/* Console do Gestor — Aurora Concierge (tema escuro estilo SaaS) */
:root {
  --bg: #0b0d1a;
  --bg-2: #10132a;
  --panel: #141834;
  --panel-2: #191e40;
  --line: #262b52;
  --text: #e9ebff;
  --muted: #8d93c2;
  --dim: #5e6493;
  --brand: #7c6cf0;
  --brand-2: #a08cff;
  --ok: #2fd18a;
  --warn: #f5b649;
  --err: #ff6b81;
  --info: #5ab0ff;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand-2); }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.side {
  background: linear-gradient(180deg, #0f1230 0%, #0b0d1a 100%);
  border-right: 1px solid var(--line);
  padding: 18px 12px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; padding: 4px 10px 18px; }
.logo .mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), #4fc3ff); font-size: 16px; }
.nav-group { color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px;
  color: var(--muted); text-decoration: none; cursor: pointer; font-weight: 500;
}
.nav a:hover { background: var(--panel); color: var(--text); }
.nav a.active { background: var(--panel-2); color: var(--text); box-shadow: inset 3px 0 0 var(--brand); }
.nav a .ico { width: 18px; text-align: center; opacity: .9; }
.side .foot { margin-top: 18px; padding: 10px; color: var(--dim); font-size: 12px; }

.main { min-width: 0; }
.top {
  display: flex; align-items: center; gap: 12px; padding: 14px 26px; border-bottom: 1px solid var(--line);
  background: rgba(11, 13, 26, .85); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5;
}
.top h1 { font-size: 22px; margin: 0; }
.crumbs { color: var(--dim); font-size: 13px; }
.top .grow { flex: 1; }
.search { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; width: 260px; }
.content { padding: 22px 26px 60px; }
.burger { display: none; }

/* ---------- elementos ---------- */
.btn {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; white-space: nowrap;
}
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-2); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--err); }
.btn.sm { padding: 6px 12px; font-size: 14px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: progress; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
}
.card h3 { margin: 0 0 4px; font-size: 17px; }
.card .sub { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.hero {
  background: radial-gradient(120% 140% at 0% 0%, #8f7bff 0%, #6a55e8 45%, #4b3cc4 100%);
  border: 0; color: #fff; box-shadow: var(--shadow);
}
.hero .label { opacity: .85; font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; }
.hero .big { font-size: 38px; font-weight: 800; margin: 2px 0; }
.hero .mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; }
.hero .mini div { background: rgba(255, 255, 255, .12); border-radius: 10px; padding: 10px; }
.hero .mini b { display: block; font-size: 18px; }
.kpi .v { font-size: 30px; font-weight: 800; }
.kpi .l { color: var(--muted); font-size: 14px; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: rgba(124, 108, 240, .15); color: var(--brand-2); }
.pill.ok { background: rgba(47, 209, 138, .14); color: var(--ok); }
.pill.warn { background: rgba(245, 182, 73, .14); color: var(--warn); }
.pill.err { background: rgba(255, 107, 129, .14); color: var(--err); }
.pill.info { background: rgba(90, 176, 255, .14); color: var(--info); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.mt { margin-top: 16px; }
.hidden { display: none !important; }

table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; color: var(--dim); font-weight: 600; font-size: 13.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.t td { padding: 10px; border-bottom: 1px solid #1d2247; vertical-align: middle; }
.t tr.click:hover td { background: var(--panel-2); cursor: pointer; }
.t td.num { text-align: right; font-variant-numeric: tabular-nums; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.bar { height: 6px; background: #20264f; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ok); }

label.f { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.in, select.in, textarea.in {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; color: var(--text); width: 100%;
}
.in:focus { outline: none; border-color: var(--brand); }
textarea.in { min-height: 110px; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 14px; }

/* ---------- quadro de prédios (arrastar e soltar) ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 300px); gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.col { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 190px); }
.col.lib { background: #11142c; border-style: dashed; }
.col-h { padding: 14px 14px 10px; border-bottom: 1px solid var(--line); }
.col-h .t1 { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.col-h .t2 { color: var(--dim); font-size: 13.5px; margin-top: 2px; }
.drop { padding: 10px; display: grid; gap: 8px; overflow-y: auto; min-height: 120px; flex: 1; border-radius: 0 0 var(--radius) var(--radius); }
.drop.over { background: rgba(124, 108, 240, .12); outline: 2px dashed var(--brand); outline-offset: -6px; }
.chip {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px; padding: 10px 11px; cursor: grab;
  display: grid; grid-template-columns: 6px 1fr auto; gap: 10px; align-items: center; user-select: none;
}
.chip:active { cursor: grabbing; }
.chip.dragging { opacity: .4; }
.chip .stripe { width: 6px; height: 100%; border-radius: 6px; min-height: 30px; }
.chip .n { font-weight: 600; font-size: 15px; }
.chip .s { color: var(--dim); font-size: 13px; }
.chip .x { background: none; border: 0; color: var(--dim); cursor: pointer; font-size: 16px; padding: 2px 4px; }
.chip .x:hover { color: var(--err); }
.empty { color: var(--dim); font-size: 14px; text-align: center; padding: 18px 8px; }

/* ---------- gaveta de edição ---------- */
.drawer-bg { position: fixed; inset: 0; background: rgba(4, 5, 14, .6); z-index: 20; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(1040px, 100%); background: var(--bg-2);
  border-left: 1px solid var(--line); z-index: 21; display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.drawer-h { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.drawer-h h2 { margin: 0; font-size: 21px; }
.tabs { display: flex; gap: 4px; padding: 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 12px 12px; color: var(--muted); cursor: pointer; font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--text); border-bottom-color: var(--brand); }
.drawer-b { padding: 20px 22px; overflow-y: auto; flex: 1; }
.drawer-f { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }

.agent { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 18px; color: #fff; }
.toggles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tg { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.tg .d { color: var(--dim); font-size: 13.5px; }
.sw { position: relative; width: 42px; height: 24px; flex: none; }
.sw input { opacity: 0; width: 0; height: 0; }
.sw span { position: absolute; inset: 0; background: #2a2f5c; border-radius: 99px; transition: .15s; cursor: pointer; }
.sw span::after { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .15s; }
.sw input:checked + span { background: var(--ok); }
.sw input:checked + span::after { transform: translateX(18px); }

.log { background: #070912; border: 1px solid var(--line); border-radius: 10px; padding: 12px; font: 13.5px/1.55 ui-monospace, Consolas, monospace;
  white-space: pre-wrap; max-height: 420px; overflow: auto; color: #b9c0ff; }
.issue { display: flex; gap: 8px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid #1d2247; }

/* modal */
.modal { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(4, 5, 14, .65); z-index: 30; padding: 16px; }
.modal .box { background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; width: min(560px, 100%); padding: 22px; box-shadow: var(--shadow); max-height: 90vh; overflow: auto; }
.modal h3 { margin: 0 0 14px; }

.toast { position: fixed; bottom: 18px; right: 18px; z-index: 40; display: grid; gap: 8px; }
.toast div { background: var(--panel-2); border: 1px solid var(--line); border-left: 4px solid var(--ok); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); max-width: 420px; }
.toast div.err { border-left-color: var(--err); }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .box { width: min(400px, 100%); }

@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 25; left: -260px; width: 240px; transition: left .2s; }
  .side.open { left: 0; }
  .burger { display: inline-block; }
  .g4, .g3, .g2, .toggles { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .top { padding: 12px 16px; }
  .search { display: none; }
  .hero .mini { grid-template-columns: 1fr 1fr; }
}
.hero .dim, .hero .muted, .hero .sub { color: #e6e0ff !important; }

/* ---------- gráficos ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: #232853; stroke-width: 1; }
.chart .ax { fill: var(--dim); font-size: 13px; }
.chart .ax.strong { fill: var(--text); font-weight: 700; }
.chart .limit { stroke: var(--err); stroke-width: 2; stroke-dasharray: 5 5; }
.chart .limit-t { fill: var(--err); font-weight: 700; }
.donut-t { fill: var(--text); font-size: 18px; font-weight: 800; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 14px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.hbars { display: grid; gap: 9px; }
.hbar { display: grid; grid-template-columns: minmax(120px, 34%) 1fr auto; gap: 10px; align-items: center; font-size: 14.5px; }
.hbar .hl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .ht { height: 12px; background: #1c2148; border-radius: 99px; overflow: hidden; }
.hbar .ht i { display: block; height: 100%; border-radius: 99px; }
.hbar .hv { font-variant-numeric: tabular-nums; font-weight: 700; }
.meter { position: relative; height: 22px; background: #1c2148; border-radius: 8px; overflow: hidden; min-width: 120px; }
.meter i { position: absolute; inset: 0 auto 0 0; border-radius: 8px; }
.meter b { position: relative; display: block; text-align: center; font-size: 13px; line-height: 22px; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { background: none; border: 0; color: var(--muted); padding: 7px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.seg button.on { background: var(--brand); color: #fff; }
.advice { display: grid; gap: 8px; }
.advice .a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: var(--panel-2); border-radius: 10px; border-left: 4px solid var(--info); }
.advice .a.warn { border-left-color: var(--warn); } .advice .a.err { border-left-color: var(--err); } .advice .a.ok { border-left-color: var(--ok); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.gallery .gi { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #000; }
.gallery .row { padding: 8px; gap: 6px; }
.preview-cloud { width: 100%; aspect-ratio: 1; max-width: 360px; border-radius: 18px; background: #000; display: block; }
.funnel { display: grid; gap: 8px; }
.funnel div { padding: 10px 14px; border-radius: 10px; background: linear-gradient(90deg, rgba(124,108,240,.55), rgba(124,108,240,.15)); font-weight: 600; }
.manual { line-height: 1.7; max-width: 900px; }
.manual h2 { font-size: 24px; margin: 0 0 12px; } .manual h3 { font-size: 19px; margin: 22px 0 8px; color: var(--brand-2); }
.manual ul { padding-left: 22px; } .manual li { margin: 4px 0; } .manual code { background: var(--bg-2); padding: 1px 6px; border-radius: 6px; }
