/* ==========================================================================
   TAMBO by ULTRIACOM — hoja de estilo base del PMS
   Marca: brass #A3702E sobre crema #F6F4EF, tinta #211E19.
   Los 3 colores salen literalmente de brand/tambo-logo.svg (rgb(163,112,46),
   rgb(246,244,239), rgb(33,30,25)) — no se inventó ninguno.
   Tipografía: Space Grotesk (titulares) + Inter (cuerpo).
   Sin build step: esto se sirve tal cual desde NGINX.
   ========================================================================== */

:root {
  /* --- marca --- */
  --brass:        #A3702E;
  --brass-dark:   #855A22;
  --brass-soft:   #C89A5B;
  --brass-wash:   rgba(163, 112, 46, 0.10);
  --cream:        #F6F4EF;
  --cream-deep:   #EDE9E0;
  --paper:        #FCFBF8;
  --ink:          #211E19;
  --ink-soft:     #4A443B;
  --ink-mute:     #837B6E;
  --line:         #DDD7CB;

  /* --- estados operativos (mismos del mockup de front-desk) --- */
  --st-ocupada:   #4A3524;
  --st-libre:     #2E7D52;
  --st-limpiar:   #C89A5B;
  --st-manten:    #6E6659;
  --st-llegar:    #23417A;
  --danger:       #A32E2E;
  --danger-wash:  rgba(163, 46, 46, 0.08);
  --warn:         #8A6A16;

  /* --- forma --- */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(33, 30, 25, 0.05);
  --shadow-md: 0 6px 24px rgba(33, 30, 25, 0.08);
  --sidebar-w: 244px;
  --header-h: 68px;

  --font-head: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

/* Cualquier regla de clase de este archivo (ej. `.field{display:block}`) le gana
   al `[hidden]{display:none}` del user-agent. Sin este !important, el selector
   de cuenta del login se mostraba aunque estuviera `hidden`. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .font-head {
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
}

a { color: var(--brass-dark); }

/* ==========================================================================
   Controles
   ========================================================================== */

.field { display: block; margin-bottom: 14px; }

.field > label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 6px;
}

input[type="text"], input[type="email"], input[type="password"],
input[type="date"], input[type="number"], select, textarea {
  width: 100%;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

textarea { border-radius: var(--r-md); resize: vertical; }

input:focus, select:focus, textarea:focus {
  border-color: var(--brass);
  box-shadow: 0 0 0 3px var(--brass-wash);
}

input[aria-invalid="true"] { border-color: var(--danger); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, opacity .15s ease;
}

.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary { background: var(--ink); color: var(--cream); }
.btn-primary:hover:not(:disabled) { background: #35302a; }

.btn-brass { background: var(--brass); color: #fff; }
.btn-brass:hover:not(:disabled) { background: var(--brass-dark); }

.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { border-color: var(--brass); color: var(--brass-dark); }

.btn-block { width: 100%; }

/* ==========================================================================
   Mensajes
   ========================================================================== */

.alert {
  padding: 12px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 14px;
  margin-bottom: 16px;
}

.alert-error   { border-color: rgba(163,46,46,.35); background: var(--danger-wash); color: #7A2222; }
.alert-warn    { border-color: rgba(138,106,22,.35); background: rgba(200,154,91,.12); color: var(--warn); }
.alert-info    { border-color: var(--line); color: var(--ink-soft); }
.alert code    { font-size: 12px; opacity: .8; }
.alert[hidden] { display: none; }

.hint { font-size: 13px; color: var(--ink-mute); }

/* ==========================================================================
   Login
   ========================================================================== */

.login-wrap {
  display: grid;
  grid-template-columns: minmax(360px, 46%) 1fr;
  min-height: 100vh;
}

.login-panel {
  background: var(--cream);
  border-top-right-radius: 40px;
  border-bottom-right-radius: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  position: relative;
  z-index: 2;
}

.login-card { width: 100%; max-width: 380px; }

.login-brand { text-align: center; margin-bottom: 40px; }
.login-brand img { width: 74px; height: 74px; display: block; margin: 0 auto 10px; }
.login-brand .wordmark {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.34em;
  padding-left: 0.34em;
  color: var(--ink);
}

.login-title {
  font-size: 34px;
  text-align: center;
  margin-bottom: 28px;
}

.login-aside {
  background:
    linear-gradient(160deg, rgba(33,30,25,.28), rgba(74,53,36,.5)),
    linear-gradient(45deg, var(--brass-dark), var(--brass-soft));
  display: flex;
  align-items: flex-end;
  padding: 56px;
}

.login-aside blockquote {
  margin: 0;
  max-width: 460px;
  color: #FDFBF7;
  font-family: var(--font-head);
  font-size: 26px;
  line-height: 1.35;
  text-shadow: 0 1px 12px rgba(0,0,0,.25);
}
.login-aside cite {
  display: block;
  margin-top: 14px;
  font-family: var(--font-body);
  font-size: 13px;
  font-style: normal;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .85;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0;
  color: var(--ink-mute);
  font-size: 13px;
}
.login-divider::before, .login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--brass-soft);
  opacity: .5;
}

@media (max-width: 860px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-aside { display: none; }
  .login-panel { border-radius: 0; }
}

/* ==========================================================================
   Shell de la app
   ========================================================================== */

.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  background: var(--ink);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 22px;
}
.sidebar-brand img { width: 34px; height: 34px; }
.sidebar-brand .wordmark {
  font-family: var(--font-head);
  font-size: 15px;
  letter-spacing: .3em;
  padding-left: .3em;
  color: var(--cream);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  color: rgba(246,244,239,.72);
  text-decoration: none;
  font-size: 14.5px;
  transition: background .14s ease, color .14s ease;
}
.nav-item:hover { background: rgba(246,244,239,.07); color: var(--cream); }
.nav-item.is-active { background: var(--brass); color: #fff; }
.nav-item .nav-glyph { width: 20px; text-align: center; opacity: .95; }

.sidebar-foot {
  margin-top: auto;
  padding: 14px 14px 4px;
  border-top: 1px solid rgba(246,244,239,.12);
  font-size: 12px;
  color: rgba(246,244,239,.45);
  line-height: 1.45;
}

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: var(--header-h);
  flex: 0 0 var(--header-h);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 26px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}

.property-switch {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.property-switch .eyebrow {
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.property-switch select {
  border: none;
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  max-width: 340px;
}
.property-switch select:focus { box-shadow: none; text-decoration: underline; }

.topbar-spacer { flex: 1; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-soft);
}
.user-chip .avatar {
  width: 32px; height: 32px;
  border-radius: var(--r-pill);
  background: var(--brass-wash);
  color: var(--brass-dark);
  display: grid; place-items: center;
  font-family: var(--font-head);
  font-weight: 600;
}
.user-chip .who { display: flex; flex-direction: column; line-height: 1.25; }
.user-chip .role { font-size: 11px; color: var(--ink-mute); text-transform: capitalize; }

.view { padding: 26px; flex: 1; min-width: 0; }

.view-head {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.view-head h1 { font-size: 26px; }
.view-head .sub { font-size: 13.5px; color: var(--ink-mute); }
.view-head .actions { margin-left: auto; display: flex; gap: 10px; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px 22px;
}

.grid { display: grid; gap: 16px; }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.grid-kpi { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.kpi .label {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-mute);
}
.kpi .value { font-family: var(--font-head); font-size: 30px; font-weight: 600; margin-top: 4px; }
.kpi .value small { font-size: 15px; color: var(--ink-mute); font-weight: 400; }

/* --- tarjeta de habitación (front-desk / housekeeping) --- */
.room {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px 16px;
  text-align: center;
}
.room .num { font-family: var(--font-head); font-size: 34px; font-weight: 700; line-height: 1; }
.room .type {
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-mute); margin-top: 6px;
}
.room .state {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 12px; font-size: 13px;
}
.dot { width: 12px; height: 12px; border-radius: var(--r-pill); flex: none; }
.dot-ocupada { background: var(--st-ocupada); }
.dot-libre { background: var(--st-libre); }
.dot-limpiar, .dot-por_limpiar, .dot-sucia { background: var(--st-limpiar); }
.dot-mantenimiento, .dot-bloqueada { background: var(--st-manten); }
.dot-por_llegar, .dot-reservada { background: var(--st-llegar); }
.dot-desconocido { background: var(--line); }

.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--ink-soft); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }

table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th {
  text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-mute); padding: 8px 10px; border-bottom: 1px solid var(--line);
}
table.data td { padding: 10px; border-bottom: 1px solid var(--cream-deep); }
table.data tr:last-child td { border-bottom: none; }

/* --- estados de carga / vacío / error --- */
.state-block {
  padding: 34px 22px;
  text-align: center;
  color: var(--ink-mute);
  font-size: 14px;
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
  background: var(--paper);
}
.state-block strong { display: block; color: var(--ink); font-family: var(--font-head); margin-bottom: 6px; }

.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--brass);
  border-radius: var(--r-pill);
  display: inline-block;
  animation: tambo-spin .7s linear infinite;
  vertical-align: -3px;
}
@keyframes tambo-spin { to { transform: rotate(360deg); } }

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto;
    flex-direction: row; align-items: center; overflow-x: auto;
  }
  .sidebar-brand { padding: 0 12px 0 4px; }
  .sidebar-foot { display: none; }
  .nav-item { white-space: nowrap; }
}
