﻿:root {
    --black: #1A4E50;
    --dark-petrol: #1A4E50;
    --petrol: #27585A;
    --gold: #AD9779;
    --white: #FFFFFF;
    --surface: #F3F6F5;
    --surface-strong: #E7EFEC;
    --border: rgba(26, 78, 80, 0.14);
    --text: #173C3E;
    --muted: #647879;
    --success: #247255;
    --error: #A84242;
    --glass: rgba(255, 255, 255, 0.72);
    --shadow: 0 18px 45px rgba(26, 78, 80, 0.13);
    --glossy-highlight: linear-gradient(135deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.08) 48%, rgba(173, 151, 121, 0.16));
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(173, 151, 121, 0.20), transparent 34%),
        linear-gradient(135deg, #F8FAF9 0%, var(--surface) 48%, #EDF4F2 100%);
    color: var(--text);
    font-family: Arial, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

a {
    color: inherit;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: relative;
    z-index: 20;
    width: 260px;
    padding: 24px 18px;
    background: linear-gradient(180deg, var(--dark-petrol) 0%, #12393A 100%);
    color: var(--white);
    box-shadow: 18px 0 42px rgba(26, 78, 80, 0.18);
}

.sidebar-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.sidebar-close,
.mobile-menu-button {
    border: 0;
    cursor: pointer;
    font: inherit;
}

.sidebar-close {
    display: none;
    width: 38px;
    min-width: 38px;
    height: 38px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: var(--white);
    font-size: 28px;
    line-height: 1;
}

.mobile-menu-button {
    position: relative;
    display: none;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 9px 12px 9px 40px;
    border-radius: 8px;
    background: var(--dark-petrol);
    color: var(--white);
    box-shadow: 0 12px 28px rgba(26, 78, 80, 0.18);
}

.mobile-menu-button span {
    position: absolute;
    left: 13px;
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.mobile-menu-button span:nth-child(1) {
    top: 14px;
}

.mobile-menu-button span:nth-child(2) {
    top: 20px;
}

.mobile-menu-button span:nth-child(3) {
    top: 26px;
}

.mobile-menu-button strong {
    font-size: 14px;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(9, 32, 33, 0.52);
    backdrop-filter: blur(3px);
}

.sidebar-backdrop[hidden] {
    display: none;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--white);
    font-weight: 700;
    text-decoration: none;
    margin-bottom: 32px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(145deg, var(--gold), #C7B392);
    color: var(--white);
    font-weight: 700;
}

.nav-list {
    display: grid;
    gap: 6px;
}

.nav-list a {
    padding: 11px 12px;
    border-radius: 8px;
    color: var(--white);
    text-decoration: none;
}

.nav-list a:hover,
.nav-list a.active {
    background: rgba(255, 255, 255, 0.14);
    color: var(--white);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.app-main {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 32px;
    background: rgba(255, 255, 255, 0.86);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px);
}

.topbar h1,
.login-header h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.2;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--gold);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.content {
    flex: 1;
    padding: 32px;
}

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

.dashboard-grid-wide {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.metric-card,
.panel,
.login-card {
    position: relative;
    overflow: hidden;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.metric-card::before,
.panel::before,
.login-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: var(--glossy-highlight);
    opacity: 0.72;
}

.metric-card {
    min-height: 154px;
    padding: 22px;
    border-color: rgba(173, 151, 121, 0.30);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.62)),
        linear-gradient(135deg, rgba(26, 78, 80, 0.08), rgba(173, 151, 121, 0.14));
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    border-color: rgba(173, 151, 121, 0.58);
    box-shadow: 0 24px 60px rgba(26, 78, 80, 0.18);
}

.metric-card > *,
.panel > *,
.login-card > * {
    position: relative;
    z-index: 1;
}

.metric-label,
.metric-card span {
    display: block;
    color: var(--muted);
}

.metric-label {
    min-height: 42px;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--petrol);
}

.metric-card strong {
    display: block;
    font-size: 32px;
    line-height: 1.1;
    margin-bottom: 8px;
    color: var(--dark-petrol);
}

.metric-card span {
    font-size: 13px;
    color: var(--gold);
    font-weight: 700;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.chart-panel {
    min-height: 330px;
}

.chart-panel:first-child {
    grid-column: span 2;
}

.simple-chart {
    display: block;
    width: 100%;
    max-width: 100%;
}

.donut-wrap {
    display: grid;
    grid-template-columns: minmax(160px, 220px) 1fr;
    gap: 18px;
    align-items: center;
}

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

.chart-legend li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
}

.chart-legend li span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gold);
}

.chart-legend li:nth-child(1) span { background: var(--dark-petrol); }
.chart-legend li:nth-child(2) span { background: var(--petrol); }
.chart-legend li:nth-child(3) span { background: var(--gold); }
.chart-legend li:nth-child(4) span { background: #D8CBB8; }

.chart-legend strong {
    color: var(--text);
}

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

.dashboard-list div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(26, 78, 80, 0.10);
}

.dashboard-list div:last-child {
    border-bottom: 0;
}

.dashboard-list strong {
    min-width: 0;
}

.dashboard-list span {
    grid-column: 1;
    color: var(--muted);
    font-size: 14px;
}

.dashboard-list em {
    grid-row: span 2;
    align-self: center;
    color: var(--gold);
    font-style: normal;
    font-weight: 700;
}

.panel {
    padding: 24px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.90), rgba(255, 255, 255, 0.68)),
        linear-gradient(135deg, rgba(39, 88, 90, 0.06), rgba(173, 151, 121, 0.08));
}

.panel-header {
    border-bottom: 1px solid rgba(26, 78, 80, 0.12);
    margin-bottom: 18px;
    padding-bottom: 14px;
}

.panel-header-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.panel-header h2,
.empty-state h2 {
    margin: 0;
    font-size: 20px;
    color: var(--dark-petrol);
}

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

.empty-state {
    color: var(--muted);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid var(--dark-petrol);
    border-radius: 8px;
    background: linear-gradient(145deg, var(--petrol), var(--dark-petrol));
    color: var(--white);
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.button-secondary {
    border-color: rgba(173, 151, 121, 0.56);
    background: rgba(255, 255, 255, 0.78);
    color: var(--dark-petrol);
}

.flash {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    background: var(--surface-strong);
}

.flash-success {
    background: #E6F2EC;
    color: var(--success);
}

.flash-error {
    background: #F4E6E6;
    color: var(--error);
}

.footer {
    padding: 18px 32px;
    color: var(--muted);
    background: var(--white);
    border-top: 1px solid var(--border);
}

.print-page {
    min-height: 100vh;
    padding: 28px;
    background: #DDE7E5;
}

.print-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.print-sheet {
    width: min(100%, 980px);
    margin: 0 auto;
    padding: 46px;
    background: var(--white);
    box-shadow: 0 22px 70px rgba(26, 78, 80, 0.18);
}

.print-header {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--dark-petrol);
}

.print-header h1 {
    margin: 0;
    color: var(--dark-petrol);
    font-size: 34px;
}

.print-header p,
.print-company span {
    display: block;
    margin: 6px 0 0;
    color: var(--muted);
}

.print-company {
    text-align: right;
}

.print-meta dl {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 8px 18px;
    margin: 28px 0;
}

.print-meta dt {
    color: var(--muted);
    font-weight: 700;
}

.print-meta dd {
    margin: 0;
}

.print-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
}

.print-table th,
.print-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.print-table th {
    color: var(--dark-petrol);
    background: #F3F6F5;
}

.print-table-small {
    font-size: 13px;
}

.print-totals {
    display: grid;
    justify-content: end;
    gap: 6px;
    margin-top: 24px;
    text-align: right;
}

.print-totals strong {
    color: var(--dark-petrol);
    font-size: 20px;
}

.print-notes,
.print-letter {
    margin-top: 28px;
    white-space: normal;
}

.document-shell {
    position: relative;
    overflow: hidden;
    color: #173638;
    font-size: 14px;
}

.document-shell::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle at 70% 20%, rgba(173, 151, 121, 0.26), transparent 64%);
    pointer-events: none;
}

.document-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 34px;
    align-items: stretch;
    margin: 0 0 34px;
    padding: 34px 38px;
    border-radius: 8px;
    color: #FFFFFF;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 34%),
        linear-gradient(135deg, #1A4E50 0%, #27585A 62%, #1A4E50 100%);
}

.document-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 44%);
    pointer-events: none;
}

.document-brand,
.document-title-block {
    position: relative;
    z-index: 1;
}

.document-brand {
    display: flex;
    gap: 16px;
    align-items: center;
}

.document-logo {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.08)),
        rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 16px 34px rgba(0, 0, 0, 0.18);
    color: #FFFFFF;
    font-size: 20px;
    font-weight: 800;
}

.document-brand strong,
.document-brand span,
.document-address strong,
.document-address span {
    display: block;
}

.document-brand strong {
    font-size: 19px;
}

.document-brand span {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.78);
}

.document-title-block {
    text-align: right;
}

.document-title-block h1 {
    margin: 6px 0;
    color: #FFFFFF;
    font-size: 38px;
    line-height: 1;
}

.document-title-block p {
    margin: 0;
    color: rgba(255, 255, 255, 0.84);
    font-size: 17px;
    font-weight: 700;
}

.document-kicker {
    color: #AD9779;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.document-intro-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 24px;
    margin-bottom: 34px;
}

.document-address,
.document-meta {
    border: 1px solid rgba(173, 151, 121, 0.28);
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.74)),
        #FFFFFF;
    box-shadow: 0 14px 32px rgba(26, 78, 80, 0.08);
}

.document-address {
    padding: 22px;
}

.document-address strong {
    margin: 9px 0 7px;
    color: #1A4E50;
    font-size: 18px;
}

.document-address span:not(.document-kicker) {
    margin-top: 3px;
    color: #445B5D;
}

.document-meta {
    display: grid;
    padding: 10px 18px;
}

.document-meta div {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(26, 78, 80, 0.1);
}

.document-meta div:last-child {
    border-bottom: 0;
}

.document-meta dt,
.document-meta dd {
    margin: 0;
}

.document-meta dt {
    color: #6A7B7D;
    font-weight: 800;
}

.document-meta dd {
    text-align: right;
    color: #1A4E50;
    font-weight: 700;
}

.document-lead {
    margin: 0 0 24px;
    color: #445B5D;
    line-height: 1.65;
}

.document-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid rgba(26, 78, 80, 0.16);
    border-radius: 8px;
}

.document-table th,
.document-table td {
    padding: 12px 13px;
    border-bottom: 1px solid rgba(26, 78, 80, 0.1);
    vertical-align: top;
}

.document-table th {
    color: #FFFFFF;
    background: #1A4E50;
    font-size: 12px;
    text-align: left;
}

.document-items-table {
    table-layout: fixed;
}

.document-item-position {
    width: 25%;
}

.document-item-qty {
    width: 12%;
}

.document-item-price {
    width: 23%;
}

.document-item-discount {
    width: 15%;
}

.document-item-tax {
    width: 11%;
}

.document-item-total {
    width: 14%;
}

.document-items-table th,
.document-items-table td {
    padding-left: 10px;
    padding-right: 10px;
    font-size: 12px;
}

.document-items-table .number-cell {
    white-space: nowrap;
}

.document-table tr:nth-child(even) td {
    background: #F7F9F8;
}

.document-table tr:last-child td {
    border-bottom: 0;
}

.number-cell,
.document-table th.number-cell {
    text-align: left;
    white-space: nowrap;
}

.document-summary {
    display: grid;
    width: min(100%, 360px);
    margin: 28px 0 0 auto;
    overflow: hidden;
    border: 1px solid rgba(26, 78, 80, 0.15);
    border-radius: 8px;
}

.document-summary div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(26, 78, 80, 0.1);
}

.document-summary div:last-child {
    border-bottom: 0;
}

.document-summary span {
    color: #6A7B7D;
    font-weight: 800;
}

.document-summary strong {
    color: #1A4E50;
}

.document-summary-total {
    color: #FFFFFF;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0)),
        #27585A;
}

.document-summary-total span,
.document-summary-total strong {
    color: #FFFFFF;
    font-size: 17px;
}

.document-notes,
.document-closing {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid rgba(26, 78, 80, 0.12);
    color: #445B5D;
    line-height: 1.65;
}

.document-notes h2 {
    margin: 0 0 8px;
    color: #1A4E50;
    font-size: 15px;
}

.document-notes p,
.document-closing p {
    margin: 0;
}

.document-footer {
    display: grid;
    grid-template-columns: 1.35fr 0.9fr 1.35fr;
    gap: 24px;
    margin-top: 36px;
    padding-top: 16px;
    border-top: 2px solid #AD9779;
    color: #6A7B7D;
    font-size: 12px;
    line-height: 1.55;
}

.document-footer div {
    display: grid;
    align-content: start;
    gap: 3px;
    min-width: 0;
}

.document-footer strong,
.document-footer span {
    overflow-wrap: anywhere;
}

.document-footer strong {
    color: #1A4E50;
}

.client-pdf-page .print-sheet {
    width: 794px;
    min-height: 1113px;
    box-sizing: border-box;
    box-shadow: none;
}

.client-pdf-page .document-shell {
    display: flex;
    min-height: calc(1113px - 92px);
    flex-direction: column;
}

.client-pdf-page .document-footer {
    margin-top: auto;
    margin-bottom: 10px;
}

.client-pdf-page .document-address,
.client-pdf-page .document-meta,
.client-pdf-page .document-table,
.client-pdf-page .document-summary {
    box-shadow: none;
}

.email-preview-shell {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #EAF2F0;
}

.email-preview-frame {
    display: block;
    width: 100%;
    min-height: 720px;
    border: 0;
    background: #EAF2F0;
}

@media print {
    @page {
        size: A4;
        margin: 14mm;
    }

    body {
        background: #FFFFFF;
    }

    .print-page {
        padding: 0;
        background: #FFFFFF;
    }

    .print-actions {
        display: none;
    }

    .print-sheet {
        width: auto;
        margin: 0;
        padding: 0;
        box-shadow: none;
    }

    .document-shell::before {
        display: none;
    }

    .document-shell {
        padding-top: 130px;
        padding-bottom: 110px;
    }

    .document-hero {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 10;
        margin: 0;
        padding: 24px 34px;
        border-radius: 0;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .document-footer {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 10;
        margin: 0;
        padding: 12px 0 0;
        background: #FFFFFF;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .document-address,
    .document-meta,
    .document-table,
    .document-summary {
        box-shadow: none;
        break-inside: avoid;
    }
}

.auth-page {
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        linear-gradient(90deg, rgba(10, 38, 39, 0.86) 0%, rgba(26, 78, 80, 0.62) 42%, rgba(26, 78, 80, 0.18) 100%),
        url("../img/crm-login-background.png") center / cover no-repeat fixed,
        linear-gradient(135deg, var(--dark-petrol), var(--petrol));
}

.auth-shell {
    display: grid;
    width: min(100%, 1120px);
    min-height: calc(100vh - 56px);
    align-items: center;
    justify-items: start;
}

.login-card {
    width: min(100%, 450px);
    padding: 34px;
    border-color: rgba(255, 255, 255, 0.34);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.76)),
        rgba(255, 255, 255, 0.78);
    box-shadow: 0 28px 80px rgba(4, 27, 28, 0.34);
}

.login-header {
    margin-bottom: 24px;
}

.login-header .brand-mark {
    margin-bottom: 14px;
}

.login-header p {
    margin: 6px 0 0;
    color: var(--muted);
}

.login-card .button {
    min-height: 48px;
}

.form {
    display: grid;
    gap: 16px;
}

.form-wide {
    gap: 24px;
}

.form label {
    display: grid;
    gap: 7px;
    font-weight: 700;
}

.form input,
.form select,
.form textarea,
.filter-bar input,
.filter-bar select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font: inherit;
    background: rgba(255, 255, 255, 0.86);
}

.form textarea {
    min-height: 120px;
    resize: vertical;
}

.form small {
    color: var(--error);
    font-weight: 400;
}

fieldset {
    margin: 0;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

legend {
    padding: 0 8px;
    color: var(--gold);
    font-weight: 700;
}

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

.span-2 {
    grid-column: span 2;
}

.form-actions,
.action-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 180px auto;
    align-items: end;
    gap: 14px;
    margin-bottom: 20px;
}

.crm-filter-bar {
    grid-template-columns: minmax(260px, 1fr) 170px 190px 150px auto;
}

.lead-filter-bar {
    grid-template-columns: minmax(240px, 1fr) 190px 170px 90px 140px 130px 100px auto;
}

.generator-search {
    display: grid;
    grid-template-columns: 220px minmax(220px, 1fr) 180px 140px auto;
    align-items: end;
    gap: 14px;
}

.product-filter-bar {
    grid-template-columns: minmax(240px, 1fr) 160px 190px 130px auto;
}

.batch-filter-bar {
    grid-template-columns: minmax(220px, 1fr) 190px 190px 120px 120px 120px 120px 150px 140px auto;
}

.filter-bar label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-weight: 700;
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: var(--petrol);
    font-size: 13px;
    text-transform: uppercase;
}

.data-table td span {
    display: block;
    color: var(--muted);
    margin-top: 2px;
}

.data-table.compact {
    min-width: 560px;
}

.crm-table {
    min-width: 1120px;
}

.lead-table {
    min-width: 1180px;
}

.generator-table {
    min-width: 1040px;
}

.product-table {
    min-width: 1280px;
}

.batch-table {
    min-width: 1380px;
}

.billing-items-table {
    min-width: 1180px;
}

.billing-items-table th:first-child {
    width: 260px;
}

.billing-items-table th:nth-child(2) {
    width: 320px;
}

.number-range-table {
    min-width: 900px;
}

.reminder-table {
    min-width: 1420px;
}

.traffic-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 16px;
}

.reminder-table th:first-child,
.reminder-table td:first-child {
    width: 165px;
}

.reminder-row-green {
    background: rgba(48, 135, 91, 0.05);
}

.reminder-row-yellow {
    background: rgba(173, 151, 121, 0.10);
}

.reminder-row-orange {
    background: rgba(199, 116, 39, 0.09);
}

.reminder-row-red {
    background: rgba(184, 61, 61, 0.08);
}

.reminder-row-stopped {
    background: rgba(26, 78, 80, 0.06);
}

.traffic-light {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    padding: 3px 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.traffic-light i {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    box-shadow: 0 0 0 4px currentColor;
    opacity: 0.28;
}

.traffic-light-green {
    background: #E6F2EC;
    border-color: rgba(48, 135, 91, 0.22);
    color: #30875B;
}

.traffic-light-yellow {
    background: #F7F0E3;
    border-color: rgba(173, 151, 121, 0.38);
    color: #8A6D2D;
}

.traffic-light-orange {
    background: #FAEBDC;
    border-color: rgba(199, 116, 39, 0.28);
    color: #B85E1D;
}

.traffic-light-red {
    background: #F4E6E6;
    border-color: rgba(184, 61, 61, 0.28);
    color: #B83D3D;
}

.traffic-light-stopped {
    background: rgba(26, 78, 80, 0.10);
    border-color: rgba(26, 78, 80, 0.20);
    color: var(--petrol);
}

.report-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 14px;
    margin-top: 18px;
}

.report-filter label {
    min-width: 190px;
}

.report-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.report-kpi {
    min-height: 132px;
    padding: 20px;
    border: 1px solid rgba(173, 151, 121, 0.34);
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(255,255,255,0.86), rgba(231,239,236,0.74)),
        #FFFFFF;
    box-shadow: var(--shadow-soft);
}

.report-kpi span,
.report-kpi em {
    display: block;
    color: var(--muted);
    font-style: normal;
    font-weight: 700;
}

.report-kpi strong {
    display: block;
    margin: 10px 0 8px;
    color: var(--dark-petrol);
    font-size: 30px;
    line-height: 1.1;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.report-grid-wide {
    grid-template-columns: repeat(auto-fit, minmax(430px, 1fr));
}

.report-card h3 {
    margin: 0 0 14px;
    color: var(--dark-petrol);
}

.report-bars {
    display: grid;
    gap: 13px;
}

.report-bar-label {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: var(--dark-petrol);
    font-weight: 800;
}

.report-bar-label strong {
    white-space: nowrap;
}

.report-bar-track {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(26, 78, 80, 0.10);
}

.report-bar-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--petrol), var(--gold));
}

.report-table {
    min-width: 640px;
}

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

.report-warning-list div {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
}

.report-warning-list strong,
.report-warning-list span {
    display: block;
}

.report-warning-list span {
    color: var(--muted);
    margin-top: 3px;
}

.report-print-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    margin-bottom: 24px;
    padding: 24px;
    border-radius: 8px;
    background: linear-gradient(145deg, #1A4E50, #27585A);
    color: #FFFFFF;
}

.report-print-header h1 {
    margin: 0;
    font-size: 38px;
}

.report-print-header strong,
.report-print-header span {
    display: block;
}

.report-print-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 22px;
}

.report-print-kpis article {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.report-print-kpis span,
.report-print-kpis em {
    display: block;
    color: var(--muted);
    font-style: normal;
    font-size: 12px;
}

.report-print-kpis strong {
    display: block;
    margin: 6px 0;
    color: var(--dark-petrol);
    font-size: 20px;
}

.report-print-section {
    margin: 22px 0;
}

.report-print-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin: 22px 0;
}

.report-print-section h2,
.report-print-grid h2 {
    margin: 0 0 12px;
    color: var(--dark-petrol);
    font-size: 18px;
}

.report-print-table {
    width: 100%;
    font-size: 12px;
}


.reminder-level-table {
    min-width: 1420px;
}

.data-table.document-table {
    min-width: 1280px;
    table-layout: fixed;
}

.document-col-select {
    width: 44px;
}

.document-col-name {
    width: 280px;
}

.document-col-type {
    width: 125px;
}

.document-col-category {
    width: 120px;
}

.document-col-relation {
    width: 260px;
}

.document-col-date {
    width: 150px;
}

.document-col-user {
    width: 120px;
}

.document-col-tags {
    width: 100px;
}

.document-col-actions {
    width: 112px;
}

.data-table.document-table th {
    background: var(--dark-petrol);
    color: var(--white);
    padding: 14px 12px;
}

.data-table.document-table th a,
.data-table.document-table th span,
.data-table.document-table th label {
    color: var(--white);
}

.document-table th.select-cell,
.document-table td.select-cell {
    width: 44px;
    padding-left: 10px;
    padding-right: 10px;
    text-align: center;
}

.document-table .select-cell input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--dark-petrol);
    cursor: pointer;
}

.document-table td {
    overflow-wrap: anywhere;
}

.document-table .document-name-cell strong {
    display: block;
    max-width: 100%;
    color: var(--dark-petrol);
    line-height: 1.45;
}

.document-table .document-nowrap-cell {
    white-space: nowrap;
}

.document-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.document-actions .inline-form {
    display: inline-flex;
    margin: 0;
}

.icon-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: 0;
    border: 1px solid rgba(26, 78, 80, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--dark-petrol);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.icon-action svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-action:hover,
.icon-action:focus-visible {
    background: var(--dark-petrol);
    border-color: var(--dark-petrol);
    color: var(--white);
    transform: translateY(-1px);
}

.danger-icon-action {
    border-color: rgba(178, 58, 58, 0.22);
    color: var(--error);
}

.danger-icon-action:hover,
.danger-icon-action:focus-visible {
    background: var(--error);
    border-color: var(--error);
    color: var(--white);
}

.task-table {
    min-width: 1180px;
}

.document-filter-bar {
    grid-template-columns: minmax(260px, 1fr) 190px auto;
}

.task-filter-bar {
    grid-template-columns: minmax(240px, 1fr) 160px 170px 150px 190px auto;
}

.task-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

.task-priority-low {
    background: #E9F3EF;
    color: #3E6E5B;
}

.task-priority-normal {
    background: #EAF1F7;
    color: #3D637B;
}

.task-priority-high {
    background: #FFF1D8;
    color: #8A5E18;
}

.task-priority-urgent {
    background: #F8E1E1;
    color: #9B3D3D;
}

.task-status-open {
    background: #EEE9E2;
    color: #6D655A;
}

.task-status-processing {
    background: #E1EEF7;
    color: #35677F;
}

.task-status-done {
    background: #DFF3E8;
    color: #247255;
}

.task-status-postponed {
    background: #EFE7F6;
    color: #6D4F82;
}

.task-status-cancelled {
    background: #F4E4E4;
    color: #9A4747;
}

.task-inline-update {
    display: inline-flex;
    margin: 0;
}

.task-select {
    min-height: 28px;
    max-width: 150px;
    padding: 3px 26px 3px 10px;
    border: 1px solid rgba(26, 78, 80, 0.10);
    border-radius: 999px;
    color: inherit;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
    cursor: pointer;
    outline: none;
}

.task-select:focus {
    border-color: rgba(26, 78, 80, 0.32);
    box-shadow: 0 0 0 3px rgba(26, 78, 80, 0.08);
}

.accounting-table {
    min-width: 1280px;
}

.accounting-payment-form {
    display: grid;
    grid-template-columns: 135px 100px 90px 140px 120px auto;
    gap: 8px;
    align-items: center;
    min-width: 720px;
    margin: 0;
}

.accounting-payment-form input,
.accounting-payment-form select {
    min-height: 36px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--text);
    font: inherit;
}

.accounting-form-hint {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
}

.status-paid {
    background: #DFF3E8;
    color: #247255;
}

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

.document-prep-grid div {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.60);
}

.document-prep-grid strong,
.document-prep-grid span {
    display: block;
}

.document-prep-grid span {
    color: var(--muted);
    font-size: 13px;
    margin-top: 4px;
}

.nested-panel {
    margin-top: 10px;
    box-shadow: none;
}

.text-danger {
    color: var(--error) !important;
    font-weight: 700;
}

.table-bulk-actions {
    margin-top: 18px;
}

.table-actions {
    white-space: nowrap;
}

.table-actions a {
    color: var(--petrol);
    font-weight: 700;
    margin-left: 12px;
    text-decoration: none;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.status-active {
    background: #E6F2EC;
    color: var(--success);
}

.status-prospect {
    background: rgba(173, 151, 121, 0.18);
    color: var(--dark-petrol);
}

.status-inactive,
.status-archived {
    background: rgba(26, 78, 80, 0.10);
    color: var(--petrol);
}

.status-blocked {
    background: #F4E6E6;
    color: var(--error);
}

.status-new,
.status-contacted,
.status-interested,
.status-offer_sent,
.status-follow_up,
.status-won,
.status-lost,
.status-unreachable {
    background: rgba(173, 151, 121, 0.18);
    color: var(--dark-petrol);
}

.status-won {
    background: #E6F2EC;
    color: var(--success);
}

.status-lost,
.status-unreachable {
    background: #F4E6E6;
    color: var(--error);
}

.status-success {
    background: #E6F2EC;
    color: var(--success);
}

.status-signed {
    background: #DFF3E8;
    color: #247255;
}

.status-warning,
.status-prepared {
    background: rgba(173, 151, 121, 0.22);
    color: var(--dark-petrol);
}

.status-failed {
    background: #F4E6E6;
    color: var(--error);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-bottom: 24px;
}

.detail-grid article {
    min-width: 0;
}

.detail-grid h3 {
    margin: 0 0 12px;
    font-size: 18px;
}

.detail-list {
    display: grid;
    grid-template-columns: minmax(190px, 0.9fr) minmax(0, 1fr);
    gap: 10px 14px;
    margin: 0;
}

.detail-list dt {
    color: var(--muted);
    font-weight: 700;
    min-width: 0;
    overflow-wrap: anywhere;
}

.detail-list dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.address-block,
.notes-block,
.muted {
    color: var(--muted);
}

.delete-form {
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.danger-zone {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.danger-button {
    border-color: var(--error);
    background: var(--error);
}

.content-reset-box {
    align-items: flex-start;
    background: rgba(177, 62, 62, 0.06);
    border: 1px solid rgba(177, 62, 62, 0.22);
    border-radius: 8px;
    padding: 18px;
}

.content-reset-box > div {
    flex: 1 1 320px;
}

.content-reset-box h3 {
    margin: 0 0 10px;
}

.content-reset-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.content-reset-list span {
    border-radius: 999px;
    padding: 6px 10px;
    background: rgba(177, 62, 62, 0.12);
    color: #7C2D2D;
    font-weight: 700;
    font-size: 13px;
}

.content-reset-keep span {
    background: rgba(36, 114, 85, 0.13);
    color: #247255;
}

.content-reset-form {
    margin-top: 18px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.automation-rule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.admin-card {
    display: grid;
    gap: 8px;
    min-height: 130px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
}

.admin-card:hover {
    border-color: var(--gold);
}

.admin-card strong {
    font-size: 17px;
}

.admin-card span {
    color: var(--muted);
}

.inline-form {
    display: inline;
    margin-left: 12px;
}

.inline-form button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--error);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.danger-link {
    color: var(--error);
}

.danger-link:hover,
.danger-link:focus-visible {
    text-decoration: underline;
}

.inline-danger {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--error);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    margin-left: 12px;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 10px !important;
    min-height: 44px;
}

.checkbox-label input {
    width: 18px;
    min-height: 18px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.45);
}

.modal-backdrop[hidden] {
    display: none;
}

.modal-box {
    width: min(100%, 560px);
    padding: 24px;
    border-radius: 8px;
    background: var(--white);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.icon-close {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    color: var(--text);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.search-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(22, 24, 30, 0.58);
    backdrop-filter: blur(5px);
}

.search-loading-overlay[hidden] {
    display: none;
}

.search-loading-card {
    width: min(100%, 430px);
    padding: 34px 26px 24px;
    border-radius: 24px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03)),
        linear-gradient(160deg, var(--dark-petrol), #12393A);
    color: var(--white);
    text-align: center;
    box-shadow: 0 26px 80px rgba(0, 0, 0, 0.32);
}

.search-orbit {
    position: relative;
    width: 122px;
    height: 122px;
    margin: 0 auto 18px;
}

.orbit-ring,
.orbit-dot,
.orbit-center,
.orbit-pin {
    position: absolute;
    display: block;
}

.orbit-ring {
    inset: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
}

.orbit-ring-two {
    inset: 0;
    animation: orbitPulse 1.8s ease-in-out infinite;
}

.orbit-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--white);
    box-shadow: 0 0 28px rgba(173, 151, 121, 0.9);
    animation: orbitSpin 2.4s linear infinite;
}

.orbit-dot-one {
    top: 8px;
    left: 54px;
    transform-origin: 7px 53px;
}

.orbit-dot-two {
    right: 8px;
    top: 70px;
    transform-origin: -53px -9px;
    animation-duration: 3s;
}

.orbit-dot-three {
    left: 8px;
    bottom: 30px;
    transform-origin: 53px -21px;
    animation-duration: 3.5s;
}

.orbit-center {
    inset: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--white);
}

.orbit-pin {
    width: 16px;
    height: 16px;
    border: 4px solid var(--petrol);
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
}

.orbit-pin::after {
    content: "";
    position: absolute;
    width: 5px;
    height: 5px;
    top: 2px;
    left: 2px;
    border-radius: 50%;
    background: var(--petrol);
}

.search-loading-card h2 {
    margin: 0 0 12px;
    font-size: 22px;
}

.search-loading-card p {
    margin: 0 auto 24px;
    max-width: 350px;
    color: rgba(255, 255, 255, 0.76);
}

.search-loading-meta {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.search-progress {
    height: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
}

.search-progress span {
    display: block;
    width: 44%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--white), var(--gold), #D8CBB8);
    animation: progressSweep 1.6s ease-in-out infinite;
}

@keyframes orbitSpin {
    from { rotate: 0deg; }
    to { rotate: 360deg; }
}

@keyframes orbitPulse {
    0%, 100% { opacity: 0.5; transform: scale(0.96); }
    50% { opacity: 1; transform: scale(1.04); }
}

@keyframes progressSweep {
    0% { transform: translateX(-105%); }
    50% { transform: translateX(70%); }
    100% { transform: translateX(235%); }
}

.public-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(173, 151, 121, 0.24), transparent 32%),
        linear-gradient(135deg, #F7FAF9 0%, #E7EFEC 100%);
}

.public-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0;
}

.public-offer {
    display: grid;
    gap: 24px;
}

.public-offer-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 34px 38px;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.02) 42%, rgba(173, 151, 121, 0.18)),
        linear-gradient(135deg, var(--dark-petrol), #164244);
    color: var(--white);
    box-shadow: 0 24px 70px rgba(26, 78, 80, 0.22);
}

.public-offer-hero h1,
.public-card h1,
.public-card h2 {
    margin: 0;
}

.public-offer-hero h1 {
    font-size: clamp(30px, 5vw, 54px);
    line-height: 1.05;
}

.public-offer-hero p {
    margin: 10px 0 0;
    color: rgba(255, 255, 255, 0.86);
}

.public-kicker {
    display: block;
    margin-bottom: 10px;
    color: var(--gold);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.public-offer-status {
    min-width: 190px;
    padding: 13px 18px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    font-weight: 800;
    text-align: center;
}

.public-offer-status.is-accepted {
    background: rgba(36, 114, 85, 0.78);
}

.public-offer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
    gap: 24px;
}

.public-card {
    padding: 24px;
    border: 1px solid rgba(26, 78, 80, 0.13);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.64)),
        var(--white);
    box-shadow: var(--shadow);
}

.public-card p {
    margin: 12px 0 0;
}

.public-facts {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0;
    margin: 0;
}

.public-facts dt,
.public-facts dd {
    margin: 0;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.public-facts dt {
    color: var(--muted);
    font-weight: 800;
}

.public-facts dd {
    color: var(--text);
    font-weight: 800;
    text-align: right;
}

.public-table-card h2 {
    margin-bottom: 16px;
}

.public-items th,
.public-items td {
    text-align: left;
}

.public-total-box {
    justify-self: end;
    width: min(100%, 430px);
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.public-total-box dl {
    display: grid;
    grid-template-columns: 1fr auto;
    margin: 0;
}

.public-total-box dt,
.public-total-box dd {
    margin: 0;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 800;
}

.public-total-box dd {
    text-align: right;
}

.public-total-box dt:last-of-type,
.public-total-box dd:last-of-type {
    border-bottom: 0;
    background: linear-gradient(135deg, var(--petrol), var(--dark-petrol));
    color: var(--white);
    font-size: 18px;
}

.public-acceptance .form {
    max-width: 620px;
    margin-top: 16px;
}

.checkbox-line {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--text);
    font-weight: 700;
}

.checkbox-line input {
    width: auto;
    margin-top: 5px;
}

.public-result {
    min-height: calc(100vh - 68px);
    align-content: center;
}

.public-accepted-card {
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

.signature-form {
    max-width: 760px;
}

.signature-pad-wrap {
    position: relative;
    overflow: hidden;
    min-height: 220px;
    border: 1px solid rgba(26, 78, 80, 0.22);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.68)),
        #FFFFFF;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.signature-pad {
    display: block;
    width: 100%;
    height: 220px;
    touch-action: none;
    cursor: crosshair;
}

.signature-pad-line {
    position: absolute;
    right: 34px;
    bottom: 42px;
    left: 34px;
    height: 1px;
    background: rgba(26, 78, 80, 0.24);
    pointer-events: none;
}

.signature-actions {
    display: flex;
    justify-content: flex-end;
}

.signature-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 520px;
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
}

.signature-preview img {
    display: block;
    max-width: 100%;
    height: auto;
}

.order-signature-preview {
    margin-top: 18px;
    max-width: 360px;
}

@media (max-width: 900px) {
    .auth-page {
        background:
            linear-gradient(180deg, rgba(10, 38, 39, 0.82), rgba(26, 78, 80, 0.54)),
            url("../img/crm-login-background.png") center / cover no-repeat,
            linear-gradient(135deg, var(--dark-petrol), var(--petrol));
    }

    .auth-shell {
        justify-items: center;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 90;
        width: min(86vw, 330px);
        max-width: 330px;
        padding: 20px 16px;
        overflow-y: auto;
        transform: translateX(-104%);
        transition: transform 220ms ease;
        box-shadow: 24px 0 70px rgba(6, 31, 32, 0.34);
    }

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

    .sidebar-close,
    .mobile-menu-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .brand {
        margin-bottom: 22px;
    }

    .nav-list {
        gap: 8px;
        padding-bottom: 20px;
    }

    .nav-list a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

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

    .filter-bar,
    .crm-filter-bar,
    .lead-filter-bar,
    .generator-search,
    .product-filter-bar,
    .batch-filter-bar,
    .document-filter-bar,
    .task-filter-bar,
    .admin-grid,
    .dashboard-layout,
    .detail-grid,
    .document-prep-grid {
        grid-template-columns: 1fr;
    }

    .chart-panel:first-child {
        grid-column: span 1;
    }

    .public-offer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .auth-page {
        padding: 18px;
    }

    .auth-shell {
        min-height: calc(100vh - 36px);
    }

    .login-card {
        padding: 24px;
    }

    .topbar,
    .topbar-user {
        align-items: flex-start;
        flex-direction: column;
    }

    .content,
    .topbar {
        padding: 22px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .donut-wrap {
        grid-template-columns: 1fr;
    }

    .panel-header-actions,
    .form-grid {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .span-2 {
        grid-column: span 1;
    }

    .filter-bar {
        align-items: stretch;
    }

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

    .public-shell {
        width: min(100% - 20px, 1120px);
        padding: 18px 0;
    }

    .public-offer-hero {
        align-items: flex-start;
        flex-direction: column;
        padding: 24px;
    }

    .public-offer-status {
        min-width: 0;
        width: 100%;
    }

    .public-card {
        padding: 18px;
    }

    .signature-pad-wrap,
    .signature-pad {
        min-height: 180px;
        height: 180px;
    }

    .public-facts {
        grid-template-columns: 1fr;
    }

    .public-facts dd {
        padding-top: 0;
        text-align: left;
    }
}
