/* ========================================
   TICKET STATUS REPORT — deliberately plain: one summary table and the ticket list,
   neutral colours only, and a print layout that is black on white.
   ======================================== */

.ts-wrapper {
    width: 100%;
    height: calc(100vh - 60px);
    overflow: hidden;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    position: relative;
    color: var(--text-primary);
}

.ts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px 28px;
    border-bottom: 1px solid var(--border-primary);
    background: var(--surface);
}
.ts-title { margin: 0; font-size: 18px; font-weight: 700; }
.ts-subtitle { margin: 2px 0 0; font-size: 12.5px; color: var(--text-muted); }
.ts-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.ts-btn {
    border: 1px solid var(--border-secondary);
    background: var(--surface);
    color: var(--text-primary);
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.ts-btn:hover:not(:disabled) { border-color: var(--text-primary); }
.ts-btn:disabled { opacity: .5; cursor: not-allowed; }
.ts-btn-main { background: var(--text-primary); border-color: var(--text-primary); color: var(--surface); }

.ts-container { flex: 1; overflow-y: auto; }
.ts-content { padding: 18px 28px 50px; max-width: 1600px; margin: 0 auto; }

.ts-loading {
    position: absolute; top: 70px; right: 28px; z-index: 5;
    font-size: 12.5px; color: var(--text-muted);
    background: var(--surface); border: 1px solid var(--border-primary); border-radius: 6px; padding: 5px 10px;
}

/* Filters */
.ts-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    align-items: flex-end;
    padding: 14px 16px;
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    background: var(--surface);
    margin-bottom: 20px;
}
.ts-field { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--text-muted); }
.ts-field input, .ts-field select {
    background: var(--surface);
    border: 1px solid var(--border-secondary);
    border-radius: 6px;
    padding: 6px 9px;
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 400;
}
.ts-field input:focus, .ts-field select:focus { outline: 2px solid var(--text-primary); outline-offset: 0; }
.ts-search { flex: 1 1 240px; }
.ts-search input { width: 100%; }
.ts-quick { display: flex; flex-wrap: wrap; gap: 4px; }
.ts-quick button {
    border: 1px solid var(--border-secondary); background: var(--surface); color: var(--text-secondary);
    border-radius: 6px; padding: 6px 10px; font-size: 12.5px; cursor: pointer;
}
.ts-quick button.on { border-color: var(--text-primary); color: var(--text-primary); font-weight: 700; }
.ts-check { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-secondary); flex-basis: 100%; }

/* Headings + messages */
.ts-h2 { font-size: 15px; font-weight: 700; margin: 4px 0 8px; }
.ts-hint { font-size: 12px; font-weight: 400; color: var(--text-muted); margin-left: 8px; }
.ts-message { font-size: 13.5px; color: var(--text-secondary); }
.ts-error { color: #b42318; }
.ts-link { background: none; border: 0; padding: 0; margin: -10px 0 18px; font-size: 12.5px; text-decoration: underline; color: var(--text-secondary); cursor: pointer; }
.ts-foot { font-size: 12px; color: var(--text-muted); margin-top: 14px; }
.ts-printhead { display: none; }

/* Tables */
.ts-table-wrap { overflow-x: auto; }
.ts-table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--surface); }
.ts-table th {
    text-align: right;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 8px 10px;
    border-bottom: 2px solid var(--text-primary);
    white-space: nowrap;
}
.ts-table td {
    text-align: right;
    padding: 7px 10px;
    border-bottom: 1px solid var(--border-primary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    vertical-align: top;
}
.ts-table th.l, .ts-table td.l { text-align: left; }
.ts-table td.ts-wrap { white-space: normal; min-width: 140px; }
.ts-small { font-size: 12px; color: var(--text-secondary); }
.ts-sort { cursor: pointer; user-select: none; }
.ts-late { font-weight: 700; }

.ts-summary-wrap { margin-bottom: 18px; }
.ts-summary tbody tr { cursor: pointer; }
.ts-summary tbody tr:hover td { background: var(--surface-inset); }
.ts-summary tbody tr.is-on td { background: var(--surface-inset); }
.ts-summary tbody tr.is-off td { color: var(--text-muted); }
.ts-summary tfoot td { font-weight: 700; border-top: 2px solid var(--text-primary); border-bottom: 0; }
.ts-desc { display: block; font-size: 11.5px; color: var(--text-muted); font-weight: 400; margin-left: 24px; }
.ts-box {
    display: inline-flex; align-items: center; justify-content: center;
    width: 15px; height: 15px; margin-right: 7px; vertical-align: -2px;
    border: 1px solid var(--border-secondary); border-radius: 3px; font-size: 11px; font-weight: 700;
}
.ts-more { margin-top: 12px; }

@media (max-width: 760px) {
    .ts-header, .ts-content { padding-left: 12px; padding-right: 12px; }
}

/* Print: black on white, no controls, every row */
@media print {
    .sidebar, .navbar, .top-row, header, nav, .ts-noprint { display: none !important; }
    .ml-wrapper, .ml-wrapper > *, main { height: auto !important; min-height: 0 !important; overflow: visible !important; padding-top: 0 !important; margin-top: 0 !important; }
    .ts-wrapper, .ts-container { height: auto !important; overflow: visible !important; background: #fff !important; }
    .ts-content { padding: 0 !important; max-width: none; }
    .ts-wrapper, .ts-table, .ts-table td, .ts-table th, .ts-h2, .ts-desc, .ts-foot, .ts-small { color: #000 !important; background: #fff !important; }
    .ts-printhead { display: flex; justify-content: space-between; border-bottom: 2px solid #000; padding-bottom: 6px; margin-bottom: 12px; font-size: 12pt; }
    .ts-table { font-size: 9pt; }
    .ts-table th { border-bottom: 1.5px solid #000; }
    .ts-table td { border-bottom: 1px solid #bbb; padding: 4px 6px; }
    .ts-summary tbody tr.is-off { display: none; }
    .ts-table-wrap { overflow: visible; }
    thead { display: table-header-group; }
    tr { break-inside: avoid; }
    @page { size: A4 landscape; margin: 12mm; }
}
