/* ============================================================
   BeautyPOS — Design System
   Fuentes: Syne (display) + DM Sans (body)
   Paleta: Obsidiana + Rosa dorado + Marfil
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,500;0,9..40,700;1,9..40,300&display=swap');

:root {
  --ink:      #0d0d0f;
  --ink-2:    #1c1c22;
  --ink-3:    #2e2e38;
  --muted:    #6b6b80;
  --border:   #e8e6f0;
  --surface:  #f7f6fb;
  --white:    #ffffff;

  --rose:     #e8506a;
  --rose-dk:  #c73d57;
  --rose-lt:  #fce8ec;
  --gold:     #c9963a;
  --gold-lt:  #fdf3e3;
  --emerald:  #2f9e6f;
  --emerald-lt:#e4f5ee;
  --violet:   #6c4de6;
  --violet-lt:#f0ecff;

  --r-xs: 8px;
  --r-sm: 14px;
  --r-md: 20px;
  --r-lg: 28px;
  --r-xl: 40px;
  --r-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(13,13,15,.06), 0 1px 2px rgba(13,13,15,.04);
  --shadow-md: 0 4px 16px rgba(13,13,15,.09), 0 2px 6px rgba(13,13,15,.06);
  --shadow-lg: 0 16px 48px rgba(13,13,15,.14), 0 4px 16px rgba(13,13,15,.08);
  --shadow-rose: 0 8px 24px rgba(232,80,106,.25);
  --shadow-ink: 0 8px 24px rgba(13,13,15,.40);

  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  --transition: 200ms cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---- Typography ---- */
h1,h2,h3,h4,h5 { font-family: var(--font-display); line-height: 1.15; }
.display { font-size: clamp(2.2rem, 5vw, 4rem); font-weight: 800; letter-spacing: -.03em; }
.label   { font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-body); font-weight: 700; font-size: .875rem;
  border: none; border-radius: var(--r-md); cursor: pointer;
  padding: .75rem 1.5rem; transition: all var(--transition);
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary   { background: var(--ink);    color: var(--white); box-shadow: var(--shadow-ink); }
.btn-primary:hover { background: var(--ink-3); }
.btn-rose      { background: var(--rose);   color: var(--white); box-shadow: var(--shadow-rose); }
.btn-rose:hover{ background: var(--rose-dk);}
.btn-ghost     { background: transparent;  color: var(--ink);   border: 1.5px solid var(--border); }
.btn-ghost:hover{ background: var(--surface); }
.btn-sm        { padding: .5rem 1rem; font-size: .8rem; border-radius: var(--r-sm); }
.btn-lg        { padding: 1rem 2rem; font-size: 1rem; border-radius: var(--r-lg); }
.btn-icon      { width: 2.5rem; height: 2.5rem; padding: 0; border-radius: var(--r-sm); }
.btn-danger    { color: #c0392b; background: #fef2f2; }
.btn-danger:hover { background: #c0392b; color: white; }
.btn-success   { background: var(--emerald); color: white; }
.btn-success:hover { background: #27875f; }

/* ---- Inputs ---- */
.input, .select, .textarea {
  width: 100%; padding: .75rem 1rem;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--r-md); font-family: var(--font-body); font-size: .9rem;
  color: var(--ink); transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.input:focus,.select:focus,.textarea:focus {
  border-color: var(--rose); box-shadow: 0 0 0 3px var(--rose-lt);
}
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; }
.input-icon .input { padding-left: 2.75rem; }
.label-field { display: block; font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: .4rem; }

/* ---- Cards ---- */
.card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-pad { padding: 1.75rem; }
.card-pad-lg { padding: 2.5rem; }

/* ---- Badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: .25rem .7rem; border-radius: var(--r-full);
}
.badge-pending  { background: var(--gold-lt);    color: var(--gold); }
.badge-confirmed{ background: var(--emerald-lt); color: var(--emerald); }
.badge-rejected { background: #fef2f2;           color: #c0392b; }
.badge-completed{ background: var(--violet-lt);  color: var(--violet); }
.badge-blocked  { background: var(--border);     color: var(--muted); }
.badge-rose     { background: var(--rose-lt);    color: var(--rose); }

/* ---- Toast ---- */
#toast-container {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 9999;
  display: flex; flex-direction: column; gap: .75rem;
}
.toast {
  background: var(--ink); color: white;
  padding: 1rem 1.5rem; border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); font-weight: 500; font-size: .9rem;
  display: flex; align-items: center; gap: .75rem;
  animation: slideUp .25s ease forwards;
  max-width: 360px;
}
.toast.error { background: #c0392b; }
.toast svg { flex-shrink: 0; }
@keyframes slideUp { from { opacity:0; transform: translateY(1rem); } to { opacity:1; transform: translateY(0); } }
@keyframes fadeOut { to { opacity:0; transform: translateY(-1rem); } }

/* ---- Layout ---- */
#app { min-height: 100vh; display: flex; }

/* Sidebar */
#sidebar {
  width: 260px; flex-shrink: 0;
  background: var(--ink); color: white;
  display: flex; flex-direction: column;
  padding: 1.5rem 1rem;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100; overflow-y: auto;
  transition: transform var(--transition);
}
#sidebar .brand {
  display: flex; align-items: center; gap: .875rem;
  padding: .5rem .75rem 1.75rem;
}
#sidebar .brand-icon {
  width: 42px; height: 42px; background: var(--rose);
  border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-rose); flex-shrink: 0;
}
#sidebar .brand-name { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; }
#sidebar .brand-sub  { font-size: .65rem; color: rgba(255,255,255,.4); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
#sidebar nav { flex: 1; display: flex; flex-direction: column; gap: .25rem; }
.nav-item {
  display: flex; align-items: center; gap: .875rem;
  padding: .875rem 1rem; border-radius: var(--r-md);
  color: rgba(255,255,255,.5); font-size: .875rem; font-weight: 500;
  cursor: pointer; transition: all var(--transition); border: none;
  background: transparent; text-align: left; width: 100%;
}
.nav-item:hover  { background: rgba(255,255,255,.07); color: rgba(255,255,255,.9); }
.nav-item.active { background: var(--rose); color: white; font-weight: 700; box-shadow: var(--shadow-rose); }
.nav-item svg    { width: 18px; height: 18px; flex-shrink: 0; }
#sidebar .sidebar-footer { padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: .5rem; }
.user-chip {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem; background: rgba(255,255,255,.06); border-radius: var(--r-md);
}
.user-avatar {
  width: 36px; height: 36px; background: var(--rose);
  border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: .9rem; flex-shrink: 0;
}
.user-name  { font-size: .8rem; font-weight: 700; }
.user-role  { font-size: .65rem; color: rgba(255,255,255,.4); text-transform: uppercase; letter-spacing: .08em; }

/* Main */
#main-content {
  flex: 1; margin-left: 260px;
  display: flex; flex-direction: column;
  min-height: 100vh;
}
.page-header {
  padding: 2rem 2.5rem 0;
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; flex-wrap: wrap;
}
.page-title { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; }
.page-sub   { font-size: .85rem; color: var(--muted); margin-top: .2rem; }
.page-body  { padding: 1.5rem 2.5rem 3rem; flex: 1; }

/* ---- Stats grid ---- */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.stat-card  { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 1.75rem; display: flex; flex-direction: column; gap: 1rem; }
.stat-icon  { width: 44px; height: 44px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; }
.stat-icon.rose    { background: var(--rose-lt); color: var(--rose); }
.stat-icon.emerald { background: var(--emerald-lt); color: var(--emerald); }
.stat-icon.violet  { background: var(--violet-lt); color: var(--violet); }
.stat-value { font-family: var(--font-display); font-size: 2.2rem; font-weight: 800; letter-spacing: -.04em; }
.stat-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }

/* ---- POS ---- */
.pos-grid   { display: grid; grid-template-columns: 1fr 340px; gap: 1.5rem; }
.item-grid  { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
.item-card  {
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: var(--r-lg); padding: 1.25rem; cursor: pointer;
  transition: all var(--transition); text-align: left; display: flex; flex-direction: column; gap: .5rem;
}
.item-card:hover { border-color: var(--rose); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.item-card:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.7); transform: none!important; }
.item-card .item-icon { width: 40px; height: 40px; border-radius: var(--r-xs); display: flex; align-items: center; justify-content: center; }
.item-card .item-name  { font-weight: 700; font-size: .875rem; line-height: 1.2; }
.item-card .item-price { font-family: var(--font-display); font-size: 1.25rem; font-weight: 800; }
.item-card .item-stock { font-size: .72rem; color: var(--muted); }
.cart-panel { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 1.5rem; display: flex; flex-direction: column; height: fit-content; position: sticky; top: 1.5rem; }
.cart-item  { display: flex; align-items: center; gap: .75rem; padding: .75rem; background: var(--surface); border-radius: var(--r-md); }
.cart-item-name { flex: 1; font-size: .85rem; font-weight: 600; }
.cart-total { font-family: var(--font-display); font-size: 2.5rem; font-weight: 800; letter-spacing: -.04em; }

/* ---- Agenda ---- */
.calendar-grid  { display: grid; grid-template-columns: repeat(7,1fr); gap: .3rem; }
.cal-day        { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: var(--r-sm); cursor: pointer; font-size: .85rem; font-weight: 500; transition: all var(--transition); }
.cal-day:hover  { background: var(--rose-lt); color: var(--rose); }
.cal-day.today  { background: var(--rose); color: white; font-weight: 800; }
.cal-day.selected { background: var(--ink); color: white; }
.cal-day.has-apts::after { content:''; width:5px; height:5px; background:var(--rose); border-radius:50%; position:absolute; bottom:4px; left:50%; transform:translateX(-50%); }
.cal-day { position: relative; }
.apt-item { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-md); padding: 1rem 1.25rem; display: flex; align-items: center; gap: 1rem; transition: box-shadow var(--transition); }
.apt-item:hover { box-shadow: var(--shadow-md); }
.apt-time  { font-family: var(--font-display); font-size: 1rem; font-weight: 800; min-width: 70px; }
.apt-info  { flex: 1; }
.apt-name  { font-weight: 700; font-size: .9rem; }
.apt-service { font-size: .78rem; color: var(--muted); }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(13,13,15,.65);
  backdrop-filter: blur(6px); z-index: 500;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  background: var(--white); border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; max-height: 90vh; display: flex; flex-direction: column;
  animation: scaleIn .25s cubic-bezier(.4,0,.2,1);
}
@keyframes scaleIn { from { opacity:0; transform: scale(.95); } }
.modal-header { padding: 1.75rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-body   { padding: 1.75rem; overflow-y: auto; flex: 1; }
.modal-footer { padding: 1.25rem 1.75rem; border-top: 1px solid var(--border); display: flex; gap: .75rem; justify-content: flex-end; }

/* ---- Tables ---- */
.table-wrap  { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--border); }
table        { width: 100%; border-collapse: collapse; }
thead th     { background: var(--surface); padding: .875rem 1.25rem; text-align: left; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); border-bottom: 1px solid var(--border); }
tbody td     { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); font-size: .875rem; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface); }

/* ---- Booking Page (Cliente) ---- */
.booking-wrap { max-width: 640px; margin: 0 auto; padding: 2rem 1rem 6rem; }
.step-num { width: 28px; height: 28px; background: var(--ink); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 800; flex-shrink: 0; }
.service-card {
  border: 1.5px solid var(--border); border-radius: var(--r-xl);
  display: flex; overflow: hidden; cursor: pointer; transition: all var(--transition);
  background: var(--white);
}
.service-card:hover { border-color: var(--rose); box-shadow: var(--shadow-md); }
.service-card.active { border-color: var(--rose); box-shadow: var(--shadow-rose); }
.service-img { width: 110px; flex-shrink: 0; background: var(--surface); display: flex; align-items: center; justify-content: center; }
.service-img img { width: 100%; height: 100%; object-fit: cover; }
.service-body { padding: 1.25rem; flex: 1; }
.service-name  { font-family: var(--font-display); font-weight: 700; font-size: 1rem; }
.service-price { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; color: var(--rose); }
.service-desc  { font-size: .8rem; color: var(--muted); margin-top: .3rem; }
.slot-btn { border: 1.5px solid var(--border); background: var(--white); border-radius: var(--r-md); padding: .6rem .75rem; font-weight: 700; font-size: .82rem; cursor: pointer; transition: all var(--transition); }
.slot-btn:hover  { border-color: var(--rose); color: var(--rose); }
.slot-btn.active { background: var(--rose); border-color: var(--rose); color: white; }
.slots-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }

/* ---- Login ---- */
#login-screen {
  position: fixed; inset: 0; background: var(--ink);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.login-orb { position: absolute; border-radius: 50%; filter: blur(100px); opacity: .15; }
.login-card { background: var(--white); border-radius: var(--r-xl); padding: 3rem 2.5rem; width: 100%; max-width: 420px; position: relative; z-index: 1; }
.login-logo { width: 60px; height: 60px; background: var(--rose); border-radius: var(--r-lg); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-rose); margin-bottom: 1.5rem; }
.login-title { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; margin-bottom: .3rem; }
.login-sub   { color: var(--muted); font-size: .875rem; margin-bottom: 2rem; }

/* ---- Responsive ---- */
#menu-toggle { display: none; }
@media (max-width: 768px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); }
  #main-content { margin-left: 0; }
  .page-header { padding: 1.25rem 1rem 0; }
  .page-body   { padding: 1rem 1rem 5rem; }
  .stats-grid  { grid-template-columns: 1fr; }
  .pos-grid    { grid-template-columns: 1fr; }
  .cart-panel  { position: fixed; bottom: 0; left: 0; right: 0; border-radius: var(--r-xl) var(--r-xl) 0 0; z-index: 50; border: none; border-top: 1px solid var(--border); }
  #menu-toggle { display: flex; position: fixed; top: 1rem; left: 1rem; z-index: 200; background: var(--ink); color: white; border: none; border-radius: var(--r-md); width: 44px; height: 44px; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--shadow-ink); }
  .modal { max-width: 100%; border-radius: var(--r-xl) var(--r-xl) 0 0; position: fixed; bottom: 0; left: 0; right: 0; }
}

/* ---- Utility ---- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .25rem; } .gap-2 { gap: .5rem; } .gap-3 { gap: .75rem; } .gap-4 { gap: 1rem; }
.mb-1 { margin-bottom: .25rem; } .mb-2 { margin-bottom: .5rem; } .mb-3 { margin-bottom: .75rem; }
.mb-4 { margin-bottom: 1rem; } .mb-6 { margin-bottom: 1.5rem; } .mb-8 { margin-bottom: 2rem; }
.mt-4 { margin-top: 1rem; } .mt-6 { margin-top: 1.5rem; }
.text-rose    { color: var(--rose); }
.text-emerald { color: var(--emerald); }
.text-muted   { color: var(--muted); }
.text-sm      { font-size: .85rem; }
.text-xs      { font-size: .72rem; }
.fw-800       { font-weight: 800; }
.fw-700       { font-weight: 700; }
.grid-2       { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3       { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; }
.full-w       { width: 100%; }
.divider      { height: 1px; background: var(--border); margin: 1.5rem 0; }
.empty-state  { text-align: center; padding: 3rem; color: var(--muted); }
.empty-state svg { margin: 0 auto 1rem; opacity: .3; display: block; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--rose); border-radius: 50%; animation: spin .6s linear infinite; margin: 2rem auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.section-title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 800; margin-bottom: 1.25rem; }

/* Tabs dentro de páginas */
.tab-bar { display: flex; gap: .5rem; background: var(--surface); border-radius: var(--r-lg); padding: .35rem; width: fit-content; margin-bottom: 1.5rem; }
.tab-pill { padding: .5rem 1.25rem; border-radius: var(--r-md); font-size: .83rem; font-weight: 700; cursor: pointer; border: none; background: transparent; color: var(--muted); transition: all var(--transition); }
.tab-pill.active { background: var(--white); color: var(--ink); box-shadow: var(--shadow-sm); }

/* Permisos checkbox grid */
.perm-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: .5rem; }
.perm-item { display: flex; align-items: center; gap: .6rem; padding: .75rem; background: var(--surface); border-radius: var(--r-md); cursor: pointer; border: 1.5px solid transparent; transition: all var(--transition); }
.perm-item:hover { border-color: var(--rose-lt); }
.perm-item input { accent-color: var(--rose); width: 16px; height: 16px; }
.perm-label { font-size: .8rem; font-weight: 600; }
