/* =========================================================
   Pousada - Sistema Administrativo
   ========================================================= */
:root {
  --bg: #eef2f7;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --navy: #0a1630;
  --navy-2: #12284f;
  --navy-3: #1b3a6b;

  --blue: #2563eb;
  --blue-soft: #dbeafe;
  --green: #12a150;
  --green-soft: #d9f5e5;
  --orange: #f59e0b;
  --orange-soft: #fef3c7;
  --red: #ef4444;
  --red-soft: #fee2e2;
  --purple: #8b5cf6;
  --purple-soft: #ede9fe;
  --gray: #94a3b8;
  --gray-soft: #f1f5f9;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .06);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--text); background: var(--bg); font-size: 14px; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; }
button { font-family: inherit; }
svg.ic { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------- LOGIN ---------------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--bg); }
.login-hero {
  position: relative; overflow: hidden; color: #fff; padding: 56px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(circle at 20% 20%, #1e4b8f 0%, transparent 45%),
              radial-gradient(circle at 80% 90%, #0f766e 0%, transparent 40%),
              linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%);
}
.login-hero::after {
  content: ""; position: absolute; inset: 0; opacity: .07;
  background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px);
  background-size: 40px 40px;
}
.login-hero > * { position: relative; z-index: 1; }
.login-hero h1 { font-size: 40px; line-height: 1.15; margin: 0 0 16px; font-weight: 700; }
.login-hero p { color: #c7d5ee; font-size: 16px; max-width: 440px; line-height: 1.6; }
.hero-features { display: grid; gap: 14px; margin-top: 32px; }
.hero-features div { display: flex; align-items: center; gap: 12px; color: #e2e8f0; }
.hero-features span.ic-wrap { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.1); }
.login-hero small { color: #8ea3c7; }

.login-box { display: grid; place-items: center; padding: 32px; }
.login-card { width: 100%; max-width: 400px; background: var(--card); border-radius: 20px; padding: 40px 36px; box-shadow: var(--shadow); }
.login-card h2 { font-size: 24px; margin-bottom: 6px; }
.login-card .sub { color: var(--muted); margin: 0 0 28px; }
.login-card .field { margin-bottom: 18px; }
.login-card label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-icon input { padding-left: 40px !important; }
.login-card input[type=text], .login-card input[type=password], .login-card input[type=email] {
  width: 100%; height: 46px; border: 1px solid var(--border); border-radius: 10px; padding: 0 14px; font-size: 15px; outline: none; transition: .15s;
}
.login-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.login-row { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 22px; font-size: 13px; color: var(--muted); }
.login-row label { display: flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; cursor: pointer; }
.login-error { background: var(--red-soft); color: #b91c1c; padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; display: none; }
.login-error.show { display: block; }
.login-card .view h2 { margin-top: 4px; }
.login-msg { padding: 11px 13px; border-radius: 10px; font-size: 13px; margin-bottom: 18px; line-height: 1.5; }
.login-msg.error { background: var(--red-soft); color: #b91c1c; }
.login-msg.info { background: var(--blue-soft); color: #1e40af; }
.login-msg.ok { background: var(--green-soft); color: #0f6b35; }
.login-foot { margin: 18px 0 0; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.5; }
.pill { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; padding: 4px 10px; border-radius: 99px; background: var(--blue-soft); color: #1d4ed8; margin-bottom: 10px; }
.pill.orange { background: var(--orange-soft); color: #b45309; }
.pill.green { background: var(--green-soft); color: #0f6b35; }
.link-btn { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.check-row { display: flex !important; align-items: center; gap: 8px; font-size: 13px; font-weight: 400 !important; color: var(--muted); margin: 0 0 18px !important; cursor: pointer; }
.pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 8px; }
.pw-meter i { height: 5px; border-radius: 99px; background: var(--border); transition: background .2s; }
.pw-label { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); min-height: 16px; }
.code-input { font-family: Consolas, "Courier New", monospace !important; letter-spacing: 2px; text-transform: uppercase; font-size: 17px !important; text-align: center; }
.code-box { font-family: Consolas, "Courier New", monospace; font-size: 24px; font-weight: 700; letter-spacing: 3px; text-align: center; padding: 18px 10px; border-radius: 12px; background: var(--navy); color: #fbbf24; margin: 6px 0 12px; user-select: all; word-break: break-all; }
.code-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.code-tips { margin: 0 0 16px; padding-left: 18px; font-size: 13px; color: var(--muted); line-height: 1.6; }
.user-reveal { color: var(--blue); font-size: 16px; }
.help { margin-top: 18px; font-size: 13px; color: var(--muted); background: var(--gray-soft); border-radius: 10px; padding: 10px 14px; }
.help summary { cursor: pointer; font-weight: 600; color: var(--text); }
.help p { margin: 8px 0 0; line-height: 1.6; }
.sub code { background: var(--gray-soft); padding: 1px 6px; border-radius: 5px; font-size: 12px; }
.success-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; margin: 4px auto 14px; }
.success-icon svg { width: 34px; height: 34px; stroke-width: 2.5; }

/* ---------------- BRAND ---------------- */
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0; overflow: hidden; background: #000; box-shadow: 0 0 0 2px rgba(30,136,229,.35), 0 6px 18px rgba(0,0,0,.35); }
.brand-logo img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.06); }
.login-hero .brand-logo { width: 84px; height: 84px; }
.login-hero .brand-name { font-size: 22px; }
.brand-name { font-weight: 800; font-size: 18px; line-height: 1.1; letter-spacing: .3px; }
.brand-name small { display: block; font-weight: 500; font-size: 12px; color: #fbbf24; letter-spacing: 0; }

/* ---------------- LAYOUT ---------------- */
.app { display: grid; grid-template-columns: 250px 1fr; height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #cbd5e1; display: flex; flex-direction: column; padding: 22px 14px; overflow-y: auto; z-index: 40;
}
.sidebar .brand { padding: 4px 10px 26px; color: #fff; }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; color: #cbd5e1; font-weight: 500; transition: .15s;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: linear-gradient(90deg, var(--navy-3), rgba(37,99,235,.35)); color: #fff; box-shadow: inset 3px 0 0 #60a5fa; }
.nav a.active svg { color: #60a5fa; }
.nav .nav-badge { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.08); padding-top: 14px; margin-top: 14px; }
.sidebar-foot a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; color: #fca5a5; cursor: pointer; }
.sidebar-foot a:hover { background: rgba(239,68,68,.12); }

.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.topbar {
  height: 64px; flex-shrink: 0; background: var(--card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px; padding: 0 28px;
}
.topbar .spacer { flex: 1; }
.topbar .hotel { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--text);
  display: inline-grid; place-items: center; cursor: pointer; position: relative; transition: .15s;
}
.icon-btn:hover { background: var(--gray-soft); }
.icon-btn .dot { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--navy-2); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.user-chip .who { line-height: 1.2; }
.user-chip .who small { color: var(--muted); display: block; font-size: 12px; }
.menu-toggle { display: none; }

.content { flex: 1; overflow-y: auto; padding: 26px 28px 40px; }

/* ---------------- PAGE ---------------- */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 700; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.date-pill { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--border); padding: 9px 14px; border-radius: 10px; font-weight: 600; box-shadow: var(--shadow); }
.date-pill svg { color: var(--blue); }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h2 { font-size: 16px; font-weight: 700; }
.muted { color: var(--muted); }
.link { font-weight: 600; font-size: 13px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-2 > .card { margin-bottom: 20px; }
.grid-2.wide-left { grid-template-columns: 2fr 1fr; }
.stats.three { grid-template-columns: repeat(3, 1fr); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* Stat cards */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 20px; }
.stat {
  border-radius: var(--radius); padding: 20px; color: #fff; display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255,255,255,.1); }
.stat .stat-ic { width: 52px; height: 52px; border-radius: 12px; background: rgba(255,255,255,.18); display: grid; place-items: center; }
.stat .stat-ic svg { width: 28px; height: 28px; }
.stat b { font-size: 30px; display: block; line-height: 1; }
.stat span { opacity: .92; font-size: 14px; }
.stat.blue { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.stat.green { background: linear-gradient(135deg, #16a34a, #0f8a3e); }
.stat.orange { background: linear-gradient(135deg, #f59e0b, #ea8a04); }
.stat.red { background: linear-gradient(135deg, #ef4444, #dc2626); }
.stat.purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.stat.navy { background: linear-gradient(135deg, #1b3a6b, #0a1630); }

/* light KPI cards */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); border-left: 4px solid var(--blue); }
.kpi small { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: .4px; }
.kpi b { display: block; font-size: 22px; margin-top: 6px; }
.kpi.green { border-color: var(--green); } .kpi.red { border-color: var(--red); } .kpi.orange { border-color: var(--orange); } .kpi.purple { border-color: var(--purple); }

/* Donut */
.occ { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.donut-wrap { position: relative; width: 170px; height: 170px; flex-shrink: 0; }
.donut { width: 100%; height: 100%; }
.donut-bg { fill: none; stroke: #e2e8f0; stroke-width: 16; }
.donut-fg { fill: none; stroke: url(#donutGrad); stroke-width: 16; stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-center b { font-size: 32px; }
.donut-center small { color: var(--muted); font-size: 11px; }
.legend-list { flex: 1; min-width: 180px; }
.legend-list h4 { font-size: 13px; margin-bottom: 10px; }
.legend-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.legend-row:last-child { border: 0; }
.legend-row b { margin-left: auto; }
.dot-s { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-s.green { background: var(--green); } .dot-s.red { background: var(--red); } .dot-s.orange { background: var(--orange); }
.dot-s.purple { background: var(--purple); } .dot-s.blue { background: var(--blue); } .dot-s.gray { background: var(--gray); }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 6px; }

/* Today list */
.today-list { display: flex; flex-direction: column; }
.today-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.today-item:last-child { border: 0; }
.today-item .time { font-weight: 700; width: 48px; }
.today-item .who { flex: 1; min-width: 0; }
.today-item .who small { display: block; color: var(--muted); font-size: 12px; }
.today-item svg.ic { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 26px 10px; }
.empty svg { width: 34px; height: 34px; color: #cbd5e1; display: block; margin: 0 auto 8px; }

/* Room tiles (dashboard) */
.room-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.room-tile {
  border: 0; border-radius: 12px; padding: 16px 8px; color: #fff; cursor: pointer; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform .15s, box-shadow .15s; min-height: 96px; justify-content: center;
}
.room-tile:hover { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(15,23,42,.18); }
.room-tile strong { font-size: 22px; }
.room-tile span { font-size: 12px; font-weight: 600; opacity: .9; letter-spacing: .5px; }
.room-tile em { font-style: normal; font-size: 11px; opacity: .9; margin-top: 4px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-tile.green { background: var(--green); } .room-tile.red { background: var(--red); }
.room-tile.orange { background: var(--orange); } .room-tile.purple { background: var(--purple); }

/* Room cards (mapa) */
.room-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.room-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.room-card .rc-top { padding: 18px 20px; color: #fff; display: flex; align-items: center; justify-content: space-between; }
.room-card .rc-top b { font-size: 26px; }
.room-card .rc-top small { display: block; opacity: .9; }
.room-card .rc-top.green { background: linear-gradient(135deg, #16a34a, #0f8a3e); }
.room-card .rc-top.red { background: linear-gradient(135deg, #ef4444, #dc2626); }
.room-card .rc-top.orange { background: linear-gradient(135deg, #f59e0b, #ea8a04); }
.room-card .rc-top.purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.rc-status { background: rgba(255,255,255,.22); padding: 5px 12px; border-radius: 99px; font-weight: 600; font-size: 12px; }
.rc-body { padding: 16px 20px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.rc-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; background: var(--gray-soft); border-radius: 10px; padding: 10px; }
.rc-info small { color: var(--muted); display: block; font-size: 11px; }
.rc-guest { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.rc-guest small { color: var(--muted); display: block; font-size: 11px; text-transform: uppercase; font-weight: 600; letter-spacing: .3px; }
.rc-actions { padding: 0 20px 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.seg { display: flex; background: var(--gray-soft); border-radius: 10px; padding: 3px; gap: 3px; width: 100%; }
.seg button { flex: 1; border: 0; background: transparent; padding: 7px 4px; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button:hover { color: var(--text); }
.seg button.on.green { background: var(--green); color: #fff; } .seg button.on.orange { background: var(--orange); color: #fff; }
.seg button.on.purple { background: var(--purple); color: #fff; } .seg button.on.red { background: var(--red); color: #fff; }

/* ---------------- BUTTONS / BADGES ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px;
  border: 1px solid transparent; font-weight: 600; font-size: 14px; cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; height: 46px; font-size: 15px; }
.btn.primary { background: var(--blue); color: #fff; } .btn.primary:hover { background: #1d4ed8; }
.btn.success { background: var(--green); color: #fff; } .btn.success:hover { filter: brightness(.95); }
.btn.danger { background: var(--red); color: #fff; } .btn.danger:hover { filter: brightness(.95); }
.btn.warning { background: var(--orange); color: #fff; }
.btn.ghost { background: var(--card); border-color: var(--border); color: var(--text); } .btn.ghost:hover { background: var(--gray-soft); }
.btn.soft-green { background: var(--green-soft); color: #0f7a3c; } .btn.soft-green:hover { background: #c4efd6; }
.btn.soft-blue { background: var(--blue-soft); color: #1d4ed8; } .btn.soft-blue:hover { background: #c7dbfd; }
.btn.soft-red { background: var(--red-soft); color: #b91c1c; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.blue { background: var(--blue-soft); color: #1d4ed8; }
.badge.green { background: var(--green-soft); color: #0f7a3c; }
.badge.orange { background: var(--orange-soft); color: #b45309; }
.badge.red { background: var(--red-soft); color: #b91c1c; }
.badge.purple { background: var(--purple-soft); color: #6d28d9; }
.badge.gray { background: var(--gray-soft); color: #475569; }

.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-actions .icon-btn { width: 32px; height: 32px; border: 1px solid var(--border); }
.row-actions .icon-btn svg { width: 16px; height: 16px; }
.row-actions .icon-btn.ok { color: var(--green); } .row-actions .icon-btn.out { color: var(--blue); }
.row-actions .icon-btn.del { color: var(--red); }

/* ---------------- TABLE ---------------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 38px !important; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 600; padding: 10px 12px; background: var(--gray-soft); white-space: nowrap; }
th:first-child { border-radius: 8px 0 0 8px; } th:last-child { border-radius: 0 8px 8px 0; }
td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:hover td { background: #fafcff; }
td small { color: var(--muted); display: block; font-size: 12px; }
.t-right { text-align: right; }
.val-in { color: var(--green); font-weight: 700; } .val-out { color: var(--red); font-weight: 700; }

/* ---------------- FORMS ---------------- */
.input, input.input, select.input, textarea.input,
.form-grid input, .form-grid select, .form-grid textarea {
  width: 100%; height: 40px; border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; font-size: 14px;
  font-family: inherit; color: var(--text); background: #fff; outline: none; transition: .15s;
}
textarea.input, .form-grid textarea { height: 76px; padding: 10px 12px; resize: vertical; }
.input:focus, .form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
select.input { width: auto; min-width: 150px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: #334155; }
.form-grid .span2 { grid-column: 1 / -1; }
.form-grid .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.total-box { background: var(--gray-soft); border-radius: 10px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.total-box b { font-size: 20px; color: var(--blue); }
.form-error { background: var(--red-soft); color: #b91c1c; padding: 10px 12px; border-radius: 8px; font-size: 13px; }
.hidden { display: none !important; }
.form-section { margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--border); }

.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; background: var(--gray-soft); padding: 14px; border-radius: 10px; margin-bottom: 4px; }
.summary small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; font-weight: 600; }

/* ---------------- MODAL ---------------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 22, 48, .55); display: grid; place-items: center; padding: 20px; z-index: 100; animation: fade .15s; backdrop-filter: blur(2px); }
.modal { background: var(--card); border-radius: 16px; width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 25px 60px rgba(0,0,0,.3); animation: pop .18s ease; }
.modal.wide { max-width: 760px; }
.modal.small { max-width: 420px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.status-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.status-options label { border: 2px solid var(--border); border-radius: 12px; padding: 14px; cursor: pointer; display: flex; align-items: center; gap: 10px; font-weight: 600; }
.status-options input { display: none; }
.status-options label:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }

/* ---------------- TOAST ---------------- */
#toast-root { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast { background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 380px; animation: pop .2s; border-left: 4px solid var(--green); }
.toast.error { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--orange); }

/* ---------------- TIMELINE ---------------- */
.timeline { overflow-x: auto; }
.tl-inner { min-width: 760px; }
.tl-row { display: grid; grid-template-columns: 90px 1fr; border-bottom: 1px solid var(--border); }
.tl-row:last-child { border-bottom: 0; }
.tl-label { padding: 10px 8px; display: flex; flex-direction: column; justify-content: center; }
.tl-label small { color: var(--muted); font-size: 11px; }
.tl-days { display: grid; grid-template-columns: repeat(14, 1fr); grid-template-rows: 48px; position: relative; }
.tl-head .tl-days { grid-template-rows: auto; }
.tl-day { text-align: center; padding: 6px 0; font-size: 12px; color: var(--muted); border-radius: 8px; }
.tl-day b { display: block; color: var(--text); font-size: 14px; }
.tl-day.wknd { background: #f8fafc; }
.tl-day.today { background: var(--blue); color: #dbeafe; }
.tl-day.today b { color: #fff; }
.tl-cell { grid-row: 1; border-left: 1px dashed var(--border); cursor: pointer; transition: background .1s; }
.tl-cell:hover { background: var(--blue-soft); }
.tl-cell.today { background: rgba(37,99,235,.05); }
.tl-bar {
  grid-row: 1; align-self: center; height: 32px; margin: 0 3px; border-radius: 8px; color: #fff; font-size: 12px; font-weight: 600;
  display: flex; align-items: center; padding: 0 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; z-index: 1;
  box-shadow: 0 2px 6px rgba(15,23,42,.15);
}
.tl-bar:hover { filter: brightness(1.08); }
.tl-bar.blue { background: var(--blue); } .tl-bar.green { background: var(--green); } .tl-bar.gray { background: var(--gray); }

/* ---------------- CHARTS ---------------- */
.bars { display: flex; align-items: flex-end; gap: 18px; height: 220px; padding: 10px 4px 0; border-bottom: 1px solid var(--border); }
.bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.bar-pair { display: flex; align-items: flex-end; gap: 4px; height: 100%; width: 100%; justify-content: center; }
.bar { width: 100%; max-width: 26px; border-radius: 6px 6px 0 0; min-height: 2px; position: relative; transition: height .6s ease; }
.bar.in { background: var(--green); } .bar.out { background: var(--red); } .bar.occ { background: var(--blue); max-width: 40px; }
.bar:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; font-size: 11px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; z-index: 5; }
.bar-labels { display: flex; gap: 18px; padding: 8px 4px 0; }
.bar-labels span { flex: 1; text-align: center; font-size: 12px; color: var(--muted); text-transform: capitalize; }
.hbar { display: grid; grid-template-columns: 90px 1fr 52px; align-items: center; gap: 12px; padding: 7px 0; }
.hbar-track { height: 12px; border-radius: 99px; background: var(--gray-soft); overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #3b82f6, #14b8a6); }
.hbar b { text-align: right; }

/* ---------------- MISC ---------------- */
.list-plain { display: flex; flex-direction: column; }
.list-plain .li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.list-plain .li:last-child { border: 0; }
.list-plain .li .grow { flex: 1; min-width: 0; }
.list-plain .li small { display: block; color: var(--muted); font-size: 12px; }
.room-num { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--navy-2); flex-shrink: 0; }
.room-num.name { width: 76px; font-size: 13px; font-weight: 700; padding: 0 6px; text-align: center; }
.fin-mini { display: grid; gap: 12px; }
.fin-mini div { display: flex; justify-content: space-between; padding: 12px 14px; border-radius: 10px; background: var(--gray-soft); }
.fin-mini div b { font-size: 16px; }
.overlay { display: none; }

/* ---------------- NUVEM ---------------- */
.tela-carregando { display: none; position: fixed; inset: 0; z-index: 90; background: linear-gradient(160deg, var(--navy), var(--navy-2)); color: #e2e8f0; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; padding: 24px; }
.tela-carregando .brand-logo { width: 96px; height: 96px; animation: pulsar 1.6s ease-in-out infinite; }
.tela-carregando p { margin: 0; font-size: 15px; line-height: 1.6; }
.tela-carregando small { color: #94a3b8; }
body.carregando .tela-carregando { display: flex; }
@keyframes pulsar { 50% { transform: scale(.94); opacity: .8; } }
.sync { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; padding: 6px 11px; border-radius: 99px; background: var(--gray-soft); color: var(--muted); white-space: nowrap; }
.sync i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.sync.ok { color: #0f6b35; background: var(--green-soft); }
.sync.busy { color: #b45309; background: var(--orange-soft); } .sync.busy i { background: var(--orange); animation: pulsar 1s infinite; }
.sync.off { color: #b91c1c; background: var(--red-soft); } .sync.off i { background: var(--red); }
.mobile-brand { display: none; margin-bottom: 22px; }
.mobile-brand .brand-logo { width: 52px; height: 52px; }
.mobile-brand .brand-name { color: var(--navy); font-size: 17px; }
.mobile-brand .brand-name small { color: var(--muted); }

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 1200px) {
  .room-strip { grid-template-columns: repeat(3, 1fr); }
  .room-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-2.wide-left, .grid-3 { grid-template-columns: 1fr; }
  .stats.three { grid-template-columns: 1fr 1fr 1fr; }
  .login-page { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .mobile-brand { display: flex; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: none; }
  .overlay.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 30; }
  .menu-toggle { display: inline-grid; }
  .topbar { padding: 0 14px; }
  .content { padding: 18px 14px 40px; }
  .user-chip .who { display: none; }
  .room-cards { grid-template-columns: 1fr; }
  .form-grid, .summary { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat { padding: 14px; gap: 10px; }
  .stat .stat-ic { width: 40px; height: 40px; }
  .stat b { font-size: 24px; }
  .room-strip { grid-template-columns: repeat(2, 1fr); }
  .topbar .hotel span { display: none; }
  .sync span { display: none; }
  .sync { padding: 8px; }
  .login-box { padding: 16px; }
  .login-card { padding: 28px 22px; }
}

@media print {
  .sidebar, .topbar, .page-head .actions, .no-print { display: none !important; }
  .app { display: block; height: auto; }
  .main, .content { height: auto; overflow: visible; }
  .card { box-shadow: none; border: 1px solid var(--border); break-inside: avoid; }
}
