/* ===== Site-specific overrides ===== */
:root {
    --phvb-border: #dee2e6;
    --phvb-muted: #6c757d;
    --phvb-bg: #f4f6f9;
    --phvb-card: #ffffff;
    --phvb-primary: #1b6ec2;
    --phvb-header: #1f2d3d;
    --phvb-sidebar: #343a40;
    --phvb-soft: #f8f9fa;
}

.field-validation-error {
    color: #dc3545;
    font-size: 13px;
}

.input-validation-error {
    border-color: #dc3545;
}

.btn {
    border-radius: 6px;
    font-weight: 500;
}

.form-control,
.form-select {
    border-radius: 6px;
    border-color: var(--phvb-border);
}

.form-control:focus,
.form-select:focus {
    border-color: #8bb9eb;
    box-shadow: 0 0 0 0.2rem rgba(27, 110, 194, 0.12);
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.04);
}

code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

a {
    color: #007bff;
}

a:hover {
    color: #0056b3;
}

.card {
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.card-header {
    background: #fff;
}

.table thead th {
    white-space: nowrap;
}

.gap-2 {
    gap: 8px;
}

.file-preview {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.pdf-embed {
    width: 100%;
    height: 80vh;
    border: 0;
}

.page-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.page-toolbar .toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.panel-subtitle {
    margin: 4px 0 0;
    color: var(--phvb-muted);
    font-size: 13px;
}

.section-card {
    margin-bottom: 16px;
}

.section-card .card-header {
    padding: 14px 18px;
}

.section-card .card-body {
    padding: 18px;
}

.empty-state {
    padding: 48px 24px;
    text-align: center;
    color: var(--phvb-muted);
}

.empty-state i {
    font-size: 38px;
    margin-bottom: 12px;
    color: #9aa7b4;
}

.metric-card {
    border: 0;
    overflow: hidden;
    color: #fff;
    height: 100%;
}

.metric-card .card-body {
    padding: 18px;
}

.metric-card .metric-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
    opacity: .88;
}

.metric-card .metric-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
    margin-top: 8px;
}

.metric-card .metric-icon {
    font-size: 34px;
    opacity: .35;
}

.metric-card.primary { background: linear-gradient(135deg, #1b6ec2 0%, #0f4c81 100%); }
.metric-card.success { background: linear-gradient(135deg, #198754 0%, #10633c 100%); }
.metric-card.info { background: linear-gradient(135deg, #0dcaf0 0%, #0b7f97 100%); }
.metric-card.warning { background: linear-gradient(135deg, #ffc107 0%, #d18a00 100%); color: #2d2000; }
.metric-card.warning .metric-label,
.metric-card.warning .metric-icon { opacity: .7; }

.soft-panel {
    background: var(--phvb-soft);
    border: 1px solid #edf1f4;
    border-radius: 8px;
    padding: 14px 16px;
}

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

.meta-item {
    border-bottom: 1px dashed #e5e7eb;
    padding-bottom: 10px;
}

.meta-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--phvb-muted);
    margin-bottom: 4px;
}

.meta-value {
    font-weight: 500;
    color: #212529;
}

.detail-block {
    margin-top: 18px;
}

.detail-block h6 {
    font-weight: 600;
    margin-bottom: 10px;
}

.detail-content {
    background: var(--phvb-soft);
    border: 1px solid #edf1f4;
    border-radius: 8px;
    padding: 14px 16px;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-cloud .badge {
    font-size: 12px;
    padding: 7px 10px;
}

.stack-list {
    display: flex;
    flex-direction: column;
}

.stack-item {
    padding: 12px 14px;
    border-bottom: 1px solid #eef1f4;
}

.stack-item:last-child {
    border-bottom: 0;
}

.stack-item .item-main {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
}

.stack-item .item-title {
    font-weight: 500;
}

.stack-item .item-meta {
    margin-top: 6px;
    color: var(--phvb-muted);
    font-size: 12px;
}

.filter-card .card-body {
    padding: 16px 18px;
}

.form-section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--phvb-muted);
    margin-bottom: 12px;
    font-weight: 700;
}

.check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px 14px;
}

.form-hint {
    color: var(--phvb-muted);
    font-size: 12px;
    margin-top: 6px;
}

.stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eef5fb;
    color: #1f4f75;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
}

/* ===== OCR Text Display ===== */
.ocr-text-display {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

@media (max-width: 992px) {
    .meta-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .table-responsive {
        font-size: 13px;
    }

    .page-toolbar {
        align-items: stretch;
    }

    .page-toolbar .toolbar-actions {
        width: 100%;
    }
}
