/* style.css - Premium Light-Theme Neo-Bank Design System for Dubai Accounting Dashboard */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --bg-dark: #f8fafc; /* Soft clean gray-white background */
    --bg-panel: #ffffff; /* Pure white sidebar and cards */
    --bg-panel-solid: #ffffff;
    --border-color: #e2e8f0; /* Fine light border */
    --border-glow: rgba(14, 165, 233, 0.15); /* Soft sky blue glow */
    
    --text-primary: #0f172a; /* Deep slate gray */
    --text-muted: #64748b; /* Cool slate gray */
    
    --primary: #0284c7; /* Sky blue primary accent */
    --primary-gradient: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    --success: #10b981; /* Emerald green */
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;
    --danger: #ef4444; /* Rose red */
    --danger-bg: #fff1f2;
    --danger-border: #fecdd3;
    --warning: #f59e0b; /* Amber yellow */
    --warning-bg: #fef3c7;
    --warning-border: #fde68a;
    
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

a {
    color: inherit;
    text-decoration: none;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: 260px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 2.5rem 1.5rem;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.45rem;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3.5rem;
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-gradient);
    border-radius: 9px;
    position: relative;
}

.brand-icon::after {
    content: '';
    position: absolute;
    inset: 7px;
    background: var(--bg-panel);
    border-radius: 4px;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.1rem;
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-item a:hover {
    color: var(--text-primary);
    background: #f1f5f9;
}

.nav-item.active a {
    color: var(--primary);
    background: #e0f2fe;
    font-weight: 600;
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e0f2fe;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--primary);
}

.user-info .username {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-info .user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Content Area */
.main-content {
    flex: 1;
    min-width: 0;
    width: calc(100% - 260px);
    max-width: 100%;
    margin-left: 260px;
    padding: 2.5rem 3.5rem;
    min-height: 100vh;
    box-sizing: border-box;
}

/* Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.page-title h1 {
    font-size: 1.85rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.page-title p {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Currency Switcher Toggle */
.currency-selector {
    display: flex;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    padding: 3px;
    border-radius: 11px;
}

.currency-btn {
    padding: 0.4rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
}

.currency-btn.active {
    background: #ffffff;
    color: var(--text-primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

/* Item Sort Order Selector Toggle */
.item-order-selector {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    padding: 3px;
    border-radius: 11px;
}

.item-order-btn {
    padding: 0.4rem 0.85rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.item-order-btn:hover {
    color: var(--text-primary);
}

.item-order-btn.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
    font-weight: 700;
}


/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Premium White Cards */
.glass-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.75rem;
    position: relative;
    box-shadow: var(--shadow-premium);
    transition: var(--transition);
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.01);
    border-color: #cbd5e1;
}

/* Stat Cards */
.stat-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 125px;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-icon-wrapper {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card.receivables {
    background: #f0fdf4;
    border-color: #dcfce7;
}
.stat-card.receivables .stat-icon-wrapper {
    background: #bbf7d0;
    color: #166534;
}
.stat-card.receivables .stat-value {
    color: #166534;
}

.stat-card.payables {
    background: #fff5f5;
    border-color: #fee2e2;
}
.stat-card.payables .stat-icon-wrapper {
    background: #fecaca;
    color: #991b1b;
}
.stat-card.payables .stat-value {
    color: #991b1b;
}

.stat-card.balance {
    background: #f0f9ff;
    border-color: #e0f2fe;
}
.stat-card.balance .stat-icon-wrapper {
    background: #bae6fd;
    color: #075985;
}
.stat-card.balance .stat-value {
    color: #075985;
}

.stat-value {
    font-size: 1.95rem;
    font-family: var(--font-heading);
    font-weight: 700;
    margin-top: 0.5rem;
    letter-spacing: -0.02em;
}

/* Grid Layout for Charts & Lists */
.content-grid-2-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    min-height: 350px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.chart-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Tables & Lists */
.card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-link {
    font-size: 0.88rem;
    color: var(--primary);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: var(--transition);
}

.btn-link:hover {
    color: #0369a1;
}

/* Custom Table styling */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.custom-table th {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: #f8fafc;
}

.custom-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.92rem;
    vertical-align: middle;
    color: #334155;
}

.custom-table tbody tr {
    transition: var(--transition);
}

.custom-table tbody tr:hover {
    background: #f8fafc;
}

/* Badges */
.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.badge-success {
    background: var(--success-bg);
    color: #065f46;
    border: 1px solid var(--success-border);
}

.badge-danger {
    background: var(--danger-bg);
    color: #991b1b;
    border: 1px solid var(--danger-border);
}

.badge-warning {
    background: var(--warning-bg);
    color: #92400e;
    border: 1px solid var(--warning-border);
}

.badge-info {
    background: #f0f9ff;
    color: #075985;
    border: 1px solid #bae6fd;
}

/* Buttons */
.btn-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    border: none;
    padding: 0.65rem 1.3rem;
    border-radius: 10px;
    font-weight: 600;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.15);
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(2, 132, 199, 0.25);
    background: #0369a1;
}

/* Filters & Inputs */
.filter-row {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-input {
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.1rem;
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.88rem;
    outline: none;
    min-width: 170px;
    transition: var(--transition);
}

.filter-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.08);
}

/* Reports Styles */
.report-section {
    margin-bottom: 2rem;
}

.report-section-title {
    font-size: 1.15rem;
    font-weight: 600;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
    color: var(--primary);
}

.report-row {
    display: flex;
    justify-content: space-between;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
    color: #334155;
}

.report-row.subtotal {
    font-weight: 600;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    background: #f8fafc;
    color: var(--text-primary);
}

.report-row.total {
    font-weight: 700;
    font-size: 1.2rem;
    border-top: 2px solid var(--border-color);
    border-bottom: 2px double var(--border-color);
    background: #f0f9ff;
    color: var(--primary);
}

.report-row.indent {
    padding-left: 2rem;
}

.reports-layout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
}

/* Icons */
.lucide {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    stroke: currentColor;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
        padding: 2.5rem 0.5rem;
        align-items: center;
    }
    
    .brand-icon {
        margin-bottom: 0;
    }
    
    .brand span, .nav-item span, .user-info, .sidebar-footer {
        display: none;
    }
    
    .brand {
        margin-bottom: 2.5rem;
    }
    
    .main-content {
        margin-left: 80px;
        padding: 2.5rem 1.5rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .content-grid-2-1 {
        grid-template-columns: 1fr;
    }
    
    .reports-layout-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Standard UAE Corporate Letterhead System
   ========================================================================== */

.lh-container {
    width: 100%;
    margin-bottom: 1.25rem;
    font-family: var(--font-body);
}

.lh-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    gap: 1.5rem;
}

.lh-brand-en {
    flex: 1;
    text-align: left;
}

.lh-en-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: #0f172a;
    line-height: 1.1;
    text-transform: uppercase;
}

.lh-en-subtitle {
    font-size: 0.82rem;
    font-weight: 700;
    color: #b8860b;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-top: 2px;
}

.lh-en-lic {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
    margin-top: 2px;
}

.lh-brand-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem;
}

.lh-brand-ar {
    flex: 1;
    text-align: right;
    direction: rtl;
    font-family: 'Amiri', 'Traditional Arabic', 'Segoe UI', serif;
}

.lh-ar-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
}

.lh-ar-subtitle {
    font-size: 0.85rem;
    font-weight: 700;
    color: #b8860b;
    margin-top: 2px;
}

.lh-ar-lic {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
    margin-top: 2px;
}

.lh-divider-rule {
    height: 0;
    border-top: 2px solid #0f172a;
    border-bottom: 1px dashed #d4af37;
    margin-bottom: 1rem;
}

/* Document Banner (Light High-Contrast Corporate Banner) */
.lh-doc-banner {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #b8860b;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.lh-main-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 900;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    line-height: 1.1;
}

.lh-sub-title {
    font-size: 0.8rem;
    color: #64748b;
    display: block;
    margin-top: 2px;
    font-weight: 500;
}

.lh-doc-meta {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    font-size: 0.85rem;
}

.lh-meta-item {
    color: #475569;
}

.lh-meta-item strong {
    color: #0f172a;
}

.lh-meta-status {
    display: inline-block;
}

/* FOOTER COMPONENT (STAMP, EMAIL, SIGNATURE - DISPLAYED ONLY ON PDF EXPORT & PRINT) */
.lh-footer-container {
    display: none;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1.5px solid #cbd5e1;
    page-break-inside: avoid;
}

.lh-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

/* Corporate Blue Ink Stamp */
.lh-stamp-wrapper {
    flex-shrink: 0;
    position: relative;
}

.lh-ink-stamp {
    transform: rotate(-10deg);
    transition: transform 0.2s ease;
    filter: drop-shadow(0 2px 4px rgba(30, 64, 175, 0.15));
}

.lh-email-pill {
    display: inline-block;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #0f172a !important;
    margin-bottom: 0.35rem;
    white-space: nowrap;
}

.lh-footer-address-sm {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 500;
}

/* Signature Section */
.lh-sig-wrapper {
    text-align: center;
    min-width: 170px;
    flex-shrink: 0;
}

.lh-sig-art {
    margin-bottom: 0;
}

.lh-sig-name {
    font-size: 0.9rem;
    font-weight: 800;
    color: #0f172a;
    font-family: var(--font-heading);
    line-height: 1.1;
}

.lh-sig-role {
    font-size: 0.7rem;
    font-weight: 700;
    color: #b8860b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.lh-sign-stamp-group {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
}

/* STATEMENT CARD WEB DASHBOARD VS PDF/PRINT LAYOUT */
#statement-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem 2.5rem;
    max-width: 1280px;
    margin: 0 auto 3rem auto;
    box-shadow: var(--shadow-premium);
    box-sizing: border-box;
    color: var(--text-primary);
    transition: var(--transition);
}

body.is-pdf-export {
    background: #ffffff !important;
    color: #0f172a !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
}

body.is-pdf-export .sidebar,
body.is-pdf-export .top-header,
body.is-pdf-export .filter-row,
body.is-pdf-export .back-nav,
body.is-pdf-export .currency-selector,
body.is-pdf-export .item-order-selector,
body.is-pdf-export .print-btn,
body.is-pdf-export .print-hide,
body.is-pdf-export .lh-style-selector-bar {
    display: none !important;
}

body.is-pdf-export .main-content {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

body.is-pdf-export #statement-card,
body.is-pdf-export #invoice-card,
body.is-pdf-export #receipt-card,
body.is-pdf-export .reports-card {
    background: #ffffff !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0.75rem 1rem !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    margin: 0 !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    color: #0f172a !important;
}

body.is-pdf-export .statement-table {
    width: 100% !important;
    table-layout: fixed !important;
    font-size: 0.78rem !important;
    margin-bottom: 1.25rem !important;
}

body.is-pdf-export .statement-table th {
    padding: 0.5rem 0.3rem !important;
    font-size: 0.68rem !important;
    letter-spacing: 0.01em !important;
    box-sizing: border-box !important;
}

body.is-pdf-export .statement-table td,
body.is-pdf-export .statement-table th {
    padding: 0.5rem 0.35rem !important;
    font-size: 0.72rem !important;
    box-sizing: border-box !important;
    line-height: 1.3 !important;
}

body.is-pdf-export .statement-table td.ref-col,
body.is-pdf-export .statement-table th.ref-col {
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    padding-right: 0.5rem !important;
}

body.is-pdf-export .statement-table td.num-col,
body.is-pdf-export .statement-table th.num-col {
    text-align: right !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    letter-spacing: -0.01em !important;
    font-size: 0.7rem !important;
    padding-left: 0.25rem !important;
    padding-right: 0.25rem !important;
}

body.is-pdf-export .partner-card {
    padding: 0.75rem 1rem !important;
    margin-bottom: 1rem !important;
    gap: 1rem !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

body.is-pdf-export .partner-detail label {
    font-size: 0.65rem !important;
}

body.is-pdf-export .partner-detail span {
    font-size: 0.88rem !important;
}

body.is-pdf-export .balance-summary-grid {
    gap: 0.45rem !important;
    margin-bottom: 1.25rem !important;
}

body.is-pdf-export .summary-box {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
    padding: 0.55rem 0.5rem !important;
}

body.is-pdf-export .summary-title {
    font-size: 0.58rem !important;
    color: #64748b !important;
}

body.is-pdf-export .summary-value {
    font-size: 0.92rem !important;
    color: #0f172a !important;
    letter-spacing: normal !important;
}

body.is-pdf-export .b2b-meta-grid {
    padding: 0.85rem 0 !important;
    margin-bottom: 1.25rem !important;
    gap: 1rem !important;
}

body.is-pdf-export .b2b-table {
    width: 100% !important;
    table-layout: fixed !important;
}

body.is-pdf-export .b2b-table th,
body.is-pdf-export .b2b-table td {
    padding: 0.5rem 0.45rem !important;
    font-size: 0.78rem !important;
    box-sizing: border-box !important;
}

body.is-pdf-export .lh-footer-container {
    display: block !important;
    margin-top: 1.25rem !important;
    padding-top: 0.75rem !important;
    border-top: 1px solid #cbd5e1 !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
}

/* COMPACT INVOICE CARD & TABLE SPACING FOR SINGLE-PAGE PRINT */
.b2b-meta-grid {
    padding: 1rem 0 !important;
    margin-bottom: 1.5rem !important;
}

.b2b-table th, .b2b-table td {
    padding: 0.65rem 0.85rem !important;
}

.totals-container {
    margin-top: 1rem !important;
}

/* AUTHENTICATION & SIDEBAR USER CONTROLS */
.profile-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.btn-profile-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: #f8fafc;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.btn-profile-action:hover {
    background-color: #e2e8f0;
    color: var(--text-primary);
}

.btn-profile-action.logout:hover {
    background-color: #fef2f2;
    color: #ef4444;
    border-color: #fecdd3;
}

/* MODAL SYSTEM */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: #ffffff;
    width: 90%;
    max-width: 480px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transform: translateY(20px);
    transition: all 0.25s ease;
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

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

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    background-color: #f8fafc;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.mb-3 {
    margin-bottom: 1rem;
}

/* TOAST NOTIFICATION SYSTEM */
.auth-toast-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 10000;
    transition: opacity 0.3s ease;
}

.auth-toast-notification.success {
    border-left: 4px solid var(--success);
}

.auth-toast-notification.error {
    border-left: 4px solid var(--danger);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

/* Audit & Reconciliation System Styles */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.metric-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.25rem;
    box-shadow: var(--shadow-premium);
    transition: var(--transition);
}

.metric-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.metric-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.metric-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.metric-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.badge-danger {
    background: #fee2e2;
    color: #ef4444;
    border: 1px solid #fca5a5;
}

.badge-warning {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fde68a;
}

.badge-success {
    background: #d1fae5;
    color: #10b981;
    border: 1px solid #6ee7b7;
}

@media (max-width: 1400px) {
    .main-content {
        padding: 2rem 2.25rem;
    }
}

@media (max-width: 1024px) {
    .main-content {
        padding: 1.5rem 1.5rem;
    }
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1.25rem 1rem;
    }
}

@media (max-width: 640px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}

/* PRINT MEDIA OVERRIDES (FORCE PERFECT SINGLE PAGE) */
@media print {
    @page {
        size: A4 portrait;
        margin: 8mm 10mm;
    }

    .print-hide, .lh-style-selector-bar {
        display: none !important;
    }

    html, body {
        background: #ffffff !important;
        color: #000000 !important;
        height: auto !important;
        font-size: 11.5px !important;
    }

    .app-container, .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }

    .invoice-card, .glass-card, .receipt-card {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
        page-break-inside: avoid !important;
    }

    .lh-top-bar {
        background: #000000 !important;
    }

    .lh-en-title {
        color: #000000 !important;
        -webkit-text-fill-color: #000000 !important;
    }

    .lh-doc-banner {
        background: #f8fafc !important;
        color: #000000 !important;
        border: 1px solid #cbd5e1 !important;
        border-left: 4px solid #b8860b !important;
    }

    .lh-main-title {
        color: #000000 !important;
    }

    .lh-sub-title {
        color: #475569 !important;
    }

    .lh-meta-item {
        color: #000000 !important;
    }

    .lh-footer-container {
        display: block !important;
        page-break-inside: avoid !important;
        margin-top: 1.25rem !important;
        padding-top: 0.75rem !important;
    }

    .lh-ink-stamp {
        filter: none !important;
    }
}

/* ==========================================================================
   Attachment UI Components (Neo-Bank Fintech Styling)
   ========================================================================== */

/* Attachment Card (Detail Views) */
.attachment-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-premium);
    margin-top: 1.5rem;
    transition: var(--transition);
}

.attachment-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.attachment-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.attachment-count-tag {
    background: var(--bg-dark);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.attachment-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: var(--transition);
}

.attachment-item:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
    transform: translateY(-1px);
}

.attachment-info {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
    flex: 1;
}

.attachment-file-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
    text-transform: uppercase;
}

.attachment-file-icon.pdf {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.attachment-file-icon.image {
    background: #e0e7ff;
    color: #4f46e5;
    border: 1px solid #c7d2fe;
}

.attachment-file-icon.doc {
    background: #dbeafe;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.attachment-file-icon.sheet {
    background: #dcfce7;
    color: #16a34a;
    border: 1px solid #86efac;
}

.attachment-file-icon.default {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.attachment-text-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.attachment-filename {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-submeta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.15rem;
}

.attachment-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-left: 1rem;
}

.btn-attach-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.775rem;
    font-weight: 600;
    border-radius: 8px;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
}

.btn-attach-view {
    background: #ffffff;
    color: var(--primary);
    border: 1px solid var(--border-color);
}

.btn-attach-view:hover {
    background: #f0f9ff;
    border-color: #7dd3fc;
    color: #0284c7;
}

.btn-attach-download {
    background: var(--primary);
    color: #ffffff;
    border: 1px solid var(--primary);
}

.btn-attach-download:hover {
    background: #0369a1;
    border-color: #0369a1;
    color: #ffffff;
}

/* Attachment Table Cell Badges & Dropdowns */
.attach-cell-badge {
    position: relative;
    display: inline-block;
}

.attach-badge-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.attach-badge-btn:hover, .attach-cell-badge:hover .attach-badge-btn {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #94a3b8;
}

.attach-popover {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1050;
    min-width: 240px;
    max-width: 320px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    padding: 0.5rem 0;
    margin-top: 0.35rem;
}

.attach-cell-badge:hover .attach-popover,
.attach-cell-badge:focus-within .attach-popover {
    display: block;
}

.attach-popover-header {
    padding: 0.4rem 0.85rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    letter-spacing: 0.04em;
}

.attach-popover-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.85rem;
    gap: 0.5rem;
    font-size: 0.775rem;
    color: var(--text-primary);
    transition: var(--transition);
    border-bottom: 1px solid #f1f5f9;
}

.attach-popover-item:last-child {
    border-bottom: none;
}

.attach-popover-item:hover {
    background: #f8fafc;
}

.attach-popover-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
    flex: 1;
}

.attach-popover-links {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.attach-popover-link {
    color: var(--primary);
    font-size: 0.725rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background: #f0f9ff;
}

.attach-popover-link:hover {
    background: #e0f2fe;
    color: #0369a1;
}

@media print {
    .attachment-card, .attach-cell-badge, .attach-popover {
        display: none !important;
    }
}

