:root {
    color-scheme: light;
    --ink: #18303a;
    --muted: #64777d;
    --line: #e1e9e7;
    --surface: #ffffff;
    --canvas: #f5f8f7;
    --green: #087c70;
    --green-dark: #075e57;
}

* { box-sizing: border-box; }
html { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, ui-sans-serif, sans-serif; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
:focus-visible { outline: 3px solid #58b8a7; outline-offset: 3px; }

.app-frame { min-height: 100vh; display: flex; }
.sidebar {
    width: 260px; flex: 0 0 260px; min-height: 100vh; padding: 25px 14px 20px;
    color: var(--ink); background: #fff; display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); padding: 0 13px 35px; }
.brand-mark {
    display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px;
    background: #0a625b; color: #fff; font: 700 27px Georgia, serif;
    box-shadow: 0 7px 16px #087c7028;
}
.brand strong { display: block; font-size: 21px; font-weight: 760; line-height: 1; letter-spacing: -.05em; }
.brand small { display: block; margin-top: 6px; font-size: 9px; color: #78908f; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.workspace-label { padding: 0 15px; font-size: 10px; font-weight: 800; letter-spacing: .14em; color: #829593; }
.workspace-role { margin: 8px 8px 19px; padding: 12px 14px; border: 1px solid #d8e9e4; background: #f1f8f5; color: #165d54; border-radius: 12px; font-size: 13px; font-weight: 730; }
.main-nav { display: grid; gap: 3px; min-height: 0; overflow-y: auto; padding: 0 4px 12px; scrollbar-width: thin; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 10px 13px; border-radius: 10px; font-size: 13px; font-weight: 570; color: #52686b; transition: background .18s, color .18s; }
.nav-link:hover { color: #0a675e; background: #f4f8f6; }
.nav-link.is-active { color: #075f57; background: #e8f5f0; font-weight: 750; }
.nav-dot { width: 8px; height: 8px; flex: 0 0 8px; border: 1.5px solid #a8bdb8; border-radius: 3px; transform: rotate(45deg); }
.nav-link.is-active .nav-dot { border-color: var(--green); background: var(--green); box-shadow: 0 0 0 3px #087c7018; }
.sidebar-bottom { margin-top: auto; padding: 17px 15px 2px; border-top: 1px solid var(--line); }
.sidebar-caption { color: #829593; font-size: 11px; margin-bottom: 14px; }
.account-link, .logout-link { display: flex; justify-content: space-between; color: #52686b; font-size: 13px; font-weight: 620; }
.account-link { margin-bottom: 13px; }
.account-link:hover, .logout-link:hover { color: var(--green-dark); }

.main-column { flex: 1; min-width: 0; }
.topbar { height: 78px; padding: 0 44px; border-bottom: 1px solid var(--line); background: #fff; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topbar-caption { color: #73888b; font-size: 12px; font-weight: 600; }
.topbar-identity { display: flex; align-items: center; justify-content: flex-end; gap: 20px; min-width: 0; margin-left: auto; }
.barou-chip { display: flex; flex-direction: column; min-width: 0; padding: 5px 20px 5px 0; border-right: 1px solid var(--line); line-height: 1.3; }
.barou-chip-label { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.barou-chip strong { overflow: hidden; max-width: 240px; color: var(--green-dark); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.account-chip { display: flex; align-items: center; gap: 11px; font-size: 13px; font-weight: 650; white-space: nowrap; }
.account-chip:hover { color: var(--green-dark); }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: #e6f3ee; color: var(--green-dark); font-size: 11px; font-weight: 800; }
.menu-toggle { display: none; border: 0; background: transparent; color: var(--ink); font-size: 22px; cursor: pointer; }
.page-content { max-width: 1480px; margin: 0 auto; padding: 38px 44px 80px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.eyebrow { display: block; color: var(--green); font-size: 10px; line-height: 1.5; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.page-heading h1 { margin: 7px 0 0; font-size: clamp(29px, 3vw, 38px); font-weight: 740; line-height: 1.15; letter-spacing: -.045em; }
.page-pill { padding: 9px 13px; border: 1px solid #dbe8e3; border-radius: 9px; color: #376b63; background: #f1f8f5; font-size: 11px; font-weight: 700; white-space: nowrap; }

.hero { min-height: 238px; padding: 35px 40px; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; border-radius: 18px; color: #fff; box-shadow: 0 18px 34px #163c4020; }
.hero-admin { background: linear-gradient(115deg, #143b42 0%, #135e5b 70%, #178171 100%); }
.hero-operator { background: linear-gradient(115deg, #153d4a 0%, #176b71 100%); }
.hero-avocat { background: linear-gradient(115deg, #26464b 0%, #50755f 100%); }
.hero h2 { position: relative; z-index: 1; max-width: 570px; margin: 12px 0 10px; font-size: clamp(27px, 2.8vw, 35px); font-weight: 730; line-height: 1.15; letter-spacing: -.04em; }
.hero p { position: relative; z-index: 1; max-width: 540px; color: #e5f2ef; font-size: 14px; line-height: 1.6; margin: 0 0 23px; }
.eyebrow-light { color: #cbe0d9; }
.hero-symbol { position: absolute; right: 55px; top: -44px; color: #ffffff13; font: 400 310px/1 Georgia, serif; user-select: none; }
.button { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 20px; min-height: 42px; border-radius: 10px; padding: 11px 16px; font-size: 12px; font-weight: 750; transition: transform .18s, box-shadow .18s, background .18s; }
.button:hover { transform: translateY(-1px); box-shadow: 0 7px 16px #00000015; }
.button-light { background: #fff; color: #174b50; }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 18px 0 27px; }
.metric { min-height: 142px; display: flex; flex-direction: column; align-items: flex-start; padding: 23px 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 6px 18px #163c4008; }
.metric-label { color: var(--muted); font-size: 12px; font-weight: 670; }
.metric strong { margin-top: 10px; font-size: 34px; font-weight: 750; line-height: 1.15; letter-spacing: -.05em; }
.metric-hint { margin-top: auto; color: #8a98a5; font-size: 11px; }
.metric-action { background: #eaf7f2; border-color: #d6e9e1; color: #165b50; }
.metric-action strong { font-size: 23px; }
.metric-action strong span { font-size: 17px; }
.metric-action:hover { border-color: #9bc9b4; }
.metric-wide { grid-column: span 2; }
.metric-wide strong { font-size: 21px; }

.panel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.panel { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 6px 18px #163c4008; }
.panel-heading { display: flex; justify-content: space-between; align-items: end; gap: 12px; padding: 25px 27px 19px; }
.panel-heading h2 { margin: 5px 0 0; font-size: 21px; font-weight: 730; line-height: 1.25; letter-spacing: -.035em; }
.heading-count { display: inline-block; padding: 3px 9px; border-radius: 100px; background: #e7f2ed; color: #216552; font: 700 12px/1.3 ui-sans-serif, sans-serif; vertical-align: middle; }
.text-link { color: var(--green); font-size: 12px; font-weight: 700; white-space: nowrap; }
.text-link:hover { text-decoration: underline; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th { padding: 13px 27px; color: #748a8b; background: #f8fbf9; border-block: 1px solid #edf2ef; font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 16px 27px; border-bottom: 1px solid #edf2ef; color: #4b6268; font-size: 13px; line-height: 1.5; }
.data-table tbody tr:hover { background: #f8fbf9; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td strong { color: var(--ink); font-weight: 700; }
.status-pill { display: inline-block; padding: 5px 9px; border-radius: 100px; background: #e6f3ed; color: #176749; font-size: 10px; font-weight: 750; white-space: nowrap; }
.empty-panel { padding: 32px; }
.empty-panel h2 { margin: 8px 0; font-size: 24px; font-weight: 720; letter-spacing: -.035em; }
.empty-panel p { color: var(--muted); font-size: 14px; }
.panel-intro { margin: 0; padding: 0 27px 24px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.notice-success { margin: 0 26px 24px; padding: 12px 15px; border-radius: 8px; background: #e6f3ed; color: #176749; font-size: 13px; font-weight: 650; }
.preferences-form { padding: 0 26px 27px; }
.choices-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.choice-card { display: flex; align-items: center; gap: 13px; min-height: 69px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.choice-card:hover { border-color: #b8d3c6; background: #f7fbf8; }
.choice-card input { width: 17px; height: 17px; accent-color: var(--green); }
.choice-card strong, .choice-card small { display: block; }
.choice-card strong { font-size: 13px; }
.choice-card small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.preferences-actions { display: flex; justify-content: flex-end; margin-top: 24px; }
.lookup-form { display: flex; align-items: flex-end; gap: 12px; padding-bottom: 20px; }
.lookup-form .form-grid { flex: 1; grid-template-columns: 1fr; }
.lookup-form .preferences-actions { flex: 0 0 auto; margin-top: 0; }
.lookup-form .button { min-height: 46px; }
.button-solid { border: 0; background: var(--green); color: #fff; cursor: pointer; }
.button-solid:hover { background: var(--green-dark); }
.button-outline { border: 1px solid #c7d4d0; background: #fff; color: var(--green-dark); cursor: pointer; }
.workspace-form { padding: 0 26px 27px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.workspace-form label, .decision-form label { display: grid; gap: 8px; color: var(--ink); font-size: 12px; font-weight: 750; }
.workspace-form input, .workspace-form select, .workspace-form textarea, .decision-form select, .decision-form textarea { width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid #d9e4e0; border-radius: 10px; background: #fff; color: var(--ink); font-size: 13px; transition: border-color .18s, box-shadow .18s; }
.workspace-form textarea, .decision-form textarea { resize: vertical; }
.workspace-form input:focus, .workspace-form select:focus, .workspace-form textarea:focus, .decision-form select:focus, .decision-form textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px #0f766e17; }
.form-full { grid-column: 1 / -1; }
.workspace-form .form-check { display: flex; align-items: center; gap: 10px; grid-column: 1 / -1; }
.workspace-form .form-check input { width: 17px; min-height: 17px; height: 17px; accent-color: var(--green); }
.form-error { min-height: 0; margin: 0 26px 17px; color: #ae3e37; font-size: 13px; }
.form-error:empty { display: none; }
.proposal-hero { min-height: 205px; margin-bottom: 20px; }
.proposal-grid { align-items: start; }
.existing-offices-panel { margin: 0 26px 24px; border: 1px solid #e7cda2; border-radius: 12px; overflow: hidden; background: #fffdf8; }
.existing-offices-panel .panel-heading { align-items: center; }
.existing-offices-panel .eyebrow { color: #9a631f; }
.existing-offices-panel .panel-intro { color: #765a36; }
.existing-offices-actions { display: flex; justify-content: flex-end; padding: 18px 26px; border-top: 1px solid #efe3cf; }
.existing-offices-count { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 100px; background: #f8e5c2; color: #815218; font-size: 13px; font-weight: 800; }
.possible-duplicate { color: #a54a29; font-size: 11px; font-weight: 750; }
.possible-duplicate:empty { display: none; }
.case-check-clear { margin: 0 26px 24px; padding: 13px 17px; border: 1px solid #d6e9e1; border-radius: 10px; background: #eff8f3; color: #226d53; font-size: 13px; font-weight: 650; }
.detail-list { padding: 0 26px 23px; }
.detail-list p { display: flex; justify-content: space-between; gap: 20px; margin: 0; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.detail-list p:last-child { border-bottom: 0; }
.detail-list span { color: var(--muted); }
.detail-list strong { text-align: right; }
.decision-form { padding: 0 26px 24px; }
.decision-form + .decision-form { border-top: 1px solid var(--line); padding-top: 23px; }
.decision-form .button { margin-top: 14px; }
.form-hint { margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.preset-list { padding: 0 26px 26px; }
.preset-row { display: flex; align-items: end; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.preset-edit-form { display: flex; align-items: end; flex: 1; gap: 10px; min-width: 0; }
.preset-edit-form label { display: grid; flex: 1; gap: 7px; min-width: 0; color: var(--ink); font-size: 12px; font-weight: 750; }
.preset-edit-form input { width: 100%; height: 43px; padding: 0 12px; border: 1px solid #d9e4e0; border-radius: 10px; color: var(--ink); font-size: 13px; }
.preset-edit-form input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px #0f766e17; }
.preset-edit-form .button { min-height: 42px; }
.preset-delete-form { padding-bottom: 11px; }
.preset-delete-form button { padding: 0; border: 0; background: none; cursor: pointer; }
.report-export { display: flex; justify-content: flex-end; padding: 0 26px 18px; }
.completed-ids { display: flex; gap: 8px; margin: 22px 0; }
.completed-office { margin-top: 18px; }
.completed-office-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.delegation-preview { margin: 0 26px 26px; padding: 26px 32px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font: 15px/1.65 Georgia, serif; }
.delegation-preview h1 { margin: 26px 0; font-size: 21px; line-height: 1.35; }
.delegation-preview h2 { margin: 0 0 20px; font-size: 17px; }
.delegation-preview p { margin: 17px 0; }
.office-live-preview { margin: 22px 0 0; padding: 22px 25px; border: 1px solid var(--line); border-radius: 12px; background: #f8fbf9; }
.office-live-preview h3 { margin: 0 0 13px; font-size: 16px; }
.office-live-preview p { margin: 0 0 10px; color: var(--ink); font: 14px/1.6 Georgia, serif; }
.office-live-preview p:last-child { margin-bottom: 0; }
.search-form { display: flex; gap: 9px; padding: 0 26px 20px; }
.search-form input { flex: 1; min-width: 0; height: 43px; padding: 0 13px; border: 1px solid #d9e4e0; border-radius: 10px; background: #fff; color: var(--ink); font-size: 12px; }
.search-form button { padding: 0 18px; border: 0; border-radius: 10px; background: var(--green); color: #fff; cursor: pointer; font-size: 12px; font-weight: 700; }
.form-label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 750; }
.role-choices { display: flex; flex-wrap: wrap; gap: 10px; }
.role-choices label { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.role-choices input { width: 16px; min-height: 16px; height: 16px; accent-color: var(--green); }
.workspace-form label small { color: var(--muted); font-size: 11px; font-weight: 400; }

@media (max-width: 1100px) {
    .sidebar { width: 220px; flex-basis: 220px; }
    .topbar { padding-inline: 28px; }
    .page-content { padding-inline: 28px; }
    .panel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 740px) {
    .sidebar { position: fixed; z-index: 30; transform: translateX(-100%); transition: transform .22s; box-shadow: 15px 0 45px #14273820; }
    .sidebar.is-open { transform: translateX(0); }
    .menu-toggle { display: block; }
    .topbar { height: 66px; padding-inline: 18px; }
    .topbar-caption { display: none; }
    .topbar-identity { gap: 12px; }
    .barou-chip { padding-right: 12px; }
    .barou-chip strong { max-width: 135px; }
    .account-name { display: none; }
    .page-content { padding: 27px 17px 50px; }
    .page-heading { align-items: start; }
    .page-heading h1 { font-size: 29px; }
    .page-pill { display: none; }
    .hero { min-height: 272px; padding: 29px; }
    .hero h2 { font-size: 29px; }
    .hero-symbol { right: -30px; top: 18px; font-size: 240px; }
    .metrics { grid-template-columns: 1fr 1fr; gap: 10px; }
    .metric { min-height: 125px; padding: 19px; }
    .metric-action, .metric-wide { grid-column: span 2; }
    .metric strong { font-size: 27px; }
    .panel-heading { padding-inline: 19px; }
    .data-table th, .data-table td { padding-inline: 19px; }
    .choices-grid { grid-template-columns: 1fr; }
    .panel-intro { padding-inline: 19px; }
    .preferences-form { padding-inline: 19px; }
    .workspace-form, .decision-form { padding-inline: 19px; }
    .preset-list { padding-inline: 19px; }
    .report-export { padding-inline: 19px; }
    .preset-row, .preset-edit-form { flex-wrap: wrap; }
    .form-grid { grid-template-columns: 1fr; }
    .lookup-form { flex-wrap: wrap; }
    .lookup-form .form-grid { flex-basis: 100%; }
    .lookup-form .preferences-actions { width: 100%; }
    .lookup-form .button { width: 100%; }
    .search-form { padding-inline: 19px; }
    .completed-office-actions { margin-top: 12px; }
    .delegation-preview { margin-inline: 19px; padding: 20px; }
    .office-live-preview { padding: 18px; }
}

.auth-page { background: #f5f8f7; }
.auth-shell { display: grid; grid-template-columns: minmax(390px, 47%) minmax(0, 1fr); min-height: 100vh; }
.auth-story { position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 49px 58px; color: #fff; background: linear-gradient(145deg, #173c43 8%, #145f5c 65%, #0d8072); }
.auth-brand { position: relative; z-index: 1; padding: 0; color: #fff; }
.auth-brand .brand-mark { background: #fff; color: #0a625b; box-shadow: none; }
.auth-brand small { color: #c3dfd9; }
.auth-story-content { position: relative; z-index: 1; max-width: 520px; margin: auto 0 33px; }
.auth-story h1 { margin: 17px 0 21px; font-size: clamp(40px, 4.1vw, 62px); font-weight: 750; line-height: 1.08; letter-spacing: -.055em; }
.auth-story p { max-width: 440px; margin: 0; color: #d3e6e4; font-size: 16px; line-height: 1.7; }
.auth-rule { width: 48px; height: 2px; margin: 53px 0 24px; background: #d3b476; }
.auth-story-footer { color: #afcecc; font-size: 11px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.auth-watermark { position: absolute; right: -18px; bottom: -140px; color: #ffffff0b; font: 400 490px/1 Georgia, serif; user-select: none; }
.auth-main { display: grid; place-items: center; padding: 48px 38px; background: radial-gradient(circle at 80% 12%, #e6f4ef 0, transparent 40%), #f6f9f7; }
.auth-card, .auth-main #formContent { width: min(100%, 420px); }
.auth-card { padding: 36px; border: 1px solid #e3ebe7; border-radius: 20px; background: #fff; box-shadow: 0 24px 60px #163c4010; }
.auth-card h2 { margin: 11px 0 13px; font-size: 36px; font-weight: 750; line-height: 1.15; letter-spacing: -.05em; }
.auth-intro { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0 0 32px; }
.auth-form, .auth-main #formContent form { display: flex; flex-direction: column; }
.auth-form label { margin: 0 0 9px; font-size: 12px; font-weight: 750; }
.auth-form input, .auth-main #formContent input:not([type="submit"]) { width: 100%; height: 50px; margin: 0 0 21px; padding: 0 15px; border: 1px solid #d9e4e0; border-radius: 10px; outline: none; background: #fff; color: var(--ink); font-size: 14px; }
.auth-form input:focus, .auth-main #formContent input:focus { border-color: #0f766e; box-shadow: 0 0 0 3px #0f766e17; }
.auth-form input::placeholder { color: #9caab3; }
.auth-form button, .auth-main #formContent input[type="submit"] { width: 100%; height: 52px; margin-top: 7px; display: flex; align-items: center; justify-content: space-between; padding: 0 19px; border: 0; border-radius: 10px; background: var(--green); color: #fff; cursor: pointer; font-size: 13px; font-weight: 750; transition: background .18s, transform .18s; }
.auth-form button:hover, .auth-main #formContent input[type="submit"]:hover { background: #095a54; transform: translateY(-1px); }
.auth-help { margin: 25px 0 0; color: #84939d; font-size: 12px; line-height: 1.55; }
.reset-restart-form { margin-top: 18px; }
.reset-restart-form button { padding: 0; border: 0; background: none; color: var(--green); cursor: pointer; font-size: 12px; font-weight: 700; }
.auth-error { padding: 13px 15px; margin-bottom: 22px; border-radius: 8px; background: #fceceb; color: #aa3a34; font-size: 13px; }
.auth-main #formContent { padding: 35px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.auth-main #formContent #icon { display: block; max-width: 160px; margin: 0 auto 25px; }
.auth-main #formContent p { color: var(--muted); font-size: 14px; line-height: 1.6; }
.auth-main #formFooter { margin-top: 24px; color: #93a0aa; font-size: 11px; }

@media (max-width: 900px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-story { min-height: 265px; padding: 31px 35px; }
    .auth-brand { margin-bottom: 35px; }
    .auth-story-content { margin: 0; }
    .auth-story h1 { max-width: 550px; margin: 10px 0; font-size: 37px; }
    .auth-story p { font-size: 13px; }
    .auth-rule, .auth-story-footer { display: none; }
    .auth-watermark { right: -9px; bottom: -65px; font-size: 300px; }
    .auth-main { padding: 56px 24px; }
}
@media (max-width: 520px) {
    .auth-story { min-height: 230px; padding: 26px 22px; }
    .auth-brand { margin-bottom: 30px; }
    .auth-story h1 { font-size: 31px; }
    .auth-story p { display: none; }
    .auth-main { align-items: start; padding: 43px 22px; }
    .auth-card { padding: 27px 23px; }
    .auth-card h2 { font-size: 34px; }
}
