:root {
    color-scheme: light;
    --bg: #f5f6f8;
    --panel: #ffffff;
    --ink: #20242a;
    --muted: #68717d;
    --line: #d9dde3;
    --accent: #176b56;
    --accent-dark: #0f5140;
    --danger: #b42318;
    --warn: #9a5b00;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.contract-number-link {
    color: var(--accent);
    font-weight: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
    padding: 0 28px;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
}

.brand {
    color: var(--ink);
    font-weight: 700;
}

.topbar nav {
    display: flex;
    gap: 14px;
    align-items: center;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dc2626;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.client-type-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    align-items: center;
}

.client-type-row label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    min-height: 28px;
    font-weight: 700;
    color: #3b4652;
}

.client-type-row input[type="radio"] {
    width: 15px;
    height: 15px;
    margin: 0;
}

.client-type-fixed {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    color: #3b4652;
    font-size: 13px;
    font-weight: 800;
}

.company-requisites-button {
    min-height: 28px;
    padding: 5px 10px;
    font-size: 12px;
    line-height: 1;
}

.director-representative-toggle {
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: #3b4652;
    display: inline-flex;
    gap: 8px;
    justify-self: start;
    min-height: 32px;
    padding: 6px 10px;
    width: auto;
}

.director-representative-toggle input[type="checkbox"] {
    flex: 0 0 auto;
    height: 15px;
    margin: 0;
    width: 15px;
}

.director-representative-toggle span {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

.price-terminal-row {
    align-items: start;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.price-terminal-row > label:first-child {
    margin: 0;
    width: 100%;
}

.terminal-payment-toggle {
    align-items: center;
    align-self: flex-start;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: #344154;
    display: inline-flex;
    gap: 6px;
    min-height: 28px;
    padding: 5px 8px;
    width: auto;
}

.terminal-payment-toggle input[type="checkbox"] {
    flex: 0 0 auto;
    height: 15px;
    margin: 0;
    min-height: 15px;
    padding: 0;
    width: 15px;
}

.terminal-payment-toggle span {
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.company-fields .quick-client-grid {
    margin-top: 8px;
}

.company-fields textarea {
    min-height: 82px;
}

.company-representative-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 6px;
    border-top: 1px solid var(--line);
}

.company-representative-head strong,
.company-representative-head span {
    display: block;
}

.company-representative-head .button {
    flex: 0 0 auto;
}

.primary-link {
    font-weight: 700;
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 22px;
}

.page-head.compact {
    margin-bottom: 16px;
}

h1, h2 {
    margin: 0;
}

h1 {
    font-size: 28px;
}

h2 {
    font-size: 19px;
}

p {
    color: var(--muted);
}

.button,
button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 38px;
    padding: 0 16px;
    border: 0;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.button:hover,
button:hover {
    background: var(--accent-dark);
    text-decoration: none;
}

.button.secondary {
    background: #374151;
}

.panel,
.form-grid,
.search,
.stat {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.panel {
    padding: 18px;
}

.panel-head {
    margin-bottom: 12px;
}

.panel-head.split {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.badge-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.muted {
    color: var(--muted);
    font-size: 13px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.dashboard-head {
    align-items: center;
}

.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.dashboard-metric {
    display: grid;
    gap: 4px;
    min-height: 82px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
}

.dashboard-metric:hover {
    border-color: #b8c8c2;
    text-decoration: none;
}

.dashboard-metric span {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}

.dashboard-metric strong {
    color: var(--muted);
    font-size: 13px;
}

.dashboard-metric.metric-danger {
    border-color: #f0b4ad;
    background: #fff5f4;
}

.dashboard-metric.metric-warn {
    border-color: #f0cf8a;
    background: #fffaf0;
}

.dashboard-grid,
.dashboard-two-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr);
    gap: 16px;
    margin-bottom: 16px;
}

.dashboard-main-flow {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}

.dashboard-panel {
    margin-bottom: 16px;
}

.dashboard-grid .dashboard-panel,
.dashboard-two-columns .dashboard-panel,
.dashboard-main-flow .dashboard-panel {
    margin-bottom: 0;
}

.dashboard-urgent {
    border-color: #cfdcd7;
}

.dashboard-quick {
    align-self: start;
}

.quick-action-grid {
    display: grid;
    gap: 8px;
}

.dashboard-total-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.task-list,
.compact-list {
    display: grid;
    gap: 8px;
}

.task-row,
.compact-row {
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfd;
    color: var(--ink);
}

.task-row:hover,
.compact-row:hover {
    border-color: #b8c8c2;
    text-decoration: none;
}

.task-row span,
.compact-row span {
    color: var(--muted);
    font-size: 13px;
}

.task-badge {
    justify-self: start;
    padding: 2px 7px;
    border-radius: 999px;
    background: #eef4f1;
    color: #315447 !important;
    font-size: 11px !important;
    font-weight: 800;
}

.task-danger,
.compact-row-danger {
    border-color: #f0b4ad;
    background: #fff7f6;
}

.task-danger .task-badge {
    background: #ffe2df;
    color: var(--danger) !important;
}

.task-warn,
.compact-row-warn {
    border-color: #f0cf8a;
    background: #fffaf0;
}

.task-warn .task-badge {
    background: #ffedc2;
    color: var(--warn) !important;
}

.dashboard-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.dashboard-table th,
.dashboard-table td {
    vertical-align: middle;
}

.dashboard-subhead {
    margin: 14px 0 8px;
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

.dashboard-footnote {
    margin: 12px 0 0;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    font-size: 13px;
}

.compact-task-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.compact-task-row a {
    display: grid;
    gap: 3px;
    color: var(--ink);
}

.compact-task-row a:hover {
    text-decoration: none;
}

.compact-task-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.compact-task-actions form {
    margin: 0;
}

.stat {
    padding: 18px;
}

.stat span {
    display: block;
    color: var(--ink);
    font-size: 30px;
    font-weight: 700;
}

.stat strong {
    color: var(--muted);
    font-weight: 500;
}

table {
    width: 100%;
    border-collapse: collapse;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
}

th,
td {
    padding: 11px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.sort-heading {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    white-space: nowrap;
}

.sort-heading a {
    color: var(--muted);
    text-decoration: none;
}

.sort-heading a.active {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

tr:last-child td {
    border-bottom: 0;
}

.actions {
    display: flex;
    gap: 12px;
    align-items: center;
    white-space: nowrap;
}

.actions form {
    margin: 0;
}

.clients-table {
    table-layout: fixed;
    width: 100%;
}

.day-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
}

.day-tabs a {
    display: grid;
    gap: 2px;
    min-width: 120px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    color: var(--ink);
    font-weight: 700;
}

.day-tabs a span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.day-tabs a.active {
    border-color: #17775f;
    background: #e8f6f0;
    color: #075f4a;
}

.handover-pickup-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.logistics-column {
    min-height: 320px;
}

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

.logistics-card {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
}

.logistics-card:hover {
    border-color: #b8c8c2;
}

.logistics-card.remote-place {
    border-color: #efb1aa;
    background: #fff7f6;
}

.logistics-time {
    padding-top: 2px;
    color: #111827;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.15;
}

.logistics-main {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.logistics-main strong,
.logistics-main span {
    overflow-wrap: anywhere;
}

.logistics-main > span {
    color: var(--muted);
}

.logistics-place {
    font-weight: 700;
}

.logistics-actions {
    display: grid;
    gap: 6px;
    justify-items: stretch;
    min-width: 104px;
}

.logistics-actions form {
    margin: 0;
}

.logistics-actions .button,
.logistics-actions button {
    width: 100%;
    min-width: 0;
    white-space: nowrap;
}

.logistics-completed-panel {
    margin-top: 16px;
}

.logistics-completed-list {
    display: grid;
    gap: 8px;
}

.danger-text {
    color: #b42318 !important;
}

.client-type-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 12px;
}

.client-type-tab {
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--muted);
    font-weight: 800;
    padding: 8px 12px;
    text-decoration: none;
}

.client-type-tab.active {
    background: #e8f4ef;
    border-color: var(--accent);
    color: var(--accent-dark);
}

.clients-table th:nth-child(1),
.clients-table td:nth-child(1) {
    width: 40%;
}

.clients-table th:nth-child(2),
.clients-table td:nth-child(2) {
    width: 22%;
}

.clients-table th:nth-child(3),
.clients-table td:nth-child(3) {
    width: 15%;
}

.clients-table th:nth-child(4),
.clients-table td:nth-child(4) {
    width: 23%;
}

.clients-table td {
    vertical-align: top;
    padding-top: 12px;
    padding-bottom: 12px;
}

.client-name-cell strong {
    display: block;
    line-height: 1.18;
    overflow-wrap: anywhere;
    max-width: 100%;
}

.client-document-cell {
    line-height: 1.2;
}

.client-document-cell .document-kind {
    color: var(--muted);
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.client-document-cell strong {
    display: block;
    font-size: 13px;
    white-space: nowrap;
}

.client-actions {
    align-items: flex-start;
    justify-content: flex-start;
    gap: 10px;
    white-space: nowrap;
}

.client-actions-cell {
    vertical-align: top;
}

.client-contact-cell {
    line-height: 1.35;
    vertical-align: top;
}

.client-phone {
    display: inline-block;
    min-width: 130px;
}

.phone-nowrap {
    white-space: nowrap;
}

.client-contact-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.link {
    min-height: 0;
    padding: 0;
    background: transparent;
    color: var(--accent);
    font-weight: 400;
}

.link:hover {
    background: transparent;
    text-decoration: underline;
}

.danger {
    color: var(--danger);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    width: fit-content;
    max-width: max-content;
    padding: 3px 9px;
    border-radius: 6px;
    background: #eef2f7;
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.badge.ok {
    background: #e8f5ef;
    color: var(--accent-dark);
}

.badge.active,
.badge.paid {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.badge.fssp-badge {
    min-height: 20px;
    padding: 2px 8px;
    border-radius: 5px;
    background: #e9fbf0;
    border-color: #72e4a2;
    line-height: 1.1;
}

.badge.closed {
    background: #e0f2fe;
    color: #075985;
    border: 1px solid #7dd3fc;
}

.badge.neutral {
    background: #eef2f7;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.badge.warn {
    background: #fff3d6;
    color: var(--warn);
    border: 1px solid #f5c56b;
}

.badge.extension-wait-badge {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fdba74;
}

.badge.prepayment-unpaid {
    background: #fde8e7;
    color: var(--danger);
    border: 1px solid #f5a6a0;
}

.badge.repair {
    background: #fee4e2;
    color: #b42318;
    border: 1px solid #fda29b;
}

.badge.service {
    background: #fef0c7;
    color: #93370d;
    border: 1px solid #fedf89;
}

.badge.blocked {
    background: #f2f4f7;
    color: #344054;
    border: 1px solid #d0d5dd;
}

.badge.danger-badge,
.danger-badge {
    background: #fde8e7;
    color: var(--danger);
    border: 1px solid #f5a6a0;
}

.fine-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.fine-limit {
    margin-bottom: 16px;
}

.car-status-cell {
    text-align: center;
    vertical-align: middle;
}

.car-status-cell .badge {
    margin: 0 auto;
}

.car-status-cell .muted {
    display: inline-block;
    margin-top: 4px;
}

.active-return-date {
    display: inline-block;
    margin-top: 2px;
    color: #7a3a00;
    font-weight: 800;
    font-size: 11px;
    line-height: 1.15;
    white-space: nowrap;
}

.car-status-summary {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.car-status-summary div {
    display: grid;
    gap: 4px;
    min-height: 62px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.car-status-summary span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.car-status-summary strong {
    color: var(--ink);
    font-size: 24px;
    line-height: 1;
}

.oil-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.oil-summary div {
    display: grid;
    gap: 4px;
    min-height: 62px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.oil-summary span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.oil-summary strong {
    color: var(--ink);
    font-size: 24px;
    line-height: 1;
}

.oil-summary .oil-soon {
    border-color: #f7c566;
    background: #fff8e6;
}

.oil-summary .oil-overdue {
    border-color: #f2a7a0;
    background: #fff1f0;
}

.oil-rules {
    display: flex;
    gap: 8px;
    align-items: center;
}

.oil-table td {
    vertical-align: top;
}

.oil-row-soon {
    background: #fffaf0;
}

.oil-row-overdue {
    background: #fff5f5;
}

.oil-row-check {
    background: #f8f5ff;
}

.oil-update-open {
    min-height: 34px;
    padding: 0 14px;
    white-space: nowrap;
}

.modal-card.oil-update-modal-card {
    width: min(420px, 100%);
}

.modal-card.oil-update-modal-card h3 {
    margin: 0;
    font-size: 18px;
}

.oil-update-form {
    display: grid;
    gap: 10px;
}

.oil-update-form label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.oil-update-form input {
    min-height: 38px;
    padding: 0 10px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
}

.oil-km-since {
    white-space: nowrap;
}

.sort-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
}

.sort-link:hover {
    color: var(--accent);
    text-decoration: none;
}

.sort-link.active {
    color: var(--accent);
}

tr.contract-row-today td {
    background: #fff7df;
}

tr.contract-row-overdue td {
    background: #fff1f0;
}

tr.contract-row-extension-wait td {
    background: #fff7ed;
}

tr.contract-row-return-place td {
    background: #fff9e8;
}

tr.reservation-attention td {
    background: #fffaf0;
}

.reservation-topline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}

.compact-note {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    padding: 6px 10px;
}

.reservation-contract-note {
    margin-bottom: 16px;
    border-color: #f5c56b;
    background: #fffaf0;
}

.reservation-contract-note p {
    margin: 8px 0 0;
}

.reservation-handover-line {
    display: grid;
    grid-template-columns: minmax(150px, 0.8fr) minmax(135px, 0.6fr) minmax(320px, 1.8fr);
    gap: 14px;
    align-items: start;
}

.reservation-side-panel,
.reservation-cancel-panel {
    margin-top: 16px;
}

.reservation-candidates {
    display: grid;
    gap: 8px;
}

.client-reservations-panel,
.client-contracts-panel {
    margin-bottom: 16px;
}

.client-reservations-list {
    display: grid;
    gap: 8px;
}

.client-reservation-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.client-reservation-row:last-child {
    border-bottom: 0;
}

.client-reservation-row strong,
.client-reservation-row span {
    display: block;
}

.candidate-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.candidate-row:last-child {
    border-bottom: 0;
}

.candidate-row strong,
.candidate-row span {
    display: block;
}

.reservations-table {
    table-layout: fixed;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.reservations-table th,
.reservations-table td {
    vertical-align: top;
}

.reservations-table th {
    padding: 12px 10px 10px;
}

.reservations-table td {
    padding: 12px 10px;
    line-height: 1.25;
}

.reservations-table td {
    overflow-wrap: break-word;
}

.reservation-col-issue {
    width: 11%;
}

.reservation-col-client {
    width: 24%;
}

.reservation-col-car {
    width: 18%;
}

.reservation-col-place {
    width: 15%;
}

.reservation-col-prepay {
    width: 10%;
}

.reservation-col-status {
    width: 14.5%;
}

.reservation-col-action {
    width: 7.5%;
}

.reservation-status-cell .badge {
    max-width: 100%;
    white-space: nowrap;
}

.reservation-status-stack {
    display: flex;
    align-items: center;
    min-height: 24px;
}

.reservation-action-note {
    margin-top: 7px;
    display: inline-flex;
    max-width: 100%;
    border: 1px solid #f3c66a;
    border-radius: 6px;
    background: #fff7dc;
    color: #875100;
    padding: 3px 6px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.22;
}

.reservation-contract-link {
    margin-top: 6px;
    font-size: 12px;
}

.reservation-action-cell {
    padding-left: 8px !important;
    padding-right: 8px !important;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle !important;
}

.reservation-action-cell form {
    display: inline-flex;
    margin: 0 6px 0 0;
}

.reservation-action-cell .button.small {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    width: 70px;
    padding-left: 0;
    padding-right: 0;
    white-space: nowrap;
}

.reservation-topline .inline-form {
    min-width: 0;
}

.reservation-client-cell strong {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
    white-space: nowrap;
}

.reservation-client-cell .muted,
.reservation-car-cell .muted,
.reservation-place-cell .muted,
.reservation-prepay-cell .badge {
    display: block;
    margin-top: 4px;
}

.reservation-car-cell strong,
.reservation-place-cell strong,
.reservation-prepay-cell strong {
    display: block;
}

.reservation-issue-cell strong {
    display: block;
    white-space: nowrap;
}

.reservation-issue-cell span {
    display: block;
    margin-top: 7px;
    text-align: left;
}

.task-create-panel {
    margin-bottom: 16px;
}

.task-create-form {
    display: grid;
    grid-template-columns: minmax(260px, 1.6fr) minmax(180px, 1fr) 145px 105px 135px;
    gap: 12px;
    align-items: end;
}

.task-create-form .task-note-field {
    grid-column: 1 / -2;
}

.task-create-form button {
    align-self: end;
}

.task-list-panel {
    margin-top: 16px;
}

.manager-task-list {
    display: grid;
    gap: 10px;
}

.manager-task {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 360px);
    gap: 12px;
    align-items: start;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.manager-task-overdue {
    border-color: #f0b4ad;
    background: #fff7f6;
}

.manager-task-today,
.manager-task-important {
    border-color: #f0cf8a;
    background: #fffaf0;
}

.manager-task-done {
    background: #f7faf9;
}

.manager-task-main {
    display: grid;
    gap: 6px;
}

.manager-task-head,
.manager-task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
}

.manager-task h2 {
    font-size: 18px;
}

.manager-task p {
    margin: 0;
}

.manager-task-meta {
    color: var(--muted);
    font-size: 13px;
}

.manager-task-actions {
    display: grid;
    justify-items: end;
    gap: 8px;
}

.manager-task-actions form {
    margin: 0;
}

.monthly-report-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    margin-bottom: 16px;
}

.monthly-report-page {
    width: calc(100vw - 28px);
    margin-left: calc(50% - 50vw + 14px);
}

.monthly-report-page .page-head {
    margin-bottom: 14px;
}

.monthly-report-toolbar .inline-form {
    min-width: 0;
}

.monthly-report-toolbar input {
    width: 90px;
}

.monthly-report-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
}

.monthly-selection-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    font-size: 13px;
    font-weight: 800;
}

.monthly-selection-summary span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 3px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.monthly-report-legend span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.legend-paid {
    background: #fff500;
}

.legend-reserved,
.legend-problem {
    background: #ff3838;
    color: #fff;
}

.legend-cashless {
    background: #10a8e8;
    color: #06233a;
}

.monthly-report-panel {
    padding: 0;
    margin-bottom: 140px;
}

.monthly-report-scroll {
    max-height: calc(100vh - 185px);
    overflow: auto;
}

.monthly-report-table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 10px;
}

.monthly-report-table th,
.monthly-report-table td {
    min-width: 48px;
    max-width: 48px;
    height: 18px;
    padding: 1px 2px;
    border-right: 1px solid #68717d;
    border-bottom: 1px solid #68717d;
    text-align: center;
    vertical-align: middle;
    line-height: 1.05;
    user-select: none;
}

.monthly-report-table thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #10b25b;
    color: #062a19;
    height: 44px;
    font-size: 9px;
    line-height: 1.05;
    white-space: normal;
    cursor: pointer;
}

.monthly-report-table thead th span {
    color: inherit;
    font-weight: 800;
}

.monthly-report-table .month-day-col {
    position: sticky;
    left: 0;
    z-index: 5;
    width: 34px;
    min-width: 34px;
    max-width: 34px;
    background: #a7d96b;
    color: #143200;
    font-weight: 800;
    cursor: pointer;
}

.monthly-report-table thead .month-day-col {
    z-index: 6;
}

.monthly-summary-row th,
.monthly-summary-row td {
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
}

.monthly-summary-total th,
.monthly-summary-total td,
.monthly-summary-company th,
.monthly-summary-company td {
    background: #e5b1aa;
}

.monthly-summary-investor th,
.monthly-summary-investor td {
    background: #f2f2f2;
}

.month-cell {
    text-align: center;
    vertical-align: middle;
    background: #fff;
    color: #101820;
    font-weight: 700;
    cursor: pointer;
}

.monthly-report-table td.month-cell-selected {
    outline: 2px solid #111827;
    outline-offset: -2px;
    box-shadow: inset 0 0 0 999px rgba(17, 24, 39, 0.16);
}

.monthly-report-table tr.month-row-selected > th,
.monthly-report-table tr.month-row-selected > td {
    box-shadow: inset 0 0 0 999px rgba(17, 24, 39, 0.12);
}

.monthly-report-table tr.month-row-selected > .month-day-col {
    outline: 2px solid #111827;
    outline-offset: -2px;
}

.month-cell-paid {
    background: #fff500;
}

.month-cell-reserved,
.month-cell-problem {
    background: #ff3838;
    color: #fff;
}

.month-cell-cashless {
    background: #10a8e8;
}

.monthly-report-table .month-grand-col,
.monthly-report-table .month-grand-empty,
.monthly-report-table .month-grand-total {
    min-width: 58px;
    max-width: 58px;
    background: #f8fafc;
    font-weight: 800;
}

.monthly-report-table .month-grand-col {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #e5e7eb;
    color: #111827;
}

.monthly-report-table .month-grand-total {
    background: #f2f2f2;
}

.vehicle-expense-entry {
    margin-bottom: 16px;
}

.vehicle-expense-form {
    display: grid;
    grid-template-columns: 150px 190px minmax(300px, 2fr) 130px auto;
    gap: 10px;
    align-items: end;
}

.organization-expense-form {
    display: grid;
    grid-template-columns: 150px minmax(340px, 1fr) 130px auto;
    gap: 10px;
    align-items: end;
}

.vehicle-expense-form label,
.organization-expense-form label {
    display: grid;
    gap: 6px;
    color: #506071;
    font-size: 13px;
    font-weight: 700;
}

.vehicle-expense-form input,
.vehicle-expense-form select,
.organization-expense-form input,
.vehicle-car-picker-toggle {
    width: 100%;
    min-height: 38px;
    border: 1px solid #ccd3dc;
    border-radius: 6px;
    padding: 0 10px;
    font: inherit;
}

.vehicle-car-picker {
    position: relative;
}

.vehicle-car-picker-toggle {
    justify-content: space-between;
    background: #fff;
    color: var(--ink);
    font-weight: 700;
    text-align: left;
}

.vehicle-car-picker-toggle:hover,
.vehicle-car-picker.open .vehicle-car-picker-toggle {
    border-color: var(--accent);
    background: #fff;
    color: var(--ink);
}

.vehicle-car-picker-toggle::after {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 2px solid #6b7280;
    border-bottom: 2px solid #6b7280;
    transform: rotate(45deg);
    margin-left: 10px;
}

.vehicle-car-picker-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 30;
    width: min(315px, 90vw);
    max-height: 270px;
    overflow: hidden;
    border: 1px solid #9aa4b2;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 16px 36px rgba(17, 24, 39, 0.18);
}

.vehicle-car-picker-search {
    min-height: 34px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    padding: 0 9px;
    font-size: 13px;
    font-weight: 700;
}

.vehicle-car-picker-options {
    max-height: 228px;
    overflow-y: auto;
    padding: 3px;
}

.vehicle-car-picker-option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(104px, auto);
    gap: 6px;
    width: 100%;
    min-height: 22px;
    padding: 2px 7px;
    border-radius: 4px;
    background: #fff;
    color: var(--ink);
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.1;
}

.vehicle-car-picker-option[hidden] {
    display: none;
}

.vehicle-car-picker-option:hover,
.vehicle-car-picker-option:focus {
    background: #edf7f3;
    color: var(--ink);
}

.vehicle-car-picker-option strong {
    white-space: nowrap;
    color: #374151;
    font-size: 11px;
    text-align: right;
}

.vehicle-expense-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.vehicle-expense-cars {
    display: grid;
    gap: 8px;
}

.vehicle-expense-car {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
}

.vehicle-expense-car:hover,
.vehicle-expense-car.active {
    border-color: var(--accent);
    background: #edf7f3;
    text-decoration: none;
}

.vehicle-expense-car span {
    min-width: 0;
    font-weight: 700;
}

.vehicle-expense-car small {
    color: var(--muted);
}

.vehicle-expense-car strong {
    white-space: nowrap;
}

.vehicle-expense-journal .inline-form {
    justify-content: flex-end;
}

.vehicle-expense-journal .inline-form input[name="month"],
.vehicle-expense-journal .inline-form input[name="year"] {
    width: 80px;
}

.investor-report-page {
    width: calc(100vw - 28px);
    margin-left: calc(50% - 50vw + 14px);
}

.investor-layout {
    display: grid;
    width: calc(100vw - 28px);
    margin-left: calc(50% - 50vw + 14px);
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.investor-sidebar {
    display: grid;
    gap: 14px;
}

.investor-create-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.investor-create-form input {
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
}

.investor-list,
.investor-car-checkboxes {
    display: grid;
    gap: 6px;
}

.investor-link {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    padding: 0;
    color: var(--ink);
    font-weight: 700;
    flex: 1;
}

.investor-list-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 8px 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.investor-sort-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 8px 0 10px;
}

.investor-sort-form {
    display: none;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.investor-sort-form.active {
    display: flex;
}

.investor-drag-handle {
    display: none;
    width: 18px;
    color: var(--muted);
    cursor: grab;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
    text-align: center;
}

.investor-list.sorting .investor-list-row {
    cursor: grab;
}

.investor-list.sorting .investor-list-row:active {
    cursor: grabbing;
}

.investor-list.sorting .investor-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.investor-list-row.dragging {
    opacity: 0.55;
    border-style: dashed;
    background: #f7fbf9;
}

.investor-list-row:hover,
.investor-list-row.active {
    border-color: var(--accent);
    background: #edf7f3;
}

.investor-link:hover {
    text-decoration: none;
}

.investor-cars-form {
    display: grid;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.investor-car-checkboxes {
    max-height: 360px;
    overflow-y: auto;
    padding-right: 4px;
}

.investor-car-editor {
    margin-top: 10px;
}

.investor-car-editor > summary {
    display: inline-flex;
    width: fit-content;
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.investor-car-editor > summary::-webkit-details-marker {
    display: none;
}

.investor-car-editor[open] > summary {
    margin-bottom: 10px;
}

.investor-car-editor[open] .investor-car-checkboxes {
    padding: 10px 6px 10px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.investor-car-editor[open] .button[type="submit"] {
    margin-top: 10px;
    width: 100%;
}

.investor-car-checkboxes label {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 7px;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
}

.investor-report-wrap {
    min-width: 0;
}

.investor-print-head {
    margin-bottom: 10px;
}

.investor-print-head h1 {
    font-size: 22px;
}

.investor-print-head p {
    margin: 4px 0 0;
}

.investor-report-grid {
    display: grid;
    grid-template-columns: max-content minmax(360px, 1fr);
    gap: 18px;
    align-items: start;
    overflow-x: visible;
}

.investor-month-table,
.investor-expense-tile table {
    width: auto;
    table-layout: fixed;
    border-collapse: collapse;
    background: #fff;
    font-size: 11px;
    line-height: 1;
}

.investor-month-table th,
.investor-month-table td,
.investor-expense-tile th,
.investor-expense-tile td {
    width: 52px;
    min-width: 52px;
    max-width: 52px;
    height: 17px;
    padding: 2px 4px;
    border: 1px solid #000;
    color: #000;
    text-align: right;
    vertical-align: middle;
}

.investor-month-table {
    font-variant-numeric: tabular-nums;
}

.investor-month-table th,
.investor-month-table td {
    box-sizing: border-box;
    overflow: hidden;
    white-space: nowrap;
    line-height: 1;
}

.investor-month-table thead th {
    height: 30px;
    padding: 1px 2px;
    font-size: 9.5px;
    line-height: 1.05;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
}

.investor-month-table tbody th {
    width: 46px;
    min-width: 46px;
    max-width: 46px;
    padding: 1px 2px;
    text-align: center;
    font-weight: 800;
}

.investor-month-table tbody td {
    padding: 1px 3px;
    text-align: right;
    font-size: 10px;
}

.investor-month-table .investor-summary-total th,
.investor-month-table .investor-summary-company th,
.investor-month-table .investor-summary-investor th {
    font-size: 10px;
}

.investor-month-table th {
    background: #00b050;
    text-align: center;
}

.investor-month-table tbody th {
    background: #92d050;
}

.investor-month-table td {
    background: #fff500;
}

.investor-summary-total th,
.investor-summary-total td,
.investor-summary-company th,
.investor-summary-company td {
    background: #e5b1aa;
}

.investor-summary-investor th,
.investor-summary-investor td {
    background: #fff;
}

.investor-month-table tbody tr:last-child th,
.investor-month-table tbody tr:last-child td {
    border-bottom: 1px solid #000 !important;
}

.investor-expense-tiles {
    display: grid;
    grid-template-columns: repeat(3, 172px);
    gap: 10px;
    align-items: start;
}

.investor-expense-tile {
    width: 172px;
    break-inside: avoid;
}

.investor-expense-tile h2 {
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding: 3px 6px;
    border: 1px solid #000;
    border-bottom: 0;
    background: #fff;
    color: #000;
    font-size: 10px;
    text-align: center;
}

.investor-expense-tile table {
    width: 100%;
}

.investor-expense-tile th {
    background: #d9ead3;
    text-align: center;
}

.investor-expense-tile th:first-child,
.investor-expense-tile td:first-child {
    width: 112px;
    min-width: 112px;
    max-width: 112px;
    text-align: left;
}

.investor-expense-tile th:last-child,
.investor-expense-tile td:last-child {
    width: 52px;
    min-width: 52px;
    max-width: 52px;
}

.investor-expense-total td {
    background: #fff500;
    font-weight: 800;
}

.investor-expense-tile tbody tr:last-child td {
    border-bottom: 1px solid #000 !important;
}

.investor-no-expenses td {
    text-align: center !important;
    font-weight: 900;
    letter-spacing: 0;
}

.investor-overage-summary {
    width: 536px;
    max-width: 100%;
    margin-top: 12px;
    break-inside: avoid;
}

.investor-overage-summary h2 {
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding: 4px 8px;
    border: 1px solid #000;
    border-bottom: 0;
    background: #00b050;
    color: #000;
    font-size: 12px;
    text-align: center;
}

.investor-overage-summary table {
    width: 100%;
    border: 1px solid #000;
    border-collapse: collapse;
    table-layout: fixed;
    background: #fff;
    font-size: 12px;
}

.investor-overage-summary th,
.investor-overage-summary td {
    height: 20px;
    padding: 3px 6px;
    border: 1px solid #000;
    color: #000;
    vertical-align: middle;
}

.investor-overage-summary th {
    background: #d9ead3;
}

.investor-overage-summary th:first-child,
.investor-overage-summary td:first-child {
    width: 150px;
}

.investor-overage-summary th:last-child,
.investor-overage-summary td:last-child {
    width: 80px;
    text-align: right;
    font-weight: 800;
}

.investor-overage-total th,
.investor-overage-total td {
    background: #e5b1aa;
    font-weight: 900;
}

.investor-overage-summary tbody tr:last-child th,
.investor-overage-summary tbody tr:last-child td {
    border-bottom: 1px solid #000;
}

.investor-payout {
    display: flex;
    gap: 18px;
    align-items: center;
    margin-top: 14px;
    font-weight: 800;
}

.investor-payout-bottom {
    width: max-content;
    max-width: 100%;
    white-space: nowrap;
}

.organization-investor-summary {
    display: grid;
    grid-template-columns: repeat(2, 320px);
    gap: 14px;
    align-items: start;
    margin-top: 14px;
    width: max-content;
    max-width: 100%;
}

.organization-investor-summary .organization-investor-card:nth-child(3) {
    grid-column: 1;
}

.organization-investor-card h2 {
    margin: 0;
    padding: 6px 8px;
    border: 1px solid #000;
    border-bottom: 0;
    background: #00b050;
    color: #000;
    font-size: 12px;
    text-align: center;
}

.organization-investor-card table {
    width: 100%;
    border: 1px solid #000;
    border-collapse: collapse;
    table-layout: fixed;
    background: #fff;
    font-size: 12px;
}

.organization-investor-card th,
.organization-investor-card td {
    height: 20px;
    padding: 3px 6px;
    border: 1px solid #000;
    color: #000;
    vertical-align: middle;
}

.organization-investor-card th {
    background: #d9ead3;
    text-align: left;
}

.organization-investor-title th {
    width: auto;
    background: #00b050;
    text-align: center;
    font-weight: 900;
    border: 1px solid #000;
    box-sizing: border-box;
}

.organization-investor-card td {
    width: 90px;
    background: #fff500;
    text-align: right;
    font-weight: 800;
}

.organization-investor-total th,
.organization-investor-total td {
    background: #e5b1aa;
    font-weight: 900;
}

.organization-investor-card tr:last-child th,
.organization-investor-card tr:last-child td {
    border-bottom: 1px solid #000;
}

.investor-payout strong {
    font-size: 20px;
}

.investor-print-preview {
    width: 100%;
    margin: 0;
}

.investor-print-preview .no-print {
    display: none !important;
}

.investor-print-preview + .investor-layout,
.investor-print-preview .investor-layout {
    width: 100%;
    margin: 0;
}

.investor-print-preview-sheet {
    width: 1122px;
    min-height: 793px;
    margin: 0 auto;
    padding: 26px;
    background: #fff;
    box-shadow: 0 2px 14px rgba(17, 24, 39, 0.22);
    overflow: visible;
}

.investor-print-preview-sheet .investor-report-grid {
    grid-template-columns: max-content 1fr;
    gap: 12px;
    width: 100%;
    overflow: visible !important;
}

.investor-print-preview-sheet .investor-month-table,
.investor-print-preview-sheet .investor-expense-tile table {
    table-layout: fixed;
    font-size: 11px;
}

.investor-print-preview-sheet .investor-month-table th,
.investor-print-preview-sheet .investor-month-table td,
.investor-print-preview-sheet .investor-expense-tile th,
.investor-print-preview-sheet .investor-expense-tile td {
    width: 52px;
    min-width: 52px;
    max-width: 52px;
    height: 17px;
    padding: 1px 2px;
    overflow: hidden;
}

.investor-print-preview-sheet .investor-expense-tiles {
    grid-template-columns: repeat(3, 160px);
    gap: 10px;
    overflow: visible !important;
}

.investor-print-preview-sheet .investor-expense-tile,
.investor-print-preview-sheet .investor-expenses-side {
    overflow: visible !important;
}

.investor-print-preview-sheet .investor-expense-tile {
    width: 160px;
}

.investor-print-preview-sheet .investor-expense-tile h2 {
    padding: 3px 6px;
    font-size: 10px;
}

.investor-print-preview-sheet .investor-expense-tile td:first-child,
.investor-print-preview-sheet .investor-expense-tile th:first-child {
    width: 104px;
    min-width: 104px;
    max-width: 104px;
}

.investor-print-preview-sheet .investor-expense-tile td:last-child,
.investor-print-preview-sheet .investor-expense-tile th:last-child {
    width: 48px;
    min-width: 48px;
    max-width: 48px;
}

.investor-print-preview-sheet .investor-month-table th,
.investor-print-preview-sheet .investor-month-table td {
    box-sizing: border-box;
    white-space: nowrap;
    line-height: 1;
}

.investor-print-preview-sheet .investor-month-table thead th {
    height: 30px;
    padding: 1px 2px;
    line-height: 1.05;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
}

.investor-print-preview-sheet .investor-month-table tbody th {
    width: 46px;
    min-width: 46px;
    max-width: 46px;
    padding: 1px 2px;
    text-align: center;
}

.investor-print-preview-sheet .investor-month-table tbody td {
    padding: 1px 3px;
    text-align: right;
}

.investor-print-preview-sheet .investor-print-head {
    margin-bottom: 10px;
}

.investor-print-preview-sheet .investor-print-head h1 {
    font-size: 18px;
}

.investor-print-preview-sheet .investor-payout {
    margin-top: 8px;
    font-size: 12px;
}

.investor-print-preview-sheet .investor-payout strong {
    font-size: 16px;
}

.investor-print-preview-sheet .organization-investor-summary {
    grid-template-columns: repeat(2, 260px);
    gap: 14px;
    width: max-content;
    max-width: 100%;
    break-inside: avoid;
}

.investor-print-preview-sheet .organization-investor-card {
    width: 260px;
    break-inside: avoid;
}

.investor-print-preview-sheet .organization-investor-card h2 {
    box-sizing: border-box;
    width: 100%;
    font-size: 10px;
}

.investor-print-preview-sheet .organization-investor-card table {
    width: 100%;
    table-layout: fixed;
}

.investor-print-preview-sheet .organization-investor-card th,
.investor-print-preview-sheet .organization-investor-card td {
    height: 18px;
    padding: 2px 6px;
    border: 1px solid #000;
    box-sizing: border-box;
}

.investor-print-preview-sheet .organization-investor-title th {
    width: auto;
    background: #00b050;
    text-align: center;
    font-weight: 900;
    border: 1px solid #000;
    box-sizing: border-box;
}

.investor-print-preview-sheet .organization-investor-card tr:last-child th,
.investor-print-preview-sheet .organization-investor-card tr:last-child td {
    border-bottom: 1px solid #000 !important;
}

@page investorPortrait {
    size: A4 portrait;
    margin: 8mm;
}

@page investorLandscape {
    size: A4 landscape;
    margin: 7mm;
}

@media print {
    body {
        background: #fff;
    }

    .topbar,
    .no-print,
    .messages {
        display: none !important;
    }

    .container {
        max-width: none;
        padding: 0;
    }

    .investor-report-page,
    .investor-layout {
        width: 100%;
        margin: 0;
    }

    .investor-report-wrap {
        page: investorPortrait;
        width: 100%;
        overflow: visible;
    }

    .investor-report-wrap.investor-print-landscape {
        page: investorLandscape;
    }

    .investor-report-grid {
        display: grid;
        grid-template-columns: max-content 1fr;
        gap: 4mm;
        width: 100%;
        overflow: visible !important;
    }

    .investor-print-many .investor-report-grid {
        grid-template-columns: max-content 1fr;
        gap: 3mm;
    }

    .investor-print-head {
        margin-bottom: 4mm;
    }

    .investor-print-head h1 {
        font-size: 14pt;
    }

    .investor-print-head p {
        font-size: 9pt;
    }

    .investor-month-table,
    .investor-expense-tile table {
        display: table;
        table-layout: fixed;
        width: auto;
        max-width: none;
        overflow: visible !important;
        break-inside: avoid;
        font-size: 7pt;
    }

    .investor-expenses-side {
        width: 100%;
        min-width: 0;
        overflow: visible !important;
    }

    .investor-expense-tiles {
        display: grid;
        grid-template-columns: repeat(3, 30mm);
        gap: 1.5mm;
        width: 100%;
        overflow: visible !important;
    }

    .investor-expense-tile {
        width: 172px;
        min-width: 0;
        overflow: visible !important;
        break-inside: avoid;
    }

    .investor-month-table th,
    .investor-month-table td,
    .investor-expense-tile th,
    .investor-expense-tile td {
        width: 8mm;
        min-width: 8mm;
        max-width: 8mm;
        height: 4mm;
        padding: 0.5mm 1mm;
        overflow: hidden;
    }

    .investor-expense-tile h2 {
        padding: 0.5mm 1mm;
        font-size: 7pt;
    }

    .investor-print-many .investor-month-table,
    .investor-print-many .investor-expense-tile table {
        font-size: 5.5pt;
    }

    .investor-print-many .investor-month-table th,
    .investor-print-many .investor-month-table td {
        min-width: 5.7mm;
        max-width: 5.7mm;
        height: 3.4mm;
        padding: 0.25mm 0.45mm;
        line-height: 1;
        box-sizing: border-box;
        overflow: hidden;
    }

    .investor-print-many .investor-month-table thead th {
        height: 6.2mm;
        line-height: 1.05;
        white-space: normal;
        overflow-wrap: normal;
        word-break: normal;
    }

    .investor-print-many .investor-month-table tbody th {
        text-align: center;
        font-weight: 800;
    }

    .investor-print-many .investor-month-table tbody td {
        text-align: right;
    }

    .investor-expense-tile td:first-child {
        width: 20mm;
        min-width: 20mm;
        max-width: 20mm;
    }

    .investor-expense-tile td:last-child {
        width: 10mm;
        min-width: 10mm;
        max-width: 10mm;
    }

    .investor-print-many .investor-expense-tile th,
    .investor-print-many .investor-expense-tile td {
        height: 3.15mm;
        padding: 0.25mm 0.45mm;
    }

    .investor-print-many .investor-expense-tiles {
        grid-template-columns: repeat(3, 25mm);
        gap: 1mm;
    }

    .investor-print-many .investor-expense-tile td:first-child,
    .investor-print-many .investor-expense-tile th:first-child {
        width: 17mm;
        min-width: 17mm;
        max-width: 17mm;
    }

    .investor-print-many .investor-expense-tile td:last-child,
    .investor-print-many .investor-expense-tile th:last-child {
        width: 8mm;
        min-width: 8mm;
        max-width: 8mm;
    }

    .investor-print-many .investor-expense-tile h2 {
        padding: 0.35mm 0.6mm;
        font-size: 5.5pt;
    }

    .investor-payout {
        margin-top: 2mm;
        font-size: 8pt;
    }

    .investor-payout strong {
        font-size: 11pt;
    }

    .investor-report-grid,
    .investor-print-many .investor-report-grid {
        grid-template-columns: max-content 1fr;
        gap: 10px;
    }

    .investor-month-table,
    .investor-expense-tile table,
    .investor-print-many .investor-month-table,
    .investor-print-many .investor-expense-tile table {
        font-size: 11px;
        line-height: 1;
    }

    .investor-month-table th,
    .investor-month-table td,
    .investor-print-many .investor-month-table th,
    .investor-print-many .investor-month-table td {
        width: 52px;
        min-width: 52px;
        max-width: 52px;
        height: 17px;
        padding: 1px 3px;
        box-sizing: border-box;
    }

    .investor-month-table thead th,
    .investor-print-many .investor-month-table thead th {
        height: 30px;
        padding: 1px 2px;
        font-size: 9.5px;
        line-height: 1.05;
        white-space: normal;
    }

    .investor-month-table tbody th,
    .investor-print-many .investor-month-table tbody th {
        width: 46px;
        min-width: 46px;
        max-width: 46px;
        text-align: center;
    }

    .investor-month-table tbody td,
    .investor-print-many .investor-month-table tbody td {
        text-align: right;
    }

    .investor-expense-tiles,
    .investor-print-many .investor-expense-tiles {
        grid-template-columns: repeat(3, 160px);
        gap: 10px;
    }

    .investor-expense-tile,
    .investor-print-many .investor-expense-tile {
        width: 160px;
    }

    .investor-expense-tile h2,
    .investor-print-many .investor-expense-tile h2 {
        padding: 3px 6px;
        font-size: 10px;
    }

    .investor-overage-summary,
    .investor-print-many .investor-overage-summary {
        width: 500px;
        max-width: 500px;
        margin-top: 10px;
        overflow: visible !important;
        break-inside: avoid !important;
    }

    .investor-overage-summary h2,
    .investor-print-many .investor-overage-summary h2 {
        box-sizing: border-box !important;
        width: 100% !important;
        padding: 3px 6px !important;
        font-size: 10px !important;
        line-height: 1 !important;
    }

    .investor-overage-summary table,
    .investor-print-many .investor-overage-summary table {
        width: 100% !important;
        table-layout: fixed !important;
        border-collapse: collapse !important;
        font-size: 11px !important;
        line-height: 1 !important;
    }

    .investor-overage-summary th,
    .investor-overage-summary td,
    .investor-print-many .investor-overage-summary th,
    .investor-print-many .investor-overage-summary td {
        height: 17px !important;
        padding: 1px 3px !important;
        border: 1px solid #000 !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        white-space: nowrap !important;
    }

    .investor-overage-summary th:first-child,
    .investor-overage-summary td:first-child,
    .investor-print-many .investor-overage-summary th:first-child,
    .investor-print-many .investor-overage-summary td:first-child {
        width: 130px !important;
        min-width: 130px !important;
        max-width: 130px !important;
    }

    .investor-overage-summary th:nth-child(2),
    .investor-overage-summary td:nth-child(2),
    .investor-print-many .investor-overage-summary th:nth-child(2),
    .investor-print-many .investor-overage-summary td:nth-child(2) {
        width: 270px !important;
        min-width: 270px !important;
        max-width: 270px !important;
    }

    .investor-overage-summary th:last-child,
    .investor-overage-summary td:last-child,
    .investor-print-many .investor-overage-summary th:last-child,
    .investor-print-many .investor-overage-summary td:last-child {
        width: 70px !important;
        min-width: 70px !important;
        max-width: 70px !important;
        text-align: right !important;
    }

    .investor-expense-tile th,
    .investor-expense-tile td,
    .investor-print-many .investor-expense-tile th,
    .investor-print-many .investor-expense-tile td {
        height: 17px;
        padding: 1px 3px;
        font-size: 11px;
        box-sizing: border-box;
    }

    .investor-expense-tile td:first-child,
    .investor-expense-tile th:first-child,
    .investor-print-many .investor-expense-tile td:first-child,
    .investor-print-many .investor-expense-tile th:first-child {
        width: 104px;
        min-width: 104px;
        max-width: 104px;
    }

    .investor-expense-tile td:last-child,
    .investor-expense-tile th:last-child,
    .investor-print-many .investor-expense-tile td:last-child,
    .investor-print-many .investor-expense-tile th:last-child {
        width: 48px;
        min-width: 48px;
        max-width: 48px;
    }

    .investor-payout {
        margin-top: 14px;
        font-size: 14px;
    }

    .investor-payout strong {
        font-size: 20px;
    }

    .organization-investor-summary {
        grid-template-columns: repeat(2, 260px);
        gap: 14px;
        width: max-content;
        max-width: 100%;
        break-inside: avoid;
    }

    .organization-investor-card {
        width: 260px;
        break-inside: avoid;
    }

    .organization-investor-card h2 {
        box-sizing: border-box;
        width: 100%;
        padding: 6px 8px;
        border: 1px solid #000;
        border-bottom: 0;
        font-size: 10px;
    }

    .organization-investor-card table {
        width: 100%;
        table-layout: fixed;
        border-collapse: collapse;
    }

    .organization-investor-card th,
    .organization-investor-card td {
        height: 18px;
        padding: 2px 6px;
        border: 1px solid #000;
        box-sizing: border-box;
        font-size: 11px;
    }

    .organization-investor-title th {
        width: auto;
        background: #00b050;
        text-align: center;
        font-weight: 900;
        border: 1px solid #000;
        box-sizing: border-box;
    }

    .organization-investor-card td {
        width: 90px;
        text-align: right;
    }

    .organization-investor-card tr:last-child th,
    .organization-investor-card tr:last-child td {
        border-bottom: 1px solid #000 !important;
    }
}

.task-snooze {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.task-snooze > span {
    flex: 1 0 100%;
    text-align: right;
}

.task-custom-snooze {
    display: grid;
    grid-template-columns: 112px 74px auto;
    gap: 6px;
    width: 100%;
}

.task-custom-snooze input {
    min-height: 32px;
    height: 32px;
    padding: 6px 8px;
    font-size: 13px;
}

.today-badge {
    background: #fff3cd;
    color: #7a4b00;
    border: 1px solid #f3d38a;
}

.fine-filters {
    grid-template-columns: minmax(240px, 1fr) 210px auto auto;
}

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
    min-width: 300px;
}

.inline-form select {
    min-width: 220px;
}

.fine-date-open {
    cursor: pointer;
    border: 0;
    min-height: 0;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.15;
}

.fine-date-modal-card {
    width: min(520px, calc(100vw - 40px));
}

.fine-auto-bind-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.fine-auto-bind-form input {
    min-width: 0;
    border-color: #d39e00;
    background: #fffdf4;
    font-weight: 600;
}

.fine-bind-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.fine-contract-search,
.fine-contract-select,
.fine-bind-hint {
    grid-column: 1 / -1;
}

.fine-contract-select {
    min-height: 230px;
}

.fine-bind-modal-card {
    width: min(860px, calc(100vw - 40px));
}

.field-error-input {
    border-color: var(--danger);
    background: #fff8f8;
}

.fines-found-panel {
    border: 2px solid #f0b429;
    background: #fffdf4;
    box-shadow: 0 10px 24px rgba(122, 75, 0, 0.08);
}

.fines-found-panel .panel-head {
    padding-bottom: 12px;
    border-bottom: 1px solid #f5d98d;
}

.fines-found-panel h2 {
    color: #7a4b00;
}

.fines-found-panel .fines-table thead th {
    background: #fff7dc;
}

.fines-found-panel .table-scroll {
    overflow: visible;
}

.fines-table {
    table-layout: fixed;
    width: 100%;
    min-width: 0;
}

.fines-table th,
.fines-table td {
    vertical-align: top;
    padding: 12px 8px;
}

.fines-table td {
    line-height: 1.28;
    overflow-wrap: break-word;
}

.fine-col-car {
    width: 150px;
}

.fine-col-number {
    width: 240px;
}

.fine-col-sum {
    width: 110px;
}

.fine-col-client {
    width: 315px;
}

.fine-col-photo {
    width: 62px;
}

.fine-col-action {
    width: 112px;
}

.fine-number-cell strong,
.fine-car-cell strong {
    display: inline-block;
    margin-bottom: 3px;
}

.fine-number-cell {
    overflow-wrap: normal;
    word-break: normal;
}

.fine-number-cell strong {
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: keep-all;
    font-variant-numeric: tabular-nums;
}

.fine-sum-cell {
    text-align: center;
    white-space: normal;
}

.fine-sum-cell strong {
    display: inline-block;
    margin-bottom: 6px;
    white-space: nowrap;
}

.fine-client-cell {
    padding-left: 18px;
    border-left: 1px solid #e5e7eb;
}

.fine-client-box {
    display: grid;
    gap: 4px;
    align-content: start;
    min-width: 0;
}

.fine-client-box strong,
.fine-client-box span {
    min-width: 0;
}

.fine-client-cell .badge,
.fine-sum-cell .badge {
    max-width: 100%;
    white-space: normal;
    text-align: center;
}

.fine-photo-cell,
.fine-action-cell {
    text-align: center;
}

.fines-table .button.small {
    min-width: 92px;
    padding-inline: 8px;
}

.checkbox-panel {
    display: grid;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.checkbox-panel legend {
    padding: 0 6px;
    color: var(--muted);
    font-weight: 700;
}

.checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
}

.checkbox-row label,
.checkbox-line {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    font-weight: 700;
}

.extra-services-panel {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
}

.extra-services-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.extra-services-summary h2 {
    margin-bottom: 4px;
}

.extra-services-summary .muted {
    margin: 0;
}

.extra-services-summary .muted strong {
    color: #0f5f4b;
}

.extra-services-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid #b8d8cd;
    border-radius: 999px;
    color: #0f5f4b;
    font-weight: 900;
    transition: transform 0.15s ease;
}

.extra-services-panel:not(.is-collapsed) .extra-services-chevron {
    transform: rotate(180deg);
}

.extra-services-body {
    display: grid;
    gap: 8px;
    padding-top: 6px;
    border-top: 1px solid #dbe7e3;
}

.extra-services-body[hidden] {
    display: none;
}

.extra-services-help {
    margin: 0;
}

.extra-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 8px;
}

.extra-service-row {
    display: grid;
    gap: 6px;
    align-content: start;
    min-height: 58px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.extra-service-row.is-enabled {
    grid-column: span 2;
    border-color: #9bd8bf;
    background: #f2fbf7;
}

.extra-service-tile {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    min-height: 56px;
    padding: 9px 10px;
    cursor: pointer;
}

.extra-service-tile input {
    width: 16px;
    height: 16px;
}

.extra-service-title {
    color: #0f5f4b;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.15;
}

.extra-service-details {
    display: none;
    grid-template-columns: 58px 76px minmax(0, 1fr);
    gap: 6px;
    padding: 0 10px 10px;
    border-top: 1px solid #cfe8dd;
}

.extra-service-row.is-enabled .extra-service-details {
    display: grid;
}

.extra-service-details label {
    margin-top: 8px;
    font-size: 12px;
}

.extra-service-details input {
    min-width: 0;
    padding: 7px 8px;
    font-size: 13px;
}

.extra-service-comment input {
    min-width: 0;
}

.extra-service-amount {
    color: #176b56;
    font-size: 13px;
    text-align: right;
    white-space: nowrap;
}

.extra-services-total {
    min-width: 150px;
}

.rental-days-input {
    width: 100%;
    max-width: 90px;
    border: 0;
    padding: 0;
    background: transparent;
    color: #0f5f4b;
    font-size: 24px;
    font-weight: 800;
    outline: none;
}

.rental-days-input::placeholder {
    color: #0f5f4b;
    opacity: 1;
}

.selection-alert {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #bfd7ff;
    background: #eff6ff;
    color: #1e3a8a;
    font-weight: 700;
}

.selection-alert.warning {
    border-color: #f3d38a;
    background: #fff8e6;
    color: #7a4b00;
}

.selection-alert.danger {
    border-color: #f2a7a0;
    background: #fff1f0;
    color: #9f1c12;
}

.selection-alert div + div {
    margin-top: 4px;
}

.contract-finance-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(145px, 1fr));
    gap: 10px;
    padding: 12px;
    border: 1px solid #b8d8cd;
    border-radius: 8px;
    background: #f3fbf8;
}

.contract-finance-summary div {
    display: grid;
    gap: 4px;
    padding: 10px;
    border-radius: 8px;
    background: #fff;
}

.contract-finance-summary span {
    color: var(--muted);
    font-weight: 700;
}

.contract-finance-summary strong {
    color: #0f5f4b;
    font-size: 18px;
}

.contract-finance-summary .finance-grand-total {
    grid-column: span 2;
    background: #0f6b55;
}

.contract-finance-summary .finance-grand-total span,
.contract-finance-summary .finance-grand-total strong {
    color: #fff;
}

.contract-finance-summary .finance-grand-total strong {
    font-size: 24px;
}

.contract-finance-summary p {
    grid-column: 1 / -1;
    margin: 0;
}

.payment-reminder-card {
    width: min(920px, calc(100vw - 32px));
}

.payment-reminder-card h2 {
    margin: 0 0 14px;
}

.payment-reminder-summary {
    margin-bottom: 16px;
}

.payment-reminder-summary .finance-grand-total {
    grid-column: 1 / -1;
}

.contract-tabs {
    display: inline-flex;
    gap: 6px;
    padding: 4px;
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #eef2f7;
}

.contract-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--muted);
    font-weight: 700;
    text-decoration: none;
}

.contract-tabs a.active {
    background: #fff;
    color: var(--ink);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.contract-tabs span {
    min-width: 22px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #dbe4ef;
    color: #334155;
    font-size: 12px;
    text-align: center;
}

.contract-tabs a.active span {
    background: #dcfce7;
    color: #166534;
}

.overdue-panel {
    margin-bottom: 16px;
    border-color: #fed7aa;
    background: #fffaf2;
}

.overdue-panel.urgent,
.overdue-card.urgent {
    border-color: #f5a6a0;
    background: #fff4f3;
}

.overdue-panel.controlled,
.overdue-card.controlled {
    border-color: #f5c56b;
    background: #fff9e8;
}

.overdue-card.return-place-card {
    border-color: #f5c56b;
    background: #fff9e8;
}

.overdue-card.today-return-card {
    border-color: #f3d38a;
    background: #fffaf0;
}

.return-deadline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    color: #7a4b00;
    font-size: 13px;
    font-weight: 700;
}

.return-deadline strong {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 9px;
    border: 1px solid #f3d38a;
    border-radius: 6px;
    background: #fff3cd;
    color: #7a4b00;
    font-size: 13px;
}

.return-deadline span {
    color: #6b4f1d;
    font-weight: 600;
}

.overdue-list {
    display: grid;
    gap: 10px;
}

.overdue-list.compact {
    margin-top: 10px;
}

.overdue-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.overdue-card > div {
    display: grid;
    gap: 4px;
}

.overdue-note-form {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(170px, 1fr) 150px auto auto;
    gap: 8px;
    align-items: center;
}

.overdue-note-form.wide {
    grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) 170px auto;
}

.controlled-overdue {
    margin-top: 12px;
}

.controlled-overdue summary {
    cursor: pointer;
    color: var(--muted);
    font-weight: 700;
}

.search {
    display: flex;
    gap: 10px;
    padding: 12px;
    margin-bottom: 16px;
}

.search.filters {
    display: grid;
    grid-template-columns: 1.45fr 0.75fr 1fr 1fr auto auto;
    align-items: center;
}

.search input {
    flex: 1;
}

.date-range-filter {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px;
    align-items: stretch;
}

.date-range-filter input {
    min-width: 0;
    padding-right: 8px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.date-range-toggle {
    border-left: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    background: #f8fafc;
}

.date-range-calendar {
    position: absolute;
    z-index: 30;
    top: calc(100% + 6px);
    left: 0;
    width: min(272px, 86vw);
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16);
}

.calendar-head {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    text-align: center;
}

.calendar-head strong {
    font-size: 13px;
}

.calendar-weekdays,
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-weekdays {
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

.calendar-day {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 28px;
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.calendar-day span {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #fff;
    line-height: 1;
    position: relative;
    z-index: 1;
}

.calendar-day:hover {
    background: #e7efff;
}

.calendar-day.muted-day {
    color: #a8b0bd;
}

.calendar-day.in-range {
    background: #dbeafe;
    color: #17457a;
}

.calendar-day.range-middle {
    border-radius: 0;
}

.calendar-day.range-start,
.calendar-day.range-end {
    background: #2563eb;
    border-radius: 14px;
    color: #fff;
}

.calendar-day.range-start span,
.calendar-day.range-end span {
    background: #fff;
    color: #17457a;
}

.calendar-day.range-start:not(.range-end) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.calendar-day.range-end:not(.range-start) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.calendar-day.range-start.range-end {
    border-radius: 14px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding: 18px;
}

.extension-panel {
    margin-top: 16px;
    margin-bottom: 16px;
}

.extension-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.extension-days-box {
    min-height: 62px;
}

.extension-payment-field {
    grid-column: 1 / 2;
}

.extension-received-field {
    grid-column: 2 / 3;
}

.extension-status-field {
    grid-column: 3 / 4;
}

.extension-payment-control-field {
    grid-column: 4 / 5;
}

.extension-actions-head,
.extension-actions-cell {
    width: 150px;
}

.extension-actions {
    display: grid;
    justify-items: start;
    gap: 7px;
    min-width: 130px;
}

.extension-actions form {
    margin: 0;
}

.extension-actions .link {
    display: inline-block;
    line-height: 1.2;
    text-align: left;
    white-space: normal;
}

.deposit-summary,
.close-calc-box {
    display: grid;
    gap: 6px;
    min-height: 62px;
    padding: 10px 12px;
    border: 1px solid #cfe7dc;
    border-radius: 8px;
    background: #f1fbf6;
}

.deposit-summary span,
.close-calc-box span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.deposit-summary strong,
.close-calc-box strong {
    color: #176b56;
    font-size: 20px;
}

.close-calc-box.has-debt {
    border-color: #f5a6a0;
    background: #fff4f3;
}

.close-calc-box.has-debt strong {
    color: var(--danger);
}

.close-full-withhold {
    align-content: end;
}

.close-charge-panel {
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.close-charge-panel h3 {
    margin: 0;
}

.close-reason-buttons {
    margin: 0;
}

.close-reason-rows {
    display: grid;
    gap: 8px;
}

.close-reason-row {
    display: grid;
    grid-template-columns: 150px 120px minmax(180px, 1fr) 96px;
    gap: 8px;
    align-items: center;
}

.close-reason-delete {
    min-height: 38px;
    padding: 0 12px;
}

label {
    align-content: start;
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

input,
select {
    box-sizing: border-box;
    width: 100%;
    height: 38px;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

.wide {
    grid-column: 1 / -1;
}

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 14px;
    align-items: center;
    margin-top: 6px;
}

.inline-add-link {
    width: fit-content;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
}

.note {
    padding: 12px;
    border: 1px solid #c8d8d2;
    border-radius: 6px;
    background: #eef7f4;
    color: #315447;
}

.quick-values {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.quick-values.compact {
    gap: 6px;
    margin: 6px 0 0;
}

.place-values {
    margin: 0;
}

.return-place-form {
    grid-template-columns: minmax(190px, 1fr) minmax(180px, 1fr) minmax(240px, 1.4fr);
    align-items: start;
    gap: 14px;
}

.return-place-form .wide {
    grid-column: 1 / -1;
}

.return-place-form .return-date-field {
    grid-column: 1 / 2;
}

.return-place-form .return-time-field {
    grid-column: 2 / 3;
}

.return-place-form .return-date-field input,
.return-place-form .return-time-field input {
    width: 100%;
    min-width: 0;
}

.return-place-form .return-channel-field {
    grid-column: 3 / 4;
}

.return-place-form .return-clarify-line {
    grid-column: 1 / 3;
    display: inline-flex;
    gap: 9px;
    align-items: flex-start;
    justify-self: start;
    align-self: end;
    margin: 0;
    padding: 7px 9px;
    border: 1px solid #c8d8d1;
    border-radius: 7px;
    background: #fbfdfc;
    color: #253b33;
    cursor: pointer;
    font-weight: 600;
}

.return-place-form .return-clarify-line input {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    cursor: pointer;
    accent-color: #14745f;
}

.return-place-form .return-clarify-line span {
    display: grid;
    gap: 1px;
}

.return-place-form .return-clarify-line small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.25;
}

.return-place-form .return-clarify-line:has(input:checked) {
    border-color: #9fbe70;
    background: #f7fbec;
    color: #315014;
}

.return-place-form .place-values {
    margin-top: 8px;
}

.quick-values button {
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid #a9c4ba;
    background: #fff;
    color: #245242;
    font-weight: 600;
}

.quick-values button:hover {
    background: #dceee8;
}

.return-date-inline {
    align-content: start;
    align-items: start;
    grid-template-rows: 25px 38px;
}

.quick-values.compact button {
    min-height: 26px;
    padding: 0 8px;
    font-size: 12px;
}

.return-date-inline > input {
    grid-row: 2;
}

.return-time-inline {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 25px 38px;
    align-content: start;
    align-items: start;
}

.return-time-inline > input {
    grid-column: 1 / 2;
    grid-row: 2;
}

.return-time-inline > .quick-values {
    grid-column: 2 / 3;
    grid-row: 2;
    align-self: start;
    margin: 0;
}

.return-time-inline .quick-values button {
    min-height: 38px;
    white-space: nowrap;
}

.return-time-inline .field-message {
    grid-column: 1 / -1;
}

.days-box {
    display: grid;
    align-content: start;
    gap: 6px;
    min-height: 59px;
    padding: 9px 12px;
    border: 1px solid #c8d8d2;
    border-radius: 6px;
    background: #eef7f4;
}

.days-box span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.days-box strong {
    color: #176b56;
    font-size: 20px;
}

.messages {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.message {
    padding: 11px 14px;
    border-radius: 6px;
    background: #e8f4ee;
    color: #174434;
}

.message.error {
    background: #fde8e8;
    color: var(--danger);
}

.message.warning {
    background: #fff4dd;
    color: var(--warn);
}

.empty {
    margin: 0;
}

.details dl {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 8px 18px;
    margin: 0 0 18px;
}

.details dt {
    color: var(--muted);
}

.details dd {
    margin: 0;
}

.client-name-line {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.return-place-comment {
    display: inline-block;
    margin-top: 4px;
    padding: 3px 8px;
    border: 1px solid #ead7a2;
    border-radius: 5px;
    background: #fffaf0;
    color: #5c4618;
    font-size: 13px;
    font-weight: 600;
}

.downloads {
    display: flex;
    gap: 12px;
    align-items: center;
}

.contract-card-actions {
    display: flex;
    gap: 12px;
    margin-left: auto;
}

.contract-modal-card {
    width: min(980px, calc(100vw - 40px));
}

.early-return-panel {
    display: none;
}

.early-return-panel.is-visible {
    display: block;
}

.warning-text {
    color: var(--warn);
    margin: 0;
}

.error-panel {
    margin-bottom: 16px;
    border-color: #f2b8b5;
    background: #fff7f7;
}

.error-panel h2 {
    color: var(--danger);
    margin-bottom: 8px;
}

.error-panel ul {
    margin: 0;
    padding-left: 20px;
    color: var(--danger);
}

.error-list-strong {
    font-weight: 700;
}

.field-error {
    color: var(--danger);
}

.field-error input,
.field-error select,
input:invalid,
select:invalid {
    border-color: #d92d20;
    background: #fff8f8;
}

.field-message {
    color: var(--danger);
    font-size: 12px;
    font-weight: 600;
}

.picker-field {
    position: relative;
    display: grid;
    gap: 6px;
}

.field-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.picker-trigger {
    justify-content: space-between;
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font-weight: 500;
}

.picker-trigger:hover {
    background: #f8faf9;
}

.picker-arrow {
    color: var(--muted);
}

.picker-panel {
    position: absolute;
    z-index: 20;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    display: none;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(20, 26, 33, 0.16);
}

.picker-panel.open {
    display: block;
}

.picker-search {
    margin-bottom: 8px;
}

.picker-options {
    display: grid;
    gap: 6px;
    max-height: 260px;
    overflow-y: auto;
}

.picker-option {
    display: grid;
    justify-content: stretch;
    min-height: 0;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    text-align: left;
    font-weight: 400;
}

.picker-option:hover {
    border-color: #c8d8d2;
    background: #eef7f4;
}

.picker-option.is-hidden {
    display: none;
}

.picker-option strong {
    font-size: 14px;
}

.picker-option span {
    color: var(--muted);
    font-size: 12px;
}

.picker-empty {
    display: none;
    padding: 12px;
    color: var(--muted);
    text-align: center;
}

.picker-empty.show {
    display: block;
}

.picker-add {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 38px;
    width: 100%;
    margin-top: 8px;
    border: 1px dashed #a9c4ba;
    border-radius: 6px;
    background: #eef7f4;
    color: #176b56;
    font-weight: 700;
    text-decoration: none;
}

.picker-add:hover {
    background: #dceee8;
    text-decoration: none;
}

.modal-backdrop {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(17, 24, 39, 0.46);
}

.modal-backdrop[hidden] {
    display: none;
}

.modal-card {
    width: min(900px, 100%);
    max-height: calc(100vh - 44px);
    overflow-y: auto;
    padding: 18px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(17, 24, 39, 0.28);
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.icon-button {
    width: 34px;
    min-height: 34px;
    padding: 0;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font-size: 22px;
    line-height: 1;
}

.icon-button:hover {
    background: #f3f4f6;
}

.quick-client-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.quick-client-tools {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 14px;
    border: 1px solid #c8d8d2;
    border-radius: 6px;
    background: #eef7f4;
}

.quick-client-tools .muted {
    margin: 0;
}

.quick-client-error {
    display: none;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    background: #fff8f8;
    color: var(--danger);
    font-weight: 700;
}

.quick-client-error.show {
    display: block;
}

.modal-actions {
    margin-top: 14px;
}

.ocr-panel {
    margin-bottom: 16px;
}

.ocr-panel p {
    margin: 6px 0 0;
}

.ocr-single-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ocr-upload-card {
    width: min(720px, 100%);
}

.ocr-upload-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.ocr-upload-slot {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 10px;
    min-height: 132px;
    padding: 16px;
    border: 1px dashed #a9c4ba;
    border-radius: 8px;
    background: #f8fbfa;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.ocr-upload-slot:hover {
    border-color: #169bd7;
    background: #f2fbff;
    box-shadow: 0 8px 24px rgba(22, 155, 215, 0.12);
}

.ocr-upload-slot input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.ocr-upload-title {
    color: var(--ink);
    font-size: 15px;
    font-weight: 700;
    text-align: center;
}

.ocr-doc-preview {
    position: relative;
    display: grid;
    grid-template-columns: 80px 1fr;
    grid-template-rows: 28px 1fr;
    column-gap: 14px;
    width: min(310px, 100%);
    min-height: 150px;
    padding: 16px;
    border: 1px solid #dfe6eb;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f4f7fa 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
    overflow: hidden;
}

.ocr-doc-preview::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(0deg, rgba(23, 107, 86, 0.04), rgba(23, 107, 86, 0.04) 1px, transparent 1px, transparent 11px),
        linear-gradient(90deg, rgba(22, 155, 215, 0.06), transparent 55%);
    pointer-events: none;
}

.license-preview {
    min-height: 132px;
    border-radius: 10px;
}

.ocr-doc-label {
    position: relative;
    z-index: 1;
    grid-column: 1 / -1;
    align-self: start;
    color: #b4bdc5;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0;
}

.ocr-doc-photo {
    position: relative;
    z-index: 1;
    grid-column: 1;
    grid-row: 2;
    align-self: end;
    width: 76px;
    height: 86px;
    border-radius: 8px;
    background:
        radial-gradient(circle at 50% 28%, #c9d2da 0 18px, transparent 19px),
        radial-gradient(ellipse at 50% 92%, #c9d2da 0 44px, transparent 45px),
        #eef2f5;
}

.ocr-doc-lines {
    position: relative;
    z-index: 1;
    grid-column: 2;
    grid-row: 2;
    display: grid;
    align-content: end;
    gap: 11px;
    padding-bottom: 8px;
}

.ocr-doc-lines i {
    display: block;
    height: 8px;
    border-radius: 99px;
    background: #e2e8ee;
}

.ocr-doc-lines i:nth-child(1) {
    width: 76%;
}

.ocr-doc-lines i:nth-child(2) {
    width: 100%;
}

.ocr-doc-lines i:nth-child(3) {
    width: 90%;
}

.ocr-doc-lines i:nth-child(4) {
    width: 68%;
}

.ocr-camera {
    position: absolute;
    z-index: 2;
    left: 50%;
    top: 54%;
    display: grid;
    place-items: center;
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: rgba(197, 239, 252, 0.92);
    transform: translate(-50%, -50%);
}

.ocr-camera svg {
    width: 42px;
    height: 42px;
    fill: none;
    stroke: #159bd8;
    stroke-width: 1.9;
}

.ocr-camera circle {
    stroke: #f4c84f;
    stroke-width: 2.3;
}

.ocr-upload-action {
    color: #1f2937;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

.ocr-upload-slot small {
    color: var(--muted);
    font-weight: 600;
    overflow-wrap: anywhere;
    text-align: center;
}

.ocr-upload-slot.has-file {
    border-color: #2f9e6d;
    background: #f1fbf6;
}

.ocr-upload-slot.has-file .ocr-upload-action,
.ocr-upload-slot.has-file small {
    color: #176b56;
}

.ocr-file {
    display: none;
}

.ocr-status {
    display: none;
    padding: 10px 12px;
    border-radius: 6px;
    background: #eef2f7;
    color: var(--muted);
    font-weight: 700;
}

.ocr-status:not(:empty) {
    display: block;
}

.ocr-status.success {
    background: #e8f4ee;
    color: #176b56;
}

.ocr-status.warning {
    background: #fff4dd;
    color: var(--warn);
}

.ocr-status.error {
    background: #fff8f8;
    color: var(--danger);
}

.ocr-status.loading {
    background: #eef2f7;
    color: #374151;
}

.client-documents-panel {
    margin-bottom: 16px;
}

.hidden-upload-form {
    display: none;
}

.client-documents-head {
    align-items: center;
    gap: 12px;
    margin-bottom: 0;
}

.client-documents-toggle {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}

.client-documents-toggle:hover .client-documents-title {
    color: var(--green);
}

.client-documents-title {
    display: block;
    margin-bottom: 3px;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
}

.client-documents-chevron {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
    transition: transform 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.client-documents-panel:not(.is-collapsed) .client-documents-chevron {
    transform: rotate(180deg);
    border-color: #a9c4ba;
    color: var(--green);
}

.client-documents-body {
    margin-top: 12px;
    animation: documentBodySlide 0.16s ease-out;
}

.client-documents-body[hidden] {
    display: none;
}

@keyframes documentBodySlide {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.client-documents-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(86px, 96px));
    gap: 10px;
}

.company-documents-panel {
    margin-bottom: 16px;
}

.company-documents-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.company-document-upload {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.company-document-upload h3,
.company-close-acts h3 {
    margin: 0;
    font-size: 16px;
    line-height: 1.2;
}

.company-documents-table td {
    vertical-align: top;
}

.company-contract-upload {
    margin-top: 4px;
}

.company-close-acts {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid #f1b0b7;
    border-radius: 8px;
    background: #fff8f8;
}

.client-document-card {
    display: grid;
    gap: 6px;
    align-content: start;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.client-document-preview {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 3 / 4;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f8fafc;
    cursor: zoom-in;
}

.client-document-preview:hover {
    border-color: #a9c4ba;
    background: #eef7f4;
}

.client-document-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.client-document-file-icon {
    display: grid;
    place-items: center;
    width: 70px;
    height: 88px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.client-document-edit {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: stretch;
}

.client-document-edit input,
.client-document-edit select {
    width: 100%;
    min-width: 0;
    min-height: 28px;
    padding: 4px 6px;
    font-size: 12px;
}

.client-document-actions {
    display: flex;
    align-items: center;
    justify-content: center;
}

.client-document-edit .button.small {
    width: 100%;
    min-height: 28px;
    padding: 0 6px;
    font-size: 12px;
}

.client-document-actions .link {
    font-size: 12px;
}

.client-document-preview-card {
    width: min(920px, calc(100vw - 40px));
    max-height: calc(100vh - 44px);
}

.client-document-preview-card img {
    display: block;
    width: 100%;
    max-height: calc(100vh - 140px);
    object-fit: contain;
    border-radius: 6px;
    background: #f8fafc;
}

.compact-empty {
    margin: 0;
}

.ocr-processing-card {
    display: grid;
    justify-items: center;
    gap: 12px;
    width: min(420px, 100%);
    padding: 28px 24px;
    text-align: center;
}

.ocr-processing-card p {
    margin: 0;
    max-width: 340px;
}

.ocr-alert-card {
    display: grid;
    justify-items: center;
    gap: 12px;
    width: min(520px, 100%);
    padding: 28px 24px;
    border: 2px solid #d92d20;
    text-align: center;
}

.ocr-alert-card h2 {
    color: #b42318;
    font-size: 30px;
}

.ocr-alert-card p {
    margin: 0;
    color: #b42318;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.35;
}

.ocr-alert-card .muted {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.danger-button {
    background: #b42318;
}

.danger-button:hover {
    background: #8f1d14;
}

.ocr-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #d9eef7;
    border-top-color: #159bd8;
    border-radius: 50%;
    animation: ocr-spin 0.8s linear infinite;
}

@keyframes ocr-spin {
    to {
        transform: rotate(360deg);
    }
}

.ocr-result {
    display: grid;
    gap: 14px;
    padding-top: 6px;
    border-top: 1px solid var(--line);
}

.ocr-raw summary {
    cursor: pointer;
    color: var(--accent);
    font-weight: 700;
}

.raw-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.fssp-modal-card {
    max-width: 900px;
}

.fssp-result {
    display: grid;
    gap: 12px;
}

.fssp-loading {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--muted);
}

.fssp-clean,
.fssp-error,
.fssp-warning {
    border-radius: 8px;
    padding: 14px;
}

.fssp-clean {
    border: 1px solid #2f9e6d;
    background: #eefaf4;
    color: #096342;
    text-align: center;
}

.fssp-error {
    border: 1px solid #f2a29b;
    background: #fff4f3;
    color: #981b13;
}

.fssp-warning {
    border: 1px solid #f7c566;
    background: #fff8e6;
    color: #694b00;
}

.fssp-clean h3,
.fssp-error h3,
.fssp-warning h3 {
    margin: 0 0 8px;
}

.fssp-debt-card {
    display: grid;
    gap: 8px;
    margin-top: 10px;
    padding: 12px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.65);
}

.fssp-debt-card div {
    display: grid;
    grid-template-columns: minmax(170px, 220px) 1fr;
    gap: 10px;
}

.fssp-debt-card strong {
    color: #475467;
}

.fssp-total {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.15);
    font-size: 16px;
    font-weight: 800;
}

textarea {
    width: 100%;
    min-height: 180px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    resize: vertical;
}

.button.small {
    min-height: 30px;
    padding: 0 10px;
    font-size: 13px;
}

.field-error .picker-trigger {
    border-color: #d92d20;
    background: #fff8f8;
}

.field-filled:not(.field-error) {
    color: #176b56;
}

.field-filled:not(.field-error) input,
.field-filled:not(.field-error) select,
.field-filled:not(.field-error) .picker-trigger {
    border-color: #2f9e6d;
    background: #f1fbf6;
}

.field-filled:not(.field-error) .field-label {
    color: #176b56;
}

@media (max-width: 760px) {
    .topbar,
    .page-head,
    .search,
    .downloads {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar {
        padding: 14px 18px;
    }

    .topbar nav {
        flex-wrap: wrap;
    }

    .container {
        padding: 18px;
    }

    .handover-pickup-grid {
        grid-template-columns: 1fr;
    }

    .logistics-card {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    .logistics-actions {
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        min-width: 0;
    }

    .stats,
    .dashboard-metrics,
    .dashboard-grid,
    .dashboard-two-columns,
    .dashboard-main-flow,
    .task-create-form,
    .manager-task,
    .car-status-summary,
    .form-grid,
    .reservation-handover-line,
    .quick-client-grid,
    .ocr-upload-grid,
    .raw-grid,
    .search.filters,
    .overdue-card,
    .overdue-note-form,
    .overdue-note-form.wide,
    .extra-service-row,
    .client-document-row,
    .client-document-edit,
    .contract-finance-summary {
        grid-template-columns: 1fr;
    }

    .client-document-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .task-create-form .task-note-field {
        grid-column: 1;
    }

    .manager-task-actions,
    .task-snooze {
        justify-items: stretch;
        justify-content: flex-start;
    }

    .task-snooze > span {
        text-align: left;
    }

    .task-custom-snooze {
        grid-template-columns: 1fr 90px auto;
    }

    table {
        display: block;
        overflow-x: auto;
    }

    .fssp-debt-card div {
        grid-template-columns: 1fr;
    }
}

/* Mobile-only layout layer. Desktop rules above remain unchanged. */
@media (max-width: 760px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        font-size: 14px;
    }

    .topbar {
        gap: 12px;
        padding: 12px 14px;
    }

    .brand {
        font-size: 17px;
    }

    .topbar nav {
        display: flex;
        width: 100%;
        flex-flow: row nowrap;
        gap: 8px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        padding: 2px 0 8px;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }

    .topbar nav > * {
        flex: 0 0 auto;
    }

    .topbar .nav-link,
    .topbar .primary-link {
        min-height: 40px;
        padding: 9px 11px;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: #fff;
    }

    .topbar .primary-link {
        background: var(--accent);
        border-color: var(--accent);
        color: #fff;
    }

    .container {
        width: 100%;
        padding: 14px 12px 28px;
    }

    .container *,
    .topbar * {
        min-width: 0;
    }

    h1 {
        font-size: 23px;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    h2 {
        font-size: 18px;
        line-height: 1.25;
    }

    .page-head {
        gap: 12px;
        margin-bottom: 16px;
    }

    .panel,
    .card,
    .dashboard-card,
    .overdue-panel,
    .picker-panel,
    .close-charge-panel,
    .early-return-panel,
    .error-panel,
    .client-documents-panel,
    .company-documents-panel {
        max-width: 100%;
    }

    .stats,
    .dashboard-metrics,
    .dashboard-grid,
    .dashboard-two-columns,
    .dashboard-main-flow,
    .task-create-form,
    .manager-task,
    .car-status-summary,
    .form-grid,
    .extension-panel,
    .reservation-handover-line,
    .quick-client-grid,
    .ocr-upload-grid,
    .raw-grid,
    .search.filters,
    .overdue-card,
    .overdue-note-form,
    .overdue-note-form.wide,
    .extra-service-row,
    .client-document-row,
    .client-document-edit,
    .contract-finance-summary,
    .company-documents-grid,
    .company-document-upload,
    .company-contract-upload,
    .return-time-inline,
    .close-reason-buttons,
    .investor-report-grid,
    .investor-summary-grid,
    .investor-expense-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .form-grid > *,
    .extension-panel > *,
    .quick-client-grid > *,
    .company-documents-grid > * {
        grid-column: 1 / -1 !important;
    }

    input,
    select,
    textarea,
    button {
        max-width: 100%;
        font-size: 16px;
    }

    input,
    select,
    textarea {
        width: 100%;
    }

    textarea {
        min-height: 88px;
    }

    .button,
    button.button {
        min-height: 42px;
        white-space: normal;
        text-align: center;
    }

    .actions,
    .downloads,
    .manager-task-actions,
    .client-document-actions {
        gap: 8px;
        flex-wrap: wrap;
    }

    .actions .button,
    .downloads .button {
        flex: 0 0 auto;
        height: auto;
    }

    .downloads .button,
    .page-head > .actions .button {
        width: 100%;
        min-height: 42px;
    }

    .contract-card-actions {
        width: 100%;
        margin-left: 0;
        flex-wrap: wrap;
    }

    .contract-card-actions .button {
        flex: 1 1 145px;
        min-height: 42px;
    }

    .container table {
        display: block;
        width: 100%;
        max-width: 100%;
        min-width: 0 !important;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .container .table-wrap,
    .container .panel,
    .container .card {
        max-width: 100%;
        min-width: 0;
        overflow-x: auto;
    }

    th,
    td {
        padding: 9px 10px;
    }

    img,
    video,
    iframe {
        max-width: 100%;
        height: auto;
    }

    .modal,
    .modal-backdrop {
        padding: 10px;
    }

    .modal-card {
        width: 100%;
        max-width: 100%;
        max-height: calc(100vh - 20px);
        overflow-y: auto;
    }

    .picker-panel {
        left: 0;
        right: 0;
        width: 100%;
    }

    .company-representative-head {
        align-items: stretch;
        flex-direction: column;
    }

    .director-representative-toggle span,
    .terminal-payment-toggle span {
        white-space: normal;
    }

    /* Expense pages: purpose-built phone layout. */
    .page-head .dashboard-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        gap: 8px;
    }

    .page-head .dashboard-actions .button {
        width: 100%;
        min-width: 0;
        min-height: 40px;
        padding: 8px 6px;
        font-size: 13px;
        line-height: 1.15;
    }

    .vehicle-expense-entry,
    .vehicle-expense-journal,
    .vehicle-expense-cars {
        overflow: visible !important;
    }

    .vehicle-expense-entry {
        padding: 14px;
    }

    .vehicle-expense-entry .panel-head {
        margin-bottom: 12px;
    }

    .vehicle-expense-entry .panel-head h2 {
        font-size: 19px;
    }

    .vehicle-expense-entry .panel-head .muted {
        margin-top: 5px;
        font-size: 13px;
        line-height: 1.35;
    }

    .vehicle-expense-form,
    .organization-expense-form {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 72px;
        gap: 10px;
        align-items: end;
        width: 100%;
    }

    .vehicle-expense-form > label,
    .organization-expense-form > label {
        grid-column: 1 / -1;
        min-width: 0;
        font-size: 13px;
    }

    .vehicle-expense-form > label:nth-last-of-type(1),
    .organization-expense-form > label:nth-last-of-type(1) {
        grid-column: 1;
    }

    .vehicle-expense-form > button[type="submit"],
    .organization-expense-form > button[type="submit"] {
        grid-column: 2;
        width: 72px;
        min-width: 72px;
        min-height: 42px;
        padding: 8px;
        font-size: 0;
        line-height: 1;
    }

    .vehicle-expense-form > button[type="submit"]::after,
    .organization-expense-form > button[type="submit"]::after {
        content: "ОК";
        font-size: 16px;
        font-weight: 800;
    }

    .vehicle-expense-form input,
    .organization-expense-form input,
    .vehicle-car-picker-toggle {
        min-height: 42px;
        padding: 8px 10px;
        font-size: 16px;
    }

    .vehicle-car-picker-menu {
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
    }

    .vehicle-expense-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 14px;
        width: 100%;
    }

    .vehicle-expense-cars,
    .vehicle-expense-journal {
        width: 100%;
        min-width: 0;
    }

    .vehicle-expense-car {
        padding: 10px 12px;
        font-size: 14px;
    }

    .vehicle-expense-journal > .panel-head.split {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        align-items: start;
    }

    .vehicle-expense-journal .inline-form {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 8px;
        width: 100%;
        justify-content: stretch;
    }

    .vehicle-expense-journal .inline-form input {
        width: 100% !important;
        min-width: 0;
        min-height: 40px;
        padding: 7px 9px;
        font-size: 15px;
    }

    .vehicle-expense-journal .inline-form input[name="q"] {
        grid-column: 1 / -1;
    }

    .vehicle-expense-journal .inline-form button,
    .vehicle-expense-journal .inline-form a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 40px;
        margin: 0;
        border-radius: 8px;
        font-size: 14px;
    }

    .vehicle-expense-journal .inline-form a {
        border: 1px solid var(--line);
        background: #fff;
    }

    .vehicle-expense-journal table {
        display: block;
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible;
        white-space: normal;
    }

    .vehicle-expense-journal thead {
        display: none;
    }

    .vehicle-expense-journal tbody {
        display: grid;
        gap: 10px;
        width: 100%;
    }

    .vehicle-expense-journal tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 5px 12px;
        width: 100%;
        padding: 11px 12px;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: #fff;
    }

    .vehicle-expense-journal td {
        display: block;
        min-width: 0;
        padding: 0;
        border: 0;
        font-size: 13px;
        overflow-wrap: anywhere;
    }

    .vehicle-expense-journal td:nth-child(1) {
        color: var(--muted);
    }

    .vehicle-expense-journal td:nth-child(2),
    .vehicle-expense-journal td:nth-child(3) {
        grid-column: 1 / -1;
    }

    .vehicle-expense-journal td:nth-last-child(2) {
        grid-column: 2;
        grid-row: 1;
        font-size: 15px;
        text-align: right;
    }

    .vehicle-expense-journal td.actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
        margin-top: 3px;
    }

    .vehicle-expense-journal td.actions button.link {
        min-height: 32px;
        padding: 5px 9px;
        font-size: 13px;
    }
}

@media print {
    .investor-report-grid,
    .investor-expenses-side,
    .investor-expense-tiles,
    .investor-expense-tile {
        overflow: visible !important;
    }

    .investor-month-table,
    .investor-expense-tile table {
        display: table !important;
        overflow: visible !important;
    }
}

@media print {
    .investor-report-grid {
        grid-template-columns: max-content 1fr !important;
        gap: 10px !important;
        width: 100% !important;
        overflow: visible !important;
    }

    .investor-expense-tiles {
        grid-template-columns: repeat(3, 160px) !important;
        gap: 10px !important;
        overflow: visible !important;
    }

    .investor-expense-tile {
        width: 160px !important;
        min-width: 160px !important;
        max-width: 160px !important;
        overflow: visible !important;
        break-inside: avoid !important;
    }

    .investor-expense-tile h2 {
        box-sizing: border-box !important;
        width: 100% !important;
        padding: 3px 6px !important;
        font-size: 10px !important;
    }

    .investor-expense-tile table {
        width: 100% !important;
        table-layout: fixed !important;
    }

    .investor-expense-tile th,
    .investor-expense-tile td {
        height: 17px !important;
        padding: 1px 3px !important;
        box-sizing: border-box !important;
        font-size: 11px !important;
    }

    .investor-expense-tile th:first-child,
    .investor-expense-tile td:first-child {
        width: 104px !important;
        min-width: 104px !important;
        max-width: 104px !important;
    }

    .investor-expense-tile th:last-child,
    .investor-expense-tile td:last-child {
        width: 48px !important;
        min-width: 48px !important;
        max-width: 48px !important;
    }

    .investor-overage-summary {
        width: 500px !important;
        min-width: 500px !important;
        max-width: 500px !important;
        margin-top: 10px !important;
        overflow: visible !important;
        break-inside: avoid !important;
    }

    .investor-overage-summary h2 {
        box-sizing: border-box !important;
        width: 100% !important;
        padding: 3px 6px !important;
        font-size: 10px !important;
        line-height: 1 !important;
    }

    .investor-overage-summary table {
        width: 100% !important;
        table-layout: fixed !important;
        border-collapse: collapse !important;
        font-size: 11px !important;
        line-height: 1 !important;
    }

    .investor-overage-summary th,
    .investor-overage-summary td {
        height: 17px !important;
        padding: 1px 3px !important;
        border: 1px solid #000 !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        white-space: nowrap !important;
    }

    .investor-overage-summary th:first-child,
    .investor-overage-summary td:first-child {
        width: 130px !important;
        min-width: 130px !important;
        max-width: 130px !important;
    }

    .investor-overage-summary th:nth-child(2),
    .investor-overage-summary td:nth-child(2) {
        width: 270px !important;
        min-width: 270px !important;
        max-width: 270px !important;
    }

    .investor-overage-summary th:last-child,
    .investor-overage-summary td:last-child {
        width: 70px !important;
        min-width: 70px !important;
        max-width: 70px !important;
        text-align: right !important;
    }

    .organization-investor-summary {
        grid-template-columns: repeat(2, 260px) !important;
        gap: 14px !important;
        width: max-content !important;
        max-width: 100% !important;
        break-inside: avoid !important;
    }

    .organization-investor-card {
        width: 260px !important;
        min-width: 260px !important;
        max-width: 260px !important;
        break-inside: avoid !important;
    }

    .organization-investor-card h2 {
        box-sizing: border-box !important;
        width: 100% !important;
        padding: 6px 8px !important;
        border: 1px solid #000 !important;
        border-bottom: 0 !important;
        font-size: 10px !important;
    }

    .organization-investor-card table {
        width: 100% !important;
        table-layout: fixed !important;
        border-collapse: collapse !important;
    }

    .organization-investor-card th,
    .organization-investor-card td {
        height: 18px !important;
        padding: 2px 6px !important;
        border: 1px solid #000 !important;
        box-sizing: border-box !important;
        font-size: 11px !important;
    }

    .organization-investor-title th {
        width: auto !important;
        background: #00b050 !important;
        text-align: center !important;
        font-weight: 900 !important;
        border: 1px solid #000 !important;
        box-sizing: border-box !important;
    }

    .organization-investor-card td {
        width: 90px !important;
        text-align: right !important;
    }

    .organization-investor-card tr:last-child th,
    .organization-investor-card tr:last-child td,
    .investor-expense-tile tbody tr:last-child td,
    .investor-month-table tbody tr:last-child th,
    .investor-month-table tbody tr:last-child td {
        border-bottom: 1px solid #000 !important;
    }






























}
