/* ============================================================
   CSC Suite — Design System v2.0
   Load AFTER style.css. Overrides tokens and layout layers
   while keeping all functional component classes intact.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ============================================================
   1. DESIGN TOKENS  (override style.css :root)
   ============================================================ */
:root {
    /* Sidebar */
    --sidebar-bg:           #04101f;
    --sidebar-width:        256px;
    --sidebar-border:       rgba(255,255,255,0.07);
    --sidebar-text:         #8892a4;
    --sidebar-active-bg:    rgba(0,74,145,0.18);
    --sidebar-active-text:  #ffffff;
    --sidebar-active-bar:   #004A91;
    --sidebar-hover-bg:     rgba(255,255,255,0.05);
    --sidebar-hover-text:   #c4cdd9;

    /* Brand gradient */
    --brand-gradient:       linear-gradient(135deg, #004A91 0%, #0066CC 100%);

    /* Content surfaces */
    --content-bg:           #f0f4f8;
    --surface:              #ffffff;
    --surface-2:            #f7f9fc;
    --border:               #e2e8f0;
    --border-subtle:        #f0f4f8;

    /* Primary */
    --primary:              #004A91;
    --primary-dark:         #003270;
    --primary-light:        rgba(0,74,145,0.09);
    --primary-ring:         rgba(0,74,145,0.22);

    /* Semantic */
    --success:              #10b981;
    --success-dark:         #059669;
    --success-light:        rgba(16,185,129,0.1);
    --danger:               #ef4444;
    --danger-dark:          #dc2626;
    --danger-light:         rgba(239,68,68,0.1);
    --warning:              #f59e0b;
    --warning-dark:         #d97706;
    --warning-light:        rgba(245,158,11,0.1);
    --info:                 #06b6d4;
    --info-light:           rgba(6,182,212,0.1);

    /* Legacy aliases — kept so existing JS and page-specific CSS keeps working */
    --primary-blue:         var(--primary);
    --primary-dark-blue:    #003270;
    --secondary-green:      var(--success);
    --secondary-dark-green: var(--success-dark);
    --danger-red:           var(--danger);
    --warning-yellow:       var(--warning);
    --info-cyan:            var(--info);
    --light-gray:           var(--surface-2);
    --medium-gray:          var(--border);
    --dark-gray:            #64748b;
    --text-dark:            #0f172a;
    --text-light:           #ffffff;
    --body-bg:              var(--content-bg);
    --card-shadow:          0 1px 4px rgba(0,0,0,0.06), 0 6px 20px rgba(0,0,0,0.05);
    --card-radius:          14px;

    /* Typography */
    --text-primary:         #0d1b2a;
    --text-secondary:       #475569;
    --text-muted:           #94a3b8;

    /* Layout */
    --topbar-height:        60px;

    /* Motion */
    --ease-fast:            150ms cubic-bezier(0.4, 0, 0.2, 1);
    --ease-base:            260ms cubic-bezier(0.4, 0, 0.2, 1);
    --ease-slow:            420ms cubic-bezier(0.4, 0, 0.2, 1);
    --spring:               cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================================
   2. GLOBAL BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

body, body.app-body {
    font-family: 'Inter', 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--content-bg);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Page-load progress bar */
body.app-body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2.5px;
    background: var(--brand-gradient);
    z-index: 9999;
    opacity: 0;
    animation: pageBar 0.7s ease forwards;
}
@keyframes pageBar {
    0%   { width: 0; opacity: 1; }
    75%  { width: 85%; opacity: 1; }
    100% { width: 100%; opacity: 0; }
}

/* ============================================================
   3. APP SHELL — two-column layout (sidebar + content)
   ============================================================ */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ============================================================
   3a. SHELL LOADING — sidebar-first skeleton system
   ============================================================ */

/* Shimmer keyframe */
@keyframes sk-shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position:  600px 0; }
}

/* Generic skeleton block */
.sk-block {
    border-radius: 8px;
    background: linear-gradient(
        90deg,
        var(--border) 25%,
        var(--surface-2) 50%,
        var(--border) 75%
    );
    background-size: 600px 100%;
    animation: sk-shimmer 1.4s infinite linear;
}

/* Full-page skeleton overlay that sits over the content area */
#shellSkeleton {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    background: var(--content-bg);
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 0;
    transition: opacity 280ms ease, visibility 280ms ease;
}
/* Topbar placeholder */
#shellSkeleton .sk-topbar {
    height: var(--topbar-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 12px;
    flex-shrink: 0;
}
#shellSkeleton .sk-topbar .sk-block { height: 22px; border-radius: 6px; }
#shellSkeleton .sk-topbar .sk-title  { width: 140px; }
#shellSkeleton .sk-topbar .sk-badge  { width: 120px; margin-left: auto; }

/* Content body placeholder */
#shellSkeleton .sk-body {
    flex: 1;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    overflow: hidden;
}
#shellSkeleton .sk-row {
    display: flex;
    gap: 16px;
}
#shellSkeleton .sk-card {
    flex: 1;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
#shellSkeleton .sk-card .sk-block { height: 13px; width: 100%; }
#shellSkeleton .sk-card .sk-block:first-child { width: 55%; height: 16px; }
#shellSkeleton .sk-card .sk-block:nth-child(2) { width: 80%; }
#shellSkeleton .sk-card .sk-block:nth-child(3) { width: 65%; }
#shellSkeleton .sk-card .sk-block:nth-child(4) { width: 70%; }

/* Footer placeholder */
#shellSkeleton .sk-footer {
    height: 44px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

/* Sidebar skeleton — shown before sidebar JS injects the real one */
#sidebarSkeleton {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 0;
    border-right: 1px solid var(--sidebar-border);
    transition: opacity 280ms ease, visibility 280ms ease;
}
#sidebarSkeleton .sk-sb-header {
    height: 65px;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    padding: 0 14px;
    gap: 10px;
}
#sidebarSkeleton .sk-sb-icon {
    width: 36px; height: 36px;
    border-radius: 9px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.08);
    animation: sk-shimmer 1.4s infinite linear;
    background-size: 600px 100%;
}
#sidebarSkeleton .sk-sb-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
#sidebarSkeleton .sk-sb-text span {
    display: block;
    height: 10px;
    border-radius: 5px;
    background: rgba(255,255,255,0.08);
    animation: sk-shimmer 1.4s infinite linear;
    background-size: 600px 100%;
}
#sidebarSkeleton .sk-sb-text span:first-child { width: 80%; }
#sidebarSkeleton .sk-sb-text span:last-child  { width: 55%; }
#sidebarSkeleton .sk-sb-nav {
    flex: 1;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
#sidebarSkeleton .sk-sb-item {
    height: 36px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    animation: sk-shimmer 1.4s infinite linear;
    background-size: 600px 100%;
}
#sidebarSkeleton .sk-sb-footer {
    height: 52px;
    border-top: 1px solid var(--sidebar-border);
}

/* When shell is ready — fade out skeletons, reveal real content */
body.shell-ready #shellSkeleton,
body.shell-ready #sidebarSkeleton {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Sidebar slides in cleanly */
.sidebar {
    opacity: 0;
    transition: opacity 220ms ease, transform var(--ease-base);
}
body.shell-ready .sidebar { opacity: 1; }

/* Page content fades in after shell is ready */
.page-container,
.mini-footer {
    opacity: 0;
    transition: opacity 300ms ease 80ms; /* slight delay so sidebar appears first */
}
body.shell-ready .page-container,
body.shell-ready .mini-footer { opacity: 1; }



.main-content {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--content-bg);
    transition: margin-left var(--ease-base);
}

/* ============================================================
   4. SIDEBAR
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    border-right: 1px solid var(--sidebar-border);
    overflow: hidden;
    transition: transform var(--ease-base);
}

/* — Brand header — */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 14px 14px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    overflow: hidden;
    text-decoration: none;
}

.sidebar-brand-icon {
    width: 36px; height: 36px;
    background: var(--brand-gradient);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(0,74,145,0.40);
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow: hidden;
}

.sidebar-brand-name {
    font-size: 14.5px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1;
    white-space: nowrap;
}

.sidebar-brand-sub {
    font-size: 10.5px;
    color: var(--sidebar-text);
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-close-btn {
    display: none; /* shown on mobile via media query */
    background: none;
    border: none;
    color: var(--sidebar-text);
    cursor: pointer;
    width: 28px; height: 28px;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background var(--ease-fast), color var(--ease-fast);
    flex-shrink: 0;
    font-size: 14px;
}
.sidebar-close-btn:hover { background: var(--sidebar-hover-bg); color: #fff; }

/* — Section labels — */
.sidebar-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.22);
    padding: 18px 16px 5px;
    user-select: none;
}

.sidebar-divider {
    height: 1px;
    background: var(--sidebar-border);
    margin: 6px 14px;
}

/* — Nav items — */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px 9px 14px;
    margin: 1px 8px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--sidebar-text);
    font-size: 13px;
    font-weight: 500;
    transition: background var(--ease-fast), color var(--ease-fast);
    position: relative;
    cursor: pointer;
    user-select: none;
}

.sidebar-nav-item:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-hover-text);
}

.sidebar-nav-item.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 600;
}

.sidebar-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 6px; bottom: 6px;
    width: 3px;
    background: var(--sidebar-active-bar);
    border-radius: 0 2px 2px 0;
}

.sidebar-nav-item.locked {
    opacity: 0.3;
    cursor: not-allowed;
}
.sidebar-nav-item.locked:hover { background: none; color: var(--sidebar-text); }

.nav-icon {
    font-size: 14px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}
.nav-label { flex: 1; white-space: nowrap; }
.nav-lock { font-size: 10px; opacity: 0.7; }

/* — User footer — */
.sidebar-footer {
    flex-shrink: 0;
    padding: 10px 12px;
    border-top: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 1;
    overflow: hidden;
}

.sidebar-user-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--brand-gradient);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    flex: 1;
}

.sidebar-user-name {
    font-size: 12.5px;
    font-weight: 600;
    color: #e2e8f0;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 9.5px;
    font-weight: 700;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 10px;
    display: inline-block;
    width: fit-content;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.sidebar-user-role.owner { background: rgba(0,74,145,0.22); color: #a8c8f0; }
.sidebar-user-role.staff { background: rgba(16,185,129,0.2); color: #6ee7b7; }

.sidebar-logout-btn {
    background: none;
    border: none;
    color: #475569;
    cursor: pointer;
    width: 30px; height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 14px;
    transition: background var(--ease-fast), color var(--ease-fast);
    flex-shrink: 0;
}
.sidebar-logout-btn:hover { background: rgba(239,68,68,0.12); color: var(--danger); }

/* Full-width logout button (replaces user info block) */
.sidebar-logout-full {
    width: 100%;
    height: auto;
    padding: 9px 14px;
    gap: 9px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    color: var(--sidebar-text);
    letter-spacing: 0.01em;
}
.sidebar-logout-full:hover { background: rgba(239,68,68,0.14); color: #f87171; }

/* — Overlay (mobile) — */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--ease-base);
    backdrop-filter: blur(2px);
}
.sidebar-overlay.visible { opacity: 1; pointer-events: all; }

/* ============================================================
   5. PAGE TOPBAR
   ============================================================ */
.page-topbar {
    height: var(--topbar-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px 0 20px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 0 var(--border);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-menu-btn {
    display: none; /* shown only on mobile */
    background: none;
    border: none;
    cursor: pointer;
    width: 36px; height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 15px;
    transition: background var(--ease-fast), color var(--ease-fast);
}
.topbar-menu-btn:hover { background: var(--surface-2); color: var(--text-primary); }

.page-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.02em;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    font-size: 13px;
    position: relative;
    user-select: none;
    transition: background var(--ease-fast), border-color var(--ease-fast);
}
.user-badge:hover,
.user-badge.badge-open {
    background: var(--surface);
    border-color: var(--primary);
}

.topbar-user-avatar {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--brand-gradient);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.topbar-user-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.topbar-user-role {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.topbar-user-role.owner { background: rgba(0,74,145,0.1); color: var(--primary); }
.topbar-user-role.staff { background: var(--success-light); color: var(--success); }

/* Badge caret icon */
.topbar-badge-caret {
    font-size: 9px;
    color: var(--text-secondary);
    transition: transform var(--ease-fast);
    flex-shrink: 0;
}
.user-badge.badge-open .topbar-badge-caret { transform: rotate(180deg); }

/* Badge dropdown menu */
.topbar-badge-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    min-width: 160px;
    z-index: 300;
    overflow: hidden;
    animation: dropdownPop 0.14s var(--spring, ease-out);
}
.topbar-badge-dropdown.open { display: block; }

@keyframes dropdownPop {
    from { opacity: 0; transform: translateY(-6px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.topbar-badge-menu-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    transition: background var(--ease-fast), color var(--ease-fast);
}
.topbar-badge-menu-item:hover {
    background: rgba(0,74,145,0.09);
    color: var(--primary);
}
.topbar-badge-menu-item i { width: 14px; text-align: center; font-size: 12px; }

/* ============================================================
   6. PAGE CONTAINER — override old centering
   ============================================================ */
.page-container {
    padding: 24px;
    margin: 0;
    max-width: none;
    flex: 1;
}

/* ============================================================
   7. MINI FOOTER
   ============================================================ */
.mini-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 11px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 6px;
    /* Always align with main content, not the sidebar */
    margin-left: var(--sidebar-width);
    transition: margin-left var(--ease-base);
}
.mini-footer p { margin: 0; }
.mini-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.mini-footer a:hover { text-decoration: underline; }

/* Version badge in mini-footer */
.footer-version-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    font-family: 'Inter', 'Poppins', monospace;
}

/* Groups version badge + changelog link on the right */
.footer-right-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ============================================================
   8. CARDS — refined
   ============================================================ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 24px;
}

/* ============================================================
   9. BUTTONS — refined
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    font-size: 13.5px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all var(--ease-fast);
    font-family: 'Inter', 'Poppins', sans-serif;
    letter-spacing: -0.01em;
    white-space: nowrap;
    line-height: 1.4;
}
.btn:active { transform: scale(0.97); }

.btn-primary   { background: var(--primary);  color: #fff; }
.btn-primary:hover   { background: var(--primary-dark); }

.btn-success   { background: var(--success);  color: #fff; }
.btn-success:hover   { background: var(--success-dark); }

.btn-danger    { background: var(--danger);   color: #fff; }
.btn-danger:hover    { background: var(--danger-dark); }

.btn-secondary { background: #64748b; color: #fff; }
.btn-secondary:hover { background: #475569; }

.btn-warning   { background: var(--warning);  color: #fff; }
.btn-warning:hover   { background: var(--warning-dark); }

.btn-info      { background: var(--info);     color: #fff; }
.btn-info:hover      { background: #0891b2; }

.btn-edit      { background: var(--success);  color: #fff; }
.btn-edit:hover      { background: var(--success-dark); }

.btn-pause     { background: var(--warning);  color: #fff; }
.btn-pause:hover     { background: var(--warning-dark); }

.btn-header-action { padding: 7px 14px; font-size: 13px; border-radius: 7px; }

/* ============================================================
   10. FORMS — refined
   ============================================================ */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--text-secondary);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px 13px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 13.5px;
    font-family: 'Inter', 'Poppins', sans-serif;
    box-sizing: border-box;
    transition: border-color var(--ease-fast), box-shadow var(--ease-fast);
    background: var(--surface);
    color: var(--text-primary);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

.form-group input.is-invalid { border-color: var(--danger); }
.form-group input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(239,68,68,0.18); }

/* ============================================================
   11. TABS — pill style
   ============================================================ */
.tabs-container {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
    align-items: flex-end;
    flex-wrap: nowrap;
    overflow: hidden;
}

.tab-button {
    padding: 10px 20px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    border-radius: 6px 6px 0 0;
    transition: color var(--ease-fast), border-color var(--ease-fast), background var(--ease-fast);
    font-family: 'Inter', 'Poppins', sans-serif;
}

.tab-button:hover { color: var(--primary); background: var(--primary-light); }
.tab-button.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ============================================================
   12. TABLE GLOBAL OVERRIDES
   ============================================================ */
#entryTable th, #expenseTable th, #holdTable th,
.entryTable th, .credentials-table th,
#usersTable th, #bankAccountsTable th,
#dmt-table th, #insuranceTable th,
#projectsTable th, #duesTable th {
    background: var(--surface-2);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    padding: 11px 14px;
    border-bottom: 2px solid var(--border);
}

#entryTable td, #expenseTable td, #holdTable td,
.entryTable td, .credentials-table td,
#usersTable td, #bankAccountsTable td,
#dmt-table td, #insuranceTable td,
#projectsTable td, #duesTable td {
    padding: 10px 14px;
    font-size: 13.5px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

/* Table row hover */
#entryTable tbody tr:hover,
#expenseTable tbody tr:hover,
#holdTable tbody tr:hover,
#dmt-table tbody tr:hover,
#insuranceTable tbody tr:hover,
#projectsTable tbody tr:hover,
#duesTable tbody tr:hover {
    background: var(--surface-2);
}

/* Table action buttons — inline row */
.table-actions {
    display: flex;
    flex-direction: row;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}
.table-actions .btn {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 6px;
    width: auto;
}

/* ============================================================
   13. MODAL — refined
   ============================================================ */
.modal-content {
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 16px;
    animation: modalPop 0.24s var(--spring);
}

@keyframes modalPop {
    0%   { opacity: 0; transform: scale(0.94) translateY(10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header { border-bottom: 1px solid var(--border); padding-bottom: 14px; }
.modal-header h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary); }
.close-btn { color: var(--text-muted); font-size: 26px; transition: color var(--ease-fast); }
.close-btn:hover { color: var(--text-primary); }

/* ============================================================
   14. PAYMENT MODES
   ============================================================ */
.payment-modes {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 10px;
}

.payment-modes button {
    padding: 12px;
    border-radius: 9px;
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    cursor: pointer;
    font-weight: 600;
    font-size: 13.5px;
    transition: all var(--ease-fast);
    color: var(--text-primary);
    font-family: 'Inter', 'Poppins', sans-serif;
}
.payment-modes button:hover { border-color: var(--primary); color: var(--primary); }
.payment-modes button.active { background: var(--primary); color: #fff; border-color: var(--primary-dark); }

/* Grand total section */
.grand-total-section {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(0,74,145,0.07), rgba(0,50,112,0.03));
    border-radius: 10px;
    border: 1px solid rgba(0,74,145,0.15);
    margin: 10px 0 18px;
}
.grand-total-section label {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary);
    margin: 0;
}
.grand-total-section input {
    width: 200px;
    font-weight: 800;
    font-size: 26px;
    color: var(--text-primary);
    border: none;
    background: transparent;
    text-align: right;
    padding: 0;
    letter-spacing: -0.02em;
    outline: none;
    box-shadow: none;
}

/* ============================================================
   15. DASHBOARD REDESIGN
   ============================================================ */

/* Hide the old header — layout.js topbar replaces it */
.page-header { display: none !important; }

/* Hide old heavy footer on every page */
.main-footer { display: none !important; }

/* Nav grid — quick access module cards */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px,1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.nav-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: 18px 16px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 13.5px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    transition: all var(--ease-base);
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
}

.nav-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: var(--brand-gradient);
    opacity: 0;
    transition: opacity var(--ease-fast);
}

.nav-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 34px rgba(0,74,145,0.12);
    border-color: rgba(0,74,145,0.30);
    color: var(--primary);
}
.nav-card:hover::after { opacity: 1; }

/* Nav card icons (FontAwesome inside .nav-card) */
.nav-card .icon-fa {
    font-size: 22px;
    color: var(--primary);
    background: var(--primary-light);
    width: 44px; height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
    transition: background var(--ease-fast), color var(--ease-fast);
}
.nav-card:hover .icon-fa { background: var(--primary); color: #fff; }

/* Nav card text label (currently rendered as text node after icon) */
.nav-card > *:last-child { align-self: flex-start; }

/* Stats grid */
.stats-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px,1fr)) !important;
}
.stats-grid .nav-card {
    border-left: 3px solid var(--primary);
    border-radius: 0 var(--card-radius) var(--card-radius) 0;
    cursor: default;
}
.stats-grid .nav-card:hover {
    transform: none;
    border-color: var(--border);
    border-left-color: var(--primary);
    color: var(--text-primary);
    box-shadow: var(--card-shadow);
}
.stats-grid .nav-card:hover::after { opacity: 0; }

.stats-grid .nav-card:nth-child(3n+1) { border-left-color: var(--primary); }
.stats-grid .nav-card:nth-child(3n+2) { border-left-color: var(--warning); }
.stats-grid .nav-card:nth-child(3n)   { border-left-color: var(--success); }

.stats-grid .nav-card h3 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin: 0;
}
.stats-grid .nav-card p {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 4px 0 0;
    letter-spacing: -0.03em;
}

/* Dashboard greeting */
.dashboard-greeting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 8px;
}
.dashboard-greeting h2 {
    font-size: 21px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.03em;
}
.dashboard-greeting p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}
.dashboard-date {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Reports button */
.reports-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    background: var(--brand-gradient);
    color: #fff;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 22px;
    transition: all var(--ease-fast);
    box-shadow: 0 4px 16px rgba(0,74,145,0.32);
}
.reports-nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0,74,145,0.44);
    opacity: 0.95;
}

/* Section heading for separating nav cards and stats */
.dashboard-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin: 0 0 12px;
}

/* ============================================================
   16. LOGIN PAGE — complete redesign
   ============================================================ */
/* ============================================================
   LOGIN PAGE — full redesign override
   (Overrides the old two-column grid from style.css)
   ============================================================ */

/* Reset any grid layout from style.css */
.login-page-wrapper {
    display: flex;             /* overrides style.css grid (design.css loads after) */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    /* Exactly viewport height — no scroll on the page itself */
    height: 100vh;
    min-height: unset;
    background: linear-gradient(135deg, #020c1b 0%, #061428 45%, #0a1e3a 100%);
    position: relative;
    /* Clip decorative blobs, let form column handle its own scroll */
    overflow: hidden;
    box-sizing: border-box;
}

/* Ambient glow blobs */
.login-page-wrapper::before,
.login-page-wrapper::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    z-index: 0;
}
.login-page-wrapper::before {
    width: 560px; height: 560px;
    background: radial-gradient(circle, rgba(0,74,145,0.30), transparent 70%);
    top: -140px; left: -140px;
    animation: glow 9s ease-in-out infinite alternate;
}
.login-page-wrapper::after {
    width: 460px; height: 460px;
    background: radial-gradient(circle, rgba(0,50,112,0.24), transparent 70%);
    bottom: -110px; right: -110px;
    animation: glow 9s ease-in-out infinite alternate-reverse;
}
@keyframes glow {
    0%   { transform: scale(1) translate(0,0); }
    100% { transform: scale(1.25) translate(20px,-20px); }
}

/* Hide old two-column promo layout — show only the card */
.login-promo-column { display: none !important; }

/* The form column fills the full wrapper and centres the card */
.login-form-column {
    /* Take up all available space inside the flex wrapper */
    width: 100% !important;           /* override style.css grid column sizing */
    max-width: 100% !important;
    flex: 1;
    display: flex;
    justify-content: center;          /* horizontal centre */
    align-items: center;              /* vertical centre */
    /* Scroll internally if card is taller than the viewport */
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
    /* Comfortable breathing room around the card */
    padding: 20px;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.login-card {
    background: rgba(255,255,255,0.98);
    border-radius: 20px;
    padding: 38px 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.08);
    animation: loginCardIn 0.5s var(--spring);
}
@keyframes loginCardIn {
    0%   { opacity: 0; transform: translateY(20px) scale(0.97); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Login card brand section */
.login-brand-header {
    text-align: center;
    margin-bottom: 28px;
}
.login-brand-icon {
    width: 56px; height: 56px;
    background: var(--brand-gradient);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 14px;
    box-shadow: 0 8px 24px rgba(0,74,145,0.45);
}
.login-card h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 4px;
    letter-spacing: -0.03em;
}
.login-card-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

/* Login form labels */
.login-card .form-group label {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.login-card .form-group input {
    padding: 10px 13px;
    font-size: 14px;
    border-radius: 9px;
}

/* Login submit button */
.login-card button[type="submit"] {
    font-size: 14.5px;
    padding: 12px;
    border-radius: 10px;
    background: var(--brand-gradient);
    box-shadow: 0 4px 16px rgba(0,74,145,0.38);
}
.login-card button[type="submit"]:hover {
    box-shadow: 0 8px 24px rgba(0,74,145,0.50);
    transform: translateY(-2px);
}

/* Captcha box */
.captcha-math-box {
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: 9px;
    padding: 12px;
    text-align: center;
    margin-bottom: 8px;
}
.captcha-question {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.05em;
}

/* ================================================================
   LOGIN PAGE — SHORT VIEWPORT FIXES
   Reduces spacing so the card fits within 768px-tall screens
   (1366x768, 1024x768, small laptops, landscape tablets)
   The form column scrolls internally if content still overflows.
   ================================================================ */

/* Screens ≤ 800px tall — tighten card & elements */
@media (max-height: 800px) {
    .login-form-column {
        /* Switch to top-alignment so card is reachable by scrolling down */
        align-items: flex-start;
        padding: 16px 20px;
    }
    .login-card {
        padding: 24px 28px;
    }
    .login-brand-header {
        margin-bottom: 16px;
    }
    .login-brand-icon {
        width: 44px;
        height: 44px;
        font-size: 20px;
        margin-bottom: 10px;
    }
    .login-card h2 {
        font-size: 19px;
    }
    .login-card-subtitle {
        font-size: 12px;
    }
    .login-card .form-group {
        margin-bottom: 14px;
    }
    .login-card .form-group label {
        margin-bottom: 4px;
    }
    .login-card .form-group input {
        padding: 9px 12px;
        font-size: 13.5px;
    }
    .captcha-math-box {
        padding: 9px 12px;
        margin-bottom: 4px;
    }
    .captcha-question {
        font-size: 18px;
    }
    .login-card button[type="submit"] {
        font-size: 13.5px;
        padding: 10px;
    }
}

/* Screens ≤ 680px tall — compact to bare minimum */
@media (max-height: 680px) {
    .login-form-column {
        padding: 10px 20px;
    }
    .login-card {
        padding: 16px 20px;
    }
    .login-brand-header {
        margin-bottom: 10px;
    }
    .login-brand-icon {
        width: 36px;
        height: 36px;
        font-size: 17px;
        margin-bottom: 6px;
        border-radius: 10px;
    }
    .login-card h2 {
        font-size: 17px;
    }
    .login-card-subtitle {
        font-size: 11.5px;
    }
    .login-card .form-group {
        margin-bottom: 10px;
    }
    .login-card .form-group label {
        margin-bottom: 3px;
        font-size: 10.5px;
    }
    .login-card .form-group input {
        padding: 7px 10px;
        font-size: 13px;
    }
    .captcha-math-box {
        padding: 7px 10px;
        margin-bottom: 3px;
    }
    .captcha-question {
        font-size: 15px;
    }
    .login-card button[type="submit"] {
        font-size: 13px;
        padding: 9px;
    }
    .login-card form > p {
        margin-top: 8px !important;
    }
    #pwa-install-banner {
        margin-top: 10px !important;
    }
}

/* ============================================================
   17. ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.animate-fade-in-up { animation: fadeIn 0.4s ease-out forwards; }
.tab-content.active  { animation: fadeIn 0.28s ease-out; }

/* ============================================================
   20. EXPENSE CATEGORY TAGS & SUBMISSION TOAST
   ============================================================ */

/* Category pill tag — colors are set inline via JS */
.expense-cat-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    line-height: 1.6;
}

/* Submission toast container (injected by JS) */
.expense-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    min-width: 260px;
    max-width: 340px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.22);
    pointer-events: auto;
    /* Start hidden and shifted right */
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.expense-toast-show {
    opacity: 1;
    transform: translateX(0);
}
.expense-toast-success {
    background: linear-gradient(135deg, #166534 0%, #15803d 100%);
    color: #dcfce7;
    border: 1px solid rgba(134,239,172,0.25);
}
.expense-toast-success i { color: #86efac; font-size: 18px; }

.expense-toast-error {
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
    color: #fee2e2;
    border: 1px solid rgba(252,165,165,0.25);
}
.expense-toast-error i { color: #fca5a5; font-size: 18px; }



/* ============================================================
   19. INSURANCE REMINDERS PANEL
   ============================================================ */

/* Two-column layout wrapper */
.dashboard-two-col {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
}

.dashboard-main-col { min-width: 0; }

/* Reminders column wrapper — title + panel */
.dashboard-reminders-col {
    min-width: 0;
}

/* Panel container */
.insurance-reminders-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: sticky;
    top: calc(var(--topbar-height) + 16px);
    max-height: calc(100vh - var(--topbar-height) - 40px);
}

/* Panel header */
.irp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.irp-header-left {
    display: flex;
    align-items: center;
    gap: 11px;
}

.irp-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 15px;
    flex-shrink: 0;
}

.irp-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.irp-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    margin: 2px 0 0;
}

/* Count badge */
.irp-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.irp-count-badge.danger  { background: var(--danger-light);  color: var(--danger); }
.irp-count-badge.warning { background: var(--warning-light); color: var(--warning-dark); }
.irp-count-badge.info    { background: var(--info-light);    color: var(--info); }

/* Scrollable list */
.irp-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    min-height: 120px;
}
.irp-list::-webkit-scrollbar { width: 4px; }
.irp-list::-webkit-scrollbar-track { background: transparent; }
.irp-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Individual reminder card */
.irp-card {
    display: flex;
    border-radius: 9px;
    border: 1px solid var(--border);
    overflow: hidden;
    background: var(--surface-2);
    transition: box-shadow var(--ease-fast), transform var(--ease-fast);
    animation: fadeIn 0.32s ease-out both;
}

.irp-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.07);
    transform: translateY(-1px);
}

/* Left accent bar */
.irp-card-accent {
    width: 4px;
    flex-shrink: 0;
}

.irp-overdue  .irp-card-accent { background: var(--danger); }
.irp-today    .irp-card-accent { background: var(--warning); }
.irp-upcoming .irp-card-accent { background: var(--primary); }

/* Card body */
.irp-card-body {
    padding: 10px 11px;
    flex: 1;
    min-width: 0;
}

.irp-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 6px;
}

.irp-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

/* Urgency badge */
.irp-urgency-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.irp-badge-overdue  { background: var(--danger-light);  color: var(--danger); }
.irp-badge-today    { background: var(--warning-light); color: var(--warning-dark); }
.irp-badge-upcoming { background: var(--primary-light); color: var(--primary); }

/* Meta row */
.irp-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
}

.irp-meta-item {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.irp-meta-item i { font-size: 10px; }

/* Empty state */
.irp-empty {
    padding: 28px 20px;
    text-align: center;
    animation: fadeIn 0.32s ease-out;
}

.irp-empty-icon {
    font-size: 30px;
    color: var(--success);
    margin-bottom: 10px;
}

.irp-empty-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.irp-empty-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

/* Skeleton loader */
.irp-skeleton {
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.irp-skel-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--border) 25%, var(--border-subtle) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}
.irp-skel-line.wide   { width: 80%; }
.irp-skel-line.medium { width: 55%; }
.irp-skel-line.short  { width: 40%; }

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* View-all footer link */
.irp-view-all-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    background: var(--surface);
    transition: background var(--ease-fast), color var(--ease-fast);
    flex-shrink: 0;
}
.irp-view-all-btn:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* ============================================================
   18. RESPONSIVE
   ============================================================ */

/* Tablet — collapse sidebar */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 4px 0 30px rgba(0,0,0,0.35);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-close-btn { display: flex !important; }

    .main-content { margin-left: 0 !important; }
    .mini-footer { margin-left: 0 !important; }
    .topbar-menu-btn { display: flex !important; }

    body.app-body::after { left: 0; }

    /* Collapse reminders panel to full-width below sidebar breakpoint */
    .dashboard-two-col {
        grid-template-columns: 1fr;
    }
    .insurance-reminders-panel {
        position: static;
        max-height: none;
    }
    .irp-list { max-height: 320px; }
}

/* Mobile */
@media (max-width: 768px) {
    :root { --sidebar-width: 280px; }

    .page-container { padding: 14px; }
    .page-topbar { padding: 0 14px; }
    .page-title { font-size: 14.5px; }

    .nav-grid { grid-template-columns: repeat(2,1fr); gap: 10px; }
    .stats-grid { grid-template-columns: repeat(2,1fr) !important; }

    .form-grid { grid-template-columns: 1fr !important; }
    .payment-modes { grid-template-columns: repeat(2,1fr); }

    .modal-content { width: 97%; border-radius: 12px; }

    .table-actions { flex-direction: column; }
    .table-actions .btn { width: 100%; }

    .login-card { padding: 28px 20px; }

    .mini-footer { flex-direction: column; gap: 5px; text-align: center; }

    .cash-grid { grid-template-columns: 1fr !important; }

    /* Insurance reminders panel — compact on mobile */
    .dashboard-two-col { gap: 14px; }
    .irp-list { max-height: 260px; }
    .irp-card-meta { flex-direction: column; gap: 3px; }
}

@media (max-width: 480px) {
    .nav-grid { grid-template-columns: repeat(2,1fr); gap: 8px; }
    .nav-card { padding: 14px 12px; font-size: 12.5px; }
    .nav-card .icon-fa { width: 36px; height: 36px; font-size: 18px; }
    .stats-grid { grid-template-columns: 1fr !important; }
    .page-title { font-size: 13.5px; }
}
