@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

/* ── CSS Variables ─────────────────────────────────── */
:root {
    --color-primary: #1a56db;
    --color-primary-soft: #eff4ff;
    --color-primary-dark: #1245b8;
    --color-bg: #f5f6fa;
    --color-surface: #ffffff;
    --color-border: #e5e7ef;
    --color-hover: #f0f2f8;
    --color-text: #111827;
    --color-text-muted: #6b7280;
    --color-success: #059669;
    --color-success-soft: #ecfdf5;
    --color-warning: #d97706;
    --color-warning-soft: #fffbeb;
    --color-danger: #dc2626;
    --color-danger-soft: #fef2f2;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --font-body: 'DM Sans', sans-serif;
    --font-mono: 'DM Mono', monospace;
}

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

/* ── Typography ────────────────────────────────────── */
h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

p {
    color: var(--color-text-muted);
}

code {
    font-family: var(--font-mono);
    font-size: 0.8em;
    background: var(--color-hover);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--color-primary);
}

/* ── Page Header ───────────────────────────────────── */
.page-header {
    margin-bottom: 1.75rem;
}

    .page-header h1 {
        margin-bottom: 0.2rem;
    }

.page-subtitle {
    font-size: 0.9rem;
}

/* ── Buttons ───────────────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.25rem;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}

    .btn-primary:hover {
        background: var(--color-primary-dark);
    }

    .btn-primary:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

.btn-outline {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.1rem;
    background: transparent;
    color: var(--color-primary);
    border: 1.5px solid var(--color-primary);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}

    .btn-outline:hover {
        background: var(--color-primary-soft);
    }

.btn-sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
}

/* ── Form Elements ─────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1.1rem;
}

    .form-group label {
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--color-text);
    }

.form-input {
    padding: 0.6rem 0.875rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--color-text);
    background: var(--color-surface);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

    .form-input:focus {
        border-color: var(--color-primary);
        box-shadow: 0 0 0 3px rgba(26,86,219,0.12);
    }

.validation-message {
    font-size: 0.8rem;
    color: var(--color-danger);
}

/* ── Toolbar ───────────────────────────────────────── */
.toolbar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-input {
    flex: 1;
    min-width: 200px;
}

.status-filter {
    width: 160px;
}

/* ── Table ─────────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    font-size: 0.875rem;
}

    .data-table th {
        padding: 0.75rem 1rem;
        background: var(--color-hover);
        font-weight: 600;
        text-align: left;
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--color-text-muted);
        border-bottom: 1px solid var(--color-border);
    }

    .data-table td {
        padding: 0.85rem 1rem;
        border-bottom: 1px solid var(--color-border);
        color: var(--color-text);
    }

    .data-table tr:last-child td {
        border-bottom: none;
    }

    .data-table tr:hover td {
        background: var(--color-hover);
    }

.amount {
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.overdue-date {
    color: var(--color-danger);
    font-weight: 600;
}

/* ── Badges ────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-pending, .badge-unpaid {
    background: var(--color-warning-soft);
    color: var(--color-warning);
}

.badge-completed, .badge-paid {
    background: var(--color-success-soft);
    color: var(--color-success);
}

.badge-failed, .badge-overdue {
    background: var(--color-danger-soft);
    color: var(--color-danger);
}

/* ── Stats Grid ────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--color-border);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-weight: 500;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.stat-change {
    font-size: 0.8rem;
}

    .stat-change.success {
        color: var(--color-success);
    }

    .stat-change.warning {
        color: var(--color-warning);
    }

    .stat-change.danger {
        color: var(--color-danger);
    }

    .stat-change.neutral {
        color: var(--color-text-muted);
    }

/* ── Empty & Loading States ────────────────────────── */
.empty-card {
    background: var(--color-surface);
    border: 1.5px dashed var(--color-border);
    border-radius: var(--radius);
    padding: 3rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.empty-state {
    color: var(--color-text-muted);
    text-align: center;
    padding: 2rem;
}

.loading-inline {
    display: flex;
    justify-content: center;
    padding: 3rem;
}

.loading-overlay {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-content {
    text-align: center;
}

.loading-text {
    margin-top: 0.75rem;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* ── Spinner ───────────────────────────────────────── */
.spinner, .spinner-sm {
    border-radius: 50%;
    border: 2.5px solid var(--color-border);
    border-top-color: var(--color-primary);
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

.spinner {
    width: 36px;
    height: 36px;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Alerts ────────────────────────────────────────── */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.alert-error {
    background: var(--color-danger-soft);
    color: var(--color-danger);
    border: 1px solid #fecaca;
}

/* ── Login Page ────────────────────────────────────── */
.empty-layout {
    min-height: 100vh;
    background: var(--color-bg);
}

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    width: 54px;
    height: 54px;
    background: var(--color-primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    margin: 0 auto 1rem;
}

.login-header h1 {
    font-size: 1.4rem;
    margin-bottom: 0.3rem;
}

.login-header p {
    font-size: 0.875rem;
}

/* ── 404 ───────────────────────────────────────────── */
.not-found {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    gap: 0.75rem;
}

.not-found-code {
    font-size: 5rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    color: var(--color-border);
    line-height: 1;
}

.not-found h1 {
    font-size: 1.5rem;
}

/* ── Recent Section ────────────────────────────────── */
.recent-section {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--color-border);
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .page-content {
        padding: 1.25rem;
    }

    .toolbar {
        flex-direction: column;
    }

    .search-input, .status-filter {
        width: 100%;
    }
}

/* ── Modal ─────────────────────────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    padding: 1rem;
}

.modal-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 2rem;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-sm {
    max-width: 360px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

    .modal-header h2 {
        margin: 0;
        font-size: 1.1rem;
    }

.modal-close {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 0.25rem;
    line-height: 1;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.amount-preview {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--color-text);
    margin: 0;
}

/* ── Alerts ────────────────────────────────────────────────────────────────── */
.alert-success {
    background: var(--color-success-soft);
    color: var(--color-success);
    border: 1px solid #a7f3d0;
}

/* ── Page header row ───────────────────────────────────────────────────────── */
.page-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

/* ── Table extras ──────────────────────────────────────────────────────────── */
.table-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.total-amount {
    font-family: var(--font-mono);
    font-weight: 600;
}

tr.row-selected td {
    background: var(--color-primary-soft);
}

.data-table tbody tr {
    cursor: pointer;
}

.actions-cell {
    white-space: nowrap;
}

.text-muted {
    color: var(--color-text-muted);
}

.empty-hint {
    font-size: 0.8rem;
}

/* ── Bank badge ────────────────────────────────────────────────────────────── */
.bank-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    letter-spacing: 0.04em;
}

.bank-cbe {
    background: #dbeafe;
    color: #1e40af;
}

.bank-abyssinia {
    background: #fef3c7;
    color: #92400e;
}

.bank-awash {
    background: #d1fae5;
    color: #065f46;
}

/* ── Danger button ─────────────────────────────────────────────────────────── */
.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.25rem;
    background: var(--color-danger);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

    .btn-danger:hover {
        background: #b91c1c;
    }

    .btn-danger:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

/* ── Detail panel ──────────────────────────────────────────────────────────── */
.detail-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: var(--shadow);
}

.detail-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

    .detail-panel-header h2 {
        font-size: 1rem;
        margin: 0;
    }

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.detail-value {
    font-size: 0.9rem;
    color: var(--color-text);
    word-break: break-all;
}

@media (max-width: 600px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

/* ══════════════════════════════════════════════════════
   SIDEBAR — Dark premium theme
   ══════════════════════════════════════════════════════ */

.sidebar {
    width: 260px;
    min-height: 100vh;
    background: linear-gradient(180deg, #0f1117 0%, #131720 100%);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 200;
    overflow: hidden;
    border-right: 1px solid rgba(255,255,255,0.05);
}

    /* Accent stripe */
    .sidebar::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 3px;
        background: linear-gradient(180deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
    }

/* ── Header ── */
.sidebar-header {
    padding: 1.4rem 1.25rem 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    box-shadow: 0 4px 14px rgba(99,102,241,0.45);
    flex-shrink: 0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.logo:hover .logo-icon {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(99,102,241,0.55);
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
}

/* ── Nav list ── */
.nav-links {
    list-style: none;
    padding: 0.85rem 0.7rem;
    margin: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    scrollbar-width: none;
}

    .nav-links::-webkit-scrollbar {
        display: none;
    }

/* ── Section label ── */
.nav-section-label {
    list-style: none;
    padding: 1rem 0.75rem 0.3rem;
}

    .nav-section-label span {
        font-size: 0.65rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.14em;
        color: rgba(255,255,255,0.22);
    }

/* ── Nav item ── */
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.62rem 0.9rem;
    border-radius: 10px;
    text-decoration: none;
    color: rgba(255,255,255,0.45);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.18s ease;
    position: relative;
}

    .nav-item:hover {
        color: rgba(255,255,255,0.92);
        background: rgba(255,255,255,0.07);
        transform: translateX(2px);
    }

    /* Active */
    .nav-item.active {
        color: #ffffff;
        background: rgba(99,102,241,0.18);
        font-weight: 600;
        box-shadow: inset 0 0 0 1px rgba(99,102,241,0.25);
    }

        .nav-item.active::after {
            content: '';
            position: absolute;
            left: 0;
            top: 20%;
            bottom: 20%;
            width: 3px;
            background: linear-gradient(180deg, #6366f1, #8b5cf6);
            border-radius: 0 3px 3px 0;
        }

/* ── Icons ── */
.nav-icon {
    font-size: 1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    transition: transform 0.18s;
}

.nav-item:hover .nav-icon {
    transform: scale(1.15);
}

.nav-item.active .nav-icon {
    filter: drop-shadow(0 0 5px rgba(99,102,241,0.7));
}

/* ── Footer ── */
.sidebar-footer {
    padding: 0.9rem 1rem 1.1rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.6rem;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    transition: background 0.15s;
    cursor: default;
}

    .user-info:hover {
        background: rgba(255,255,255,0.07);
    }

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(99,102,241,0.4);
    letter-spacing: 0.02em;
}

.user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.user-name {
    font-size: 0.825rem;
    font-weight: 600;
    color: rgba(255,255,255,0.88);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.3);
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ── Sign out ── */
.btn-logout-sidebar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: rgba(255,255,255,0.28);
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.07);
    transition: all 0.18s ease;
    letter-spacing: 0.01em;
}

    .btn-logout-sidebar:hover {
        color: #f87171;
        border-color: rgba(248,113,113,0.35);
        background: rgba(248,113,113,0.08);
    }

/* ── Top bar ── */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 60px;
    background: #ffffff;
    border-bottom: 1px solid #eaecf0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.user-badge {
    font-size: 0.825rem;
    font-weight: 600;
    color: #374151;
    background: #f3f4f6;
    padding: 0.3rem 0.85rem;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
}

.btn-logout {
    font-size: 0.78rem;
    padding: 0.35rem 0.85rem;
    border-radius: 8px;
    background: transparent;
    border: 1.5px solid #e5e7eb;
    color: #9ca3af;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.15s;
}

    .btn-logout:hover {
        background: #fef2f2;
        border-color: #fca5a5;
        color: #dc2626;
    }

/* ── Layout wrapper ── */
.layout-wrapper {
    display: flex;
    min-height: 100vh;
    background: #f4f6fb;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-left: 260px;
}

.page-content {
    flex: 1;
    padding: 2rem 2.5rem;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
}

    .nav-toggle span {
        display: block;
        width: 20px;
        height: 2px;
        background: #6b7280;
        border-radius: 2px;
    }

@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .page-content {
        padding: 1.25rem;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

        .sidebar.open {
            transform: translateX(0);
        }
}

/* ── TV License page extras ──────────────────────────────────────────────── */
.tv-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--color-primary);
    background: var(--color-primary-soft);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}

.license-info-bar {
    display: flex;
    gap: 1.5rem;
    padding: 0.6rem 0.75rem;
    background: var(--color-hover);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

/* ── Import page ────────────────────────────────────────────────────────── */
.import-template-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.import-template-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.import-icon {
    font-size: 2rem;
}

.import-template-header h3 {
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.import-template-header p {
    font-size: 0.85rem;
}

.column-map {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.4rem;
}

.col-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    background: var(--color-hover);
}

.col-num {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    background: var(--color-primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.col-name {
    font-weight: 600;
    color: var(--color-text);
}

.col-req {
    font-size: 0.72rem;
    color: var(--color-danger);
    margin-left: auto;
}

.col-opt {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    margin-left: auto;
}

.import-upload-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.upload-zone {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius);
    padding: 2.5rem;
    text-align: center;
    transition: all 0.2s;
    cursor: default;
}

    .upload-zone.dragging {
        border-color: var(--color-primary);
        background: var(--color-primary-soft);
    }

.upload-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.upload-icon {
    font-size: 2.5rem;
}

.upload-prompt p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin: 0;
}

.upload-selected {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.import-result-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

    .import-result-card h2 {
        margin-bottom: 1rem;
    }

.import-result-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.result-stat {
    text-align: center;
    padding: 1rem;
    border-radius: var(--radius);
}

.result-num {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.3rem;
}

.result-label {
    font-size: 0.8rem;
}

.result-success {
    background: var(--color-success-soft);
    color: var(--color-success);
}

.result-warning {
    background: var(--color-warning-soft);
    color: var(--color-warning);
}

.result-danger {
    background: var(--color-danger-soft);
    color: var(--color-danger);
}

.result-neutral {
    background: var(--color-hover);
    color: var(--color-text-muted);
}

@media (max-width: 600px) {
    .import-result-stats {
        grid-template-columns: 1fr 1fr;
    }
}

/* ── Fee Rates page ──────────────────────────────────────────────────────── */
.current-rate-card {
    display: flex;
    gap: 2rem;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    color: white;
    box-shadow: 0 4px 20px rgba(99,102,241,0.3);
}

.current-rate-left {
    flex: 1;
}

.current-rate-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.7;
    margin-bottom: 0.5rem;
}

.current-rate-value {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.current-rate-sub {
    font-size: 0.85rem;
    opacity: 0.6;
}

.current-rate-right {
    background: rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    min-width: 260px;
}

.rate-example {
}

.rate-ex-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.6;
    margin-bottom: 0.75rem;
}

.rate-ex-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 0.85rem;
}

    .rate-ex-row:last-child {
        border-bottom: none;
    }

    .rate-ex-row span {
        opacity: 0.7;
    }

    .rate-ex-row strong {
        font-family: var(--font-mono);
    }

.row-active-rate td {
    background: rgba(5,150,105,0.05);
}

/* ── Bulk Billing page ───────────────────────────────────────────────────── */
.billing-config-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.billing-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.billing-result-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
}

.billing-result-header {
    margin-bottom: 1.25rem;
}

.billing-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.bstat {
    text-align: center;
    padding: 1.25rem 1rem;
    border-radius: var(--radius);
}

.bstat-num {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.35rem;
    letter-spacing: -0.02em;
}

.bstat-label {
    font-size: 0.78rem;
    font-weight: 500;
}

.bstat-blue {
    background: #eff6ff;
    color: #1d4ed8;
}

.bstat-green {
    background: var(--color-success-soft);
    color: var(--color-success);
}

.bstat-yellow {
    background: var(--color-warning-soft);
    color: var(--color-warning);
}

.bstat-purple {
    background: #f5f3ff;
    color: #7c3aed;
}

@media (max-width: 768px) {
    .billing-stats {
        grid-template-columns: 1fr 1fr;
    }

    .current-rate-card {
        flex-direction: column;
    }

    .current-rate-value {
        font-size: 2rem;
    }
}

/* ── Customer detail page ────────────────────────────────────────────────── */
.detail-two-col {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.detail-profile-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

    .detail-profile-card h3 {
        font-size: 0.9rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--color-text-muted);
        margin-bottom: 0.5rem;
    }

.detail-summary-col {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.summary-stat-card {
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    text-align: center;
}

.summary-num {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.summary-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.summary-sub {
    font-size: 0.75rem;
    margin-top: 0.2rem;
    opacity: 0.7;
}

.summary-blue {
    background: #eff6ff;
    color: #1d4ed8;
}

.summary-green {
    background: var(--color-success-soft);
    color: var(--color-success);
}

.summary-red {
    background: var(--color-danger-soft);
    color: var(--color-danger);
}

.summary-purple {
    background: #f5f3ff;
    color: #7c3aed;
}

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.detail-tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 1.25rem;
}

.tab-btn {
    padding: 0.65rem 1.25rem;
    border: none;
    background: none;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
}

    .tab-btn:hover {
        color: var(--color-text);
    }

    .tab-btn.active {
        color: var(--color-primary);
        border-bottom-color: var(--color-primary);
        font-weight: 600;
    }

/* ── Reports page ────────────────────────────────────────────────────────── */
.report-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
}

.report-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

    .report-card-header h2 {
        font-size: 1.1rem;
        margin-bottom: 0.2rem;
    }

    .report-card-header p {
        font-size: 0.85rem;
    }

.report-filters {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .detail-two-col {
        grid-template-columns: 1fr;
    }

    .detail-summary-col {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .summary-stat-card {
        flex: 1;
        min-width: 140px;
    }
}

/* ── Bill create modal — customer search ─────────────────────────────────── */
.customer-search-results {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-top: -0.5rem;
    margin-bottom: 0.75rem;
    max-height: 220px;
    overflow-y: auto;
}

.customer-result-item {
    padding: 0.65rem 0.875rem;
    cursor: pointer;
    border-bottom: 1px solid var(--color-border);
    transition: background 0.12s;
}

    .customer-result-item:last-child {
        border-bottom: none;
    }

    .customer-result-item:hover {
        background: var(--color-hover);
    }

    .customer-result-item.selected {
        background: var(--color-primary-soft);
        border-left: 3px solid var(--color-primary);
    }

.cri-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.2rem;
}

.cri-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.selected-customer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.875rem;
    background: var(--color-primary-soft);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.overdue-date {
    color: var(--color-danger);
    font-weight: 600;
}
