:root {
  --verde: #006e51;
  --verde-d: #00543e;
  --verde-dd: #013a2b;
  --marigold: #eda624;
  --marigold-d: #c8860f;
  --cream: #f6f0e2;
  --bg: #f4f5f3;
  --surface: #ffffff;
  --ink: #18140d;
  --muted: #74726b;
  --line: #e8e8e4;
  --danger: #d64545;
  --success: #1f9d57;
  --shadow: 0 1px 3px rgba(24, 20, 13, 0.06), 0 8px 24px rgba(24, 20, 13, 0.05);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }

/* Buttons */
.btn, .btn-accent, .btn-ghost, .btn-danger {
  cursor: pointer; border: none; border-radius: 10px; font-weight: 700; font-size: 14px;
  padding: 11px 18px; transition: transform 0.05s, filter 0.15s, background 0.15s; white-space: nowrap;
}
.btn { background: var(--verde); color: #fff; }
.btn-accent { background: var(--marigold); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: #f0efe9; color: var(--ink); }
.btn:hover, .btn-accent:hover, .btn-danger:hover, .btn-ghost:hover { filter: brightness(0.96); }
.btn:active, .btn-accent:active, .btn-ghost:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }

/* Inputs */
input, select {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); font-size: 15px; color: var(--ink); outline: none; transition: border 0.15s, box-shadow 0.15s;
}
input:focus, select:focus { border-color: var(--verde); box-shadow: 0 0 0 3px rgba(0, 110, 81, 0.12); }
label { display: block; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.field { margin-bottom: 14px; }
.error { color: var(--danger); font-size: 14px; min-height: 18px; margin-top: 8px; }

/* ---------- LOGIN ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1200px 600px at 50% -10%, var(--verde), var(--verde-dd)); }
.login-card { background: var(--surface); border-radius: 22px; padding: 36px 32px; width: 100%; max-width: 380px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3); text-align: center; }
.login-logo { font-size: 44px; }
.login-card h1 { font-size: 27px; margin: 8px 0 2px; }
.login-card p { margin: 0 0 22px; }
.login-card form { text-align: left; }
.login-card label { margin-top: 4px; }
.login-card input { margin-bottom: 14px; }
.login-card button { width: 100%; margin-top: 6px; padding: 13px; font-size: 15px; }

/* ---------- LAYOUT ---------- */
.layout { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

.sidebar { background: linear-gradient(180deg, var(--verde-d), var(--verde-dd)); color: #fff;
  display: flex; flex-direction: column; padding: 22px 16px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 22px; }
.brand-mark { font-size: 26px; }
.brand-text { font-weight: 900; font-size: 18px; line-height: 1; display: flex; flex-direction: column; gap: 3px; }
.brand-text small { font-weight: 600; font-size: 11px; letter-spacing: 0.06em; color: rgba(255, 255, 255, 0.55); text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 11px; background: transparent; color: rgba(255, 255, 255, 0.78);
  border: none; cursor: pointer; padding: 12px 13px; border-radius: 11px; font-size: 14.5px; font-weight: 600; text-align: left; transition: background 0.15s, color 0.15s; }
.nav-item .ico { font-size: 17px; width: 22px; text-align: center; }
.nav-item:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-item.active { background: rgba(255, 255, 255, 0.14); color: #fff; font-weight: 800; }
.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.staff { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: rgba(255, 255, 255, 0.7); margin: 4px 6px 12px; overflow: hidden; }
.staff-dot { width: 8px; height: 8px; border-radius: 50%; background: #5ed39c; flex-shrink: 0; }
.sidebar-foot .btn-ghost { background: rgba(255, 255, 255, 0.1); color: #fff; }
.sidebar-foot .btn-ghost:hover { background: rgba(255, 255, 255, 0.18); filter: none; }

.content { padding: 32px 36px; max-width: 920px; }
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 26px; }
.page-head p { margin: 5px 0 0; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h2 { font-size: 18px; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.empty { text-align: center; color: var(--muted); padding: 60px 20px; font-size: 38px; }
.empty p { font-size: 15px; margin: 10px 0 0; }

/* Searchbar (caja) */
.searchbar { display: flex; gap: 10px; margin-bottom: 18px; }
.searchbar input { font-size: 16px; }
.mini-search { max-width: 280px; }

/* Caja customer */
.profile { display: flex; align-items: center; gap: 16px; }
.avatar { width: 64px; height: 64px; border-radius: 18px; background: var(--marigold); color: var(--ink);
  display: grid; place-items: center; font-size: 24px; font-weight: 900; flex-shrink: 0; }
.profile h2 { font-size: 22px; }
.balance { font-size: 46px; font-weight: 900; color: var(--verde); line-height: 1; }
.pill { display: inline-flex; align-items: center; gap: 5px; background: rgba(237, 166, 36, 0.16); color: var(--marigold-d);
  padding: 5px 12px; border-radius: 999px; font-weight: 800; font-size: 13px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stamps { display: flex; flex-wrap: wrap; gap: 8px; }
.stamp { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; font-weight: 700; color: var(--muted);
  background: var(--cream); border: 1px dashed var(--line); }
.stamp.on { background: rgba(0, 110, 81, 0.12); border: none; color: var(--verde); }
.field-inline { display: flex; gap: 10px; }
.field-inline input { margin: 0; }

.reward { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.reward:first-of-type { border-top: none; }
.reward .emoji { font-size: 26px; width: 34px; text-align: center; }
.reward .grow { flex: 1; }
.reward .cost { color: var(--marigold-d); font-weight: 800; font-size: 12.5px; margin-top: 2px; }
.ledger .li { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.ledger .li:first-child { border-top: none; }
.plus { color: var(--success); font-weight: 800; }
.minus { color: var(--danger); font-weight: 800; }

/* Stats (dashboard) */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); }
.stat .big { font-size: 30px; font-weight: 900; color: var(--verde); line-height: 1; }
.stat .lbl { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-top: 8px; }

/* Table (clientes) */
.table { display: flex; flex-direction: column; }
.trow { display: grid; grid-template-columns: 1fr 130px 90px; align-items: center; gap: 12px; padding: 13px 8px; border-top: 1px solid var(--line); cursor: pointer; border-radius: 8px; }
.trow:first-child { border-top: none; }
.trow:hover { background: #faf9f5; }
.trow .nm { font-weight: 700; }
.trow .ph { color: var(--muted); font-size: 13px; }
.trow .sl { text-align: right; font-weight: 800; color: var(--verde); }
.trow .tg { text-align: right; font-size: 13px; }

/* Reward editor (ajustes) */
.rw-edit { display: grid; grid-template-columns: 56px 1fr 96px 40px; gap: 8px; align-items: center; margin: 8px 0; }
.rw-edit input { margin: 0; }
.rw-emoji { text-align: center; padding: 11px 4px; }

/* Promo */
.promo { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.promo:first-of-type { border-top: none; }
.badge { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em; }
.badge.on { background: rgba(31, 157, 87, 0.14); color: var(--success); }
.badge.off { background: #efeee9; color: var(--muted); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 14px 22px; border-radius: 12px; font-weight: 700; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32); z-index: 50; max-width: 90%; text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; gap: 8px; overflow-x: auto; }
  .brand { padding: 4px 8px; }
  .brand-text small { display: none; }
  .nav { flex-direction: row; gap: 4px; }
  .nav-item { padding: 9px 11px; white-space: nowrap; }
  .nav-item span.ico { display: none; }
  .sidebar-foot { margin: 0 0 0 auto; padding: 0; border: none; display: flex; align-items: center; gap: 8px; }
  .staff { display: none; }
  .content { padding: 20px 16px; }
  .grid2 { grid-template-columns: 1fr; }
}
