/* ─── LegalPOS site.css ─────────────────────────────────────────────────────
   Theme: Modern Product (attorney workstation)
   Primary: #1B3A6B (deep navy)   Accent: #C89B2A (gold)
   ─────────────────────────────────────────────────────────────────────────── */

:root {
    --lp-primary:       #1B3A6B;
    --lp-primary-dark:  #122951;
    --lp-accent:        #C89B2A;
    --lp-accent-light:  #F0D98A;
    --lp-sidebar-w:     240px;
    --lp-topbar-h:      56px;
    --lp-font:          'Segoe UI', system-ui, -apple-system, sans-serif;
    --lp-radius:        0.5rem;
    --lp-shadow:        0 2px 8px rgba(0,0,0,.10);
    --lp-shadow-lg:     0 4px 20px rgba(0,0,0,.15);
    --lp-bg:            #F4F5F7;
    --lp-surface:       #FFFFFF;
    --lp-border:        #DEE2E6;
    --lp-text:          #212529;
    --lp-text-muted:    #6C757D;
}

/* ─── Reset / base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    height: 100%;
    font-family: var(--lp-font);
    background-color: var(--lp-bg);
    color: var(--lp-text);
    font-size: 14px;
}

a { color: var(--lp-primary); text-decoration: none; }
a:hover { color: var(--lp-accent); text-decoration: underline; }

/* ─── Topbar ────────────────────────────────────────────────────────────── */
.lp-topbar {
    background-color: var(--lp-primary-dark) !important;
    height: var(--lp-topbar-h);
    box-shadow: var(--lp-shadow);
    z-index: 1040;
}

.lp-brand { color: white !important; font-size: 1.1rem; letter-spacing: .02em; }
.lp-brand:hover { color: var(--lp-accent-light) !important; }

.lp-search .form-control { color: white !important; }
.lp-search .form-control::placeholder { color: rgba(255,255,255,.5); }
.lp-search .form-control:focus { box-shadow: none; border-bottom: 1px solid var(--lp-accent) !important; }

/* ─── Sidebar ───────────────────────────────────────────────────────────── */
.lp-sidebar {
    position: fixed;
    top: var(--lp-topbar-h);
    left: 0;
    width: var(--lp-sidebar-w);
    height: calc(100vh - var(--lp-topbar-h));
    background-color: var(--lp-primary);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1030;
    transition: transform .25s ease;
}

.lp-sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 1020;
}
.lp-sidebar-overlay.show { display: block; }

/* Sidebar nav */
.lp-nav { display: flex; flex-direction: column; padding-bottom: 2rem; }

.lp-nav-group-label {
    padding: .4rem 1rem .1rem;
    font-size: .67rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255,255,255,.4);
    margin-top: .75rem;
}

.lp-nav-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem 1rem;
    color: rgba(255,255,255,.78);
    font-size: .875rem;
    border-left: 3px solid transparent;
    transition: background .15s, color .15s, border-color .15s;
    cursor: pointer;
}
.lp-nav-link i { font-size: 1rem; width: 1.25rem; text-align: center; }
.lp-nav-link:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.lp-nav-link.active { background: rgba(200,155,42,.15); color: var(--lp-accent-light); border-left-color: var(--lp-accent); }

/* ─── Main content ──────────────────────────────────────────────────────── */
.lp-main {
    margin-left: var(--lp-sidebar-w);
    margin-top: var(--lp-topbar-h);
    padding: 1.5rem;
    min-height: calc(100vh - var(--lp-topbar-h));
}

@media (max-width: 991.98px) {
    .lp-sidebar { transform: translateX(calc(-1 * var(--lp-sidebar-w))); }
    .lp-sidebar.show { transform: translateX(0); }
    .lp-main { margin-left: 0; }
}

/* ─── Breadcrumb ────────────────────────────────────────────────────────── */
.lp-breadcrumb {
    margin-bottom: 1rem;
    font-size: .8rem;
}
.lp-breadcrumb .breadcrumb-item + .breadcrumb-item::before { color: var(--lp-text-muted); }

/* ─── Page header ───────────────────────────────────────────────────────── */
.lp-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: .5rem;
}
.lp-page-title { font-size: 1.35rem; font-weight: 700; color: var(--lp-primary); margin: 0; }

/* ─── Cards ─────────────────────────────────────────────────────────────── */
.card { border-radius: var(--lp-radius); border: 1px solid var(--lp-border); box-shadow: var(--lp-shadow); }
.card-header { background-color: var(--lp-surface); border-bottom: 1px solid var(--lp-border); font-weight: 600; }

/* Stat / KPI cards */
.lp-stat-card {
    border-radius: var(--lp-radius);
    background: var(--lp-surface);
    border: 1px solid var(--lp-border);
    box-shadow: var(--lp-shadow);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.lp-stat-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--lp-text-muted); }
.lp-stat-value { font-size: 1.75rem; font-weight: 700; color: var(--lp-primary); line-height: 1.1; }
.lp-stat-sub   { font-size: .8rem; color: var(--lp-text-muted); }
.lp-stat-icon  { font-size: 2rem; color: var(--lp-accent); opacity: .7; }

/* ─── Tables ────────────────────────────────────────────────────────────── */
.table { font-size: .875rem; }
.table thead th {
    background-color: var(--lp-bg);
    font-weight: 600;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--lp-text-muted);
    border-bottom: 2px solid var(--lp-border);
    white-space: nowrap;
}
.table tbody tr:hover { background-color: rgba(27,58,107,.04); }
.table-clickable tbody tr { cursor: pointer; }

/* ─── Status badges ─────────────────────────────────────────────────────── */
.lp-badge-open         { color: #0d6efd; background: #cfe2ff; }
.lp-badge-inprogress   { color: #0a5a8a; background: #cff4fc; }
.lp-badge-pendingreview{ color: #664d03; background: #fff3cd; }
.lp-badge-closed       { color: #146c43; background: #d1e7dd; }
.lp-badge-archived     { color: #6c757d; background: #e9ecef; }
.lp-badge-overdue      { color: #842029; background: #f8d7da; }
.lp-badge-draft        { color: #6c757d; background: #f8f9fa; border: 1px solid #dee2e6; }

/* ─── Buttons ───────────────────────────────────────────────────────────── */
.btn-lp-primary { background-color: var(--lp-primary); color: #fff; border: none; }
.btn-lp-primary:hover { background-color: var(--lp-primary-dark); color: #fff; }
.btn-lp-accent  { background-color: var(--lp-accent); color: #212529; border: none; }
.btn-lp-accent:hover { background-color: #b08620; color: #fff; }

/* ─── Forms ─────────────────────────────────────────────────────────────── */
.form-label { font-weight: 500; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--lp-text-muted); }
.form-control:focus, .form-select:focus {
    border-color: var(--lp-primary);
    box-shadow: 0 0 0 .2rem rgba(27,58,107,.15);
}

/* ─── Timeline ──────────────────────────────────────────────────────────── */
.lp-timeline { position: relative; padding-left: 2rem; }
.lp-timeline::before {
    content: '';
    position: absolute;
    left: .75rem;
    top: 0; bottom: 0;
    width: 2px;
    background: var(--lp-border);
}
.lp-timeline-item { position: relative; padding-bottom: 1.25rem; }
.lp-timeline-dot {
    position: absolute;
    left: -2rem;
    top: .1rem;
    width: 1.5rem; height: 1.5rem;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .7rem; color: #fff;
}
.lp-dot-primary  { background: var(--lp-primary); }
.lp-dot-info     { background: #0dcaf0; }
.lp-dot-success  { background: #198754; }
.lp-dot-warning  { background: #ffc107; color: #212529 !important; }
.lp-dot-secondary{ background: #6c757d; }

.lp-timeline-title { font-weight: 600; font-size: .875rem; }
.lp-timeline-meta  { font-size: .75rem; color: var(--lp-text-muted); margin-top: .1rem; }
.lp-timeline-notes { margin-top: .2rem; }

/* ─── Wizard steps ──────────────────────────────────────────────────────── */
.lp-wizard-steps {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
}
.lp-wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}
.lp-step-circle {
    width: 2.25rem; height: 2.25rem;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .875rem;
    border: 2px solid var(--lp-border);
    background: var(--lp-surface);
    color: var(--lp-text-muted);
}
.lp-step-active .lp-step-circle  { border-color: var(--lp-primary); background: var(--lp-primary); color: #fff; }
.lp-step-done .lp-step-circle    { border-color: #198754; background: #198754; color: #fff; }
.lp-step-label { font-size: .7rem; margin-top: .3rem; text-align: center; color: var(--lp-text-muted); }
.lp-step-active .lp-step-label   { color: var(--lp-primary); font-weight: 600; }
.lp-step-done .lp-step-label     { color: #198754; }
.lp-step-connector {
    flex: 1;
    height: 2px;
    background: var(--lp-border);
    min-width: 20px;
    margin-bottom: 1.2rem;
}
.lp-connector-done { background: #198754; }

/* ─── AI panel ──────────────────────────────────────────────────────────── */
.lp-ai-panel { border-left: 3px solid var(--lp-accent); }
.lp-ai-panel .card-header { background: linear-gradient(90deg, #fffaf0, #fff); }
.lp-ai-text  { font-size: .9rem; line-height: 1.5; }
.lp-ai-badge { font-size: .65rem; }
.lp-ai-placeholder { font-size: .875rem; }

/* ─── Alerts ────────────────────────────────────────────────────────────── */
.lp-alert { border-radius: var(--lp-radius); margin-bottom: 1rem; }

/* ─── Checklist ─────────────────────────────────────────────────────────── */
.lp-checklist-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem .25rem;
    border-bottom: 1px solid var(--lp-border);
}
.lp-checklist-item:last-child { border-bottom: none; }
.lp-check-done .lp-checklist-label { text-decoration: line-through; color: var(--lp-text-muted); }

/* ─── Statement tables ───────────────────────────────────────────────────── */
.lp-statement-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.lp-statement-deduction td { color: #842029; }
.lp-statement-total td { font-weight: 700; border-top: 2px solid var(--lp-primary); background: #f8f9fa; }

/* ─── Utilities ─────────────────────────────────────────────────────────── */
.lp-currency::before { content: 'J$\00a0'; color: var(--lp-text-muted); font-size: .8em; }
.text-accent { color: var(--lp-accent) !important; }
.bg-lp-primary { background-color: var(--lp-primary) !important; color: #fff; }
.lp-click-row { cursor: pointer; }
