/* public/css/main.css */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --air-blue: #1F3864;
    --air-gold: #C9A227;
    --bg: #f4f6fb;
    --surface: #ffffff;
    --border: #dde2ef;
    --text: #1a1d2e;
    --text-muted: #6b7280;
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #d97706;
    --radius: 10px;
    --shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    --bottom-nav-h: 60px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
}

/* ── Login ── */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 16px;
}

.login-card {
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
    padding: 40px 36px;
    width: 100%;
    max-width: 380px;
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.logo-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--air-blue);
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.login-logo h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--air-blue);
}

.login-logo p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Forms ── */
.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    color: var(--text);
    background: var(--surface);
    transition: border-color 0.15s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--air-blue);
}

/* ── Buttons ── */
.btn-primary {
    width: 100%;
    padding: 11px;
    background: var(--air-blue);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    padding: 8px 16px;
    background: var(--surface);
    color: var(--air-blue);
    border: 1px solid var(--air-blue);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.btn-danger {
    padding: 8px 16px;
    background: var(--danger);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
}

.btn-success {
    padding: 8px 16px;
    background: var(--success);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 13px;
}

/* ── Chips ── */
.chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.chip-pending {
    background: #fef3c7;
    color: #92400e;
}

.chip-approved {
    background: #d1fae5;
    color: #065f46;
}

.chip-declined {
    background: #fee2e2;
    color: #991b1b;
}

.chip-primary {
    background: #dbeafe;
    color: #1e40af;
}

.chip-vb {
    background: #ede9fe;
    color: #5b21b6;
}

.chip-first {
    background: #ecfdf5;
    color: #065f46;
}

.chip-second {
    background: #fffbeb;
    color: #92400e;
}

.chip-third {
    background: #fdf2f8;
    color: #86198f;
}

/* ── Utility ── */
.hidden {
    display: none !important;
}

.error-msg {
    background: #fee2e2;
    color: var(--danger);
    padding: 10px 12px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 12px;
}

.success-msg {
    background: #d1fae5;
    color: var(--success);
    padding: 10px 12px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 12px;
}

.warn-msg {
    background: #fef3c7;
    color: #92400e;
    padding: 10px 12px;
    border-radius: var(--radius);
    font-size: 13px;
}

.card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 16px 0;
}

/* ── Tables — always scrollable ── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: #f8faff;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

/* ── Dashboard layout ── */
.dash-layout {
    display: flex;
    height: 100vh;
}

/* Sidebar — desktop only */
.dash-sidebar {
    width: 220px;
    background: var(--air-blue);
    color: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.dash-logo {
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dash-logo h2 {
    font-size: 14px;
    font-weight: 600;
}

.dash-logo p {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 2px;
}

.dash-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.dash-nav a {
    display: block;
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s;
}

.dash-nav a:hover,
.dash-nav a.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.dash-sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.dash-main {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.dash-main h1 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

/* Stats grid — 2x2 on mobile, row on desktop */
.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.stat-val {
    font-size: 28px;
    font-weight: 700;
    color: var(--air-blue);
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Roster grid */
.roster-grid {
    display: grid;
    grid-template-columns: 100px repeat(6, 1fr);
    gap: 1px;
    background: var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.roster-cell {
    background: var(--surface);
    padding: 8px;
    font-size: 13px;
}

.roster-cell.header {
    background: var(--air-blue);
    color: #fff;
    font-weight: 600;
    font-size: 12px;
}

.roster-slot {
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 6px;
    margin-bottom: 3px;
    cursor: pointer;
}

.roster-slot.unassigned {
    background: #fee2e2;
    color: var(--danger);
    border-color: #fca5a5;
}

.roster-slot.draft {
    background: #fef3c7;
}

.roster-slot.approved {
    background: #d1fae5;
}

/* ── Bottom nav — mobile dashboard only ── */
.dash-bottom-nav {
    display: none;
}

/* ── Desktop overrides ── */
@media (min-width: 769px) {
    .stats-row {
        grid-template-columns: repeat(4, 1fr);
    }

    .dash-sidebar-footer {
        display: block;
    }
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .dash-sidebar {
        display: none;
    }

    .dash-main {
        padding: 12px 12px calc(12px + var(--bottom-nav-h));
    }

    .dash-main h1 {
        font-size: 17px;
        margin-bottom: 14px;
    }

    /* Bottom nav bar */
    .dash-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: var(--bottom-nav-h);
        background: var(--air-blue);
        z-index: 100;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .dash-bottom-nav a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: rgba(255, 255, 255, 0.6);
        text-decoration: none;
        font-size: 10px;
        gap: 3px;
        transition: color 0.15s;
        padding: 6px 4px;
    }

    .dash-bottom-nav a.active {
        color: #fff;
    }

    .dash-bottom-nav a svg {
        width: 20px;
        height: 20px;
        fill: currentColor;
    }

    /* Make tables scroll on mobile */
    .card {
        overflow-x: auto;
    }

    .data-table {
        min-width: 480px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 10px;
        font-size: 12px;
    }

    /* Roster table on mobile */
    #rosterContent {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Roster layout — stack sidebar below on mobile */
    #rosterContent+div {
        margin-top: 16px;
    }
}