/* PostingScript theme — light blue base, orange highlights. Dark mode via prefers-color-scheme. */
:root {
    --bg: #ffffff;          /* white page */
    --panel: #eef4fc;       /* light-blue cards (keeps the blue identity on white) */
    --field: #ffffff;       /* inputs */
    --text: #15273b;        /* dark slate */
    --muted: #5a6b7d;
    --accent: #1f74c4;      /* blue — links, accents */
    --accent-strong: #155a9c;
    --highlight: #f5821f;   /* orange — CTAs, highlights */
    --highlight-strong: #d96b0c;
    --border: #cfe0f1;
    --ok-bg: #e6f7ec; --ok-fg: #1c7a45;
    --err-bg: #fdeaec; --err-fg: #b3261e;
    --shadow: 0 1px 3px rgba(21, 39, 59, .08), 0 6px 18px rgba(21, 39, 59, .06);
    --maxw: 960px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0e1726;          /* deep navy-blue */
        --panel: #16233a;
        --field: #0c1320;       /* inputs (darker than panel) */
        --text: #e6eef8;
        --muted: #9fb2c6;
        --accent: #4f9ae6;      /* lighter blue on dark */
        --accent-strong: #6fb0f0;
        --highlight: #ff9233;   /* orange, a touch brighter */
        --highlight-strong: #ffab5e;
        --border: #24364f;
        --ok-bg: #133024; --ok-fg: #7fe0a6;
        --err-bg: #3a1620; --err-fg: #ff9bb0;
        --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .35);
    }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.55;
}

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

.site-header {
    display: flex; align-items: center; justify-content: space-between;
    max-width: var(--maxw); margin: 0 auto; padding: 20px 24px;
}
.site-header .brand { font-weight: 700; font-size: 1.25rem; color: var(--text); letter-spacing: .2px; }
.site-header nav a { margin-left: 18px; color: var(--muted); }
.site-header nav a:hover { color: var(--accent); }

main { max-width: var(--maxw); margin: 0 auto; padding: 24px; }

.hero { padding: 56px 0 32px; text-align: center; }
.hero h1 { font-size: 3rem; margin: 0 0 8px; letter-spacing: -.5px; }
.hero .tagline { font-size: 1.4rem; color: var(--accent); margin: 0 0 20px; font-weight: 600; }
.hero .lede { max-width: 620px; margin: 0 auto 28px; color: var(--muted); font-size: 1.1rem; }

.cta, button {
    display: inline-block; background: var(--highlight); color: #fff;
    border: none; border-radius: 8px; padding: 12px 22px;
    font-size: 1rem; font-weight: 600; cursor: pointer;
}
.cta:hover, button:hover { background: var(--highlight-strong); color: #fff; text-decoration: none; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin: 32px 0; }
.feature { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 22px; box-shadow: var(--shadow); }
.feature h3 { margin: 0 0 8px; color: var(--accent); }
.feature p { margin: 0; color: var(--muted); }

.contact, .auth, .admin { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 28px; margin: 32px 0; box-shadow: var(--shadow); }
.auth { max-width: 460px; }
.admin { overflow-x: auto; }
.contact h2, .auth h1, .admin h1 { margin-top: 0; }
.muted { color: var(--muted); }

.form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: .95rem; color: var(--muted); }
.form input, .form textarea {
    background: var(--field); color: var(--text);
    border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 1rem; font-family: inherit;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31, 116, 196, .15); }
.form button { align-self: flex-start; }

.flash { padding: 12px 16px; border-radius: 8px; margin: 16px 0; }
.flash-ok { background: var(--ok-bg); color: var(--ok-fg); }
.flash-error { background: var(--err-bg); color: var(--err-fg); }

.site-footer { max-width: var(--maxw); margin: 40px auto 24px; padding: 0 24px; color: var(--muted); font-size: .9rem; }

/* Admin — full-page view with a left sidebar */
.admin-body .site-header, .admin-body .site-footer { max-width: none; }
.admin-shell { display: flex; align-items: stretch; max-width: none; margin: 0; min-height: calc(100vh - 150px); }
.side-nav { flex: 0 0 200px; border-right: 1px solid var(--border); padding: 16px 0; display: flex; flex-direction: column; }
.side-nav a { display: block; padding: 10px 24px; color: var(--muted); }
.side-nav a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.side-nav a.active { color: var(--accent); font-weight: 600; border-left: 3px solid var(--accent); padding-left: 21px; }
.side-nav a.sep { margin-top: auto; border-top: 1px solid var(--border); padding-top: 16px; }
.side-nav-label { padding: 14px 24px 4px; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.side-nav a.profile-link { padding-left: 36px; font-size: .95rem; }
.side-nav a.profile-link.active { padding-left: 33px; }
.profile-switcher { padding: 4px 16px 14px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.profile-switcher select { width: 100%; background: var(--field); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; font-size: 1rem; font-weight: 600; }
.profile-switcher .new-profile { margin-top: 8px; }
.profile-switcher .new-profile summary { cursor: pointer; color: var(--accent); font-size: .9rem; list-style: none; }
.profile-switcher .new-profile summary::-webkit-details-marker { display: none; }
.profile-switcher .new-profile form { display: flex; gap: 6px; margin-top: 8px; }
.profile-switcher .new-profile input[type=text] { flex: 1; min-width: 0; background: var(--field); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; }
.profile-switcher .new-profile button { padding: 7px 12px; font-size: .9rem; }
.side-nav-sublabel { padding: 8px 24px 2px 36px; font-size: .8rem; color: var(--muted); }
/* Queue weekly 7-day calendar (interactive editor) */
.cal7 { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 8px; margin: 16px 0; }
.cal-day { border: 1px solid var(--border); border-radius: 8px; padding: 8px; background: var(--panel); min-height: 70px; }
.cal-day-name { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.cal-slots { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.cal-slot-edit { display: flex; align-items: center; gap: 4px; }
.cal-slot-edit input[type=time] { flex: 1 1 auto; min-width: 108px; background: var(--field); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 4px 6px; font-size: .9rem; font-family: inherit; }
.cal-slot-edit .slot-del { flex: 0 0 auto; background: none; border: none; color: var(--err-fg); cursor: pointer; font-size: 1.2rem; line-height: 1; padding: 0 2px; }
.cal-add { width: 100%; background: none; border: 1px dashed var(--border); color: var(--accent); border-radius: 6px; padding: 5px; font-size: .82rem; cursor: pointer; }
.cal-add:hover { border-color: var(--accent); background: var(--field); }
.side-nav a.queue-link { padding-left: 52px; font-size: .95rem; }
.side-nav a.queue-link.active { padding-left: 49px; }
.admin-main { flex: 1; min-width: 0; max-width: none; margin: 0; padding: 4px 28px 28px; }
@media (max-width: 700px) {
    .admin-shell { flex-direction: column; min-height: 0; }
    .side-nav { flex-basis: auto; flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--border); padding: 8px; }
    .side-nav a { padding: 8px 12px; }
    .side-nav a.active { border-left: none; padding-left: 12px; }
    .side-nav a.sep { margin-top: 0; border-top: none; padding-top: 8px; }
    .admin-main { padding: 8px 16px; }
}
.subnav { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 18px; border-bottom: 1px solid var(--border); }
.subnav a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a:hover { color: var(--text); text-decoration: none; }
.subnav a.active { color: var(--accent); font-weight: 600; border-bottom-color: var(--accent); }
.stats { display: flex; flex-wrap: wrap; gap: 14px; margin: 18px 0; }
.stat { display: flex; flex-direction: column; align-items: center; min-width: 96px; padding: 16px 18px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; }
.stat .num { font-size: 1.8rem; font-weight: 700; color: var(--accent); }
.stat .lbl { color: var(--muted); font-size: .9rem; }
a.stat:hover { border-color: var(--accent); text-decoration: none; }
.tbl { width: 100%; border-collapse: collapse; margin-top: 16px; }
.tbl th, .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl th { color: var(--muted); font-weight: 600; font-size: .9rem; }
.tbl td.right, .tbl th.right { text-align: right; }
.form-inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0; }
.form-inline input[type=text], .form-inline select, .device-form input[type=text] {
    background: var(--field); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; font-size: 1rem; font-family: inherit;
}
.device-form { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; max-width: 520px; }
.device-form fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.device-form legend { color: var(--muted); font-size: .9rem; padding: 0 6px; }
.chk { display: inline-flex; align-items: center; gap: 6px; margin: 4px 14px 4px 0; color: var(--text); }
.net { font-weight: 700; color: var(--accent); }
button.danger { background: transparent; color: var(--err-fg); border: 1px solid var(--border); padding: 6px 12px; font-size: .9rem; }
button.danger:hover { background: var(--err-bg); border-color: var(--err-fg); }
.thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); display: block; }
.form input[type=file] { background: var(--field); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; }
.form input[type=datetime-local], .form input[type=time], .form input[type=number], .form select { background: var(--field); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; font-size: 1rem; font-family: inherit; max-width: 280px; }
.linkbtn { background: none; border: none; color: var(--accent); padding: 0; font: inherit; cursor: pointer; text-decoration: underline; }
.linkbtn:hover { color: var(--accent-strong); }

/* Horizontal radio/checkbox rows (override .form label's column flex). */
.form label.chk { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; width: auto; }
.chk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 6px 0; }
/* Split time selector: hour : min-tens min-ones */
.time-sel { display: inline-flex; align-items: center; gap: 6px; }
.time-sel select { max-width: 84px; }
.time-sel .tcolon { font-weight: 700; }

@media (max-width: 520px) { .hero h1 { font-size: 2.2rem; } .hero .tagline { font-size: 1.15rem; } }
