/* =====================================================
   KAUSHAL CRM — PREMIUM SAAS STYLESHEET
   Design System: Inter Font · Indigo Accent · Clean Cards
   ===================================================== */

/* ============================================================
   1. CSS VARIABLES
   ============================================================ */
:root {
    /* Brand */
    --primary:        #4f46e5;
    --primary-dark:   #3730a3;
    --primary-light:  #eef2ff;
    --primary-glow:   rgba(79,70,229,0.18);

    /* Semantic */
    --success:        #10b981;
    --success-light:  #ecfdf5;
    --danger:         #ef4444;
    --danger-light:   #fef2f2;
    --warning:        #f59e0b;
    --warning-light:  #fffbeb;
    --info:           #3b82f6;
    --info-light:     #eff6ff;

    /* Surface */
    --bg:             #f0f4f8;
    --card-bg:        #ffffff;
    --sidebar-bg:     #0a0f1e;
    --sidebar-hover:  rgba(255,255,255,0.07);
    --sidebar-active: rgba(79,70,229,0.85);

    /* Text */
    --text-primary:   #0f172a;
    --text-secondary: #64748b;
    --text-muted:     #94a3b8;
    --text-white:     #f8fafc;

    /* Borders */
    --border:         #e2e8f0;
    --border-focus:   #4f46e5;

    /* Shadows */
    --shadow-xs:  0 1px 3px rgba(15,23,42,0.06);
    --shadow-sm:  0 2px 8px rgba(15,23,42,0.07);
    --shadow-md:  0 4px 20px rgba(15,23,42,0.09);
    --shadow-lg:  0 8px 36px rgba(15,23,42,0.12);
    --shadow-xl:  0 20px 60px rgba(15,23,42,0.16);

    /* Radius */
    --radius-xs:  6px;
    --radius-sm:  8px;
    --radius-md:  12px;
    --radius-lg:  16px;
    --radius-xl:  22px;
    --radius-full: 9999px;

    /* Layout */
    --sidebar-w: 220px;
    --header-h:  62px;

    /* Transitions */
    --ease: 0.22s cubic-bezier(0.4,0,0.2,1);
}

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

body {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
button { font-family: inherit; }
h1,h2,h3,h4,h5,h6 { margin: 0; font-weight: 600; line-height: 1.3; }

/* ============================================================
   3. LOGIN PAGE
   ============================================================ */
.login-body {
    margin: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #0a0f1e 0%, #1a1f3c 50%, #0e1628 100%);
    font-family: 'Inter', 'Segoe UI', sans-serif;
    position: relative;
    overflow: hidden;
}

.login-body::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(79,70,229,0.18) 0%, transparent 70%);
    top: -150px;
    left: -100px;
    pointer-events: none;
}

.login-body::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(16,185,129,0.1) 0%, transparent 70%);
    bottom: -100px;
    right: -80px;
    pointer-events: none;
}

.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    padding: 20px;
}

.login-box,
.login-container {
    width: 100%;
    max-width: 400px;
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 44px 40px;
    border-radius: var(--radius-xl);
    box-shadow: 0 30px 80px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.05);
    position: relative;
    z-index: 10;
}

.login-box h2,
.login-container h2 {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.login-box .sub,
.login-box p.sub {
    text-align: center;
    color: rgba(255,255,255,0.45);
    font-size: 13.5px;
    margin-bottom: 30px;
}

/* Login Input Groups */
.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group input {
    width: 100%;
    padding: 13px 14px 13px 14px;
    background: rgba(255,255,255,0.07);
    border: 1.5px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: #ffffff;
    transition: var(--ease);
    outline: none;
}

.input-group input::placeholder { color: rgba(255,255,255,0.3); }

.input-group input:focus {
    border-color: var(--primary);
    background: rgba(79,70,229,0.08);
    box-shadow: 0 0 0 4px rgba(79,70,229,0.15);
}

.input-group label {
    position: absolute;
    top: -9px;
    left: 12px;
    background: transparent;
    padding: 0 5px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
}

.toggle-pass {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}
.toggle-pass:hover { opacity: 1; }

.login-options {
    text-align: right;
    margin-bottom: 12px;
}
.login-options a {
    font-size: 12px;
    color: rgba(255,255,255,0.45);
    transition: color 0.2s;
}
.login-options a:hover { color: var(--primary); }

.login-btn {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.2px;
    transition: var(--ease);
    box-shadow: 0 8px 24px rgba(79,70,229,0.35);
}
.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(79,70,229,0.45);
}
.login-btn:active { transform: scale(0.98); }

.login-container button,
.login-container input[type="submit"] {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ease);
    box-shadow: 0 8px 24px rgba(79,70,229,0.3);
}
.login-container button:hover { background: var(--primary-dark); }

.login-container input {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 16px;
    border-radius: var(--radius-md);
    border: 1.5px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.07);
    font-size: 14px;
    color: #fff;
    transition: var(--ease);
    outline: none;
}
.login-container input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.login-footer,
.footer {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: rgba(255,255,255,0.3);
}

.error-msg {
    background: rgba(239,68,68,0.15);
    color: #fca5a5;
    border: 1px solid rgba(239,68,68,0.3);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
}

/* ============================================================
   4. SIDEBAR
   ============================================================ */
.sidebar {
    width: var(--sidebar-w);
    box-sizing: border-box;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    background: linear-gradient(180deg, #0a0f1e 0%, #111827 100%);
    padding: 0 0 20px 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255,255,255,0.05);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }

/* Logo */
.sidebar .logo {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 16px 15px 14px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 8px;
    text-decoration: none;
}

.sidebar .logo img {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.sidebar .logo span {
    font-size: 13.5px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.2px;
}

.sidebar h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #fff;
}

/* Nav Links */
.sidebar a {
    display: flex;
    align-items: center;
    gap: 9px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    padding: 7px 12px 7px 15px;
    border-radius: 0;
    margin: 0 8px 2px 8px;
    font-size: 12px;
    font-weight: 500;
    transition: all var(--ease);
    position: relative;
    border-radius: var(--radius-sm);
}

.sidebar a i {
    width: 16px;
    text-align: center;
    font-size: 12.5px;
    flex-shrink: 0;
    opacity: 0.75;
    transition: opacity 0.2s;
}

.sidebar a:hover {
    color: #ffffff;
    background: var(--sidebar-hover);
    transform: none;
}
.sidebar a:hover i { opacity: 1; }

.sidebar a.active {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(79,70,229,0.7), rgba(79,70,229,0.45));
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(79,70,229,0.25);
}
.sidebar a.active i { opacity: 1; }

.sidebar a.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
}

/* Logout */
.sidebar .logout {
    background: rgba(239,68,68,0.12);
    color: #fca5a5;
    margin-top: auto;
}
.sidebar .logout:hover {
    background: rgba(239,68,68,0.25);
    color: #fff;
}

/* Submenu */
.sidebar .arrow {
    margin-left: auto;
    font-size: 11px;
    opacity: 0.5;
}

.menu-item .submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    display: flex;
    flex-direction: column;
}

.menu-item.open .submenu {
    max-height: 200px;
}

.menu-item .arrow {
    transition: transform 0.3s ease;
}
.menu-item.open .arrow {
    transform: rotate(180deg);
}

.menu-item .submenu a {
    font-size: 11px;
    padding: 6px 8px 6px 30px;
    color: rgba(255,255,255,0.45);
    margin: 0 8px 1px 8px;
    border-radius: var(--radius-xs);
}
.menu-item .submenu a:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.85);
    transform: none;
}
.sidebar .active-sub {
    background: rgba(255,255,255,0.1) !important;
    color: #ffffff !important;
    font-weight: 600;
}

/* Delete badge in sidebar */
.delete-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    margin-left: 4px;
}

/* ============================================================
   5. LAYOUT — CONTENT AREA
   ============================================================ */
.content {
    margin-left: var(--sidebar-w);
    padding: 20px 22px;
    min-height: 100vh;
    background: var(--bg);
    width: calc(100% - var(--sidebar-w));
    box-sizing: border-box;
}

/* ============================================================
   6. DASHBOARD HEADER
   ============================================================ */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    gap: 16px;
    flex-wrap: wrap;
}

.mobile-menu-btn {
    display: none;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: var(--shadow-xs);
}

.dashboard-title-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
}

.dashboard-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.role-badge {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.update-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(245,158,11,0.3);
    transition: var(--ease);
    white-space: nowrap;
}
.update-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(245,158,11,0.4);
}

/* Clock */
.header-clock {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: var(--shadow-xs);
    flex-shrink: 0;
}

#liveClock {
    color: var(--primary);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

#liveDate { color: var(--text-secondary); font-size: 13px; }
.clock-divider { color: var(--border); font-weight: 300; }

/* ============================================================
   7. DASHBOARD GRID / TOP
   ============================================================ */
.dashboard-grid { display: block; width: 100%; }

.dashboard-top {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    flex-wrap: wrap;
    width: 100%;
}

.dashboard-left {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.dashboard-right {
    width: 280px;
    max-width: 100%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ============================================================
   8. DASHBOARD CARDS
   ============================================================ */
.dashboard-card {
    padding: 16px 18px;
    border-radius: var(--radius-lg);
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.dashboard-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 14px;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    font-size: 12px;
}

/* ============================================================
   9. FINANCE KPI CARDS
   ============================================================ */
.finance-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.finance-kpi {
    position: relative;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    min-width: 170px;
    overflow: visible;
    transition: box-shadow var(--ease), transform var(--ease);
    z-index: 1;
}

.finance-kpi:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* KPI Icon */
.finance-kpi > i {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 15px;
    flex-shrink: 0;
}

.kpi-content { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

.finance-kpi h4 {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    white-space: nowrap;
}

.kpi-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    letter-spacing: -0.5px;
}

/* Color themes */
.finance-kpi.revenue {
    background: linear-gradient(135deg, #eef2ff, #f5f3ff);
    border-color: #c7d2fe;
    border-left: 4px solid #6366f1;
}
.finance-kpi.revenue > i { background: linear-gradient(135deg, #6366f1, #4f46e5); }

.finance-kpi.received {
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
    border-color: #a7f3d0;
    border-left: 4px solid #10b981;
}
.finance-kpi.received > i { background: linear-gradient(135deg, #10b981, #059669); }

.finance-kpi.due {
    background: linear-gradient(135deg, #fef2f2, #fff5f5);
    border-color: #fecaca;
    border-left: 4px solid #ef4444;
}
.finance-kpi.due > i { background: linear-gradient(135deg, #ef4444, #dc2626); }

.finance-kpi.month {
    background: linear-gradient(135deg, #fffbeb, #fef9ec);
    border-color: #fde68a;
    border-left: 4px solid #f59e0b;
}
.finance-kpi.month > i { background: linear-gradient(135deg, #f59e0b, #d97706); }

/* KPI Tooltip */
.tooltip-kpi { position: relative; cursor: pointer; }

.kpi-tooltip {
    position: absolute;
    top: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    color: #f1f5f9;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    line-height: 1.7;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    white-space: nowrap;
    z-index: 99999;
    border: 1px solid rgba(255,255,255,0.07);
}

.tooltip-up .kpi-tooltip {
    top: auto;
    bottom: 120%;
}

.tooltip-kpi:hover .kpi-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(4px);
}

.finance-kpi,
.finance-kpi-grid { overflow: visible !important; }

/* ============================================================
   10. CHART AREA
   ============================================================ */
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.chart-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: none;
}

.fy-dropdown {
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    font-size: 13px;
    color: var(--text-primary);
    background: #fff;
    cursor: pointer;
    outline: none;
    transition: border-color var(--ease);
}
.fy-dropdown:focus { border-color: var(--primary); }
.fy-dropdown:hover { border-color: #c7d2fe; }

.chart-container {
    height: 155px;
    position: relative;
    margin-top: 6px;
}
.chart-container canvas { max-height: 155px !important; }

/* ============================================================
   11. DUE PAYMENTS LIST
   ============================================================ */
.due-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

.due-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 14px;
    border-radius: var(--radius-md);
    background: #f8fafc;
    border: 1px solid var(--border);
    transition: background var(--ease);
}
.due-item:hover { background: #f1f5f9; }

.due-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.due-client {
    font-weight: 600;
    font-size: 12.5px;
    color: var(--text-primary);
}

.due-type {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: var(--radius-xs);
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.due-type.bd  { background: #dbeafe; color: #1d4ed8; }
.due-type.itr { background: #dcfce7; color: #166534; }

.due-amount {
    font-weight: 700;
    color: var(--danger);
    font-size: 12.5px;
}

/* ============================================================
   12. MODAL OVERLAY & BOX
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-box {
    background: #ffffff;
    border-radius: var(--radius-xl);
    padding: 36px 38px;
    width: 460px;
    max-width: 95vw;
    box-shadow: var(--shadow-xl);
    animation: modalPop 0.25s cubic-bezier(0.34,1.56,0.64,1);
    position: relative;
    border: 1px solid var(--border);
}

@keyframes modalPop {
    from { transform: translateY(20px) scale(0.96); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-box h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 18px;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-muted);
    transition: color 0.2s;
    line-height: 1;
}
.modal-close:hover { color: var(--danger); }

.modal-box p { color: var(--text-secondary); font-size: 14px; }

.modal-box select,
.modal-box input[type="text"],
.modal-box input[type="number"],
.modal-box input[type="date"],
.modal-box textarea {
    width: 100%;
    padding: 11px 13px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border);
    font-size: 14px;
    background: #fafafa;
    transition: var(--ease);
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
}

.modal-box select:focus,
.modal-box input:focus,
.modal-box textarea:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.modal-row {
    display: flex;
    gap: 12px;
}
.modal-row select,
.modal-row input { flex: 1; }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.modal-actions button {
    padding: 10px 22px;
    border-radius: var(--radius-md);
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ease);
    font-family: inherit;
}

.modal-actions button:first-child {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 6px 18px rgba(79,70,229,0.25);
}
.modal-actions button:first-child:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(79,70,229,0.35);
}
.modal-actions button:last-child {
    background: #f1f5f9;
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.modal-actions button:last-child:hover { background: #e2e8f0; }

.modal-success {
    background: var(--success-light);
    color: #065f46;
    padding: 10px 14px;
    border-left: 4px solid var(--success);
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 14px;
}

@keyframes popUp {
    from { transform: scale(0.88); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* ============================================================
   13. SECTION CARDS / PREMIUM SECTION
   ============================================================ */
.section-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    margin-bottom: 22px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.section-header {
    background: #f8fafc;
    padding: 13px 18px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid var(--primary);
}
.section-header i { color: var(--primary); font-size: 14px; }

.section-card input,
.section-card select {
    width: 100%;
    padding: 9px 11px;
    margin: 5px 0;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    font-size: 13px;
    outline: none;
    transition: var(--ease);
}
.section-card input:focus,
.section-card select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ============================================================
   14. PREMIUM SECTION BOX (Forms)
   ============================================================ */
.premium-section {
    position: relative;
    border-radius: var(--radius-xl);
    padding: 28px 32px 24px;
    margin-bottom: 22px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    overflow: visible;
}

.section-title {
    position: absolute;
    top: -13px;
    left: 32px;
    background: #fef9e7;
    padding: 5px 16px;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #92400e;
    border-radius: var(--radius-full);
    border: 1px solid #fde68a;
}

/* Section toggle +/- button */
.section-toggle {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1.5px solid #fde68a;
    background: #fef9e7;
    color: #b45309;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: background 0.15s, transform 0.2s;
    padding: 0;
}
.section-toggle:hover { background: #fef3c7; }

/* Section content hide/show */
.section-content         { display: none; }
.section-content.open    { display: block; }

/* ============================================================
   15. FORM GRID & GROUPS
   ============================================================ */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 4px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 7px;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border);
    background: #f9fafb;
    font-size: 14px;
    color: var(--text-primary);
    transition: var(--ease);
    outline: none;
    font-family: inherit;
}

.form-group input:hover,
.form-group select:hover { border-color: #c7d2fe; background: #fff; }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.full-width { grid-column: 1 / -1; }

.section-content { margin-top: 14px; }

/* ============================================================
   ACCORDION SECTIONS
   ============================================================ */
.accordion-section {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    overflow: hidden;
}
.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    cursor: pointer;
    user-select: none;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #92400e;
    background: #fef9e7;
    border-bottom: 1px solid transparent;
    transition: background 0.15s;
}
.accordion-header:hover { background: #fef3c7; }
.accordion-header.open { border-bottom: 1px solid #fde68a; }
.accordion-icon {
    font-size: 12px;
    color: #b45309;
    transition: transform 0.2s;
}
.accordion-body {
    padding: 20px 20px 16px;
    display: none;
}
.accordion-body.open { display: block; }

/* Form Rows (legacy) */
.form-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 14px;
}
.form-row label { margin-bottom: 6px; font-weight: 600; font-size: 13px; }
.form-row input,
.form-row select {
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    transition: var(--ease);
}
.form-row input:focus,
.form-row select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }

/* Edit form legacy */
.edit-form select,
.edit-form input {
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

/* ============================================================
   16. BUTTONS
   ============================================================ */

/* Primary Save Button */
button[name="save"] {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 13px 32px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--ease);
    box-shadow: 0 6px 18px rgba(79,70,229,0.25);
    font-family: inherit;
}
button[name="save"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(79,70,229,0.35);
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 6px 18px rgba(79,70,229,0.25);
    transition: var(--ease);
    font-family: inherit;
    text-decoration: none;
}
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(79,70,229,0.35); }
.primary-btn:active { transform: scale(0.98); }

.action-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--ease);
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.action-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }

.add-itr-btn,
.add-return-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    padding: 11px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--ease);
    box-shadow: 0 6px 18px rgba(16,185,129,0.25);
    font-size: 13.5px;
}
.add-itr-btn:hover,
.add-return-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(16,185,129,0.35); }

.save-itr-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    padding: 13px 26px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--ease);
    box-shadow: 0 6px 18px rgba(79,70,229,0.25);
    font-family: inherit;
}
.save-itr-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(79,70,229,0.35); }

.update-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--ease);
    font-family: inherit;
}
.update-btn:hover { transform: translateY(-1px); }

/* Back buttons */
.back-btn {
    background: #e0e7ff;
    color: var(--primary);
    padding: 9px 16px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--ease);
    border: 1px solid #c7d2fe;
}
.back-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.back-btn-top {
    background: #e0e7ff;
    color: var(--primary);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--ease);
}
.back-btn-top:hover { background: var(--primary); color: #fff; }

.form-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--border);
    transition: var(--ease);
}
.form-back-btn:hover { background: var(--danger-light); color: var(--danger); border-color: #fecaca; }

.form-back-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    transition: var(--ease);
}
.btn-primary:hover { transform: translateY(-1px); }

.btn-secondary {
    background: #f1f5f9;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    border: 1px solid var(--border);
    display: inline-block;
    transition: var(--ease);
}
.btn-secondary:hover { background: #e2e8f0; }

/* Clear filter */
.clear-filter-btn {
    background: var(--danger);
    color: #fff;
    padding: 9px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--ease);
    font-weight: 600;
}
.clear-filter-btn:hover { background: #dc2626; transform: translateY(-1px); }

/* ============================================================
   17. ACTION ICON BUTTONS (Table row actions)
   ============================================================ */
.action-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.action-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.icon-btn, .view-icon, .edit-icon, .delete-icon,
.edit-icon-btn, .delete-icon-btn {
    width: 25px;
    height: 25px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 12px;
    transition: var(--ease);
    color: #fff;
}

.view-icon, .view-btn.icon { background: var(--primary); }
.view-icon:hover { background: var(--primary-dark); transform: scale(1.08); }

.edit-icon, .edit-icon-btn { background: var(--success); }
.edit-icon:hover, .edit-icon-btn:hover { background: #059669; transform: scale(1.08); }

.delete-icon, .delete-icon-btn { background: var(--danger); }
.delete-icon:hover, .delete-icon-btn:hover { background: #dc2626; transform: scale(1.08); }

.icon-btn:hover { transform: scale(1.08); opacity: 0.9; }

.view-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: var(--ease);
    display: inline-block;
}
.view-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,70,229,0.3); }

.edit-btn {
    background: var(--success);
    color: #fff;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    display: inline-block;
    transition: var(--ease);
}
.edit-btn:hover { background: #059669; transform: scale(1.03); }

.delete-btn {
    background: var(--danger);
    color: #fff;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    display: inline-block;
    transition: var(--ease);
}
.delete-btn:hover { background: #dc2626; transform: scale(1.03); }

.whatsapp-btn {
    background: #25D366;
    color: #fff !important;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--ease);
    text-decoration: none;
}
.whatsapp-btn:hover { background: #1ebe5d; transform: scale(1.08); }

.reminder-btn {
    margin-left: 6px;
    background: var(--danger);
    color: white;
    padding: 2px 7px;
    border-radius: var(--radius-xs);
    font-size: 11px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--ease);
}
.reminder-btn:hover { background: #dc2626; }

.toggle-btn {
    margin-top: 4px;
    padding: 4px 10px;
    border: none;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
}
.toggle-btn:hover { background: var(--primary-dark); }

.copy-btn {
    margin-left: 8px;
    padding: 3px 9px;
    font-size: 11px;
    border-radius: var(--radius-xs);
    border: none;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: var(--ease);
}
.copy-btn:hover { background: var(--primary-dark); }

/* ============================================================
   18. BADGES & STATUS PILLS
   ============================================================ */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11.5px;
    font-weight: 600;
}

.badge-blue  { background: #dbeafe; color: #1d4ed8; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-orange{ background: #fde68a; color: #92400e; }
.badge-red   { background: #fee2e2; color: #b91c1c; }

.badge.active    { background: #dcfce7; color: #166534; }
.badge.cancelled { background: #fee2e2; color: #b91c1c; }

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11.5px;
    font-weight: 600;
    text-transform: capitalize;
}
.status-badge.active    { background: #dcfce7; color: #15803d; }
.status-badge.cancelled { background: #fee2e2; color: #b91c1c; }
.status-badge.surrendered{ background: #fef3c7; color: #b45309; }
.status-badge.pending   { background: #fff4e5; color: #b26a00; }
.status-badge.success   { background: #e6f4ea; color: #137333; }
.status-badge.moved\ on { background: #e0e7ff; color: #3730a3; }

.status {
    padding: 4px 10px;
    border-radius: var(--radius-xs);
    font-size: 12px;
    font-weight: 600;
}
.status.active    { background: #dcfce7; color: #15803d; }
.status.cancelled { background: #fee2e2; color: #b91c1c; }
.status.surrendered{ background: #fef3c7; color: #b45309; }
.status.moved     { background: #e0e7ff; color: #3730a3; }

.status-pill {
    display: inline-block;
    padding: 4px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
}
.status-pill.success { background: #b7e4c7; color: #1b4332; }
.status-pill.pending { background: #fff4e6; color: #9c6b1c; }

.itr-type-badge {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 11.5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

/* Misc */
.blue   { background: var(--primary); color: #fff; }
.green  { background: var(--success); color: #fff; }
.orange { background: var(--warning); color: #fff; }

.text-danger { color: var(--danger); font-weight: 600; }

.risk { padding: 5px 10px; border-radius: var(--radius-full); font-size: 12.5px; font-weight: 600; }
.risk.green  { background: #d3f9d8; color: #2b8a3e; }
.risk.yellow { background: #fff3bf; color: #e67700; }
.risk.orange { background: #ffe8cc; color: #d9480f; }
.risk.red    { background: #ffe3e3; color: #c92a2a; }

/* Tags */
.tag { padding: 6px 14px; border-radius: var(--radius-sm); font-weight: 600; font-size: 12px; display: inline-block; }
.tag.file   { background: #e8ecff; color: #3c3dbb; }
.tag.gst    { background: #e6f4f8; color: #1a6a8a; }
.tag.pan    { background: #fef3c7; color: #92400e; }
.tag.reg    { background: #dfeaf4; color: #355b7a; }
.tag.status { background: #dcfce7; color: #166534; }

/* Summary Pills */
.summary-pill {
    background: #e2e8f0;
    padding: 7px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
}
.summary-pill.fee      { background: #dbeafe; color: #1e40af; }
.summary-pill.received { background: #dcfce7; color: #166534; }
.summary-pill.due      { background: #fee2e2; color: #b91c1c; }

/* Money Pills */
.money-pill   { padding: 5px 14px; border-radius: var(--radius-full); font-weight: 600; font-size: 14px; display: inline-block; }
.fee-pill     { background: #e0ecff; color: #1e40af; }
.paid-pill    { background: #dcfce7; color: #166534; }
.balance-pill { background: #fee2e2; color: #b91c1c; }

/* Payment Boxes */
.financial-box { padding: 8px 14px; border-radius: var(--radius-md); font-weight: 600; display: flex; flex-direction: column; font-size: 14px; }
.financial-box span { font-size: 11px; opacity: 0.7; }
.total-box   { background: #e8f5ff; color: #0077cc; }
.pending-box { background: #ffeaea; color: #d60000; }
.overpaid-box{ background: #f3e8ff; color: #6b21a8; }
.paid-full   { background: #e8fff0; color: #008a2e; }
.balance-due { background: #ffeaea; color: #d60000; }

.overpaid-box,
.paid-full,
.balance-due {
    padding: 4px 11px;
    border-radius: var(--radius-full);
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    display: inline-block;
}

/* Health pill */
.health-pill {
    background: #d1fae5;
    color: #065f46;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 11.5px;
    font-weight: 600;
    margin-right: 4px;
    display: inline-block;
}

/* Filed / Pending text */
.filed   { color: var(--success); font-weight: 700; }
.pending { color: var(--danger);  font-weight: 700; }
.fake-mobile { background: var(--danger-light); color: #b91c1c; padding: 3px 7px; border-radius: 3px; font-weight: 600; font-size: 11px; }

/* ============================================================
   19. TABLES
   ============================================================ */

/* Page containers */
.table-card {
    background: var(--card-bg);
    padding: 22px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.table-container,
.table-wrapper {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
}

.table-scroll { overflow-x: auto; }
.table-wrapper { display: flex; flex-direction: column; }

.table-body {
    max-height: 560px;
    overflow-y: auto;
    overflow-x: auto;
}

/* ---- Clean / Data Table (main workhorse) ---- */
.clean-table,
.data-table,
.it-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.data-table,
.clean-table,
.table-header { width: max-content; border-collapse: collapse; }

/* Header */
.clean-table thead,
.data-table thead,
.it-table thead {
    position: sticky;
    top: 0;
    z-index: 5;
}

.clean-table th,
.data-table th,
.table-header th,
.it-table th {
    background: #3d4e6b;
    color: #f1f5f9;
    padding: 9px 11px;
    border: 1px solid #4a5a7a;
    font-weight: 600;
    font-size: 12.5px;
    text-align: left;
    white-space: nowrap;
    position: relative;
    min-width: 100px;
    letter-spacing: 0.2px;
}

/* First sticky col */
.data-table thead th { position: sticky; top: 0; background: #3d4e6b; z-index: 15; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }

/* Body */
.clean-table td,
.data-table td,
.it-table td {
    padding: 7px 10px;
    border: 1px solid #eef0f4;
    color: var(--text-primary);
    white-space: nowrap;
    vertical-align: middle;
}

/* Zebra */
.clean-table tbody tr:nth-child(even) { background: #fafbfd; }

/* Hover */
.clean-table tbody tr:hover,
.data-table tbody tr:hover,
.it-table tbody tr:hover { background: #f0f4ff; }

/* Active row */
.data-table tbody tr.active-row { background: #dbeafe !important; }

/* Row cursor */
.data-table tbody tr { cursor: pointer; transition: background 0.12s; }

/* SL column */
.data-table th:first-child,
.data-table td:first-child {
    min-width: 55px;
    width: 55px;
    max-width: 55px;
    text-align: center;
    padding-left: 6px;
    padding-right: 6px;
}

/* Last cell */
td:last-child { white-space: nowrap; }

/* ---- Premium Table (cards style) ---- */
.premium-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.premium-table thead th {
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.premium-table tbody tr {
    background: #f9fafb;
    transition: all 0.2s ease;
    border-radius: var(--radius-sm);
}
.premium-table tbody tr:hover {
    background: #eef2ff;
    transform: translateY(-1px);
}

.premium-table td {
    padding: 13px 16px;
    font-size: 14px;
    color: var(--text-primary);
}

/* ---- Pro / Details Table ---- */
.pro-table,
.details-table,
.detail-table,
.info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.pro-table th, .details-table th, .detail-table th {
    width: 18%;
    background: #f8fafc;
    color: var(--text-secondary);
    padding: 11px 14px;
    text-align: left;
    border: 1px solid var(--border);
    font-weight: 600;
    font-size: 12.5px;
}

.pro-table td, .details-table td, .detail-table td {
    padding: 11px 14px;
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-weight: 500;
}

.pro-table tr:hover, .details-table tr:hover, .detail-table tr:hover { background: #f9fafb; }
.detail-table tr:nth-child(even) td { background: #fafbfc; }

/* Info table (client view) */
.info-table { table-layout: fixed; }
.info-table td {
    padding: 14px 12px;
    border-bottom: 1px dashed #e2e8f0;
    vertical-align: middle;
}
.info-table .label { width: 38%; color: var(--text-secondary); font-weight: 500; font-size: 13px; }
.info-table .value { width: 62%; border-left: 2px solid var(--border); padding-left: 20px; font-weight: 600; color: var(--text-primary); text-align: right; }

/* Column resizer */
.resizer {
    position: absolute;
    top: 0; right: 0;
    width: 6px; height: 100%;
    cursor: col-resize;
    user-select: none;
}
.resizer:hover { background: rgba(79,70,229,0.3); }

/* ============================================================
   20. PAGE HEADERS & TITLES
   ============================================================ */
.page-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    gap: 16px;
    flex-wrap: wrap;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 12px;
}

.it-header-actions,
.itr-header-actions,
.header-action {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Finance summary pills row */
.finance-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.top-summary-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}

/* ============================================================
   21. SEARCH
   ============================================================ */
.search-wrapper { margin-bottom: 22px; display: flex; justify-content: flex-end; }

.search-container,
.modern-search,
.itr-search-wrapper,
.gst-search {
    position: relative;
}

.search-container input,
.modern-search input,
.itr-search-wrapper input,
.gst-search input {
    padding: 8px 36px 8px 34px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--border);
    background: #ffffff;
    font-size: 13.5px;
    transition: var(--ease);
    box-shadow: var(--shadow-xs);
    outline: none;
    min-width: 220px;
}

.search-container input:focus,
.modern-search input:focus,
.itr-search-wrapper input:focus,
.gst-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-container i,
.search-icon,
.itr-search-wrapper i,
.gst-search i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}

.clear-btn,
#clearSearch {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}
.clear-btn:hover, #clearSearch:hover { color: var(--danger); }
#clearSearch { display: none; }
#searchBox { text-transform: uppercase; }

/* ============================================================
   22. RECORD COUNT
   ============================================================ */
.record-count {
    background: #e2e8f0;
    padding: 9px 18px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text-primary);
}

/* ============================================================
   23. STATUS FILTER DROPDOWN
   ============================================================ */
.status-filter {
    position: relative;
    display: inline-block;
}

.status-filter select {
    padding: 9px 36px 9px 14px;
    font-size: 13.5px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--border);
    background: #ffffff;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    min-width: 120px;
    height: 40px;
    outline: none;
    transition: var(--ease);
}
.status-filter select:hover { border-color: #c7d2fe; }
.status-filter select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }

.status-filter::after {
    content: "▾";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--text-secondary);
    pointer-events: none;
}

/* ============================================================
   24. PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.page-btn {
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    background: var(--card-bg);
    color: var(--text-primary);
    font-weight: 500;
    font-size: 13.5px;
    transition: var(--ease);
    border: 1.5px solid var(--border);
}
.page-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); transform: translateY(-1px); }

.active-page {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    border-color: var(--primary);
    box-shadow: 0 3px 10px rgba(79,70,229,0.3);
}

/* ============================================================
   25. SUCCESS / ERROR MESSAGES
   ============================================================ */
.success-msg {
    background: var(--success-light);
    color: #065f46;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 4px solid var(--success);
    box-shadow: 0 3px 10px rgba(16,185,129,0.1);
}
.success-msg i { color: var(--success); font-size: 16px; }

.alert-success {
    background: var(--success-light);
    color: #065f46;
    padding: 12px 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    border-left: 4px solid var(--success);
}

.form-error {
    background: var(--danger-light);
    color: #b91c1c;
    padding: 12px 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 500;
    border-left: 4px solid var(--danger);
}

/* ============================================================
   26. TOAST NOTIFICATIONS
   ============================================================ */
.toast-delete {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: #ffffff;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideToast 0.3s ease;
    z-index: 99999;
    max-width: 380px;
}

.toast-success {
    position: fixed;
    bottom: 22px;
    right: 22px;
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    padding: 13px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    animation: slideToast 0.3s ease;
}

.success-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    box-shadow: var(--shadow-md);
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease;
}

@keyframes slideToast {
    from { transform: translateX(40px); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ============================================================
   27. PROFILE / DETAILS VIEWS
   ============================================================ */

/* Client Banner */
.client-banner {
    background: linear-gradient(135deg, #1e293b, #334155);
    padding: 24px 28px;
    border-radius: var(--radius-xl);
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    color: #fff;
}

.client-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 12px;
}

.client-title-bar h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    color: #fff;
}

.client-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.client-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.client-avatar {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    color: white;
    font-size: 26px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(79,70,229,0.3);
}

.client-info h2 { margin: 0; font-size: 26px; }

.client-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.client-header hr,
.header-divider {
    border: none;
    border-top: 1px dashed rgba(255,255,255,0.15);
    margin: 16px 0;
}

.client-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.return-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 28px;
    gap: 12px;
}

.return-history-title {
    margin-top: 36px;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--danger);
    letter-spacing: 0.5px;
    position: relative;
}
.return-history-title::after {
    content: "";
    width: 60px;
    height: 3px;
    background: var(--danger);
    display: block;
    margin: 8px auto 0;
    border-radius: 5px;
}

/* Profile Premium */
.profile-premium {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 28px;
    padding: 22px 28px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.profile-left   { display: flex; align-items: center; gap: 18px; }
.profile-center { display: flex; gap: 18px; align-items: center; }

.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.profile-name { margin: 0; font-size: 22px; font-weight: 700; }
.profile-sub  { margin-top: 5px; }

.pan-pill {
    background: #bcccff;
    color: #0033bb;
    padding: 5px 12px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    font-size: 12px;
    margin-right: 6px;
    display: inline-block;
}

.type-pill {
    background: #ffbfc1;
    color: #c61919;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    display: inline-block;
}

.profile-status-group { display: flex; gap: 8px; flex-wrap: wrap; }

.profile-financial { display: flex; gap: 12px; margin-top: 10px; flex-wrap: wrap; }

/* Profile Grid */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.profile-item {
    background: #f8f9fb;
    padding: 14px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}
.profile-item:hover { background: #eef2f7; }

.profile-label { font-size: 12px; color: var(--text-muted); display: block; margin-bottom: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.profile-value { font-size: 15px; font-weight: 600; color: var(--text-primary); }

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 22px;
}
.info-grid label { font-size: 11.5px; color: var(--text-muted); display: block; margin-bottom: 5px; font-weight: 600; text-transform: uppercase; }
.info-grid p     { font-size: 14.5px; font-weight: 600; margin: 0; }

/* Client Grid */
.client-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-top: 22px;
}

.client-top-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-bottom: 22px;
}

/* Info Card */
.info-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
    transition: box-shadow 0.2s;
}
.info-card:hover { box-shadow: var(--shadow-md); }

.info-card h3 {
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-light);
    padding: 6px 18px;
    border-radius: var(--radius-full);
    display: inline-block;
    width: fit-content;
    text-align: center;
    margin: 0 auto 18px auto;
    display: block;
}

.info-card.full-width { grid-column: span 2; }
.full-width { grid-column: 1 / -1; }

/* Info Row */
.info-row {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #e2e8f0;
}
.info-row:last-child { border-bottom: none; }

.info-row span {
    width: 44%;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
}

.info-row b {
    width: 56%;
    padding-left: 12px;
    text-align: right;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

/* View Card */
.view-card {
    background: var(--card-bg);
    padding: 20px;
    margin-bottom: 18px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.view-card h3 { margin-bottom: 14px; border-bottom: 2px solid var(--border); padding-bottom: 6px; font-size: 15px; }

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 10px;
}

.view-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
}

/* Details Card / Header */
.details-card { padding: 0; border-radius: 0; box-shadow: none; }

.details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 12px;
}
.details-header h2 { font-size: 26px; font-weight: 700; }

.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px 36px;
}

.detail-item { display: flex; flex-direction: column; }
.detail-item label { font-size: 11px; color: var(--text-muted); display: block; margin-bottom: 5px; letter-spacing: 0.5px; text-transform: uppercase; }
.detail-item span { font-size: 15px; font-weight: 600; color: var(--text-primary); }

/* Password Box */
.password-box, .password-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}
.password-box button, .password-wrapper button {
    padding: 5px 12px;
    border: 1.5px solid var(--border);
    background: #f9fafb;
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: var(--ease);
    font-family: inherit;
}
.password-box button:hover, .password-wrapper button:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Credential Bar */
.credential-bar {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed #d1d5db;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

.credential-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 22px;
}

.credential-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f1f5f9;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    font-size: 14px;
}
.credential-item i { color: var(--text-muted); font-size: 15px; }
.credential-item span { color: var(--text-muted); font-size: 12px; font-weight: 500; }
.credential-item b { font-weight: 600; color: var(--text-primary); font-size: 13px; }

/* ============================================================
   28. YEAR / TYPE / QUARTER SECTIONS
   ============================================================ */
.year-section {
    margin-top: 22px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
}

.year-header {
    background: #1e293b;
    color: #fff;
    padding: 11px 18px;
    font-weight: 600;
    font-size: 15px;
}

.type-section { border-top: 1px solid var(--border); text-align: left; }

.type-header {
    background: #f8fafc;
    padding: 11px 18px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    transition: background 0.2s;
}
.type-header:hover { background: #e2e8f0; }

.type-header .arrow { transition: transform 0.2s ease; margin-left: 0 !important; }
.type-header.open .arrow { transform: rotate(90deg); }

.type-body { display: none; padding: 14px; background: #ffffff; }

/* Quarter */
.quarter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 22px;
}

.quarter-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 13px 12px;
    text-align: center;
    border: 1px solid var(--border);
    transition: var(--ease);
    position: relative;
}
.quarter-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.quarter-title  { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.quarter-status { font-size: 12px; font-weight: 600; margin-bottom: 6px; }

.quarter-actions { display: flex; justify-content: center; gap: 6px; margin-top: 6px; }
.quarter-actions a {
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-xs);
    background: #e5e7eb;
    color: var(--text-secondary);
    font-size: 12px;
    text-decoration: none;
    transition: 0.2s;
}
.quarter-actions a:hover { background: #d1d5db; transform: scale(1.05); }
.quarter-actions .whatsapp { background: #25D366; color: #fff; font-size: 14px; }
.quarter-actions .whatsapp:hover { background: #1ebe5d; }

/* Month boxes (GST tracker) */
.month-box {
    width: 86px; height: 86px;
    border-radius: var(--radius-md);
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid var(--border);
    background: white;
    transition: var(--ease);
}
.month-box:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.month-box.filed    { border-color: #22c55e; background: #dcfce7; color: #166534; }
.month-box.notfiled { border-color: var(--danger); background: var(--danger-light); color: #991b1b; }

.month-title  { font-size: 13px; font-weight: 700; }
.month-icon   { font-size: 20px; margin: 4px 0; }
.month-status { font-size: 11px; }

.month-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    margin-top: 22px;
    width: 100%;
}

.month-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 6px;
    font-size: 14px;
}
.month-actions a { text-decoration: none; color: inherit; }
.month-actions button,
.month-actions a {
    border: none;
    background: #f1f5f9;
    padding: 5px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
}
.month-actions button:hover, .month-actions a:hover { background: #e2e8f0; }
.month-actions i { font-size: 13px; }

/* Tracker Month Card */
.tracker-month-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 13px;
    box-shadow: var(--shadow-sm);
    transition: var(--ease);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 130px;
    border: 1px solid var(--border);
}
.tracker-month-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.month-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.month-name   { font-weight: 700; font-size: 14px; }
.month-badge  { font-size: 10px; padding: 3px 8px; border-radius: var(--radius-full); font-weight: 700; letter-spacing: 0.5px; }
.badge-filed    { background: #dcfce7; color: #166534; }
.badge-notfiled { background: #fee2e2; color: #991b1b; }

/* ============================================================
   29. PROGRESS BARS
   ============================================================ */
.collection-progress {
    background: var(--card-bg);
    padding: 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border);
}
.progress-header { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 7px; font-size: 13px; }

.progress-bar,
.progress-bar-header {
    width: 100%;
    height: 10px;
    background: #e5e7eb;
    border-radius: var(--radius-full);
    overflow: hidden;
}
.progress-bar-header { width: 120px; height: 9px; }

.progress-fill,
.progress-fill-header {
    height: 100%;
    background: linear-gradient(90deg, var(--success), #059669);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.progress-percent,
.progress-text { margin-top: 5px; font-size: 12px; color: var(--text-secondary); font-weight: 600; }

.header-progress { display: flex; align-items: center; gap: 8px; min-width: 140px; }

.payment-progress { margin-top: 14px; }
.payment-stat {
    background: #f8f9fb;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 9px;
    border: 1px solid var(--border);
}

/* ============================================================
   30. EDIT LAYOUTS & HEADERS
   ============================================================ */
.edit-container {
    max-width: 700px;
    margin: 36px auto;
    padding: 28px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.edit-title { text-align: center; font-size: 24px; margin-bottom: 22px; font-weight: 700; }

.edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 12px;
}

.edit-header-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 22px;
    border: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}

.edit-header-info { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.header-client { font-weight: 700; }
.header-ay { font-weight: 700; }
.header-money { font-weight: 600; color: var(--text-primary); }
.header-money.due { color: var(--danger); }

.edit-layout {
    display: flex;
    gap: 36px;
    align-items: flex-start;
    margin-top: 22px;
    flex-wrap: wrap;
}

.edit-top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    gap: 16px;
    flex-wrap: wrap;
}

.edit-title-area h2 {
    margin: 0;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.edit-summary-mini { display: flex; gap: 28px; }
.edit-summary-mini small { display: block; font-size: 11px; color: var(--text-muted); }
.edit-summary-mini strong { font-size: 13.5px; }

/* Form Card */
.form-card {
    background: #fff;
    padding: 28px;
    border-radius: var(--radius-md);
    max-width: 480px;
    margin: 28px auto;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

/* Form Actions */
.form-actions { margin-top: 18px; display: flex; gap: 10px; }

/* IFR Search / Header misc */
.itr-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 12px; }
.itr-search-form { display: flex; gap: 8px; }
.itr-search-form input {
    padding: 8px 12px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border);
    font-size: 14px;
    outline: none;
}
.itr-search-form button {
    padding: 8px 14px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--primary);
    color: white;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
}

/* ============================================================
   31. TOOLTIPS
   ============================================================ */
.tooltip {
    position: relative;
    display: inline-block;
    margin-right: 5px;
    cursor: pointer;
}

.tooltiptext {
    visibility: hidden;
    opacity: 0;
    width: max-content;
    background-color: #1c1c1c;
    color: #fff;
    text-align: center;
    padding: 6px 10px;
    border-radius: var(--radius-xs);
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    white-space: nowrap;
    transition: opacity 0.15s ease;
    z-index: 999;
}

.tooltip:hover .tooltiptext { visibility: visible; opacity: 1; }

/* Client tooltip */
#clientTooltip {
    position: absolute;
    background: #111827;
    color: #fff;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    display: none;
    z-index: 9999;
    max-width: 240px;
    line-height: 1.6;
    box-shadow: var(--shadow-lg);
}

.client-hover {
    cursor: pointer;
    color: var(--primary);
    font-weight: 600;
    transition: 0.2s;
}
.client-hover:hover { text-decoration: underline; }

.client-tooltip { cursor: pointer; font-weight: 600; color: var(--text-primary); }
.client-tooltip:hover { color: var(--primary); }

/* ============================================================
   32. MISCELLANEOUS / PAGE-SPECIFIC
   ============================================================ */

/* Page/Table Titles */
.table-title { font-size: 20px; font-weight: 700; margin-bottom: 14px; color: var(--text-primary); }

/* Name bold */
.name, .bold-name { font-weight: 600; }

/* No data */
.no-data, .no-record {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 14px;
}

.error { font-size: 11px; }

.toggle-icon { transition: 0.3s ease; }

.section-content { display: none; }

/* Edit buttons (top of view pages) */
.edit-btn-top {
    background: var(--success);
    color: #fff;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: var(--ease);
}
.edit-btn-top:hover { background: #059669; }

/* Install button */
#installBtn {
    position: fixed;
    bottom: 20px;
    left: calc(var(--sidebar-w) + 20px);
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    z-index: 100;
    font-family: inherit;
    transition: var(--ease);
}
#installBtn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* KPI Row (legacy) */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 10px;
}

.kpi-box {
    background: #f6f8fb;
    border-radius: var(--radius-md);
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    border: 1px solid var(--border);
}

.kpi-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: white;
}

/* Records grid */
.records-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-top: 10px;
}

/* Fee Grid */
.fee-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* Collection Progress (BD) */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }

/* Text */
.error-msg-form {
    background: var(--danger-light);
    color: #b91c1c;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
}

/* Modal back-compat */
@keyframes popUp {
    from { transform: scale(0.88); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

/* ============================================================
   33. MOBILE — RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .client-grid,
    .client-top-section,
    .credential-grid {
        grid-template-columns: 1fr;
    }
    .details-grid { grid-template-columns: 1fr; }
    .quarter-grid { grid-template-columns: repeat(2, 1fr); }
    .month-grid   { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 768px) {
    :root { --sidebar-w: 0px; }

    .sidebar {
        left: -260px;
        width: 245px;
        transition: left 0.3s ease;
        z-index: 1100;
    }
    .sidebar.active { left: 0; }

    .content {
        margin-left: 0;
        width: 100%;
        padding: 16px;
    }

    .mobile-menu-btn { display: flex; }

    .dashboard-top { flex-direction: column; }
    .dashboard-right { width: 100%; }

    .finance-kpi-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .kpi-value { font-size: 17px; }

    .dashboard-title { font-size: 16px; }
    .header-clock { font-size: 13px; padding: 6px 12px; }

    .form-grid { grid-template-columns: 1fr; }
    .full-width { grid-column: 1; }

    .records-grid { grid-template-columns: repeat(2, 1fr); }
    .kpi-row { grid-template-columns: 1fr 1fr; }

    .modal-box { padding: 24px 20px; width: 92vw; }

    .top-bar, .page-header { flex-direction: column; align-items: flex-start; }
    .modern-search input { width: 100%; }
}

@media (max-width: 480px) {
    .finance-kpi-grid { grid-template-columns: 1fr; }
    .records-grid     { grid-template-columns: 1fr; }
    .kpi-row          { grid-template-columns: 1fr; }
    .dashboard-header { flex-direction: column; align-items: flex-start; }
    .profile-premium  { flex-direction: column; }
    .edit-layout      { flex-direction: column; }
    .quarter-grid     { grid-template-columns: repeat(2, 1fr); }
}
