/* R7-44 repeat alarms ("Powtarzające się alarmy"), /administrator/alarm-feedback.
   R7-69: the frame of the other admin pages (card shadow + card-header-default, the modern grid, DxButton); this
   file holds only what the page adds: the case cells (what / how many / where), the pills, the small tables.
   Phone (390 px): the grid shows one stacked cell per car, tables scroll inside their own box, never the page. */

.af-page { max-width: 100%; min-width: 0; }
.af-card { min-width: 0; }
.af-card .card-body { min-width: 0; }
.af-label { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: #8d9ab5; font-weight: 700; margin: 0; }
.af-muted { color: #8d9ab5; font-size: 0.8rem; }
.af-strong { color: #f1f5f9; font-weight: 600; }
.af-intro { color: #cdd6e8; font-size: 0.9rem; margin: 0 0 14px 0; max-width: 980px; }

/* Card headers: the title left, the actions right; they stack on a phone. */
.af-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; width: 100%; min-width: 0; }
.af-card-title { display: flex; align-items: center; min-width: 0; }
.af-card-title h3 { font-size: 1.1rem; overflow-wrap: anywhere; }
.af-head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.af-count {
    margin-left: 10px; padding: 1px 10px; border-radius: 999px; font-weight: 700; font-size: 0.85rem;
    color: #e2e8f5; border: 1px solid rgba(148, 163, 184, 0.4); background: rgba(148, 163, 184, 0.12);
}

/* The list's numbers and settings. */
.af-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.af-kpi {
    display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.af-kpi-value { font-size: 1.4rem; font-weight: 800; color: #fff; line-height: 1.2; }
.af-kpi-value.warn { color: #fcd34d; }
.af-facts { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; }
.af-facts > div { display: flex; flex-direction: column; min-width: 0; }
.af-facts dt { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: #8d9ab5; font-weight: 700; }
.af-facts dd { margin: 0; color: #e2e8f5; font-size: 0.9rem; overflow-wrap: anywhere; }

/* Filters above the grid. */
.af-bar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-bottom: 12px; }
.af-pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.af-pill {
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid #3d4f75; border-radius: 999px; background: transparent;
    padding: 4px 11px; font-size: 0.8rem; font-weight: 600; color: #cdd6e8; white-space: nowrap; line-height: 1.4;
}
button.af-pill { cursor: pointer; }
button.af-pill:hover { border-color: #7aa2ff; color: #fff; }
button.af-pill:focus-visible, .af-car-open:focus-visible { outline: 2px solid #7aa2ff; outline-offset: 2px; }
.af-pill.on { border-color: #7aa2ff; color: #fff; background: rgba(59, 130, 246, 0.2); }
.af-pill.small { font-size: 0.72rem; padding: 2px 9px; }
.af-pill.new { border-color: #a78bfa; color: #c4b5fd; }
.af-pill.waiting { border-color: #10b981; color: #6ee7b7; }
.af-pill.writeoff { border-color: #f59e0b; color: #fcd34d; }
.af-pill.open { border-color: #f59e0b; color: #fcd34d; }
.af-pill.resolved { border-color: #10b981; color: #6ee7b7; }
.af-pill.answer-1 { border-color: #10b981; color: #6ee7b7; }
.af-pill.answer-2, .af-pill.answer-3 { border-color: #60a5fa; color: #93c5fd; }
.af-pill.answer-4, .af-pill.answer-6 { border-color: #a78bfa; color: #c4b5fd; }
.af-pill.answer-5 { border-color: #ef4444; color: #fca5a5; }
.af-search { margin-left: auto; width: 240px; max-width: 100%; }
.af-empty { padding: 24px 0; color: #8d9ab5; }

/* The grid: the modern grid's first three cells are tight action cells (modern-grid.css); here they hold text. */
.af-grid.modern-glass-grid .dxbl-grid-table td:nth-child(1),
.af-grid.modern-glass-grid .dxbl-grid-table td:nth-child(2),
.af-grid.modern-glass-grid .dxbl-grid-table td:nth-child(3),
.af-grid.modern-glass-grid .dxbl-grid-table td {
    padding: 0.55rem 0.75rem !important;
    text-align: left !important;
    vertical-align: top !important;
}
.af-grid.modern-glass-grid .dxbl-grid-table th:nth-child(1),
.af-grid.modern-glass-grid .dxbl-grid-table th:nth-child(2),
.af-grid.modern-glass-grid .dxbl-grid-table th:nth-child(3),
.af-grid.modern-glass-grid .dxbl-grid-table th {
    padding: 0.5rem 0.75rem !important;
}
.af-grid .dxbl-grid-table thead th .dxbl-grid-header-content,
.af-grid .dxbl-grid-table thead th .dxbl-grid-header-content > span {
    white-space: normal !important;
    text-overflow: clip !important;
}
.af-grid .dxbl-grid-table td { white-space: normal; }

/* A car: the plate (our plate control) opens it below the list; the client and "nowe" under it. */
.af-car { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.af-car-open { background: none; border: none; padding: 0; cursor: pointer; align-self: flex-start; border-radius: 6px; }
.af-car-open.on { box-shadow: 0 0 0 2px #7aa2ff; }
.af-car-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.af-stack { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, 0.08); }

/* The three cells of a case, also the three boxes on top of the opened car. */
.af-what, .af-where { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.af-cell-wrap { display: flex; flex-wrap: wrap; gap: 4px; white-space: normal; min-width: 0; margin-top: 2px; }
.af-cell-wrap .af-pill { white-space: normal; max-width: 100%; }
.af-stats { display: grid; grid-template-columns: auto auto; gap: 2px 12px; margin: 0; justify-content: start; }
.af-stats > div { display: contents; }
.af-stats dt { font-weight: 400; color: #8d9ab5; font-size: 0.8rem; }
.af-stats dd { margin: 0; color: #f1f5f9; font-weight: 600; font-size: 0.85rem; text-align: right; white-space: nowrap; }
.af-stats .af-stat-saldo dt { color: #cdd6e8; }
.af-stats .af-stat-saldo dd { color: #fcd34d; font-weight: 800; }
.af-station { color: #e2e8f5; overflow-wrap: anywhere; }

/* The opened car. */
.af-detail-plate { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-width: 0; }
.af-glance { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.af-glance-box {
    padding: 10px 14px; border-radius: 12px; min-width: 0; display: flex; flex-direction: column; gap: 6px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.af-section { margin: 20px 0 8px; color: #e2e8f5; font-weight: 700; font-size: 1rem; }
.af-table-wrap { overflow-x: auto; max-width: 100%; }
.af-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.af-table th { color: #8d9ab5; font-weight: 700; text-align: left; padding: 6px 8px; border-bottom: 1px solid #23304e; white-space: nowrap; }
.af-table td { padding: 6px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); vertical-align: top; color: #e2e8f5; }
.af-table .num { text-align: right; white-space: nowrap; }
.af-table tr.other td { opacity: 0.6; }
.af-table tr.match td { background: rgba(16, 185, 129, 0.12); }
.af-comment { color: #cdd6e8; font-size: 0.8rem; max-width: 420px; overflow-wrap: anywhere; }
.af-report { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.af-card-when { color: #8d9ab5; font-size: 0.8rem; min-width: 120px; }
.af-alarms { display: flex; flex-wrap: wrap; gap: 6px; }
.af-memo { max-width: 640px; margin-bottom: 8px; }
.af-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.af-digest-preview { background: #fff; color: #1f2937; border-radius: 10px; padding: 12px 14px; overflow-x: auto; max-width: 100%; }
.af-writeoff { border: 1px solid #f59e0b55; border-radius: 12px; padding: 12px 14px; margin-top: 8px; }

@media (max-width: 600px) {
    .af-search { margin-left: 0; width: 100%; }
    .af-facts { gap: 6px 14px; }
    .af-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .af-card-when { min-width: 0; }
}
