body {
    background: #eef1f4;
    color: #1d2630;
}

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

.sidebar {
    width: 278px;
    min-height: 100vh;
    background: #1e2933;
    color: #fff;
    position: fixed;
    inset: 0 auto 0 0;
    padding: 1rem;
    overflow-y: auto;
}

.sidebar a {
    color: #d8e1eb;
    display: block;
    padding: .48rem .65rem;
    border-radius: .35rem;
    text-decoration: none;
    font-size: .94rem;
}

.sidebar a:hover,
.sidebar a.active {
    background: #344557;
    color: #fff;
}

.main-content {
    margin-left: 278px;
    min-height: 100vh;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #d8dee6;
    padding: .8rem 1.2rem;
}

.content-wrap {
    padding: 1.25rem;
}

.metric-card {
    border: 1px solid #d7dde5;
    background: #fff;
    border-radius: 6px;
    padding: 1rem;
}

.metric-card .metric-value {
    font-size: 1.85rem;
    font-weight: 700;
}

.document-page {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto 24px;
    padding: 30px 25px 34px;
    background: #fff;
    color: #000;
    box-shadow: 0 12px 34px rgba(15, 23, 42, .16);
    font-family: Calibri, "Segoe UI", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.15;
}

.document-page * {
    letter-spacing: 0;
}

.document-title {
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    padding: 8px 0;
}

.document-hero {
    height: 160px;
    margin: 0 0 78px;
    background: #1f4e79;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    font-size: 28px;
    font-weight: 700;
}

.section-title {
    background: #ddebf7;
    border-top: 1px solid #1f4e79;
    border-bottom: 1px solid #1f4e79;
    color: #002060;
    font-weight: 700;
    font-size: 20px;
    margin: 0 7px 24px;
    padding: 6px 8px;
}

.required-mark {
    color: #ff0000;
}

.section-subtitle {
    text-align: center;
    font-weight: 700;
    margin: 3px 0 6px;
}

.spec-table {
    width: calc(100% - 20px);
    border-collapse: collapse;
    table-layout: fixed;
    margin: 0 10px 24px;
}

.spec-table th,
.spec-table td {
    border: 1px solid #bfbfbf;
    padding: 8px 8px;
    vertical-align: middle;
    word-break: normal;
    overflow-wrap: anywhere;
}

.spec-table th {
    text-align: center;
    font-weight: 700;
    background: #fff;
}

.spec-table .center {
    text-align: center;
}

.spec-table .label {
    font-weight: 700;
    width: 56%;
}

.spec-table .value-lg {
    text-align: center;
    font-family: "Times New Roman", Georgia, serif;
    font-size: 22px;
}

.spec-table .strong {
    font-weight: 700;
}

.doc-input,
.doc-textarea,
.doc-select {
    width: 100%;
    border: 0;
    background: transparent;
    color: #000;
    font: inherit;
    line-height: inherit;
    padding: 0;
    resize: vertical;
    outline: none;
}

.is-editable .doc-input,
.is-editable .doc-textarea,
.is-editable .doc-select {
    background: #fff8d6;
    box-shadow: inset 0 0 0 1px #d6a800;
    min-height: 20px;
    padding: 2px 4px;
}

.is-editable .doc-textarea {
    min-height: 38px;
}

.editable-legend {
    display: inline-block;
    margin: 0 0 12px;
    padding: 4px 9px;
    border: 1px dashed #b28700;
    background: #fff8d6;
    color: #5f4700;
    font-size: 12px;
    font-family: Calibri, "Segoe UI", Arial, sans-serif;
    font-weight: 700;
}

.doc-textarea {
    min-height: 34px;
}

.doc-textarea.large {
    min-height: 118px;
}

.doc-input:focus,
.doc-textarea:focus,
.doc-select:focus {
    background: #fffceb;
    box-shadow: inset 0 0 0 1px #a67c00;
}

.doc-read {
    white-space: pre-line;
    min-height: 16px;
}

.document-actions {
    width: 210mm;
    margin: 0 auto 12px;
    display: flex;
    gap: .5rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.status-stamp {
    display: inline-block;
    border: 1px solid #333;
    padding: 2px 8px;
    font-size: 11px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.signature-line {
    min-height: 42px;
}

.resources-grid {
    font-size: 14px;
}

.resources-grid td {
    padding: 2px 6px;
    line-height: 1.1;
}

.resources-grid .resources-side {
    width: 14%;
    background: #d9d9d9;
    text-align: center;
    font-weight: 700;
    font-size: 16px;
}

.resources-grid .resource-label {
    width: 38%;
    background: #f2f2f2;
    text-align: center;
    font-weight: 700;
}

.resources-grid .resource-label small {
    display: block;
    font-size: 12px;
    font-weight: 400;
}

.resources-grid .resource-value {
    min-height: 28px;
}

.signature-table {
    table-layout: fixed;
}

.signature-table td {
    height: 335px;
    text-align: center;
    vertical-align: middle;
}

.signature-box {
    padding: 0 18px;
}

.signature-label {
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 12px;
}

.signature-name {
    margin-bottom: 32px;
    white-space: pre-line;
}

.signature-field {
    border-top: 1px solid #000;
    min-height: 28px;
    padding-top: 5px;
}

.is-editable .signature-field {
    border-top: 1px solid #000;
}

[dir="rtl"],
.rtl {
    direction: rtl;
    unicode-bidi: plaintext;
}

.repeat-controls {
    display: flex;
    gap: .35rem;
    justify-content: flex-end;
    margin: -3px 0 5px;
}

@media (max-width: 992px) {
    .sidebar {
        position: static;
        width: auto;
        min-height: auto;
    }

    .main-content {
        margin-left: 0;
    }

    .document-page,
    .document-actions {
        width: 100%;
    }

    .document-page {
        padding: 12mm 8mm;
    }
}

@page {
    size: A4;
    margin: 12mm;
}

@media print {
    body {
        background: #fff;
    }

    .no-print,
    .sidebar,
    .topbar,
    .alert,
    .document-actions {
        display: none !important;
    }

    .main-content,
    .content-wrap {
        margin: 0 !important;
        padding: 0 !important;
    }

    .document-page {
        width: auto;
        min-height: auto;
        margin: 0;
        padding: 0;
        box-shadow: none;
        font-size: 13px;
    }

    .document-hero {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .is-editable .doc-input,
    .is-editable .doc-textarea,
    .is-editable .doc-select {
        background: transparent;
        box-shadow: none;
        padding: 0;
    }

    .spec-table {
        page-break-inside: auto;
    }

    .spec-table tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    .page-break {
        page-break-before: always;
    }
}
