/* ============================================================
   AltaCore · Demo Barbería · Tema oscuro
   ============================================================ */
:root {
  --bg:        #0a1220;
  --bg-2:      #0d1b2e;
  --sidebar:   #0c1828;
  --card:      #13243d;
  --card-2:    #16294a;
  --border:    #1f3556;
  --text:      #e6edf5;
  --muted:     #8a9bb3;
  --blue:      #3b82f6;
  --blue-2:    #60a5fa;
  --gold:      #e0a82e;
  --gold-2:    #f5c451;
  --green:     #22c55e;
  --red:       #ef4444;
  --shadow:    0 8px 30px rgba(0,0,0,.35);
  --radius:    14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 250px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 50;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 22px 22px 20px;
  border-bottom: 1px solid var(--border);
}
.brand-mark {
  width: 38px; height: 38px; flex-shrink: 0;
  display: grid; place-items: center;
}
.brand-mark svg { width: 100%; height: 100%; }
.brand-text { line-height: 1.1; }
.brand-text strong { font-size: 18px; font-weight: 800; letter-spacing: .3px; }
.brand-text strong span { color: var(--gold); }
.brand-text small { color: var(--muted); font-size: 9.5px; letter-spacing: 1.5px; text-transform: uppercase; }

.nav { padding: 14px 12px; flex: 1; overflow-y: auto; }
.nav-label { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; padding: 12px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--muted); font-weight: 500;
  margin-bottom: 2px; transition: .15s;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: var(--card); color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(59,130,246,.22), rgba(59,130,246,.05));
  color: #fff;
  box-shadow: inset 3px 0 0 var(--blue);
}
.nav-item.active svg { color: var(--blue-2); }

.sidebar-foot {
  padding: 16px; border-top: 1px solid var(--border);
}
.plan-badge {
  background: linear-gradient(135deg, rgba(224,168,46,.18), rgba(224,168,46,.04));
  border: 1px solid rgba(224,168,46,.35);
  border-radius: 12px; padding: 13px 14px;
}
.plan-badge .crown { color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: .5px; }
.plan-badge .pname { font-size: 16px; font-weight: 800; margin: 2px 0 4px; }
.plan-badge .pname span { color: var(--gold-2); }
.plan-badge small { color: var(--muted); font-size: 11px; }

/* ---------- Main ---------- */
.main { margin-left: 250px; flex: 1; min-width: 0; }

.topbar {
  height: 66px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 40;
}
.topbar h1 { font-size: 18px; font-weight: 700; }
.topbar .crumb { color: var(--muted); font-size: 12px; margin-top: 1px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.search {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 14px; color: var(--text);
  width: 240px; font-size: 13px;
}
.search::placeholder { color: var(--muted); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--muted);
  position: relative; cursor: pointer;
}
.icon-btn:hover { color: var(--text); }
.icon-btn .dot {
  position: absolute; top: 8px; right: 9px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--red);
}
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--gold));
  display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 14px;
}
.user-chip .uname { font-size: 13px; font-weight: 600; }
.user-chip .urole { font-size: 11px; color: var(--muted); }

.content { padding: 26px 28px 50px; }

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 18px; }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-2-1 { grid-template-columns: 2fr 1fr; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.card-head h3 { font-size: 15px; font-weight: 700; }
.card-head .link { color: var(--blue-2); font-size: 12px; font-weight: 600; }

/* ---------- Stat cards ---------- */
.stat {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  position: relative; overflow: hidden;
}
.stat .ico {
  width: 42px; height: 42px; border-radius: 11px;
  display: grid; place-items: center; margin-bottom: 14px;
}
.stat .label { color: var(--muted); font-size: 12.5px; }
.stat .value { font-size: 25px; font-weight: 800; margin: 3px 0 6px; }
.stat .delta { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.delta.up { color: var(--green); }
.delta.down { color: var(--red); }
.ico.blue  { background: rgba(59,130,246,.16); color: var(--blue-2); }
.ico.gold  { background: rgba(224,168,46,.16); color: var(--gold-2); }
.ico.green { background: rgba(34,197,94,.16);  color: var(--green); }
.ico.violet{ background: rgba(139,92,246,.16); color: #a78bfa; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; color: var(--muted);
  font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
  font-weight: 600; padding: 11px 14px; border-bottom: 1px solid var(--border);
}
tbody td { padding: 13px 14px; border-bottom: 1px solid rgba(31,53,86,.5); font-size: 13px; }
tbody tr:hover { background: rgba(59,130,246,.05); }
tbody tr:last-child td { border-bottom: none; }
.cell-main { font-weight: 600; }
.cell-sub { color: var(--muted); font-size: 12px; }

/* ---------- Misc UI ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600;
}
.badge.green  { background: rgba(34,197,94,.14);  color: #4ade80; }
.badge.blue   { background: rgba(59,130,246,.14); color: var(--blue-2); }
.badge.gold   { background: rgba(224,168,46,.14); color: var(--gold-2); }
.badge.red    { background: rgba(239,68,68,.14);  color: #f87171; }
.badge.muted  { background: rgba(138,155,179,.14);color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 10px; font-weight: 600;
  font-size: 13px; cursor: pointer; border: 1px solid transparent;
  transition: .15s;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #2f6fe0; }
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #1a1200; }
.btn-gold:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--card); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--card-2); }
.btn-green { background: var(--green); color: #04240f; }

.page-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px; flex-wrap: wrap; gap: 14px;
}
.page-head .ph-title { font-size: 20px; font-weight: 700; }
.page-head .ph-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; }

.avatar-sm {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700;
  font-size: 12px; color: #fff; flex-shrink: 0;
}
.av-1 { background: linear-gradient(135deg,#3b82f6,#1d4ed8); }
.av-2 { background: linear-gradient(135deg,#e0a82e,#b45309); }
.av-3 { background: linear-gradient(135deg,#22c55e,#15803d); }
.av-4 { background: linear-gradient(135deg,#a78bfa,#6d28d9); }
.av-5 { background: linear-gradient(135deg,#f87171,#b91c1c); }
.user-cell { display: flex; align-items: center; gap: 11px; }

/* ---------- Progress / bars ---------- */
.bar-track { background: var(--bg); border-radius: 20px; height: 8px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 20px; background: linear-gradient(90deg,var(--blue),var(--blue-2)); }
.bar-fill.gold { background: linear-gradient(90deg,var(--gold),var(--gold-2)); }
.bar-fill.green { background: linear-gradient(90deg,#15803d,var(--green)); }

/* ---------- Chart (CSS bars) ---------- */
.chart {
  display: flex; align-items: flex-end; gap: 14px;
  height: 200px; padding-top: 10px;
}
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.chart-bar {
  width: 100%; max-width: 38px; border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, var(--blue-2), var(--blue));
  transition: .3s;
}
.chart-bar:hover { filter: brightness(1.15); }
.chart-col span { color: var(--muted); font-size: 11px; }

/* ---------- Donut (conic) ---------- */
.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut {
  width: 140px; height: 140px; border-radius: 50%;
  flex-shrink: 0; position: relative;
}
.donut::after {
  content: ''; position: absolute; inset: 26px;
  background: var(--card); border-radius: 50%;
}
.donut-legend { display: flex; flex-direction: column; gap: 9px; flex: 1; }
.leg-item { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.leg-dot { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.leg-item .leg-val { margin-left: auto; color: var(--muted); font-weight: 600; }

/* ---------- Agenda timeline ---------- */
.appt {
  display: flex; gap: 14px; padding: 13px 0;
  border-bottom: 1px solid rgba(31,53,86,.5);
}
.appt:last-child { border-bottom: none; }
.appt-time {
  text-align: center; flex-shrink: 0; width: 58px;
}
.appt-time strong { display: block; font-size: 14px; }
.appt-time small { color: var(--muted); font-size: 11px; }
.appt-body { flex: 1; }
.appt-body .a-client { font-weight: 600; }
.appt-body .a-serv { color: var(--muted); font-size: 12px; }

/* ---------- Calendar grid ---------- */
.cal {
  display: grid; grid-template-columns: repeat(7,1fr);
  gap: 8px;
}
.cal-head { color: var(--muted); font-size: 11px; text-align: center; font-weight: 600; text-transform: uppercase; padding-bottom: 4px; }
.cal-cell {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 9px; min-height: 78px; padding: 7px 8px;
}
.cal-cell .cd { font-size: 12px; color: var(--muted); font-weight: 600; }
.cal-cell.today { border-color: var(--blue); }
.cal-cell.today .cd { color: var(--blue-2); }
.cal-cell.muted { opacity: .35; }
.cal-pill {
  background: rgba(59,130,246,.16); color: var(--blue-2);
  font-size: 9.5px; font-weight: 600; padding: 2px 5px;
  border-radius: 5px; margin-top: 4px; display: block;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-pill.gold { background: rgba(224,168,46,.16); color: var(--gold-2); }
.cal-pill.green { background: rgba(34,197,94,.16); color: #4ade80; }

/* ---------- Service / product cards ---------- */
.tile {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; transition: .15s;
}
.tile:hover { border-color: var(--blue); transform: translateY(-2px); }
.tile-ico {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center; margin-bottom: 13px;
}
.tile h4 { font-size: 14.5px; font-weight: 700; }
.tile .t-desc { color: var(--muted); font-size: 12px; margin: 4px 0 12px; }
.tile .t-foot { display: flex; align-items: center; justify-content: space-between; }
.tile .t-price { font-size: 18px; font-weight: 800; color: var(--gold-2); }

/* ---------- POS (Caja) ---------- */
.pos { display: grid; grid-template-columns: 1fr 360px; gap: 18px; }
.pos-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; margin-bottom: 9px; cursor: pointer;
}
.pos-item:hover { border-color: var(--blue); }
.ticket-line {
  display: flex; justify-content: space-between;
  padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 13px;
}
.ticket-total {
  display: flex; justify-content: space-between;
  padding-top: 13px; margin-top: 6px; font-size: 18px; font-weight: 800;
}
.pay-methods { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 14px 0; }
.pay-m {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 9px; padding: 11px 6px; text-align: center;
  font-size: 11.5px; font-weight: 600; cursor: pointer;
}
.pay-m.active { border-color: var(--blue); background: rgba(59,130,246,.12); color: var(--blue-2); }

/* ---------- Reports ---------- */
.kpi-row { display: flex; align-items: baseline; gap: 8px; }
.kpi-row .kv { font-size: 22px; font-weight: 800; }

.section-title { font-size: 14px; font-weight: 700; margin: 26px 0 14px; }

/* ---------- WhatsApp banner ---------- */
.wa-banner {
  background: linear-gradient(135deg, rgba(34,197,94,.14), rgba(34,197,94,.03));
  border: 1px solid rgba(34,197,94,.3);
  border-radius: var(--radius); padding: 20px 22px;
  display: flex; align-items: center; gap: 18px;
}
.wa-banner .wa-ico {
  width: 50px; height: 50px; border-radius: 13px;
  background: var(--green); display: grid; place-items: center; flex-shrink: 0;
}
.wa-banner h3 { font-size: 15px; }
.wa-banner p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .g-4 { grid-template-columns: repeat(2,1fr); }
  .g-3 { grid-template-columns: repeat(2,1fr); }
  .pos { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sidebar { transform: translateX(-100%); transition: .25s; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .g-4,.g-3,.g-2,.g-2-1 { grid-template-columns: 1fr; }
  .search { display: none; }
}

.mobile-toggle {
  display: none; background: var(--card); border: 1px solid var(--border);
  color: var(--text); width: 38px; height: 38px; border-radius: 10px;
}
@media (max-width: 760px) { .mobile-toggle { display: grid; place-items: center; } }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }
