/* ── Staff 360 Hub — FEAT-589 ──────────────────────────────────────────── */
/* Prefix: s360- */

.s360-page {
    padding: 16px 20px;
    max-width: 1200px;
}

/* ── Header ────────────────────────────────────────────────────────────── */
.s360-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    position: relative;
}

.s360-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.s360-page-title {
    font-size: 1.3rem;
    font-weight: 700;
    white-space: nowrap;
}

.s360-driver-badge {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--hi-accent, #4a9eff);
}

.s360-search-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 2;
    min-width: 260px;
}

.s360-search-input {
    flex: 1;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--hi-border, #3a3d47);
    background: var(--hi-input-bg, #23262f);
    color: inherit;
    font-size: 0.9rem;
}

.s360-search-btn {
    padding: 6px 14px;
    border-radius: 6px;
    border: none;
    background: var(--hi-accent, #4a9eff);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.s360-search-btn:hover {
    background: #3a8eef;
}

/* ── Search results dropdown ────────────────────────────────────────────── */
.s360-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 200;
    margin-top: 4px;
}

.s360-results-list {
    background: var(--hi-card-bg, #1e2028);
    border: 1px solid var(--hi-border, #3a3d47);
    border-radius: 8px;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
}

.s360-result-item {
    padding: 8px 14px;
    text-align: left;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--hi-border, #3a3d47);
    color: inherit;
    cursor: pointer;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.s360-result-item:last-child {
    border-bottom: none;
}

.s360-result-item:hover {
    background: var(--hi-hover-bg, #2a2d37);
}

.s360-search-no-results,
.s360-search-hint {
    padding: 8px 14px;
    font-size: 0.85rem;
    color: var(--hi-muted, #8899aa);
    background: var(--hi-card-bg, #1e2028);
    border: 1px solid var(--hi-border, #3a3d47);
    border-radius: 8px;
}

/* ── Days selector ──────────────────────────────────────────────────────── */
.s360-days-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.s360-days-label {
    font-size: 0.85rem;
    color: var(--hi-muted, #8899aa);
}

.s360-days-btn {
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--hi-border, #3a3d47);
    background: transparent;
    color: inherit;
    font-size: 0.82rem;
    cursor: pointer;
}

.s360-days-btn--active {
    background: var(--hi-accent, #4a9eff);
    border-color: var(--hi-accent, #4a9eff);
    color: #fff;
}

/* ── Identity card ──────────────────────────────────────────────────────── */
.s360-identity-inner {
    background: var(--hi-card-bg, #1e2028);
    border: 1px solid var(--hi-border, #3a3d47);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 14px;
}

.s360-hero {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 14px;
}

.s360-hero-name {
    font-size: 1.25rem;
    font-weight: 700;
}

.s360-hero-id {
    font-size: 0.9rem;
    color: var(--hi-muted, #8899aa);
}

/* ── Section collapses ──────────────────────────────────────────────────── */
.s360-section-collapse {
    margin-bottom: 12px;
    border: 1px solid var(--hi-border, #3a3d47);
    border-radius: 8px;
    overflow: hidden;
}

.s360-section-summary {
    padding: 10px 16px;
    font-weight: 600;
    cursor: pointer;
    background: var(--hi-card-bg, #1e2028);
    user-select: none;
    list-style: none;
}

.s360-section-summary::-webkit-details-marker { display: none; }
.s360-section-summary::before { content: '▶ '; font-size: 0.7em; }
details[open] .s360-section-summary::before { content: '▼ '; }

.s360-section-body {
    padding: 12px 16px;
    background: var(--hi-page-bg, #15171f);
}

/* ── Summary tiles ──────────────────────────────────────────────────────── */
.s360-summary-tile {
    min-width: 110px;
}

/* ── Tab toolbar (export bar) ────────────────────────────────────────────── */
.s360-tab-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

/* ── Tables ────────────────────────────────────────────────────────────── */
.s360-duties-table,
.s360-roster-table,
.s360-attendance-table,
.s360-buses-table,
.s360-accidents-table {
    width: 100%;
}

/* ── Plate links ────────────────────────────────────────────────────────── */
.s360-plate-link {
    color: var(--hi-accent, #4a9eff);
    text-decoration: none;
    font-weight: 600;
}

.s360-plate-link:hover {
    text-decoration: underline;
}

/* ── Error card ─────────────────────────────────────────────────────────── */
.s360-error-card {
    background: var(--hi-card-bg, #1e2028);
    border: 1px solid #e05555;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.s360-badge-name {
    font-size: 0.95rem;
    font-weight: 600;
}

/* ── 390px responsive ───────────────────────────────────────────────────── */
@media (max-width: 420px) {
    .s360-page { padding: 10px 8px; }
    .s360-header { flex-direction: column; gap: 10px; }
    .s360-search-bar { flex-direction: column; align-items: stretch; }
    .s360-hero { flex-direction: column; gap: 4px; }
    .b360-stat-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Dark theme ─────────────────────────────────────────────────────────── */
body[data-theme="dark"] .s360-search-input {
    background: #23262f;
    border-color: #3a3d47;
}

body[data-theme="dark"] .s360-results-list {
    background: #1e2028;
    border-color: #3a3d47;
}

body[data-theme="dark"] .s360-result-item:hover {
    background: #2a2d37;
}

/* ── Light theme ────────────────────────────────────────────────────────── */
body[data-theme="light"] .s360-search-input {
    background: #fff;
    border-color: #d0d4db;
    color: #1a1c24;
}

body[data-theme="light"] .s360-results-list {
    background: #fff;
    border-color: #d0d4db;
}

body[data-theme="light"] .s360-result-item:hover {
    background: #f3f5f9;
}

body[data-theme="light"] .s360-identity-inner,
body[data-theme="light"] .s360-section-summary {
    background: #fff;
    border-color: #d0d4db;
}

body[data-theme="light"] .s360-section-body {
    background: #f7f8fa;
}

/* ── Mobile field with reveal link ─────────────────────────────────────── */
.b360-field-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.b360-field-masked {
    font-family: monospace;
    letter-spacing: 0.04em;
}

.s360-reveal-link-btn {
    padding: 2px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
    border: 1px solid var(--hi-accent, #4a9eff);
    background: transparent;
    color: var(--hi-accent, #4a9eff);
    cursor: pointer;
    white-space: nowrap;
}

.s360-reveal-link-btn:hover {
    background: var(--hi-accent, #4a9eff);
    color: #fff;
}

.s360-reveal-logged-note {
    font-size: 0.78rem;
    color: var(--hi-muted, #8899aa);
    font-style: italic;
}

/* ── Reveal modal backdrop ──────────────────────────────────────────────── */
.s360-reveal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
}

.s360-reveal-modal-box {
    background: var(--hi-card-bg, #1e2028);
    border: 1px solid var(--hi-border, #3a3d47);
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.s360-reveal-modal-title {
    font-size: 1.05rem;
    font-weight: 700;
}

.s360-reveal-driver-name {
    font-size: 0.9rem;
    color: var(--hi-muted, #8899aa);
}

.s360-reveal-password-field {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--hi-border, #3a3d47);
    background: var(--hi-input-bg, #23262f);
    color: inherit;
    font-size: 0.92rem;
    box-sizing: border-box;
}

.s360-reveal-modal-msg {
    font-size: 0.85rem;
    color: #e05555;
    min-height: 1.2em;
}

.s360-reveal-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.s360-reveal-btn-cancel {
    padding: 7px 16px;
    border-radius: 6px;
    border: 1px solid var(--hi-border, #3a3d47);
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 0.88rem;
}

.s360-reveal-btn-cancel:hover {
    background: var(--hi-hover-bg, #2a2d37);
}

.s360-reveal-btn-confirm {
    padding: 7px 16px;
    border-radius: 6px;
    border: none;
    background: var(--hi-accent, #4a9eff);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.88rem;
}

.s360-reveal-btn-confirm:hover {
    background: #3a8eef;
}

/* ── Light theme overrides ──────────────────────────────────────────────── */
body[data-theme="light"] .s360-reveal-modal-box {
    background: #fff;
    border-color: #d0d4db;
}

body[data-theme="light"] .s360-reveal-password-field {
    background: #fff;
    border-color: #d0d4db;
    color: #1a1c24;
}

body[data-theme="light"] .s360-reveal-btn-cancel:hover {
    background: #f3f5f9;
}

/* ── 390px responsive ───────────────────────────────────────────────────── */
@media (max-width: 420px) {
    .s360-reveal-modal-box {
        padding: 18px 14px;
        max-width: 100%;
    }

    .s360-reveal-modal-actions {
        flex-direction: column-reverse;
        gap: 8px;
    }

    .s360-reveal-btn-cancel,
    .s360-reveal-btn-confirm {
        width: 100%;
        text-align: center;
    }
}
