/* ============================================================
   DOCUMENT HISTORY / DETAIL PAGE - extracted from app.css
   Load order preserved: tokens.css -> app.css -> THIS -> mud-overrides.css
   ============================================================ */

/* ═══════════════════════════════════════════
   DOCUMENT HISTORY PAGE
   ═══════════════════════════════════════════ */
.dochist-search-bar {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 1.5rem 1.75rem;
    margin-top: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.dochist-search-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.dochist-search-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #23519E 0%, var(--brand-blue-dark) 100%);
    box-shadow: 0 3px 10px rgba(35, 81, 158, 0.25);
    flex-shrink: 0;
}

.dochist-search-icon .mud-icon-root {
    font-size: 1.4rem !important;
    color: #ffffff !important;
}

.dochist-search-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 2px 0;
    letter-spacing: -0.01em;
}

.dochist-search-desc {
    font-size: 0.8rem;
    color: #6b7280;
    margin: 0;
}

.dochist-search-fields {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    align-items: flex-end;
}

.dochist-search-field {
    flex: 1;
    min-width: 0;
}

.dochist-search-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    padding-bottom: 2px;
}

/* KPI strip */
.dochist-kpi-strip {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.dochist-kpi {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.85rem 1.1rem;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.15s;
}

.dochist-kpi:hover {
    background: #f9fafb;
}

.dochist-kpi--active {
    border-color: #23519E;
    box-shadow: 0 0 0 3px rgba(35, 81, 158, 0.08);
    background: #f8faff;
}

.dochist-kpi__icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
}

.dochist-kpi__value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    line-height: 1;
}

.dochist-kpi__label {
    font-size: 0.73rem;
    color: #9ca3af;
    margin-top: 2px;
}

/* Empty state */
.dochist-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 1rem;
    opacity: 0.4;
    gap: 4px;
}

/* Document detail dialog */
.doc-detail-dialog .mud-dialog-content {
    padding: 0 !important;
}

.doc-detail-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.doc-detail-header-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(240, 174, 30, 0.15);
    flex-shrink: 0;
}

.doc-detail-header-icon .mud-icon-root {
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 1rem !important;
}

.doc-detail-header-code {
    font-family: monospace;
    font-weight: 700;
    font-size: 0.88rem;
    color: #ffffff;
    line-height: 1.2;
}

.doc-detail-header-type {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.6);
}

.doc-detail-header .mud-chip {
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.doc-detail-tabs .mud-tabs-toolbar {
    min-height: 36px;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 8px;
}

.doc-detail-tabs .mud-tab {
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    text-transform: none !important;
    min-height: 36px;
    padding: 0 0.85rem !important;
}

.doc-detail-tabs .mud-tab.mud-tab-active {
    color: #23519E !important;
}

.doc-detail-tabs .mud-tab-slider {
    background: #F18A25 !important;
    height: 2px;
}

.doc-detail-panel {
    padding: 14px 20px 16px !important;
}

.doc-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.doc-detail-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.doc-detail-item--full {
    grid-column: 1 / -1;
}

.doc-detail-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.doc-detail-value {
    font-size: 0.82rem;
    color: #111827;
    font-weight: 500;
}

.doc-detail-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
    gap: 6px;
    opacity: 0.35;
    font-size: 0.8rem;
    color: #6B7280;
}

@media (max-width: 768px) {
    .dochist-search-fields {
        flex-direction: column;
    }

    .dochist-kpi-strip {
        flex-direction: column;
        gap: 0.5rem;
    }

    .doc-detail-grid {
        grid-template-columns: 1fr;
    }
}

/* Tabs card */
.dochist-tabs-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    margin-top: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.dochist-tabs .mud-tabs-toolbar {
    background: linear-gradient(135deg, #f8f9fb 0%, #f1f3f7 100%) !important;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 0.5rem;
    min-height: 50px;
}

.dochist-tabs .mud-tab {
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    text-transform: none !important;
    color: #6b7280 !important;
    min-height: 50px;
    padding: 0 1.25rem !important;
    gap: 8px;
}

.dochist-tabs .mud-tab:hover {
    color: #374151 !important;
    background: rgba(0, 0, 0, 0.02) !important;
}

.dochist-tabs .mud-tab.mud-tab-active {
    color: #23519E !important;
}

.dochist-tabs .mud-tabs-toolbar .mud-tab-slider {
    background: #F18A25 !important;
    height: 3px;
    border-radius: 3px 3px 0 0;
}

.dochist-tab-panel {
    padding: 0 !important;
}
