/* ==========================================================================
   Tibisay ERP · UI estilo suite Sigo (AppShell + login estándar)
   Paleta Tibisay. Tipografía Inter. Edita solo los tokens de :root.
   ========================================================================== */
:root {
  /* Marca (paleta extraída del logo oficial) */
  --gold: #c9a24b;
  --gold-hover: #a9883a;
  --gold-dark: #7d6427;
  --gold-soft: #f5eedd;
  --champagne: #c0b090;
  --champagne-soft: #ece5d6;
  --teal: #141414;          /* negro Tibisay: sidebar y superficies oscuras */
  --teal-900: #0a0a0a;
  --teal-700: #2b2b2b;
  --teal-soft: #ecebe8;
  --on-dark: #f4f1ea;       /* texto hueso sobre negro */

  /* Neutros */
  --bg: #f7f5f1;
  --cream: #faf8f5;
  --surface: #ffffff;
  --border: #e5e1d9;
  --border-strong: #cfc9bd;
  --text: #1c1c1c;
  --text-2: #606060;
  --text-3: #8a8883;

  /* Estados */
  --ok: #2f7d57;     --ok-bg: #e5f3ec;
  --warn: #a8690f;   --warn-bg: #fbf0dc;
  --danger: #b4412f; --danger-bg: #fbe7e3;
  --info: #2f6377;   --info-bg: #e4eff3;

  /* Sistema */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(20, 20, 20, .05);
  --shadow: 0 1px 3px rgba(20, 20, 20, .06), 0 4px 12px rgba(20, 20, 20, .04);
  --shadow-lg: 0 10px 30px rgba(20, 20, 20, .12);
  --sb-w: 252px;
  --sb-w-min: 68px;
  --top-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
a { color: var(--gold-dark); text-decoration: none; }
a:hover { color: var(--gold-hover); }
h1, h2, h3, h4 { margin: 0; color: var(--text); letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0 0 8px; }
svg { flex-shrink: 0; }
.ico { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px;
  border-radius: var(--r); border: 1px solid transparent;
  font: 500 13px/1 var(--font); cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn .ico { width: 16px; height: 16px; }
.btn-primary { background: var(--gold); color: var(--teal); font-weight: 600; }
.btn-primary:hover { background: var(--gold-hover); color: var(--teal); }
.btn-dark { background: var(--teal); color: #fff; }
.btn-dark:hover { background: var(--teal-700); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--border-strong); background: var(--cream); color: var(--text); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn-block { width: 100%; height: 42px; font-size: 14px; }
.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center;
  border-radius: var(--r); border: 1px solid transparent; background: transparent;
  color: var(--text-2); cursor: pointer; position: relative;
}
.icon-btn:hover { background: var(--cream); color: var(--text); }
.dot-notif { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); border: 2px solid #fff; }

/* ---------------------------------------------------------------- Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 500; color: var(--text-2); }
.input, .select {
  height: 40px; width: 100%; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--r);
  background: var(--surface); color: var(--text);
  font: 400 14px var(--font); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 162, 75, .18); }
.select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23606060' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.input-sm, .select-sm { height: 34px; font-size: 13px; }

/* ---------------------------------------------------------------- Login */
.login-page {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(201, 162, 75, .18), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(20, 20, 20, .10), transparent 60%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 380px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); padding: 32px 28px 24px;
}
.login-logo { display: flex; flex-direction: column; align-items: center; margin-bottom: 22px; text-align: center; }
.login-logo img { height: 96px; width: auto; display: block; }
.login-logo h1 { font-size: 20px; margin-top: 12px; }
.login-logo p { color: var(--text-3); font-size: 13px; margin: 2px 0 0; }
.login-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-2); margin: -2px 0 18px; }
.login-row label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.login-row input { accent-color: var(--gold); }
.login-foot { text-align: center; font-size: 11px; color: var(--text-3); margin-top: 18px; }
.login-demo { background: var(--gold-soft); color: var(--gold-dark); border-radius: var(--r); padding: 8px 12px; font-size: 12px; margin-bottom: 16px; text-align: center; }
.pwd-wrap { position: relative; }
.pwd-wrap .icon-btn { position: absolute; right: 2px; top: 2px; }

/* ---------------------------------------------------------------- AppShell */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--sb-w);
  background: var(--teal); color: rgba(244, 241, 234, .78);
  display: flex; flex-direction: column;
  transition: width .2s ease, transform .2s ease;
}
.sb-brand { height: var(--top-h); display: flex; align-items: center; justify-content: center; padding: 0 14px; border-bottom: 1px solid rgba(255, 255, 255, .08); overflow: hidden; }
.sb-logo { height: 54px; padding: 3px 22px; border-radius: 10px; background: var(--cream); display: flex; align-items: center; justify-content: center; border: 1px solid rgba(192, 176, 144, .35); }
.sb-logo img { height: 48px; width: auto; max-width: 100%; object-fit: contain; display: block; }
.sb-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 14px 10px; }
.sb-label { font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .38); padding: 14px 12px 6px; white-space: nowrap; }
.sb-link {
  display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; margin-bottom: 2px;
  border-radius: var(--r); color: rgba(244, 241, 234, .78); white-space: nowrap; position: relative;
  font-weight: 500; font-size: 13.5px;
}
.sb-link .ico { width: 20px; height: 20px; }
.sb-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sb-link.active { background: rgba(201, 162, 75, .16); color: var(--gold); }
.sb-link.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.sb-link .sb-count { margin-left: auto; font-size: 11px; background: rgba(255, 255, 255, .1); color: #fff; padding: 1px 7px; border-radius: 10px; }
.sb-foot { padding: 10px; border-top: 1px solid rgba(255, 255, 255, .08); }
.sb-collapse { width: 100%; justify-content: flex-start; color: rgba(255, 255, 255, .6); background: none; border: 0; cursor: pointer; font: inherit; }
.sb-collapse:hover { color: #fff; }

.main-wrap { margin-left: var(--sb-w); min-height: 100vh; transition: margin-left .2s ease; }
body.sb-min .sidebar { width: var(--sb-w-min); }
body.sb-min .main-wrap { margin-left: var(--sb-w-min); }
body.sb-min .sb-text, body.sb-min .sb-label, body.sb-min .sb-count { display: none; }
body.sb-min .sb-brand { justify-content: center; padding: 0; }
body.sb-min .sb-logo { width: 50px; height: 42px; padding: 4px; border-radius: 8px; }
body.sb-min .sb-logo img { width: 100%; height: 100%; }
body.sb-min .sb-link { justify-content: center; padding: 0; }
body.sb-min .sb-collapse .ico { transform: rotate(180deg); }

.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top-h);
  display: flex; align-items: center; gap: 14px; padding: 0 24px;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar .menu-btn { display: none; }
.search { position: relative; flex: 1; max-width: 420px; }
.search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 16px; height: 16px; }
.search .input { height: 38px; padding-left: 34px; background: var(--cream); }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 500 11px var(--font); color: var(--text-3); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; background: #fff; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.prop-select { display: flex; align-items: center; gap: 8px; }
.prop-select .ico { color: var(--gold-dark); }
.prop-select .select { height: 38px; min-width: 200px; font-weight: 500; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: var(--r); cursor: pointer; position: relative; }
.user-chip:hover { background: var(--cream); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--teal); color: var(--gold); display: grid; place-items: center; font-weight: 600; font-size: 13px; flex-shrink: 0; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-gold { background: var(--gold-soft); color: var(--gold-dark); }
.user-chip b { display: block; font-size: 13px; line-height: 1.2; }
.user-chip small { display: block; font-size: 11px; color: var(--text-3); }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; background: #fff;
  border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-lg);
  padding: 6px; display: none;
}
.menu.open { display: block; }
.menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--text); font-size: 13px; }
.menu a:hover { background: var(--cream); }

.content { padding: 24px; max-width: 1480px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.crumbs { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.crumbs a { color: var(--text-3); }
.page-head p { color: var(--text-2); margin: 4px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.scope-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; background: var(--gold-soft); color: var(--gold-dark); padding: 3px 10px; border-radius: 20px; margin-left: 8px; vertical-align: middle; }

/* ---------------------------------------------------------------- Layout */
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.span-2 { grid-column: span 2; }
.mt { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.right { text-align: right; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* ---------------------------------------------------------------- Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-h p { margin: 2px 0 0; font-size: 12px; color: var(--text-3); }
.card-b { padding: 18px; }
.card-b.flush { padding: 0; }
.card-f { padding: 10px 18px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }

/* KPI */
.kpi { padding: 16px 18px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.kpi-label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.kpi-ico { width: 34px; height: 34px; border-radius: var(--r); display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-dark); }
.kpi-ico.teal { background: var(--teal-soft); color: var(--teal); }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-sub { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; color: var(--text-3); }
.delta { font-weight: 600; font-size: 12px; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--danger); }
.kpi.dark { background: var(--teal); border-color: var(--teal); }
.kpi.dark .kpi-label, .kpi.dark .kpi-sub { color: rgba(255, 255, 255, .65); }
.kpi.dark .kpi-value { color: #fff; }
.kpi.dark .kpi-ico { background: rgba(201, 162, 75, .18); color: var(--gold); }

/* ---------------------------------------------------------------- Tablas */
.table-wrap { overflow: visible; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-size: 11.5px; font-weight: 600; color: var(--text-2);
  background: var(--cream); padding: 9px 14px; border-bottom: 1px solid var(--border);
}
.table td { padding: 9px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fcfbf7; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .strong { font-weight: 600; color: var(--text); }
.table .sub { display: block; font-size: 11.5px; color: var(--text-3); }
.table tfoot td { font-weight: 600; background: var(--cream); border-top: 1px solid var(--border); }
.cell-user { display: flex; align-items: center; gap: 10px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.toolbar .search { max-width: 280px; }
.toolbar .search .input { height: 34px; font-size: 13px; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 10px 18px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 20px; font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.nodot::before { display: none; }
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-danger { background: var(--danger-bg); color: var(--danger); }
.b-info { background: var(--info-bg); color: var(--info); }
.b-gold { background: var(--gold-soft); color: var(--gold-dark); }
.b-muted { background: #efece6; color: var(--text-2); }
.b-teal { background: var(--teal); color: var(--gold); }

/* Tabs y chips */
.tabs { display: flex; flex-wrap: wrap; gap: 0 4px; border-bottom: 1px solid var(--border); padding: 0 18px; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 12px 10px; margin-bottom: -1px; font: 500 13px var(--font); color: var(--text-2); cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--gold-dark); border-bottom-color: var(--gold); }
.tab .badge { margin-left: 6px; height: 18px; font-size: 10.5px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.seg { display: inline-flex; background: var(--cream); border: 1px solid var(--border); border-radius: var(--r); padding: 3px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: var(--r-sm); font: 500 12px var(--font); color: var(--text-2); cursor: pointer; }
.seg button.active { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }

/* Progreso */
.progress { height: 6px; background: #efece6; border-radius: 6px; overflow: hidden; min-width: 60px; }
.progress > span { display: block; height: 100%; background: var(--gold); border-radius: 6px; }
.progress.teal > span { background: var(--teal); }
.pcell { display: flex; align-items: center; gap: 10px; }
.pcell .progress { flex: 1; }
.pcell b { width: 38px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------------------------------------------------------------- Gráficos */
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--font); fill: var(--text-3); font-size: 11px; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .bar { fill: var(--gold); transition: opacity .15s; }
.chart .bar.alt { fill: var(--teal); }
.chart .bar.soft { fill: var(--champagne-soft); }
.chart .bar:hover { opacity: .8; }
.chart .val { fill: var(--text); font-weight: 600; font-size: 11px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--gold); }
.legend i.alt { background: var(--teal); }
.legend i.soft { background: var(--champagne-soft); }
.legend i.line { height: 2px; border-radius: 0; vertical-align: 3px; }
.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut-list { list-style: none; margin: 0; padding: 0; flex: 1; font-size: 13px; }
.donut-list li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.donut-list li:last-child { border-bottom: 0; }

/* ---------------------------------------------------------------- Módulos específicos */
.mod-tile { display: flex; gap: 14px; padding: 16px; align-items: flex-start; color: var(--text); transition: border-color .15s, box-shadow .15s, transform .15s; }
.mod-tile:hover { border-color: var(--gold); box-shadow: var(--shadow); transform: translateY(-1px); color: var(--text); }
.mod-tile .kpi-ico { width: 40px; height: 40px; }
.mod-tile p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-2); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list b { font-weight: 600; font-size: 13px; }
.list small { display: block; color: var(--text-3); font-size: 12px; }
.alert-ico { width: 30px; height: 30px; border-radius: var(--r); display: grid; place-items: center; flex-shrink: 0; }
.alert-ico .ico { width: 16px; height: 16px; }

.rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; }
.room { border-radius: var(--r-sm); padding: 7px 4px; text-align: center; font-size: 10.5px; border: 1px solid transparent; cursor: default; }
.room b { display: block; font-size: 13px; }
.r-libre { background: var(--ok-bg); color: var(--ok); }
.r-ocupada { background: var(--info-bg); color: var(--info); }
.r-sucia { background: var(--danger-bg); color: var(--danger); }
.r-insp { background: var(--warn-bg); color: var(--warn); }
.r-fuera { background: #ece9e3; color: var(--text-3); }
.r-lleg { background: var(--gold-soft); color: var(--gold-dark); }
.r-proceso { background: #e8e4f3; color: #5b4a8f; }

.kanban { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kcol { background: var(--cream); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 10px; }
.kcol-h { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; color: var(--text-2); padding: 4px 4px 10px; }
.kcard { background: #fff; border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; margin-bottom: 8px; box-shadow: var(--shadow-sm); font-size: 12.5px; }
.kcard b { display: block; font-size: 13px; margin-bottom: 2px; }
.kcard .between { margin-top: 8px; font-size: 11.5px; color: var(--text-3); }
.kcard .between > span:last-child { white-space: nowrap; }

.chat { background: #efeadf; padding: 14px; display: flex; flex-direction: column; gap: 8px; height: 100%; }
.msg { max-width: 85%; background: #fff; padding: 8px 11px; border-radius: 10px 10px 10px 2px; font-size: 12.5px; box-shadow: var(--shadow-sm); }
.msg.out { align-self: flex-end; background: #f3ead6; border-radius: 10px 10px 2px 10px; }
.msg small { display: block; text-align: right; font-size: 10.5px; color: var(--text-3); margin-top: 3px; }
.chat-h { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--teal); color: #fff; border-radius: var(--r-lg) var(--r-lg) 0 0; }
.chat-h small { display: block; font-size: 11px; opacity: .65; }

.dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13px; margin: 0; }
.dl dt { color: var(--text-3); }
.dl dd { margin: 0; text-align: right; font-weight: 500; }

.conn { padding: 18px; }
.conn-h { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.conn-logo { width: 44px; height: 44px; border-radius: var(--r); display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--teal); color: var(--gold); flex-shrink: 0; }
.conn-logo.erp { background: var(--gold-soft); color: var(--gold-dark); }
.conn-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.conn-meta div { background: var(--cream); border-radius: var(--r); padding: 8px 10px; }
.conn-meta small { display: block; font-size: 11px; color: var(--text-3); }
.conn-meta b { font-size: 13px; }

.flow { display: flex; align-items: stretch; gap: 10px; }
.flow-node { flex: 1; border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px; background: #fff; }
.flow-node.core { background: var(--teal); border-color: var(--teal); color: rgba(255, 255, 255, .75); }
.flow-node.core h3 { color: var(--gold); }
.flow-node ul { margin: 8px 0 0; padding-left: 16px; font-size: 12.5px; }
.flow-arrow { display: grid; place-items: center; color: var(--gold); font-size: 20px; }

.banner { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--r-lg); background: linear-gradient(120deg, var(--teal) 0%, var(--teal-900) 100%); color: rgba(255, 255, 255, .78); }
.banner h2 { color: #fff; font-size: 18px; }
.banner .kpi-ico { width: 48px; height: 48px; background: rgba(201, 162, 75, .18); color: var(--gold); }
.banner .ico { width: 24px; height: 24px; }

.svc { padding: 18px; }
.svc .kpi-ico { width: 42px; height: 42px; margin-bottom: 12px; }
.svc p { font-size: 13px; color: var(--text-2); margin: 6px 0 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------------------------------------------------------------- Iteración 2 */
/* Tour guiado (js/tour.js) */
.tour-mask { position: fixed; inset: 0; z-index: 90; pointer-events: auto; }
.tour-spot { position: fixed; z-index: 91; border-radius: var(--r-lg); box-shadow: 0 0 0 9999px rgba(20, 20, 20, .55); outline: 2px solid var(--gold); transition: all .25s ease; pointer-events: none; }
.tour-pop { position: fixed; z-index: 92; width: 340px; max-width: calc(100vw - 32px); background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 18px 18px 14px; transition: top .25s ease, left .25s ease; }
.tour-pop .tour-step { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-dark); }
.tour-pop h3 { font-size: 15px; margin: 4px 0 6px; }
.tour-pop p { font-size: 13px; color: var(--text-2); margin: 0 0 12px; }
.tour-pop ul { font-size: 12.5px; color: var(--text-2); margin: -4px 0 12px; padding-left: 18px; }
.tour-dots { display: flex; gap: 4px; }
.tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); }
.tour-dots i.on { background: var(--gold); width: 16px; border-radius: 3px; }
.tour-welcome { position: fixed; inset: 0; z-index: 92; display: grid; place-items: center; background: rgba(20, 20, 20, .55); padding: 16px; }
.tour-welcome .card { max-width: 460px; padding: 26px; text-align: center; }
.tour-welcome .kpi-ico { width: 52px; height: 52px; margin: 0 auto 12px; }
.tour-welcome ol { text-align: left; font-size: 13px; color: var(--text-2); padding-left: 20px; margin: 12px 0 18px; }
.help-fab { position: fixed; right: 20px; bottom: 20px; z-index: 50; border-radius: 22px; height: 40px; box-shadow: var(--shadow-lg); }

/* Ficha 360 */
.p360-tabs { display: flex; gap: 4px; margin: 14px 0 10px; flex-wrap: wrap; }
.p360-tabs button { border: 1px solid var(--border); background: #fff; border-radius: 16px; padding: 4px 11px; font: 500 12px var(--font); color: var(--text-2); cursor: pointer; }
.p360-tabs button.active { background: var(--teal); border-color: var(--teal); color: var(--gold); }
.mini-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.mini-kpis div { background: var(--cream); border-radius: var(--r); padding: 8px 10px; }
.mini-kpis small { display: block; font-size: 11px; color: var(--text-3); }
.mini-kpis b { font-size: 14px; font-variant-numeric: tabular-nums; }
.tl { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.tl li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.tl li:last-child { border-bottom: 0; }
.tl span { color: var(--text-3); }
.note { background: var(--gold-soft); padding: 8px 10px; border-radius: 8px; font-size: 12.5px; margin-bottom: 6px; }
.note small { display: block; color: var(--text-3); font-size: 11px; margin-top: 2px; }
.level-bar { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); margin-top: 4px; }

/* Semáforo */
.sem { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 12.5px; }
.sem::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
.sem.ok { color: var(--ok); } .sem.warn { color: var(--warn); } .sem.danger { color: var(--danger); } .sem.muted { color: var(--text-3); }
.semaforo { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.sem-card { border-radius: var(--r-lg); padding: 14px 16px; border: 1px solid var(--border); background: #fff; }
.sem-card .kpi-value { font-size: 28px; }
.sem-card.ok { border-left: 4px solid var(--ok); } .sem-card.warn { border-left: 4px solid var(--warn); } .sem-card.danger { border-left: 4px solid var(--danger); } .sem-card.muted { border-left: 4px solid var(--text-3); }
.stack { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: #efece6; min-width: 120px; }
.stack span { display: block; height: 100%; }
.clock-big { font-size: 34px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: #fff; }

/* Conectores (integración) */
.cx { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.cx-status { display: flex; align-items: center; gap: 10px; padding: 10px 18px; font-weight: 600; font-size: 13px; }
.cx-status .ico { width: 18px; height: 18px; }
.cx-status.ok { background: var(--ok-bg); color: var(--ok); }
.cx-status.err { background: var(--danger-bg); color: var(--danger); }
.cx-status.sync { background: var(--info-bg); color: var(--info); }
.cx-status.sync .ico { animation: spin 1.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.cx-body { padding: 16px 18px; flex: 1; }
.cx-big { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.cx-big div { background: var(--cream); border-radius: var(--r); padding: 10px 12px; }
.cx-big small { display: block; font-size: 11px; color: var(--text-3); }
.cx-big b { font-size: 18px; font-variant-numeric: tabular-nums; }
.cx-err { font-size: 12px; background: var(--danger-bg); color: var(--danger); border-radius: var(--r); padding: 8px 10px; margin-top: 8px; }
.cx-err + .cx-err { margin-top: 6px; }
.cx-foot { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); }
.cx-foot .btn { flex: 1; }
.health { display: flex; align-items: center; gap: 18px; padding: 18px 20px; }
.health-ring { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 18px; flex-shrink: 0; }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 26px; }
.spark i { flex: 1; background: var(--ok); border-radius: 2px 2px 0 0; min-width: 3px; opacity: .75; }
.spark i.e { background: var(--danger); opacity: 1; }

/* Infraestructura (IT) */
.infra { padding: 16px; }
.infra-h { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.infra-h h3 { flex: 1; }
.uptime { display: flex; gap: 2px; margin-top: 10px; }
.uptime i { flex: 1; height: 18px; border-radius: 2px; background: var(--ok); opacity: .8; }
.uptime i.w { background: var(--warn); } .uptime i.d { background: var(--danger); }
.site-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; }
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.status-dot.info { background: var(--info); }
.status-dot.ok { background: var(--ok); } .status-dot.warn { background: var(--warn); } .status-dot.danger { background: var(--danger); }
.matrix td { text-align: center; }
.matrix td:first-child { text-align: left; }

/* Pisos (front desk) y camareras */
.floor { display: grid; grid-template-columns: 70px 1fr; gap: 10px; align-items: start; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.floor:last-child { border-bottom: 0; }
.floor-l { font-size: 12px; font-weight: 600; color: var(--text-2); padding-top: 8px; }
.floor-l small { display: block; font-weight: 400; color: var(--text-3); }
.room.sel { outline: 2px solid var(--gold); }
.room .hk { display: block; font-size: 9.5px; opacity: .8; }
.maid { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 12px; background: #fff; }
.maid-h { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.maid-rooms { display: flex; flex-wrap: wrap; gap: 4px; }
.maid-rooms span { font-size: 11px; font-weight: 600; padding: 3px 7px; border-radius: 5px; }
.venue { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px; background: #fff; }
.venue-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.slots { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.slots li { display: grid; grid-template-columns: 92px 1fr auto; gap: 8px; padding: 6px 0; border-top: 1px dashed var(--border); align-items: center; }
.slots li b { font-weight: 600; }

/* Flujo por pasos (IMS) */
.steps { display: flex; gap: 0; align-items: center; flex-wrap: wrap; font-size: 12px; }
.steps span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 16px; background: var(--cream); border: 1px solid var(--border); color: var(--text-2); font-weight: 500; }
.steps span.done { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.steps span.now { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-dark); }
.steps em { font-style: normal; color: var(--text-3); padding: 0 4px; }
.source-note { display: flex; align-items: center; gap: 10px; background: var(--info-bg); color: var(--info); border-radius: var(--r); padding: 9px 14px; font-size: 12.5px; margin: 14px 18px 0; }
.source-note .ico { width: 16px; height: 16px; }
.subtabs { display: flex; gap: 6px; padding: 12px 18px 0; flex-wrap: wrap; }
.num-danger { color: var(--danger); font-weight: 600; }
.num-warn { color: var(--warn); font-weight: 600; }
.num-ok { color: var(--ok); font-weight: 600; }
.modal-back { position: fixed; inset: 0; z-index: 80; background: rgba(20, 20, 20, .45); display: none; place-items: center; padding: 16px; }
.modal-back.open { display: grid; }
.modal { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; }

/* ---------------------------------------------------------------- Iteración 3 · menos carga */
/* Selector de vista por rol (barra superior) */
.role-select { display: flex; align-items: center; gap: 6px; }
.role-select label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.role-select .select { height: 38px; min-width: 150px; font-weight: 500; background-color: var(--gold-soft); border-color: transparent; color: var(--gold-dark); }
/* Sidebar agrupado por rol */
.sb-more { width: 100%; background: none; border: 0; cursor: pointer; font: inherit; text-align: left; }
.sb-more .ico.chev { width: 14px; height: 14px; margin-left: auto; transition: transform .15s; }
.sb-more[aria-expanded="true"] .ico.chev { transform: rotate(180deg); }
.sb-rest { display: none; }
.sb-rest.open { display: block; }
.sb-rest .sb-link { height: 36px; font-size: 13px; color: rgba(244, 241, 234, .6); }
body.sb-min .sb-more .chev { display: none; }

/* Métrica hero + métricas secundarias en línea (en vez de 4 tarjetas iguales) */
.hero { display: flex; align-items: stretch; gap: 0; padding: 0; overflow: hidden; }
.hero-main { background: var(--teal); color: rgba(244, 241, 234, .75); padding: 18px 22px; min-width: 240px; display: flex; flex-direction: column; justify-content: center; }
.hero-main .kpi-label { color: rgba(244, 241, 234, .7); }
.hero-main .hero-value { font-size: 36px; font-weight: 700; letter-spacing: -.02em; line-height: 1.05; color: var(--on-dark); font-variant-numeric: tabular-nums; margin: 4px 0 2px; }
.hero-main .hero-value small { font-size: 16px; font-weight: 600; color: var(--champagne); margin-left: 4px; }
.hero-main .kpi-sub { color: rgba(244, 241, 234, .65); margin: 0; }
.hero-side { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); align-items: center; padding: 10px 8px; }
.stat { padding: 8px 14px; border-left: 1px solid var(--border); }
.stat:first-child { border-left: 0; }
.stat small { display: block; font-size: 11.5px; color: var(--text-3); }
.stat b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; line-height: 1.3; }
.stat span { font-size: 11.5px; color: var(--text-3); }
.stat-row { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.stat-row .stat { flex: 1; min-width: 120px; padding: 10px 16px; }
.stat b.ok { color: var(--ok); } .stat b.warn { color: var(--warn); } .stat b.danger { color: var(--danger); }

/* Acordeón (revelado progresivo) */
details.acc { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
details.acc + details.acc { margin-top: 10px; }
details.acc > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 13px 18px; font-weight: 600; font-size: 14px; }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::after { content: ""; margin-left: 8px; width: 8px; height: 8px; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: rotate(45deg); transition: transform .15s; flex-shrink: 0; }
details.acc[open] > summary::after { transform: rotate(-135deg); }
details.acc > summary .muted { font-weight: 400; font-size: 12px; }
details.acc > summary .grow { flex: 1; }
details.acc[open] > summary { border-bottom: 1px solid var(--border); }
details.acc.flat { box-shadow: none; border-radius: 0; border-width: 1px 0 0; }
.acc-b { padding: 16px 18px; }

/* Bandeja de acciones pendientes */
.inbox li { align-items: center; }
.inbox .btn { flex-shrink: 0; }
.inbox .tag { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.more-btn { display: block; width: 100%; border: 0; border-top: 1px solid var(--border); background: var(--cream); color: var(--gold-dark); font: 500 12.5px var(--font); padding: 9px; cursor: pointer; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.more-btn:hover { background: var(--gold-soft); }
tr.more-hidden, li.more-hidden { display: none !important; }
body.searching tr.more-hidden { display: table-row !important; }

/* Acciones rápidas por rol */
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.quick a { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); color: var(--text); font-weight: 500; font-size: 13px; }
.quick a:hover { border-color: var(--gold); color: var(--text); }
.quick .kpi-ico { width: 30px; height: 30px; }
.quick .ico { width: 16px; height: 16px; }

/* Drawer lateral (detalle bajo demanda) */
.drawer-back { position: fixed; inset: 0; z-index: 70; background: rgba(20, 20, 20, .35); opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 71; width: min(560px, 100vw); background: var(--surface); box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .22s ease; display: flex; flex-direction: column; }
body.drawer-open .drawer-back { opacity: 1; pointer-events: auto; }
body.drawer-open .drawer.open { transform: none; }
.drawer-h { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.drawer-h > div { flex: 1; min-width: 0; }
.drawer-h p { margin: 2px 0 0; font-size: 12px; color: var(--text-3); }
.drawer-b { flex: 1; overflow: auto; }
.drawer-f { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--cream); }
.drawer .tabs { padding: 0 18px; }
.drawer .chat { min-height: 100%; }

/* Asistente por pasos (wizard) */
.wz-steps { display: flex; gap: 6px; padding: 12px 18px; border-bottom: 1px solid var(--border); background: var(--cream); flex-wrap: wrap; }
.wz-steps span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--text-3); }
.wz-steps span i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: #fff; border: 1px solid var(--border); }
.wz-steps span.now { color: var(--text); } .wz-steps span.now i { background: var(--gold); border-color: var(--gold); color: var(--teal); }
.wz-steps span.done { color: var(--ok); } .wz-steps span.done i { background: var(--ok-bg); border-color: transparent; }
.wz-steps em { font-style: normal; color: var(--border-strong); }
.modal .table td .input-sm { height: 30px; }
.modal-lg { max-width: 760px; }

/* Timeline del día (operaciones · estilo Mews) */
.dl-inner { padding: 6px 18px 12px; }
.dl-hours, .dl-lane { display: grid; grid-template-columns: 130px 1fr; align-items: center; }
.dl-hours .dl-track { display: flex; }
.dl-hours .dl-track span { flex: 1; font-size: 11px; color: var(--text-3); border-left: 1px solid var(--border); padding-left: 4px; }
.dl-lane { border-top: 1px dashed var(--border); min-height: 44px; }
.dl-lab { font-size: 12px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.dl-lab .ico { width: 15px; height: 15px; color: var(--gold-dark); }
.dl-lab small { display: block; font-weight: 400; color: var(--text-3); font-size: 11px; }
.dl-track { position: relative; height: 44px; }
.dl-item { position: absolute; top: 9px; height: 26px; border-radius: 6px; font-size: 11px; font-weight: 600; padding: 0 7px; display: flex; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; border: 1px solid transparent; }
.dl-item.pt { min-width: 26px; justify-content: center; padding: 0 6px; }
.dl-item.lleg { background: var(--gold-soft); color: var(--gold-dark); border-color: rgba(201, 162, 75, .45); }
.dl-item.sal { background: var(--warn-bg); color: var(--warn); }
.dl-item.ev { background: var(--teal); color: var(--on-dark); }
.dl-item.rest { background: var(--champagne-soft); color: #6b5d3f; }
.dl-item.hk { background: var(--ok-bg); color: var(--ok); }
.dl-item.mt { background: var(--danger-bg); color: var(--danger); }
.dl-item:hover { filter: brightness(.96); }
.dl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); z-index: 2; pointer-events: none; }
.dl-now::before { content: attr(data-t); position: absolute; top: -2px; left: 4px; font-size: 10px; font-weight: 700; color: var(--danger); background: var(--surface); padding: 0 3px; }

/* Journey del huésped (reserva → check-in → estancia → check-out) */
.journey { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.jcol { background: var(--cream); border: 1px solid var(--border); border-radius: var(--r-lg); display: flex; flex-direction: column; min-width: 0; }
.jcol-h { padding: 10px 12px 8px; border-bottom: 1px solid var(--border); }
.jcol-h b { font-size: 13px; }
.jcol-h .kpi-value { font-size: 22px; }
.jcol-h small { display: block; font-size: 11.5px; color: var(--text-3); }
.jcol ul { list-style: none; margin: 0; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.jcard { background: #fff; border: 1px solid var(--border); border-radius: var(--r); padding: 8px 10px; font-size: 12px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.jcard:hover { border-color: var(--gold); }
.jcard > div { flex: 1; min-width: 0; }
.jcard b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jcard span.muted { font-size: 11.5px; }
.jstep { display: flex; gap: 0; margin: 4px 0 14px; }
.jstep span { flex: 1; text-align: center; font-size: 11.5px; font-weight: 500; color: var(--text-3); padding-top: 18px; position: relative; }
.jstep span::before { content: ""; position: absolute; top: 4px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--border-strong); z-index: 1; }
.jstep span::after { content: ""; position: absolute; top: 8px; left: 0; right: 0; height: 2px; background: var(--border); }
.jstep span.done { color: var(--ok); } .jstep span.done::before { background: var(--ok); }
.jstep span.now { color: var(--gold-dark); font-weight: 600; } .jstep span.now::before { background: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }

/* Grilla semanal de turnos (estilo 7shifts) */
.shifts { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.shifts th { font-size: 11.5px; font-weight: 600; color: var(--text-2); text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); background: var(--cream); white-space: nowrap; }
.shifts th.today { color: var(--gold-dark); box-shadow: inset 0 -2px 0 var(--gold); }
.shifts td { padding: 5px 4px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.shifts td:first-child { padding-left: 16px; min-width: 150px; }
.shifts td.today { background: #fcf9f1; }
.shift { display: block; border-radius: 6px; padding: 5px 6px; font-size: 11.5px; font-weight: 600; line-height: 1.25; }
.shift small { display: block; font-weight: 400; font-size: 10.5px; opacity: .8; }
.shift.A { background: var(--gold-soft); color: var(--gold-dark); border-left: 3px solid var(--gold); }
.shift.B { background: var(--champagne-soft); color: #6b5d3f; border-left: 3px solid var(--champagne); }
.shift.C { background: var(--teal); color: var(--on-dark); border-left: 3px solid var(--gold); }
.shift.off { background: transparent; color: var(--text-3); font-weight: 500; border: 1px dashed var(--border-strong); text-align: center; }
.shift.vac { background: var(--warn-bg); color: var(--warn); text-align: center; }
.shift.extra { background: var(--info-bg); color: var(--info); border-left: 3px solid var(--info); }
.cov { display: flex; gap: 2px; height: 6px; margin-top: 2px; }
.cov i { flex: 1; border-radius: 2px; }

/* Buscador de entrada (IMS) */
.bigsearch { position: relative; }
.bigsearch .ico { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--gold-dark); }
.bigsearch .input { height: 50px; padding-left: 46px; font-size: 15px; border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.prow-actions { display: flex; gap: 6px; flex-wrap: wrap; }
tr.prow-open td { background: var(--gold-soft) !important; }
tr.prow-detail td { background: #fcf9f1; padding: 10px 14px 14px; }

/* Lista compacta de conexiones */
.cx-row { display: grid; grid-template-columns: 44px minmax(0, 1.4fr) minmax(0, 1fr) auto auto; gap: 12px; align-items: center; }
.cx-row .conn-logo { width: 38px; height: 38px; font-size: 12px; }
details.cx-line > summary { padding: 10px 18px; }
details.cx-line > summary::after { margin-left: 0; }

.help-fab { color: var(--teal); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 22px 0 10px; }
.section-title h2 { font-size: 15px; }

@media (max-width: 1024px) {
  .journey { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .role-select label { display: none; }
  .role-select .select { min-width: 0; width: 130px; }
}
@media (max-width: 860px) {
  .hero { flex-direction: column; }
  .hero-main { min-width: 0; }
  .prop-select .select { width: 130px; }
  .cx-row { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .cx-row .cx-hide { display: none; }
}
@media (max-width: 560px) {
  .journey { grid-template-columns: minmax(0, 1fr); }
  .role-select .select { width: 104px; font-size: 12px; }
  .stat { border-left: 0; }
}

@media (max-width: 1200px) {
  .semaforo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .semaforo, .mini-kpis, .cx-big { grid-template-columns: minmax(0, 1fr); }
  .slots li { grid-template-columns: 1fr; }
  .floor { grid-template-columns: 1fr; }
}

/* Toast */
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 100; background: var(--teal); color: #fff; padding: 12px 16px; border-radius: var(--r); box-shadow: var(--shadow-lg); font-size: 13px; display: flex; gap: 10px; align-items: center; transform: translateY(20px); opacity: 0; transition: .2s; pointer-events: none; }
.toast.show { transform: none; opacity: 1; }
.toast .ico { color: var(--gold); }

.backdrop { display: none; }

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 1200px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .g-3, .g-2-1, .g-1-2 { grid-template-columns: minmax(0, 1fr); }
  .user-chip .who { display: none; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); width: var(--sb-w) !important; }
  body.sb-open .sidebar { transform: none; }
  body.sb-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(20, 20, 20, .4); z-index: 35; }
  .main-wrap, body.sb-min .main-wrap { margin-left: 0; }
  body.sb-min .sb-text, body.sb-min .sb-label, body.sb-min .sb-count { display: initial; }
  body.sb-min .sb-link { justify-content: flex-start; padding: 0 12px; }
  .sb-collapse { display: none !important; }
  .topbar { padding: 0 14px; gap: 8px; }
  .topbar .menu-btn { display: inline-grid; }
  .search kbd { display: none; }
  .prop-select .select { min-width: 0; width: 150px; }
  .prop-select > .ico { display: none; }
  .content { padding: 16px; }
  .g-2 { grid-template-columns: minmax(0, 1fr); }
  .flow { flex-direction: column; }
  .flow-arrow { transform: rotate(90deg); }
}
@media (max-width: 560px) {
  .g-4 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .kanban { grid-template-columns: minmax(0, 1fr); }
  .topbar .search { display: none; }
  .conn-meta { grid-template-columns: 1fr; }
}

/* Línea de tiempo de actividad (ficha del huésped) */
.tline { list-style: none; margin: 0 0 0 7px; padding: 0; border-left: 2px solid var(--border); }
.tline li { position: relative; padding: 0 0 12px 18px; font-size: 12.5px; }
.tline li::before { content: ""; position: absolute; left: -8px; top: 2px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--champagne); }
.tline li.stay::before { border-color: var(--teal); background: var(--teal); }
.tline li.tn::before { border-color: var(--gold); }
.tline b { font-weight: 500; display: block; }
.tline small { display: block; color: var(--text-3); font-size: 11px; }
.tline + .more-btn { border-radius: var(--r); border: 1px solid var(--border); margin-top: 4px; }
.tour-pop .between { flex-wrap: wrap; row-gap: 10px; }
.shifts .strong { font-weight: 600; }
.shifts .sub { display: block; font-size: 11.5px; color: var(--text-3); font-weight: 400; }
@media (max-width: 560px) {
  .topbar { padding: 0 10px; gap: 6px; }
  .top-right { gap: 4px; }
  .role-select .select, .prop-select .select { width: 100px; padding: 0 22px 0 8px; font-size: 12px; background-position: right 6px center; }
  .user-chip { padding: 2px; }
  .seg { flex-wrap: wrap; }
  .health { flex-wrap: wrap; }
  .page-head .actions { width: 100%; }
}

/* ---------------------------------------------------------------- Sin scroll lateral dentro de recuadros */
.table td, .table th { overflow-wrap: break-word; }
.table th[style*="min-width"], .table td[style*="min-width"] { min-width: 0 !important; }
.table td .input-sm { max-width: 100%; }
.modal { overflow-x: hidden; }
.dl-now-wrap { position: absolute; top: 0; bottom: 0; left: 130px; right: 0; pointer-events: none; }
.notif-wrap { position: relative; }
.notif-menu { min-width: 300px; }
.notif-menu a span { display: block; min-width: 0; }
.notif-menu a b { display: block; font-size: 12.5px; font-weight: 600; }
.notif-menu a small { display: block; font-size: 11px; color: var(--text-3); }

/* Tablas de muchas columnas en pantallas medianas: se apilan antes de desbordar */
@media (max-width: 1180px) {
  .table.stack-md thead { display: none; }
  .table.stack-md, .table.stack-md tbody, .table.stack-md tfoot, .table.stack-md tr, .table.stack-md td { display: block; width: 100%; }
  .table.stack-md tr { padding: 10px 14px; border-bottom: 1px solid var(--border); }
  .table.stack-md td { border: 0; padding: 3px 0 3px 42%; position: relative; text-align: right; min-height: 24px; }
  .table.stack-md td::before { content: attr(data-label); position: absolute; left: 0; top: 4px; width: 40%; text-align: left; font-size: 11.5px; font-weight: 500; color: var(--text-3); }
  .table.stack-md td:first-child { padding-left: 0; text-align: left; font-weight: 600; }
  .table.stack-md td:first-child::before, .table.stack-md td[data-label=""]::before { display: none; }
  .table.stack-md td[data-label=""] { padding-left: 0; }
  .table.stack-md td:empty { display: none; }
  .table.stack-md .pcell { justify-content: flex-end; }
  .table.stack-md tr[hidden] { display: none; }
}

/* Móvil: todas las tablas se apilan como fichas (etiquetas desde el encabezado) */
@media (max-width: 760px) {
  .table thead { display: none; }
  .table, .table tbody, .table tfoot, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 10px 14px; border-bottom: 1px solid var(--border); }
  .table tbody tr:last-child { border-bottom: 0; }
  .table tfoot tr { background: var(--cream); }
  .table td, .table tfoot td { border: 0; background: none; padding: 3px 0 3px 42%; position: relative; text-align: right; min-height: 24px; }
  .table td::before { content: attr(data-label); position: absolute; left: 0; top: 4px; width: 40%; text-align: left; font-size: 11.5px; font-weight: 500; color: var(--text-3); }
  .table td:first-child { padding-left: 0; text-align: left; }
  .table td:first-child::before, .table td[data-label=""]::before { display: none; }
  .table td[data-label=""] { padding-left: 0; }
  .table td:empty { display: none; }
  .table tr[hidden] { display: none; }
  body.searching .table tr.more-hidden { display: block !important; }
  .table .pcell { justify-content: flex-end; }
  .table .pcell .progress { max-width: 140px; }
  .table .cell-user { justify-content: flex-start; }
  .table tbody tr:hover td { background: none; }
  .matrix td { text-align: right; }
  .table td .btn { margin-top: 4px; }

  /* Línea de tiempo: la etiqueta arriba y la pista a todo el ancho */
  .dl-inner { padding: 6px 12px 12px; }
  .dl-hours, .dl-lane { grid-template-columns: minmax(0, 1fr); }
  .dl-hours > div:first-child { display: none; }
  .dl-hours .dl-track span:nth-child(even) { visibility: hidden; }
  .dl-lab { padding-top: 6px; }
  .dl-lab small { display: inline; margin-left: 4px; }
  .dl-lab br { display: none; }
  .dl-now-wrap { left: 0; }
  .dl-item { font-size: 10px; padding: 0 4px; }

  /* Grilla de turnos: cada colaborador es una ficha con sus 7 días */
  .shifts thead { display: none; }
  .shifts, .shifts tbody, .shifts tfoot { display: block; width: 100%; }
  .shifts tr { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
  .shifts td, .shifts td:first-child { display: block; padding: 0; border: 0; min-width: 0; }
  .shifts td:first-child, .shifts td:last-child { grid-column: 1 / -1; }
  .shifts td:last-child { text-align: left !important; padding: 2px 0 0 !important; font-size: 12px; }
  .shifts td:last-child::before { content: "Total "; color: var(--text-3); font-weight: 400; }
  .shifts td:not(:first-child):not(:last-child)::before { content: attr(data-label); display: block; font-size: 9.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; }
  .shifts td.today { background: none; }
  .shift { padding: 4px 3px; font-size: 11px; text-align: center; }
  .shift small { display: none; }
  .shift.off, .shift.vac { font-size: 9.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .shifts tfoot td:first-child { font-size: 12px; }
  .notif-menu { position: fixed; left: 10px; right: 10px; top: 60px; min-width: 0; }
}

.ims-grid { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1440px) { .ims-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.table td.right .btn { margin: 2px 0 2px 4px; }
@media (max-width: 1180px) {
  .shifts td:first-child { min-width: 0; }
  .shift small { display: none; }
  .shift { text-align: center; }
}
.table .sub { font-weight: 400; }
