/* ============================================================
   LexVault Law Firm — Design System (app.css)
   ============================================================ */

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

/* ── CSS Custom Properties ─────────────────────────────────── */
:root {
    /* Colors */
    --clr-bg:           #070b14;
    --clr-bg-2:         #0d1322;
    --clr-bg-3:         #111827;
    --clr-surface:      rgba(255,255,255,0.04);
    --clr-surface-2:    rgba(255,255,255,0.08);
    --clr-border:       rgba(255,255,255,0.08);
    --clr-border-2:     rgba(255,255,255,0.14);

    --clr-gold:         #c9a84c;
    --clr-gold-light:   #e8c97a;
    --clr-gold-dark:    #a07c2e;
    --clr-blue:         #4a9eff;
    --clr-blue-dark:    #2563eb;

    --clr-text:         #f0f2f7;
    --clr-text-2:       #a1adc4;
    --clr-text-3:       #6b7a99;

    --clr-success:      #22c55e;
    --clr-error:        #ef4444;
    --clr-warning:      #f59e0b;
    --clr-info:         #3b82f6;

    /* Typography */
    --font-heading:     'Playfair Display', Georgia, serif;
    --font-body:        'Inter', system-ui, sans-serif;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;

    /* Radius */
    --radius-sm:  6px;
    --radius-md:  12px;
    --radius-lg:  18px;
    --radius-xl:  24px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
    --shadow-md:  0 4px 16px rgba(0,0,0,0.5);
    --shadow-lg:  0 8px 32px rgba(0,0,0,0.6);
    --shadow-gold: 0 0 24px rgba(201,168,76,0.25);

    /* Sidebar */
    --sidebar-w:         300px;
    --sidebar-w-collapsed: 70px;
    --sidebar-transition: 0.3s cubic-bezier(0.4,0,0.2,1);
    --topbar-h:          64px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: var(--font-body);
    background: var(--clr-bg);
    color: var(--clr-text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    color-scheme: dark;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select {
    font-family: inherit;
    outline: none;
    border: none;
    background: none;
    color: inherit;
}

/* ── Typography ────────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-family: var(--font-heading); line-height: 1.25; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.6rem); }
h4 { font-size: 1.1rem; }
p  { color: var(--clr-text-2); font-size: 0.95rem; }
.text-gold  { color: var(--clr-gold); }
.text-muted { color: var(--clr-text-3); }
.font-heading { font-family: var(--font-heading); }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0.65rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    transition: all 0.25s ease;
    white-space: nowrap;
}
.btn-primary {
    background: linear-gradient(135deg, var(--clr-gold), var(--clr-gold-dark));
    color: #0a0a0a;
    box-shadow: 0 4px 20px rgba(201,168,76,0.35);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(201,168,76,0.5);
    background: linear-gradient(135deg, var(--clr-gold-light), var(--clr-gold));
}
.btn-outline {
    border: 1.5px solid var(--clr-border-2);
    color: var(--clr-text);
    background: var(--clr-surface);
}
.btn-outline:hover {
    border-color: var(--clr-gold);
    color: var(--clr-gold);
    background: rgba(201,168,76,0.08);
}
.btn-danger {
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.3);
    color: #ef4444;
}
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-sm { padding: 0.4rem 1rem; font-size: 0.8rem; }
.btn-block { width: 100%; justify-content: center; }

/* ── Cards / Glass ─────────────────────────────────────────── */
.card {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.card-hover {
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--clr-border-2);
}

/* ── Form Elements ─────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-5); }
.form-label { font-size: 0.85rem; font-weight: 600; color: var(--clr-text-2); letter-spacing: 0.04em; text-transform: uppercase; }
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--clr-surface-2);
    border: 1.5px solid var(--clr-border);
    border-radius: var(--radius-md);
    color: var(--clr-text);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus {
    border-color: var(--clr-gold);
    box-shadow: 0 0 0 3px rgba(201,168,76,0.15);
}
.form-control::placeholder { color: var(--clr-text-3); }
.form-error { font-size: 0.8rem; color: var(--clr-error); margin-top: var(--space-1); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23a1adc4'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 20px; padding-right: 2.5rem; }
select.form-control option { background-color: #1a202c; color: #f0f2f7; padding: 10px; }
/* Force dark mode colors for system dropdowns */
@media (prefers-color-scheme: light) {
    select.form-control option { background-color: #1a202c; color: #f0f2f7; }
}

/* ── Badges ────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.73rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.badge-success  { background: rgba(34,197,94,0.15);  color: #22c55e;  border: 1px solid rgba(34,197,94,0.3); }
.badge-warning  { background: rgba(245,158,11,0.15); color: #f59e0b;  border: 1px solid rgba(245,158,11,0.3); }
.badge-danger   { background: rgba(239,68,68,0.15);  color: #ef4444;  border: 1px solid rgba(239,68,68,0.3); }
.badge-info     { background: rgba(59,130,246,0.15); color: #60a5fa;  border: 1px solid rgba(59,130,246,0.3); }
.badge-secondary{ background: rgba(107,122,153,0.15);color: #a1adc4; border: 1px solid rgba(107,122,153,0.3); }

/* ── Tables ────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
thead th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--clr-text-3);
    background: var(--clr-surface);
    border-bottom: 1px solid var(--clr-border);
    white-space: nowrap;
}
tbody tr {
    border-bottom: 1px solid var(--clr-border);
    transition: background 0.15s;
}
tbody tr:hover { background: var(--clr-surface); }
tbody td { padding: 0.9rem 1rem; color: var(--clr-text-2); vertical-align: middle; }
tbody td:first-child { color: var(--clr-text); font-weight: 500; }

/* ── Stat Cards ────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-5); }
.stat-card {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-lg);
    padding: var(--space-5) var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    position: relative;
    overflow: hidden;
    transition: transform 0.25s, border-color 0.25s;
}
.stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(201,168,76,0.04), transparent);
    pointer-events: none;
}
.stat-card:hover { transform: translateY(-3px); border-color: rgba(201,168,76,0.3); }
.stat-card__icon {
    width: 44px; height: 44px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    background: rgba(201,168,76,0.12);
    color: var(--clr-gold);
}
.stat-card__value { font-size: 1.9rem; font-weight: 700; font-family: var(--font-heading); color: var(--clr-text); line-height: 1; }
.stat-card__label { font-size: 0.8rem; color: var(--clr-text-3); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }

/* ── Divider ───────────────────────────────────────────────── */
.divider { height: 1px; background: var(--clr-border); margin: var(--space-6) 0; }

/* ── Alert Callouts ────────────────────────────────────────── */
.alert { padding: var(--space-4); border-radius: var(--radius-md); font-size: 0.9rem; border: 1px solid; }
.alert-success { background: rgba(34,197,94,0.1); border-color: rgba(34,197,94,0.25); color: #22c55e; }
.alert-error   { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.25); color: #ef4444; }

/* ── Pagination ────────────────────────────────────────────── */
.pagination-wrapper { display: flex; justify-content: center; margin-top: var(--space-6); }
.pagination-wrapper nav { display: flex; gap: var(--space-2); }
.pagination-wrapper .page-link,
.pagination-wrapper span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 var(--space-3);
    border-radius: var(--radius-md);
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    font-size: 0.85rem;
    color: var(--clr-text-2);
    transition: all 0.2s;
}
.pagination-wrapper a:hover { border-color: var(--clr-gold); color: var(--clr-gold); }
.pagination-wrapper [aria-current="page"] span { background: var(--clr-gold); color: #0a0a0a; border-color: var(--clr-gold); font-weight: 700; }

/* ── Utilities ─────────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.w-full { width: 100%; }
.text-center { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Section Headers ───────────────────────────────────────── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-6); flex-wrap: wrap; gap: var(--space-4); }
.section-header h2, .section-header h3 { margin: 0; }
.page-title { font-size: 1.6rem; font-family: var(--font-heading); color: var(--clr-text); }
.page-subtitle { color: var(--clr-text-3); font-size: 0.88rem; margin-top: var(--space-1); }

/* ── Empty State ───────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: var(--space-16) var(--space-8);
    color: var(--clr-text-3);
}
.empty-state i { font-size: 3rem; margin-bottom: var(--space-4); opacity: 0.4; color: var(--clr-gold); }
.empty-state h3 { font-family: var(--font-heading); margin-bottom: var(--space-2); color: var(--clr-text-2); }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--clr-bg-2); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

/* ── Site Logo System ───────────────────────────────────────── */
.site-logo {
    display: block;
    height: auto;
    width: auto;
    object-fit: contain;
}
.site-logo--nav {
    max-height: 65px;
    max-width: 260px;
}
.site-logo--footer {
    max-height: 58px;
    max-width: 230px;
    margin-bottom: var(--space-4);
}
.site-logo--auth {
    max-height: 86px;
    max-width: 288px;
    margin: 0 auto 12px;
}
.site-logo--sidebar {
    max-height: 80px;
    max-width: 280px;
    margin: 0 auto;
}

