:root {
    --ink: #172126;
    --muted: #59686b;
    --line: #d6dfdc;
    --line-strong: #c7d2ce;
    --paper: #f7f4ed;
    --white: #ffffff;
    --surface: #fffdf9;
    --surface-soft: #f1f6f4;
    --teal: #0e766e;
    --teal-dark: #084d49;
    --clay: #a34f38;
    --gold: #c9972f;
    --blue: #315f6d;
    --mist: #e8f1ed;
    --shadow: 0 18px 45px rgba(24, 32, 36, .12);
    --shadow-soft: 0 16px 38px rgba(23, 33, 38, .08);
    --shadow-card: 0 12px 30px rgba(23, 33, 38, .07);
    --radius: 8px;
}

body.admin-body {
    min-height: 100vh;
    background: linear-gradient(180deg, #eef3f4 0%, #e7eeee 100%);
}

.admin-shell {
    --admin-sidebar-width: 264px;
    min-height: 100vh;
    color: var(--ink);
    background: linear-gradient(180deg, #eef3f4 0%, #e7eeee 100%);
}

.admin-sidebar {
    position: fixed;
    z-index: 50;
    inset: 0 auto 0 0;
    display: flex;
    width: var(--admin-sidebar-width);
    flex-direction: column;
    gap: 18px;
    padding: 16px 12px;
    overflow-y: auto;
    color: #f8fbfa;
    background:
        linear-gradient(180deg, rgba(14, 118, 110, .10), rgba(14, 118, 110, 0) 38%),
        #172126;
    border-right: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 14px 0 34px rgba(23, 33, 38, .18);
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px 14px;
    color: inherit;
    text-decoration: none;
}

.admin-brand .brand-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-color: rgba(255, 255, 255, .22);
    box-shadow: none;
}

.admin-brand strong,
.admin-brand small {
    display: block;
}

.admin-brand strong {
    line-height: 1;
}

.admin-brand small {
    margin-top: 3px;
    color: rgba(255, 255, 255, .58);
    font-size: .76rem;
    font-weight: 750;
}

.admin-nav {
    display: grid;
    gap: 18px;
}

.admin-nav-group {
    display: grid;
    gap: 4px;
}

.admin-nav-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 8px 8px 7px;
    border: 0;
    color: rgba(255, 255, 255, .48);
    background: transparent;
    cursor: pointer;
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .08em;
    line-height: 1;
    text-align: left;
    text-transform: uppercase;
}

.admin-nav-heading:hover,
.admin-nav-heading:focus-visible {
    color: rgba(255, 255, 255, .82);
    outline: none;
}

.admin-nav-chevron {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform .16s ease;
}

.admin-nav-heading[aria-expanded="false"] .admin-nav-chevron {
    transform: rotate(-45deg);
}

.admin-nav-items {
    display: grid;
    gap: 4px;
}

.admin-nav-items[hidden] {
    display: none;
}

.admin-nav a {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 9px 10px;
    border-radius: 6px;
    color: rgba(255, 255, 255, .76);
    font-size: .92rem;
    font-weight: 750;
    text-decoration: none;
}

.admin-nav a:hover,
.admin-nav a:focus-visible {
    color: #ffffff;
    background: rgba(255, 255, 255, .08);
    outline: none;
}

.admin-nav a.is-active {
    color: #ffffff;
    background: linear-gradient(135deg, #0e766e, #0a5f61);
    box-shadow: 0 10px 24px rgba(8, 77, 73, .24);
}

.admin-nav a.is-active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    bottom: 9px;
    width: 3px;
    border-radius: 999px;
    background: #f0c76c;
}

.admin-sidebar-foot {
    display: grid;
    gap: 6px;
    margin-top: auto;
    padding: 12px 8px 4px;
    border-top: 1px solid rgba(255, 255, 255, .1);
}

.admin-sidebar-foot a {
    color: rgba(255, 255, 255, .72);
    font-size: .86rem;
    font-weight: 750;
    text-decoration: none;
}

.admin-sidebar-foot a:hover,
.admin-sidebar-foot a:focus-visible {
    color: #ffffff;
    outline: none;
}

.admin-sidebar-backdrop {
    display: none;
}

.admin-workspace {
    display: flex;
    min-height: 100vh;
    min-width: 0;
    flex-direction: column;
    margin-left: var(--admin-sidebar-width);
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: auto minmax(220px, 560px) minmax(180px, auto);
    gap: 16px;
    align-items: center;
    min-width: 0;
    min-height: 64px;
    padding: 10px 22px;
    border-bottom: 1px solid rgba(199, 210, 206, .8);
    background: rgba(255, 253, 249, .92);
    box-shadow: 0 10px 26px rgba(23, 33, 38, .05);
    backdrop-filter: blur(14px);
}

.admin-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    padding: 9px;
    border: 1px solid #d8dee2;
    border-radius: 6px;
    background: #ffffff;
}

.admin-menu-toggle span {
    display: block;
    height: 2px;
    margin: 5px 0;
    background: #182024;
}

.admin-global-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    min-width: 0;
}

.admin-global-search label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.admin-global-search input {
    width: 100%;
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(23, 33, 38, .03);
}

.admin-global-search input:focus {
    border-color: #0e766e;
    outline: 3px solid rgba(14, 118, 110, .14);
}

.admin-global-search button {
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid #172126;
    border-radius: 6px;
    color: #ffffff;
    background: linear-gradient(135deg, #172126, #24343a);
    cursor: pointer;
    font-weight: 850;
}

.admin-user-chip {
    display: flex;
    align-items: center;
    justify-self: end;
    gap: 10px;
    min-width: 0;
}

.admin-user-chip > span {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    place-items: center;
    border-radius: 8px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--clay), #7f3d2f);
    box-shadow: 0 10px 22px rgba(163, 79, 56, .20);
    font-size: .88rem;
    font-weight: 900;
}

.admin-user-chip div {
    min-width: 0;
}

.admin-user-chip strong,
.admin-user-chip small {
    display: block;
    overflow: hidden;
    max-width: 280px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-user-chip strong {
    line-height: 1.1;
}

.admin-user-chip small {
    margin-top: 3px;
    color: #5d6a6d;
    font-size: .78rem;
    font-weight: 750;
}

.admin-content {
    width: 100%;
    min-width: 0;
    flex: 1;
    padding: 24px;
    overflow-x: hidden;
}

.admin-shell .dashboard {
    width: 100%;
    margin: 0;
    padding: 0;
}

.admin-shell .admin-dashboard {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 20px;
}

.admin-shell .admin-dashboard > * {
    min-width: 0;
}

.admin-shell .admin-dashboard > form {
    display: grid;
    gap: 20px;
}

.admin-shell .dashboard-hero {
    align-items: flex-start;
    margin-bottom: 0;
    padding: 18px;
    border: 1px solid rgba(214, 223, 220, .95);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255, 253, 249, .98), rgba(241, 246, 244, .96));
    box-shadow: var(--shadow-card);
}

.admin-shell .dashboard-hero h1 {
    font-size: clamp(1.65rem, 2.4vw, 2.35rem);
}

.admin-shell .dashboard-hero p {
    max-width: 780px;
    margin: 8px 0 0;
    font-size: .98rem;
}

.admin-shell .action-row {
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 0;
}

.admin-shell .button {
    width: auto;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: .88rem;
}

.admin-shell .main-panel,
.admin-shell .side-panel,
.admin-shell .metric-grid article,
.admin-shell .checker,
.admin-shell .result-panel,
.admin-shell .case-card,
.admin-shell .price-panel {
    border-color: rgba(214, 223, 220, .95);
    border-radius: 6px;
    box-shadow: var(--shadow-card);
}

.admin-shell .main-panel,
.admin-shell .side-panel {
    display: grid;
    align-content: start;
    gap: 16px;
    padding: 18px;
    background: rgba(255, 253, 249, .97);
}

.admin-shell .main-panel > *,
.admin-shell .side-panel > * {
    min-width: 0;
    max-width: 100%;
}

.admin-shell .metric-grid {
    gap: 14px;
    margin-bottom: 0;
}

.admin-shell .admin-metric-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.admin-shell .metric-grid article {
    padding: 16px;
    background:
        linear-gradient(180deg, #ffffff, #fbfdfc);
}

.admin-shell .metric-grid strong {
    margin: 6px 0;
    font-size: 2rem;
}

.admin-shell .filter-bar {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin: 0;
    padding: 12px;
    border-color: rgba(214, 223, 220, .95);
    border-radius: 6px;
    background: #f7faf9;
}

.admin-shell .filter-bar input,
.admin-shell .filter-bar select,
.admin-shell .inline-form input,
.admin-shell .inline-form select,
.admin-shell .inline-form textarea,
.admin-shell .compact-form input,
.admin-shell .compact-form select,
.admin-shell .field-group input,
.admin-shell .field-group select,
.admin-shell .field-group textarea {
    border-radius: 6px;
    background: #ffffff;
}

.admin-shell input[type="text"],
.admin-shell input[type="search"],
.admin-shell input[type="email"],
.admin-shell input[type="tel"],
.admin-shell input[type="number"],
.admin-shell input[type="date"],
.admin-shell input[type="datetime-local"],
.admin-shell select,
.admin-shell textarea {
    min-width: 0;
}

.admin-shell textarea {
    overflow-wrap: anywhere;
}

.admin-shell .field-group textarea {
    min-height: 112px;
}

.admin-shell .field-group textarea.matter-label-textarea {
    min-height: 64px;
}

.admin-shell .filter-bar .button {
    width: 100%;
    min-width: 0;
}

.admin-shell .admin-layout {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
    gap: 20px;
    align-items: start;
}

.admin-shell .dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    align-items: start;
}

.admin-shell .admin-detail-grid {
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 20px;
}

.admin-case-command {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    margin-bottom: 18px;
}

.admin-case-command h2 {
    margin: 3px 0 4px;
}

.admin-case-command p {
    margin: 0;
}

.case-jump-nav {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 4px;
}

.case-jump-nav a {
    padding: 7px 10px;
    border: 1px solid #d8dee2;
    border-radius: 6px;
    color: #344246;
    background: #f7f9f9;
    font-size: .84rem;
    font-weight: 850;
}

.case-jump-nav a:hover {
    border-color: var(--teal);
    color: var(--teal);
}

.admin-shell .split-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.admin-shell .inline-form {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin: 0;
}

.admin-shell .inline-form .button {
    width: 100%;
}

.admin-shell .panel-heading {
    align-items: flex-start;
    margin-bottom: 0;
    min-width: 0;
}

.admin-shell .panel-heading > div {
    min-width: 0;
}

.admin-shell .panel-heading .action-row {
    justify-content: flex-end;
}

.admin-shell table {
    min-width: 1120px;
    font-size: .92rem;
    table-layout: auto;
    background: #ffffff;
}

.admin-shell th,
.admin-shell td {
    padding: 11px 10px;
    vertical-align: top;
}

.admin-shell th {
    border-bottom-color: rgba(199, 210, 206, .9);
    color: #435258;
    background: #f3f7f5;
    font-size: .74rem;
    letter-spacing: .04em;
}

.admin-shell tr:hover td {
    background: #f6faf8;
}

.admin-shell .tag,
.admin-shell .pill {
    min-height: 24px;
    border-radius: 999px;
    font-size: .72rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
}

.admin-shell .table-pagination {
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px solid rgba(214, 223, 220, .8);
}

.admin-shell .responsive-table {
    margin-inline: 0;
    padding-bottom: 2px;
    border-radius: 8px;
    scrollbar-width: thin;
}

.admin-shell .responsive-table table {
    width: max-content;
    min-width: max(100%, 1120px);
}

.admin-shell .compact-admin-table table {
    width: 100%;
    min-width: 0;
}

.admin-shell .responsive-table .admin-edit-table {
    width: 100%;
    table-layout: fixed;
}

.admin-shell [data-volume-table="admin-cases"] table {
    min-width: 1220px;
}

.admin-shell [data-volume-table="admin-clients"] table {
    min-width: 1040px;
}

.admin-shell [data-volume-table="admin-audit"] table {
    min-width: 1180px;
}

.admin-shell .admin-team-table table {
    min-width: 1080px;
}

.admin-shell .admin-tasks-table table {
    min-width: 1080px;
}

.admin-shell .manual-state-table table {
    min-width: 720px;
}

.admin-shell .admin-edit-table td {
    vertical-align: middle;
}

.admin-shell .admin-edit-table strong,
.admin-shell .admin-edit-table small {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}

.admin-shell .admin-edit-table input:not([type="checkbox"]),
.admin-shell .admin-edit-table select {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #d8dee2;
    border-radius: 6px;
    color: #182024;
    background: #ffffff;
}

.admin-shell .admin-edit-table input:focus,
.admin-shell .admin-edit-table select:focus {
    border-color: #0e766e;
    outline: 3px solid rgba(14, 118, 110, .14);
}

.admin-shell .admin-edit-table input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    accent-color: #0e766e;
}

.admin-shell .admin-edit-table .button {
    width: 100%;
    min-width: 92px;
}

.admin-shell .table-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .84rem;
    font-weight: 850;
    white-space: nowrap;
}

.admin-shell .col-team-name {
    width: 18%;
}

.admin-shell .col-team-email {
    width: 22%;
}

.admin-shell .col-team-role {
    width: 16%;
}

.admin-shell .col-team-status {
    width: 12%;
}

.admin-shell .col-team-phone {
    width: 15%;
}

.admin-shell .col-team-reset {
    width: 9%;
}

.admin-shell .col-team-actions {
    width: 8%;
}

.admin-shell .col-task-title {
    width: 22%;
}

.admin-shell .col-task-case {
    width: 10%;
}

.admin-shell .col-task-status,
.admin-shell .col-task-priority {
    width: 11%;
}

.admin-shell .col-task-assigned {
    width: 13%;
}

.admin-shell .col-task-due {
    width: 14%;
}

.admin-shell .col-task-notes {
    width: 10%;
}

.admin-shell .col-task-actions {
    width: 9%;
}

.admin-shell .admin-tasks-table .button {
    min-width: 74px;
    padding-inline: 8px;
}

.admin-shell .responsive-table td .compact-form,
.admin-shell .template-list article .compact-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px;
    min-width: 0;
}

.admin-shell .responsive-table td .compact-form input,
.admin-shell .responsive-table td .compact-form select,
.admin-shell .template-list article .compact-form input,
.admin-shell .template-list article .compact-form select {
    flex: 1 1 145px;
    min-width: 145px;
}

.admin-shell .responsive-table td .compact-form button,
.admin-shell .template-list article .compact-form button {
    flex: 0 0 auto;
}

.admin-shell .template-list article {
    min-width: 0;
    overflow-wrap: anywhere;
}

.admin-shell .document-actions {
    flex-wrap: wrap;
    min-width: 0;
}

.admin-shell .document-actions .compact-form {
    flex: 1 1 240px;
}

.admin-shell .admin-clients-table table {
    table-layout: fixed;
}

.admin-shell .admin-clients-table th:nth-child(1) {
    width: 25%;
}

.admin-shell .admin-clients-table th:nth-child(2) {
    width: 9%;
}

.admin-shell .admin-clients-table th:nth-child(3),
.admin-shell .admin-clients-table th:nth-child(5) {
    width: 14%;
}

.admin-shell .admin-clients-table th:nth-child(4) {
    width: 13%;
}

.admin-shell .admin-clients-table th:nth-child(6) {
    width: 18%;
}

.admin-shell .admin-clients-table th:nth-child(7) {
    width: 7%;
}

.admin-shell .admin-client-contact a {
    color: #182024;
    text-decoration-color: rgba(14, 118, 110, .35);
    text-underline-offset: 3px;
}

.admin-shell .admin-client-contact strong,
.admin-shell .admin-client-contact small,
.admin-shell .admin-client-activity small {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}

.admin-shell .admin-client-contact small,
.admin-shell .admin-client-activity small {
    margin-top: 4px;
    color: #5d6a6d;
    font-size: .78rem;
    font-weight: 750;
}

.admin-shell .admin-client-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.admin-shell .admin-client-metric {
    display: grid;
    min-width: 58px;
    padding: 6px 8px;
    border: 1px solid #e7ecef;
    border-radius: 6px;
    background: #f8fafb;
}

.admin-shell .admin-client-metric strong {
    font-size: .95rem;
    line-height: 1;
}

.admin-shell .admin-client-metric small {
    margin-top: 3px;
    color: #5d6a6d;
    font-size: .68rem;
    font-weight: 850;
    text-transform: uppercase;
}

.admin-shell .admin-client-metric.is-live {
    border-color: rgba(14, 118, 110, .24);
    background: #eef7f4;
}

.admin-shell .admin-client-metric.is-alert {
    border-color: rgba(176, 82, 56, .25);
    background: #fff6e1;
}

.admin-shell .admin-client-actions .button {
    width: 100%;
    min-width: 64px;
}

.admin-shell .settings-grid {
    gap: 20px;
}

.admin-shell .side-panel.danger-zone {
    margin-top: 0;
}

.admin-shell .manual-steps {
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
}

.admin-shell .manual-steps > li {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 14px;
    padding: 16px 0;
    border-top: 1px solid #e7ecef;
}

.admin-shell .manual-steps > li:first-child {
    padding-top: 0;
    border-top: 0;
}

.admin-shell .manual-step-number {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 8px;
    color: #ffffff;
    background: #182024;
    font-size: .86rem;
    font-weight: 900;
}

.admin-shell .manual-steps h3 {
    margin: 0 0 6px;
    font-size: 1rem;
}

.admin-shell .manual-steps p {
    margin: 0;
}

.admin-shell .manual-steps ul,
.admin-shell .manual-checklist {
    display: grid;
    gap: 6px;
    margin: 10px 0 0;
    padding-left: 18px;
    color: #5d6a6d;
}

.admin-shell .manual-checklist {
    margin: 0;
}

.admin-shell .manual-links {
    display: grid;
    gap: 8px;
}

.admin-shell .manual-links a {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #d8dee2;
    border-radius: 6px;
    color: #182024;
    background: #f8fafb;
    font-weight: 800;
    text-decoration: none;
}

.admin-shell .manual-links a:hover,
.admin-shell .manual-links a:focus-visible {
    border-color: rgba(14, 118, 110, .35);
    background: #eef7f4;
    outline: none;
}

.admin-shell .file-list article {
    flex-wrap: wrap;
    align-items: flex-start;
}

.admin-shell .file-list article > div:first-child {
    flex: 1 1 240px;
    min-width: 220px;
}

.admin-shell .file-list .document-actions {
    flex: 2 1 320px;
}

.admin-shell .communication-list article {
    overflow-wrap: anywhere;
}

.admin-shell .communication-list .action-row {
    align-items: center;
}

@media (max-width: 1120px) {
    .admin-workspace {
        margin-left: 0;
    }

    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform .18s ease;
    }

    .admin-menu-open .admin-sidebar {
        transform: translateX(0);
    }

    .admin-sidebar-backdrop {
        position: fixed;
        z-index: 45;
        inset: 0 0 0 var(--admin-sidebar-width);
        display: none;
        border: 0;
        background: rgba(24, 32, 36, .38);
    }

    .admin-menu-open .admin-sidebar-backdrop {
        display: block;
    }

    .admin-menu-toggle {
        display: block;
    }

    .admin-topbar {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }
}

@media (max-width: 1320px) {
    .admin-shell .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-shell .side-panel {
        grid-row: auto;
    }
}

@media (max-width: 760px) {
    .admin-topbar {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 10px;
        padding: 10px 14px;
    }

    .admin-global-search {
        grid-column: 1 / -1;
        order: 3;
    }

    .admin-user-chip {
        min-width: 0;
    }

    .admin-user-chip strong,
    .admin-user-chip small {
        max-width: 150px;
    }

    .admin-content {
        padding: 16px 14px 28px;
    }

    .admin-shell .dashboard-hero {
        align-items: flex-start;
    }

    .admin-shell .dashboard-hero .action-row {
        width: 100%;
    }

    .admin-shell .button {
        width: auto;
        white-space: nowrap;
    }

    .admin-shell .main-panel,
    .admin-shell .side-panel {
        padding: 14px;
    }

    .admin-case-command {
        grid-template-columns: 1fr;
    }
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        linear-gradient(180deg, #fbfaf6 0%, var(--paper) 48%, #f1f6f4 100%);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    line-height: 1.5;
}

body.nav-open {
    overflow: hidden;
}

a {
    color: inherit;
}

button,
input,
select {
    font: inherit;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    padding: 14px clamp(18px, 5vw, 64px);
    color: var(--white);
    border-bottom: 1px solid transparent;
    transition: background .2s ease, color .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.site-header.is-scrolled,
.app-shell .site-header,
.page-legal .site-header,
.page-login .site-header,
.page-viabilidad .site-header {
    color: var(--ink);
    border-color: rgba(214, 223, 220, .75);
    background: rgba(255, 253, 249, .92);
    box-shadow: 0 10px 28px rgba(23, 33, 38, .07);
    backdrop-filter: blur(14px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0;
    text-decoration: none;
}

.brand-mark {
    display: block;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border: 2px solid rgba(255, 255, 255, .4);
    border-radius: 8px;
    box-shadow: 0 10px 22px rgba(8, 77, 73, .18);
}

.site-header.is-scrolled .brand-mark,
.app-shell .brand-mark,
.page-legal .brand-mark,
.page-login .brand-mark,
.page-viabilidad .brand-mark {
    border-color: rgba(14, 118, 110, .25);
}

.brand-word {
    line-height: 1;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-nav a {
    padding: 10px 12px;
    border-radius: 8px;
    color: inherit;
    font-size: .94rem;
    font-weight: 650;
    text-decoration: none;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
    background: rgba(255, 255, 255, .16);
    outline: none;
}

.site-header.is-scrolled .site-nav a:hover,
.site-header.is-scrolled .site-nav a:focus-visible,
.app-shell .site-nav a:hover,
.app-shell .site-nav a:focus-visible,
.page-legal .site-nav a:hover,
.page-legal .site-nav a:focus-visible,
.page-login .site-nav a:hover,
.page-login .site-nav a:focus-visible,
.page-viabilidad .site-nav a:hover,
.page-viabilidad .site-nav a:focus-visible {
    background: var(--mist);
}

.site-nav .nav-cta {
    color: var(--white);
    background: linear-gradient(135deg, var(--teal), #0a5f61);
    box-shadow: 0 10px 22px rgba(8, 77, 73, .18);
}

.site-nav .nav-cta:hover,
.site-nav .nav-cta:focus-visible {
    background: linear-gradient(135deg, #0a675f, var(--teal-dark));
    transform: translateY(-1px);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: 9px;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 8px;
    color: inherit;
    background: transparent;
}

.nav-toggle span {
    display: block;
    height: 2px;
    margin: 5px 0;
    background: currentColor;
}

.site-header.is-scrolled .nav-toggle,
.app-shell .nav-toggle,
.page-legal .nav-toggle,
.page-login .nav-toggle,
.page-viabilidad .nav-toggle {
    border-color: rgba(24, 32, 36, .18);
}

.hero {
    position: relative;
    min-height: 92vh;
    display: grid;
    align-items: end;
    overflow: hidden;
    color: var(--white);
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(12, 20, 22, .82), rgba(12, 20, 22, .43) 52%, rgba(12, 20, 22, .18)),
        url("../img/hero-legal-workflow.png") center / cover;
    transform: scale(1.02);
}

.hero-inner {
    position: relative;
    z-index: 1;
    width: min(980px, calc(100% - 36px));
    margin: 0 auto;
    padding: 132px 0 72px;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--clay);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.hero .eyebrow {
    color: #f1c76c;
}

h1,
h2,
h3,
p {
    letter-spacing: 0;
}

h1,
h2,
h3 {
    line-height: 1.06;
}

h1 {
    max-width: 780px;
    margin: 0;
    font-size: clamp(3rem, 8vw, 6.6rem);
}

h2 {
    margin: 0;
    font-size: clamp(2rem, 4.5vw, 4rem);
}

h3 {
    margin: 0 0 10px;
    font-size: 1.18rem;
}

.hero-copy {
    max-width: 660px;
    margin: 22px 0 0;
    color: rgba(255, 255, 255, .9);
    font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.hero-actions,
.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 18px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}

.button-primary {
    color: var(--white);
    background: linear-gradient(135deg, var(--teal), #0a5f61);
    box-shadow: 0 12px 24px rgba(8, 77, 73, .18);
}

.button-primary:hover,
.button-primary:focus-visible {
    background: linear-gradient(135deg, #0a675f, var(--teal-dark));
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(8, 77, 73, .22);
}

.button-secondary {
    color: var(--white);
    border-color: rgba(255, 255, 255, .42);
    background: rgba(255, 255, 255, .08);
}

.button-ghost {
    color: var(--ink);
    border-color: var(--line);
    background: rgba(255, 255, 255, .82);
}

.button-ghost:hover,
.button-ghost:focus-visible {
    border-color: rgba(14, 118, 110, .32);
    background: var(--surface-soft);
    transform: translateY(-1px);
}

.hero-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 44px;
}

.hero-facts span {
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 8px;
    background: rgba(255, 255, 255, .08);
    backdrop-filter: blur(8px);
}

.intro-band,
.tool-section,
.process-band,
.workspace-preview,
.pricing-band,
.final-cta,
.form-hero,
.checker-layout,
.dashboard,
.legal-page {
    width: min(1160px, calc(100% - 36px));
    margin: 0 auto;
}

.intro-band,
.tool-section,
.process-band,
.workspace-preview,
.pricing-band,
.final-cta {
    padding: 76px 0;
}

.section-grid {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(280px, 1fr);
    gap: clamp(28px, 6vw, 84px);
    align-items: start;
}

.section-grid > p,
.workspace-copy p,
.price-panel p,
.form-hero p,
.legal-copy p {
    color: var(--muted);
    font-size: 1.05rem;
}

.section-heading {
    max-width: 760px;
    margin-bottom: 32px;
}

.case-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.case-card,
.price-panel,
.main-panel,
.side-panel,
.metric-grid article {
    border: 1px solid rgba(214, 223, 220, .95);
    border-radius: var(--radius);
    background: rgba(255, 253, 249, .94);
    box-shadow: var(--shadow-card);
}

.case-card {
    min-height: 240px;
    padding: 22px;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.case-card:hover {
    transform: translateY(-2px);
    border-color: rgba(14, 118, 110, .28);
    box-shadow: 0 18px 38px rgba(23, 33, 38, .10);
}

.case-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin-bottom: 26px;
    border-radius: 8px;
    color: var(--white);
    background: var(--ink);
    font-weight: 900;
    font-size: .8rem;
}

.case-card:nth-child(2) .case-icon {
    background: var(--teal);
}

.case-card:nth-child(3) .case-icon {
    background: var(--clay);
}

.case-card:nth-child(4) .case-icon {
    background: var(--gold);
}

.case-card p,
.timeline p,
.main-panel p,
.side-panel small,
.document-list small,
.template-list small,
.metric-grid small {
    color: var(--muted);
}

.process-band {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.timeline {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.timeline article {
    position: relative;
    padding-top: 56px;
}

.timeline span {
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 50%;
    color: var(--white);
    background: var(--teal);
    font-weight: 900;
}

.timeline article::after {
    content: "";
    position: absolute;
    top: 20px;
    left: 48px;
    right: -12px;
    height: 1px;
    background: var(--line);
}

.timeline article:last-child::after {
    display: none;
}

.workspace-preview {
    display: grid;
    grid-template-columns: minmax(280px, .85fr) minmax(320px, 1.15fr);
    gap: clamp(28px, 6vw, 76px);
    align-items: center;
}

.text-link {
    display: inline-flex;
    margin-top: 12px;
    color: var(--teal-dark);
    font-weight: 800;
}

.product-shot {
    overflow: hidden;
    min-height: 360px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #eef3f0;
    box-shadow: var(--shadow);
}

.shot-topbar {
    display: flex;
    gap: 8px;
    padding: 16px;
    border-bottom: 1px solid var(--line);
    background: var(--white);
}

.shot-topbar span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--clay);
}

.shot-topbar span:nth-child(2) {
    background: var(--gold);
}

.shot-topbar span:nth-child(3) {
    background: var(--teal);
}

.shot-body {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 18px;
    padding: 20px;
}

.shot-body aside {
    min-height: 260px;
    padding: 18px;
    color: var(--white);
    border-radius: 8px;
    background: var(--ink);
}

.shot-body aside small,
.shot-body aside b {
    display: block;
    margin-top: 12px;
}

.shot-body aside b {
    font-size: 2.8rem;
}

.shot-row,
.mini-grid span {
    border-radius: 8px;
    background: var(--white);
    box-shadow: 0 8px 20px rgba(24, 32, 36, .05);
}

.shot-row {
    height: 58px;
    margin-bottom: 14px;
}

.shot-row.wide {
    height: 92px;
}

.shot-row.short {
    width: 64%;
}

.mini-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.mini-grid span {
    min-height: 86px;
}

.price-panel {
    padding: 28px;
}

.price-panel strong {
    display: block;
    color: var(--teal-dark);
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1;
}

.final-cta {
    text-align: center;
}

.final-cta h2 {
    max-width: 760px;
    margin: 0 auto 24px;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 28px;
    padding: 34px clamp(18px, 5vw, 64px);
    color: var(--white);
    background: var(--ink);
}

.site-footer p {
    max-width: 420px;
    margin: 12px 0 0;
    color: rgba(255, 255, 255, .68);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    align-content: start;
    justify-content: flex-end;
}

.footer-links a {
    color: rgba(255, 255, 255, .78);
    text-decoration: none;
}

.form-page,
.legal-page {
    padding-top: 120px;
}

.form-hero,
.legal-hero {
    position: relative;
    padding: 40px 0 24px;
}

.form-hero::after {
    content: "";
    display: block;
    width: 76px;
    height: 4px;
    margin-top: 24px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--teal), var(--gold));
}

.form-hero h1,
.legal-hero h1 {
    max-width: 760px;
    font-size: clamp(2.25rem, 4.8vw, 4.25rem);
}

.form-hero p {
    max-width: 760px;
    font-size: 1.02rem;
}

.checker-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    padding: 18px 0 78px;
}

.checker-layout.has-result {
    grid-template-columns: minmax(0, 760px);
    justify-content: center;
}

.login-layout {
    display: grid;
    grid-template-columns: minmax(280px, 480px) 360px;
    gap: 24px;
    width: min(980px, calc(100% - 36px));
    margin: 0 auto;
    padding: 18px 0 78px;
}

.checker,
.result-panel {
    border: 1px solid rgba(214, 223, 220, .95);
    border-radius: 8px;
    background: rgba(255, 253, 249, .96);
    box-shadow: var(--shadow-soft);
}

.form-alert {
    padding: 12px 14px;
    border: 1px solid rgba(163, 79, 56, .28);
    border-radius: 8px;
    color: #7b2f1f;
    background: #fff0ec;
    font-weight: 750;
}

.form-alert.success {
    border-color: rgba(48, 112, 88, .28);
    color: #235b45;
    background: #effaf4;
}

.checker {
    display: grid;
    gap: 22px;
    padding: 26px;
}

.account-summary {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(14, 118, 110, .18);
    border-radius: 8px;
    background: #eef7f4;
}

.account-summary .status-dot {
    flex: 0 0 auto;
    margin-top: 4px;
}

.account-summary strong,
.account-summary small {
    display: block;
}

.account-summary small {
    margin-top: 4px;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.field-group {
    display: grid;
    gap: 9px;
    margin: 0;
    padding: 0;
    border: 0;
}

.split-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.split-fields > div {
    display: grid;
    gap: 9px;
}

.field-group label,
.field-group legend {
    color: var(--ink);
    font-weight: 800;
}

.field-group input,
.field-group select {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(23, 33, 38, .03);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.field-group input:focus,
.field-group select:focus,
.inline-form textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 4px rgba(14, 118, 110, .12);
    outline: none;
}

.money-input {
    position: relative;
}

.money-input input {
    padding-right: 72px;
}

.money-input span {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    color: var(--muted);
    font-weight: 800;
}

.check-row {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    column-gap: 10px;
    color: var(--muted);
    line-height: 1.35;
}

.check-row input[type="checkbox"],
.field-group .check-row input[type="checkbox"] {
    width: 18px !important;
    min-width: 18px !important;
    max-width: 18px;
    height: 18px !important;
    min-height: 18px !important;
    max-height: 18px;
    margin: 0;
    padding: 0 !important;
    border-radius: 3px;
    justify-self: start;
    accent-color: var(--teal);
}

.check-row.is-done {
    color: var(--ink);
    font-weight: 800;
}

.check-row input[disabled] {
    opacity: 1;
}

.checklist-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.result-panel {
    position: sticky;
    top: 96px;
    align-self: start;
    padding: 24px;
}

.checker-layout.has-result .result-panel {
    position: static;
    width: 100%;
    padding: clamp(28px, 5vw, 44px);
    text-align: center;
}

.result-panel:focus {
    outline: none;
}

.result-panel.is-final {
    border-color: rgba(14, 118, 110, .28);
    background:
        linear-gradient(180deg, rgba(255, 253, 249, .98), rgba(241, 246, 244, .98));
    box-shadow: 0 22px 52px rgba(23, 33, 38, .12);
}

.result-kicker {
    margin: 0 0 10px;
    color: var(--teal-dark);
    font-size: .76rem;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.status-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gold);
}

.result-panel.is-good .status-dot {
    background: var(--teal);
}

.result-panel.is-warning .status-dot {
    background: var(--gold);
}

.result-panel.is-bad .status-dot {
    background: var(--clay);
}

.result-panel h2 {
    margin: 12px 0;
    font-size: 1.55rem;
}

.result-panel.is-final h2 {
    max-width: 640px;
    margin-inline: auto;
    font-size: clamp(1.8rem, 4vw, 2.7rem);
}

.result-panel ul {
    padding-left: 20px;
    color: var(--muted);
}

.checker-layout.has-result .result-panel ul {
    display: grid;
    gap: 8px;
    max-width: 560px;
    margin: 20px auto 0;
    padding-left: 0;
    list-style-position: inside;
    text-align: left;
}

.checker-layout.has-result .result-panel .action-row {
    justify-content: center;
}

.dashboard {
    padding-top: 116px;
    padding-bottom: 80px;
}

.flash-message {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 8px;
    font-weight: 800;
}

.flash-message.success {
    color: var(--teal-dark);
    background: var(--mist);
}

.flash-message.error {
    color: #7b2f1f;
    background: #fff0ec;
}

.dashboard-hero {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: end;
    margin-bottom: 22px;
}

.dashboard-hero h1 {
    font-size: clamp(2.3rem, 5vw, 4.6rem);
}

.dashboard-hero p {
    max-width: 720px;
    color: var(--muted);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 18px;
}

.account-grid {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
    align-items: start;
}

.account-grid .side-panel {
    grid-row: auto;
}

.side-panel,
.main-panel {
    min-width: 0;
    padding: 22px;
}

.side-panel {
    grid-row: span 3;
}

.side-panel h2,
.main-panel h2 {
    font-size: 1.5rem;
}

.client-flow-panel {
    margin-bottom: 22px;
}

.client-next-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 420px) auto;
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
    border-color: rgba(14, 118, 110, .22);
    background:
        linear-gradient(135deg, rgba(255, 253, 249, .98), rgba(241, 246, 244, .98));
}

.client-next-panel h2,
.client-next-panel p,
.client-missing-box p {
    margin: 0;
}

.client-next-panel h2 {
    font-size: clamp(1.65rem, 3vw, 2.35rem);
}

.client-missing-box {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid rgba(201, 151, 47, .28);
    border-radius: 8px;
    background: #fff8e8;
}

.client-missing-box strong {
    display: block;
}

.client-missing-box ul {
    display: grid;
    gap: 6px;
    margin: 0;
    padding-left: 18px;
}

.client-missing-box a {
    color: var(--teal-dark);
    font-weight: 850;
    text-decoration: none;
}

.client-tabs {
    position: sticky;
    top: 72px;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 253, 249, .94);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(12px);
    scrollbar-width: none;
}

.client-tabs::-webkit-scrollbar {
    display: none;
}

.client-tabs button {
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-weight: 850;
}

.client-tabs button:hover,
.client-tabs button:focus-visible {
    color: var(--ink);
    border-color: rgba(14, 118, 110, .22);
    background: var(--surface-soft);
    outline: none;
}

.client-tabs button.is-active {
    color: var(--white);
    border-color: transparent;
    background: linear-gradient(135deg, var(--teal), #0a5f61);
    box-shadow: 0 10px 22px rgba(8, 77, 73, .18);
}

.client-tab-panels {
    display: grid;
    gap: 18px;
}

.client-tab-panel {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.client-tab-panel[hidden] {
    display: none;
}

.client-summary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 18px;
    align-items: start;
}

.client-summary-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.client-checklist-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.workflow-steps {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.workflow-steps li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbfa;
}

.workflow-steps li > span {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #dfe9e7;
    color: var(--ink);
    font-weight: 850;
    font-size: .85rem;
}

.workflow-steps strong,
.workflow-steps small,
.workflow-steps a {
    display: block;
}

.workflow-steps small {
    margin-top: 3px;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 750;
}

.workflow-steps a {
    grid-column: 2;
    color: var(--teal);
    font-size: .82rem;
    font-weight: 850;
}

.workflow-steps .is-done {
    border-color: rgba(14, 118, 110, .26);
    background: #eef7f4;
}

.workflow-steps .is-done > span {
    background: var(--teal);
    color: #fff;
}

.workflow-steps .is-active {
    border-color: rgba(191, 141, 49, .36);
    background: #fff8e8;
}

.workflow-steps .is-active > span {
    background: var(--gold);
    color: var(--ink);
}

.workflow-steps .is-locked {
    color: var(--muted);
}

.workflow-steps .is-locked a {
    color: var(--muted);
}

.status-list {
    display: grid;
    gap: 10px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.status-list li {
    padding: 12px;
    border-left: 4px solid var(--line);
    border-radius: 8px;
    background: #fffdf9;
    color: var(--muted);
}

.status-list .done {
    border-color: var(--teal);
    color: var(--ink);
}

.status-list .active {
    border-color: var(--gold);
    color: var(--ink);
    background: #fff7dd;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: start;
    margin-bottom: 14px;
}

.completion-meter {
    height: 8px;
    margin: 18px 0 8px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--mist);
}

.completion-meter span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--teal);
}

.completion-label {
    color: var(--muted);
    font-weight: 800;
}

.case-details-panel {
    margin-bottom: 18px;
}

.details-form {
    display: grid;
    gap: 18px;
}

.form-section {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf9;
}

.form-section h3 {
    margin: 0;
}

.form-helper {
    margin: 0;
    color: var(--muted);
    font-size: .92rem;
    font-weight: 650;
}

.field-group textarea {
    width: 100%;
    min-height: 92px;
    resize: vertical;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: var(--white);
    font: inherit;
}

.field-group textarea:focus {
    border-color: var(--teal);
    outline: 3px solid rgba(14, 118, 110, .15);
}

.pill,
.tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    color: var(--white);
    background: var(--teal);
    font-size: .78rem;
    font-weight: 900;
}

.pill.muted {
    color: var(--ink);
    background: var(--mist);
}

.document-list,
.template-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
}

.document-list article {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 12px;
    align-items: center;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.document-list span {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 8px;
    color: var(--white);
    background: var(--ink);
    font-size: .75rem;
    font-weight: 900;
}

.document-list strong,
.document-list small,
.template-list strong,
.template-list small {
    display: block;
}

.document-list button {
    min-width: 64px;
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    cursor: pointer;
}

.document-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.document-actions .button {
    min-height: 34px;
    padding: 7px 12px;
    font-size: .86rem;
}

.document-actions a:not(.button) {
    color: var(--teal);
    font-size: .9rem;
    font-weight: 850;
    text-decoration: none;
}

.document-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: start;
}

.document-hero .action-row {
    margin-top: 0;
}

.document-paper {
    padding: clamp(22px, 4vw, 44px);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.document-paper-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.document-paper-header span {
    display: grid;
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 8px;
    color: var(--white);
    background: var(--ink);
    font-size: .78rem;
    font-weight: 900;
}

.document-paper-header h2 {
    margin: 2px 0 0;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.document-note {
    margin: 22px 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    color: var(--muted);
}

.document-section {
    padding-top: 22px;
}

.document-section h3 {
    margin-bottom: 12px;
}

.document-section p,
.document-section li {
    color: var(--muted);
}

.document-section ul,
.document-section ol {
    margin: 0;
    padding-left: 22px;
}

.document-side dl {
    display: grid;
    gap: 12px;
    margin: 0 0 24px;
}

.document-side dt {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.document-side dd {
    margin: 2px 0 0;
    font-weight: 800;
}

.mini-list {
    display: grid;
    gap: 10px;
}

.mini-list a {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font-weight: 750;
    text-decoration: none;
    background: #fffdf9;
}

.note-form {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.event-list {
    display: grid;
    gap: 12px;
}

.event-list article {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf9;
}

.event-list article.is-internal {
    border-color: rgba(163, 79, 56, .28);
    background: #fff6f1;
}

.event-list span {
    align-self: start;
    padding: 6px 8px;
    border-radius: 8px;
    color: var(--white);
    background: var(--ink);
    font-size: .72rem;
    font-weight: 900;
    text-align: center;
}

.event-list strong,
.event-list small {
    display: block;
}

.event-list p {
    margin: 5px 0;
}

.checklist-panel {
    display: grid;
    gap: 10px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.admin-metric-grid {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}

.metric-card {
    color: inherit;
    text-decoration: none;
}

.metric-card article {
    height: 100%;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.metric-card:hover article,
.metric-card:focus-visible article {
    border-color: rgba(20, 131, 116, .45);
    box-shadow: 0 14px 32px rgba(24, 32, 36, .1);
    transform: translateY(-1px);
}

.metric-card em {
    display: inline-flex;
    margin-top: 10px;
    color: var(--teal);
    font-size: .78rem;
    font-style: normal;
    font-weight: 850;
}

.metric-grid article {
    padding: 20px;
}

.metric-grid span,
.metric-grid small,
.metric-grid strong {
    display: block;
}

.metric-grid strong {
    margin: 8px 0;
    font-size: 2.4rem;
    line-height: 1;
}

.admin-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 18px;
}

.responsive-table {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.filter-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    align-items: end;
    margin: 0 0 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf9;
}

.filter-bar .button {
    min-width: 0;
}

.compact-filter-bar {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.filter-bar label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.filter-bar input,
.filter-bar select {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: var(--white);
    font-size: .95rem;
    font-weight: 600;
    text-transform: none;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1080px;
}

th,
td {
    padding: 14px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

th {
    color: var(--muted);
    font-size: .8rem;
    text-transform: uppercase;
}

.tag.ok {
    background: var(--teal);
}

.tag.warn {
    color: var(--ink);
    background: #f0d37b;
}

.tag.danger {
    background: var(--clay);
}

.tag.muted {
    color: var(--ink);
    background: var(--mist);
}

.table-note {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 800;
}

.service-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
}

.service-panel form {
    margin-top: 4px;
}

.service-form {
    display: grid;
    align-content: start;
    gap: 12px;
}

.service-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin: 0;
}

.service-facts div {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf9;
}

.service-facts dt {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.service-facts dd {
    margin: 3px 0 0;
    font-weight: 850;
}

.template-list article {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf9;
}

.template-list article a {
    display: inline-block;
    margin-top: 8px;
    color: var(--teal-dark);
    font-weight: 850;
    text-decoration: none;
}

.placeholder-list {
    display: grid;
    gap: 12px;
}

.placeholder-list article {
    display: grid;
    gap: 8px;
}

.placeholder-list code {
    display: block;
    padding: 7px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: #f8fbfa;
    white-space: normal;
    overflow-wrap: anywhere;
}

.upload-form,
.inline-form {
    display: grid;
    gap: 14px;
    margin: 16px 0;
}

.inline-form {
    grid-template-columns: minmax(170px, .8fr) minmax(150px, .7fr) minmax(320px, 1.5fr) auto;
    align-items: end;
}

.case-status-form {
    grid-template-columns: minmax(280px, 1fr) minmax(170px, 180px);
}

.case-status-form label:nth-of-type(3) {
    grid-column: 1 / 2;
}

.case-status-form .button {
    grid-column: 2 / 3;
}

.inline-form label,
.compact-form {
    display: grid;
    gap: 8px;
    font-weight: 800;
}

.inline-form input,
.inline-form select,
.inline-form textarea,
.compact-form input,
.compact-form select {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf9;
}

.inline-form textarea {
    min-height: 64px;
    resize: vertical;
    font: inherit;
}

.compact-form {
    grid-template-columns: 1fr auto;
    margin-top: 12px;
}

.compact-form button {
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    cursor: pointer;
    font-weight: 800;
}

.compact-form input[type="file"] {
    min-height: auto;
    padding: 8px;
    font-size: .84rem;
    font-weight: 650;
}

.file-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.file-list article {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf9;
}

.file-list strong,
.file-list small {
    display: block;
}

.file-list small,
.empty-state {
    color: var(--muted);
}

.admin-detail-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
    margin-top: 18px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.settings-grid .main-panel {
    display: grid;
    gap: 14px;
}

.table-pagination {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-top: 14px;
    color: var(--muted);
    font-weight: 800;
}

.table-pagination div {
    display: flex;
    gap: 8px;
}

.table-pagination .button {
    min-height: 36px;
    padding: 7px 12px;
    font-size: .86rem;
}

.table-pagination .button[disabled] {
    cursor: not-allowed;
    opacity: .55;
}

.payment-box {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #f8fbfa;
    margin: 14px 0;
}

.danger-zone {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.danger-zone .button-primary {
    color: #fff;
    background: #9f3a38;
}

.payment-box p {
    margin: 8px 0;
}

.receipt-box {
    display: grid;
    gap: 10px;
}

.communication-list {
    display: grid;
    gap: 10px;
}

.communication-list article {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf9;
}

.communication-list article.is-unread {
    border-color: var(--teal);
    background: #f3fbf8;
}

.communication-list strong,
.communication-list small {
    display: block;
}

.communication-list small {
    color: var(--muted);
}

.communication-list p {
    margin: 8px 0 0;
}

.quick-reply {
    margin-top: 10px;
}

.quick-reply summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    background: var(--white);
    cursor: pointer;
    font-size: .86rem;
    font-weight: 850;
    list-style: none;
}

.quick-reply summary::-webkit-details-marker {
    display: none;
}

.quick-reply summary:hover,
.quick-reply summary:focus-visible {
    border-color: rgba(14, 118, 110, .35);
    background: #eef7f4;
    outline: none;
}

.quick-reply-form {
    display: grid;
    gap: 10px;
    margin-top: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f8fafb;
}

.quick-reply-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.quick-reply-actions .legal-check {
    flex: 1 1 260px;
}

.quick-reply-actions .button {
    flex: 0 0 auto;
}

.payment-notice-form {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.payment-notice-form label {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.legal-copy {
    max-width: 840px;
    padding: 0 0 90px;
}

.legal-hero p {
    max-width: 780px;
    color: var(--muted);
}

.legal-section {
    padding: 24px 0;
    border-top: 1px solid var(--line);
}

.legal-section h2 {
    margin-bottom: 12px;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.legal-section ul {
    display: grid;
    gap: 8px;
    margin: 10px 0 0;
    padding-left: 20px;
    color: var(--muted);
}

.legal-check {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf9;
}

.legal-check a {
    color: var(--teal-dark);
    font-weight: 850;
}

.contract-checks {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.cookie-banner {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 40;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    width: min(760px, calc(100% - 36px));
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.cookie-banner[hidden] {
    display: none;
}

.cookie-banner p {
    margin: 4px 0 0;
    color: var(--muted);
}

.cookie-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.cookie-actions .button {
    min-height: 38px;
    padding: 8px 12px;
    font-size: .88rem;
}

.cookie-actions a {
    color: var(--teal-dark);
    font-size: .9rem;
    font-weight: 850;
    text-decoration: none;
}

.preflight-list {
    display: grid;
    gap: 10px;
}

.preflight-list article {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf9;
}

.preflight-list strong,
.preflight-list small {
    display: block;
}

.preflight-list small {
    margin-top: 4px;
    color: var(--muted);
}

@media (max-width: 980px) {
    .case-grid,
    .timeline,
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .section-grid,
    .workspace-preview,
    .checker-layout,
    .login-layout,
    .dashboard-grid,
    .client-next-panel,
    .client-summary-grid,
    .client-summary-grid.compact,
    .workflow-steps,
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .side-panel {
        grid-row: auto;
    }

    .result-panel {
        position: static;
    }

    .timeline article::after {
        display: none;
    }

    .inline-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .case-status-form {
        grid-template-columns: minmax(280px, 1fr) minmax(170px, 180px);
    }

    .case-status-form label:nth-of-type(3),
    .case-status-form .button {
        grid-column: auto;
    }
}

@media (max-width: 760px) {
    .site-header {
        min-height: 64px;
        padding: 12px 18px;
    }

    .nav-toggle {
        display: block;
    }

    .site-nav {
        position: fixed;
        inset: 64px 0 auto 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 16px 18px 22px;
        color: var(--ink);
        background: var(--paper);
        box-shadow: 0 16px 30px rgba(24, 32, 36, .12);
    }

    .site-nav.is-open {
        display: flex;
    }

    .client-tabs {
        top: 64px;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .client-tabs button {
        flex: 0 0 auto;
    }

    .client-checklist-grid {
        grid-template-columns: 1fr;
    }

    .site-nav a {
        min-height: 44px;
    }

    .hero {
        min-height: 88vh;
    }

    .hero-bg {
        background:
            linear-gradient(180deg, rgba(12, 20, 22, .76), rgba(12, 20, 22, .52)),
            url("../img/hero-legal-workflow.png") 56% center / cover;
    }

    .hero-inner {
        width: min(100% - 30px, 620px);
        padding: 112px 0 46px;
    }

    h1 {
        font-size: clamp(2.2rem, 10vw, 3rem);
    }

    .hero h1 {
        font-size: clamp(2.4rem, 12vw, 3rem);
    }

    h2 {
        font-size: clamp(1.8rem, 9vw, 2.7rem);
    }

    .case-grid,
    .timeline,
    .metric-grid,
    .admin-metric-grid,
    .document-layout {
        grid-template-columns: 1fr;
    }

    .shot-body {
        grid-template-columns: 1fr;
    }

    .shot-body aside {
        min-height: 170px;
    }

    .site-footer,
    .dashboard-hero,
    .panel-heading,
    .file-list article,
    .cookie-banner,
    .table-pagination,
    .inline-form,
    .compact-form {
        flex-direction: column;
        align-items: flex-start;
    }

    .inline-form,
    .compact-form,
    .filter-bar,
    .checklist-grid,
    .admin-detail-grid,
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .admin-shell .dashboard-grid,
    .admin-shell .admin-detail-grid,
    .admin-shell .split-fields,
    .admin-shell .inline-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .footer-links {
        justify-content: flex-start;
    }

    .button {
        width: 100%;
        white-space: normal;
        text-align: center;
    }

    .admin-dashboard > .dashboard-hero .action-row {
        width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 8px;
        scrollbar-width: thin;
    }

    .admin-dashboard > .dashboard-hero .action-row .button {
        width: auto;
        flex: 0 0 auto;
        min-height: 42px;
        padding: 10px 14px;
        white-space: nowrap;
    }

    .document-list article {
        grid-template-columns: 44px 1fr;
    }

    .document-list button,
    .document-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .event-list article {
        grid-template-columns: 1fr;
    }

    .split-fields {
        grid-template-columns: 1fr;
    }

    .cookie-banner,
    .preflight-list article {
        grid-template-columns: 1fr;
    }

    .cookie-banner {
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto;
        gap: 8px;
        padding: 10px 12px;
    }

    .cookie-banner strong {
        font-size: .92rem;
    }

    .cookie-banner p {
        display: none;
    }

    .cookie-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
        gap: 8px;
        justify-content: stretch;
    }

    .cookie-actions .button {
        width: 100%;
        min-height: 34px;
        padding: 7px 10px;
        font-size: .82rem;
    }

    .cookie-actions a {
        grid-column: 1 / -1;
        font-size: .82rem;
    }
}
