/* ═══════════════════════════════════════════════════════════════════
   Fleet Status — PnL Owner  (.fpn- prefix)  FEAT-042
   ═══════════════════════════════════════════════════════════════════ */

/* ── Page ─────────────────────────────────────────────────────────── */
.fpn-page {
    min-height: 100vh;
    padding-bottom: 40px;
    font-family: inherit;
}

/* ── Header ───────────────────────────────────────────────────────── */
.fpn-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px 14px;
    border-bottom: 1px solid #2d3548;
    background: #1e2537;
}

.fpn-page-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #e4e8f0;
    letter-spacing: 0.02em;
}

body[data-theme="light"] .fpn-header {
    background: #f0f4ff;
    border-bottom-color: #cdd5e0;
}

body[data-theme="light"] .fpn-page-title {
    color: #1a2540;
}

/* ── Content area ─────────────────────────────────────────────────── */
.fpn-content {
    padding: 20px 24px;
}

/* ── Region section ───────────────────────────────────────────────── */
.fpn-region-section {
    margin-bottom: 28px;
}

.fpn-region-header {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #6b7899;
    padding: 4px 0 8px;
    border-bottom: 1px solid #2d3548;
    margin-bottom: 12px;
    text-transform: uppercase;
}

body[data-theme="light"] .fpn-region-header {
    color: #7a8aaa;
    border-bottom-color: #cdd5e0;
}

/* ── Cards grid ───────────────────────────────────────────────────── */
.fpn-owner-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ── Owner card ───────────────────────────────────────────────────── */
.fpn-owner-card {
    background: #252c3e;
    border: 1px solid #2d3548;
    border-radius: 8px;
    padding: 14px 16px;
    min-width: 280px;
    flex: 1 1 280px;
    max-width: 420px;
    transition: border-color 0.15s;
}

.fpn-owner-card:hover {
    border-color: #4a9eff;
}

body[data-theme="light"] .fpn-owner-card {
    background: #fff;
    border-color: #d0d8ea;
}

body[data-theme="light"] .fpn-owner-card:hover {
    border-color: #4a9eff;
}

/* ── Card header ──────────────────────────────────────────────────── */
.fpn-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
    gap: 8px;
}

.fpn-card-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #c8d0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body[data-theme="light"] .fpn-card-title {
    color: #1a2540;
}

.fpn-card-total {
    font-size: 0.8rem;
    font-weight: 700;
    color: #7eb3f7;
    white-space: nowrap;
    flex-shrink: 0;
}

body[data-theme="light"] .fpn-card-total {
    color: #2c6fbf;
}

/* ── Stats row ────────────────────────────────────────────────────── */
.fpn-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.fpn-stat {
    font-size: 0.78rem;
    color: #8a96b0;
}

body[data-theme="light"] .fpn-stat {
    color: #5a6a88;
}

.fpn-stat-active {
    color: #4bcc8a;
    font-weight: 600;
}

body[data-theme="light"] .fpn-stat-active {
    color: #1a8f52;
}

.fpn-stat-inactive {
    color: #f0a04a;
}

body[data-theme="light"] .fpn-stat-inactive {
    color: #c0620c;
}

.fpn-stat-overdue {
    color: #f06060;
    font-weight: 600;
}

body[data-theme="light"] .fpn-stat-overdue {
    color: #c42020;
}

.fpn-stat-dim {
    color: #6b7899;
}

body[data-theme="light"] .fpn-stat-dim {
    color: #8a96b0;
}

/* ── Progress bar ─────────────────────────────────────────────────── */
.fpn-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fpn-bar-track {
    flex: 1;
    height: 6px;
    background: #2d3548;
    border-radius: 3px;
    overflow: hidden;
}

body[data-theme="light"] .fpn-bar-track {
    background: #d0d8ea;
}

.fpn-bar-fill {
    height: 100%;
    background: #4bcc8a;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.fpn-bar-label {
    font-size: 0.72rem;
    color: #6b7899;
    white-space: nowrap;
    min-width: 62px;
}

body[data-theme="light"] .fpn-bar-label {
    color: #7a8aaa;
}

/* ── Empty / Error states ─────────────────────────────────────────── */
.fpn-empty-state {
    padding: 48px 24px;
    text-align: center;
    color: #6b7899;
    font-size: 0.9rem;
}

body[data-theme="light"] .fpn-empty-state {
    color: #8a96b0;
}

.fpn-error-state {
    padding: 32px 24px;
    text-align: center;
}

.fpn-state-title {
    color: #f06060;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.fpn-state-detail {
    color: #8a96b0;
    font-size: 0.82rem;
}

/* ── Date label ───────────────────────────────────────────────────── */
.fpn-date-label { font-size:0.8rem; color:#8a96b0; white-space:nowrap; }

/* ── Region sub-header inside PnL groups ──────────────────────────── */
.flt-state-region-header {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6c757d;
    padding: 18px 16px 4px;
}
.flt-region-section { margin-bottom: 8px; }

/* ── Clickable card header ─────────────────────────────────────────── */
.fpn-card-clickable {
    cursor: pointer;
    transition: background 0.15s;
}
.fpn-card-clickable:hover { background: rgba(255,255,255,0.04); }
.fpn-chevron { margin-right: 8px; font-size: 0.75rem; color: #6c757d; }
.fpn-card-expanded { border-color: #4a9eff !important; }

/* ── Bus detail panel ──────────────────────────────────────────────── */
.fpn-bus-panel { display: none; }
.fpn-bus-panel-open {
    display: block;
    padding: 0 12px 14px;
    border-top: 1px solid rgba(255,255,255,0.07);
    margin-top: 4px;
}

/* ── Bus table ─────────────────────────────────────────────────────── */
.fpn-bus-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    margin-top: 10px;
}
.fpn-th {
    text-align: left;
    padding: 6px 10px;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8a96b0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.fpn-th-right { text-align: right; }
.fpn-td {
    padding: 6px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: #c8d0df;
    vertical-align: middle;
}
.fpn-td-plate { font-weight: 600; color: #e4e8f0; font-size: 0.85rem; }
.fpn-td-right { text-align: right; }

.fpn-bus-row-overdue td { background: rgba(232,115,74,0.05); }
.fpn-bus-row-due-soon td { background: rgba(244,167,36,0.05); }

/* ── PM status badges in bus table ────────────────────────────────── */
.fpn-pm-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
}
.fpn-pm-overdue  { background: rgba(232,115,74,0.2);  color: #e8734a; }
.fpn-pm-soon     { background: rgba(244,167,36,0.2);  color: #f4a724; }
.fpn-pm-ok       { background: rgba(77,212,143,0.2);  color: #4dd48f; }
.fpn-pm-unknown  { background: rgba(138,150,176,0.15); color: #8a96b0; }

/* ── Header right ──────────────────────────────────────────────────── */
.fpn-header-right { display: flex; align-items: center; gap: 10px; }
.fpn-date-label   { font-size: 0.8rem; color: #8a96b0; }
.fpn-loading      { color: #8a96b0; font-size: 0.85rem; padding: 16px; text-align: center; }
.fpn-empty-buses  { color: #6c757d; font-size: 0.85rem; padding: 12px; text-align: center; }
