:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-soft: #f0f2f5;
    --text: #252932;
    --muted: #6f7682;
    --line: #dfe3e8;
    --primary: #20242c;
    --primary-soft: #e9eaed;
    --accent: #d99000;
    --success: #14735a;
    --danger: #b43a42;
    --shadow: 0 12px 36px rgba(25, 29, 36, .08);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: inherit; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(1.65rem, 4vw, 2.25rem); line-height: 1.15; }
h2 { margin-bottom: 6px; font-size: 1.05rem; }
small { display: block; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 22px 14px 16px; background: var(--surface); border-right: 1px solid var(--line); z-index: 20; overflow: hidden; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; text-decoration: none; }
.brand > span:last-child { display: grid; gap: 1px; }
.brand small { color: var(--muted); font-size: .72rem; font-weight: 500; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; background: var(--primary); color: var(--accent); font-weight: 800; letter-spacing: -.06em; }
.main-nav { min-height: 0; display: grid; gap: 4px; overflow-y: auto; padding-right: 3px; scrollbar-width: thin; }
.nav-link { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 9px 10px; border-radius: 9px; color: #535a65; text-decoration: none; font-size: .88rem; }
.nav-link > span { width: 19px; text-align: center; color: #747c87; }
.nav-link.active { color: var(--text); background: var(--primary-soft); font-weight: 700; }
.nav-link.disabled { cursor: default; opacity: .76; }
.sidebar-user { flex: 0 0 auto; margin-top: auto; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 13px 7px 0; border-top: 1px solid var(--line); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: .82rem; font-weight: 800; }
.user-copy { min-width: 0; color: var(--ink); text-decoration: none; }
.user-copy strong, .user-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy strong { display: block; font-size: .82rem; }
.user-copy small { color: var(--muted); font-size: .7rem; }
.icon-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); cursor: pointer; }
.app-main { min-width: 0; }
.mobile-header { display: none; }
.page-content { width: min(1180px, 100%); margin: 0 auto; padding: 34px 32px 54px; }
.page-header { margin-bottom: 24px; }
.page-header.split, .panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.eyebrow { margin-bottom: 5px; color: var(--accent); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.muted { color: var(--muted); }

.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.stats-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 0 rgba(20, 24, 30, .02); }
.stat-card { padding: 18px; }
.stat-card > span { color: var(--muted); font-size: .79rem; }
.stat-card > strong { display: block; margin: 5px 0 3px; font-size: 1.6rem; }
.stat-card > small { color: var(--muted); font-size: .76rem; }
.content-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
.stat-card.attention-stat { border-top: 3px solid #c98b16; }
.dashboard-commercial-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.commercial-attention-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; }
.commercial-attention-item > span:nth-child(2) { min-width: 0; display: grid; }
.commercial-attention-item small, .commercial-attention-item time { color: var(--muted); }
.commercial-attention-item.overdue { border-left: 3px solid #c43b3b; background: #fff8f6; }
.account-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(290px, .8fr); gap: 16px; align-items: start; }
.account-grid hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.status-note { display: block; margin-top: 4px; color: #8a6412; font-size: .65rem; }
.panel { padding: 20px; min-width: 0; }
.panel-heading { margin-bottom: 16px; }
.panel-heading .eyebrow { margin-bottom: 3px; }
.checklist, .compact-list { display: grid; }
.check-row, .person-row { display: flex; align-items: flex-start; gap: 11px; padding: 12px 0; border-top: 1px solid var(--line); }
.check-row:first-child, .person-row:first-child { border-top: 0; }
.check-row > span { width: 25px; height: 25px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--surface-soft); color: var(--muted); font-weight: 800; }
.check-row.done > span { background: #e2f3ec; color: var(--success); }
.check-row strong, .check-row small, .person-row strong, .person-row small { display: block; }
.check-row strong, .person-row strong { font-size: .88rem; }
.check-row small, .person-row small { margin-top: 3px; color: var(--muted); font-size: .74rem; }
.person-row > div { min-width: 0; flex: 1; }
.status { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; background: #f5e6e8; color: var(--danger); font-size: .68rem; font-weight: 800; white-space: nowrap; }
.status.active { background: #e2f3ec; color: var(--success); }

.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 9px 14px; border: 1px solid transparent; border-radius: 9px; text-decoration: none; font-weight: 750; cursor: pointer; }
.button.primary { background: var(--primary); color: white; }
.button.secondary { border-color: var(--line); background: var(--surface); color: var(--text); }
.button.block { width: 100%; }
.field { display: grid; gap: 6px; color: #474e59; font-size: .79rem; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; min-height: 43px; padding: 9px 11px; border: 1px solid #cfd4db; border-radius: 9px; background: var(--surface); color: var(--text); outline: none; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(32, 36, 44, .1); }
.field.compact { min-width: 180px; }
.check { display: flex; align-items: flex-start; gap: 8px; color: #545c67; font-size: .79rem; }
.check input { margin-top: 2px; }
.phone-list { display: grid; gap: 10px; }
.phone-row { display: grid; grid-template-columns: minmax(150px, .7fr) minmax(200px, 1fr) minmax(210px, auto) auto; gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.phone-row .check { align-self: center; }
.conditional-fields { margin: 4px 0; padding: 14px; border: 1px solid #ead7a9; border-radius: 11px; background: #fffaf0; }
fieldset.conditional-fields { min-width: 0; }
.conditional-fields legend { padding: 0 6px; color: #7c5600; font-size: .76rem; font-weight: 800; }
.conditional-fields > .check + .check { margin-top: 9px; }
.fields-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(250px, .6fr); gap: 14px; align-items: start; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; }
.password-help, .form-foot { color: var(--muted); font-size: .73rem; line-height: 1.55; }
.filters { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; padding-bottom: 16px; margin-bottom: 5px; border-bottom: 1px solid var(--line); }

.responsive-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
th { padding: 11px 9px; color: var(--muted); font-size: .7rem; text-align: left; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); }
td { padding: 12px 9px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
.table-person { display: flex; align-items: center; gap: 9px; min-width: 190px; }
.table-person strong, .table-person small { display: block; }
.table-person small { color: var(--muted); margin-top: 2px; }
.empty-state { padding: 20px; color: var(--muted); text-align: center; }
.search-field { flex: 1; min-width: 230px; }
.client-list, .cards-list { display: grid; }
.client-row, .entity-card { display: grid; grid-template-columns: auto minmax(180px, 1.25fr) minmax(160px, 1fr) minmax(130px, .7fr) auto; gap: 12px; align-items: center; min-width: 0; padding: 13px 6px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.client-row:first-child, .entity-card:first-child { border-top: 0; }
.client-row:hover { background: #fafbfc; }
.client-row strong, .client-row small, .entity-card strong, .entity-card small { display: block; }
.client-row strong, .entity-card strong { font-size: .84rem; }
.client-row small, .entity-card small { margin-top: 3px; color: var(--muted); font-size: .72rem; }
.client-main, .client-contact, .client-owner { min-width: 0; }
.client-main strong, .client-contact strong, .client-owner strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-title, .profile-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.profile-title > span:last-child { min-width: 0; }
.profile-avatar { width: 54px; height: 54px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 14px; background: var(--primary); color: var(--accent); font-weight: 800; }
.record-tabs { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 15px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.record-tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 700; }
.record-tab span { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--surface-soft); font-size: .66rem; }
.record-tab.active { background: var(--primary); color: white; }
.record-tab.active span { background: rgba(255,255,255,.16); }
.record-panel:not(.active) { display: none; }
.qualification { margin: 0 0 18px; padding: 13px 15px; border-left: 3px solid var(--accent); background: #faf8f3; color: #4a4e56; font-size: .84rem; line-height: 1.6; }
.info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.info-grid small { margin-bottom: 3px; color: var(--muted); font-size: .7rem; }
.info-grid strong { display: block; font-size: .82rem; }
.address-block { color: #535a65; font-size: .84rem; font-style: normal; line-height: 1.7; }
.compact-stats { margin-bottom: 0; }
.section-toolbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.disclosure { margin-bottom: 14px; }
.disclosure summary, .inline-disclosure summary { cursor: pointer; font-weight: 800; }
.disclosure[open] summary { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.inline-disclosure { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.inline-disclosure[open] summary { margin-bottom: 12px; }
.entity-card { grid-template-columns: auto minmax(0, 1fr) auto; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-bottom: 9px; }
.entity-actions { display: grid; justify-items: end; gap: 7px; }
.edit-disclosure { position: relative; }
.edit-disclosure > summary { list-style: none; color: var(--primary); font-size: .72rem; }
.edit-disclosure > form { width: min(760px, calc(100vw - 310px)); margin-top: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.guarantee-item { padding: 9px 0; border-top: 1px solid var(--line); }
.guarantee-item:first-child { border-top: 0; }
.file-symbol { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--surface-soft); color: var(--primary); font-weight: 800; }
.debt-card { margin-bottom: 10px; }
.debt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.debt-head strong, .debt-head small { display: block; }
.debt-head small { margin-top: 3px; color: var(--muted); font-size: .73rem; }
.debt-status { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: .69rem; font-weight: 800; white-space: nowrap; }
.debt-status.current { background: #e5effb; color: #1f62a3; }
.debt-status.overdue { background: #f8e3e6; color: #a52e38; }
.debt-status.soon_overdue { background: #fff0c8; color: #916100; }
.debt-info { margin-top: 15px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.guarantee-list { display: grid; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.guarantee-list strong, .guarantee-list small { display: block; }
.guarantee-list strong { font-size: .78rem; }
.guarantee-list small { margin-top: 2px; color: var(--muted); font-size: .7rem; }
.upload-bar { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.upload-bar .field { min-width: 180px; }
.uppercase { text-transform: uppercase; }
.alert { margin-bottom: 16px; padding: 12px 14px; border-radius: 9px; font-size: .82rem; }
.alert.success { background: #e2f3ec; color: #0d604a; }
.alert.error { background: #f8e7e9; color: #8e2830; }
.alert ul { margin: 7px 0 0; padding-left: 18px; }
.case-link { display: grid; gap: 3px; color: inherit; text-decoration: none; }
.case-link strong { font-size: .84rem; }
.case-link small { color: var(--muted); font-size: .72rem; }
.count-pill { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; background: #e7edf5; color: #40536b; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.count-pill.warning { background: #fff0c8; color: #8a5c00; }
.pagination { margin-top: 14px; }
.pagination nav > div:first-child { display: none; }
.pagination nav > div:last-child { display: flex; justify-content: space-between; gap: 12px; align-items: center; color: var(--muted); font-size: .76rem; }
.pagination svg { width: 18px; }
.single-column { grid-template-columns: 1fr; }
.stats-stack { display: grid; gap: 10px; }
.stats-stack > div { display: flex; align-items: baseline; gap: 9px; padding: 12px; border-radius: 10px; background: var(--surface-soft); }
.stats-stack strong { font-size: 1.3rem; }
.stats-stack span { color: var(--muted); font-size: .76rem; }
.timeline { position: relative; display: grid; gap: 12px; padding-left: 21px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 12px; bottom: 12px; width: 2px; background: var(--line); }
.timeline-item { position: relative; }
.timeline-dot { position: absolute; left: -20px; top: 19px; width: 10px; height: 10px; border: 2px solid var(--surface); border-radius: 50%; background: #9ba2ad; box-shadow: 0 0 0 2px var(--line); }
.timeline-item.needs-action .timeline-dot { background: var(--accent); box-shadow: 0 0 0 2px #f0d295; }
.timeline-item.needs-action .panel { border-left: 3px solid var(--accent); }
.event-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.event-head strong, .event-head small { display: block; }
.event-head small { margin-bottom: 4px; color: var(--muted); font-size: .7rem; }
.event-description { margin: 12px 0 0; color: #535a65; font-size: .82rem; line-height: 1.6; white-space: pre-line; }
.deadline-card:has(.file-symbol) .file-symbol { background: #fff4dc; color: #865900; }
.sector-tabs { display: flex; gap: 7px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 7px; scrollbar-width: thin; }
.sector-tab { flex: 0 0 auto; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); text-decoration: none; font-size: .78rem; font-weight: 800; }
.sector-tab.active { border-color: var(--primary); background: var(--primary); color: white; }
.compact-filters { margin-bottom: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.kanban-board { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 13px; align-items: start; }
.kanban-column { min-height: 420px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #eef0f3; transition: background .15s, border-color .15s; }
.kanban-column.drag-over { border-color: var(--accent); background: #fff8e8; }
.kanban-column > header { padding: 4px 5px 11px; }
.kanban-column > header > div { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kanban-column > header strong { font-size: .82rem; }
.kanban-column > header span { min-width: 23px; padding: 3px 7px; border-radius: 999px; background: #dde1e6; color: var(--muted); font-size: .66rem; font-weight: 800; text-align: center; }
.kanban-cards { display: grid; gap: 9px; min-height: 350px; align-content: start; }
.task-card { position: relative; padding: 13px; border: 1px solid var(--line); border-left: 3px solid #aab0b9; border-radius: 11px; background: var(--surface); box-shadow: 0 3px 12px rgba(25,29,36,.04); cursor: grab; }
.task-card.dragging { opacity: .55; cursor: grabbing; }
.task-card.priority-high { border-left-color: var(--accent); }
.task-card.priority-urgent { border-left-color: var(--danger); }
.task-card.priority-low { border-left-color: #7592b3; }
.task-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.task-type { color: var(--muted); font-size: .62rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.priority-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #aab0b9; }
.priority-high .priority-dot { background: var(--accent); }
.priority-urgent .priority-dot { background: var(--danger); }
.priority-low .priority-dot { background: #7592b3; }
.task-card h3 { margin: 7px 0 9px; font-size: .86rem; line-height: 1.4; }
.task-context { display: block; margin: 4px 0; overflow: hidden; color: #55606d; font-size: .7rem; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.task-context:hover { text-decoration: underline; }
.contact-mode { display: inline-flex; margin-top: 6px; padding: 4px 7px; border-radius: 6px; background: #e8eff8; color: #315f91; font-size: .65rem; font-weight: 750; }
.task-meta { display: flex; align-items: center; gap: 7px; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); }
.task-meta .avatar { width: 27px; height: 27px; }
.task-meta strong, .task-meta small { display: block; }
.task-meta strong { font-size: .69rem; }
.task-meta small { margin-top: 2px; color: var(--muted); font-size: .63rem; }
.overdue-text { color: var(--danger) !important; font-weight: 800; }
.task-status-form { margin-top: 9px; }
.task-status-form select { width: 100%; min-height: 34px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); color: #4d5560; font-size: .68rem; font-weight: 750; }
.kanban-empty { margin: 22px 8px; color: var(--muted); font-size: .72rem; text-align: center; }
.handoff { margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line); }
.handoff summary { color: #855a00; cursor: pointer; font-size: .7rem; font-weight: 800; }
.handoff form { display: grid; gap: 8px; margin-top: 9px; }
.handoff .field { font-size: .68rem; }
.handoff .field input, .handoff .field select { min-height: 36px; }
.handoff .button { min-height: 35px; font-size: .7rem; }
.publication-list { display: grid; gap: 11px; }
.publication-card { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.publication-card.pending { border-left: 3px solid var(--accent); }
.publication-date { display: grid; place-items: center; padding: 8px 4px; border-radius: 10px; background: var(--surface-soft); }
.publication-date strong { font-size: 1.35rem; }
.publication-date span { color: var(--accent); font-size: .65rem; font-weight: 900; }
.publication-date small { color: var(--muted); font-size: .62rem; }
.publication-copy { min-width: 0; }
.publication-copy h2 { margin-bottom: 0; }
.publication-copy > p { margin: 10px 0; color: #555d68; font-size: .79rem; line-height: 1.55; }
.publication-context { display: flex; gap: 16px; flex-wrap: wrap; }
.publication-context span { color: var(--muted); font-size: .68rem; }
.publication-context strong { display: block; margin-bottom: 2px; color: var(--text); }
.month-nav { display: flex; gap: 7px; flex-wrap: wrap; }
.legend { width: 9px; height: 9px; display: inline-block; border-radius: 2px; }
.legend.task { background: #4678ad; }
.legend.deadline { background: #b46b25; }
.calendar-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.calendar-weekdays, .calendar-grid { min-width: 840px; display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); }
.calendar-weekdays { border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.calendar-weekdays strong { padding: 10px; color: var(--muted); font-size: .68rem; text-align: center; text-transform: uppercase; }
.calendar-day { min-height: 130px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.outside { background: #fafafa; opacity: .62; }
.calendar-day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.calendar-day > header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; }
.calendar-day > header span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; font-size: .73rem; font-weight: 800; }
.calendar-day.today > header span { background: var(--accent); color: white; }
.calendar-day > header small { color: var(--accent); font-size: .6rem; font-weight: 800; }
.day-items { display: grid; gap: 4px; }
.calendar-item { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 4px; align-items: center; padding: 5px 6px; border-left: 3px solid; border-radius: 5px; color: #39434f; text-decoration: none; font-size: .61rem; }
.calendar-item.task { border-left-color: #4678ad; background: #e9f1fa; }
.calendar-item.deadline { border-left-color: #b46b25; background: #fbefe4; }
.calendar-item.done { opacity: .55; text-decoration: line-through; }
.calendar-item time { font-weight: 850; }
.calendar-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-item b { padding: 2px 3px; border-radius: 3px; background: var(--danger); color: white; font-size: .5rem; text-transform: uppercase; }
.finance-stats { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; overflow-x: auto; }
.finance-stat { position: relative; min-width: 155px; padding: 17px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.finance-stat::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: #8b939e; }
.finance-stat.received::before { background: var(--success); }
.finance-stat.receivable::before { background: #3b76b4; }
.finance-stat.overdue::before { background: var(--danger); }
.finance-stat.expense::before { background: #8453a6; }
.finance-stat.success::before { background: var(--accent); }
.finance-stat span { color: var(--muted); font-size: .7rem; }
.finance-stat strong { display: block; margin-top: 7px; font-size: 1.15rem; }
.finance-month { justify-content: space-between; align-items: center; margin: 18px 0 11px; }
.finance-month > strong { text-transform: capitalize; }
.finance-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .65fr); gap: 14px; align-items: start; }
.finance-entries td strong, .finance-entries td small { display: block; }
.finance-entries td small { margin-top: 3px; color: var(--muted); font-size: .65rem; }
.money { white-space: nowrap; font-weight: 850; }
.money.income { color: var(--success); }
.money.expense { color: var(--danger); }
.entry-type, .payment-status { display: inline-flex; padding: 4px 7px; border-radius: 999px; font-size: .64rem; font-weight: 800; white-space: nowrap; }
.entry-type.income { background: #e2f3ec; color: var(--success); }
.entry-type.expense { background: #f8e3e6; color: var(--danger); }
.payment-status.pending { background: #e7edf5; color: #40536b; }
.payment-status.overdue { background: #f8e3e6; color: var(--danger); }
.payment-status.paid { background: #e2f3ec; color: var(--success); }
.payment-status.cancelled { background: #ececef; color: #6d737c; }
.table-action { display: block; margin-top: 5px; color: #4e6076; font-size: .64rem; font-weight: 800; }
.table-pay { position: relative; margin-top: 5px; }
.table-pay summary { color: #4e6076; cursor: pointer; font-size: .64rem; font-weight: 800; }
.table-pay form { position: absolute; right: 0; z-index: 4; width: 210px; display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); box-shadow: var(--shadow); }
.table-pay select, .table-pay input { width: 100%; min-height: 34px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; font-size: .68rem; }
.table-pay .button { min-height: 34px; font-size: .68rem; }
.agreements-list { padding-bottom: 8px; }
.agreement-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.agreement-row:first-of-type { border-top: 0; }
.agreement-row:hover strong { text-decoration: underline; }
.agreement-row span:last-child { text-align: right; }
.agreement-row strong, .agreement-row small { display: block; }
.agreement-row strong { font-size: .76rem; }
.agreement-row small { margin-top: 3px; color: var(--muted); font-size: .64rem; }
.success-fee-panel { position: sticky; top: 20px; }
.expected-fee { margin-top: 18px; padding: 17px; border: 1px solid #efd79f; border-radius: 12px; background: #fff9eb; }
.expected-fee small, .expected-fee strong, .expected-fee span { display: block; }
.expected-fee small { color: #826529; font-size: .68rem; font-weight: 800; }
.expected-fee strong { margin: 6px 0; font-size: 1.55rem; }
.expected-fee span { color: #776d59; font-size: .67rem; line-height: 1.45; }
.expected-fee.compact { margin: 0; padding: 12px; }
.expected-fee.compact strong { font-size: 1.12rem; }
.financial-entry-card { grid-template-columns: auto minmax(0, 1fr) auto auto auto; }
.entry-actions { min-width: 130px; }
.entry-actions summary { color: #4b5f77; cursor: pointer; font-size: .69rem; font-weight: 800; }
.entry-actions form { display: grid; gap: 7px; margin-top: 8px; }
.entry-actions .field { font-size: .66rem; }
.entry-actions .field input, .entry-actions .field select { min-height: 35px; }
.entry-actions .button { min-height: 35px; font-size: .68rem; }
.professional-list { padding-top: 7px; }
.professional-row { display: grid; grid-template-columns: auto minmax(180px, 1.2fr) minmax(160px, 1fr) minmax(130px, .7fr) auto; gap: 12px; align-items: center; padding: 13px 6px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.professional-row:first-child { border-top: 0; }
.professional-row:hover { background: #fafbfc; }
.profile-avatar.small { width: 38px; height: 38px; border-radius: 10px; font-size: .73rem; }
.professional-row strong, .professional-row small { display: block; }
.professional-row strong { overflow: hidden; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.professional-row small { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.professional-overview { margin-bottom: 17px; }
.professional-tabs { margin-top: 3px; }
.professional-access-card { display: flex; gap: 18px; align-items: center; justify-content: space-between; margin-bottom: 17px; border-left: 4px solid #d58d00; }
.professional-access-card h2 { margin: 3px 0; font-size: .9rem; }
.professional-form { display: grid; gap: 18px; }
.form-subsection { min-width: 0; margin: 0; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.form-subsection > legend { display: grid; grid-template-columns: 30px auto; column-gap: 10px; align-items: center; padding: 0 8px; }
.form-subsection > legend > span { grid-row: 1 / span 2; display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; background: #20242c; color: #fff; font-size: .76rem; font-weight: 800; }
.form-subsection > legend > strong { font-size: .86rem; }
.form-subsection > legend > small { color: var(--muted); font-size: .68rem; font-weight: 500; }
.form-subsection > .fields-grid, .form-subsection > .conditional-fields { margin-top: 14px; }
.field-check { align-self: end; min-height: 44px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8f9fb; }
.access-subsection { border-color: #e7cf91; background: linear-gradient(180deg, #fffdf7 0%, #fff 100%); }
.access-toggle { display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; padding: 15px; border: 1px solid #e7cf91; border-radius: 12px; background: #fffaf0; cursor: pointer; }
.access-toggle input { margin-top: 3px; accent-color: #d58d00; }
.access-toggle strong, .access-toggle small { display: block; }
.access-toggle strong { font-size: .82rem; }
.access-toggle small { margin-top: 4px; color: var(--muted); font-size: .7rem; line-height: 1.45; }
.access-level-guide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.access-level-guide div { padding: 10px 12px; border: 1px solid #eadfbe; border-radius: 9px; background: #fff; }
.access-level-guide strong, .access-level-guide small { display: block; }
.access-level-guide strong { font-size: .7rem; }
.access-level-guide small { margin-top: 3px; color: var(--muted); font-size: .63rem; line-height: 1.4; }
.security-note { margin: 12px 0 0; padding: 11px 12px; border-left: 3px solid #d58d00; background: #fff; color: #5e6672; font-size: .7rem; line-height: 1.5; }
.template-library { margin-bottom: 15px; }
.template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.template-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 11px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fafbfc; }
.template-card small, .template-card strong, .template-card span { display: block; }
.template-card small { color: var(--accent); font-size: .62rem; font-weight: 850; text-transform: uppercase; }
.template-card strong { margin-top: 3px; font-size: .82rem; }
.template-card p { margin: 6px 0; color: #5e6671; font-size: .7rem; line-height: 1.45; }
.template-card div > span { color: var(--muted); font-size: .63rem; }
.template-actions { display: grid; gap: 6px; }
.template-actions .button { min-height: 34px; padding: 6px 10px; font-size: .68rem; }
.document-filters { margin-top: 18px; }
.document-status { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: .66rem; font-weight: 850; white-space: nowrap; }
.document-status.draft { background: #eceef1; color: #5f6670; }
.document-status.review { background: #fff0c8; color: #865b00; }
.document-status.approved { background: #e2f3ec; color: var(--success); }
.document-status.signed { background: #e8eff8; color: #315f91; }
.document-status.protocolled { background: #ede6f5; color: #68418a; }
.document-editor-layout, .document-review-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); gap: 14px; align-items: start; }
.template-content textarea { min-height: 560px; padding: 22px !important; background: #fffefb !important; font-family: Georgia, "Times New Roman", serif; font-size: .9rem; line-height: 1.7; }
.variable-palette { position: sticky; top: 20px; }
.variable-palette > .muted { font-size: .72rem; line-height: 1.5; }
.variable-list { display: grid; gap: 6px; max-height: 620px; overflow-y: auto; }
.variable-list button { display: grid; gap: 3px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); cursor: pointer; text-align: left; }
.variable-list button:hover { border-color: var(--accent); background: #fffaf0; }
.variable-list strong { font-size: .7rem; }
.variable-list code, .used-variables code { color: #745600; font-size: .62rem; }
.used-variables { display: flex; gap: 5px; flex-wrap: wrap; }
.used-variables code { padding: 5px 7px; border-radius: 5px; background: #fff4d9; }
.document-review .panel-heading > small { max-width: 300px; color: var(--muted); font-size: .68rem; text-align: right; }
.document-save-bar { display: flex; justify-content: flex-end; align-items: flex-end; gap: 9px; margin-top: 12px; }
.document-save-bar .field { min-width: 180px; }
.version-history { position: sticky; top: 20px; }
.version-list { display: grid; }
.version-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.version-row:first-child { border-top: 0; }
.version-row > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-soft); font-size: .68rem; font-weight: 850; }
.version-row.current > span { background: var(--primary); color: white; }
.version-row strong, .version-row small { display: block; }
.version-row strong { font-size: .72rem; }
.version-row small { margin-top: 2px; color: var(--muted); font-size: .61rem; }
.version-row b { color: var(--success); font-size: .6rem; }
.document-context { display: grid; gap: 10px; margin-top: 17px; padding-top: 15px; border-top: 1px solid var(--line); }
.document-context h3 { margin: 0; font-size: .8rem; }
.document-context small, .document-context strong { display: block; }
.document-context small { color: var(--muted); font-size: .62rem; }
.document-context strong { margin-top: 2px; font-size: .7rem; }
.generated-links { margin-bottom: 14px; }
.alert-feed { display: grid; gap: 10px; }
.system-alert { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.system-alert.critical { border-left: 4px solid var(--danger); }
.system-alert.warning { border-left: 4px solid var(--accent); }
.system-alert.info { border-left: 4px solid #477db3; }
.alert-symbol { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-soft); font-weight: 900; }
.critical .alert-symbol { background: #f8e3e6; color: var(--danger); }
.warning .alert-symbol { background: #fff0c8; color: #8a5c00; }
.alert-copy { min-width: 0; }
.alert-copy > div:first-child { display: flex; gap: 8px; align-items: center; }
.alert-severity { font-size: .62rem; font-weight: 900; text-transform: uppercase; }
.critical .alert-severity { color: var(--danger); }
.warning .alert-severity { color: #8a5c00; }
.alert-copy small { color: var(--muted); font-size: .65rem; }
.alert-copy h2 { margin: 5px 0 3px; }
.alert-copy p { margin: 0; color: #59616c; font-size: .74rem; }
.snoozed-label { display: inline-flex; margin-top: 6px; padding: 3px 6px; border-radius: 5px; background: var(--surface-soft); color: var(--muted); font-size: .62rem; }
.alert-actions { display: flex; gap: 7px; align-items: center; }
.alert-actions details { position: relative; }
.alert-actions summary { padding: 8px; color: var(--muted); cursor: pointer; font-size: .68rem; font-weight: 800; }
.alert-actions form { position: absolute; right: 0; z-index: 5; width: 180px; display: grid; gap: 7px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); box-shadow: var(--shadow); }
.alert-actions select { min-height: 36px; padding: 6px; border: 1px solid var(--line); border-radius: 6px; }
.report-period { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.report-kpis { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; overflow-x: auto; }
.report-kpis article { min-width: 155px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.report-kpis span, .report-kpis strong, .report-kpis small { display: block; }
.report-kpis span { color: var(--muted); font-size: .68rem; }
.report-kpis strong { margin: 5px 0 3px; font-size: 1.35rem; }
.report-kpis small { color: var(--muted); font-size: .64rem; }
.reports-grid { align-items: start; }
.metric-table { display: grid; }
.metric-head, .metric-row { display: grid; grid-template-columns: minmax(150px, 1fr) 80px 80px 80px; gap: 9px; align-items: center; padding: 10px 4px; }
.metric-head { color: var(--muted); font-size: .63rem; font-weight: 800; text-transform: uppercase; }
.metric-row { position: relative; border-top: 1px solid var(--line); font-size: .73rem; }
.metric-row strong { font-size: .76rem; }
.metric-bar { height: 5px; overflow: hidden; border-radius: 999px; background: var(--surface-soft); }
.metric-row > .metric-bar { grid-column: 1 / -1; }
.metric-bar i { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #f2bd4f); }
.donut-wrap { display: grid; place-items: center; gap: 14px; padding: 10px; text-align: center; }
.donut { --value: 0; width: 132px; height: 132px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--success) calc(var(--value) * 1%), var(--surface-soft) 0); }
.donut::before { content: ''; grid-area: 1/1; width: 94px; height: 94px; border-radius: 50%; background: var(--surface); }
.donut span { z-index: 1; grid-area: 1/1; font-size: 1.2rem; font-weight: 900; }
.donut-wrap p { margin: 0; color: var(--muted); font-size: .68rem; line-height: 1.5; }
.productivity-list { display: grid; }
.productivity-row { display: grid; grid-template-columns: auto minmax(130px, .8fr) minmax(150px, 1fr) 35px; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.productivity-row:first-child { border-top: 0; }
.productivity-row strong, .productivity-row small { display: block; }
.productivity-row strong { font-size: .74rem; }
.productivity-row small { margin-top: 2px; color: var(--muted); font-size: .62rem; }
.productivity-row b { text-align: right; }
.financial-report { display: grid; gap: 10px; }
.financial-report > div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.financial-report span { color: var(--muted); font-size: .7rem; }
.financial-report strong { font-size: .76rem; }
.financial-report .danger strong { color: var(--danger); }
.financial-report .net { padding: 11px; border: 0; border-radius: 8px; background: #e2f3ec; }
.financial-report .net span, .financial-report .net strong { color: var(--success); font-weight: 850; }
.settings-grid { align-items: start; }
.backup-panel { margin-top: 18px; }
.security-warning { display: grid; gap: 3px; margin-bottom: 14px; padding: 11px 13px; border-left: 3px solid var(--accent); border-radius: 8px; background: #fff7e5; }
.security-warning strong { color: #765100; font-size: .75rem; }
.security-warning span { color: #7d704f; font-size: .68rem; }
.backup-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-bottom: 14px; }
.backup-facts > div { padding: 12px; border-radius: 9px; background: var(--surface-soft); }
.backup-facts strong, .backup-facts span { display: block; }
.backup-facts strong { font-size: 1rem; }
.backup-facts span { margin-top: 2px; color: var(--muted); font-size: .64rem; }
.backup-list { display: grid; }
.backup-list > div { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.backup-list strong, .backup-list small { display: block; }
.backup-list strong { font-size: .74rem; }
.backup-list small { margin-top: 2px; color: var(--muted); font-size: .63rem; }
.audit-list { padding-top: 10px; overflow-x: auto; }
.audit-head, .audit-row { min-width: 900px; display: grid; grid-template-columns: 170px minmax(180px, 1fr) minmax(220px, 1.2fr) minmax(180px, .8fr) 75px; gap: 10px; align-items: center; }
.audit-head { padding: 8px 5px; color: var(--muted); font-size: .62rem; font-weight: 850; text-transform: uppercase; }
.audit-row { padding: 11px 5px; border-top: 1px solid var(--line); }
.audit-row > span { min-width: 0; }
.audit-row strong, .audit-row small { display: block; }
.audit-row strong { overflow: hidden; font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.audit-row small { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: .59rem; text-overflow: ellipsis; white-space: nowrap; }
.audit-status { display: inline-flex; padding: 4px 6px; border-radius: 999px; font-size: .6rem; font-weight: 850; }
.audit-status.ok { background: #e2f3ec; color: var(--success); }
.audit-status.error { background: #f8e3e6; color: var(--danger); }

.guest-body { min-height: 100vh; background: var(--surface); }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, .9fr) minmax(420px, 1.1fr); }
.login-intro { display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: clamp(32px, 6vw, 76px); background: var(--primary); color: white; }
.brand.light { padding: 0; color: white; }
.brand.light small { color: #bec4ce; }
.brand.light .brand-mark { background: white; color: var(--primary); }
.login-intro h1 { max-width: 520px; font-size: clamp(2rem, 5vw, 4rem); }
.login-intro p:not(.eyebrow) { max-width: 550px; color: #cbd0d8; line-height: 1.7; }
.login-security { font-size: .75rem; }
.login-panel { display: grid; place-items: center; padding: 30px; }
.login-card { width: min(420px, 100%); display: grid; gap: 17px; }
.login-card h2 { margin-bottom: 6px; font-size: 1.55rem; }
.form-foot { text-align: center; }

/* Cadastro de processos: fluxo progressivo e confortável em telas grandes e pequenas. */
.case-form-stack { display: grid; gap: 16px; }
.form-section { padding: 22px; }
.numbered-heading { align-items: flex-start; }
.numbered-heading > span { flex: 0 0 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--primary); color: #fff; font-size: .72rem; font-weight: 900; }
.numbered-heading > div { flex: 1; }
.numbered-heading .muted { margin: 4px 0 0; font-size: .68rem; }
.field em { color: var(--accent-dark, #a66d00); font-size: .57rem; font-style: normal; font-weight: 800; text-transform: uppercase; }
.field > small { min-height: 12px; margin-top: 5px; color: var(--muted); font-size: .61rem; font-weight: 500; }
.choice-group { display: flex; flex-wrap: wrap; gap: 10px 28px; padding: 12px 14px; border-radius: 9px; background: var(--surface-soft); }
.party-editor-list { display: grid; gap: 13px; }
.party-editor { padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.party-editor-head, .subsection-title { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 13px; }
.party-editor-head strong, .party-editor-head small, .subsection-title strong, .subsection-title small { display: block; }
.party-editor-head strong, .subsection-title strong { font-size: .75rem; }
.party-editor-head small, .subsection-title small { margin-top: 2px; color: var(--muted); font-size: .61rem; }
.lawyers-block { margin-top: 14px; padding-top: 13px; border-top: 1px dashed var(--line); }
.party-lawyers { color: var(--primary) !important; font-weight: 750; }

/* Ficha do processo: visão operacional e navegação orientada à ação. */
.case-profile-header { margin-bottom: 13px; }
.record-tabs { position: sticky; z-index: 7; top: 0; padding: 8px; border: 1px solid var(--line); border-radius: 11px; background: rgba(245,246,248,.96); box-shadow: 0 8px 20px rgba(25,29,36,.04); backdrop-filter: blur(8px); }
.case-attention-banner { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; margin-bottom: 13px; padding: 13px 15px; border: 1px solid #efc8cc; border-radius: 11px; background: #fff2f3; }
.attention-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--danger); color: white; font-weight: 900; }
.case-attention-banner strong, .case-attention-banner p { display: block; margin: 0; }
.case-attention-banner strong { color: #8e2830; font-size: .78rem; }
.case-attention-banner p { margin-top: 2px; color: #80545a; font-size: .66rem; }
.danger-soft { border-color: #e3aeb3 !important; background: #fff !important; color: var(--danger) !important; }
.case-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 13px; }
.case-kpi { min-width: 0; display: grid; gap: 3px; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--text); cursor: pointer; text-align: left; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.case-kpi:hover { transform: translateY(-2px); border-color: #c7ccd3; box-shadow: var(--shadow); }
.case-kpi span { color: var(--muted); font-size: .66rem; font-weight: 750; }
.case-kpi strong { font-size: 1.45rem; }
.case-kpi small { color: var(--muted); font-size: .61rem; }
.case-kpi.warning { border-left: 3px solid var(--accent); background: #fffbf2; }
.case-kpi.danger { border-left: 3px solid var(--danger); background: #fff6f7; }
.case-kpi.danger small { color: var(--danger); font-weight: 750; }
.case-overview-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, .7fr); gap: 13px; align-items: start; }
.case-data-panel { grid-column: 1 / -1; }
.next-action-list { display: grid; }
.next-action { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 11px; align-items: center; padding: 10px 3px; border: 0; border-top: 1px solid var(--line); background: transparent; color: inherit; cursor: pointer; text-align: left; }
.next-action:first-child { border-top: 0; }
.next-action:hover { background: var(--surface-soft); }
.action-date { width: 42px; height: 42px; display: grid; place-content: center; border-radius: 9px; background: var(--primary); color: white; text-align: center; }
.action-date b, .action-date small { display: block; line-height: 1; }
.action-date b { font-size: .9rem; }
.action-date small { margin-top: 3px; font-size: .51rem; }
.next-action > span:nth-child(2) small, .next-action > span:nth-child(2) strong, .next-action > span:nth-child(2) em { display: block; }
.next-action > span:nth-child(2) small { color: var(--accent); font-size: .55rem; font-weight: 850; }
.next-action > span:nth-child(2) strong { margin: 2px 0; font-size: .72rem; }
.next-action > span:nth-child(2) em { color: var(--muted); font-size: .59rem; font-style: normal; }
.action-state { color: var(--muted); font-size: .6rem; font-weight: 750; white-space: nowrap; }
.next-action.late .action-date { background: var(--danger); }
.next-action.late .action-state { color: var(--danger); }
.panel-footer-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.case-owner { display: flex; gap: 10px; align-items: center; padding: 11px; border-radius: 10px; background: var(--surface-soft); }
.case-owner small, .case-owner strong { display: block; }
.case-owner small { color: var(--muted); font-size: .6rem; }
.case-owner strong { margin-top: 2px; font-size: .72rem; }
.case-progress { margin: 15px 0; }
.case-progress > div { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: .64rem; }
.case-progress progress { width: 100%; height: 7px; overflow: hidden; border: 0; border-radius: 999px; }
.case-progress progress::-webkit-progress-bar { background: var(--surface-soft); }
.case-progress progress::-webkit-progress-value { background: var(--accent); }
.summary-list { display: grid; gap: 8px; margin: 0; }
.summary-list > div { display: flex; justify-content: space-between; gap: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.summary-list dt { color: var(--muted); font-size: .61rem; }
.summary-list dd { margin: 0; font-size: .65rem; font-weight: 750; text-align: right; }
.case-notes { display: grid; gap: 4px; margin: 17px 0 0; }
.case-notes strong { color: var(--text); font-size: .65rem; }

/* Histórico jurídico e tratamento de publicações. */
.event-summary-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.event-summary-strip span { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: .62rem; }
.event-summary-strip strong { margin-right: 3px; color: var(--text); }
.warning-text, .warning-text strong { color: #9a6500 !important; }
.event-create-panel { margin-bottom: 12px; border-left: 3px solid var(--accent); }
.action-check { padding: 11px 13px; border-radius: 9px; background: #fff7e6; color: #775100; }
.event-filters { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(190px, .45fr) minmax(180px, .4fr); gap: 10px; align-items: end; margin-bottom: 15px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.event-card { padding: 17px; }
.event-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.importance-badge { display: inline-flex; align-items: center; padding: 4px 7px; border-radius: 999px; background: var(--surface-soft); color: var(--muted); font-size: .56rem; font-weight: 850; }
.importance-badge.important { background: #fff1cf; color: #8b5d00; }
.importance-badge.urgent { background: #f8e3e6; color: var(--danger); }
.timeline-item.importance-urgent .timeline-dot { background: var(--danger); }
.event-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: .61rem; }
.event-meta span b { margin-right: 5px; color: var(--text); }
.event-meta a { color: #8d6108; font-weight: 750; }
.treatment-result { margin-top: 11px; padding: 10px 12px; border-radius: 8px; background: #e7f4ee; color: #195f4d; }
.treatment-result strong { font-size: .64rem; }
.treatment-result p { margin: 4px 0 0; font-size: .63rem; line-height: 1.5; }
.event-card-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin-top: 12px; }
.event-card-actions > details { flex: 0 0 auto; }
.event-card-actions > details[open] { flex: 1 0 100%; }
.event-card-actions > details > summary { display: inline-flex; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); font-size: .61rem; font-weight: 800; }
.event-card-actions > details[open] > summary { margin-bottom: 10px; }
.event-card-actions .treatment-disclosure > summary { border-color: var(--primary); background: var(--primary); color: white; }
.event-card-actions .dismiss-disclosure > summary { color: var(--muted); }
.event-card-actions form { padding: 12px; border-radius: 9px; background: var(--surface-soft); }
.danger-stat { border-left: 3px solid var(--danger) !important; background: #fff6f7 !important; }
.danger-stat strong { color: var(--danger); }
.publication-card.importance-urgent { border-left-color: var(--danger); }

/* Controles jurídicos: prazos e tarefas ligados à Agenda e ao Kanban. */
.deadline-create-panel { margin-bottom: 12px; border-left: 3px solid var(--danger); }
.task-create-panel { margin-bottom: 12px; border-left: 3px solid var(--primary); }
.danger-text, .danger-text strong { color: var(--danger) !important; }
.calculation-notice { display: block; color: #8b5d00 !important; line-height: 1.35; }
.deadline-list, .task-control-list { display: grid; gap: 10px; }
.legal-control-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 13px; align-items: start; padding: 15px; }
.legal-control-card.overdue { border-left: 3px solid var(--danger); background: #fffafa; }
.legal-control-card.fatal:not(.overdue) { border-left: 3px solid var(--accent); }
.control-date { width: 52px; min-height: 58px; display: grid; place-content: center; border-radius: 10px; background: var(--primary); color: white; text-align: center; }
.control-date strong, .control-date span, .control-date small { display: block; line-height: 1; }
.control-date strong { font-size: 1.1rem; }
.control-date span { margin: 4px 0; font-size: .54rem; font-weight: 850; }
.control-date small { color: #cfd3da; font-size: .55rem; }
.legal-control-card.overdue .control-date { background: var(--danger); }
.control-copy { min-width: 0; }
.control-title { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.control-title small, .control-title strong { display: block; }
.control-title small { margin-bottom: 3px; color: var(--accent); font-size: .56rem; font-weight: 850; }
.control-title strong { font-size: .76rem; }
.control-copy > p { margin: 7px 0 0; color: var(--muted); font-size: .64rem; }
.danger-status { background: #f8e3e6 !important; color: var(--danger) !important; }
.control-actions { min-width: 110px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.control-actions select { min-height: 34px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: white; font-size: .63rem; }
.control-actions > details[open] { flex: 1 0 100%; min-width: min(660px, 70vw); }
.control-actions > details > summary { padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: white; cursor: pointer; font-size: .61rem; font-weight: 800; }
.control-actions > details[open] > summary { margin-bottom: 8px; }
.control-actions > details form { padding: 12px; border-radius: 9px; background: var(--surface-soft); }
.cancel-control > summary { color: var(--danger); }
.task-check-symbol { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-soft); color: var(--muted); font-size: 1rem; font-weight: 900; }
.task-control.priority-urgent .task-check-symbol { background: #f8e3e6; color: var(--danger); }
.task-control.priority-high .task-check-symbol { background: #fff1cf; color: #8b5d00; }
.priority-label { display: inline-flex; padding: 4px 7px; border-radius: 999px; background: var(--surface-soft); color: var(--muted); font-size: .55rem; font-weight: 850; }
.priority-label.high { background: #fff1cf; color: #8b5d00; }
.priority-label.urgent { background: #f8e3e6; color: var(--danger); }
.control-notes { padding: 8px 10px; border-radius: 7px; background: var(--surface-soft); white-space: pre-line; }

/* Documentos privados e histórico de versões. */
.document-upload-panel { margin-bottom: 14px; border-left: 3px solid #516b95; }
.document-dropzone { position: relative; min-height: 150px; display: grid; place-items: center; align-content: center; gap: 5px; padding: 18px; border: 2px dashed #cbd2dc; border-radius: 12px; background: #f8fafc; cursor: pointer; text-align: center; transition: border-color .16s ease, background .16s ease; }
.document-dropzone:hover, .document-dropzone.dragging { border-color: var(--accent); background: #fffbf2; }
.document-dropzone.has-file { border-color: var(--success); background: #f2faf7; }
.document-dropzone input { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; opacity: 0; }
.dropzone-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--primary); color: white; font-weight: 900; }
.document-dropzone strong { font-size: .76rem; }
.document-dropzone small { color: var(--muted); font-size: .61rem; }
.document-dropzone em { margin-top: 5px; color: #48617f; font-size: .63rem; font-style: normal; font-weight: 750; }
.generated-document-section { margin-bottom: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.document-grid { display: grid; gap: 10px; }
.document-card { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: inherit; text-decoration: none; }
.document-card.generated:hover { border-color: #bdc5d0; box-shadow: var(--shadow); }
.document-icon { width: 44px; height: 52px; display: grid; place-items: center; border-radius: 7px 7px 10px 10px; background: #e8edf5; color: #405675; font-size: .58rem; font-weight: 900; }
.document-card.generated > span:nth-child(2) small, .document-card.generated > span:nth-child(2) strong, .document-card.generated > span:nth-child(2) em { display: block; }
.document-card.generated > span:nth-child(2) small, .document-main > small { color: var(--accent); font-size: .56rem; font-weight: 850; }
.document-card.generated > span:nth-child(2) strong { margin: 3px 0; font-size: .74rem; }
.document-card.generated > span:nth-child(2) em { color: var(--muted); font-size: .6rem; font-style: normal; }
.file-card { grid-template-columns: auto minmax(0, 1fr) auto; }
.document-main { min-width: 0; }
.document-main > strong, .document-main > em, .document-main > span { display: block; }
.document-main > strong { margin: 3px 0; overflow-wrap: anywhere; font-size: .76rem; }
.document-main > em, .document-main > span { color: var(--muted); font-size: .59rem; font-style: normal; }
.document-main > span { margin-top: 3px; }
.document-main > p { margin: 8px 0 0; padding: 8px; border-radius: 7px; background: var(--surface-soft); color: #555d68; font-size: .62rem; white-space: pre-line; }
.document-card-side { display: grid; gap: 8px; justify-items: end; }
.document-actions { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; padding-top: 10px; border-top: 1px solid var(--line); }
.document-actions > form { min-width: 170px; }
.document-actions > details { flex: 0 0 auto; }
.document-actions > details[open] { flex: 1 0 100%; }
.document-actions > details > summary { padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: white; cursor: pointer; font-size: .61rem; font-weight: 800; }
.document-actions > details[open] > summary { margin-bottom: 8px; }
.document-actions > details > form, .version-list { padding: 12px; border-radius: 9px; background: var(--surface-soft); }
.version-list { display: grid; padding: 0; overflow: hidden; }
.version-list > div { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px; border-top: 1px solid var(--line); }
.version-list > div:first-child { border-top: 0; }
.version-list strong, .version-list small { display: block; }
.version-list strong { font-size: .66rem; }
.version-list small { margin-top: 2px; color: var(--muted); font-size: .56rem; }
.version-list a { color: #405675; font-size: .61rem; font-weight: 850; }
.document-center-section { margin-top: 14px; }
.document-center-section .panel-heading > .count-pill { align-self: center; }
.lawyer-row { display: grid; grid-template-columns: 1.2fr .55fr 1fr .75fr auto; gap: 9px; align-items: end; margin-top: 9px; }
.compact-button { min-height: 34px; padding: 7px 10px; }
.empty-state.compact { min-height: auto; padding: 16px; }
.sticky-form-actions { position: sticky; z-index: 4; bottom: 0; display: flex; justify-content: flex-end; gap: 9px; margin: 18px -8px -8px; padding: 13px 8px 8px; background: linear-gradient(transparent, var(--page-bg, #f4f5f7) 24%); }

.crm-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 16px; }
.crm-kpi-grid article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 4px; }
.crm-kpi-grid span { color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; }
.crm-kpi-grid strong { font-size: 1.3rem; }
.crm-kpi-grid small { color: var(--muted); }
.crm-kpi-grid .attention { border-top: 3px solid #c98b16; }
.crm-kpi-grid .success { border-top: 3px solid #16856b; }
.crm-filters { margin-bottom: 16px; }
.crm-board { display: grid; grid-template-columns: repeat(8, minmax(275px, 1fr)); gap: 12px; align-items: start; overflow-x: auto; padding: 2px 2px 18px; scroll-snap-type: x proximity; }
.crm-column { background: #e9edf2; border-radius: 14px; padding: 10px; min-height: 430px; scroll-snap-align: start; }
.crm-column > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 4px 8px; font-size: .8rem; font-weight: 800; }
.crm-column > header strong { display: grid; place-items: center; min-width: 24px; height: 24px; border-radius: 99px; background: var(--surface); }
.crm-column-value { color: var(--muted); font-size: .72rem; padding: 0 4px 9px; }
.crm-cards { display: grid; gap: 9px; }
.crm-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 10px; box-shadow: 0 2px 6px rgba(20,28,40,.04); }
.crm-card-head { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 9px; }
.crm-card-head > span:last-child { min-width: 0; display: grid; }
.crm-card-head a { color: var(--ink); font-weight: 800; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-card-head small, .crm-stage-age { color: var(--muted); }
.crm-card-facts { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .7rem; }
.crm-card-facts strong { color: var(--ink); }
.crm-next-action { display: grid; gap: 2px; padding: 9px; border-radius: 9px; background: #f4f6f8; color: var(--ink); text-decoration: none; }
.crm-next-action small, .crm-next-action span { color: var(--muted); font-size: .65rem; }
.crm-next-action strong { font-size: .76rem; }
.crm-next-action.overdue { background: #fff0ed; border-left: 3px solid #c43b3b; }
.crm-next-action.empty { opacity: .72; }
.crm-card-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.crm-card-actions details { min-width: 0; grid-column: span 1; }
.crm-card-actions details[open] { grid-column: 1 / -1; }
.crm-card-actions summary { list-style: none; cursor: pointer; text-align: center; border: 1px solid var(--line); border-radius: 8px; padding: 7px 4px; font-size: .68rem; font-weight: 700; }
.crm-popover { display: grid; gap: 9px; padding-top: 10px; }
.crm-popover hr { width: 100%; border: 0; border-top: 1px solid var(--line); }
.crm-history { border-top: 1px dashed var(--line); padding-top: 8px; }
.crm-history > summary { color: var(--muted); cursor: pointer; font-size: .7rem; font-weight: 700; }
.crm-history > div { display: grid; gap: 7px; padding-top: 8px; }
.crm-history article { display: grid; gap: 2px; background: #f5f6f8; border-radius: 8px; padding: 8px; font-size: .7rem; }
.crm-history article small, .crm-history article p { color: var(--muted); margin: 0; }
.crm-empty { color: var(--muted); font-size: .72rem; text-align: center; padding: 30px 8px; }
.stage-contract_signed { background: #e3f2ed; }
.stage-lost { background: #eeeef0; }

.finance-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.finance-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 5px; }
.finance-kpi > span { color: var(--muted); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.finance-kpi > strong { font-size: 1.35rem; }
.finance-kpi > small { color: var(--muted); }
.finance-kpi.positive { border-top: 3px solid #16856b; }
.finance-kpi.danger { border-top: 3px solid #c43b3b; }
.finance-agreement-layout { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(290px, .7fr); gap: 18px; align-items: start; }
.agreement-side-stack { display: grid; gap: 14px; position: sticky; top: 20px; }
.financial-entry-list { display: grid; gap: 12px; }
.financial-control-card { display: grid; grid-template-columns: 55px minmax(0, 1fr) auto; gap: 14px; align-items: start; border: 1px solid var(--line); border-radius: 14px; padding: 15px; background: var(--surface); }
.financial-date { width: 50px; min-height: 54px; border-radius: 10px; background: var(--soft); display: grid; place-content: center; text-align: center; line-height: 1; }
.financial-date strong { font-size: 1.2rem; }
.financial-date span { color: var(--muted); font-size: .65rem; margin-top: 4px; }
.financial-copy { min-width: 0; display: grid; gap: 6px; }
.financial-copy small, .financial-value small { color: var(--muted); }
.financial-value { text-align: right; display: grid; white-space: nowrap; }
.financial-actions { grid-column: 2 / -1; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.financial-actions details, .payment-history details { position: relative; }
.financial-actions summary, .payment-history summary { list-style: none; cursor: pointer; }
.popover-form { position: absolute; right: 0; z-index: 10; width: min(330px, 80vw); padding: 14px; margin-top: 7px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); display: grid; gap: 10px; }
.agreement-entry-progress { height: 6px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.agreement-entry-progress span { display: block; height: 100%; background: #16856b; border-radius: inherit; }
.payment-progress { display: grid; gap: 5px; }
.payment-progress > div { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .72rem; }
.payment-progress progress { width: 100%; height: 7px; accent-color: #16856b; }
.payment-history { grid-column: 2 / -1; border-top: 1px dashed var(--line); padding-top: 10px; }
.payment-history > summary { color: var(--muted); font-size: .78rem; font-weight: 700; }
.payment-history-list { display: grid; gap: 8px; margin-top: 10px; }
.payment-history-list > div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 11px; background: var(--soft); border-radius: 9px; }
.payment-history-list span { display: grid; }
.payment-history-list small { color: var(--muted); }
.payment-history-list .reversed { opacity: .65; text-decoration: line-through; }
.text-button { color: var(--muted); font-size: .75rem; cursor: pointer; }
.installment-preview { background: var(--soft); border-radius: 11px; padding: 13px 15px; display: grid; gap: 3px; }
.installment-preview small { color: var(--muted); }
.field-help { color: var(--muted); font-size: .76rem; }
.button.danger-outline { color: #a62f2f; border-color: #e4baba; background: #fff; }
.button.danger { color: #fff; background: #a62f2f; border-color: #a62f2f; }
.heading-actions, .toolbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.copy-chip, .copy-inline { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 30px; border: 1px solid #d8dde5; background: #fff; color: #536071; border-radius: 8px; font: inherit; font-size: .69rem; line-height: 1; font-weight: 750; cursor: pointer; transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease; white-space: nowrap; }
.copy-chip::before, .copy-inline::before { content: ""; width: 12px; height: 12px; flex: 0 0 auto; border: 1.5px solid currentColor; border-radius: 2px; box-shadow: 3px -3px 0 -1px #fff, 3px -3px 0 0 currentColor; }
.copy-chip { padding: 7px 10px; }
.copy-inline { width: fit-content; margin-top: 7px; padding: 5px 8px; }
.copy-chip:hover, .copy-inline:hover { color: #1e2530; border-color: #aeb7c3; background: #f7f8fa; }
.copy-chip:active, .copy-inline:active { transform: translateY(1px); }
.copy-chip.copied, .copy-inline.copied, .copy-action.copied { color: #08745d; border-color: #9ed8c9; background: #ecf8f4; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: #c94747; background: #fff8f8; box-shadow: 0 0 0 3px rgba(201, 71, 71, .08); }
.field-error { color: #a62f2f !important; font-weight: 700; }
.field-error-link { color: #8f2929; font-size: .76rem; font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }
.info-grid > div { position: relative; }
.client-case-card { align-items: center; }
.client-case-card .entity-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.empty-state > span { display: block; margin-top: 4px; }
.client-profile-flags { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); display: grid; gap: 5px; }
.client-profile-flags > small { color: var(--muted); }
.client-profile-flags > div { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 6px; }
.document-checklist { display: grid; gap: 10px; margin: 16px 0 24px; }
.requirement-card { --requirement-color: #bd3333; --requirement-border: #ecc4c4; --requirement-bg: #fff8f8; display: grid; grid-template-columns: 8px minmax(220px, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px; border: 1px solid var(--requirement-border); border-radius: 12px; background: var(--requirement-bg); }
.requirement-card.status-received { --requirement-color: #14816a; --requirement-border: #b9dfd5; --requirement-bg: #f5fbf9; }
.requirement-card.status-requested { --requirement-color: #b87900; --requirement-border: #ead49e; --requirement-bg: #fffbf1; }
.requirement-card.status-pending { --requirement-color: #bd3333; --requirement-border: #ecc4c4; --requirement-bg: #fff8f8; }
.requirement-card.status-not_applicable { --requirement-color: #707986; --requirement-border: #d6dbe1; --requirement-bg: #f7f8fa; }
.requirement-state { width: 10px; height: 38px; border-radius: 99px; background: var(--requirement-color); }
.requirement-copy { display: grid; gap: 3px; }
.requirement-copy strong { font-size: .82rem; line-height: 1.35; }
.requirement-copy small { color: var(--muted); font-size: .68rem; }
.requirement-copy .security-note { color: #8a6200; font-weight: 700; }
.requirement-status-form { display: flex; align-items: end; gap: 8px; }
.requirement-status-form label { display: grid; gap: 4px; }
.requirement-status-form label > span { color: var(--muted); font-size: .65rem; font-weight: 800; text-transform: uppercase; }
.requirement-status-form select { min-width: 135px; height: 38px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.requirement-status-form .button { min-height: 38px; }
.requirement-status-form .button:disabled { cursor: wait; opacity: .72; }
.requirement-save-feedback { flex: 1 0 100%; min-height: 14px; color: #8a6412; font-size: .64rem; font-weight: 750; text-align: right; }
.requirement-save-feedback.saved { color: #14735a; }
.requirement-save-feedback.error { color: var(--danger); }
.requirement-badge { color: var(--requirement-color); font-weight: 800; }
.document-history-heading { margin-top: 24px; }
.checklist-heading { align-items: end; margin-top: 28px; }
.add-requirement-form { display: flex; align-items: end; gap: 8px; width: min(520px, 100%); }
.add-requirement-form .field { flex: 1; }
.requirement-actions { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.requirement-actions > form:last-child { display: flex; align-items: end; }
.document-row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.nav-link-secondary { margin-left: 18px; font-size: .72rem; }
.relationship-context, .origin-case-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; padding: 15px 17px; border: 1px solid #d7c27f; border-radius: 12px; background: #fffbef; }
.relationship-context strong, .relationship-context small, .origin-case-banner small, .origin-case-banner strong, .origin-case-banner em { display: block; }
.relationship-context small, .origin-case-banner small, .origin-case-banner em { margin-top: 3px; color: var(--muted); font-size: .7rem; font-style: normal; }
.origin-case-banner { justify-content: flex-start; }
.origin-case-banner > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #ead8a6; color: #6f5100; font-size: 1.2rem; }
.case-origin-link { display: flex; align-items: center; gap: 10px; margin: -10px 0 18px; padding: 10px 13px; border: 1px solid #ead49e; border-radius: 10px; background: #fffbf1; }
.case-origin-link > span { color: #8b6108; font-size: 1.05rem; }
.case-origin-link small, .case-origin-link a { display: block; }
.case-origin-link small { color: var(--muted); font-size: .65rem; }
.case-origin-link a { margin-top: 2px; font-size: .78rem; font-weight: 800; }
.origin-case-banner a { margin-top: 4px; color: inherit; text-decoration: none; }
.relationship-grid { display: grid; gap: 10px; margin-top: 14px; }
.relationship-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 13px; align-items: center; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.relationship-card > div { display: grid; gap: 3px; min-width: 0; }
.relationship-card a { display: grid; color: inherit; text-decoration: none; }
.relationship-card a span, .relationship-card small, .relationship-card em { color: var(--muted); font-size: .68rem; font-style: normal; }
.relationship-card p { margin: 5px 0 0; color: var(--text); font-size: .72rem; }
.relationship-card > .relationship-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.relationship-kind { display: inline-flex; padding: 6px 8px; border-radius: 999px; background: #edf0f5; color: #48566b; font-size: .64rem; font-weight: 850; }
.relationship-kind.appeal { background: #fff0cd; color: #835900; }
.source-choice { display: grid; grid-template-columns: minmax(240px, .5fr) 1fr; gap: 14px; align-items: end; margin-bottom: 14px; padding: 13px; border-radius: 10px; background: var(--surface-soft); }
.source-choice p { margin: 0 0 9px; color: var(--muted); font-size: .72rem; }
.case-party-list { gap: 10px; }
.case-party-card { grid-template-columns: auto minmax(0, 1fr) auto; }
.case-party-card .entity-actions, .party-profile-card .entity-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.party-side-badge { display: inline-flex; padding: 3px 6px; border-radius: 999px; background: #edf0f5; color: #465267; font-size: .62rem; font-weight: 850; }
.party-side-badge.side-claimant, .party-side-badge.side-appellant { background: #e7f4ee; color: #14735a; }
.party-side-badge.side-defendant, .party-side-badge.side-appellee { background: #f8e6e8; color: #a62f3b; }
.compact-disclosure { margin: -5px 0 7px 54px; }
.inline-danger-action { display: flex; justify-content: flex-end; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.party-profile-list { margin-top: 14px; }
.party-profile-card { grid-template-columns: auto minmax(0, 1fr) auto; }
.danger-zone { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-top: 16px; padding: 16px; border: 1px solid #efc3c3; border-radius: 12px; background: #fff8f8; }
.danger-zone strong, .danger-zone small { display: block; }
.danger-zone small { margin-top: 3px; color: var(--muted); }

@media (max-width: 900px) {
    .account-grid { grid-template-columns: 1fr; }
    .stats-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .content-grid { grid-template-columns: 1fr 1fr; }
    .content-grid .span-2 { grid-column: 1 / -1; }
    .form-layout { grid-template-columns: 1fr; }
    .form-layout .span-2 { grid-column: auto; }
    .client-row { grid-template-columns: auto minmax(0, 1fr) auto; }
    .client-contact, .client-owner { display: none; }
    .info-grid, .debt-info { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .publication-card { grid-template-columns: 48px minmax(0, 1fr); }
    .publication-card > .button { grid-column: 2; justify-self: start; }
    .finance-layout { grid-template-columns: 1fr; }
    .success-fee-panel { position: static; }
    .professional-row { grid-template-columns: auto minmax(0, 1fr) auto; }
    .professional-row > span:nth-child(3), .professional-row > span:nth-child(4) { display: none; }
    .form-subsection { padding: 16px 12px; }
    .access-level-guide { grid-template-columns: 1fr; }
    .professional-access-card { align-items: stretch; flex-direction: column; }
    .client-case-card .entity-actions { grid-column: 2; justify-content: flex-start; }
    .requirement-card { grid-template-columns: 10px minmax(0, 1fr); }
    .requirement-actions, .requirement-status-form, .requirement-badge { grid-column: 2; justify-self: start; }
    .document-editor-layout, .document-review-layout { grid-template-columns: 1fr; }
    .relationship-card, .case-party-card, .party-profile-card { grid-template-columns: auto minmax(0, 1fr); }
    .relationship-card > form, .relationship-actions, .case-party-card .entity-actions, .party-profile-card .entity-actions { grid-column: 2; justify-content: flex-start; }
    .variable-palette, .version-history { position: static; }
    .system-alert { grid-template-columns: auto minmax(0, 1fr); }
    .alert-actions { grid-column: 2; }
    .phone-row { grid-template-columns: 1fr 1fr; }
    .phone-row .icon-button { justify-self: end; }
    .edit-disclosure > form { width: min(650px, calc(100vw - 60px)); }
    .lawyer-row { grid-template-columns: 1fr 1fr; }
    .lawyer-row .icon-button { justify-self: start; }
    .case-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .case-overview-grid { grid-template-columns: 1fr; }
    .case-data-panel { grid-column: auto; }
    .event-filters { grid-template-columns: 1fr 1fr; }
    .event-filters .search-field { grid-column: 1 / -1; }
    .legal-control-card { grid-template-columns: auto minmax(0, 1fr); }
    .control-actions { grid-column: 2; justify-content: flex-start; }
    .control-actions > details[open] { min-width: min(600px, 75vw); }
    .document-actions { grid-column: 1 / -1; }
    .crm-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .finance-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .finance-agreement-layout { grid-template-columns: 1fr; }
    .agreement-side-stack { position: static; }
}

@media (max-width: 760px) {
    .app-shell { display: block; }
    .sidebar { position: fixed; left: 0; transform: translateX(-102%); width: min(280px, 86vw); transition: transform .2s ease; box-shadow: var(--shadow); }
    .sidebar.open { transform: translateX(0); }
    .mobile-header { height: 58px; display: flex; align-items: center; gap: 10px; padding: 0 15px; background: var(--surface); border-bottom: 1px solid var(--line); }
    .page-content { padding: 24px 15px 40px; }
    .record-tabs { top: 58px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
    .record-tab { flex: 0 0 auto; }
    .stats-grid, .content-grid { grid-template-columns: 1fr; }
    .stats-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-commercial-grid { grid-template-columns: 1fr; }
    .content-grid .span-2 { grid-column: auto; }
    .login-shell { grid-template-columns: 1fr; }
    .login-intro { min-height: 290px; padding: 28px; }
    .login-intro h1 { font-size: 2.1rem; }
    .login-security { display: none; }
}

@media (max-width: 520px) {
    .fields-grid { grid-template-columns: 1fr; }
    .page-header.split .button, .form-actions, .form-actions .button { width: 100%; }
    .stats-grid { gap: 10px; }
    .panel { padding: 16px; }
    .login-panel { padding: 28px 20px; }
    .entity-card { grid-template-columns: auto minmax(0, 1fr); }
    .entity-card > .status, .entity-card > .button { grid-column: 2; justify-self: start; }
    .info-grid, .debt-info { grid-template-columns: 1fr; }
    .record-tabs { display: flex; }
    .record-tab { justify-content: center; }
    .event-head { display: grid; }
    .publication-card { padding: 14px; gap: 10px; }
    .month-nav, .month-nav .button { width: 100%; }
    .finance-month > strong { width: 100%; text-align: center; order: -1; }
    .financial-entry-card { grid-template-columns: auto minmax(0, 1fr); }
    .financial-entry-card > .money, .financial-entry-card > .payment-status, .financial-entry-card > .entry-actions { grid-column: 2; justify-self: start; }
    .template-grid { grid-template-columns: 1fr; }
    .template-card { grid-template-columns: auto minmax(0, 1fr); }
    .template-actions { grid-column: 2; grid-template-columns: 1fr 1fr; }
    .document-save-bar { display: grid; }
    .document-save-bar .field, .document-save-bar .button { width: 100%; }
    .alert-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .alert-actions .button { width: 100%; }
    .metric-head, .metric-row { grid-template-columns: minmax(110px, 1fr) repeat(3, 45px); }
    .metric-head span { font-size: .55rem; }
    .productivity-row { grid-template-columns: auto minmax(0, 1fr) 30px; }
    .productivity-row .metric-bar { grid-column: 2 / -1; }
    .backup-facts { grid-template-columns: 1fr; }
    .backup-list > div { grid-template-columns: auto minmax(0, 1fr); }
    .backup-list .button { grid-column: 2; justify-self: start; }
    .phone-row { grid-template-columns: 1fr; }
    .phone-row .icon-button { justify-self: start; }
    .entity-actions { grid-column: 2; justify-items: start; }
    .heading-actions, .toolbar-actions { width: 100%; align-items: stretch; }
    .heading-actions > *, .toolbar-actions > * { flex: 1 1 auto; }
    .requirement-status-form { display: grid; width: 100%; }
    .requirement-status-form select, .requirement-status-form .button { width: 100%; }
    .add-requirement-form, .requirement-actions, .document-row-actions { display: grid; width: 100%; }
    .add-requirement-form .button, .requirement-actions .button, .document-row-actions .button { width: 100%; }
    .numbered-heading { display: grid; grid-template-columns: auto 1fr; }
    .numbered-heading > .button { grid-column: 1 / -1; width: 100%; }
    .party-editor { padding: 13px; }
    .lawyer-row { grid-template-columns: 1fr; }
    .sticky-form-actions { display: grid; grid-template-columns: 1fr; }
    .sticky-form-actions .button { width: 100%; }
    .case-attention-banner { grid-template-columns: auto 1fr; }
    .case-attention-banner .button { grid-column: 1 / -1; width: 100%; }
    .case-kpi-grid { grid-template-columns: 1fr 1fr; }
    .case-kpi { padding: 12px; }
    .next-action { grid-template-columns: auto minmax(0, 1fr); }
    .action-state { grid-column: 2; }
    .panel-footer-actions, .panel-footer-actions .button { width: 100%; }
    .panel-footer-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .event-filters { grid-template-columns: 1fr; }
    .event-filters .search-field { grid-column: auto; }
    .event-badges { justify-content: flex-start; }
    .event-card-actions, .event-card-actions > details, .event-card-actions > details > summary { width: 100%; }
    .legal-control-card { grid-template-columns: 1fr; }
    .control-date, .task-check-symbol { justify-self: start; }
    .control-actions { grid-column: auto; display: grid; grid-template-columns: 1fr; width: 100%; }
    .control-actions > form, .control-actions > form > *, .control-actions > details, .control-actions > details > summary { width: 100%; }
    .control-actions > details[open] { min-width: 0; }
    .control-title { display: grid; }
    .document-card, .file-card { grid-template-columns: auto minmax(0, 1fr); }
    .document-card-side { grid-column: 2; justify-items: start; }
    .document-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr; }
    .document-actions > form, .document-actions > details, .document-actions > details > summary { width: 100%; }
    .version-list > div { grid-template-columns: 1fr auto; }
    .version-list a { grid-column: 2; }
    .crm-kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .crm-kpi-grid article { padding: 12px; }
    .finance-kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .finance-kpi { padding: 12px; }
    .finance-kpi > strong { font-size: 1.05rem; }
    .financial-control-card { grid-template-columns: 48px minmax(0, 1fr); padding: 12px; gap: 10px; }
    .financial-value, .financial-actions, .payment-history { grid-column: 2; text-align: left; justify-content: flex-start; }
    .financial-actions { display: grid; width: 100%; }
    .financial-actions details, .financial-actions summary { width: 100%; }
    .popover-form { position: static; width: 100%; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
