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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --primary-glow: rgba(37, 99, 235, 0.15);
    --secondary: #0f172a;
    --secondary-light: #1e293b;
    --success: #10b981;
    --success-light: #ecfdf5;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --info: #0284c7;
    --info-light: #f0f9ff;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --sidebar-width: 270px;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow: 0 4px 14px -2px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 10px 25px -4px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.03);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    direction: rtl;
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    font-size: 13.5px;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    width: 100%;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ===================================================
   SIDEBAR (SLEEK EXECUTIVE SLATE DESIGN)
   =================================================== */
.sidebar {
    width: var(--sidebar-width);
    background: #0f172a;
    color: #f8fafc;
    border-left: 1px solid #1e293b;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    z-index: 100;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
}

.sidebar-header {
    padding: 22px 20px;
    border-bottom: 1px solid #1e293b;
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-badge {
    width: 46px;
    height: 46px;
    border-radius: var(--radius);
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(212, 175, 55, 0.45);
    flex-shrink: 0;
    padding: 0;
}

.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.brand-info h1 {
    font-size: 15px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.2px;
}

.brand-info span {
    font-size: 11px;
    color: #94a3b8;
    display: block;
    margin-top: 2px;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.menu-category {
    font-size: 10.5px;
    font-weight: 800;
    color: #64748b;
    padding: 14px 12px 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.menu-item:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    transform: translateX(-2px);
}

.menu-item.active {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.2) 0%, rgba(37, 99, 235, 0.35) 100%);
    color: #60a5fa;
    border-right: 3px solid #3b82f6;
    font-weight: 700;
}

.menu-item .icon {
    font-size: 17px;
    min-width: 22px;
    display: flex;
    justify-content: center;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid #1e293b;
    background: #090d16;
}

.mode-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.mode-indicator.sim {
    background: rgba(2, 132, 199, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(2, 132, 199, 0.3);
}

.mode-indicator.prod {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.7; }
    50% { transform: scale(1.35); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.7; }
}

/* ===================================================
   MAIN WRAPPER & TOPBAR
   =================================================== */
.main-wrapper {
    margin-right: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    max-width: calc(100% - var(--sidebar-width));
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background: var(--bg-main);
}

.topbar {
    min-height: 64px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    position: sticky;
    top: 0;
    z-index: 90;
    gap: 12px;
    width: 100%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.topbar-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    min-width: 0;
}

.topbar-title h2 {
    font-size: 16px;
    font-weight: 800;
    color: var(--secondary);
    white-space: nowrap;
}

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

.content-body {
    padding: 24px;
    flex: 1;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

/* ===================================================
   CARDS & CONTAINERS
   =================================================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ===================================================
   STATS GRID & STAT CARDS
   =================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: #cbd5e1;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-icon.blue {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #2563eb;
}
.stat-icon.green {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #059669;
}
.stat-icon.orange {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    color: #d97706;
}
.stat-icon.red {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: #dc2626;
}

.stat-details span {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-details h3 {
    font-size: 22px;
    font-weight: 900;
    color: var(--secondary);
    margin-top: 3px;
    letter-spacing: -0.5px;
}

/* ===================================================
   FORMS & INPUTS
   =================================================== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 12.5px;
    font-weight: 700;
    color: #334155;
}

.form-control {
    height: 42px;
    padding: 0 14px;
    border-radius: var(--radius-sm);
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: var(--text-main);
    font-size: 13px;
    outline: none;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-control::placeholder {
    color: #94a3b8;
}

textarea.form-control {
    height: auto;
    padding: 12px 14px;
    min-height: 85px;
    resize: vertical;
}

/* ===================================================
   TAX ID BANNER
   =================================================== */
.tax-id-banner {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: white;
    border-radius: var(--radius-lg);
    padding: 22px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tax-id-text span {
    font-size: 12px;
    color: #94a3b8;
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
}

.tax-id-value {
    font-family: monospace;
    font-size: 23px;
    font-weight: 800;
    letter-spacing: 2.5px;
    color: #38bdf8;
    direction: ltr;
    display: inline-block;
    text-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

/* ===================================================
   TABLES
   =================================================== */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #ffffff;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
    font-size: 13px;
}

th {
    background: #0b1930;
    color: #ffffff;
    padding: 14px 16px;
    font-weight: 800;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    font-size: 12px;
}

td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: #f8fafc;
}

/* ===================================================
   BUTTONS
   =================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    box-sizing: border-box;
    line-height: 1.2;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}
.btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}
.btn-secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.btn-danger {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}
.btn-danger:hover {
    background: #fecaca;
    color: #b91c1c;
}

.btn-sm {
    height: 32px;
    padding: 0 10px;
    font-size: 11.5px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    gap: 5px;
}

/* ===================================================
   BADGES
   =================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.badge-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.badge-warning { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.badge-danger { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.badge-info { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.badge-gray { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }

/* ===================================================
   MODALS
   =================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

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

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.25);
    padding: 28px;
    position: relative;
    border: 1px solid var(--border);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 800;
    color: var(--secondary);
}

.modal-close {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* ===================================================
   SUMMARY & TOTALS BOX
   =================================================== */
.summary-box {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-top: 24px;
    box-shadow: var(--shadow-sm);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13.5px;
    color: #475569;
}

.summary-row.total {
    border-top: 2px dashed #cbd5e1;
    margin-top: 10px;
    padding-top: 14px;
    font-size: 17px;
    font-weight: 900;
    color: var(--secondary);
}

.summary-row.total .amount {
    color: #2563eb;
    font-size: 20px;
    font-family: monospace;
}

/* ===================================================
   PRINT STYLES
@page {
    size: A4 landscape;
    margin: 0.4cm;
}

@media print {
    html, body {
        background: white !important;
        color: black !important;
        margin: 0 !important;
        padding: 0 !important;
        font-family: 'Vazirmatn', sans-serif !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    .sidebar, .topbar, .btn, .no-print, .modal-overlay, .login-overlay, .main-wrapper > header, .view-section {
        display: none !important;
    }
    .main-wrapper, .main-content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    #printArea {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .header-table, .content-table {
        border-collapse: collapse !important;
    }
    .header-table td, .content-table th, .content-table td {
        border: 1px solid #000 !important;
    }
    table, tr, td, th {
        page-break-inside: avoid;
    }
}

/* Operation buttons & Badges matching reference */
.tax-id-preview {
    display: inline-block;
    font-family: monospace;
    font-size: 11px;
    font-weight: 800;
    color: #0369a1;
    background: #e0f2fe;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}
.btn-action-correct {
    background: #0284c7;
    color: white;
    border: none;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
}
.btn-action-cancel {
    background: #dc2626;
    color: white;
    border: none;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
}
.btn-action-return {
    background: #d97706;
    color: white;
    border: none;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
}
.btn-action-print {
    background: #f0f9ff;
    border: 1px solid #0284c7;
    color: #0284c7;
    font-size: 13px;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.2s ease;
}
.btn-action-print:hover {
    background: #0284c7;
    color: white;
}
.btn-action-view {
    background: #0284c7;
    color: white;
    border: 1px solid #0284c7;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    text-decoration: none;
    transition: all 0.2s ease;
}
.btn-action-view:hover {
    background: #0369a1;
    border-color: #0369a1;
}

/* ===================================================
   RESPONSIVE DESIGN FOR ALL BROWSER SIZES & RESOLUTIONS
   =================================================== */
@media (max-width: 1200px) {
    :root {
        --sidebar-width: 240px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 992px) {
    :root {
        --sidebar-width: 260px;
    }
    .sidebar {
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 9999;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: -8px 0 32px rgba(0, 0, 0, 0.4);
    }
    .main-wrapper {
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .mobile-menu-btn {
        display: inline-flex !important;
    }
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.5);
        backdrop-filter: blur(4px);
        z-index: 9998;
        display: none;
    }
    .sidebar-backdrop.active {
        display: block;
    }
}

/* ===================================================
   AUTHENTICATION & LOGIN OVERLAY
   =================================================== */
/* ===================================================
   AUTHENTICATION & LOGIN OVERLAY (REDESIGNED)
   =================================================== */
.login-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 50% 18%, #1e3a5f 0%, #0b1930 45%, #050d1a 100%);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(14px);
    overflow-y: auto;
}

.login-card-container {
    position: relative;
    width: 100%;
    max-width: 460px;
    margin: auto;
}

.login-ambient-glow {
    position: absolute;
    top: -25px;
    left: -25px;
    right: -25px;
    bottom: -25px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.16) 0%, rgba(11, 25, 48, 0) 70%);
    pointer-events: none;
    z-index: 0;
    filter: blur(28px);
}

.login-card {
    position: relative;
    z-index: 1;
    background: #ffffff;
    border-radius: 18px;
    padding: 34px 30px 24px 30px;
    box-shadow: 0 25px 65px -10px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(212, 175, 55, 0.35);
    border-top: 4px solid #d4af37;
    animation: loginFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginFadeIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-logo-ring {
    width: 82px;
    height: 82px;
    margin: 0 auto 14px auto;
    border-radius: 50%;
    background: #000000;
    border: 2px solid #d4af37;
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3);
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform 0.3s ease;
}
.login-logo-ring:hover {
    transform: scale(1.05) rotate(2deg);
}
.login-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.login-header {
    text-align: center;
    margin-bottom: 20px;
}

.login-header h2 {
    font-size: 20px;
    font-weight: 900;
    color: #0b1930;
    margin: 0 0 5px 0;
}

.login-subtitle {
    font-size: 12px;
    color: #64748b;
    margin: 0 0 10px 0;
    line-height: 1.5;
}

.login-security-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Alert / Lockout Box */
.login-alert-box {
    margin-top: 14px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    line-height: 1.5;
    animation: alertSlideDown 0.25s ease-out;
}
@keyframes alertSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-alert-box.danger {
    background: #fef2f2;
    border: 1.5px solid #f87171;
    color: #991b1b;
}

.login-alert-box.warning {
    background: #fffbeb;
    border: 1.5px solid #fcd34d;
    color: #92400e;
}

.login-alert-box.locked {
    background: #fff1f2;
    border: 1.5px solid #e11d48;
    color: #9f1239;
    box-shadow: 0 4px 14px rgba(225, 29, 72, 0.15);
}

.login-alert-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: -2px;
}

.login-alert-content {
    flex: 1;
}

.login-alert-title {
    display: block;
    font-size: 12.5px;
    margin-bottom: 3px;
}

.login-lockout-timer {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(225, 29, 72, 0.3);
    font-size: 12px;
    font-weight: 700;
}

.timer-progress-bar {
    height: 5px;
    background: #fecdd3;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}
.timer-progress-fill {
    height: 100%;
    width: 100%;
    background: #e11d48;
    transition: width 1s linear;
}

/* Form Groups & Inputs */
.login-form-group {
    margin-bottom: 16px;
    text-align: right;
}
.login-form-group label {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
}
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}
.field-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    color: #94a3b8;
    pointer-events: none;
    z-index: 2;
}
.login-input {
    height: 46px !important;
    padding-right: 38px !important;
    padding-left: 38px !important;
    font-size: 13.5px !important;
    border-radius: 8px !important;
    border: 1.5px solid #cbd5e1 !important;
    direction: ltr !important;
    text-align: right !important;
    transition: all 0.2s ease !important;
}
.login-input:focus {
    border-color: #d4af37 !important;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.22) !important;
}
.btn-toggle-password {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 16px;
    padding: 6px;
    border-radius: 6px;
    transition: color 0.15s ease;
    z-index: 2;
}
.btn-toggle-password:hover {
    color: #0b1930;
}
.caps-lock-warning {
    font-size: 11px;
    color: #d97706;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.login-submit-btn {
    width: 100%;
    height: 48px;
    font-size: 15px;
    font-weight: 800;
    border-radius: 8px;
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}
.login-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    background: #94a3b8 !important;
    border-color: #64748b !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Quick test accounts */
.login-quick-accounts {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.quick-accounts-title {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    display: block;
    margin-bottom: 8px;
}
.quick-accounts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.quick-acc-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    text-align: right;
    transition: all 0.2s ease;
}
.quick-acc-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.quick-acc-btn.admin:hover {
    border-color: #d4af37;
    background: #fdfaf0;
}
.quick-acc-btn.accountant:hover {
    border-color: #10b981;
    background: #f0fdf4;
}
.quick-acc-btn .acc-icon {
    font-size: 20px;
    flex-shrink: 0;
}
.quick-acc-btn .acc-info strong {
    display: block;
    font-size: 11.5px;
    color: #0f172a;
}
.quick-acc-btn .acc-info span {
    display: block;
    font-size: 10px;
    color: #64748b;
}

.login-footer-info {
    margin-top: 16px;
    text-align: center;
    font-size: 10.5px;
    color: #94a3b8;
}

/* ==================== ROLE-SPECIFIC PANELS (ACCOUNTANT VS ADMIN) ==================== */
.badge-accountant {
    background: #059669 !important;
    color: #ffffff !important;
    border: 1px solid #10b981 !important;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
}

.badge-admin {
    background: linear-gradient(135deg, #d4af37, #ab7f1e) !important;
    color: #0b1930 !important;
    border: 1px solid #f6dc86 !important;
    font-weight: 800;
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.3);
}

body.role-accountant-active .topbar {
    border-bottom: 2px solid #10b981;
}

body.role-accountant-active #topbarUserPill {
    background: #ecfdf5 !important;
    border-color: #a7f3d0 !important;
}

body.role-admin-active .topbar {
    border-bottom: 2px solid #d4af37;
}

body.role-admin-active #topbarUserPill {
    background: #fdf6e2 !important;
    border-color: #f1dfa8 !important;
}

.accountant-quick-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.filter-pill-btn {
    border: 1px solid var(--border);
    background: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-main);
}

.filter-pill-btn:hover, .filter-pill-btn.active {
    background: #059669;
    color: #fff;
    border-color: #047857;
}

/* ===================================================
   SMART PRODUCT AUTOCOMPLETE & INVOICE ROW PICKER
   =================================================== */
.product-picker-wrap {
    position: relative;
    width: 100%;
}

.product-input-group {
    display: flex;
    align-items: center;
    position: relative;
    gap: 5px;
}

.product-name-input {
    flex: 1;
    height: 38px !important;
    padding-right: 30px !important;
    padding-left: 10px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    transition: all 0.2s ease;
}

.product-name-input:focus {
    border-color: #b58c28 !important;
    box-shadow: 0 0 0 3px rgba(181, 140, 40, 0.2) !important;
}

.product-input-icon {
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: #94a3b8;
    pointer-events: none;
    z-index: 2;
}

.btn-browse-products {
    height: 38px;
    padding: 0 10px;
    font-size: 11.5px;
    font-weight: 700;
    background: #f8fafc;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.btn-browse-products:hover {
    background: #e2e8f0;
    border-color: #b58c28;
    color: #b58c28;
}

.product-autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    min-width: 380px;
    max-width: 480px;
    background: #ffffff;
    border: 1.5px solid #d4af37;
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(11, 25, 48, 0.22);
    z-index: 9999;
    max-height: 290px;
    overflow-y: auto;
    direction: rtl;
    padding: 4px 0;
}

.product-dropdown-header {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 800;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-suggestion-item {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    transition: background 0.15s ease;
}

.product-suggestion-item:last-child {
    border-bottom: none;
}

.product-suggestion-item:hover,
.product-suggestion-item.active {
    background: #fff8e6;
}

.product-sugg-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #0f172a;
    display: block;
    margin-bottom: 2px;
}

.product-sugg-meta {
    font-size: 11px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.product-sugg-code {
    font-family: monospace;
    background: #e2e8f0;
    padding: 1px 6px;
    border-radius: 4px;
    color: #1e293b;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.product-sugg-price {
    font-size: 12px;
    font-weight: 800;
    color: #059669;
    white-space: nowrap;
    text-align: left;
}

.product-sugg-empty {
    padding: 16px 12px;
    text-align: center;
    color: #64748b;
    font-size: 12px;
}

.product-sugg-add-new {
    padding: 9px 12px;
    background: #fdfaf0;
    border-top: 1px solid #f1dfa8;
    color: #92701c;
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.product-sugg-add-new:hover {
    background: #fceec5;
    color: #0b1930;
}




