/* ============================================
   Clearpath Client Portal — Design System
   Navy/Blue color scheme
   ============================================ */

:root {
  --navy: #11243d;
  --navy-2: #182f4c;
  --ink: #162233;
  --muted: #718095;
  --line: #e5e9ef;
  --surface: #ffffff;
  --canvas: #f5f7fa;
  --green: #2c9d76;
  --green-soft: #e7f6ef;
  --gold: #c99031;
  --gold-soft: #fdf4e4;
  --blue: #3976ba;
  --blue-soft: #eaf2ff;
  --purple: #7654bd;
  --purple-soft: #f0ecff;
  --red: #ae5160;
  --shadow: 0 10px 30px rgba(19,35,56,0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { min-width: 320px; background: var(--canvas); }
body { min-width: 320px; background: var(--canvas); color: var(--ink); font-family: Arial, Helvetica, sans-serif; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: none; }
button:disabled { cursor: not-allowed; opacity: .58; }

/* ---- Portal Shell ---- */
.portal-shell { min-height: 100vh; display: flex; background: var(--canvas); }
.portal-sidebar { width: 256px; flex-shrink: 0; min-height: 100vh; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--navy); color: #dce6f3; z-index: 20; transition: transform .2s ease; }
.portal-main { min-width: 0; flex: 1; }
.portal-header { height: 91px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 clamp(24px, 4vw, 58px); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.82); }
.header-title { display: flex; align-items: center; gap: 13px; }
.header-title h1 { margin: 2px 0 0; font-size: 18px; line-height: 1.1; letter-spacing: -.2px; }
.header-actions { display: flex; align-items: center; gap: 22px; }
.secure-pill { display: inline-flex; align-items: center; gap: 6px; color: #597087; font-size: 11px; font-weight: 600; }
.secure-pill i { color: var(--green); font-size: 9px; }
.avatar-header { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #dce9ef; color: #21405a; font-size: 11px; font-weight: 800; flex-shrink: 0; }
.menu-button { display: none; padding: 8px; background: transparent; color: var(--navy); font-size: 21px; }
.content-area { width: 100%; max-width: 1390px; margin: 0 auto; padding: 38px clamp(24px, 4vw, 58px) 60px; }
.eyebrow { margin: 0; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; }

/* ---- Sidebar ---- */
.sidebar-brand { min-height: 91px; display: flex; align-items: center; gap: 10px; padding: 22px 24px; border-bottom: 1px solid rgba(255,255,255,.09); color: white; font-size: 21px; font-weight: 700; letter-spacing: -.5px; }
.sidebar-brand small { display: block; margin-left: -6px; align-self: flex-end; padding-bottom: 4px; color: #91a5bf; font-size: 9px; font-weight: 700; letter-spacing: 1.05px; text-transform: uppercase; }
.brand-monogram { width: 32px; height: 32px; display: grid; place-items: center; background: #d8a74d; border-radius: 10px; color: var(--navy); font-family: Georgia, serif; font-size: 21px; font-weight: 700; flex-shrink: 0; }
.portal-nav { padding: 25px 13px; display: grid; gap: 4px; }
.nav-label { margin: 15px 11px 7px; color: #8499b2; font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; }
.nav-label:first-child { margin-top: 0; }
.nav-item { width: 100%; min-height: 43px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border-radius: 8px; background: transparent; color: #c1cddd; text-align: left; font-size: 14px; font-weight: 600; transition: .15s ease; }
.nav-item:hover { background: rgba(255,255,255,.06); color: white; }
.nav-item.active { background: rgba(255,255,255,.13); color: white; }
.nav-item i { width: 17px; font-style: normal; color: #9db1c9; font-size: 18px; line-height: 1; text-align: center; }
.nav-item.active i { color: #f2c66f; }
.count-badge { min-width: 19px; height: 19px; display: grid; place-items: center; margin-left: auto; padding: 0 5px; border-radius: 99px; background: #d9a54a; color: #182a43; font-size: 10px; }
.sidebar-user { margin: auto 14px 14px; padding: 14px 10px; display: flex; align-items: center; gap: 10px; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-user > div:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.sidebar-user strong { overflow: hidden; color: white; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user span { color: #8fa2ba; font-size: 10px; }
.sidebar-scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 15; }

/* ---- Cards & Layout ---- */
.welcome-card { min-height: 215px; position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 34px; padding: 35px 44px; border-radius: 14px; color: white; background: linear-gradient(115deg, #102540 0%, #193957 100%); box-shadow: 0 18px 35px rgba(17,36,61,.12); }
.welcome-card:before { width: 430px; height: 430px; position: absolute; right: -120px; top: -165px; z-index: -1; border: 1px solid rgba(216,167,77,.42); border-radius: 50%; box-shadow: 0 0 0 38px rgba(216,167,77,.04), 0 0 0 95px rgba(216,167,77,.035); content: ""; }
.welcome-card > div:first-child { max-width: 680px; }
.welcome-card .eyebrow { color: #aebfd1; }
.welcome-card h2 { margin: 7px 0 8px; font-size: clamp(23px, 3vw, 31px); line-height: 1.15; letter-spacing: -.8px; }
.welcome-card p { max-width: 620px; color: #c1cedc; font-size: 13px; line-height: 1.7; }
.welcome-orbit { width: 130px; height: 130px; flex-shrink: 0; position: relative; display: grid; place-items: center; border: 1px solid rgba(218,177,100,.55); border-radius: 50%; background: rgba(15,34,58,.44); }
.welcome-orbit:before, .welcome-orbit:after { position: absolute; border-radius: 50%; content: ""; }
.welcome-orbit:before { inset: 11px; border: 1px solid rgba(255,255,255,.16); }
.welcome-orbit:after { width: 5px; height: 5px; right: 23px; top: 19px; background: #e8be6b; box-shadow: -85px 84px 0 #e8be6b; }
.orbit-inner { display: grid; color: white; font-size: 29px; font-weight: 800; text-align: center; }
.orbit-inner span { margin-top: 2px; color: #acbed0; font-size: 9px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }

.trust-row { display: flex; flex-wrap: wrap; gap: 18px 30px; margin: 19px 4px 39px; color: #728298; font-size: 11px; font-weight: 600; }
.trust-row span { display: inline-flex; align-items: center; gap: 6px; }
.trust-row span:first-letter { color: var(--green); }

/* ---- Section ---- */
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.section-heading h2 { font-size: 19px; letter-spacing: -.3px; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 17px; margin: 19px 0; }
.stat-card { min-height: 160px; padding: 20px; border: 1px solid var(--line); border-radius: 11px; background: white; box-shadow: 0 5px 18px rgba(18,37,58,.035); }
.stat-icon { width: 27px; height: 27px; display: grid; place-items: center; margin-bottom: 17px; border-radius: 7px; font-size: 15px; font-weight: 800; }
.stat-icon.navy { background: #e7eef7; color: #406c99; }
.stat-icon.green { background: var(--green-soft); color: var(--green); }
.stat-icon.gold { background: var(--gold-soft); color: var(--gold); }
.stat-card p { margin: 0 0 6px; color: #6d7b8e; font-size: 11px; font-weight: 600; }
.stat-card strong { display: block; margin-bottom: 8px; font-size: 21px; letter-spacing: -.5px; }
.stat-card small { color: #9da7b3; font-size: 10px; }

.two-column { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; margin: 19px 0; }
.panel { padding: 23px 24px; border: 1px solid var(--line); border-radius: 11px; background: white; box-shadow: 0 5px 18px rgba(18,37,58,.035); }
.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.action-panel { display: flex; flex-direction: column; justify-content: space-between; gap: 23px; background: #fdfdfc; }
.action-panel > div > p:last-child { margin: 10px 0 0; color: #6f7d8f; font-size: 12px; line-height: 1.55; }

.primary-matter { overflow: hidden; padding: 23px 26px 18px; border: 1px solid #e5e9ee; border-radius: 12px; background: white; box-shadow: var(--shadow); }
.matter-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.matter-reference { color: #4c6177; font-family: "Courier New", monospace; font-size: 12px; font-weight: 700; letter-spacing: .2px; }

/* ---- Status Badges ---- */
.status { display: inline-flex; align-items: center; width: max-content; padding: 5px 8px; border-radius: 5px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status:before { width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: currentColor; content: ""; }
.status-green { background: var(--green-soft); color: #2e8e6d; }
.status-amber { background: var(--gold-soft); color: #a66c13; }
.status-blue { background: var(--blue-soft); color: #3976ba; }
.status-purple { background: var(--purple-soft); color: #7253b6; }

/* ---- Matter ---- */
.matter-grid { display: grid; grid-template-columns: 1.45fr 1fr .75fr; gap: 20px; margin: 22px 0 21px; }
.metric-label { display: block; margin: 0 0 5px; color: #8390a0; font-size: 9px; font-weight: 800; letter-spacing: .9px; text-transform: uppercase; }
.matter-grid strong { font-size: 14px; }
.progress-track { height: 4px; overflow: hidden; border-radius: 99px; background: #e9eef3; }
.progress-track span { height: 100%; display: block; border-radius: inherit; background: #4f9e86; }
.matter-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; color: #7a8899; font-size: 11px; }

/* ---- Buttons ---- */
.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 17px; padding: 0 16px; border-radius: 7px; font-size: 12px; font-weight: 800; transition: transform .12s ease, box-shadow .12s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 5px 12px rgba(17,36,61,.13); }
.button b { font-size: 15px; }
.button-primary { background: #2d78bd; color: white; }
.button-dark { background: var(--navy); color: white; }
.button-secondary { border: 1px solid #ccd5df; background: white; color: var(--navy); }
.button-full { width: 100%; }
.text-button { border: 0; padding: 0; background: transparent; color: #235b98; font-size: 12px; font-weight: 700; text-align: left; }
.text-button b { margin-left: 4px; font-size: 14px; }

/* ---- Timeline ---- */
.timeline { margin: 23px 0 0; }
.timeline-item { position: relative; display: grid; grid-template-columns: 16px 1fr; gap: 10px; padding: 0 0 19px; }
.timeline-item:not(:last-child):before { width: 1px; position: absolute; left: 6px; top: 13px; bottom: -1px; background: #dce3e9; content: ""; }
.timeline-dot { width: 13px; height: 13px; margin-top: 2px; position: relative; z-index: 1; border: 3px solid white; border-radius: 50%; background: #62a88e; box-shadow: 0 0 0 1px #b4dccb; }
.timeline-item p { margin: 0 0 5px; color: #344557; font-size: 12px; line-height: 1.45; }
.timeline-item small { color: #9aa6b3; font-size: 10px; }

/* ---- Info Boxes ---- */
.information-note { display: flex; gap: 10px; align-items: flex-start; padding: 13px 15px; border: 1px solid #dae8f5; border-radius: 8px; background: #f4f8fc; color: #5c7185; font-size: 11px; line-height: 1.55; margin: 19px 0; }
.information-note > span { width: 17px; height: 17px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: #6390bd; color: white; font-family: Georgia, serif; font-weight: 700; }
.information-note strong { color: #3e5b75; }

.notice { min-height: 43px; display: flex; align-items: center; gap: 9px; margin: -15px 0 22px; padding: 10px 13px; border: 1px solid #c7e9d8; border-radius: 9px; background: #effaf4; color: #267456; font-size: 13px; font-weight: 600; }
.notice > span { width: 19px; height: 19px; display: grid; place-items: center; border-radius: 50%; background: #37a878; color: white; font-size: 11px; }
.notice button { margin-left: auto; background: none; color: #558c73; font-size: 19px; }

/* ---- Forms ---- */
.form-card { padding: 28px; border: 1px solid var(--line); border-radius: 11px; background: white; box-shadow: 0 5px 18px rgba(18,37,58,.035); }
.form-heading { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 27px; }
.form-step { width: 28px; height: 28px; flex-shrink: 0; display: grid; place-items: center; border-radius: 7px; background: #e6eef6; color: #356289; font-size: 12px; font-weight: 800; }
.form-heading h3 { margin: 1px 0 4px; font-size: 16px; }
.form-heading p { color: #758295; font-size: 12px; line-height: 1.5; }
.form-card label { display: grid; gap: 7px; margin-bottom: 18px; color: #42576c; font-size: 11px; font-weight: 800; }
.form-card em { color: #c15b5b; font-style: normal; }
.form-card input, .form-card select, .form-card textarea { width: 100%; outline: none; padding: 10px 11px; border: 1px solid #dce2e8; border-radius: 6px; background: white; color: #2f4154; font-size: 13px; font-weight: 500; transition: border .15s, box-shadow .15s; }
.form-card input:focus, .form-card select:focus, .form-card textarea:focus { border-color: #5291c9; box-shadow: 0 0 0 3px #e7f2fb; }
.form-card input:disabled { background: #f4f6f8; color: #8e9aa7; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.intake-form { max-width: 850px; }
.choice-card { display: flex; align-items: center; gap: 12px; padding: 14px 13px; margin-bottom: 7px; border: 1px solid #e1e6ec; border-radius: 8px; cursor: pointer; transition: .12s; }
.choice-card.selected { border-color: #5291c9; background: #f7fafe; }
.choice-card input[type="radio"] { width: 16px; height: 16px; accent-color: #2d78bd; flex-shrink: 0; }
.choice-card span { flex: 1; display: grid; gap: 3px; }
.choice-card strong { font-size: 12px; color: #344557; }
.choice-card small { color: #8394a6; font-size: 10px; }
.choice-card b { color: #5487b8; font-size: 11px; }
fieldset { border: none; padding: 0; margin: 0 0 18px; }
fieldset legend { margin-bottom: 9px; color: #42576c; font-size: 11px; font-weight: 800; }

/* ---- Tables ---- */
.table-card { overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: white; box-shadow: var(--shadow); }
.matter-row { width: 100%; min-height: 76px; display: grid; grid-template-columns: 1.2fr 1.2fr .85fr 90px 18px; align-items: center; gap: 20px; padding: 13px 21px; border: 0; border-bottom: 1px solid #edf0f3; background: white; color: var(--ink); text-align: left; transition: background .12s ease; }
.matter-row:last-child { border-bottom: 0; }
.matter-row:hover { background: #f9fbfc; }
.matter-row strong { display: block; font-size: 12px; line-height: 1.35; }
.row-reference { display: grid; gap: 4px; }
.row-reference strong { color: #2c516f; font-family: "Courier New", monospace; }
.row-reference span { color: #96a1af; font-size: 10px; }
.row-arrow { color: #66809b; font-size: 18px; }

/* ---- Case Detail ---- */
.case-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 27px 28px; border-radius: 12px; background: var(--navy); color: white; }
.case-hero > div:first-child { max-width: 690px; }
.case-hero .matter-reference { color: #b7c9da; }
.case-hero h2 { margin-top: 17px; font-size: clamp(20px, 3vw, 28px); }
.case-hero p { color: #c1d0de; font-size: 13px; line-height: 1.65; }
.case-value { min-width: 185px; padding: 15px; border-radius: 8px; background: rgba(255,255,255,.09); }
.case-value span { display: block; margin-bottom: 9px; color: #b4c4d4; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.case-value strong { font-size: 22px; }
.back-link { margin-bottom: 19px; display: inline-flex; align-items: center; gap: 5px; color: #235b98; font-size: 12px; font-weight: 700; }

/* ---- Detail Grid ---- */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, .75fr); gap: 19px; margin-top: 19px; }
.timeline.large { margin-top: 27px; }
.timeline.large .timeline-item { padding-bottom: 26px; }

/* ---- Side Stack ---- */
.side-stack { display: grid; align-content: start; gap: 18px; }
.side-card { padding: 23px; border: 1px solid var(--line); border-radius: 11px; background: white; box-shadow: 0 5px 18px rgba(18,37,58,.035); }
.side-card.subdued { background: #f1f6f9; }
.side-icon { width: 29px; height: 29px; display: grid; place-items: center; margin-bottom: 15px; border-radius: 8px; background: #e5eef5; color: #497195; font-size: 15px; }
.side-card h3 { margin: 6px 0 8px; font-size: 15px; }
.side-card p:not(.eyebrow) { margin: 0 0 17px; color: #708092; font-size: 12px; line-height: 1.6; }

/* ---- Profile ---- */
.profile-hero { display: flex; align-items: center; gap: 20px; padding: 27px 28px; border-radius: 12px; background: white; border: 1px solid var(--line); }
.large-avatar { width: 60px; height: 60px; display: grid; place-items: center; border-radius: 50%; background: #dce9ef; color: #21405a; font-size: 18px; font-weight: 800; flex-shrink: 0; }
.profile-hero h2 { font-size: 22px; }
.profile-hero p { color: var(--muted); font-size: 13px; }
.profile-hero .verified { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 5px; background: var(--green-soft); color: #2e8e6d; font-size: 10px; font-weight: 800; }
.profile-status { margin-left: auto; text-align: right; }
.profile-status span { display: block; padding: 5px 8px; border-radius: 5px; background: var(--blue-soft); color: var(--blue); font-size: 10px; font-weight: 800; }
.profile-status strong { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.profile-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, .75fr); gap: 19px; margin-top: 19px; }

/* ---- Support ---- */
.support-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, .75fr); gap: 19px; margin-top: 19px; }
.tickets-panel { max-height: 600px; overflow-y: auto; }
.ticket-card { padding: 17px; border-bottom: 1px solid #edf0f3; }
.ticket-card:last-child { border-bottom: 0; }
.ticket-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.ticket-top > span { color: #506276; font-family: "Courier New", monospace; font-size: 11px; font-weight: 700; }
.ticket-card h3 { font-size: 14px; margin: 0 0 5px; }
.ticket-card p { color: #6b7a8d; font-size: 12px; line-height: 1.55; }
.ticket-card small { color: #9aa6b3; font-size: 10px; }

/* ---- Disbursements ---- */
.release-banner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 26px; border-radius: 12px; background: #edf5f0; margin-bottom: 19px; }
.release-banner h2 { margin: 6px 0; font-size: 20px; }
.release-banner p:last-child { max-width: 600px; color: #667d70; font-size: 12px; line-height: 1.55; }
.release-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; background: #317b5c; color: white; font-size: 15px; }
.release-checks { display: grid; gap: 5px; font-size: 11px; color: #578870; font-weight: 600; }
.disbursement-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, .75fr); gap: 19px; margin-top: 19px; }
.history-row { display: flex; align-items: center; gap: 13px; padding: 12px 0; border-bottom: 1px solid #edf0f3; }
.history-row:last-child { border-bottom: 0; }
.history-icon { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; background: #e7eef7; color: #406c99; font-size: 12px; flex-shrink: 0; }
.history-row strong { display: block; font-size: 12px; }
.history-row small { color: #9aa6b3; font-size: 10px; }

/* ---- Empty State ---- */
.empty-state { padding: 32px; text-align: center; }
.empty-icon { width: 45px; height: 45px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 11px; background: #eaeef3; color: #8092a6; font-size: 20px; }
.empty-state h3 { font-size: 14px; margin-bottom: 5px; }
.empty-state p { color: #8496a8; font-size: 12px; }

/* ---- Page Intro ---- */
.page-intro { margin-bottom: 24px; }
.page-intro > div { max-width: 720px; }
.page-intro h2 { margin-bottom: 8px; font-size: 28px; letter-spacing: -.5px; }
.page-intro p:last-child { color: #6c7b8d; font-size: 13px; line-height: 1.6; }
.page-intro.narrow { align-items: flex-start; }
.filter-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 10px; color: #748196; font-size: 11px; font-weight: 700; }
.filter-button { padding: 7px 9px; border: 1px solid #dbe1e7; border-radius: 5px; background: white; color: #506276; font-size: 11px; font-weight: 700; }
.filter-button.active { border-color: #5291c9; background: #f0f6ff; color: #356289; }
.secure-tag { padding: 7px 10px; border-radius: 5px; background: var(--green-soft); color: #388867; font-size: 10px; font-weight: 800; white-space: nowrap; }

/* ---- Loading ---- */
.portal-loading { min-height: 100vh; display: grid; place-content: center; gap: 15px; justify-items: center; text-align: center; }
.loader-mark { width: 55px; height: 55px; display: grid; place-items: center; border-radius: 13px; background: var(--navy); color: white; font-family: Georgia, serif; font-size: 28px; }

/* ---- Mobile ---- */
@media (max-width: 1023px) {
  .portal-sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); }
  .portal-sidebar.is-open { transform: translateX(0); }
  .sidebar-scrim { display: block; }
  .menu-button { display: inline-flex; }
  .portal-main { margin-left: 0 !important; }
  .content-area { padding: 25px 20px 35px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .two-column, .detail-grid, .profile-grid, .support-grid, .disbursement-grid { grid-template-columns: 1fr; }
  .matter-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .case-hero { flex-direction: column; }
  .case-value { min-width: auto; }
  .profile-hero { flex-wrap: wrap; }
  .profile-status { margin-left: 0; text-align: left; }
  .form-grid { grid-template-columns: 1fr; }
  .welcome-card { flex-direction: column; text-align: center; }
  .release-banner { flex-direction: column; }
}
