/* Jazz Day AZ — admin dashboard (demo) */
:root {
  --brand: #06669e; --brand-600: #075482; --brand-50: #eef8fd; --brand-100: #d6eefa;
  --gold: #f2a516; --gold-50: #fff9eb;
  --bg: #f4f7fb; --surface: #ffffff; --surface-2: #f8fafc; --border: #e3e9f1;
  --text: #12233a; --muted: #5d6f86; --faint: #94a3b8;
  --ok: #16a34a; --ok-bg: #e9f8ef; --warn: #b45309; --warn-bg: #fff4e0; --bad: #dc2626; --bad-bg: #fdecec;
  --shadow: 0 1px 2px rgba(15, 35, 60, .06), 0 4px 16px rgba(15, 35, 60, .06);
  --radius: 12px;
  --sidebar: 248px;
  color-scheme: light;
}
[data-theme="dark"] {
  --brand: #3aa6d9; --brand-600: #79c6ea; --brand-50: #0e2a3f; --brand-100: #123650;
  --gold: #fbb424; --gold-50: #2e2410;
  --bg: #07101c; --surface: #0e1a2b; --surface-2: #122136; --border: #1f3048;
  --text: #e6edf6; --muted: #9fb0c6; --faint: #64748b;
  --ok: #4ade80; --ok-bg: #0f2a1b; --warn: #fbbf24; --warn-bg: #2d2311; --bad: #f87171; --bad-bg: #2f1517;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Icons ---------- */
.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 15px; height: 15px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 8px 14px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 13px;
  white-space: nowrap; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
[data-theme="dark"] .btn-primary { color: #04111d; }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); border-color: var(--bad); }
.btn-danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 5px 9px; font-size: 12px; border-radius: 7px; }
.btn-icon { padding: 6px; width: 32px; height: 32px; }
.btn-icon.btn-sm { width: 28px; height: 28px; padding: 5px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(circle at 20% 10%, rgba(6, 102, 158, .25), transparent 50%),
              radial-gradient(circle at 85% 90%, rgba(242, 165, 22, .18), transparent 45%), var(--bg);
}
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 32px; box-shadow: var(--shadow); }
.login-card .logo { height: 54px; width: auto; margin: 0 auto 18px; }
.login-card h1 { font-size: 22px; text-align: center; }
.login-card p.sub { text-align: center; color: var(--muted); margin: 6px 0 22px; }
.demo-hint { margin-top: 18px; padding: 10px 12px; background: var(--gold-50); border: 1px dashed var(--gold); border-radius: 10px; font-size: 12.5px; }
.form-error { color: var(--bad); font-size: 13px; margin: 0 0 10px; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex: none; background: var(--surface); border-right: 1px solid var(--border);
  position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 40; transition: transform .2s;
}
.sidebar-head { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; border-bottom: 1px solid var(--border); }
.sidebar-head img { height: 34px; width: auto; }
.sidebar-head .t { font-weight: 800; font-size: 14px; line-height: 1.2; }
.sidebar-head .t small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.nav { padding: 10px; overflow-y: auto; flex: 1; }
.nav-label { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--muted);
  font-weight: 600; font-size: 13.5px;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--brand-50); color: var(--brand); }
.nav a .badge { margin-left: auto; }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.storage-bar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin-top: 6px; border: 1px solid var(--border); }
.storage-bar span { display: block; height: 100%; background: var(--brand); }

.main { flex: 1; margin-left: var(--sidebar); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px;
  padding: 12px 24px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar .search { flex: 1; max-width: 420px; position: relative; }
.topbar .search .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.topbar .search input { padding-left: 34px; }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--gold)); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.content { padding: 24px; max-width: 1280px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 24px; letter-spacing: -.01em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.backdrop { display: none; }

/* ---------- Cards / stats ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-head h2 { font-size: 15px; }
.card-body { padding: 16px 18px; }
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.stats { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-bottom: 16px; }
.stat { padding: 16px 18px; display: flex; gap: 14px; align-items: center; cursor: pointer; transition: border-color .15s, transform .15s; }
.stat:hover { border-color: var(--brand); transform: translateY(-1px); }
.stat .ico { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); flex: none; }
.stat .ico.gold { background: var(--gold-50); color: var(--gold); }
.stat .num { font-size: 24px; font-weight: 800; line-height: 1.1; }
.stat .lbl { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.dash-grid { grid-template-columns: 1.4fr 1fr; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .sub { color: var(--muted); font-size: 12.5px; }
.date-chip { width: 46px; flex: none; text-align: center; border-radius: 9px; background: var(--brand-50); color: var(--brand); padding: 5px 0; line-height: 1.1; }
.date-chip b { display: block; font-size: 17px; }
.date-chip small { font-size: 10.5px; font-weight: 700; text-transform: uppercase; }
.quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.quick .btn { justify-content: flex-start; padding: 10px 12px; }
.empty { padding: 36px 18px; text-align: center; color: var(--muted); }
.empty .ic { width: 34px; height: 34px; margin: 0 auto 8px; display: block; color: var(--faint); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 700; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.badge.brand { background: var(--brand); color: #fff; border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: none; }

/* ---------- Toolbar + table ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.toolbar .search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.toolbar .search .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.toolbar .search input { padding-left: 34px; }
.toolbar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 6px 10px; cursor: pointer; color: var(--muted); display: inline-flex; }
.seg button.on { background: var(--brand-50); color: var(--brand); }
.bulkbar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--brand-50); border-bottom: 1px solid var(--border); font-weight: 600; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; background: var(--surface-2); white-space: nowrap; user-select: none; }
th.sortable { cursor: pointer; }
th.sortable:hover { color: var(--text); }
tbody tr:hover { background: var(--surface-2); }
tbody tr.unread td { font-weight: 700; }
td.cb, th.cb { width: 36px; padding-right: 0; }
td.actions { text-align: right; white-space: nowrap; }
td.actions .btn + .btn { margin-left: 4px; }
.cell-title { font-weight: 600; max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-sub { color: var(--muted); font-size: 12px; max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb { width: 56px; height: 40px; border-radius: 7px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--border); }
.thumb.contain { object-fit: contain; background: #fff; padding: 3px; }
.thumb.dark { background: #111; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; color: var(--muted); font-size: 12.5px; flex-wrap: wrap; }
.pager .pages { display: flex; gap: 4px; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }

/* Grid (cards) view */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; padding: 14px; }
.tile { border: 1px solid var(--border); border-radius: 11px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; position: relative; }
.tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface-2); }
.tile img.contain { object-fit: contain; background: #fff; padding: 14px; }
.tile img.dark { background: #111; }
.tile .meta { padding: 10px 12px; flex: 1; }
.tile .meta .t { font-weight: 600; font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .bar { display: flex; gap: 4px; padding: 8px 10px; border-top: 1px solid var(--border); justify-content: flex-end; }
.tile .sel { position: absolute; top: 8px; left: 8px; background: var(--surface); border-radius: 6px; padding: 3px; display: flex; }
.tile .play { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.6); color: #fff; border-radius: 6px; padding: 2px 6px; font-size: 11px; font-weight: 700; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .field > .label { font-weight: 600; font-size: 13px; }
.field .req { color: var(--bad); }
.field .help { color: var(--muted); font-size: 12px; }
.field.invalid input, .field.invalid textarea, .field.invalid .editor { border-color: var(--bad); }
.field .err { color: var(--bad); font-size: 12px; }
.input, input[type="text"], input[type="email"], input[type="url"], input[type="password"], input[type="date"], input[type="datetime-local"], input[type="number"], input[type="search"], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus, .editor:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
textarea { min-height: 90px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.input-row { display: flex; gap: 8px; }
.input-row > input { flex: 1; }

.img-field { display: flex; gap: 12px; align-items: flex-start; }
.img-field .preview { width: 120px; height: 90px; border-radius: 9px; border: 1px dashed var(--border); background: var(--surface-2); display: grid; place-items: center; overflow: hidden; flex: none; color: var(--faint); }
.img-field .preview img { width: 100%; height: 100%; object-fit: cover; }
.img-field .controls { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.img-field .btns { display: flex; gap: 6px; flex-wrap: wrap; }

.editor { border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: var(--surface); }
.editor .tb { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--border); background: var(--surface-2); flex-wrap: wrap; }
.editor .tb button { border: 0; background: transparent; border-radius: 6px; padding: 5px 8px; cursor: pointer; font-weight: 700; font-size: 12.5px; color: var(--muted); min-width: 30px; }
.editor .tb button:hover, .editor .tb button.on { background: var(--surface); color: var(--text); }
.editor .tb .sep { width: 1px; background: var(--border); margin: 3px 4px; }
.editor .area { min-height: 260px; max-height: 460px; overflow-y: auto; padding: 12px 14px; outline: none; }
.editor .area img { max-width: 100%; height: auto; border-radius: 8px; }
.editor .area h2 { font-size: 18px; margin: 14px 0 6px; }
.editor .area h3 { font-size: 16px; margin: 12px 0 6px; }
.editor textarea.html { border: 0; border-radius: 0; min-height: 260px; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; box-shadow: none; }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(6, 14, 25, .55); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 100; overflow-y: auto; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 720px; box-shadow: 0 20px 60px rgba(0,0,0,.3); border: 1px solid var(--border); animation: pop .18s cubic-bezier(.2,.8,.2,1); }
.modal.sm { max-width: 440px; }
.modal.lg { max-width: 920px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 17px; }
.modal-body { padding: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 16px 16px; }
.modal-foot .left { margin-right: auto; }
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; max-height: 60vh; overflow-y: auto; }
.picker button { border: 2px solid transparent; padding: 0; border-radius: 9px; overflow: hidden; cursor: pointer; background: var(--surface-2); }
.picker button:hover { border-color: var(--brand); }
.picker img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.msg-meta { display: grid; grid-template-columns: 90px 1fr; gap: 6px 12px; margin-bottom: 16px; font-size: 13px; }
.msg-meta dt { color: var(--muted); font-weight: 600; }
.msg-meta dd { margin: 0; }
.msg-body { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* ---------- Toasts ---------- */
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); font-weight: 600; font-size: 13px; animation: pop .2s; max-width: 360px; }
.toast.bad { background: var(--bad); color: #fff; }
.toast button { margin-left: 6px; background: transparent; border: 1px solid currentColor; color: inherit; border-radius: 6px; padding: 2px 8px; cursor: pointer; font-weight: 700; font-size: 12px; }

/* ---------- Activity ---------- */
.ic-wrap { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: none; }
.activity li .ic-wrap.create { background: var(--ok-bg); color: var(--ok); }
.activity li .ic-wrap.delete { background: var(--bad-bg); color: var(--bad); }
.activity li .ic-wrap.update { background: var(--brand-50); color: var(--brand); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 10px 16px; }
  .topbar .hide-sm { display: none; }
  .content { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-overlay { padding: 12px; }
  .hide-sm { display: none; }
}

/* ------------------------------------------------------------------
   Orders, settings tabs and accounts — added with the shop sections
   ------------------------------------------------------------------ */

.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs a {
  padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }

.order-view .table-wrap { margin-bottom: 14px; }
.order-totals { max-width: 320px; margin-left: auto; font-size: 14px; }
.order-totals .row { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; color: var(--muted); }
.order-totals .row span:last-child { color: var(--text); font-weight: 600; }
.order-totals .row.total {
  margin-top: 8px; padding-top: 10px; border-top: 2px solid var(--brand);
  font-size: 17px; font-weight: 800; color: var(--text);
}
.order-totals .row.total span:last-child { font-weight: 800; }
.order-view .card { margin-top: 14px; }