/* Atomic Badges — simple CSS, no packages. Dark app, violet landing. */

:root {
    --violet: #090114;
    --violet-deep: #220b4d;
    --bg: #121216;
    --panel: #1c1c22;
    --line: #2e2e38;
    --text: #e8e8ee;
    --dim: #9a9aa8;
    --accent: #a78bfa;
    --ok: #00c853;
    --warn: #e8b100;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    height: 100%;
}

body {
    font: 15px/1.45 system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: var(--accent);
    text-decoration: none;
}

.dim {
    color: var(--dim);
}

.ok {
    color: var(--ok);
}

button {
    font: inherit;
    color: var(--text);
    background: var(--violet);
    border: 0;
    border-radius: 6px;
    padding: 8px 18px;
    cursor: pointer;
}

button.ghost {
    background: none;
    border: 1px solid var(--line);
    color: var(--dim);
}

input {
    font: inherit;
    color: var(--text);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 10px;
}

input:focus {
    outline: 1px solid var(--accent);
}

/* ---- landing (logged out) ----
   Masthead/footer art from the atomic.style site (Masthead.astro /
   AtomicFooter.astro; fonts served from the site root — same origin). In-flow
   rather than position:fixed: the landing is its own 100vh flex column. */

@font-face {
    font-family: 'Atomicaboy';
    src: url('/Atomicaboy.woff2') format('woff2');
    font-display: swap;
}

@font-face {
    font-family: 'CherryCreamSoda';
    src: url('/CherryCreamSoda.woff2') format('woff2');
    font-display: swap;
}

@font-face {
    font-family: 'IBM3270';
    src: url('/IBM3270.woff2') format('woff2');
    font-display: swap;
}

#landing {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(var(--violet-deep), var(--violet));
}

#landing[hidden] {
    display: none;
}

/* author display beats the UA [hidden] rule */

.masthead {
    position: relative;
    width: 100%;
}

.masthead svg {
    display: block;
    width: 100%;
    height: auto;
}

.masthead-text-box {
    position: absolute;
    top: 1.25vw;
    width: 100%;
    padding: 0.5vw;
    text-align: center;
    line-height: 1.5vw;
}

.masthead-text {
    color: #f1e4b7;
    font-family: 'Atomicaboy', sans-serif;
    font-size: clamp(0.5rem, 2.75vw, 3.5rem);
}

.land-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    /* extra bottom padding lifts the centered form ~3vw — optically centered
       under the tall masthead rather than geometrically centered */
    padding: 16px 16px calc(16px + 6vw);
}

#login_form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: min(320px, 90vw);
}

#login_form label {
    color: #f1e4b7;
    font-family: 'CherryCreamSoda', sans-serif;
    text-align: center;
}

#login_form input {
    text-align: center;
}

.atomic-footer {
    position: relative;
    width: 100%;
    margin-top: auto;
}

.atomic-footer svg {
    display: block;
    width: 100%;
    height: auto;
}

.atomic-footer-text-box {
    position: absolute;
    bottom: 0;
    width: 100%;
    text-align: center;
}

.atomic-footer-text {
    color: #f1e4b7;
    font-family: 'IBM3270', sans-serif;
    font-size: clamp(0.75rem, 1.25vw, 1.5rem);
}

/* ---- shell ---- */

#topbar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
}

#topbar .logo {
    width: 26px;
    height: 26px;
    vertical-align: -7px;
    color: var(--accent);
}

#brand_img {
    height: 30px;
    max-width: 180px;
    object-fit: contain;
}

#home_link {
    color: var(--text);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

#topbar nav {
    display: flex;
    gap: 14px;
}

#whoami {
    margin-left: auto;
}

#content {
    max-width: 1080px;
    margin: 0 auto;
    padding: 18px;
}

/* ---- tables ---- */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th,
td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
}

th {
    color: var(--dim);
    font-weight: 500;
    user-select: none;
}

th[data-sort] {
    cursor: pointer;
}

th[data-sort].asc::after {
    content: " ▲";
    font-size: 0.7em;
}

th[data-sort].desc::after {
    content: " ▼";
    font-size: 0.7em;
}

tr.rowlink {
    cursor: pointer;
}

tr.rowlink:hover {
    background: var(--panel);
}

td .pending {
    color: var(--warn);
}

/* ---- project tabs (pinned to viewport top) ---- */

#tabs {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    gap: 4px;
    padding: 8px 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}

#tabs a {
    padding: 6px 14px;
    border-radius: 6px 6px 0 0;
    color: var(--dim);
    cursor: pointer;
}

#tabs a.active {
    color: var(--text);
    background: var(--panel);
}

#att_search {
    width: min(340px, 100%);
    margin-top: 12px;
}

/* ---- attendee page ---- */

#att_cols {
    display: flex;
    flex-wrap: wrap;
    gap: 5%;
    align-items: flex-start;
    margin-top: 10px;
}

#att_left {
    flex: 1 1 40%;
    min-width: 260px;
}

#att_right {
    flex: 1 1 50%;
    min-width: 300px;
}

#att_form .grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

#att_form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--dim);
    font-size: 13px;
}

#att_form label.check {
    flex-direction: row;
    align-items: center;
    color: var(--text);
    font-size: 15px;
}

#att_actions,
#set_actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
}

#att_save,
#set_save {
    background: var(--ok);
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    padding: 12px 40px;
}

/* ---- settings tab ---- */

#set_form h3 {
    margin: 24px 0 10px;
}

.setfield {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--dim);
    font-size: 13px;
    max-width: 420px;
}

.setcheck {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
}

#set_colors {
    display: flex;
    gap: 18px;
}

#set_colors label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--dim);
    font-size: 13px;
}

#set_colors input {
    padding: 2px;
    width: 64px;
    height: 36px;
}

#set_logo_row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

#set_logo {
    height: 48px;
    max-width: 200px;
    object-fit: contain;
    background: var(--panel);
    border-radius: 6px;
    padding: 4px;
}

.filebtn {
    color: var(--accent);
    cursor: pointer;
}

.edit-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.edit-row .wlabel {
    width: 200px;
}

.edit-row .wkey {
    width: 130px;
    font-family: ui-monospace, monospace;
}

.edit-row .wnum {
    width: 54px;
    text-align: center;
}

.edit-row .check {
    display: flex;
    gap: 6px;
    align-items: center;
    color: var(--dim);
    font-size: 13px;
}

/* ---- staff ---- */

td .cell {
    width: 100%;
    min-width: 90px;
}

.projcell label {
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: 13px;
}

#staff_add {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    flex-wrap: wrap;
}

#staff_add select {
    font: inherit;
    color: var(--text);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 10px;
}

td select.cell {
    font: inherit;
    color: var(--text);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 6px 8px;
}

#slot_grid {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 10px;
}

.slot {
    margin: 0;
    width: 140px;
}

.slot-box {
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--panel);
    border: 1px dashed var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.slot-box img {
    max-width: 100%;
    max-height: 100%;
}

.slot-hint {
    color: var(--dim);
    font-size: 13px;
    padding: 6px;
    text-align: center;
}

.slot figcaption {
    margin-top: 4px;
    font-size: 13px;
}

.slot .pending {
    color: var(--warn);
}

#badge_wrap {
    margin-top: 0;
}

#badge_canvas {
    display: block;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}


/* ---- devices tab ---- */

#dev_attach {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

#dev_attach select,
#set_form select {
    font: inherit;
    color: var(--text);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 10px;
}

td.online {
    color: #4c4;
    width: 1em;
}

/* ---- ARS tab ---- */

#ars_controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin: 14px 0;
}

#ars_qbtns button {
    margin-right: 6px;
}

#ars_qbtns button.active {
    outline: 1px solid var(--accent);
}

#ars_results {
    max-width: 680px;
}

#ars_results h3 {
    margin: 16px 0 6px;
}

.ars_bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px 0;
}

.ars_bar span:first-child {
    flex: 0 0 200px;
    text-align: right;
    color: var(--dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ars_track {
    flex: 1;
    height: 20px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 4px;
    overflow: hidden;
}

.ars_fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s;
}

.ars_bar span:last-child {
    flex: 0 0 3ch;
}

.ars_q {
    border: 1px solid var(--line);
    border-radius: 6px;
    margin: 10px 0;
    max-width: 680px;
}

.ars_qtext {
    width: 100%;
    margin-bottom: 8px;
}

.ars_answers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

#ars_actions {
    margin: 10px 0 20px;
}

#ars_sess_table td,
#ars_sess_table th {
    padding: 4px 12px 4px 0;
    text-align: left;
}

#ars_sess_table tbody tr {
    cursor: pointer;
}
