@font-face {
    font-family: "Plus Jakarta Sans";
    src: url("../fonts/PlusJakartaSans-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: "Plus Jakarta Sans";
    src: url("../fonts/PlusJakartaSans-Medium.ttf") format("truetype");
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: "Plus Jakarta Sans";
    src: url("../fonts/PlusJakartaSans-SemiBold.ttf") format("truetype");
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: "Plus Jakarta Sans";
    src: url("../fonts/PlusJakartaSans-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
}

:root {
    --brand: #17446e;
    --brand-light: #2678b9;
    --bs-font-sans-serif: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

body {
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    background: #f5f7fb;
    color: #1f2937;
}

.app-chooser-body {
    min-height: 100vh;
    background: #edf2f7;
}

.app-chooser {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.app-chooser-panel {
    width: min(820px, 100%);
    background: #fff;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, .12);
}

.app-chooser-kicker {
    color: var(--brand);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .78rem;
}

.app-chooser-card {
    display: flex;
    flex-direction: column;
    min-height: 160px;
    padding: 22px;
    border: 1px solid #d7e1ec;
    border-radius: 8px;
    background: #f8fafc;
    color: #1f2937;
    text-decoration: none;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.app-chooser-card:hover,
.app-chooser-card:focus {
    transform: translateY(-2px);
    border-color: var(--brand-light);
    background: #fff;
    box-shadow: 0 12px 26px rgba(15, 23, 42, .12);
    color: #1f2937;
}

.app-chooser-title {
    color: var(--brand);
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: .6rem;
}

.app-chooser-text {
    color: #64748b;
    line-height: 1.55;
}

.bg-primary {
    background: var(--brand) !important;
}

.page-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}

.nav-guide-item {
    margin-left: .75rem;
    padding-left: .75rem;
    border-left: 1px solid rgba(255, 255, 255, .28);
}

.navbar-dark .navbar-nav .nav-guide-link {
    background: #fff;
    color: var(--brand) !important;
    border-radius: 6px;
    padding-right: .9rem;
    padding-left: .9rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .16);
}

.navbar-dark .navbar-nav .nav-guide-link:hover,
.navbar-dark .navbar-nav .nav-guide-link:focus {
    background: #eef6ff;
    color: var(--brand) !important;
}

.guide-hero {
    background: #fff;
    border: 1px solid #dbe4ef;
    border-left: 6px solid var(--brand-light);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}

.guide-section {
    scroll-margin-top: 88px;
}

.guide-section h2 {
    color: var(--brand);
}

.guide-list li + li {
    margin-top: .45rem;
}

.guide-step {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
}

.guide-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    font-size: .85rem;
}

@media (max-width: 991.98px) {
    .nav-guide-item {
        margin-left: 0;
        padding-left: 0;
        border-left: 0;
        margin-top: .5rem;
    }

    .navbar-dark .navbar-nav .nav-guide-link {
        display: inline-block;
    }
}

.table > :not(caption) > * > * {
    vertical-align: middle;
}

.badge-state {
    text-transform: uppercase;
    letter-spacing: .04em;
}

.action-menu-button {
    width: 34px;
    height: 30px;
    padding: 0;
    font-weight: 700;
    line-height: 1;
}

.quotes-table-card.table-responsive {
    overflow: visible;
}

@media (max-width: 767.98px) {
    .quotes-table-card.table-responsive {
        overflow-x: auto;
    }
}

.signature-pad-wrap {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

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

.intervention-material-rows {
    display: grid;
    gap: .75rem;
}

.intervention-document {
    max-width: 920px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 30px 34px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
    color: #4b5563;
    font-size: .92rem;
}

.intervention-doc-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.intervention-doc-header h2 {
    margin: 0;
    color: var(--brand);
    font-size: 1.6rem;
    line-height: 1.15;
}

.intervention-doc-header img {
    max-width: 128px;
    max-height: 68px;
    object-fit: contain;
}

.intervention-letterhead {
    display: table;
    width: 100%;
    table-layout: fixed;
    margin-bottom: 18px;
}

.intervention-letterhead-logo-cell {
    display: table-cell;
    width: 180px;
    vertical-align: top;
}

.intervention-letterhead-logo {
    display: block;
    width: 124px;
    max-width: 124px;
    height: auto;
}

.intervention-letterhead-company {
    display: table-cell;
    width: auto;
    vertical-align: top;
    color: #111827;
    text-align: right;
    line-height: 1.32;
    font-size: .78rem;
}

.intervention-doc-title {
    margin-bottom: 10px;
}

.intervention-doc-title h2 {
    margin: 0;
    color: var(--brand);
    font-size: 1.35rem;
}

.intervention-doc-subtitle {
    color: var(--brand-light);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-top: 6px;
}

.intervention-doc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    padding: 8px 0 0;
    color: #1f2937;
}

.intervention-doc-meta-compact {
    justify-content: flex-end;
    font-size: .86rem;
}

.intervention-report-head {
    display: grid;
    grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
    gap: 28px;
    align-items: end;
    border-bottom: 1px solid #e5e7eb;
    border-top: 2px solid var(--brand);
    padding-top: 14px;
    padding-bottom: 14px;
    margin-bottom: 16px;
}

.intervention-report-main {
    min-width: 0;
    text-align: right;
}

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

.intervention-doc-client {
    max-width: none;
    margin-bottom: 0;
}

.intervention-doc-label {
    color: var(--brand-light);
    font-size: .66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 5px;
}

.intervention-party {
    background: #eef3f8;
    border: 1px solid #cfd8e3;
    border-radius: 8px;
    padding: 9px 11px;
    min-height: 0;
    line-height: 1.38;
    font-size: .86rem;
}

.intervention-party strong {
    color: var(--brand);
}

.intervention-section h3 {
    margin: 12px 0 5px;
    border-left: 5px solid var(--brand-light);
    padding-left: 8px;
    color: var(--brand);
    font-size: .86rem;
    font-weight: 700;
}

.intervention-card {
    background: #eef3f8;
    border: 1px solid #cfd8e3;
    border-radius: 8px;
    padding: 7px 10px;
    line-height: 1.34;
    font-size: .82rem;
}

.intervention-section-activity .intervention-card {
    min-height: 74px;
}

.intervention-section-material {
    margin-top: 12px;
}

.intervention-doc-acceptance .intervention-section h3 {
    margin-top: 0;
}

.intervention-doc-acceptance .intervention-section + .intervention-section,
.intervention-doc-acceptance .intervention-section + .intervention-costs {
    margin-top: 6px;
}

.intervention-material-table {
    width: 100%;
    border-collapse: collapse;
}

.intervention-material-table th,
.intervention-material-table td {
    padding: 5px 9px;
    border-bottom: 1px solid #cfd8e3;
    text-align: left;
    font-size: .78rem;
    line-height: 1.24;
}

.intervention-material-table th:last-child,
.intervention-material-table td:last-child {
    width: 110px;
    text-align: right;
}

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

.intervention-note {
    border-color: #f59e0b;
    border-left: 5px solid #d97706;
    background: #fff3df;
    color: #7c2d12;
    font-weight: 700;
}

.intervention-note-client {
    border-color: #f59e0b;
    border-left: 5px solid #d97706;
    background: #fff3df;
    color: #7c2d12;
    font-size: .78rem;
    line-height: 1.25;
    font-weight: 700;
}

.intervention-costs {
    margin-top: 12px;
    margin-bottom: 8px;
    padding: 5px 8px;
    border: 1px solid #cfd8e3;
    border-left: 5px solid var(--brand);
    border-radius: 8px;
    background: #f8fafc;
    color: #1f2937;
    font-size: .72rem;
    line-height: 1.28;
    font-family: inherit;
    font-weight: 400;
}

.intervention-costs strong {
    font-weight: 700;
}

.intervention-doc-acceptance {
    margin-top: 12px;
    padding-top: 7px;
}

.intervention-acceptance-rule {
    border-top: 2px solid var(--brand);
    margin: 0 0 7px;
}

.intervention-doc-acceptance p {
    margin: 0 0 3px;
    font-size: .68rem;
    line-height: 1.12;
}

.intervention-signature-grid {
    display: grid;
    grid-template-columns: minmax(180px, .55fr) minmax(260px, 1fr);
    gap: 24px;
    align-items: end;
}

.intervention-signature-label {
    color: #64748b;
    font-size: .62rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.intervention-signature-value {
    color: #1f2937;
    margin-top: 5px;
    font-size: .82rem;
}

.intervention-signature-box,
.intervention-signature-empty {
    min-height: 62px;
    margin-top: 5px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    padding: 10px;
}

.intervention-signature-box img {
    display: block;
    max-width: 220px;
    width: 100%;
    max-height: 62px;
    height: auto;
    object-fit: contain;
}

.intervention-signature-empty {
    display: flex;
    align-items: center;
    color: #64748b;
}

@media (max-width: 767.98px) {
    .intervention-document {
        padding: 22px;
    }

    .intervention-doc-header,
    .intervention-report-head,
    .intervention-doc-columns,
    .intervention-signature-grid {
        grid-template-columns: 1fr;
        display: grid;
    }
}

@media (max-width: 480px) {
    .intervention-letterhead {
        display: block;
    }

    .intervention-letterhead-logo-cell,
    .intervention-letterhead-company {
        display: block;
    }

    .intervention-letterhead-company {
        text-align: left;
        margin-top: 12px;
    }
}

@media print {
    .navbar,
    .no-print {
        display: none !important;
    }

    body {
        background: #fff;
    }

    main.container {
        width: 100%;
        max-width: none;
        padding: 0 !important;
    }

    .page-card,
    .intervention-document {
        box-shadow: none;
        border: 0;
    }

    .intervention-document {
        font-size: .86rem !important;
    }

    .intervention-letterhead {
        display: table !important;
        width: 100% !important;
        table-layout: fixed !important;
        margin-bottom: 8px !important;
        margin-left: -17px !important;
        margin-right: -17px !important;
        width: calc(100% + 34px) !important;
    }

    .intervention-letterhead-company {
        display: table-cell !important;
        vertical-align: top !important;
        text-align: right !important;
        font-size: .68rem !important;
        line-height: 1.18 !important;
    }

    .intervention-letterhead-logo-cell {
        display: table-cell !important;
        width: 150px !important;
        vertical-align: top !important;
    }

    .intervention-letterhead-logo {
        width: 104px !important;
        max-width: 104px !important;
    }

    .intervention-report-head {
        display: grid !important;
        grid-template-columns: minmax(280px, 380px) minmax(0, 1fr) !important;
        align-items: end !important;
        gap: 18px !important;
        padding-top: 8px !important;
        padding-bottom: 8px !important;
        margin-bottom: 10px !important;
        margin-left: -17px !important;
        margin-right: -17px !important;
    }

    .intervention-doc-title {
        margin-bottom: 5px !important;
    }

    .intervention-doc-title h2 {
        font-size: 1.16rem !important;
    }

    .intervention-doc-subtitle {
        margin-top: 3px !important;
        font-size: .6rem !important;
    }

    .intervention-doc-meta {
        padding-top: 4px !important;
        gap: 4px 12px !important;
    }

    .intervention-party {
        padding: 6px 9px !important;
        font-size: .78rem !important;
        line-height: 1.24 !important;
    }

    .intervention-signature-grid {
        display: grid !important;
        grid-template-columns: minmax(180px, .55fr) minmax(260px, 1fr) !important;
        align-items: end !important;
        gap: 12px !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .intervention-doc-acceptance {
        margin-top: 0 !important;
        padding-top: 0 !important;
        page-break-inside: avoid;
        break-inside: avoid;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 6mm;
        background: #fff;
    }

    .intervention-acceptance-rule {
        margin-bottom: 5px !important;
    }

    .intervention-doc-acceptance p {
        margin-bottom: 2px !important;
        font-size: .66rem !important;
        line-height: 1.08 !important;
    }

    .intervention-signature-value {
        margin-top: 3px !important;
        font-size: .76rem !important;
    }

    .intervention-section-request,
    .intervention-section-activity {
        margin-left: -17px !important;
        margin-right: -17px !important;
    }

    .intervention-costs {
        margin-top: 0 !important;
        margin-bottom: 6px !important;
        padding: 4px 7px !important;
        font-size: .68rem !important;
        line-height: 1.18 !important;
        font-weight: 400 !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .intervention-card {
        padding: 5px 8px !important;
        font-size: .76rem !important;
        line-height: 1.22 !important;
    }

    .intervention-section-activity .intervention-card {
        min-height: 62px !important;
    }

    .intervention-section-material {
        margin-top: 0 !important;
    }

    .intervention-doc-acceptance .intervention-section h3 {
        margin-top: 0 !important;
    }

    .intervention-doc-acceptance .intervention-section + .intervention-section,
    .intervention-doc-acceptance .intervention-section + .intervention-costs {
        margin-top: 4px !important;
    }

    .intervention-note-client {
        font-size: .72rem !important;
        line-height: 1.18 !important;
    }

    .intervention-section h3 {
        margin: 9px 0 4px !important;
        font-size: .78rem !important;
    }

    .intervention-material-table th,
    .intervention-material-table td {
        padding: 4px 8px !important;
        font-size: .72rem !important;
        line-height: 1.15 !important;
    }

    .intervention-signature-box,
    .intervention-signature-empty {
        min-height: 46px !important;
        padding: 4px !important;
    }

    .intervention-signature-box img {
        max-width: 170px !important;
        max-height: 46px !important;
        object-fit: contain !important;
    }
}

.quote-warning-modal .modal-content {
    border: 0;
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .35);
}

.quote-warning-modal .modal-header {
    background: #fff7ed;
    border-bottom-color: #fed7aa;
    color: #7c2d12;
}

.quote-warning-modal .modal-title {
    font-weight: 800;
}

.quote-warning-modal .modal-body {
    color: #1f2937;
    font-size: 1rem;
    line-height: 1.55;
}

.modal-backdrop.show {
    opacity: .58;
    backdrop-filter: blur(5px);
}
.client-similar-row td {
    background: #fbfdff;
}

.client-similar-row td:first-child {
    color: #334155;
}
.dashboard-stat-card {
    display: block;
    color: var(--bs-body-color);
    text-decoration: none;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.dashboard-stat-card:hover,
.dashboard-stat-card:focus-visible {
    color: var(--bs-body-color);
    transform: translateY(-2px);
    box-shadow: 0 11px 28px rgba(15, 23, 42, 0.10);
}

.dashboard-stat-card:focus-visible {
    outline: 3px solid rgba(13, 110, 253, 0.22);
    outline-offset: 2px;
}

.text-editor {
    overflow: hidden;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: #fff;
}
.text-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 9px;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
}
.text-editor-surface {
    min-height: 480px;
    padding: 22px;
    color: #1f2937;
    line-height: 1.6;
    outline: 0;
}
.text-editor-surface h2 { margin: 24px 0 10px; color: #17446e; font-size: 1.2rem; }
.text-editor-surface p { margin: 0 0 12px; }
.text-editor-surface table { width: 100%; margin: 14px 0; border-collapse: collapse; }
.text-editor-surface th,
.text-editor-surface td { min-width: 90px; padding: 8px 10px; border: 1px solid #cfd8e3; vertical-align: top; }
.text-editor-surface th { background: #eef3f8; color: #17446e; }
.backup-warning {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    border: 2px solid #dc3545;
    border-left-width: 7px;
    border-radius: 6px;
    background: #fff1f2;
    color: #842029;
    box-shadow: 0 8px 22px rgba(220, 53, 69, .10);
}

.backup-warning strong {
    letter-spacing: 0;
}

@media (max-width: 575.98px) {
    .backup-warning {
        align-items: stretch;
        flex-direction: column;
    }
}
.quote-optional-badge {
    background: #fff1d6;
    color: #805300;
    border: 1px solid #d6a74b;
    font-weight: 700;
}
