/**
 * Larpei & Company Advocates — Modern UI Design System
 * Brand: #6A1F27 · #AA9166 · #121518 · #000 · #fff
 */

/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
    --burgundy: #6A1F27;
    --burgundy-dark: #4e161c;
    --burgundy-light: #8a2833;
    --burgundy-muted: rgba(106, 31, 39, 0.08);
    --gold: #AA9166;
    --gold-light: #c9b896;
    --gold-dark: #8a7550;
    --gold-muted: rgba(170, 145, 102, 0.15);
    --charcoal: #121518;
    --charcoal-soft: #1e2329;
    --white: #ffffff;
    --surface: #ffffff;
    --surface-muted: #f4f5f7;
    --surface-elevated: #fafbfc;
    --border: #e8eaed;
    --border-subtle: #f0f1f3;
    --text-primary: #121518;
    --text-secondary: #5c6570;
    --text-tertiary: #8b939e;
    --success: #0d7a4e;
    --success-bg: #e8f5ef;
    --warning: #9a6700;
    --warning-bg: #fef7e6;
    --danger: #b42318;
    --danger-bg: #fdecec;
    --info: #1e5a7a;
    --info-bg: #e8f2f8;
    --sidebar-width: 272px;
    --topbar-height: 72px;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --shadow-xs: 0 1px 2px rgba(18, 21, 24, 0.04);
    --shadow-sm: 0 2px 8px rgba(18, 21, 24, 0.06);
    --shadow-md: 0 4px 20px rgba(18, 21, 24, 0.08);
    --shadow-lg: 0 12px 40px rgba(18, 21, 24, 0.12);
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 2.5rem;
}

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

html {
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    background: var(--surface-muted);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--burgundy);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--burgundy-light); }

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

.icon-svg { flex-shrink: 0; }

/* ==========================================================================
   Auth / Login
   ========================================================================== */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(170, 145, 102, 0.2), transparent),
        linear-gradient(155deg, var(--charcoal) 0%, var(--burgundy-dark) 45%, var(--burgundy) 100%);
}

.auth-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 440px;
    padding: var(--space-2xl) var(--space-xl);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-brand { text-align: center; margin-bottom: var(--space-xl); }

.auth-brand .logo-mark {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--burgundy) 0%, var(--gold) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-lg);
    font-family: var(--font-display);
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--white);
    box-shadow: 0 8px 24px rgba(106, 31, 39, 0.35);
}

.auth-brand h1 {
    font-family: var(--font-display);
    font-size: 1.875rem;
    font-weight: 600;
    color: var(--burgundy);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.auth-brand p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-top: var(--space-sm);
}

/* ==========================================================================
   Sidebar
   ========================================================================== */
.app-body { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: #6A1F27;
    color: var(--white);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform var(--transition);
    border-right: 1px solid rgba(14, 13, 13, 0.12);
}

.sidebar.open { transform: translateX(0); }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(18, 21, 24, 0.55);
    backdrop-filter: blur(4px);
    z-index: 999;
}
.sidebar-overlay.active { display: block; }

.sidebar-brand {
    padding: var(--space-lg) var(--space-lg) var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.brand-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--burgundy) 0%, var(--gold-dark) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
}

.brand-monogram {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.brand-name {
    display: block;
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.brand-sub {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-sm) var(--space-md) var(--space-lg);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.nav-section-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #ffffff;
    padding: var(--space-md) var(--space-md) var(--space-sm);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 0.8rem var(--space-md);
    color: #ffffff;
    border: 1px solid transparent;
    border-radius: 12px;
    margin-bottom: 6px;
    font-size: 1rem;
    font-weight: 500;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.nav-link:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.nav-link.active {
    color: var(--white);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    font-weight: 600;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 15%;
    height: 70%;
    width: 4px;
    background: var(--gold-light);
    border-radius: 0 4px 4px 0;
}

.nav-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.08);
    transition: background var(--transition);
    flex-shrink: 0;
}

.nav-link.active .nav-icon-wrap,
.nav-link:hover .nav-icon-wrap {
    background: transparent;
}

.nav-link.active .nav-icon-wrap {
    color: var(--gold-light);
}

.nav-icon { color: inherit; }

.sidebar-footer {
    padding: var(--space-md);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
}

.user-mini {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.08);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--white);
    flex-shrink: 0;
}

.user-info .user-name {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--white);
}

.user-info .user-role {
    font-size: 0.75rem;
    color: var(--gold-light);
    font-weight: 600;
}

.logout-link { color: rgba(255, 255, 255, 0.55) !important; }
.logout-link:hover {
    color: #fca5a5 !important;
    background: rgba(248, 113, 113, 0.12) !important;
}

/* ==========================================================================
   Main layout & topbar
   ========================================================================== */
.main-wrapper {
    flex: 1;
    margin-left: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.topbar {
    position: sticky;
    top: 0;
    min-height: var(--topbar-height);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 var(--space-lg);
    gap: var(--space-md);
    z-index: 100;
}

.topbar-title-wrap { flex: 1; min-width: 0; }

.page-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--burgundy);
    letter-spacing: -0.02em;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.topbar-user-chip {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.35rem 0.75rem 0.35rem 0.35rem;
    background: var(--surface-muted);
    border-radius: 999px;
    border: 1px solid var(--border);
}

.topbar-user-avatar {
    width: 32px;
    height: 32px;
    background: var(--burgundy);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 700;
}

.topbar-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.content-area {
    flex: 1;
    padding: var(--space-lg);
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
}

.app-footer {
    padding: var(--space-lg);
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    border-top: 1px solid var(--border);
    background: var(--surface);
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    transition: box-shadow var(--transition);
}

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

.card-header {
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
    background: var(--surface-elevated);
}

.card-header h2,
.card-header h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--burgundy);
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.card-body {
    padding: var(--space-xl);
}

.card-body + .card-body {
    border-top: 1px solid var(--border-subtle);
}

.card-body.compact {
    padding: var(--space-lg);
}

/* Stat cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.stat-card {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--burgundy), var(--gold));
}

.stat-card.gold::before {
    background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
}

.stat-card.charcoal::before {
    background: var(--charcoal);
}

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

.stat-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.stat-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--burgundy-muted);
    color: var(--burgundy);
}

.stat-card.gold .stat-icon-wrap {
    background: var(--gold-muted);
    color: var(--gold-dark);
}

.stat-card.charcoal .stat-icon-wrap {
    background: rgba(18, 21, 24, 0.08);
    color: var(--charcoal);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2.125rem;
    font-weight: 700;
    color: var(--burgundy);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.stat-card.gold .stat-value { color: var(--gold-dark); }
.stat-card.charcoal .stat-value { color: var(--charcoal); }

.stat-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    margin-top: var(--space-xs);
}

/* Detail fields (profile cards) */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

.detail-item {
    padding: var(--space-md) var(--space-lg);
    background: var(--surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    transition: border-color var(--transition), background var(--transition);
}

.detail-item:hover {
    border-color: var(--border);
    background: var(--surface);
}

.detail-item label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: var(--space-xs);
}

.detail-item span,
.detail-item p {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.5;
}

.detail-item a {
    font-weight: 600;
}

/* ==========================================================================
   Modern data tables
   ========================================================================== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: calc(var(--space-xl) * -1);
    margin-top: 0;
    padding: 0;
}

.card .table-responsive {
    margin: 0;
}

.card-body.table-responsive,
.card .card-body:has(.table-responsive) {
    padding: 0;
}

.card .card-body:has(.table-responsive) .table {
    margin: 0;
}

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

.table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.table th {
    padding: 0.875rem 1.25rem;
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table th:first-child { padding-left: var(--space-xl); }
.table th:last-child { padding-right: var(--space-xl); }

.table td {
    padding: 1rem 1.25rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-weight: 450;
}

.table td:first-child { padding-left: var(--space-xl); }
.table td:last-child { padding-right: var(--space-xl); }

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

.table tbody tr:hover {
    background: var(--burgundy-muted);
}

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

.table tbody tr:last-child td:first-child {
    border-bottom-left-radius: var(--radius-lg);
}

.table tbody tr:last-child td:last-child {
    border-bottom-right-radius: var(--radius-lg);
}

.table a {
    font-weight: 600;
    color: var(--burgundy);
}

.table a:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.table .empty-state,
.table td.empty-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-tertiary);
    font-weight: 500;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    font-family: inherit;
    white-space: nowrap;
    line-height: 1.2;
}

.btn-primary {
    background: var(--burgundy);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(106, 31, 39, 0.25);
}
.btn-primary:hover {
    background: var(--burgundy-light);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(106, 31, 39, 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--gold);
    color: var(--charcoal);
}
.btn-secondary:hover {
    background: var(--gold-light);
    transform: translateY(-1px);
}

.btn-outline {
    background: var(--surface);
    border: 1.5px solid var(--border);
    color: var(--burgundy);
}
.btn-outline:hover {
    border-color: var(--burgundy);
    background: var(--burgundy-muted);
}

.btn-sm {
    padding: 0.4rem 0.875rem;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
}

.btn-danger { background: var(--danger); color: var(--white); }
.btn-success { background: var(--success); color: var(--white); }

.btn-icon {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-primary);
    border-radius: var(--radius);
    transition: all var(--transition);
}
.btn-icon:hover {
    background: var(--surface-muted);
    border-color: var(--gold);
    color: var(--burgundy);
}

/* Contact chips */
.contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.btn-contact {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: transform var(--transition), box-shadow var(--transition);
}

.btn-contact:hover {
    transform: translateY(-1px);
    color: var(--white);
}

.btn-email { background: var(--charcoal); color: var(--white); }
.btn-call { background: var(--burgundy); color: var(--white); }
.btn-sms { background: var(--gold-dark); color: var(--white); }
.btn-whatsapp { background: #128c7e; color: var(--white); }

/* ==========================================================================
   Forms
   ========================================================================== */
.form-group { margin-bottom: var(--space-lg); }

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
    background: var(--surface);
    color: var(--text-primary);
}

.form-control:hover {
    border-color: #d0d4d9;
}

.form-control:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 4px var(--gold-muted);
}

select.form-control { cursor: pointer; }

textarea.form-control {
    min-height: 120px;
    resize: vertical;
    line-height: 1.55;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: var(--space-xs);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

/* ==========================================================================
   Badges & alerts
   ========================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    font-size: 0.6875rem;
    font-weight: 700;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.4;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-secondary { background: var(--surface-muted); color: var(--text-secondary); }

.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border-color: rgba(13, 122, 78, 0.2);
}
.alert-error, .alert-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(180, 35, 24, 0.2);
}
.alert-warning {
    background: var(--warning-bg);
    color: var(--warning);
}
.alert-info {
    background: var(--info-bg);
    color: var(--info);
}

.alert-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.5;
    line-height: 1;
    padding: 0.25rem;
}
.alert-close:hover { opacity: 1; }

/* Search & filters */
.search-bar {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    margin-bottom: var(--space-lg);
    padding: var(--space-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.search-bar .form-control {
    max-width: 320px;
    flex: 1;
    min-width: 180px;
}

/* Layout grids */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
}

/* Calendar list */
.calendar-list { list-style: none; }

.calendar-list li {
    padding: var(--space-md) var(--space-lg);
    border-left: 3px solid var(--gold);
    margin-bottom: var(--space-sm);
    background: var(--surface-elevated);
    border-radius: 0 var(--radius) var(--radius) 0;
    border: 1px solid var(--border-subtle);
    border-left-width: 3px;
    border-left-color: var(--gold);
    transition: background var(--transition);
}

.calendar-list li:hover {
    background: var(--surface);
}

.calendar-list strong {
    font-weight: 600;
    color: var(--text-primary);
}

/* Tabs */
.tabs {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-lg);
    padding: var(--space-xs);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow-x: auto;
}

.tab-link {
    padding: 0.6rem 1.125rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-radius: var(--radius);
    white-space: nowrap;
    transition: all var(--transition);
}

.tab-link:hover {
    color: var(--burgundy);
    background: var(--burgundy-muted);
}

.tab-link.active {
    color: var(--white);
    background: var(--burgundy);
    box-shadow: var(--shadow-xs);
}

/* Pagination */
.pagination {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
    margin-top: var(--space-xl);
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.pagination a:hover,
.pagination .active {
    background: var(--burgundy);
    color: var(--white);
    border-color: var(--burgundy);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
    color: var(--text-tertiary);
    font-size: 0.9375rem;
    font-weight: 500;
}

/* Invoice print */
@media print {
    .sidebar, .topbar, .app-footer, .no-print, .sidebar-toggle { display: none !important; }
    .main-wrapper { margin: 0 !important; }
    .content-area { padding: 0; max-width: 100%; }
    body { background: white; }
}

.invoice-print {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-xl);
    background: white;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 3px solid var(--burgundy);
    padding-bottom: var(--space-lg);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    gap: var(--space-lg);
}

/* Utilities */
.d-none { display: none !important; }
.text-muted { color: var(--text-secondary); }
.text-right { text-align: right; }
.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space-lg); }
.mb-2 { margin-bottom: var(--space-lg); }
.gap-1 { gap: var(--space-sm); }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (min-width: 576px) {
    .form-row { grid-template-columns: repeat(2, 1fr); }
    .detail-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
    .sidebar { transform: translateX(0); }
    .sidebar-overlay { display: none !important; }
    .main-wrapper { margin-left: var(--sidebar-width); }
    .sidebar-toggle { display: none; }
    .d-md-inline { display: inline !important; }
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
    .content-area { padding: var(--space-xl) var(--space-2xl); }
}

@media (min-width: 992px) {
    .form-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
    .detail-grid { grid-template-columns: repeat(3, 1fr); }
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1200px) {
    .page-title { font-size: 1.625rem; }
}

/* Split View Login Styles */
.auth-split-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: var(--font-base);
    background-color: var(--surface);
}

.auth-split-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.auth-split-left {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(170, 145, 102, 0.2), transparent),
        linear-gradient(155deg, var(--charcoal) 0%, var(--burgundy-dark) 45%, var(--burgundy) 100%);
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.auth-split-left .auth-brand h1 {
    color: var(--white);
    font-size: 2.5rem;
}

.auth-split-left .auth-brand p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.125rem;
}

.auth-split-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    background: var(--surface);
}

.auth-split-form-wrapper {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

@media (max-width: 900px) {
    .auth-split-container {
        flex-direction: column;
    }
    .auth-split-left {
        flex: none;
        min-height: 350px;
    }
}

/* Modern Auth Inputs */
.auth-input {
    padding: 0.85rem 1.15rem;
    font-size: 1rem;
    border-radius: 8px;
    background-color: var(--background);
}
.auth-input:focus {
    background-color: var(--surface);
}
.btn-lg {
    padding: 0.85rem 1.5rem;
    font-size: 1.05rem;
    border-radius: 8px;
}
