/* ── Driver OT Analytics — FEAT-651 ──────────────────────────────────────── */
/* Prefix: dot- */

.dot-page {
    padding: 16px 20px;
    max-width: 1400px;
}

/* ── Header ────────────────────────────────────────────────────────────── */
.dot-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.dot-page-title {
    font-size: 1.3rem;
    font-weight: 700;
    white-space: nowrap;
}

.dot-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
}

.dot-proj-dropdown {
    min-width: 180px;
}

.dot-apply-btn {
    padding: 6px 14px;
    border-radius: 6px;
    border: none;
    background: var(--hi-accent, #4a9eff);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.dot-apply-btn:hover { background: #3a8eef; }

.dot-caveat {
    font-size: 0.8rem;
    color: var(--hi-muted, #8899aa);
    margin: 0 0 14px;
    font-style: italic;
}

/* ── KPI strip ─────────────────────────────────────────────────────────── */
.dot-kpi-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.dot-kpi-placeholder {
    font-size: 0.9rem;
    color: var(--hi-muted, #8899aa);
    margin-bottom: 16px;
}

.dot-tile {
    background: var(--hi-card-bg, #1e2330);
    border-radius: 8px;
    padding: 12px 18px;
    min-width: 160px;
    flex: 1 1 160px;
}

.dot-tile-btn {
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: border-color 0.15s;
}

.dot-tile-btn:hover {
    border-color: var(--hi-accent, #4a9eff);
    color: inherit;
}

.dot-tile-label {
    font-size: 0.75rem;
    color: var(--hi-muted, #8899aa);
    margin-bottom: 4px;
}

.dot-tile-value {
    font-size: 1.4rem;
    font-weight: 700;
}

/* ── Section cards ─────────────────────────────────────────────────────── */
.dot-section-card {
    background: var(--hi-card-bg, #1e2330);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.dot-section-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--hi-muted, #8899aa);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: 10px;
}

.dot-chart {
    width: 100%;
}

/* ── Table header row ──────────────────────────────────────────────────── */
.dot-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.dot-toolbar {
    display: flex;
    gap: 6px;
}

/* ── Table styles ──────────────────────────────────────────────────────── */
.dot-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.dot-plain-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.dot-plain-table th,
.dot-plain-table td {
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid var(--hi-border, #2a3040);
    white-space: nowrap;
}

.dot-plain-table th {
    font-weight: 600;
    color: var(--hi-muted, #8899aa);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dot-plain-table tbody tr:hover {
    background: rgba(74, 158, 255, 0.06);
}

/* ── Drill button (hours cell) ─────────────────────────────────────────── */
.dot-hours-btn {
    background: none;
    border: 1px solid var(--hi-accent, #4a9eff);
    color: var(--hi-accent, #4a9eff);
    border-radius: 4px;
    padding: 2px 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.15s;
}

.dot-hours-btn:hover {
    background: rgba(74, 158, 255, 0.15);
}

/* ── Current week badge ────────────────────────────────────────────────── */
.dot-badge-current {
    display: inline-block;
    background: rgba(74, 158, 255, 0.2);
    color: var(--hi-accent, #4a9eff);
    border: 1px solid rgba(74, 158, 255, 0.4);
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 6px;
    vertical-align: middle;
}

/* ── Partial week badge ────────────────────────────────────────────────── */
.dot-badge-partial {
    display: inline-block;
    background: rgba(240, 160, 64, 0.2);
    color: #f0a040;
    border: 1px solid rgba(240, 160, 64, 0.4);
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 6px;
    vertical-align: middle;
}

/* ── Partial data banner ───────────────────────────────────────────────── */
.dot-partial-banner {
    background: rgba(240, 160, 64, 0.1);
    color: #f0a040;
    border: 1px solid rgba(240, 160, 64, 0.35);
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

body[data-theme="light"] .dot-partial-banner {
    background: rgba(200, 120, 20, 0.08);
    color: #b06010;
    border-color: rgba(200, 120, 20, 0.3);
}

/* ── Driver link ───────────────────────────────────────────────────────── */
.dot-link {
    color: var(--hi-accent, #4a9eff);
    text-decoration: none;
}

.dot-link:hover { text-decoration: underline; }

.dot-rate-mix {
    font-size: 0.78rem;
    color: var(--hi-muted, #8899aa);
}

/* ── States ────────────────────────────────────────────────────────────── */
.dot-empty-state {
    padding: 24px;
    text-align: center;
    color: var(--hi-muted, #8899aa);
    font-style: italic;
}

.dot-error-state {
    padding: 24px;
    color: #e05c5c;
}

/* ── 390px responsive ──────────────────────────────────────────────────── */
@media (max-width: 420px) {
    .dot-kpi-strip {
        flex-direction: column;
    }
    .dot-tile {
        min-width: 0;
        flex: 1 1 100%;
    }
    .dot-table-wrap {
        overflow-x: scroll;
    }
}

/* ── Theme: light ──────────────────────────────────────────────────────── */
body[data-theme="light"] .dot-tile,
body[data-theme="light"] .dot-section-card {
    background: #f4f6fb;
}

body[data-theme="light"] .dot-plain-table th,
body[data-theme="light"] .dot-plain-table td {
    border-color: #dde2ee;
}

body[data-theme="light"] .dot-plain-table tbody tr:hover {
    background: rgba(74, 158, 255, 0.06);
}

body[data-theme="light"] .dot-tile-label,
body[data-theme="light"] .dot-section-label,
body[data-theme="light"] .dot-caveat,
body[data-theme="light"] .dot-rate-mix,
body[data-theme="light"] .dot-empty-state {
    color: #6677aa;
}

body[data-theme="light"] .dot-tile-value,
body[data-theme="light"] .dot-page-title {
    color: #1a2240;
}

/* ── Theme: dark (explicit) ────────────────────────────────────────────── */
[data-theme="dark"] .dot-tile,
[data-theme="dark"] .dot-section-card {
    background: #1e2330;
}
