/* Tap admin — design system. Get Glass Distribution brand: gold #DDBD52 on black, Inter, light workspace. */
:root {
  --gold: #DDBD52;          /* brand gold — fills, buttons (with dark text) */
  --gold-hover: #CBA93B;
  --blue: #96771C;          /* legacy accent var: deep gold, readable on white */
  --blue-dark: #7A6012;
  --blue-soft: #F6EFD8;
  --ink: #16140F;
  --night: #0D0C0A;         /* sidebar / brand black */
  --gray: #6E6A5E;
  --bg: #F7F6F1;
  --line: #E6E3D8;
  --ok: #0A7F4F;
  --ok-soft: #E4F5EC;
  --warn: #B45309;
  --warn-soft: #FDF1DF;
  --bad: #B42318;
  --bad-soft: #FDEBE9;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 4px; }
h2 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 12px; }
h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; }

/* Shell */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 224px; flex: 0 0 224px; background: var(--night); border-right: 1px solid #262318;
  padding: 20px 12px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: #F3EBD2; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; }
.brand-mark img { width: 38px; height: 38px; display: block; }
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -.02em; display: flex; flex-direction: column; line-height: 1.15; }
.brand-sub { font-weight: 500; font-size: 11px; color: var(--gold); max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px;
  color: #C9C3AE; font-weight: 500; font-size: 14px;
}
.nav-item:hover { background: #1B1912; color: #F3EBD2; }
.nav-item.on { background: #2A2513; color: var(--gold); font-weight: 600; }
.nav-ico { width: 20px; text-align: center; }
.nav-out { color: #8B8672; }
.main { flex: 1; padding: 28px 32px 80px; max-width: 1080px; min-width: 0; }

/* Page head */
.pagehead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.pagehead .sub { color: var(--gray); font-size: 14px; margin: 0; }

/* Cards / panels */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.tight { padding: 14px 16px; }

/* Stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.tile .num { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.tile .lbl { font-size: 12.5px; color: var(--gray); font-weight: 500; margin-top: 2px; }
.tile .delta { font-size: 12px; color: var(--ok); font-weight: 600; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font: inherit; font-weight: 600; font-size: 14px; padding: 9px 16px;
  border-radius: 10px; cursor: pointer; transition: .12s; text-decoration: none;
}
.btn:hover { border-color: #cdd2da; background: #fafafa; }
.btn-primary { background: var(--gold); border-color: var(--gold); color: var(--night); }
.btn-primary:hover { background: var(--gold-hover); border-color: var(--gold-hover); }
.btn-danger { background: #fff; border-color: #f1c1bc; color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--blue); }
.btn-ghost:hover { background: var(--blue-soft); }
.btn-sm { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 13px 22px; font-size: 15.5px; border-radius: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Forms */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=color], select, textarea {
  width: 100%; font: inherit; font-size: 14.5px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue-soft); border-color: var(--blue); }
input[type=color] { padding: 3px 4px; height: 40px; width: 56px; cursor: pointer; }
textarea { min-height: 84px; resize: vertical; }
.help { font-size: 12.5px; color: var(--gray); margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--gray); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px; border-bottom: 1px solid #f0f1f3; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.rowlink:hover td { background: #fafbff; cursor: pointer; }

/* Badges */
.badge { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 10px; background: var(--bg); color: var(--gray); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }

/* Toasts */
.toast {
  position: fixed; top: 18px; right: 18px; z-index: 50; background: var(--ink); color: #fff;
  padding: 11px 18px; border-radius: 12px; font-size: 14px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(16,24,40,.18); transition: opacity .4s; max-width: 340px;
}
.toast-err { background: var(--bad); }
.toast + .toast { top: 70px; }

/* Empty states */
.empty { text-align: center; padding: 44px 20px; color: var(--gray); }
.empty .big { font-size: 40px; margin-bottom: 8px; }
.empty p { margin: 4px 0 16px; }

/* Program mini-card preview (shared by programs.php list & designer) */
.mini-card {
  border-radius: 16px; padding: 18px; color: #fff; width: 100%; max-width: 340px;
  box-shadow: 0 10px 28px rgba(16,24,40,.22);
}
.mini-card .mc-top { display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.mini-card .mc-icon { font-size: 26px; }
.mini-card .mc-name { font-size: 17px; letter-spacing: -.01em; }
.mini-card .mc-stamps { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.mini-card .st { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.22); display: grid; place-items: center; font-size: 15px; }
.mini-card .st.full { background: var(--mc-accent, #FFD166); color: #101828; }
.mini-card .mc-points { font-size: 30px; font-weight: 800; margin-top: 12px; }
.mini-card .mc-sub { font-size: 12.5px; opacity: .85; margin-top: 6px; }

/* Auth pages (login/setup) */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-box { width: 100%; max-width: 400px; }
.auth-box .card { padding: 28px; }
.auth-logo { text-align: center; margin-bottom: 18px; font-size: 34px; }
.auth-title { text-align: center; margin-bottom: 22px; }
.auth-title h1 { font-size: 22px; }
.auth-title p { color: var(--gray); font-size: 14px; margin: 4px 0 0; }

/* Mobile */
@media (max-width: 820px) {
  .shell { flex-direction: column; }
  .sidebar {
    position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; width: auto;
    flex-direction: row; align-items: center; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-right: none; border-top: 1px solid #262318; z-index: 40;
  }
  .brand, .nav-out { display: none; }
  .nav { flex-direction: row; width: 100%; justify-content: space-around; }
  .nav-item { flex-direction: column; gap: 2px; font-size: 10.5px; padding: 6px 8px; }
  .main { padding: 18px 16px 120px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
}
