/* Tokens and primitives.
   No component may hardcode a colour, a border width, a radius or a spacing value:
   everything below is a token, and applyTheme() is the only writer of the colour ones. */

:root {
    /* Colour - the dark preset is the default so the page is correct before JS runs. */
    --bg: #0F1216;
    --panel: #1C222B;
    --panel2: #232A34;
    --elevated: #161B22;
    --border-c: #2A323D;
    --border-soft: #20262F;
    --text: #E9ECEF;
    --text-dim: #909AA8;
    --text-faint: #5B6472;
    --primary: #49C2AE;
    --danger: #E2647A;
    --ok: #5FBF7A;
    --warning: #E2A64D;
    --scrollbar: #2A323D;
    --on-accent: #04211C;

    /* Derived: written by applyTheme() from the tokens above, never authored by hand. */
    --hover: #232A34;
    --pressed: #2A323D;
    --tint-free: rgba(95, 191, 122, .14);
    --tint-busy: rgba(226, 166, 77, .14);
    --tint-booked: rgba(156, 139, 224, .14);
    --tint-done: rgba(91, 147, 226, .14);
    --tint-off: rgba(91, 100, 114, .12);
    --shadow-pop: 0 8px 24px rgba(0, 0, 0, .35);
    --scrim: rgba(0, 0, 0, .6);

    /* Geometry, spacing, type and motion: reusable quantities (R2). */
    --r-sm: 6px;
    --r-md: 8px;
    --r-lg: 10px;
    --r-xl: 12px;
    --r-2xl: 16px;
    --r-3xl: 20px;
    --r-pill: 999px;
    --divider-w: 1px;
    --ring-w: 2px;
    --stripe-w: 3px;
    --btn-border-w: 1px;
    --btn-border-c: #2A323D;
    --panel-border-w: 1px;
    --panel-border-c: #2A323D;

    --fs-title: 18px;
    --fs-body: 14px;
    --fs-small: 12px;

    --pad-page: 16px;
    --pad-panel: 16px;
    --gap-sm: 6px;
    --gap: 10px;
    --gap-lg: 16px;

    --scrollbar-w: 10px;
    --scrollbar-gap: 2px;

    --t: .3s;
    --t-fast: .15s;
    --t-ease: ease;
    --t-swift: cubic-bezier(.32, .72, 0, 1);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: var(--fs-body)/1.45 "Segoe UI", system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Scrollbars follow the palette rather than the platform default. */
::-webkit-scrollbar {
    width: var(--scrollbar-w);
    height: var(--scrollbar-w);
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar);
    border-radius: var(--r-pill);
    border: var(--scrollbar-gap) solid var(--bg);
}

.shell {
    max-width: 1080px;
    margin: 0 auto;
    padding: var(--pad-page);
}

.panel {
    background: var(--panel);
    border: var(--panel-border-w) solid var(--panel-border-c);
    border-radius: var(--r-xl);
    padding: var(--pad-panel);
}

.panel + .panel {
    margin-top: var(--gap-lg);
}

.panel-title {
    margin: 0 0 var(--gap) 0;
    font-size: var(--fs-small);
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-dim);
}

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

.faint {
    color: var(--text-faint);
}

.small {
    font-size: var(--fs-small);
}

.row {
    display: flex;
    align-items: center;
    gap: var(--gap);
}

.row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--gap);
}

.grow {
    flex: 1 1 auto;
    min-width: 0;
}

.hidden {
    display: none !important;
}

button,
select,
input[type="text"] {
    font: inherit;
    color: var(--text);
    background: var(--elevated);
    border: var(--btn-border-w) solid var(--btn-border-c);
    border-radius: var(--r-md);
    padding: 6px 12px;
    transition: background var(--t-fast) var(--t-ease), border-color var(--t-fast) var(--t-ease);
}

button {
    cursor: pointer;
}

button:hover,
select:hover,
input[type="text"]:hover {
    background: var(--hover);
}

button:active {
    background: var(--pressed);
}

/* A round is in flight. A live read can take fifteen seconds when the hotel is slow, and
   a button that looks identical while it is busy is why it read as doing nothing. */
button:disabled {
    opacity: 0.55;
    cursor: default;
}

button.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--on-accent);
    font-weight: 600;
}

button.primary:hover {
    background: var(--primary);
    filter: brightness(1.08);
}

button.ghost {
    background: transparent;
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
    outline: var(--ring-w) solid var(--primary);
    outline-offset: 1px;
}

.tabs {
    display: flex;
    gap: var(--gap-sm);
}

.tab {
    background: transparent;
    border-color: transparent;
    color: var(--text-dim);
    border-radius: var(--r-md);
}

.tab[aria-selected="true"] {
    background: var(--panel);
    border-color: var(--panel-border-c);
    color: var(--text);
    font-weight: 600;
}

.badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: var(--r-pill);
    font-size: var(--fs-small);
    background: var(--panel2);
    color: var(--text-dim);
}

.switch {
    display: inline-flex;
    align-items: center;
    gap: var(--gap-sm);
    cursor: pointer;
    user-select: none;
}

.switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch .track {
    width: 38px;
    height: 22px;
    border-radius: var(--r-pill);
    background: var(--panel2);
    border: var(--btn-border-w) solid var(--btn-border-c);
    position: relative;
    transition: background var(--t-fast) var(--t-ease);
}

.switch .track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: var(--r-circle, 50%);
    background: var(--text-faint);
    transition: transform var(--t-fast) var(--t-swift), background var(--t-fast) var(--t-ease);
}

.switch input:checked + .track {
    background: var(--primary);
    border-color: var(--primary);
}

.switch input:checked + .track::after {
    transform: translateX(16px);
    background: var(--on-accent);
}

.switch input:focus-visible + .track {
    outline: var(--ring-w) solid var(--primary);
    outline-offset: 1px;
}
