/* ================================
   Attendance — warm / earthy palette
   ================================ */

:root {
    --bg: #1c1917;
    --bg2: #231f1c;
    --bg3: #2c2622;
    --surface: #352e28;
    --surface2: #3e352e;

    --text: #e8ddd4;
    --text2: #b5a99a;
    --text3: #8a7e72;

    --green: #7cba5f;
    --green-bg: rgba(124, 186, 95, 0.12);
    --green-border: rgba(124, 186, 95, 0.45);

    --red: #d46a5e;
    --red-bg: rgba(212, 106, 94, 0.12);
    --red-border: rgba(212, 106, 94, 0.45);

    --amber: #d4a24e;
    --amber-bg: rgba(212, 162, 78, 0.12);

    --border: rgba(181, 169, 154, 0.1);
    --border2: rgba(181, 169, 154, 0.18);

    --mono: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
    --sans: 'DM Sans', system-ui, -apple-system, sans-serif;

    --r: 6px;
    --r2: 10px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* --- layout --- */
.page {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 16px 48px;
}

/* --- topbar --- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.topbar-title {
    font-weight: 700;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.01em;
}

.topbar-icon {
    color: var(--amber);
    font-size: 1rem;
}

.topbar-date {
    font-size: 0.8rem;
    color: var(--text3);
    font-family: var(--mono);
    font-weight: 500;
}

/* --- counts --- */
.counts {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.count-box {
    flex: 1;
    padding: 12px 14px;
    border-radius: var(--r2);
    display: flex;
    align-items: baseline;
    gap: 8px;
    border: 1px solid var(--border);
}

.count-num {
    font-family: var(--mono);
    font-weight: 700;
    font-size: 1.35rem;
}

.count-tag {
    font-size: 0.75rem;
    color: var(--text3);
    text-transform: lowercase;
    letter-spacing: 0.02em;
}

.count-present { background: var(--green-bg); }
.count-present .count-num { color: var(--green); }

.count-absent { background: var(--red-bg); }
.count-absent .count-num { color: var(--red); }

.count-total { background: var(--amber-bg); }
.count-total .count-num { color: var(--amber); }

/* --- progress bar --- */
.bar-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.bar-track {
    flex: 1;
    height: 5px;
    background: var(--surface);
    border-radius: 99px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    width: 0%;
    background: var(--green);
    border-radius: 99px;
    transition: width .45s ease;
}

.bar-pct {
    font-size: 0.72rem;
    font-family: var(--mono);
    color: var(--text3);
    min-width: 36px;
    text-align: right;
}

/* --- actions --- */
.actions {
    display: flex;
    gap: 8px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.btn {
    font-family: var(--sans);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--r);
    border: 1px solid var(--border2);
    background: var(--surface);
    color: var(--text2);
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}

.btn:hover {
    background: var(--surface2);
    color: var(--text);
    border-color: var(--border2);
}

.btn:active { transform: scale(0.97); }

.btn-outline {
    background: transparent;
    border: 1px dashed var(--border2);
}

.btn-outline:hover {
    background: var(--bg3);
    border-style: solid;
}

/* --- board --- */
.board {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--r2);
    padding: 20px;
    margin-bottom: 22px;
}

.board-inner {
    display: flex;
    gap: 0;
    justify-content: center;
}

.col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    max-width: 370px;
}

.divider {
    width: 1px;
    background: var(--border2);
    margin: 0 16px;
    border-radius: 99px;
    align-self: stretch;
}

.seat-row {
    display: flex;
    gap: 7px;
    align-items: center;
}

.seat {
    flex: 1 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 42px;
}

.seat-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-weight: 500;
    font-size: 0.82rem;
    cursor: pointer;
    user-select: none;
    transition: transform .12s, background .15s, border-color .15s, color .15s, box-shadow .15s;

    background: var(--green-bg);
    border: 1.5px solid var(--green-border);
    color: var(--green);
}

.seat-circle:hover {
    transform: scale(1.18);
    box-shadow: 0 0 12px rgba(124, 186, 95, 0.18);
}

.seat-circle:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 2px;
}

.seat-circle.absent {
    background: var(--red-bg);
    border-color: var(--red-border);
    color: var(--red);
}

.seat-circle.absent:hover {
    box-shadow: 0 0 12px rgba(212, 106, 94, 0.18);
}

.empty-seat {
    flex: 1 0 0;
    height: 42px;
}

/* --- lists --- */
.lists {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 28px;
}

.list-card {
    border-radius: var(--r2);
    border: 1px solid var(--border);
    overflow: hidden;
}

.list-head {
    padding: 10px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mini-btn {
    appearance: none;
    border: 1px solid var(--border2);
    background: var(--bg3);
    color: var(--text3);
    font-family: var(--mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all .15s;
}

.mini-btn:hover {
    background: var(--surface2);
    color: var(--text2);
    border-color: var(--text3);
}

.mini-btn:active {
    transform: scale(0.95);
}

.list-present .list-head {
    background: var(--green-bg);
    color: var(--green);
}

.list-absent .list-head {
    background: var(--red-bg);
    color: var(--red);
}

.list-body {
    padding: 12px 14px;
    font-size: 0.82rem;
    color: var(--text2);
    line-height: 1.7;
    word-break: break-word;
    max-height: 180px;
    overflow-y: auto;
    background: var(--bg2);
}

.list-body::-webkit-scrollbar { width: 3px; }
.list-body::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 99px; }

/* --- toast --- */
.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(60px);
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--border2);
    padding: 10px 22px;
    border-radius: var(--r);
    font-size: 0.82rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
    opacity: 0;
    visibility: hidden;
    transition: all .35s cubic-bezier(.4, 0, .2, 1);
    z-index: 100;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}



/* --- responsive --- */
@media (max-width: 640px) {
    .page { padding: 0 10px 36px; }

    .topbar { flex-direction: column; align-items: flex-start; gap: 4px; }

    .counts { gap: 6px; }
    .count-box { padding: 8px 10px; }
    .count-num { font-size: 1.1rem; }

    .board-inner { flex-direction: column; align-items: center; gap: 12px; }
    .divider { width: 80%; height: 1px; margin: 0; align-self: center; }
    .col { max-width: 100%; width: 100%; }

    .seat-row { gap: 4px; }
    .seat, .empty-seat { height: 36px; }
    .seat-circle { width: 32px; height: 32px; font-size: 0.72rem; }

    .lists { grid-template-columns: 1fr; }

    .btn { font-size: 0.78rem; padding: 7px 12px; }
}
