/* ============================================================
   BarberOS · Sistema de diseño SaaS premium (Glassmorphism)
   Desarrollado por DL Solutions Digitales
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Marca: latón/brass barbería + slate premium */
  --brand: #d8a24a;
  --brand-2: #f0c177;
  --brand-ink: #2a1d07;
  --ok: #3fb98a;
  --warn: #e6a23c;
  --danger: #e5564e;
  --info: #6c8cff;

  /* Tema oscuro (default) */
  --bg: #0c0f15;
  --bg-2: #11151e;
  --bg-grad: radial-gradient(1200px 600px at 80% -10%, rgba(216,162,74,.18), transparent 60%),
             radial-gradient(900px 500px at -10% 20%, rgba(108,140,255,.12), transparent 55%),
             linear-gradient(180deg, #0c0f15, #0a0c11);
  --text: #eef1f6;
  --muted: #9aa3b2;
  --line: rgba(255,255,255,.10);
  --glass: rgba(255,255,255,.055);
  --glass-2: rgba(255,255,255,.085);
  --glass-strong: rgba(20,24,33,.72);
  --shadow: 0 20px 50px -20px rgba(0,0,0,.65);
  --shadow-sm: 0 8px 24px -12px rgba(0,0,0,.55);
  --blur: 16px;

  --r-xs: 8px; --r-sm: 12px; --r-md: 16px; --r-lg: 22px; --r-xl: 30px;
  --sp: 16px;
  --ff-display: "Sora", system-ui, sans-serif;
  --ff-body: "Inter", system-ui, sans-serif;
  --ff-mono: "JetBrains Mono", ui-monospace, monospace;
  --maxw: 1180px;
}

[data-theme="light"] {
  --bg: #eef1f6;
  --bg-2: #ffffff;
  --bg-grad: radial-gradient(1100px 600px at 85% -10%, rgba(216,162,74,.22), transparent 60%),
             radial-gradient(800px 500px at -5% 15%, rgba(108,140,255,.14), transparent 55%),
             linear-gradient(180deg, #f4f6fb, #e9edf4);
  --text: #161b22;
  --muted: #5b6573;
  --line: rgba(13,18,28,.10);
  --glass: rgba(255,255,255,.65);
  --glass-2: rgba(255,255,255,.85);
  --glass-strong: rgba(255,255,255,.86);
  --shadow: 0 24px 50px -22px rgba(40,55,90,.35);
  --shadow-sm: 0 10px 24px -14px rgba(40,55,90,.3);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--ff-body);
  color: var(--text);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color .4s ease, color .3s ease;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1,h2,h3,h4 { font-family: var(--ff-display); font-weight: 700; line-height: 1.12; margin: 0; letter-spacing: -.02em; }
.mono { font-family: var(--ff-mono); }
::selection { background: var(--brand); color: var(--brand-ink); }

/* ---------- Utilidades ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.row { display: flex; gap: 12px; align-items: center; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.center { justify-content: center; }
.col { display: flex; flex-direction: column; gap: 12px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.mt { margin-top: 18px; } .mb { margin-bottom: 18px; }
.tac { text-align: center; }
.small { font-size: .82rem; }
.eyebrow { font-family: var(--ff-mono); font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--brand); }

/* ---------- Glass ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(var(--blur)) saturate(1.2);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card { padding: 20px; }
.card.glass:hover { border-color: rgba(216,162,74,.35); }

/* ---------- Botones ---------- */
.btn {
  --b: var(--glass-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--b); cursor: pointer; font-weight: 600; font-size: .92rem;
  transition: transform .12s ease, box-shadow .2s ease, background .2s, border-color .2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn.primary {
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: var(--brand-ink); border-color: transparent;
  box-shadow: 0 12px 28px -12px rgba(216,162,74,.7);
}
.btn.ghost { background: transparent; }
.btn.danger { background: rgba(229,86,78,.14); border-color: rgba(229,86,78,.4); color: #ff8e88; }
.btn.ok { background: rgba(63,185,138,.14); border-color: rgba(63,185,138,.4); color: #7fe3bc; }
.btn.sm { padding: 7px 13px; font-size: .82rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- Inputs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 14px; border-radius: var(--r-sm);
  background: var(--glass-2); border: 1px solid var(--line); color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(216,162,74,.18); }
textarea.input { resize: vertical; min-height: 84px; }
.input::placeholder { color: var(--muted); opacity: .7; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; border: 1px solid var(--line); }
.badge.ok { background: rgba(63,185,138,.16); color: #7fe3bc; border-color: rgba(63,185,138,.3); }
.badge.warn { background: rgba(230,162,60,.16); color: #f3cf8e; border-color: rgba(230,162,60,.3); }
.badge.danger { background: rgba(229,86,78,.16); color: #ff9a94; border-color: rgba(229,86,78,.3); }
.badge.info { background: rgba(108,140,255,.16); color: #aebcff; border-color: rgba(108,140,255,.3); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--glass-strong); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.topbar .inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 14px; }
.brand-logo { display: flex; align-items: center; gap: 10px; font-family: var(--ff-display); font-weight: 800; font-size: 1.12rem; letter-spacing: -.02em; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--brand-2), var(--brand)); display: grid; place-items: center; color: var(--brand-ink); font-weight: 900; box-shadow: 0 8px 18px -8px rgba(216,162,74,.7); }
.nav-links { display: flex; gap: 4px; }
.nav-links a { padding: 8px 13px; border-radius: 999px; font-size: .9rem; color: var(--muted); font-weight: 600; transition: .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--glass); }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--glass); cursor: pointer; transition: .2s; }
.icon-btn:hover { background: var(--glass-2); transform: translateY(-1px); }

/* ---------- Hero (público) ---------- */
.hero { position: relative; padding: 70px 0 50px; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 4rem); }
.hero h1 .accent { background: linear-gradient(120deg, var(--brand-2), var(--brand)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 1.1rem; color: var(--muted); max-width: 540px; margin-top: 14px; }
.hero-card { padding: 22px; }
.stat { font-family: var(--ff-display); font-size: 1.7rem; font-weight: 800; }
.stat .lbl { display: block; font-size: .74rem; color: var(--muted); font-weight: 600; font-family: var(--ff-body); margin-top: 2px; }

/* secciones */
.section { padding: 46px 0; }
.section h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
.section-head { max-width: 620px; margin-bottom: 26px; }

/* service / product cards */
.tile { overflow: hidden; }
.tile .thumb { aspect-ratio: 16/10; background: linear-gradient(135deg, rgba(216,162,74,.25), rgba(108,140,255,.18)); display: grid; place-items: center; font-size: 2.4rem; }
.tile .body { padding: 16px; }
.price { font-family: var(--ff-display); font-weight: 800; color: var(--brand); }

/* gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.gallery-grid .g-item { aspect-ratio: 1; border-radius: var(--r-md); background: linear-gradient(135deg, rgba(216,162,74,.3), rgba(108,140,255,.22)); display: grid; place-items: center; font-size: 2rem; border: 1px solid var(--line); }

/* faq */
.faq-item { padding: 16px 18px; cursor: pointer; }
.faq-item summary { font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item[open] summary { color: var(--brand); }
.faq-item p { color: var(--muted); margin: 10px 0 0; }

/* ---------- App layout (dashboards) ---------- */
.app-shell { display: grid; grid-template-columns: 250px 1fr; min-height: calc(100vh - 64px); }
.sidebar { padding: 18px 14px; border-right: 1px solid var(--line); background: var(--glass-strong); backdrop-filter: blur(16px); position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; }
.side-link { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 12px; color: var(--muted); font-weight: 600; cursor: pointer; transition: .18s; margin-bottom: 3px; font-size: .92rem; }
.side-link:hover { color: var(--text); background: var(--glass); }
.side-link.active { color: var(--brand); background: rgba(216,162,74,.12); }
.side-link .ico { width: 20px; text-align: center; }
.side-sep { font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); opacity: .7; padding: 14px 13px 6px; }
.main { padding: 26px; overflow-x: hidden; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 1.7rem; }

/* KPI */
.kpi { padding: 18px; }
.kpi .v { font-family: var(--ff-display); font-size: 1.9rem; font-weight: 800; }
.kpi .k { color: var(--muted); font-size: .82rem; font-weight: 600; }
.kpi .trend { font-size: .76rem; }

/* tables */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }

/* mini bar chart */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 10px; }
.bars .bar { flex: 1; background: linear-gradient(180deg, var(--brand-2), var(--brand)); border-radius: 8px 8px 0 0; min-height: 6px; position: relative; transition: height .6s cubic-bezier(.2,.8,.2,1); }
.bars .bar span { position: absolute; bottom: -22px; left: 0; right: 0; text-align: center; font-size: .68rem; color: var(--muted); }

/* booking slots */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(82px,1fr)); gap: 10px; }
.slot { padding: 11px; text-align: center; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); cursor: pointer; font-weight: 600; font-size: .9rem; transition: .15s; }
.slot:hover { border-color: var(--brand); }
.slot.sel { background: linear-gradient(135deg,var(--brand-2),var(--brand)); color: var(--brand-ink); border-color: transparent; }
.slot.taken { opacity: .35; cursor: not-allowed; text-decoration: line-through; }
.choice { padding: 14px; cursor: pointer; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--glass); transition: .15s; }
.choice:hover { border-color: var(--brand); }
.choice.sel { border-color: var(--brand); background: rgba(216,162,74,.12); }

/* day toggles */
.day-toggle { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--glass-2); border: 1px solid var(--line); border-radius: 999px; transition: .2s; }
.switch .track::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: var(--muted); transition: .2s; }
.switch input:checked + .track { background: linear-gradient(135deg,var(--brand-2),var(--brand)); border-color: transparent; }
.switch input:checked + .track::before { transform: translateX(20px); background: var(--brand-ink); }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(5,7,12,.6); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 80; padding: 18px; animation: fade .2s ease; }
.modal { width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; padding: 24px; animation: pop .25s cubic-bezier(.2,.9,.3,1.2); }
.modal h3 { font-size: 1.3rem; margin-bottom: 4px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.97); } }

/* ---------- Toast ---------- */
#toasts { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 120; }
.toast { padding: 13px 18px; border-radius: 14px; background: var(--glass-strong); border: 1px solid var(--line); backdrop-filter: blur(14px); box-shadow: var(--shadow); font-weight: 600; font-size: .9rem; display: flex; gap: 10px; align-items: center; animation: slidein .3s cubic-bezier(.2,.9,.3,1.2); min-width: 220px; }
.toast.ok { border-left: 3px solid var(--ok); } .toast.err { border-left: 3px solid var(--danger); } .toast.info { border-left: 3px solid var(--info); }
@keyframes slidein { from { opacity: 0; transform: translateX(40px); } }

/* ---------- Auth ---------- */
.auth-wrap { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 30px 18px; }
.auth-card { width: 100%; max-width: 420px; padding: 32px; }
.auth-tabs { display: flex; gap: 6px; background: var(--glass); padding: 5px; border-radius: 999px; margin-bottom: 20px; }
.auth-tabs button { flex: 1; padding: 9px; border-radius: 999px; border: none; background: transparent; cursor: pointer; font-weight: 600; color: var(--muted); }
.auth-tabs button.active { background: var(--glass-2); color: var(--text); box-shadow: var(--shadow-sm); }
.demo-pill { font-size: .78rem; padding: 8px 12px; border-radius: 10px; background: var(--glass); border: 1px dashed var(--line); cursor: pointer; transition: .15s; }
.demo-pill:hover { border-color: var(--brand); }

/* ---------- WhatsApp FAB ---------- */
.wa-fab { position: fixed; bottom: 22px; left: 22px; width: 58px; height: 58px; border-radius: 50%; background: #25d366; display: grid; place-items: center; box-shadow: 0 14px 30px -10px rgba(37,211,102,.6); z-index: 60; cursor: pointer; transition: transform .2s; border: none; }
.wa-fab:hover { transform: scale(1.08); }
.wa-fab svg { width: 30px; height: 30px; fill: #fff; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 34px 0; background: var(--glass-strong); }
.dev-badge { display: inline-flex; align-items: center; gap: 9px; padding: 9px 14px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); font-size: .84rem; }

/* progress bar */
.pbar { height: 8px; border-radius: 999px; background: var(--glass-2); overflow: hidden; }
.pbar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-2), var(--brand)); }

/* avatar */
.avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg,var(--brand-2),var(--brand)); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; font-size: .9rem; flex: none; }

/* mobile menu button */
.menu-toggle { display: none; }

/* ---------- Responsive / Mobile first refinements ---------- */
@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 64px; width: 260px; transform: translateX(-105%); transition: transform .25s ease; z-index: 50; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: grid; }
  .g4 { grid-template-columns: repeat(2,1fr); }
  .g3 { grid-template-columns: repeat(2,1fr); }
  .gallery-grid { grid-template-columns: repeat(3,1fr); }
  .nav-links { display: none; }
}
@media (max-width: 640px) {
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2,1fr); }
  .main { padding: 18px 14px; }
  .hero { padding: 40px 0 26px; }
  .page-head { align-items: flex-start; }
  #toasts { left: 14px; right: 14px; bottom: 14px; }
  .toast { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto; }
}
