/* =====================================================================
   MenuQR — Panel de administración
   ===================================================================== */

:root {
  --a-primary: #92400e;
  --a-primary-dark: #78350f;
  --a-ink: #2b1710;
  --a-sidebar-bg: #2b1710;
  --a-bg: #f5efdd;
  --a-surface: #ffffff;
  --a-border: #ecdfb5;
  --a-soft: #8a7561;
  --a-success: #2f8f5b;
  --a-danger: #d63b3b;
  --font-display: 'Playfair Display SC', Georgia, serif;
  --font-body: 'Karla', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 12px;
}
:root.dark {
  --a-ink: #f6ecd9;
  --a-bg: #1a130a;
  --a-surface: #241a0f;
  --a-border: #3a2c1a;
  --a-soft: #c2ab8e;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: var(--font-body); background: var(--a-bg); color: var(--a-ink);
  transition: background .2s ease, color .2s ease;
}
img { max-width: 100%; }
a { color: inherit; }
[x-cloak] { display: none !important; }

a:focus-visible, button:focus-visible, .a-btn:focus-visible, .a-nav-link:focus-visible {
  outline: 2px solid var(--a-primary);
  outline-offset: 2px;
}
.a-checkbox-pill:focus-within { outline: 2px solid var(--a-primary); outline-offset: 2px; }
.a-switch input:focus-visible + .slider { outline: 2px solid var(--a-primary); outline-offset: 2px; }

.icon { width: 18px; height: 18px; flex-shrink: 0; }

/* ---------- Login screen ---------- */
.a-login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(135deg, #2b1710 0%, #5c2c0d 100%);
}
.a-login-card {
  background: #fff; border-radius: 20px; padding: 44px 38px; width: 100%; max-width: 380px;
  box-shadow: 0 30px 60px rgba(0,0,0,.35);
}
.a-login-card h1 { font-family: var(--font-display); text-align: center; margin: 0 0 6px; font-size: 24px; }
.a-login-card p.sub { text-align: center; color: var(--a-soft); font-size: 14px; margin-bottom: 26px; }
.a-login-brand { display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.a-login-brand .icon { width: 38px; height: 38px; color: var(--a-primary); }
.a-login-demo-note { margin-top: 24px; }

/* ---------- Layout ---------- */
.a-shell { display: flex; min-height: 100vh; }
.a-sidebar {
  width: 240px; background: var(--a-sidebar-bg); color: #f2ece2; flex-shrink: 0;
  padding: 24px 16px; display: flex; flex-direction: column; gap: 4px;
}
.a-sidebar-brand { font-family: var(--font-display); font-size: 20px; padding: 0 10px 22px; }
.a-sidebar-brand span { color: var(--a-primary); }
.a-nav-link {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px;
  font-size: 14.5px; font-weight: 500; color: rgba(255,255,255,.72); text-decoration: none;
}
.a-nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.a-nav-link.active { background: var(--a-primary); color: #fff; }
.a-nav-link .icon { width: 17px; height: 17px; }
.a-sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.1); }
.a-sidebar-foot .a-user {
  font-size: 13px; color: rgba(255,255,255,.6); padding: 0 12px 10px;
  display: flex; align-items: center; gap: 8px;
}
.a-sidebar-foot .a-user .icon { width: 15px; height: 15px; }

.a-main { flex: 1; min-width: 0; }
.a-topbar {
  background: var(--a-surface); border-bottom: 1px solid var(--a-border);
  padding: 16px 32px; display: flex; justify-content: space-between; align-items: center;
}
.a-topbar h1 { font-family: var(--font-display); font-size: 22px; margin: 0; }
.a-icon-btn {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: var(--a-bg); border: 1px solid var(--a-border); color: var(--a-ink);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s ease;
}
.a-icon-btn:hover { background: var(--a-border); }
.a-icon-btn .icon { width: 18px; height: 18px; }
.a-content { padding: 24px 32px 64px; max-width: 1100px; }

/* ---------- Cards / stats ---------- */
.a-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; margin-bottom: 30px; }
.a-stat-card { background: var(--a-surface); border: 1px solid var(--a-border); border-radius: var(--radius); padding: 20px; }
.a-stat-card .num { font-family: var(--font-display); font-size: 30px; margin-bottom: 4px; }
.a-stat-card .label { font-size: 13px; color: var(--a-soft); }

.a-card { background: var(--a-surface); border: 1px solid var(--a-border); border-radius: var(--radius); padding: 24px; margin-bottom: 22px; }
.a-card h2 { font-family: var(--font-display); font-size: 18px; margin: 0 0 18px; }

/* ---------- Forms ---------- */
.a-field { margin-bottom: 16px; }
.a-field label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 8px; }
.a-field .hint { font-size: 12px; color: var(--a-soft); margin-top: 4px; }
.a-field input[type=text], .a-field input[type=number], .a-field input[type=password],
.a-field input[type=tel], .a-field textarea, .a-field select {
  width: 100%; padding: 11px 13px; border-radius: 9px; border: 1px solid var(--a-border);
  font-family: var(--font-body); font-size: 14.5px; background: #fff; color: var(--a-ink);
}
.a-field input:focus, .a-field textarea:focus, .a-field select:focus { outline: 2px solid var(--a-primary); outline-offset: 1px; }
.a-field textarea { resize: vertical; min-height: 80px; }
.a-field input[type=color] { width: 60px; height: 42px; padding: 4px; border-radius: 9px; border: 1px solid var(--a-border); cursor: pointer; }
.a-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.a-checkbox-row { display: flex; flex-wrap: wrap; gap: 10px; }
.a-checkbox-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--a-border); padding: 8px 13px; border-radius: 999px; font-size: 13.5px; cursor: pointer; }
.a-checkbox-pill .icon { width: 14px; height: 14px; }
.a-checkbox-pill input { margin: 0; }

.a-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 11px 20px; border-radius: 9px;
  font-weight: 600; font-size: 14px; cursor: pointer; border: 1px solid transparent; text-decoration: none;
}
.a-btn .icon { width: 16px; height: 16px; }
.a-btn-primary { background: var(--a-primary); color: #fff; }
.a-btn-primary:hover { background: var(--a-primary-dark); }
.a-btn-secondary { background: #fff; border-color: var(--a-border); color: var(--a-ink); }
.a-btn-secondary:hover { background: var(--a-bg); }
.a-btn-danger { background: #fff; border-color: var(--a-danger); color: var(--a-danger); }
.a-btn-danger:hover { background: var(--a-danger); color: #fff; }
.a-btn-sm { padding: 7px 13px; min-height: 40px; font-size: 13px; }
.a-btn-block { width: 100%; justify-content: center; }
.a-btn[disabled] { opacity: .5; cursor: not-allowed; }

.a-alert { padding: 13px 16px; border-radius: 9px; font-size: 14px; margin-bottom: 18px; }
.a-alert-error { background: #fdecec; color: #a32323; border: 1px solid #f3c6c6; }
.a-alert-success { background: #e9f7ef; color: #1e6b40; border: 1px solid #bfe6cf; }

/* ---------- Category / dish lists ---------- */
.a-cat-list { display: flex; flex-direction: column; gap: 10px; }
.a-cat-row {
  display: flex; align-items: center; gap: 12px; background: var(--a-surface);
  border: 1px solid var(--a-border); border-radius: 10px; padding: 12px 14px;
}
.a-drag-handle { cursor: grab; color: var(--a-soft); font-size: 16px; user-select: none; }
.a-cat-row.sortable-ghost { opacity: .4; }
.a-cat-name { flex: 1; font-weight: 600; font-size: 14.5px; }
.a-cat-count { font-size: 12.5px; color: var(--a-soft); }
.a-row-actions { display: flex; gap: 6px; }

.a-dish-table { width: 100%; border-collapse: collapse; }
.a-dish-row { background: var(--a-surface); }
.a-dish-row td { padding: 12px 10px; border-bottom: 1px solid var(--a-border); font-size: 14px; vertical-align: middle; }
.a-dish-thumb-sm { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--a-bg); }
.a-dish-name-cell { font-weight: 600; }
.a-dish-name-cell .desc { font-weight: 400; color: var(--a-soft); font-size: 12.5px; margin-top: 2px; max-width: 280px; }

.a-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.a-switch input { opacity: 0; width: 0; height: 0; }
.a-switch .slider {
  position: absolute; cursor: pointer; inset: 0; background: #d9d2c4; border-radius: 999px; transition: .2s;
}
.a-switch .slider::before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .2s;
}
.a-switch input:checked + .slider { background: var(--a-success); }
.a-switch input:checked + .slider::before { transform: translateX(18px); }

.a-tag-chip { font-size: 11px; background: #fbe8c6; padding: 3px 8px; border-radius: 999px; margin-right: 4px; display: inline-flex; align-items: center; gap: 3px; }
.a-tag-chip .icon { width: 11px; height: 11px; }

.a-empty { text-align: center; padding: 50px 20px; color: var(--a-soft); }

/* ---------- QR page ---------- */
.a-qr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.a-qr-box { text-align: center; }
.a-qr-box img { border: 1px solid var(--a-border); border-radius: 12px; background: #fff; padding: 16px; }
.a-download-links { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

.a-tent-card {
  background: #fff; border-radius: var(--radius); padding: 24px 20px; text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.15); max-width: 260px; margin: 0 auto;
  border: 1px solid #eee;
}
.a-tent-card img.qr { width: 100%; margin: 14px 0; }
.a-tent-card .rest-name { font-family: var(--font-display); font-size: 17px; font-weight: 700; }
.a-tent-card .cta { font-size: 12px; color: #777; text-transform: uppercase; letter-spacing: .06em; margin-top: 8px; }
.a-tent-preview-wrap {
  background: repeating-linear-gradient(45deg, #ece6da, #ece6da 10px, #e4ddcd 10px, #e4ddcd 20px);
  border-radius: 12px; padding: 40px 20px; display: flex; align-items: center; justify-content: center;
}

@media (max-width: 900px) {
  .a-shell { flex-direction: column; }
  .a-sidebar { width: 100%; flex-direction: row; overflow-x: auto; padding: 12px; align-items: center; }
  .a-sidebar-brand { padding: 0 12px 0 4px; }
  .a-sidebar-foot { display: none; }
  .a-content { padding: 20px 16px 50px; }
  .a-topbar { padding: 16px; }
  .a-row-2, .a-qr-grid { grid-template-columns: 1fr; }
}
