/* ==========================================================================
   Aurora Vista — painel operacional.
   Direção oposta à do site: denso, silencioso, escaneável. Ferramenta de uso
   diário, não peça de marketing. Sidebar escura, conteúdo em papel frio,
   tipografia menor, tabelas com números tabulares.
   ========================================================================== */

:root {
  --ink: #10161b;
  --deep: #14282c;
  --panel: #1b3034;
  --panel-2: #24413f;
  --bg: #f4f5f4;
  --card: #ffffff;
  --line: #e0e2e0;
  --line-2: #eef0ee;
  --txt: #1b2226;
  --muted: #6a7480;
  --brass: #b5822f;
  --ok: #2f7d5c;
  --warn: #b9821e;
  --bad: #b1462f;
  --info: #2f6690;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: "Fraunces", Georgia, serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;

  --r: 8px;
  --r-lg: 14px;
  --sb: 244px;
  --shadow: 0 1px 2px rgb(16 22 27 / 6%), 0 6px 18px rgb(16 22 27 / 6%);
  --shadow-lg: 0 24px 60px rgb(16 22 27 / 22%);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--txt);
  font-family: var(--sans); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 3px; }

/* ==========================================================================
   Login
   ========================================================================== */
#login {
  position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 24px;
  background: var(--deep);
}
#login::before {
  content: ""; position: absolute; inset: 0;
  background: url("https://images.pexels.com/photos/290597/pexels-photo-290597.jpeg?auto=compress&cs=tinysrgb&w=1600") center/cover;
  opacity: .16;
}
#login[hidden] { display: none; }
.login__box {
  position: relative; width: min(380px, 100%); background: var(--card);
  border-radius: var(--r-lg); padding: 34px; display: grid; gap: 14px; box-shadow: var(--shadow-lg);
}
.login__box h1 { font-family: var(--serif); font-size: 1.7rem; font-weight: 500; }
.login__box p { color: var(--muted); font-size: .85rem; }
.login__box label { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 5px; }
.login__box input { width: 100%; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; }
.login__hint { font-size: .76rem; background: var(--line-2); border-radius: var(--r); padding: 9px 12px; color: var(--muted); }

/* ==========================================================================
   Shell
   ========================================================================== */
.shell { display: grid; grid-template-columns: var(--sb) minmax(0, 1fr); min-height: 100vh; }

.side {
  background: var(--deep); color: #cfe0dc; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side__brand { padding: 20px 20px 16px; border-bottom: 1px solid rgb(255 255 255 / 8%); }
.side__brand b { font-family: var(--serif); font-size: 1.15rem; font-weight: 500; color: #fff; display: block; }
.side__brand span { font-size: .62rem; letter-spacing: .22em; text-transform: uppercase; color: #7f9c96; }
.side nav { padding: 12px 10px; display: grid; gap: 2px; flex: 1; }
.side__grp { font-size: .6rem; letter-spacing: .18em; text-transform: uppercase; color: #6b8781; padding: 14px 10px 6px; }
.side a {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: var(--r);
  font-size: .875rem; transition: background .2s, color .2s;
}
.side a svg { width: 17px; height: 17px; flex: none; opacity: .72; }
.side a:hover { background: rgb(255 255 255 / 6%); color: #fff; }
.side a.on { background: var(--panel-2); color: #fff; }
.side a.on svg { opacity: 1; color: var(--brass); }
.side a .badge {
  margin-left: auto; background: var(--brass); color: #fff; font-size: .66rem;
  padding: 1px 7px; border-radius: 99px; font-variant-numeric: tabular-nums;
}
.side__foot { padding: 14px; border-top: 1px solid rgb(255 255 255 / 8%); display: grid; gap: 8px; font-size: .76rem; color: #7f9c96; }
.side__foot button, .side__foot a { color: #cfe0dc; text-align: left; padding: 7px 11px; border-radius: var(--r); display: block; }
.side__foot button:hover, .side__foot a:hover { background: rgb(255 255 255 / 6%); }

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

.top {
  position: sticky; top: 0; z-index: 40; background: rgb(244 245 244 / 88%);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  padding: 14px 26px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.top h1 { font-size: 1.25rem; margin-right: auto; }
.top__date { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.mtoggle { display: none; }

.page { padding: 22px 26px 60px; display: grid; gap: 20px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 100;
    transform: translateX(-100%); transition: transform .35s var(--ease);
  }
  body.side-open .side { transform: none; }
  body.side-open::after { content: ""; position: fixed; inset: 0; background: rgb(0 0 0 / 45%); z-index: 90; }
  .mtoggle { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
  .page { padding: 18px 16px 60px; }
  .top { padding: 12px 16px; }
}

/* ==========================================================================
   Cards / KPI
   ========================================================================== */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px; box-shadow: var(--shadow);
}
.card__h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card__h h2 { font-size: .95rem; }
.card__h p { font-size: .78rem; color: var(--muted); }

.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; position: relative; overflow: hidden; }
.kpi__l { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.kpi__v { font-size: 1.9rem; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 6px; letter-spacing: -.02em; }
.kpi__d { font-size: .76rem; margin-top: 4px; color: var(--muted); }
.kpi__d b { font-weight: 600; }
.kpi--up .kpi__d b { color: var(--ok); }
.kpi--down .kpi__d b { color: var(--bad); }

.grid2 { display: grid; gap: 20px; }
@media (min-width: 1100px) { .grid2 { grid-template-columns: 1.55fr 1fr; align-items: start; } }
.grid3 { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }

/* ==========================================================================
   Tabelas
   ========================================================================== */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .84rem; }
thead th {
  text-align: left; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
thead th[data-sort] { cursor: pointer; user-select: none; }
thead th[data-sort]:hover { color: var(--txt); }
thead th[aria-sort]::after { content: "↑"; margin-left: 5px; color: var(--brass); }
thead th[aria-sort="descending"]::after { content: "↓"; }
tbody td { padding: 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #fafbfa; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.mono { font-family: var(--mono); font-size: .8rem; }
.tools { display: flex; gap: 8px; justify-content: flex-end; }
.tools button {
  width: 30px; height: 30px; border-radius: var(--r); display: grid; place-items: center;
  border: 1px solid var(--line); color: var(--muted); transition: border-color .2s, color .2s, background .2s;
}
.tools button:hover { border-color: var(--brass); color: var(--brass); background: #fff; }
.tools button[data-del]:hover { border-color: var(--bad); color: var(--bad); }
.tools svg { width: 15px; height: 15px; }

/* pills de status */
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px;
  font-size: .72rem; font-weight: 600; white-space: nowrap; text-transform: capitalize;
}
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill--ok { background: #e6f2ec; color: var(--ok); }
.pill--warn { background: #fbf1dd; color: var(--warn); }
.pill--bad { background: #fbe9e4; color: var(--bad); }
.pill--info { background: #e6eef5; color: var(--info); }
.pill--mute { background: #eef0ee; color: var(--muted); }

/* barra de ferramentas de listagem */
.bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.bar input[type="search"], .bar select, .bar input[type="date"] {
  border: 1px solid var(--line); border-radius: var(--r); padding: 8px 11px; background: var(--card); min-width: 0;
}
.bar input[type="search"] { flex: 1; min-width: 180px; }
.bar .right { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; border-radius: var(--r);
  background: var(--deep); color: #fff; font-size: .82rem; font-weight: 600;
  transition: background .2s, transform .15s, box-shadow .2s; white-space: nowrap;
}
.btn:hover { background: var(--panel); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn svg { width: 15px; height: 15px; }
.btn--ghost { background: var(--card); color: var(--txt); border: 1px solid var(--line); }
.btn--ghost:hover { background: #fff; border-color: var(--brass); color: var(--brass); }
.btn--brass { background: var(--brass); }
.btn--brass:hover { background: #9d6f26; }
.btn--danger { background: var(--bad); }
.btn--danger:hover { background: #94381f; }
.btn--sm { padding: 6px 11px; font-size: .76rem; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 14px; font-size: .8rem; color: var(--muted); }
.pager button { border: 1px solid var(--line); border-radius: var(--r); padding: 5px 11px; }
.pager button:hover:not([disabled]) { border-color: var(--brass); color: var(--brass); }
.pager button[disabled] { opacity: .4; cursor: default; }

.vazio { text-align: center; padding: 44px 20px; color: var(--muted); font-size: .86rem; }

/* ==========================================================================
   Widgets do dashboard
   ========================================================================== */
.chart { width: 100%; height: auto; overflow: visible; }
.chart .bar-r { fill: var(--deep); transition: fill .2s; }
.chart .bar-c { fill: #c3cdc9; }
.chart .bar-r:hover { fill: var(--brass); }
.chart text { font-size: 10px; fill: var(--muted); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.legend { display: flex; gap: 16px; font-size: .76rem; color: var(--muted); margin-top: 10px; flex-wrap: wrap; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-right: 6px; vertical-align: -1px; }

.donut { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut__n { font-size: 2rem; font-weight: 600; font-variant-numeric: tabular-nums; }

/* mapa de quartos */
.rooms-map { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
.rm {
  border: 1px solid var(--line); border-radius: var(--r); padding: 11px; background: var(--card);
  display: grid; gap: 4px; text-align: left; transition: transform .18s var(--ease), box-shadow .2s;
  border-left: 3px solid var(--muted);
}
.rm:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.rm b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.rm small { font-size: .7rem; color: var(--muted); }
.rm[data-st="limpo"] { border-left-color: var(--ok); }
.rm[data-st="sujo"] { border-left-color: var(--warn); }
.rm[data-st="manutencao"] { border-left-color: var(--bad); }
.rm[data-st="ocupado"] { border-left-color: var(--info); background: #f7fafc; }

/* timeline */
.tl { display: grid; }
.tl__i { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); align-items: flex-start; }
.tl__i:last-child { border-bottom: 0; }
.tl__t { font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 46px; padding-top: 2px; }
.tl__c b { font-size: .86rem; }
.tl__c p { font-size: .78rem; color: var(--muted); }

/* café da manhã */
.cafe-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.cafe-i {
  border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; background: var(--card);
  display: flex; gap: 12px; align-items: center; transition: border-color .2s, background .2s;
}
.cafe-i.done { background: #f2f8f4; border-color: #c9e2d4; }
.cafe-i input { width: 18px; height: 18px; accent-color: var(--ok); flex: none; }
.cafe-i b { font-size: .88rem; display: block; }
.cafe-i small { font-size: .74rem; color: var(--muted); }

.menu-day { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.menu-day summary {
  padding: 11px 14px; cursor: pointer; font-weight: 600; font-size: .86rem;
  display: flex; justify-content: space-between; align-items: center; background: #fafbfa; gap: 10px;
}
.menu-day[open] summary { border-bottom: 1px solid var(--line); }
.menu-day .body { padding: 12px 14px; display: grid; gap: 8px; font-size: .82rem; }
.menu-day .body div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; }
.menu-day .body span:first-child { color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; padding-top: 2px; }

/* alertas */
.alert { display: flex; gap: 10px; padding: 11px 13px; border-radius: var(--r); font-size: .82rem; align-items: flex-start; }
.alert--bad { background: #fbe9e4; color: #7d3122; }
.alert--warn { background: #fbf1dd; color: #7a5511; }
.alert--info { background: #e6eef5; color: #23506f; }
.alert svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }

/* ==========================================================================
   Modal / formulários
   ========================================================================== */
.modal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal__scrim { position: absolute; inset: 0; background: rgb(16 22 27 / 55%); backdrop-filter: blur(2px); }
.modal__box {
  position: relative; width: min(640px, 100%); max-height: 86vh; overflow: auto;
  background: var(--card); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow-lg);
  animation: pop .3s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal__box h2 { font-size: 1.15rem; margin-bottom: 4px; }
.modal__box > p { font-size: .82rem; color: var(--muted); margin-bottom: 16px; }
.modal__x { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: var(--r); font-size: 1.3rem; color: var(--muted); }
.modal__x:hover { background: var(--line-2); }

.fgrid { display: grid; gap: 13px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.fgrid .full { grid-column: 1 / -1; }
.fgrid .f { display: grid; gap: 5px; }
.fgrid label { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.fgrid input, .fgrid select, .fgrid textarea {
  border: 1px solid var(--line); border-radius: var(--r); padding: 9px 11px; background: var(--card); width: 100%;
}
.fgrid input:focus, .fgrid select:focus, .fgrid textarea:focus { border-color: var(--brass); outline: none; }
.fgrid input[aria-invalid="true"], .fgrid select[aria-invalid="true"] { border-color: var(--bad); background: #fdf6f4; }
.facts { display: flex; gap: 9px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.ferr { color: var(--bad); font-size: .78rem; min-height: 1em; margin-top: 10px; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 160%); z-index: 400;
  background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 99px;
  font-size: .84rem; box-shadow: var(--shadow-lg); transition: transform .4s var(--ease); max-width: 92vw;
}
#toast.on { transform: translate(-50%, 0); }

.view[hidden] { display: none; }
.view { animation: fadeup .35s var(--ease); }
@keyframes fadeup { from { opacity: 0; transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
