/* Panel Origen Nueva Romana */
:root {
  --ink: #121a15; --forest: #1c2a22; --forest-2: #24362c; --cream: #f4f0e7; --sand: #ebe4d6; --stone: #d9d0bf; --line: #e4ddcf;
  --gold: #b8975a; --gold-2: #d4b67a; --text: #1d2621; --muted: #5f6861; --light: #e9e4d8; --light-muted: #b7b3a6;
  --ok: #3f7d5a; --warn: #b8862b; --sold: #8a4a3c; --block: #6b6b6b;
  --serif: "Cormorant Garamond", Georgia, serif; --sans: "Manrope", system-ui, sans-serif; --r: 6px;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--sans); font-size: .95rem; line-height: 1.5; color: var(--text); background: var(--cream); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.1; margin: 0; }
h1 { font-size: 2rem; } h2 { font-size: 1.6rem; } h3 { font-size: 1.25rem; }
p { margin: 0 0 .8em; } a { color: inherit; }
button, input, select, textarea { font: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); } .small { font-size: .8rem; }
.eyebrow { font-size: .66rem; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); margin-bottom: .6rem; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 3px; border: 1px solid transparent; cursor: pointer; font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; background: var(--forest); color: var(--cream); text-decoration: none; transition: background .25s, color .25s; }
.btn:hover { background: var(--forest-2); }
.btn--gold { background: var(--gold); color: var(--ink); } .btn--gold:hover { background: var(--gold-2); }
.btn--ghost { background: transparent; border-color: var(--stone); color: var(--text); } .btn--ghost:hover { background: var(--sand); }
.btn--sm { padding: 6px 12px; font-size: .68rem; }
.btn--danger { background: transparent; border-color: #c98b7a; color: #8a4a3c; } .btn--danger:hover { background: #f3e2dc; }
.btn:disabled { opacity: .5; cursor: default; }

/* Login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login__visual { position: relative; background: var(--ink); overflow: hidden; }
.login__visual img { width: 100%; height: 100%; object-fit: cover; opacity: .75; }
.login__visual .logo { position: absolute; top: 40px; left: 40px; height: 64px; }
.login__visual p { position: absolute; left: 40px; bottom: 40px; color: var(--light); max-width: 34ch; font-family: var(--serif); font-size: 1.5rem; line-height: 1.2; margin: 0; }
.login__panel { display: grid; place-items: center; padding: 40px 24px; }
.login__form { width: min(100%, 380px); }
.login__form h1 { margin-bottom: 6px; }
.login__form .muted { margin-bottom: 28px; }
.demo-hint { margin-top: 20px; padding: 12px 14px; background: var(--sand); border-radius: var(--r); font-size: .8rem; }
.demo-hint code { background: #fff; padding: 1px 6px; border-radius: 3px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--stone); border-radius: 3px; background: #fff; color: var(--text); }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
.field--row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field--check { display: flex; align-items: center; gap: 10px; } .field--check label { margin: 0; text-transform: none; letter-spacing: 0; font-size: .9rem; color: var(--text); }
.error { color: #8a4a3c; font-size: .85rem; margin: 8px 0; }

/* Shell */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--forest); color: var(--light); display: flex; flex-direction: column; padding: 24px 18px; position: sticky; top: 0; height: 100vh; }
.side__logo { height: 56px; width: auto; margin: 6px 0 28px 4px; }
.side nav { display: grid; gap: 4px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 4px; text-decoration: none; color: var(--light-muted); font-size: .9rem; }
.side nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side nav a.active { background: rgba(212,182,122,.15); color: var(--gold-2); }
.side nav a svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.side__user { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); font-size: .82rem; }
.side__user strong { display: block; color: #fff; font-weight: 600; }
.side__user span { color: var(--light-muted); }
.side__user button { margin-top: 10px; }
.side__mode { font-size: .62rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-2); margin-top: 14px; }
.main { padding: 32px clamp(20px, 3vw, 44px); min-width: 0; }
.main__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 28px; }
.main__head .muted { margin-top: 6px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.toolbar input, .toolbar select { padding: 8px 10px; border: 1px solid var(--stone); border-radius: 3px; background: #fff; }
.toolbar input[type="search"] { min-width: 220px; }
.topbar { display: none; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 28px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.kpi__label { font-size: .64rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.kpi__value { font-family: var(--serif); font-size: 2.4rem; line-height: 1.1; margin: 6px 0 2px; }
.kpi__sub { font-size: .78rem; color: var(--muted); }
.kpi--dark { background: var(--forest); color: var(--light); border-color: var(--forest); }
.kpi--dark .kpi__value { color: var(--gold-2); } .kpi--dark .kpi__label, .kpi--dark .kpi__sub { color: var(--light-muted); }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 22px 24px; margin-bottom: 20px; }
.card h3 { margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* Barras por tipología */
.bars { display: grid; gap: 12px; }
.bar { display: grid; grid-template-columns: 200px 1fr 120px; gap: 14px; align-items: center; font-size: .85rem; }
.bar__track { height: 10px; background: var(--sand); border-radius: 5px; overflow: hidden; display: flex; }
.bar__track i { display: block; height: 100%; }
.bar__track .s-disponible { background: var(--ok); } .bar__track .s-reservada { background: var(--gold); } .bar__track .s-vendida { background: var(--sold); } .bar__track .s-bloqueada { background: var(--block); }
.bar__nums { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: .78rem; color: var(--muted); margin-top: 14px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* Tablas */
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th { text-align: left; font-size: .64rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #faf8f3; white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { cursor: pointer; } tbody tr:hover { background: #faf8f3; }
tbody tr.static { cursor: default; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 36px; text-align: center; color: var(--muted); }

.tag { display: inline-block; padding: 3px 9px; border-radius: 3px; font-size: .66rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.tag.s-disponible { background: #e3efe7; color: var(--ok); } .tag.s-reservada { background: #f4ebd7; color: #8a6418; } .tag.s-vendida { background: #f0e0dc; color: var(--sold); } .tag.s-bloqueada { background: #e8e8e8; color: var(--block); }
.tag.s-solicitada { background: #eae6f5; color: #5a4a8a; } .tag.s-confirmada { background: #e3efe7; color: var(--ok); } .tag.s-cancelada { background: #ececec; color: var(--block); }
.price { font-family: var(--serif); font-size: 1.05rem; }
.price.tbd { font-family: var(--sans); font-size: .8rem; color: var(--muted); }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(18,26,21,.55); display: grid; place-items: center; padding: 20px; z-index: 40; }
.modal__box { background: var(--cream); border-radius: var(--r); width: min(100%, 640px); max-height: 92vh; overflow: auto; padding: 28px 30px; }
.modal__head { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 18px; }
.modal__close { background: none; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--muted); }
.modal__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 22px; }
.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 18px; }
.specs div { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; }
.specs dt { font-size: .62rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.specs dd { margin: 2px 0 0; font-weight: 500; }
.plan-preview { margin: 0 0 18px; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: #fff; }
.plan-preview img { display: block; width: 100%; max-height: 320px; object-fit: contain; background: #fff; }
.plan-preview .nofile { padding: 24px; text-align: center; color: var(--muted); font-size: .85rem; }
.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.doc { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 8px; }
.doc strong { font-weight: 600; }
.doc__actions { display: flex; gap: 8px; margin-top: 4px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--light); padding: 12px 20px; border-radius: 4px; font-size: .85rem; z-index: 50; box-shadow: 0 8px 30px rgba(0,0,0,.25); }

@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; } .login__visual { display: none; }
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; transform: translateX(-100%); transition: transform .3s; z-index: 30; }
  .side.open { transform: none; }
  .topbar { display: flex; align-items: center; justify-content: space-between; background: var(--forest); color: var(--light); padding: 12px 16px; position: sticky; top: 0; z-index: 20; }
  .topbar img { height: 36px; } .topbar button { background: none; border: 1px solid rgba(255,255,255,.3); color: #fff; padding: 6px 10px; border-radius: 3px; }
  .main { padding: 20px 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  .bar { grid-template-columns: 1fr; gap: 6px; } .bar__nums { text-align: left; }
  .field--row { grid-template-columns: 1fr; }
  .modal__box { padding: 20px; }
}
