/* styles.css — Sistema de diseño Hotel Morales Guest House */

/* ---------- Tokens ---------- */
:root{
  /* Paleta base de marca */
  --navy:    #0A3D4A;
  --navy-700:#0D4B5B;
  --navy-600:#125e72;
  --teal:    #1C7293;
  --teal-600:#1f7ea2;
  --gold:    #D9A441;
  --gold-700:#bf8b2c;

  /* Neutros (gris pizarra) */
  --ink:     #1f2a30;   /* texto principal */
  --slate:   #51626b;   /* texto secundario */
  --muted:   #7c8b93;   /* texto terciario */
  --line:    #e3ebef;   /* bordes */
  --line-2:  #eef3f6;
  --bg:      #F6FAFB;   /* fondo app */
  --surface: #ffffff;   /* tarjetas */
  --surface-2:#f3f8fa;

  /* Semáforo de estados */
  --ok:      #2e9e6b;   --ok-bg:#e7f5ee;
  --warn:    #d9962f;   --warn-bg:#fbf1df;
  --busy:    #d2533e;   --busy-bg:#fbeae6;
  --clean:   #2f7fb3;   --clean-bg:#e6f1f8;
  --maint:   #7c8b93;   --maint-bg:#eef2f4;

  /* Tipografía */
  --serif: "Raleway", system-ui, sans-serif;
  --sans:  "Raleway", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Sombras */
  --sh-sm: 0 1px 2px rgba(10,61,74,.06), 0 1px 1px rgba(10,61,74,.04);
  --sh-md: 0 4px 16px rgba(10,61,74,.08), 0 1px 3px rgba(10,61,74,.05);
  --sh-lg: 0 18px 50px rgba(10,61,74,.18);

  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --sidebar-w: 248px;
}

/* Variantes de paleta (tweak) */
.pal-bosque{ --navy:#173a30; --teal:#2d7a5f; --gold:#c8923a; }
.pal-andes { --navy:#3a2a3f; --teal:#7a4a78; --gold:#d98a4a; }

*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; }
body{
  font-family:var(--sans);
  color:var(--ink);
  background:var(--bg);
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
button{ font-family:inherit; cursor:pointer; }
input,select,textarea{ font-family:inherit; }

/* ---------- Tipografía ---------- */
.serif{ font-family:var(--serif); }
.h-page{ font-family:var(--serif); font-weight:800; font-size:30px; letter-spacing:.2px; color:var(--navy); margin:0; line-height:1.1; }
.h-card{ font-family:var(--serif); font-weight:700; font-size:20px; color:var(--navy); margin:0; }
.sub{ color:var(--slate); font-size:13.5px; }
.eyebrow{ font-size:11px; letter-spacing:.14em; text-transform:uppercase; color:var(--muted); font-weight:600; }

/* ---------- Botones ---------- */
.btn{
  display:inline-flex; align-items:center; gap:8px; justify-content:center;
  border:1px solid transparent; border-radius:var(--r-sm);
  font-size:14px; font-weight:600; padding:10px 16px; line-height:1;
  transition:transform .08s ease, background .15s ease, box-shadow .15s ease;
  white-space:nowrap;
}
.btn:active{ transform:translateY(1px); }
.btn-primary{ background:var(--teal); color:#fff; }
.btn-primary:hover{ background:var(--teal-600); }
.btn-teal{ background:var(--teal); color:#fff; }
.btn-teal:hover{ background:var(--navy-600); }
.btn-gold{ background:var(--gold); color:#3a2a07; }
.btn-gold:hover{ background:var(--gold-700); color:#fff; }
.btn-ghost{ background:transparent; color:var(--slate); border-color:var(--line); }
.btn-ghost:hover{ background:var(--surface-2); color:var(--ink); }
.btn-danger{ background:#fff; color:var(--busy); border-color:#f0cabf; }
.btn-danger:hover{ background:var(--busy-bg); }
.btn-sm{ padding:7px 12px; font-size:13px; }
.btn-block{ width:100%; }

/* ---------- Inputs ---------- */
.field{ display:flex; flex-direction:column; gap:6px; }
.label{ font-size:12.5px; font-weight:600; color:var(--slate); letter-spacing:.01em; }
.input, .select{
  appearance:none; width:100%;
  border:1px solid var(--line); background:#fff;
  border-radius:var(--r-sm); padding:11px 13px; font-size:14px; color:var(--ink);
  transition:border .15s ease, box-shadow .15s ease;
}
.input::placeholder{ color:var(--muted); }
.input:focus, .select:focus{
  outline:none; border-color:var(--teal);
  box-shadow:0 0 0 3px rgba(28,114,147,.14);
}
.input.invalid{ border-color:var(--busy); box-shadow:0 0 0 3px rgba(210,83,62,.12); }
.select{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237c8b93' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 12px center; padding-right:34px;
}
.input-icon{ position:relative; }
.input-icon .input{ padding-left:38px; }
.input-icon svg{ position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--muted); }

/* ---------- Cards ---------- */
.card{ background:var(--surface); border:1px solid var(--line); border-radius:var(--r); box-shadow:var(--sh-sm); }
.card-pad{ padding:20px; }

/* ---------- Badges (semáforo) ---------- */
.badge{
  display:inline-flex; align-items:center; gap:6px;
  font-size:12px; font-weight:600; padding:4px 10px; border-radius:999px; line-height:1.3;
  text-transform:capitalize;
}
.badge .dot{ width:7px; height:7px; border-radius:50%; }
.b-ok{    background:var(--ok-bg);    color:#1d6f49; } .b-ok .dot{background:var(--ok);}
.b-warn{  background:var(--warn-bg);  color:#9a6a16; } .b-warn .dot{background:var(--warn);}
.b-busy{  background:var(--busy-bg);  color:#a73a28; } .b-busy .dot{background:var(--busy);}
.b-clean{ background:var(--clean-bg); color:#1f6492; } .b-clean .dot{background:var(--clean);}
.b-maint{ background:var(--maint-bg); color:#5d6a72; } .b-maint .dot{background:var(--maint);}
.b-info{  background:#eaf0f2; color:var(--navy); }

/* ---------- Tablas ---------- */
.tbl{ width:100%; border-collapse:collapse; font-size:14px; }
.tbl thead th{
  text-align:left; font-size:11.5px; letter-spacing:.06em; text-transform:uppercase;
  color:var(--muted); font-weight:700; padding:12px 16px; border-bottom:1px solid var(--line);
  background:var(--surface-2);
}
.tbl tbody td{ padding:14px 16px; border-bottom:1px solid var(--line-2); color:var(--ink); vertical-align:middle; }
.tbl tbody tr:last-child td{ border-bottom:none; }
.tbl tbody tr{ transition:background .12s ease; }
.tbl tbody tr:hover{ background:var(--surface-2); }
.tbl .num{ font-variant-numeric:tabular-nums; }

/* ---------- Layout app ---------- */
.app{ display:flex; min-height:100vh; }
.main{ flex:1; min-width:0; display:flex; flex-direction:column; }
.content{ padding:28px 32px 48px; max-width:1240px; width:100%; margin:0 auto; }

/* ---------- Sidebar ---------- */
.sidebar{
  width:var(--sidebar-w); flex-shrink:0; background:var(--navy); color:#cfe0e6;
  display:flex; flex-direction:column; position:sticky; top:0; height:100vh;
}
.sb-brand{ display:flex; align-items:center; gap:11px; padding:20px 20px 18px; }
.sb-logo{ width:38px; height:38px; border-radius:10px; background:linear-gradient(140deg,var(--teal),var(--navy-600)); display:grid; place-items:center; color:#fff; flex-shrink:0; border:1px solid rgba(255,255,255,.12); }
.sb-name{ font-family:var(--serif); font-weight:600; font-size:18px; color:#fff; line-height:1.05; }
.sb-tag{ font-size:10px; letter-spacing:.16em; text-transform:uppercase; color:var(--gold); margin-top:2px; }
.sb-sep{ height:1px; background:rgba(255,255,255,.08); margin:4px 16px 10px; }
.sb-nav{ flex:1; overflow-y:auto; padding:4px 12px; display:flex; flex-direction:column; gap:2px; }
.sb-cat{ font-size:10px; letter-spacing:.14em; text-transform:uppercase; color:#6f97a3; padding:14px 12px 6px; font-weight:700; }
.sb-item{
  display:flex; align-items:center; gap:11px; padding:10px 12px; border-radius:9px;
  color:#bcd2da; font-size:14px; font-weight:500; border:none; background:transparent; width:100%; text-align:left;
  transition:background .12s ease, color .12s ease;
}
.sb-item:hover{ background:rgba(255,255,255,.06); color:#fff; }
.sb-item.active{ background:rgba(255,255,255,.12); color:#fff; }
.sb-item.active .ic{ color:var(--gold); }
.sb-item .ic{ flex-shrink:0; opacity:.95; }
.sb-item .pill{ margin-left:auto; background:var(--gold); color:#3a2a07; font-size:11px; font-weight:700; border-radius:999px; padding:1px 7px; }
.sb-foot{ padding:14px; }

/* ---------- Topbar ---------- */
.topbar{
  display:flex; align-items:center; gap:16px; padding:14px 32px;
  background:rgba(255,255,255,.85); backdrop-filter:saturate(1.4) blur(8px);
  border-bottom:1px solid var(--line); position:sticky; top:0; z-index:20;
}
.topbar .search{ flex:1; max-width:420px; }
.tb-actions{ margin-left:auto; display:flex; align-items:center; gap:10px; }
.icon-btn{ width:38px; height:38px; border-radius:10px; border:1px solid var(--line); background:#fff; display:grid; place-items:center; color:var(--slate); position:relative; }
.icon-btn:hover{ background:var(--surface-2); color:var(--ink); }
.icon-btn .ping{ position:absolute; top:8px; right:9px; width:7px; height:7px; border-radius:50%; background:var(--busy); border:2px solid #fff; }
.icon-btn.danger:hover{ background:var(--busy-bg); color:var(--busy); border-color:#f0cabf; }
.icon-btn.sm{ width:32px; height:32px; border-radius:8px; }

/* Selector de rol */
.role-pick{ display:flex; align-items:center; gap:9px; border:1px solid var(--line); border-radius:999px; padding:5px 6px 5px 12px; background:#fff; }
.role-pick:hover{ background:var(--surface-2); }
.avatar{ width:30px; height:30px; border-radius:50%; background:linear-gradient(140deg,var(--gold),var(--gold-700)); color:#3a2a07; display:grid; place-items:center; font-weight:700; font-size:13px; flex-shrink:0; }
.role-menu{ position:absolute; top:54px; right:0; width:240px; background:#fff; border:1px solid var(--line); border-radius:var(--r); box-shadow:var(--sh-lg); padding:6px; z-index:50; }
.role-opt{ display:flex; align-items:center; gap:10px; padding:9px 10px; border-radius:9px; width:100%; border:none; background:transparent; text-align:left; }
.role-opt:hover{ background:var(--surface-2); }
.role-opt.sel{ background:var(--surface-2); }

/* ---------- Utilidades ---------- */
.row{ display:flex; align-items:center; }
.col{ display:flex; flex-direction:column; }
.grid{ display:grid; }
.gap-8{ gap:8px; } .gap-12{ gap:12px; } .gap-16{ gap:16px; } .gap-20{ gap:20px; } .gap-24{ gap:24px; }
.tabnum{ font-variant-numeric:tabular-nums; }

/* KPI card */
.kpi{ position:relative; overflow:hidden; }
.kpi .kpi-ic{ width:42px; height:42px; border-radius:11px; display:grid; place-items:center; }
.kpi .kpi-val{ font-family:var(--serif); font-weight:600; font-size:35px; color:var(--navy); line-height:1; letter-spacing:.3px; white-space:nowrap; }
.kpi .kpi-lbl{ color:var(--slate); font-size:13px; margin-top:2px; }
.kpi .kpi-delta{ font-size:12px; font-weight:600; display:inline-flex; align-items:center; gap:3px; }
.kpi.style-bar::before{ content:""; position:absolute; left:0; top:0; bottom:0; width:4px; }

/* Chart */
.bars{ display:flex; align-items:flex-end; gap:14px; height:170px; padding-top:8px; }
.bar-col{ flex:1; display:flex; flex-direction:column; align-items:center; gap:8px; height:100%; justify-content:flex-end; }
.bar{ width:100%; max-width:34px; border-radius:7px 7px 3px 3px; background:linear-gradient(180deg,var(--teal),var(--navy-600)); position:relative; transition:height .6s cubic-bezier(.2,.8,.2,1); }
.bar .bv{ position:absolute; top:-20px; left:50%; transform:translateX(-50%); font-size:11px; font-weight:700; color:var(--slate); }
.bar-x{ font-size:11.5px; color:var(--muted); font-weight:600; }

/* Donut */
.donut-wrap{ display:grid; place-items:center; position:relative; }
.donut-center{ position:absolute; text-align:center; }

/* Modal */
.overlay{ position:fixed; inset:0; background:rgba(10,30,38,.42); backdrop-filter:blur(2px); display:grid; place-items:center; z-index:100; padding:24px; animation:fade .15s ease; }
.modal{ background:#fff; border-radius:var(--r-lg); box-shadow:var(--sh-lg); width:100%; max-width:560px; max-height:90vh; overflow:auto; animation:pop .18s cubic-bezier(.2,.9,.3,1.2); }
.modal-head{ padding:22px 24px 12px; }
.modal-body{ padding:8px 24px 4px; }
.modal-foot{ padding:16px 24px 22px; display:flex; gap:10px; justify-content:flex-end; }
@keyframes fade{ from{opacity:0} to{opacity:1} }
@keyframes pop{ from{opacity:0; transform:translateY(10px) scale(.98)} to{opacity:1; transform:none} }

/* Toast */
.toasts{ position:fixed; right:22px; bottom:22px; display:flex; flex-direction:column; gap:10px; z-index:200; }
.toast{ display:flex; align-items:center; gap:12px; background:#fff; border:1px solid var(--line); border-left:4px solid var(--ok); border-radius:var(--r); box-shadow:var(--sh-lg); padding:13px 16px; min-width:280px; max-width:380px; animation:slidein .25s cubic-bezier(.2,.9,.3,1.1); }
.toast.err{ border-left-color:var(--busy); }
.toast.warn{ border-left-color:var(--warn); }
@keyframes slidein{ from{opacity:0; transform:translateX(20px)} to{opacity:1; transform:none} }

/* Segmented */
.seg{ display:inline-flex; background:var(--surface-2); border:1px solid var(--line); border-radius:10px; padding:3px; gap:2px; }
.seg button{ border:none; background:transparent; padding:7px 14px; border-radius:7px; font-size:13px; font-weight:600; color:var(--slate); }
.seg button.on{ background:#fff; color:var(--navy); box-shadow:var(--sh-sm); }

/* Calendar grid availability */
.cal{ display:grid; grid-template-columns:repeat(7,1fr); gap:6px; }
.cal-d{ aspect-ratio:1.3; border-radius:8px; border:1px solid var(--line); display:flex; flex-direction:column; padding:6px; font-size:11px; }

/* Scrollbar subtle */
.sb-nav::-webkit-scrollbar{ width:6px; } .sb-nav::-webkit-scrollbar-thumb{ background:rgba(255,255,255,.14); border-radius:3px; }

/* Animations entrance */
.fade-up{ animation:fadeUp .4s ease both; }
@keyframes fadeUp{ from{opacity:0; transform:translateY(10px)} to{opacity:1; transform:none} }
.stagger > *{ animation:fadeUp .45s ease both; }
.stagger > *:nth-child(1){ animation-delay:.02s }
.stagger > *:nth-child(2){ animation-delay:.07s }
.stagger > *:nth-child(3){ animation-delay:.12s }
.stagger > *:nth-child(4){ animation-delay:.17s }

/* Responsive */
@media (max-width: 920px){
  .sidebar{ position:fixed; left:0; top:0; transform:translateX(-100%); transition:transform .25s ease; z-index:120; box-shadow:var(--sh-lg); }
  .sidebar.open{ transform:none; }
  .content{ padding:20px 16px 40px; }
  .topbar{ padding:12px 16px; }
  .hide-sm{ display:none !important; }
}
@media (min-width: 921px){ .menu-btn{ display:none !important; } }
.scrim{ position:fixed; inset:0; background:rgba(10,30,38,.4); z-index:110; }
