/* ============================================================
   SoloIX Member Portal — Dark Theme Stylesheet
   Premium glassmorphism design with dark navy palette
   ============================================================ */

/* ---- CSS Custom Properties ---- */
:root {
    /* Base colors */
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.8);
    --bg-card-hover: rgba(30, 41, 59, 0.9);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);
    --bg-input: rgba(255, 255, 255, 0.06);

    /* Accent colors */
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-glow: rgba(59, 130, 246, 0.3);
    --accent-soft: rgba(59, 130, 246, 0.15);

    /* Text colors */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #0f172a;

    /* Status colors */
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.15);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.15);

    /* Border */
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --border-accent: rgba(59, 130, 246, 0.4);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.2);

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Layout */
    --nav-height: 64px;
    --container-max: 1200px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animated gradient background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(6, 182, 212, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    height: auto;
}

/* ---- Navigation ---- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: background 0.3s ease;
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
}

.nav-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
}

.nav-title {
    background: linear-gradient(135deg, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    text-decoration: none;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-glass-hover);
}

.nav-link.active {
    color: var(--accent);
    background: var(--accent-soft);
}

.nav-link svg {
    flex-shrink: 0;
}

/* User Dropdown */
.nav-user {
    position: relative;
}

.user-dropdown {
    position: relative;
}

.user-button {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 6px 14px 6px 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-family);
    font-size: 0.875rem;
}

.user-button:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-hover);
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: white;
}

.user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 1001;
    overflow: hidden;
}

.dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.dropdown-code {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: all 0.15s ease;
    text-decoration: none;
}

.dropdown-item:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}

.dropdown-item-danger:hover {
    color: var(--danger);
    background: var(--danger-bg);
}

.dropdown-divider {
    border-top: 1px solid var(--border);
    margin: 4px 0;
}

/* ---- Main Content ---- */
.main-content {
    flex: 1;
    padding-top: calc(var(--nav-height) + 24px);
    padding-bottom: 40px;
    position: relative;
    z-index: 1;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

/* ---- Page Title ---- */
.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

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

/* ---- Cards ---- */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

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

.card-action {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 500;
}

/* Summary Cards Grid */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.summary-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.summary-card:nth-child(1)::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.summary-card:nth-child(2)::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.summary-card:nth-child(3)::before { background: linear-gradient(90deg, #22c55e, #4ade80); }
.summary-card:nth-child(4)::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.summary-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow);
}

.summary-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 1.3rem;
}

.summary-card:nth-child(1) .summary-icon { background: var(--info-bg); }
.summary-card:nth-child(2) .summary-icon { background: rgba(139, 92, 246, 0.15); }
.summary-card:nth-child(3) .summary-icon { background: var(--success-bg); }
.summary-card:nth-child(4) .summary-icon { background: var(--warning-bg); }

.summary-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.summary-value.currency {
    font-family: var(--font-mono);
    font-size: 1.3rem;
}

/* ---- Tables ---- */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table thead {
    background: rgba(255, 255, 255, 0.03);
}

.data-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.data-table th:hover {
    color: var(--accent);
}

.data-table th.sort-asc::after {
    content: ' ↑';
    color: var(--accent);
}

.data-table th.sort-desc::after {
    content: ' ↓';
    color: var(--accent);
}

.data-table th.no-sort {
    cursor: default;
}

.data-table th.no-sort:hover {
    color: var(--text-muted);
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background 0.15s ease;
}

.data-table tbody tr:hover {
    background: var(--bg-glass-hover);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table .col-amount,
.data-table .col-currency {
    font-family: var(--font-mono);
    text-align: right;
    white-space: nowrap;
}

.data-table .col-date {
    white-space: nowrap;
}

.data-table .col-actions {
    text-align: right;
    white-space: nowrap;
}

.table-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.table-empty svg {
    margin-bottom: 12px;
    opacity: 0.4;
}

/* ---- Status Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-paid {
    background: var(--success-bg);
    color: var(--success);
}

.badge-unpaid {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-overdue {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-partial {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
}

.badge-default {
    background: var(--bg-glass);
    color: var(--text-muted);
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #2563eb);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover), #3b82f6);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
    color: white;
}

.btn-secondary {
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-icon {
    padding: 8px;
    border-radius: var(--radius-sm);
}

.btn-download {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.btn-download:hover {
    background: rgba(34, 197, 94, 0.25);
    color: var(--success);
}

/* ---- Forms ---- */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.9rem;
    transition: all 0.2s ease;
    outline: none;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: rgba(255, 255, 255, 0.08);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ---- Alerts ---- */
.alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-size: 0.875rem;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.alert-info {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.alert-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
    padding: 0 4px;
    line-height: 1;
}

.alert-close:hover {
    opacity: 1;
}

/* ---- Login Page ---- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg-primary);
}

.login-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(59, 130, 246, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.5s ease;
}

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
}

.login-logo img {
    max-width: 80px;
    max-height: 80px;
    object-fit: contain;
}

.login-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 32px;
}

.login-form .btn-primary {
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 0.95rem;
    margin-top: 8px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ---- Invoice Detail ---- */
.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 24px;
}

.invoice-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.invoice-brand img {
    max-width: 60px;
    max-height: 60px;
    object-fit: contain;
}

.invoice-brand-name {
    font-size: 1.2rem;
    font-weight: 700;
}

.invoice-brand-details {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.invoice-title-badge {
    text-align: right;
}

.invoice-title-badge h1 {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.invoice-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.invoice-meta-group {
    padding: 20px;
    background: var(--bg-glass);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.invoice-meta-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.invoice-meta-value {
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.invoice-totals {
    margin-left: auto;
    width: 300px;
    margin-top: 24px;
}

.invoice-total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.invoice-total-row.total {
    border-top: 2px solid var(--border);
    padding-top: 12px;
    margin-top: 4px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.invoice-total-row.balance-due {
    border-top: 2px solid var(--accent);
    padding-top: 12px;
    margin-top: 4px;
    font-size: 1.2rem;
    font-weight: 700;
}

.invoice-total-row.balance-due .amount-paid {
    color: var(--success);
}

.invoice-total-row.balance-due .amount-due {
    color: var(--danger);
}

.invoice-total-row.balance-due .amount-zero {
    color: var(--success);
}

.invoice-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

/* ---- Two-Column Grid ---- */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* ---- Footer ---- */
.footer {
    padding: 24px 0;
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 1;
}

.footer p {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ---- Animations ---- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.animate-in {
    animation: fadeInUp 0.4s ease forwards;
}

.animate-in:nth-child(1) { animation-delay: 0s; }
.animate-in:nth-child(2) { animation-delay: 0.05s; }
.animate-in:nth-child(3) { animation-delay: 0.1s; }
.animate-in:nth-child(4) { animation-delay: 0.15s; }

/* ---- Admin Pages ---- */
.admin-container {
    max-width: 800px;
}

.settings-section {
    margin-bottom: 32px;
}

.settings-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.logo-preview {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
}

.logo-preview img {
    max-width: 100px;
    max-height: 100px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
    padding: 12px;
    border: 1px solid var(--border);
}

.file-input-wrapper {
    position: relative;
}

.file-input-wrapper input[type="file"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-input-wrapper input[type="file"]:hover {
    border-color: var(--accent);
}

.file-input-wrapper input[type="file"]::file-selector-button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    margin-right: 12px;
    transition: background 0.2s ease;
}

.file-input-wrapper input[type="file"]::file-selector-button:hover {
    background: var(--accent-hover);
}

/* ---- Change Password ---- */
.password-card {
    max-width: 480px;
    margin: 0 auto;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .invoice-meta {
        grid-template-columns: 1fr;
    }

    .invoice-totals {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(10, 14, 26, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 24px;
        gap: 24px;
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }

    .nav-menu.open {
        transform: translateX(0);
    }

    .nav-links {
        flex-direction: column;
        gap: 8px;
    }

    .nav-link {
        padding: 14px 16px;
        font-size: 1rem;
    }

    .user-button .user-name {
        display: none;
    }

    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .summary-card {
        padding: 16px;
    }

    .summary-value {
        font-size: 1.2rem;
    }

    .summary-value.currency {
        font-size: 1rem;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0 16px;
    }

    .login-card {
        padding: 32px 24px;
    }

    .invoice-header {
        flex-direction: column;
    }

    .invoice-title-badge {
        text-align: left;
    }

    .invoice-actions {
        flex-direction: column;
    }

    .invoice-actions .btn {
        justify-content: center;
    }
}

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

    .page-title {
        font-size: 1.4rem;
    }
}

/* ---- Print Styles ---- */
@media print {
    body {
        background: white !important;
        color: #1a1a1a !important;
    }

    body::before {
        display: none;
    }

    .navbar,
    .nav-toggle,
    .footer,
    .invoice-actions,
    .alert,
    .btn {
        display: none !important;
    }

    .main-content {
        padding-top: 0;
    }

    .card {
        background: white !important;
        border: 1px solid #ddd !important;
        backdrop-filter: none !important;
        box-shadow: none !important;
    }

    .data-table th,
    .data-table td {
        color: #333 !important;
        border-color: #ddd !important;
    }

    .data-table thead {
        background: #f5f5f5 !important;
    }

    .badge {
        border: 1px solid currentColor;
    }

    .invoice-title-badge h1 {
        -webkit-text-fill-color: var(--accent) !important;
        color: var(--accent) !important;
    }

    * {
        --text-primary: #1a1a1a;
        --text-secondary: #444;
        --text-muted: #777;
        --border: #ddd;
    }
}
