/* ================================================================
   Drawback Filing System – Custom Stylesheet
   ================================================================ */

/* General */
body { font-size: 14px; background: #f8f9fa; }
.form-label-sm { font-size: .8rem; font-weight: 600; margin-bottom: 2px; color: #495057; }
.form-control-sm, .form-select-sm { font-size: .8rem; }

/* Tabs */
.nav-tabs .nav-link { font-size: .82rem; padding: .4rem .75rem; }
.tab-content { min-height: 400px; }

/* Record group cards */
.record-card {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 12px;
    background: #fff;
}
.record-card .record-header {
    background: #f1f3f5;
    padding: 6px 12px;
    border-bottom: 1px solid #dee2e6;
    border-radius: 6px 6px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}
.record-card .record-header:hover { background: #e9ecef; }
.record-card .record-body { padding: 10px 14px; }
.record-card .record-seq {
    font-weight: 700;
    font-size: .75rem;
    color: #6c757d;
    min-width: 3rem;
}
.record-card .record-summary {
    font-size: .78rem;
    color: #495057;
    flex: 1;
    margin: 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sub-record sections (41/42/43 inside DD40) */
.sub-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 8px 10px;
    margin-top: 8px;
}
.sub-section-header {
    font-size: .75rem;
    font-weight: 700;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 6px;
}
.sub-row {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 6px 8px;
    margin-bottom: 6px;
}

/* ITIN/MTIN grid */
.itin-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    margin-top: 4px;
}
.itin-grid input {
    font-size: .75rem;
    text-align: center;
    font-family: monospace;
}

/* Status badges */
.badge-draft      { background: #6c757d; }
.badge-submitted  { background: #0dcaf0; }
.badge-accepted   { background: #198754; }
.badge-rejected   { background: #dc3545; }

/* Save indicator */
#save-indicator { transition: opacity .5s; }

/* Help tooltips */
.bi-question-circle { cursor: help; font-size: .75rem; }

/* Table improvements */
.table-sm td, .table-sm th { padding: .3rem .5rem; }

/* D89 summary table */
#d89-container .summary-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}
.summary-cell {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 6px 8px;
}
.summary-cell .cls { font-weight: 700; font-size: .8rem; color: #495057; }
.summary-cell .amt { font-size: .9rem; color: #0d6efd; }

/* ================================================================
   PRINT STYLES
   ================================================================ */
@media print {
    body { background: white; font-size: 11pt; }
    .navbar, .btn, .nav-tabs, button, .no-print { display: none !important; }
    .tab-pane { display: block !important; opacity: 1 !important; }
    .tab-content { border: none; box-shadow: none; padding: 0; }
    .record-card { break-inside: avoid; }
    .page-break { page-break-before: always; }
    a { text-decoration: none; color: inherit; }

    .print-header {
        border-bottom: 2px solid #333;
        padding-bottom: 8pt;
        margin-bottom: 12pt;
    }
    .print-section { margin-bottom: 16pt; }
    .print-field-row { display: flex; gap: 16pt; margin-bottom: 4pt; }
    .print-field { flex: 1; }
    .print-field label { font-size: 8pt; color: #666; display: block; }
    .print-field span { font-size: 10pt; border-bottom: 1px solid #ccc; display: block; min-height: 14pt; }
}

/* Responsive helpers */
@media (max-width: 768px) {
    .itin-grid { grid-template-columns: repeat(3, 1fr); }
}
