/* Phase 15 - operational UX polish */
.ux-page {
    padding-top: 10px;
}

.ux-page .card,
.ux-panel {
    border: 1px solid #e7ebf3;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(31, 45, 61, 0.06);
}

.ux-page .card-header,
.ux-panel .card-header {
    border-bottom: 1px solid #edf0f6;
}

.ux-page .card-title,
.ux-page h4,
.ux-page h5,
.ux-page h6 {
    letter-spacing: 0;
}

.ux-toolbar {
    gap: 12px;
    align-items: center;
}

.ux-toolbar .btn,
.ux-action-group .btn,
.ux-action-group button {
    min-width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 3px 5px 0;
}

.ux-action-group form {
    display: inline-flex !important;
}

.ux-filter-bar {
    background: #f8fafc;
    border: 1px solid #e8edf5;
    border-radius: 8px;
    padding: 14px;
}

.ux-kpi {
    min-height: 118px;
    border-left: 4px solid #6571ff;
    background: #fff;
}

.ux-kpi .card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ux-kpi-label {
    color: #6b7280;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.ux-kpi-value {
    color: #1f2937;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
}

.ux-kpi-meta {
    color: #6b7280;
    font-size: 12px;
}

.ux-kpi--success {
    border-left-color: #0f9f6e;
}

.ux-kpi--warning {
    border-left-color: #f59e0b;
}

.ux-kpi--danger {
    border-left-color: #dc2626;
}

.ux-kpi--info {
    border-left-color: #0ea5e9;
}

.ux-table {
    border-collapse: separate;
    border-spacing: 0;
}

.ux-table thead th {
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    border-bottom: 1px solid #e5e7eb;
}

.ux-table tbody td,
.ux-table tbody th {
    vertical-align: middle;
}

.ux-table tbody tr:hover {
    background: #fbfdff;
}

.ux-amount {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ux-empty {
    padding: 28px 16px;
    color: #64748b;
    text-align: center;
}

.ux-empty i {
    color: #94a3b8;
    display: block;
    font-size: 24px;
    margin-bottom: 8px;
}

.ux-quick-action {
    border-radius: 8px;
    min-height: 92px;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    white-space: normal;
}

.ux-status-pill {
    border-radius: 999px;
    padding: 5px 9px;
}

.ux-report-header {
    background: #16213e;
    color: #fff;
    border-radius: 8px;
    padding: 24px;
}

.annex-notes-card {
    border: 1px solid #dfe6ef;
    border-radius: 8px;
    overflow: hidden;
}

.annex-tabs-wrap {
    border-bottom: 1px solid #cfd8e3;
    overflow-x: auto;
    overflow-y: hidden;
}

.annex-filter-bar {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #dfe6ef;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    padding: 10px;
}

.annex-tabs {
    flex-wrap: nowrap;
    min-width: max-content;
}

.annex-tabs .nav-link {
    border-radius: 0;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    min-width: 58px;
    padding: 10px 12px;
    text-align: center;
    white-space: nowrap;
}

.annex-tabs .nav-link.active {
    background: #eef6ff;
    border-color: #94bde7 #94bde7 #eef6ff;
    color: #0f4f8f;
}

.annex-tab-content {
    background: #f8fafc;
    border: 1px solid #cfd8e3;
    border-top: 0;
}

.annex-sheet {
    background: #fff;
    min-height: 420px;
    padding: 18px;
}

.annex-sheet-header {
    align-items: flex-start;
    border: 2px solid #9fb5ce;
    border-bottom: 0;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
}

.annex-sheet-kicker {
    color: #0f4f8f;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.annex-sheet-header h4 {
    color: #111827;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.3;
    margin: 2px 0 5px;
}

.annex-sheet-header p {
    color: #64748b;
    font-size: 12px;
    margin: 0;
}

.annex-entity-grid {
    border-left: 2px solid #9fb5ce;
    border-right: 2px solid #9fb5ce;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.annex-entity-grid div {
    border-top: 1px solid #cfd8e3;
    padding: 8px 12px;
}

.annex-entity-grid div + div {
    border-left: 1px solid #cfd8e3;
}

.annex-entity-grid span {
    color: #64748b;
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.annex-entity-grid strong {
    color: #111827;
    display: block;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.annex-table-wrap {
    border: 2px solid #9fb5ce;
}

.annex-excel-table {
    border-collapse: collapse;
    font-size: 12px;
    min-width: 920px;
}

.annex-excel-table th,
.annex-excel-table td {
    border: 1px solid #b8c6d8 !important;
    padding: 7px 8px;
    vertical-align: middle;
}

.annex-excel-table thead th {
    background: #d9eaf7;
    color: #0f2742;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
}

.annex-excel-table tbody tr:nth-child(even) td {
    background: #fbfdff;
}

.annex-row-label {
    background: #f4f8fc;
    color: #1f2937;
    font-weight: 700;
    min-width: 260px;
}

.annex-source-pill {
    background: #e8f3ff;
    border: 1px solid #b8d8f6;
    border-radius: 999px;
    color: #0f4f8f;
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    margin-left: 6px;
    padding: 1px 6px;
    text-transform: uppercase;
}

.annex-number {
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.annex-total-row td {
    background: #eef6ff !important;
    font-weight: 800;
}

.annex-empty-cell {
    display: block;
    min-height: 17px;
}

.annex-input {
    border-color: #9fb5ce;
    border-radius: 4px;
    font-size: 12px;
    min-width: 110px;
    padding: 4px 6px;
}

.annex-input-number {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.annex-manual-zone {
    background: #f8fafc;
    border: 1px solid #cfd8e3;
    border-top: 0;
    padding: 12px;
}

.annex-manual-zone h6 {
    color: #334155;
    font-size: 12px;
    font-weight: 800;
    margin: 0 0 8px;
    text-transform: uppercase;
}

.annex-manual-zone .form-label {
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    margin-top: 8px;
}

.annex-comment {
    border-color: #cfd8e3;
    border-radius: 4px;
    font-size: 12px;
}

.annex-actions {
    align-items: center;
    background: #fff;
    border: 2px solid #9fb5ce;
    border-top: 0;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 12px;
}

.annex-action-hint {
    color: #64748b;
    font-size: 12px;
}

.annex-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.annex-footnote {
    background: #fff8e6;
    border: 1px solid #f2d48c;
    color: #7a5200;
    font-size: 12px;
    margin-top: 12px;
    padding: 9px 12px;
}

@media (max-width: 767.98px) {
    .ux-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .ux-toolbar .btn {
        width: 100%;
        justify-content: center;
    }

    .ux-kpi-value {
        font-size: 19px;
    }

    .annex-sheet {
        padding: 12px;
    }

    .annex-sheet-header {
        flex-direction: column;
    }

    .annex-entity-grid {
        grid-template-columns: 1fr;
    }

    .annex-entity-grid div + div {
        border-left: 0;
    }

    .annex-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .annex-action-buttons,
    .annex-action-buttons .btn,
    .annex-action-buttons form {
        width: 100%;
    }
}
