/* ------------------------------------------------------------------
   Brand tokens — change these four lines to reskin the whole app.
   ------------------------------------------------------------------ */
:root {
    /* LEO brand — South Tex Lawyer identity, per approved mockup v2 (8/6):
       ink navy / gold / steel / slate / warm paper */
    --brand: #1a1a2e;          /* --leo-ink */
    --brand-hover: #2a2a44;
    --brand-accent: #8a6d1f;   /* gold, darkened for link contrast */
    --brand-accent-hover: #6d5618;
    --leo-ink: #1a1a2e;
    --leo-gold: #c8a951;
    --leo-gold-soft: rgba(200,169,81,.12);
    --leo-slate: #3a4559;
    --leo-steel: #5ba4c9;
    --leo-paper: #f8f6f0;
}

[x-cloak] { display: none !important; }

.brand-bg { background-color: var(--brand); }
.brand-bg-hover:hover { background-color: var(--brand-hover); }
.brand-accent { color: var(--brand-accent); }

.nav-link { opacity: 0.85; }
.nav-link:hover { opacity: 1; }

.btn-primary {
    background-color: var(--brand);
    color: #fff;
    padding: 0.65rem 1.25rem;
    border-radius: 0.375rem;
    font-weight: 600;
    transition: background-color 0.15s;
    cursor: pointer;
    border: none;
    width: 100%;
}
.btn-primary:hover { background-color: var(--brand-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}
.form-control {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.95rem;
}
.form-control:focus {
    outline: 2px solid var(--brand-accent);
    outline-offset: 0;
    border-color: transparent;
}

.auth-card {
    max-width: 420px;
    margin: 60px auto;
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}
.auth-card-header {
    background-color: var(--brand);
    color: #fff;
    padding: 2rem 1.75rem;
    text-align: center;
}
.auth-card-body { padding: 2.25rem 1.75rem; }

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}
.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* ==================================================================
   LEO skeleton components — look follows the approved mockups
   (leads-dashboard-mockup-v2.html): ink header w/ gold rule, gold
   card accents, status colors in Phillip's lifecycle words.
   ================================================================== */

.leo-body { background: linear-gradient(135deg, #eaf2f8 0%, #cfe0ee 100%) fixed; }

.skeleton-banner {
    background: repeating-linear-gradient(45deg, #ffc107, #ffc107 12px, #e6ac00 12px, #e6ac00 24px);
    color: #212529; text-align: center; font-weight: 700; font-size: 0.75rem;
    letter-spacing: 1px; padding: 4px; text-transform: uppercase;
}

.leo-header {
    background-color: var(--leo-ink);
    border-bottom: 3px solid var(--leo-gold);
    box-shadow: 0 2px 8px rgba(26,26,46,.35);
}
.leo-mark {
    background: var(--leo-gold); color: var(--leo-ink); font-weight: 800;
    letter-spacing: 1.5px; border-radius: 6px; padding: 6px 11px; font-size: 1.05rem;
}
.leo-avatar {
    width: 30px; height: 30px; border-radius: 50%; background: var(--leo-gold);
    color: var(--leo-ink); display: inline-flex; align-items: center;
    justify-content: center; font-weight: 700; font-size: .85rem;
}
.leo-nav-link {
    color: rgba(255,255,255,.8); padding: 6px 10px; border-radius: 6px;
    font-weight: 600;
}
.leo-nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.leo-nav-active { color: var(--leo-gold); }
.leo-nav-active:hover { color: var(--leo-gold); }

.leo-footer { background-color: var(--leo-ink); color: #fff; border-top: 3px solid var(--leo-gold); }

/* Cards */
.leo-card {
    background: #fff; border: 1px solid rgba(26,26,46,.28); border-radius: 8px;
    box-shadow: 0 2px 10px rgba(26,26,46,.14); margin-bottom: 20px; overflow: hidden;
}
.leo-card-header {
    padding: 13px 18px; border-bottom: 1px solid rgba(26,26,46,.18);
    border-left: 4px solid var(--leo-gold); font-weight: 700; color: var(--leo-ink);
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
}
.leo-card-body { padding: 18px; }
.leo-card-body.p0 { padding: 0; }

.leo-stat-card {
    background: #fff; border: 1px solid rgba(26,26,46,.28); border-top: 4px solid var(--leo-gold);
    border-radius: 8px; padding: 18px; box-shadow: 0 2px 10px rgba(26,26,46,.14);
    position: relative; height: 100%;
}
.leo-stat-card .stat-label {
    font-size: 0.78rem; color: #2b3446; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; margin-bottom: 5px;
}
.leo-stat-card .stat-value { font-size: 2rem; font-weight: 700; color: var(--leo-ink); line-height: 1.2; }
.leo-stat-card .stat-sub { font-size: 0.78rem; color: #4a5568; margin-top: 6px; }

/* Status badges — Phillip's lifecycle words (8/6 questionnaire) */
.st-badge {
    display: inline-block; font-size: .75rem; font-weight: 700;
    padding: 3px 10px; border-radius: 10px; white-space: nowrap;
}
.st-initial   { background: rgba(91,164,201,.18); color: #2e7396; }
.st-sort      { background: rgba(58,69,89,.14);   color: #3a4559; }
.st-follow    { background: rgba(255,171,46,.18); color: #a56a00; }
.st-client    { background: rgba(200,169,81,.22); color: #8a6d1f; border: 1px solid rgba(200,169,81,.5); }
.st-closed    { background: #e9ecef; color: #6c757d; }
.st-perpetual { background: rgba(26,26,46,.08);   color: var(--leo-ink); border: 1px dashed rgba(26,26,46,.3); }

.badge-hot  { background: #dc3545; color: #fff; font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 10px; }
.badge-test { background: rgba(255,193,7,.15); color: #b58900; border: 1px dashed rgba(255,193,7,.6); font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.badge-omni { background: rgba(26,26,46,.85); color: var(--leo-gold); font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 10px; }
.badge-case { background: #eef1f5; color: var(--leo-slate); border: 1px solid rgba(26,26,46,.15); font-size: .75rem; font-weight: 600; padding: 3px 9px; border-radius: 10px; white-space: nowrap; }

/* Leads table */
.leads-table { width: 100%; font-size: 0.9rem; border-collapse: collapse; }
.leads-table th {
    color: var(--leo-ink); font-weight: 700; text-transform: uppercase; font-size: .72rem;
    letter-spacing: .5px; text-align: left; padding: 10px 12px;
    border-bottom: 2px solid rgba(26,26,46,.18); white-space: nowrap;
}
.leads-table td { padding: 10px 12px; border-bottom: 1px solid rgba(26,26,46,.08); vertical-align: middle; }
.leads-table tbody tr { cursor: pointer; }
.leads-table tbody tr:hover { background: var(--leo-gold-soft); }
.leads-table tr.lead-archived td { opacity: .5; }

/* Phone: card-per-lead list replaces the table under 640px (mockup pattern) */
.lead-card {
    background: #fff; border: 1px solid rgba(26,26,46,.28); border-left: 4px solid var(--leo-gold);
    border-radius: 8px; padding: 12px 14px; margin: 10px 0; cursor: pointer;
    box-shadow: 0 1px 3px rgba(26,26,46,.08); display: block;
}
.lead-card:active { background: var(--leo-gold-soft); }
.lead-card .lc-name { font-weight: 700; font-size: 1rem; color: var(--leo-ink); }
.lead-card .lc-meta { font-size: .8rem; color: #3f4a5a; }

/* Timeline */
.leo-timeline { list-style: none; margin: 0; padding: 0; }
.leo-timeline li { position: relative; padding: 0 0 16px 26px; border-left: 2px solid rgba(26,26,46,.15); margin-left: 8px; }
.leo-timeline li:last-child { padding-bottom: 0; }
.leo-timeline li::before {
    content: ''; position: absolute; left: -7px; top: 2px; width: 12px; height: 12px;
    border-radius: 50%; background: var(--leo-steel); border: 2px solid #fff;
}
.leo-timeline li.tl-gold::before { background: var(--leo-gold); }
.leo-timeline .tl-time { font-size: 0.72rem; color: #5a6472; display: block; }
.leo-timeline .tl-who { font-size: 0.72rem; color: #8a6d1f; font-weight: 600; }

/* Stage tracker (per-case-type state machine) */
.stage-list { list-style: none; margin: 0; padding: 0; font-size: .85rem; }
.stage-list li { position: relative; padding: 0 0 12px 28px; border-left: 2px solid rgba(26,26,46,.12); margin-left: 9px; }
.stage-list li:last-child { padding-bottom: 0; border-left-color: transparent; }
.stage-list li::before {
    content: ''; position: absolute; left: -8px; top: 1px; width: 14px; height: 14px;
    border-radius: 50%; background: #fff; border: 2px solid rgba(26,26,46,.25);
}
.stage-list li.done { color: #5a6472; }
.stage-list li.done::before { background: var(--leo-gold); border-color: var(--leo-gold); }
.stage-list li.current { font-weight: 700; color: var(--leo-ink); }
.stage-list li.current::before { background: var(--leo-ink); border-color: var(--leo-ink); box-shadow: 0 0 0 3px var(--leo-gold-soft); }
.stage-list li.todo { color: #8b95a5; }
.stage-list .stage-note { display: block; font-weight: 400; font-size: .75rem; color: #6b7585; }

/* Ticket review */
.ticket-img { width: 100%; border: 1px solid rgba(26,26,46,.25); border-radius: 6px; display: block; }
.ticket-fields dt {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .5px;
    color: #2b3446; font-weight: 700; margin-top: 10px;
}
.ticket-fields dd { margin: 2px 0 0 0; }
.ticket-fields input {
    width: 100%; padding: 6px 8px; font-size: .9rem;
    border: 1px solid #9aa7b8; border-radius: 5px; background: #fff;
}
.ticket-fields .flagged input { background: rgba(255,193,7,.18); border-left: 3px solid #ffc107; }
.flag-note { font-size: .74rem; color: #a56a00; font-weight: 600; margin-top: 2px; display: block; }

/* Buttons */
.btn-gold {
    background-color: var(--leo-gold); color: var(--leo-ink); font-weight: 700;
    padding: 0.6rem 1.2rem; border-radius: 0.375rem; border: none; cursor: pointer;
    transition: background-color .15s;
}
.btn-gold:hover { background-color: #b6973f; color: #fff; }
.btn-gold:disabled { opacity: .5; cursor: not-allowed; }
.btn-ink {
    background-color: var(--leo-ink); color: #fff; font-weight: 600;
    padding: 0.6rem 1.2rem; border-radius: 0.375rem; border: none; cursor: pointer;
    transition: background-color .15s;
}
.btn-ink:hover { background-color: var(--brand-hover); }
.btn-ink:disabled { background: #9a99a8; cursor: not-allowed; }
.btn-outline {
    background: #fff; color: var(--leo-ink); font-weight: 600; padding: 0.55rem 1.1rem;
    border-radius: 0.375rem; border: 1px solid var(--leo-slate); cursor: pointer;
}
.btn-outline:hover { background: var(--leo-ink); color: #fff; }
.btn-sm { padding: 0.35rem 0.8rem; font-size: .85rem; }

/* Copy-message affordance */
.msg-item { border: 1px solid rgba(26,26,46,.15); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; background: #fff; }
.msg-item .msg-label { font-weight: 700; font-size: .85rem; color: var(--leo-ink); }
.msg-item .msg-channel { font-size: .7rem; text-transform: uppercase; letter-spacing: .5px; color: #8a6d1f; font-weight: 700; }
.msg-item pre {
    white-space: pre-wrap; font-family: inherit; font-size: .85rem; color: #374151;
    background: var(--leo-paper); border: 1px solid rgba(26,26,46,.1);
    border-radius: 6px; padding: 10px 12px; margin: 8px 0;
}
.msg-copy-btn.copied { background-color: #198754 !important; color: #fff !important; }

/* Phase-1 stub callouts — honest "not built yet" markers */
.stub-note {
    background: rgba(91,164,201,.1); border: 1px dashed rgba(91,164,201,.6);
    color: #2e7396; font-size: .8rem; font-weight: 600;
    border-radius: 8px; padding: 8px 12px;
}

/* Needs-action list */
.action-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid rgba(26,26,46,.08); flex-wrap: wrap; }
.action-row:hover { background: var(--leo-gold-soft); }
.action-row .ar-reason { font-size: .8rem; color: #3f4a5a; }

.detail-grid dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: #2b3446; font-weight: 700; }
.detail-grid dd { margin: 1px 0 12px 0; font-size: .93rem; color: #212529; }

@media (max-width: 639px) {
    .leo-table-wrap { display: none; }
}
@media (min-width: 640px) {
    .leo-cards-wrap { display: none; }
}
