:root {
  --primary-blue: #1e4f8a;
  --secondary-blue: #2c6eb5;
  --bg-light: #f4f7fa;
  --white: #ffffff;
  --text-main: #2d3748;
  --text-muted: #718096;
  --border-color: #e2e8f0;
  --success: #10b981;
  --info: #3b82f6;
  --warning: #f59e0b;
  --danger: #ef4444;
  --card-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --hover-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --transition: all 0.3s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background-color: var(--bg-light);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
}

/* Nav Styles */
.navbar {
  background-color: var(--white);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--primary-blue);
  text-decoration: none;
  font-size: 1.25rem;
}

.navbar-brand img {
  height: 36px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.05));
}

.nav-links {
  display: flex;
  gap: 20px;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background-color: var(--primary-blue);
  transition: all 0.3s ease;
  transform: translateX(-50%);
  border-radius: 3px 3px 0 0;
  opacity: 0;
}

.nav-link:hover {
  color: var(--primary-blue);
  background-color: #f1f5f9;
}

.nav-link.active {
  color: var(--primary-blue);
  background-color: rgba(30, 79, 138, 0.05);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 60%;
  opacity: 1;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

/* Container */
.main-container {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Dashboard Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.page-title h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

.page-title p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.stat-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 1.5rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-info {
    text-align: left;
}

.stat-info .label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 0.25rem;
}

.stat-info .value {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
    margin-bottom: 1rem;
}

.stat-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Specific Card Themes */
.stat-final .stat-icon { background: #dcfce7; color: #10b981; }
.stat-approved .stat-icon { background: #dbeafe; color: #3b82f6; }
.stat-pending .stat-icon { background: #fff7ed; color: #f59e0b; }
.stat-rejected .stat-icon { background: #fee2e2; color: #ef4444; }
.stat-accountable .stat-icon { background: #eff6ff; color: #2563eb; }

.stat-final .stat-status { color: #10b981; }
.stat-approved .stat-status { color: #3b82f6; }
.stat-pending .stat-status { color: #f59e0b; }
.stat-rejected .stat-status { color: #ef4444; }
.stat-accountable .stat-status { color: #2563eb; }

/* Dashboard Layout Mixins */
.dashboard-summary {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: var(--white);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.chart-placeholder {
    height: 200px;
    width: 200px;
    margin: 2rem auto;
    border-radius: 50%;
    border: 15px solid var(--primary-blue);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-placeholder::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 15px solid #e2e8f0;
    border-left-color: transparent;
    border-bottom-color: transparent;
    transform: rotate(45deg);
}

/* Table Section */
.content-card {
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
}

.table-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.search-input {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  width: 250px;
  font-size: 0.9rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: inherit;
}

th {
  text-align: left;
  padding: 1.25rem 1rem;
  border-bottom: 2px solid var(--border-color);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

th.sortable {
  cursor: pointer;
  position: relative;
  user-select: none;
  padding-right: 1.5rem;
  transition: all 0.2s ease;
}

th.sortable:hover {
  color: var(--primary-blue);
  background-color: rgba(248, 250, 252, 0.8);
}

th.sortable::after {
  content: '\f0dc'; /* fa-sort */
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  color: #cbd5e1;
  opacity: 0.3;
  transition: all 0.2s ease;
}

th.sortable:hover::after {
  opacity: 0.8;
  color: var(--primary-blue);
}

th.sortable.asc::after {
  content: '\f0de'; /* fa-sort-up */
  opacity: 1;
  color: var(--primary-blue);
}

th.sortable.desc::after {
  content: '\f0dd'; /* fa-sort-down */
  opacity: 1;
  color: var(--primary-blue);
}

@media print {
  th.sortable::after {
    display: none !important;
  }
}


td {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
  font-weight: 500;
  color: #334155;
  vertical-align: middle;
}

tr:hover td {
  background-color: #f8fafc;
}

.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-final {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}
.badge-pending {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

/* Buttons */
.btn {
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.btn-primary {
  background-color: var(--primary-blue);
  color: var(--white);
}

.btn-primary:hover {
  background-color: var(--secondary-blue);
  box-shadow: var(--hover-shadow);
}

/* Secondary / Inline Links */
.action-link {
  color: #64748b;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  padding: 4px 8px;
  border-radius: 6px;
}

.action-link:hover {
  color: var(--primary-blue);
  background: rgba(30, 79, 138, 0.05);
  transform: translateX(-2px);
}

.action-link.forward:hover {
  transform: translateX(2px);
}

/* Login Page Styles */
/* New Modern Auth Styles */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    background-image: 
        radial-gradient(at 0% 0%, hsla(215, 98%, 61%, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, hsla(125, 98%, 72%, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, hsla(258, 98%, 79%, 0.1) 0px, transparent 50%),
        radial-gradient(at 0% 100%, hsla(339, 98%, 79%, 0.1) 0px, transparent 50%);
    position: relative;
    overflow: hidden;
    padding: 20px;
}

.auth-wrapper::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%233b82f6' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    z-index: 0;
}

.auth-card {
    display: flex;
    width: 100%;
    max-width: 960px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.1);
    z-index: 1;
    min-height: 580px;
}

.auth-left {
    flex: 0 0 42%;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

/* Wavy separator effect */
.auth-left::after {
    display: none;
}

.auth-left h3 {
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 2px;
    margin-bottom: 30px;
    opacity: 0.9;
}

.auth-brand-logo {
    width: fit-content;
    min-width: 90px;
    height: 90px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    padding: 12px 20px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.auth-brand-logo img {
    max-width: 100%;
    max-height: 100%;
}

.auth-left h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.auth-left p {
    font-size: 0.85rem;
    line-height: 1.6;
    opacity: 0.8;
}

.auth-right {
    flex: 1;
    background: #ffffff;
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.auth-right::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(59, 130, 246, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.02) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}

.auth-right h4 {
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    color: #475569;
    margin-bottom: 40px;
}

.modern-form-group {
    margin-bottom: 25px;
    position: relative;
}

.modern-form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 5px;
}

.modern-input {
    width: 100%;
    border: none;
    border-bottom: 2px solid #e2e8f0;
    background: transparent;
    padding: 12px 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: #1e293b;
    transition: all 0.3s ease;
    border-radius: 0;
}

.modern-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.modern-input:focus {
    outline: none;
    border-bottom-color: #0f172a;
    padding-left: 8px;
}

.forgot-password {
    text-align: right;
    margin-top: -15px;
    margin-bottom: 30px;
}

.forgot-password a {
    font-size: 0.8rem;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.modern-btn {
    width: 100%;
    background: #0f172a;
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.2);
}

.modern-btn:hover {
    background: #1e4f8a;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.3);
}

.auth-footer-text {
    text-align: center;
    margin-top: 40px;
    font-size: 0.85rem;
    color: #64748b;
}

.auth-footer-text a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 700;
}

@media (max-width: 768px) {
    .auth-card {
        flex-direction: column;
    }
    .auth-left {
        flex: none;
        padding: 40px 20px;
    }
    .auth-left::after {
        display: none;
    }
    .auth-right {
        padding: 40px 30px;
    }
}
/* Consolidated Logo Styling */
.auth-brand-logo img {
    max-width: 70px;
    max-height: 70px;
    width: auto;
    height: auto;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

/* Forms & Form Controls */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label,
label {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    line-height: 1.5;
    color: var(--text-main);
    background-color: var(--white);
    background-clip: padding-box;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    transition: var(--transition);
}

.form-control:focus {
    color: var(--text-main);
    background-color: var(--white);
    border-color: var(--primary-blue);
    outline: 0;
    box-shadow: 0 0 0 4px rgba(30, 79, 138, 0.12);
}

.form-control::placeholder {
    color: #94a3b8;
    opacity: 1;
}

.form-control:disabled, .form-control[readonly] {
    background-color: #f1f5f9;
    opacity: 1;
    color: #475569;
}

select.form-control {
    appearance: none;
    -moz-appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
    cursor: pointer;
}

textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

/* Customizing the table to handle compact forms */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

td .form-control {
    padding: 0.5rem 0.75rem;
}

/* Flash Toast Notifications */
.alert {
    position: relative;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    animation: slideInDown 0.4s ease forwards;
    border: 1px solid transparent;
}

.alert-title {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.alert-message {
    font-size: 0.95rem;
    font-weight: 500;
}

.alert-icon {
    font-size: 1.5rem;
}

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.5;
    transition: 0.2s;
}
.alert-close:hover {
    opacity: 1;
}

.alert-success {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}
.alert-success .alert-icon, .alert-success .alert-close { color: #15803d; }

.alert-danger {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}
.alert-danger .alert-icon, .alert-danger .alert-close { color: #b91c1c; }

.alert-warning {
    background-color: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}
.alert-warning .alert-icon, .alert-warning .alert-close { color: #b45309; }

.alert-info {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #1e3a8a;
}
.alert-info .alert-icon, .alert-info .alert-close { color: #1d4ed8; }

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   RESPONSIVE UTILITY CLASSES
   ============================================================ */

/* Generic 2-col form/layout grid */
.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* Auto-fit grid */
.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

/* Flex row that stacks on mobile */
.flex-responsive {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ============================================================
   MOBILE & RESPONSIVE STYLES
   ============================================================ */

/* Prevent body scroll when mobile menu is open */
body.no-scroll {
    overflow: hidden;
}

/* Hamburger Button */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    padding: 6px;
    transition: var(--transition);
    margin-left: auto;
}

.hamburger-btn:hover {
    background: #f1f5f9;
}

.hamburger-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: var(--transition);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1099;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.open {
    display: block;
    opacity: 1;
}

/* Mobile Navigation Drawer */
.mobile-nav-drawer {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    max-width: 85vw;
    height: 100%;
    background: var(--white);
    z-index: 1100;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-nav-drawer.open {
    right: 0;
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 1;
}

.mobile-nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1.25rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 0;
    flex: 1;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.875rem 1.25rem;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.mobile-nav-link:hover {
    color: var(--primary-blue);
    background: rgba(30, 79, 138, 0.05);
    border-left-color: var(--primary-blue);
}

.mobile-nav-link i {
    width: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 1rem;
}

.mobile-nav-link:hover i {
    color: var(--primary-blue);
}

.mobile-nav-footer {
    padding: 0.75rem 0;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

@media (max-width: 768px) {

    .navbar {
        padding: 0.75rem 1rem;
        flex-wrap: nowrap;
    }

    .navbar-brand span {
        display: none;
    }

    .nav-links {
        display: none;
    }

    .user-profile {
        display: none;
    }

    .hamburger-btn {
        display: flex;
    }

    .main-container {
        padding: 1rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1.25rem;
    }

    .page-title h1 {
        font-size: 1.2rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-bottom: 1.25rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-info .value {
        font-size: 1.6rem;
    }

    .dashboard-summary {
        grid-template-columns: 1fr;
    }

    .content-card {
        padding: 1rem;
        border-radius: 10px;
    }

    .table-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .search-input {
        width: 100%;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 560px;
    }

    .auth-card {
        flex-direction: column;
        min-height: unset;
        border-radius: 16px;
    }

    .auth-left {
        flex: none;
        padding: 30px 20px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .auth-right {
        padding: 30px 20px;
    }

    footer {
        padding: 1.25rem 1rem !important;
        font-size: 0.78rem !important;
    }

    /* Responsive utility class overrides */
    .grid-2col {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .flex-responsive {
        flex-direction: column;
    }

    /* Modal sizing */
    .modal-box {
        width: 90vw !important;
        max-width: 500px !important;
        margin: 5% auto !important;
    }
}


@media (max-width: 480px) {

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-info .value {
        font-size: 1.4rem;
    }

    .auth-wrapper {
        padding: 10px;
        align-items: flex-start;
        padding-top: 20px;
    }

    .auth-card {
        border-radius: 12px;
    }

    .auth-left h1 {
        font-size: 1.3rem;
    }

    .auth-right {
        padding: 24px 16px;
    }

    .page-title h1 {
        font-size: 1.05rem;
    }

    .main-container {
        padding: 0.75rem;
    }

    td, th {
        font-size: 0.8rem;
        padding: 0.75rem 0.5rem;
    }

    .alert {
        padding: 0.75rem 1rem;
        font-size: 0.88rem;
    }

    .alert-icon {
        font-size: 1.1rem;
    }
}

@media print {
    .hamburger-btn,
    .mobile-nav-drawer,
    .mobile-menu-overlay {
        display: none !important;
    }
}

/* Dashboard main 2-1 grid: responsive */
.dashboard-main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .dashboard-main-grid {
        grid-template-columns: 1fr;
    }
}

/* -- Inventory filter bar: wrap on mobile -- */
@media (max-width: 768px) {
    /* Make filter controls wrap */
    [style*=display: flex; align-items: center; gap: 1rem; flex-wrap: wrap] {
        gap: 0.5rem !important;
    }

    /* Make search bar full width inside controls */
    [style*=position: relative; width: 450px],
    [style*=position: relative; width: 320px] {
        width: 100% !important;
    }

    /* Inventory action buttons row: wrap */
    [style*=display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }

    /* Button groups in controls */
    [style*=display: flex; gap: 8px],
    [style*=display: flex; gap: 4px] {
        flex-wrap: wrap;
    }

    /* Make modal inner boxes fit viewport */
    [style*=width: 500px],
    [style*=width: 400px] {
        width: 90vw !important;
        max-width: 460px !important;
    }

    /* Dashboard inventory movement grid */
    [style*=display: grid; grid-template-columns: 1fr 1fr] {
        grid-template-columns: 1fr !important;
    }

    /* Report form output format row */
    [style*=display: flex; justify-content: space-between; align-items: center; padding-top: 1.5rem] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
    }

    /* Fund tabs: allow horizontal scroll */
    [style*=display: flex; align-items: center; gap: 0; border-bottom] {
        overflow-x: auto;
        padding-bottom: 2px;
    }
}

/* Legacy .card class (used in admin/ris templates) */
.card {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    .card {
        padding: 1rem;
    }
}
