@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&display=swap');

*[hidden] { display: none !important; }

:root {
    --bg:        #f8f8f8;
    --bg2:       #ffffff;
    --bg3:       #eeeeee;
    --ink:       #111111;
    --muted:     rgba(17, 17, 17, 0.55);
    --muted2:    rgba(17, 17, 17, 0.35);
    --border:    rgba(0, 0, 0, 0.18);
    --border2:   rgba(0, 0, 0, 0.10);
    --shadow:    0 2px 8px rgba(0, 0, 0, 0.08);
    --radius:    14px;
    --radius-sm: 9px;
    --max:       860px;
    --tap:       44px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Nunito', ui-rounded, ui-sans-serif, system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.scrollLock { overflow: hidden; }
.page { min-height: 100%; }

/* ── Topbar ─────────────────────────────────────────────── */

.topbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border2);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.topbarInner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.brandTitle {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.2px;
    color: var(--ink);
}

.brandSubtitle {
    margin-top: 1px;
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.9px;
    text-transform: uppercase;
    font-weight: 600;
}

.nav {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.navLink {
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.navLink:hover {
    color: var(--ink);
    border-color: var(--border2);
    background: rgba(0, 0, 0, 0.05);
}

/* ── Layout ─────────────────────────────────────────────── */

.content {
    max-width: var(--max);
    margin: 0 auto;
    padding: 16px 16px 80px;
}

.bannerWrap  { margin: 0; }
.bannerImg   { width: 100%; height: auto; display: block; }
.footerImgWrap { margin: 20px 0 0; }
.footerImg   { width: 100%; height: auto; display: block; }

/* ── Menu ───────────────────────────────────────────────── */

.menu { margin-top: 10px; }
.category { margin-top: 22px; }

.categoryHeader {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.categoryName {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.3px;
    color: var(--ink);
    white-space: nowrap;
}

.categoryRule {
    height: 2px;
    flex: 1;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.22), transparent);
    border-radius: 2px;
}

.drinkGrid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.drinkCard {
    width: 100%;
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 16px;
    transition: border-color 0.18s, box-shadow 0.18s;
}

.drinkCard:hover {
    border-color: var(--border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.drinkCard86 { opacity: 0.45; filter: grayscale(40%); }

/* Images hidden */
.drinkMedia { display: none; }

.drinkRow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 14px;
    align-items: center;
}

.drinkThumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.drinkMain  { min-width: 0; }

.drinkName {
    font-size: clamp(16px, 4.2vw, 18px);
    font-weight: 800;
    letter-spacing: 0.4px;
    color: var(--ink);
}

.drinkDesc {
    margin-top: 4px;
    color: var(--muted);
    font-size: clamp(13px, 3.4vw, 14px);
    font-weight: 500;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.drinkCta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    white-space: nowrap;
}

/* ── Buttons ────────────────────────────────────────────── */

.btn {
    min-height: var(--tap);
    padding: 10px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink);
    font-family: 'Nunito', ui-rounded, sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.38; cursor: not-allowed; box-shadow: none; transform: none; }

.btnGold {
    background: var(--ink);
    border-color: var(--ink);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btnGold:hover:not(:disabled) {
    background: #333333;
    border-color: #333333;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

.btnGhost {
    background: #ffffff;
    border-color: var(--border);
    color: var(--ink);
}

.btnGhost:hover:not(:disabled) {
    background: var(--bg3);
}

.btnBig    { width: 100%; font-size: 18px; padding: 14px 20px; }
.btnTight  { min-height: 34px; padding: 5px 12px; font-size: 13px; }
.btnDisabled { opacity: 0.35; }

/* ── Inputs ─────────────────────────────────────────────── */

.input {
    width: 100%;
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    background: #ffffff;
    color: var(--ink);
    padding: 10px 13px;
    font-size: 16px;
    font-family: 'Nunito', ui-rounded, sans-serif;
    font-weight: 500;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus {
    border-color: rgba(0, 0, 0, 0.40);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.07);
}

.input::placeholder { color: var(--muted2); }
.textarea { min-height: 88px; resize: vertical; }

/* ── Modal ──────────────────────────────────────────────── */

.modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 16px;
}

.modalBackdrop {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(0, 0, 0, 0.50);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modalCard {
    position: relative;
    z-index: 2;
    width: min(560px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow: auto;
    background: #ffffff;
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    padding: 20px;
}

.modalTitle {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.2px;
    color: var(--ink);
    margin-bottom: 14px;
}

.modalBody   { display: grid; gap: 14px; }
.modalLine   { display: grid; gap: 6px; }

.modalLabel {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.7px;
    text-transform: uppercase;
}

.modalValue { font-size: 16px; font-weight: 600; }

.modalActions {
    margin-top: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* ── My Orders Panel ────────────────────────────────────── */

.myOrdersPanel {
    position: sticky;
    top: 0;
    z-index: 30;
    margin-bottom: 14px;
}

.myOrdersInner {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px 15px;
}

.myOrdersHeader {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.myOrdersTitle {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.2px;
    color: var(--ink);
}

.myOrdersNote {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.myOrdersList { margin-top: 10px; display: grid; gap: 8px; }

.myOrderLine {
    padding: 10px 13px;
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.03);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

/* ── Ready Overlay ──────────────────────────────────────── */

.readyOverlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(0, 0, 0, 0.60);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: grid;
    place-items: center;
    padding: 16px;
}

.readyCard {
    width: min(520px, 100%);
    background: #ffffff;
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    padding: 24px;
}

.readyTop  { display: grid; gap: 10px; margin-bottom: 14px; }

.readyBadge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 5px 13px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--ink);
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.05);
}

.readyTitle {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.2px;
    color: var(--ink);
}

.readyList { display: grid; gap: 10px; margin: 12px 0 18px; }

.readyManyTitle {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.readyLine {
    padding: 12px 14px;
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.03);
    font-size: 16px;
    font-weight: 600;
}

/* ── Toasts ─────────────────────────────────────────────── */

.toastHost {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 14px;
    z-index: 90;
    display: grid;
    gap: 9px;
    pointer-events: none;
}

.toast {
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 180ms ease, transform 180ms ease;
    background: #ffffff;
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.toastIn  { opacity: 1; transform: translateY(0);    }
.toastOut { opacity: 0; transform: translateY(10px); }

.toastOk {
    border-color: rgba(30, 140, 70, 0.35);
    background: rgba(240, 255, 245, 0.98);
    color: #1a6e38;
}

.toastError {
    border-color: rgba(200, 50, 50, 0.30);
    background: rgba(255, 245, 245, 0.98);
    color: #b83333;
}

/* ── Secret / Admin Nav ─────────────────────────────────── */

.secretNav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 14px;
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.secretNav a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.secretNav a:hover {
    color: var(--ink);
    border-color: var(--border2);
    background: rgba(0, 0, 0, 0.05);
}

.navSep  { color: var(--border); }

.navRight {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
}

/* ── Tables ─────────────────────────────────────────────── */

.tableWrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
}

.adminTable,
.ordersTable {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
    background: #ffffff;
}

.adminTable th,
.adminTable td,
.ordersTable th,
.ordersTable td {
    padding: 10px 13px;
    border-bottom: 1px solid var(--border2);
    vertical-align: top;
}

.adminTable tr:last-child td,
.ordersTable tr:last-child td { border-bottom: none; }

.adminTable th,
.ordersTable th {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    text-align: left;
    background: var(--bg3);
}

.nowrap { white-space: nowrap; }

.actionsGroup {
    display: inline-flex;
    gap: 7px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.inlineForm { display: inline; }

/* ── Admin pages ────────────────────────────────────────── */

.adminHeader   { margin-bottom: 16px; }

.adminTitle {
    font-size: 22px;
    font-weight: 800;
    color: var(--ink);
}

.adminSubtitle {
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
}

.adminSection      { margin-bottom: 26px; }

.adminSectionTitle {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 10px;
}

.inputTable    { min-width: 120px; font-size: 14px; }
.textareaTable { min-height: 58px; font-size: 13px; }
.rowForm       { display: contents; }
.colName       { min-width: 140px; }
.colDesc       { min-width: 200px; }
.colAction     { min-width: 130px; }

/* ── Orders / Analytics sections ────────────────────────── */

.ordersSection { margin-bottom: 26px; }

.categoryTitle {
    font-size: 20px;
    font-weight: 800;
    color: var(--ink);
    margin: 0 0 12px 0;
}

.indented { padding: 0; }

/* ── Bar-closed card ────────────────────────────────────── */

.closedCard {
    max-width: 480px;
    margin: 64px auto;
    padding: 36px 32px;
    background: #ffffff;
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
    text-align: center;
}

.closedTitle {
    font-size: 26px;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 8px;
}

.closedSubtitle {
    font-size: 15px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 16px;
}

.closedHint {
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    line-height: 1.55;
}

/* ── Analytics ──────────────────────────────────────────── */

.analyticsControls {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 10px 0 14px 0;
    flex-wrap: wrap;
}

.btn.isActive {
    background: var(--ink) !important;
    border-color: var(--ink) !important;
    color: #ffffff !important;
}

.chartWrap {
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    background: #ffffff;
    padding: 14px;
    overflow-x: auto;
    position: relative;
}

.chartBars {
    height: 180px;
    display: grid;
    align-items: stretch;
    gap: 5px;
}

.chartBars.bin60 { grid-template-columns: repeat(12, 1fr); }
.chartBars.bin30 { grid-template-columns: repeat(24, 1fr); }
.chartBars.bin15 { grid-template-columns: repeat(48, 1fr); }

.chartBarCol {
    height: 100%;
    width: 100%;
    display: flex;
    align-items: flex-end;
    flex: 1 1 0;
    min-width: 2px;
}

.chartBar {
    width: 100%;
    display: block;
    background: linear-gradient(180deg, #666666, #222222);
    border-radius: 3px 3px 0 0;
}

.chartAxis {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    opacity: 0.80;
}

.chartTicks {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: clamp(11px, 1.6vw, 12px);
    opacity: 0.80;
}

.chartTicks .tick {
    flex: 0 0 auto;
    white-space: nowrap;
    text-align: center;
    font-weight: 600;
}

.chartTooltip {
    position: absolute;
    left: 12px;
    top: 12px;
    z-index: 5;
    padding: 7px 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.97);
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: var(--shadow);
}

/* ── Danger zone ────────────────────────────────────────── */

.dangerZone {
    border: 1px solid rgba(200, 50, 50, 0.25);
    border-radius: var(--radius);
    padding: 16px 20px;
    background: rgba(255, 245, 245, 0.60);
}

.dangerZoneTitle {
    font-size: 13px;
    font-weight: 700;
    color: #b83333;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.btnDanger {
    background: #ffffff;
    border-color: rgba(200, 50, 50, 0.50);
    color: #b83333;
}

.btnDanger:hover:not(:disabled) {
    background: rgba(200, 50, 50, 0.06);
    border-color: #b83333;
}

/* ── Edit tabs ──────────────────────────────────────────── */

.editTabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
}

.editTab {
    padding: 9px 24px;
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    background: #ffffff;
    color: var(--muted);
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.editTab:hover {
    color: var(--ink);
    border-color: var(--border);
    background: var(--bg3);
}

.editTabActive {
    color: #ffffff !important;
    border-color: var(--ink) !important;
    background: var(--ink) !important;
}

/* ── Category section header ────────────────────────────── */

.catSectionHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    padding: 10px 14px;
    background: var(--bg3);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    border: 1px solid var(--border2);
    border-bottom: none;
}

.catRenameForm {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}

.catNameInput { max-width: 240px; }

/* ── Theme editor ───────────────────────────────────────── */

.themeSection {
    background: #ffffff;
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 14px;
}

.themeSectionTitle {
    font-size: 11px;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border2);
}

.themeGrid { display: grid; gap: 0; }

.themeRow {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 11px 0;
    border-bottom: 1px solid var(--border2);
}

.themeRow:last-child { border-bottom: none; }

.themeLabel {
    min-width: 190px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}

.themeHint {
    font-size: 12px;
    color: var(--muted);
    font-style: italic;
}

.themeSelect {
    max-width: 200px;
    padding: 8px 12px;
    font-size: 14px;
}

.colorPicker {
    width: 48px;
    height: 36px;
    padding: 2px 3px;
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    background: #ffffff;
    cursor: pointer;
}

.imagePreview {
    max-width: 260px;
    max-height: 100px;
    object-fit: contain;
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    display: block;
    margin-top: 8px;
}

.themeSaveRow {
    padding-top: 16px;
}

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 430px) {
    .btn      { padding: 10px 13px; font-size: 14px; }
    .btnBig   { font-size: 16px; padding: 13px 18px; }
    .btnTight { font-size: 12px; padding: 5px 10px; }
    .modalCard  { padding: 16px; }
    .readyCard  { padding: 18px; }
    .closedCard { padding: 24px 18px; margin: 40px auto; }
    .themeLabel { min-width: 140px; }
    .catSectionHeader { flex-direction: column; align-items: flex-start; }
}
