/* Slate blue minimal design (matches Culminac) */
:root {
    --slate: #475a7a;
    --slate-dark: #344460;
    --slate-light: #e6ebf3;
    --bg: #f4f6fa;
    --card: #ffffff;
    --border: #d9dfeb;
    --text: #1f2937;
    --muted: #6b7a90;
    --ok: #3f7d5a;
    --danger: #b4443f;
    --radius: 12px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.4;
    padding-bottom: env(safe-area-inset-bottom);
}

a { color: var(--slate); }

.container { max-width: 720px; margin: 0 auto; padding: 16px 16px 120px; }
.page-title { font-size: 1.4rem; margin: 8px 0 16px; color: var(--slate-dark); }
.section-title { font-size: 1.05rem; margin: 0 0 8px; color: var(--slate-dark); }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 8px; }
.section-head .section-title { margin: 0; }
.muted { color: var(--muted); font-size: 0.9rem; }
.error { color: var(--danger); margin: 0 0 8px; }
.note { background: var(--slate-light); border-radius: 8px; padding: 8px 10px; margin: 8px 0; }

/* Nav */
.nav {
    position: sticky; top: 0; z-index: 20;
    display: flex; gap: 4px; align-items: center;
    background: var(--slate); padding: 8px 12px;
    padding-top: calc(8px + env(safe-area-inset-top));
}
.nav-link {
    color: #fff; text-decoration: none; opacity: 0.75;
    padding: 8px 14px; border-radius: 8px; font-size: 0.95rem;
}
.nav-link.active { opacity: 1; background: var(--slate-dark); }
.nav-logout { margin-left: auto; }
.nav-button { background: none; border: 0; cursor: pointer; font: inherit; }

/* Cards + flash + toast */
.card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px; margin-bottom: 12px;
}
.flash { background: var(--slate-light); color: var(--slate-dark); padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; }
.toast {
    position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 20px);
    background: var(--slate-dark); color: #fff; padding: 12px 18px; border-radius: 10px;
    opacity: 0; pointer-events: none; transition: all 0.2s; z-index: 50; max-width: 90%;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-error { background: var(--danger); }

/* Buttons */
.btn {
    display: inline-block; border: 1px solid transparent; border-radius: 10px;
    padding: 12px 18px; font: inherit; font-weight: 600; cursor: pointer;
    text-decoration: none; text-align: center;
}
.btn:disabled { opacity: 0.45; cursor: default; }
.btn-primary { background: var(--slate); color: #fff; }
.btn-primary:active { background: var(--slate-dark); }
.btn-ghost { background: transparent; color: var(--slate); border-color: var(--border); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-small { padding: 8px 12px; font-size: 0.9rem; }
.btn-block { display: block; width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.button-row form { margin: 0; }

/* Forms */
.form label { display: block; font-weight: 600; margin: 12px 0 4px; }
.form input[type="text"], .form input[type="password"], .form input[type="number"],
.notes-input, .day-picker input {
    width: 100%; padding: 12px; font: inherit; border: 1px solid var(--border);
    border-radius: 10px; background: #fff; color: var(--text);
}
.form .check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.form .check input { width: 20px; height: 20px; }
.day-picker { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.day-picker input { width: auto; }

/* Till */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 4px; }
.chip {
    flex: none; border: 1px solid var(--border); background: #fff; color: var(--slate);
    border-radius: 999px; padding: 8px 16px; font: inherit; cursor: pointer;
}
.chip.active { background: var(--slate); border-color: var(--slate); color: #fff; }

.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.item-btn {
    position: relative; display: flex; flex-direction: column; justify-content: space-between;
    min-height: 92px; padding: 12px; text-align: left; font: inherit;
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
}
.item-btn:active { background: var(--slate-light); }
.item-name { font-weight: 600; }
.item-price { color: var(--muted); font-size: 0.9rem; }
.item-qty {
    position: absolute; top: 8px; right: 8px; min-width: 24px; height: 24px; padding: 0 6px;
    background: var(--slate); color: #fff; border-radius: 12px; font-size: 0.85rem;
    display: flex; align-items: center; justify-content: center;
}

.cart-line { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.cart-line-name { flex: 1; }
.cart-line-price { min-width: 60px; text-align: right; }
.qty-controls { display: flex; align-items: center; gap: 8px; }
.qty-btn {
    width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border);
    background: #fff; color: var(--slate); font-size: 1.2rem; cursor: pointer;
}
.qty-num { min-width: 20px; text-align: center; }
.notes-input { margin-top: 12px; }

.cart-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: flex; align-items: center; gap: 10px;
    background: #fff; border-top: 1px solid var(--border);
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
}
.cart-summary { flex: 1; display: flex; flex-direction: column; }
.cart-summary strong { font-size: 1.2rem; color: var(--slate-dark); }
.cart-bar .btn-primary { min-width: 140px; }

/* Orders + tickets */
.order-head { display: flex; align-items: center; gap: 10px; }
.ticket-no { font-size: 1.3rem; font-weight: 700; text-decoration: none; }
.order-total { margin-left: auto; }
.order-lines { margin: 8px 0; padding-left: 20px; }
.order-card.done { opacity: 0.6; }
.badge { padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.badge-new { background: var(--slate-light); color: var(--slate-dark); }
.badge-done { background: #dff0e6; color: var(--ok); }

.ticket-lines { list-style: none; margin: 12px 0; padding: 0; font-size: 1.15rem; }
.ticket-lines li { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.ticket-lines .qty { font-weight: 700; color: var(--slate); }
.line-price { margin-left: auto; color: var(--muted); }
.ticket-total { display: flex; justify-content: space-between; font-size: 1.3rem; margin: 12px 0; }

/* Admin */
.item-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; }
.item-info { display: flex; flex-direction: column; }
.item-actions { display: flex; gap: 6px; }
.item-actions form { margin: 0; }
.hidden-item { opacity: 0.6; }

@media (min-width: 720px) {
    .cart-bar { left: 50%; transform: translateX(-50%); max-width: 720px; border-radius: 12px 12px 0 0; border: 1px solid var(--border); }
}

/* House Orders additions */
.field-label { display: block; font-weight: 600; margin-bottom: 6px; }
.tickets-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tickets-bar .btn { margin-left: auto; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); flex: none; }
.live-dot.on { background: var(--ok); }
.order-card .btn-primary { margin-top: 4px; }
.cart-bar .btn-primary { min-width: 130px; }
