/* ============ Tokens ============ */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #fafafc;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #a1a1a6;
  --hairline: rgba(0, 0, 0, 0.08);
  --fill: rgba(0, 0, 0, 0.05);
  --fill-2: rgba(0, 0, 0, 0.08);
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: rgba(0, 113, 227, 0.12);
  --green: #248a3d;
  --green-soft: rgba(52, 199, 89, 0.15);
  --amber: #b25e00;
  --amber-soft: rgba(255, 149, 0, 0.16);
  --red: #d70015;
  --red-soft: rgba(255, 59, 48, 0.12);
  --purple: #8944ab;
  --purple-soft: rgba(175, 82, 222, 0.14);
  --teal: #0e7c86;
  --teal-soft: rgba(48, 176, 199, 0.15);
  --wallapop: #13c1ac;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 20px rgba(0, 0, 0, 0.045);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(0, 0, 0, 0.04);
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --glass: rgba(255, 255, 255, 0.72);
  --glass-bg: rgba(245, 245, 247, 0.78);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-2: #232325;
    --text: #f5f5f7;
    --text-2: #98989d;
    --text-3: #6e6e73;
    --hairline: rgba(255, 255, 255, 0.1);
    --fill: rgba(255, 255, 255, 0.07);
    --fill-2: rgba(255, 255, 255, 0.12);
    --accent: #0a84ff;
    --accent-hover: #409cff;
    --accent-soft: rgba(10, 132, 255, 0.2);
    --green: #30d158;
    --green-soft: rgba(48, 209, 88, 0.18);
    --amber: #ffb340;
    --amber-soft: rgba(255, 159, 10, 0.2);
    --red: #ff6961;
    --red-soft: rgba(255, 69, 58, 0.2);
    --purple: #da8fff;
    --purple-soft: rgba(191, 90, 242, 0.2);
    --teal: #5ac8d8;
    --teal-soft: rgba(64, 200, 224, 0.18);
    --shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
    --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
    --glass: rgba(28, 28, 30, 0.72);
    --glass-bg: rgba(0, 0, 0, 0.72);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px; line-height: 1.45; letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
::selection { background: rgba(0, 113, 227, 0.2); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 32px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos { color: var(--green); } .neg { color: var(--red); }

/* ============ Layout ============ */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; width: 240px; flex-shrink: 0;
  display: flex; flex-direction: column; padding: 14px 12px;
  background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  border-right: 1px solid var(--hairline);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 8px 12px 18px; font-weight: 700; font-size: 19px; letter-spacing: -0.025em; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; font-size: 17px;
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 10px;
  color: var(--text); opacity: 0.85; font-size: 14px; font-weight: 500; text-decoration: none; transition: background 0.15s;
}
.nav a:hover { background: var(--fill); }
.nav a.active { background: var(--accent-soft); color: var(--accent); opacity: 1; }
.nav a svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav .badge-count { margin-left: auto; font-size: 12px; background: var(--fill-2); border-radius: 999px; padding: 1px 8px; color: var(--text-2); }
.sidebar-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--hairline); }
.sidebar-foot .who { font-size: 12px; color: var(--text-3); padding: 6px 12px; overflow: hidden; text-overflow: ellipsis; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px;
  min-height: 60px; padding: 10px 28px; padding-top: max(10px, env(safe-area-inset-top));
  background: var(--glass-bg); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid var(--hairline);
}
.topbar h1 { font-size: 22px; font-weight: 700; margin-right: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar h1 span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view { padding: 24px 28px 48px; max-width: 1400px; width: 100%; }

.tabbar { display: none; }
.fab { display: none; }

@media (max-width: 820px) {
  .sidebar { display: none; }
  .topbar { padding-left: 16px; padding-right: 16px; }
  .topbar h1 { font-size: 20px; }
  .view { padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
    border-top: 1px solid var(--hairline);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 500;
    color: var(--text-2); text-decoration: none; padding: 4px 0;
  }
  .tabbar a svg { width: 24px; height: 24px; }
  .tabbar a.active { color: var(--accent); }
  .fab {
    display: grid; place-items: center; position: fixed; right: 18px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 41;
    width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--accent); color: #fff;
    box-shadow: 0 8px 24px rgba(0, 113, 227, 0.45); cursor: pointer;
  }
  .fab svg { width: 26px; height: 26px; }
  .hide-mobile { display: none !important; }
}
@media (min-width: 821px) { .show-mobile { display: none !important; } }

/* ============ Componentes ============ */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid rgba(0, 0, 0, 0.03); }
.card-pad { padding: 18px 20px; }
.card h3 { font-size: 16px; font-weight: 600; }
.section-title { font-size: 13px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 10px; }

.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.kpi { padding: 16px 18px; }
.kpi .label { font-size: 12.5px; font-weight: 500; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 28px; font-weight: 700; letter-spacing: -0.035em; margin-top: 4px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12.5px; color: var(--text-3); margin-top: 6px; }
.kpi.link { cursor: pointer; transition: transform 0.15s; }
.kpi.link:hover { transform: translateY(-1px); }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1000px) { .cols-2, .cols-3-1 { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 16px;
  border-radius: 999px; border: 0; cursor: pointer; font-size: 14px; font-weight: 500; white-space: nowrap;
  background: var(--fill-2); color: var(--text); transition: background 0.15s, transform 0.1s; text-decoration: none !important;
}
.btn:hover { background: rgba(0, 0, 0, 0.11); }
@media (prefers-color-scheme: dark) { .btn:hover { background: rgba(255, 255, 255, 0.16); } }
.btn:active { transform: scale(0.97); }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--fill); }
.btn.wallapop { background: var(--wallapop); color: #fff; }
.btn.sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: var(--fill); color: var(--text-2); white-space: nowrap;
}
.chip.lg { font-size: 13px; padding: 4px 11px; }
.st-en_uso { background: var(--fill); color: var(--text-2); }
.st-guardado { background: var(--teal-soft); color: var(--teal); }
.st-para_vender { background: var(--amber-soft); color: var(--amber); }
.st-en_venta { background: var(--accent-soft); color: var(--accent); }
.st-reservado { background: var(--purple-soft); color: var(--purple); }
.st-vendido { background: var(--green-soft); color: var(--green); }
.st-regalado, .st-tirado, .st-perdido { background: var(--fill); color: var(--text-3); }

/* Inputs */
input:not([type='checkbox']):not([type='radio']):not([type='file']):not([type='color']), select, textarea {
  width: 100%; border: 1px solid rgba(0, 0, 0, 0.14); border-radius: 10px; background-color: var(--surface);
  padding: 9px 12px; font: inherit; font-size: 15px; color: var(--text); outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
@media (prefers-color-scheme: dark) {
  input:not([type='checkbox']):not([type='radio']):not([type='file']):not([type='color']), select, textarea { border-color: rgba(255, 255, 255, 0.16); background-color: var(--surface-2); }
}
input:focus, select:focus, textarea:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.18); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
textarea { resize: vertical; min-height: 80px; }
select {
  -webkit-appearance: none; appearance: none; padding-right: 32px;
  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='%238e8e93' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
select.filter-on, input.filter-on { background-color: var(--accent-soft) !important; border-color: var(--accent) !important; }
input[type='checkbox'] { width: 18px; height: 18px; accent-color: var(--accent); }
input[type='number'] { font-variant-numeric: tabular-nums; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; color: var(--text-2); min-width: 0; }
label.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.hint { font-size: 12px; color: var(--text-3); font-weight: 400; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: span 1; } }
details.fold { border-top: 1px solid var(--hairline); padding-top: 12px; }
details.fold > summary { cursor: pointer; font-weight: 600; font-size: 14px; list-style: none; display: flex; align-items: center; gap: 8px; padding: 4px 0 10px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: '›'; display: inline-block; transition: transform 0.2s; font-size: 18px; color: var(--text-3); width: 10px; }
details.fold[open] > summary::before { transform: rotate(90deg); }

/* Toolbar de filtros */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .search { position: relative; flex: 1 1 240px; }
.toolbar .search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); }
.toolbar .search input { padding-left: 34px; }
.toolbar select { width: auto; flex: 0 1 auto; font-size: 14px; }
.seg { display: inline-flex; background: var(--fill); border-radius: 10px; padding: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.seg button svg { width: 16px; height: 16px; }
.pills { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; margin-bottom: 14px; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pills button { border: 0; background: var(--fill); padding: 6px 13px; border-radius: 999px; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; color: var(--text); }
.pills button.on { background: var(--text); color: var(--bg); }
.pills button .n { opacity: 0.6; margin-left: 3px; }

/* Tarjetas de objeto */
.items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
@media (max-width: 520px) { .items-grid { grid-template-columns: 1fr 1fr; gap: 10px; } }
.item-card { overflow: hidden; cursor: pointer; transition: transform 0.15s var(--ease), box-shadow 0.15s; display: flex; flex-direction: column; text-decoration: none !important; color: inherit; }
.item-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05), 0 12px 30px rgba(0, 0, 0, 0.09); }
.thumb { aspect-ratio: 1 / 1; background: var(--fill); position: relative; display: grid; place-items: center; font-size: 46px; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .chip { position: absolute; top: 8px; left: 8px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.thumb .qty { position: absolute; top: 8px; right: 8px; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 1px 8px; }
.thumb .pc { position: absolute; bottom: 8px; right: 8px; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 11px; border-radius: 999px; padding: 1px 7px; }
.item-card .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.item-card .name { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-card .meta { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-card .price { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 14px; }

/* Lista / tabla */
.table-wrap { overflow-x: auto; }
table.data { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; }
table.data th { text-align: left; color: var(--text-2); font-size: 12px; font-weight: 500; padding: 10px 12px; border-bottom: 1px solid var(--hairline); white-space: nowrap; }
table.data td { padding: 9px 12px; border-bottom: 1px solid var(--hairline); vertical-align: middle; font-variant-numeric: tabular-nums; }
table.data tbody tr { cursor: pointer; transition: background 0.12s; }
table.data tbody tr:hover { background: var(--fill); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .r { text-align: right; }
.mini-thumb { width: 40px; height: 40px; border-radius: 9px; background: var(--fill); display: grid; place-items: center; font-size: 20px; overflow: hidden; flex-shrink: 0; }
.mini-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Habitaciones */
.rooms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.room-card { padding: 18px; cursor: pointer; position: relative; overflow: hidden; transition: transform 0.15s; }
.room-card:hover { transform: translateY(-2px); }
.room-card .ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 26px; }
.room-card .rname { font-weight: 600; font-size: 17px; margin-top: 12px; }
.room-card .rstats { display: flex; gap: 14px; margin-top: 6px; font-size: 13px; color: var(--text-2); }
.room-card .edit { position: absolute; top: 12px; right: 12px; }
.room-card.add { display: grid; place-items: center; min-height: 150px; border: 2px dashed var(--fill-2); background: transparent; box-shadow: none; color: var(--text-2); font-weight: 500; }

/* Barras */
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 150px) 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; cursor: pointer; }
.bar-row .track { height: 8px; background: var(--fill); border-radius: 999px; overflow: hidden; }
.bar-row .fill { height: 100%; border-radius: 999px; background: var(--accent); }
.months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; height: 140px; }
.months .m { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.months .col { width: 100%; max-width: 30px; background: var(--green); border-radius: 6px 6px 3px 3px; min-height: 3px; opacity: 0.85; }
.months .col.zero { background: var(--fill-2); }
.months .lbl { font-size: 10.5px; color: var(--text-3); }
.months .v { font-size: 10.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* Pipeline de ventas */
.pipeline { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 6px; }
@media (max-width: 820px) { .pipeline { grid-template-columns: repeat(4, 82vw); scroll-snap-type: x mandatory; } .pipeline > * { scroll-snap-align: start; } }
.lane { background: var(--fill); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 200px; }
.lane-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px; font-weight: 600; font-size: 14px; }
.lane-head .sum { font-weight: 500; color: var(--text-2); font-size: 12.5px; }
.deal { padding: 10px; display: flex; gap: 10px; cursor: pointer; transition: transform 0.12s; }
.deal:hover { transform: translateY(-1px); }
.deal .mini-thumb { width: 54px; height: 54px; }
.deal .t { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal .s { font-size: 12.5px; color: var(--text-2); }
.deal .acts { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.lane .empty { text-align: center; color: var(--text-3); font-size: 13px; padding: 24px 8px; }

/* Avisos */
.alert-list { display: flex; flex-direction: column; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--hairline); cursor: pointer; }
.alert:last-child { border-bottom: 0; }
.alert .ai { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 15px; flex-shrink: 0; }
.alert .at { font-size: 14px; font-weight: 500; }
.alert .as { font-size: 12.5px; color: var(--text-2); }

/* Timeline */
.timeline { display: flex; flex-direction: column; }
.ev { display: flex; gap: 12px; padding: 9px 0; position: relative; }
.ev .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; flex-shrink: 0; background: var(--fill); z-index: 1; }
.ev:not(:last-child)::after { content: ''; position: absolute; left: 13.5px; top: 37px; bottom: -9px; width: 1px; background: var(--hairline); }
.ev .em { font-size: 14px; }
.ev .ed { font-size: 12px; color: var(--text-3); }
.ev .del { margin-left: auto; opacity: 0; }
.ev:hover .del { opacity: 1; }

/* Detalle de objeto */
.detail { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .detail { grid-template-columns: 1fr; } }
.gallery .main-photo { aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--fill); display: grid; place-items: center; font-size: 80px; cursor: zoom-in; position: relative; }
.gallery .main-photo img { width: 100%; height: 100%; object-fit: contain; background: #111; }
.gallery .strip { display: flex; gap: 8px; overflow-x: auto; margin-top: 10px; padding-bottom: 4px; }
.gallery .strip .ph { width: 72px; height: 72px; border-radius: 10px; overflow: hidden; flex-shrink: 0; cursor: pointer; position: relative; border: 2px solid transparent; background: var(--fill); }
.gallery .strip .ph.on { border-color: var(--accent); }
.gallery .strip .ph img { width: 100%; height: 100%; object-fit: cover; }
.gallery .strip .ph.add { display: grid; place-items: center; color: var(--text-2); border: 2px dashed var(--fill-2); font-size: 26px; }
.props { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.props dt { color: var(--text-2); }
.props dd { margin: 0; text-align: right; font-weight: 500; overflow-wrap: anywhere; }
.status-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.copy-box { background: var(--fill); border-radius: 12px; padding: 10px 12px; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; position: relative; }
.copy-box .btn { position: absolute; top: 6px; right: 6px; }
.price-suggest { display: flex; gap: 8px; flex-wrap: wrap; }
.price-suggest button { flex: 1; border: 1px solid var(--hairline); background: var(--surface); border-radius: 12px; padding: 8px 10px; cursor: pointer; text-align: center; }
.price-suggest button:hover { border-color: var(--accent); }
.price-suggest b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.price-suggest span { font-size: 11.5px; color: var(--text-2); }
.offer { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--hairline); font-size: 14px; }
.offer:last-child { border-bottom: 0; }

/* Modal */
.modal-wrap { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.32); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: fade 0.2s; }
.modal {
  position: relative; background: var(--surface); border-radius: 24px; width: 100%; max-width: 640px; max-height: calc(100vh - 4rem);
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop 0.28s var(--ease); overflow: hidden;
}
.modal.wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px 12px; }
.modal-head h2 { font-size: 19px; margin-right: auto; }
.modal-body { padding: 4px 22px 18px; overflow-y: auto; flex: 1; min-height: 0; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 22px 18px; border-top: 1px solid var(--hairline); flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; }
@media (max-width: 640px) {
  .modal-wrap { padding: 0; align-items: flex-end; }
  .modal { border-radius: 20px 20px 0 0; max-height: 94vh; animation: slideup 0.32s var(--ease); }
  .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0.96) translateY(8px); } }
@keyframes slideup { from { transform: translateY(100%); } }

/* Fotos del formulario */
.photo-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-picker .ph { width: 84px; height: 84px; border-radius: 12px; overflow: hidden; position: relative; background: var(--fill); }
.photo-picker .ph img { width: 100%; height: 100%; object-fit: cover; }
.photo-picker .ph .x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0, 0, 0, 0.6); color: #fff; border: 0; cursor: pointer; font-size: 13px; line-height: 1; }
.photo-picker .ph.main::after { content: 'Portada'; position: absolute; bottom: 4px; left: 4px; font-size: 10px; background: rgba(0, 0, 0, 0.6); color: #fff; border-radius: 6px; padding: 1px 5px; }
.photo-picker label.add { width: 84px; height: 84px; border-radius: 12px; border: 2px dashed var(--fill-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; color: var(--text-2); font-size: 11.5px; font-weight: 500; text-align: center; }
.photo-picker label.add svg { width: 24px; height: 24px; }
.photo-picker input[type='file'] { display: none; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, 0.94); display: flex; align-items: center; justify-content: center; animation: fade 0.2s; }
.lightbox img { max-width: 96vw; max-height: 90vh; object-fit: contain; }
.lightbox .nav-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.15); color: #fff; font-size: 22px; cursor: pointer; }
.lightbox .prev { left: 14px; } .lightbox .next { right: 14px; }
.lightbox .close { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.15); color: #fff; font-size: 18px; cursor: pointer; }

/* Toast */
#toast-root { position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
@media (max-width: 820px) { #toast-root { bottom: calc(150px + env(safe-area-inset-bottom)); } }
.toast { background: rgba(29, 29, 31, 0.92); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 500; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); animation: pop 0.25s var(--ease); pointer-events: auto; display: flex; align-items: center; gap: 12px; }
.toast.err { background: #d70015; }
.toast button { background: none; border: 0; color: #64d2ff; font-weight: 600; cursor: pointer; padding: 0; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 360px; text-align: center; }
.login-card .logo { width: 72px; height: 72px; border-radius: 18px; background: var(--accent); display: grid; place-items: center; font-size: 40px; margin: 0 auto 16px; box-shadow: 0 10px 30px rgba(0, 113, 227, 0.35); }
.login-card h1 { font-size: 30px; font-weight: 700; }
.login-card p { color: var(--text-2); margin: 6px 0 26px; }
.login-card form { display: flex; flex-direction: column; gap: 10px; }
.login-card .btn { height: 44px; font-size: 15px; margin-top: 6px; }
.err-text { color: var(--red); font-size: 13.5px; }

.empty-state { text-align: center; padding: 56px 20px; color: var(--text-2); }
.empty-state .big { font-size: 54px; }
.empty-state h3 { color: var(--text); font-size: 19px; margin: 10px 0 6px; }
.empty-state p { margin: 0 0 18px; }

.skeleton { background: linear-gradient(90deg, var(--fill) 25%, var(--fill-2) 50%, var(--fill) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 4px; }
.emoji-grid button { font-size: 22px; height: 40px; border: 0; background: var(--fill); border-radius: 10px; cursor: pointer; }
.emoji-grid button.on { outline: 2px solid var(--accent); background: var(--accent-soft); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 28px; height: 28px; border-radius: 50%; border: 0; cursor: pointer; }
.swatches button.on { outline: 3px solid var(--text); outline-offset: 2px; }

.settings-list .srow { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--hairline); }
.settings-list .srow:last-child { border-bottom: 0; }

/* Ajustes de la barra de filtros y etiquetas sobre fotos */
.toolbar .search input { padding-left: 34px !important; }
.thumb .chip { background: rgba(255, 255, 255, 0.92); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); }
@media (prefers-color-scheme: dark) { .thumb .chip { background: rgba(28, 28, 30, 0.88); } }
@media (max-width: 820px) {
  .toolbar .search { flex: 1 1 100%; }
  .toolbar select { flex: 1 1 calc(50% - 4px); min-width: 0; font-size: 14px; padding-top: 8px; padding-bottom: 8px; }
  .toolbar #f-sort { flex: 1 1 auto; }
}
.toast { max-width: 92vw; width: max-content; }
@media (max-width: 1000px) {
  .detail { display: flex; flex-direction: column; align-items: stretch; }
  .detail .d-left { display: contents; }
  .detail .gallery { order: 1; }
  .detail .d-info { order: 2; }
  .detail .d-right { order: 3; }
  .detail .d-ficha { order: 4; }
  .detail .d-hist { order: 5; }
}
@media (max-width: 820px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 13px 14px; }
  .kpi .value { font-size: 22px; }
  .kpi .sub { font-size: 11.5px; }
}
@media (max-width: 820px) {
  .rooms-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .room-card { padding: 14px; }
  .room-card .ico { width: 40px; height: 40px; font-size: 22px; border-radius: 12px; }
  .room-card .rname { font-size: 15px; margin-top: 10px; }
  .room-card .rstats { flex-wrap: wrap; gap: 2px 10px; font-size: 12px; }
  .room-card.add { min-height: 120px; }
}
