:root {
  --bg: #07090d;
  --bg-2: #0d1118;
  --panel: #121821;
  --panel-2: #18212c;
  --line: #243041;
  --text: #e8eef6;
  --muted: #8b97a8;
  --teal: #2ee6c8;
  --teal-dim: rgba(46, 230, 200, 0.14);
  --blue: #7aa2ff;
  --amber: #f0b429;
  --rose: #ff6b7a;
  --mint: #7dffb3;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font-family: "IBM Plex Sans", sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.hidden { display: none !important; }

.login-wrap {
  min-height: 100%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(46,230,200,0.12), transparent 50%),
    radial-gradient(800px 400px at 100% 0%, rgba(122,162,255,0.10), transparent 45%),
    var(--bg);
}
.login-card {
  width: min(420px, 92vw);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.brand { display: flex; gap: 14px; align-items: center; margin-bottom: 22px; }
.brand h1 { margin: 0; font-size: 22px; }
.brand p, .brand span { margin: 0; color: var(--muted); font-size: 13px; }
.logo {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #2ee6c8, #1a8f9a);
  color: #06221d; font-weight: 700; font-size: 20px;
}
.login-card label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0; }
.login-card input, .modal-card input, .modal-card select, main input, main select {
  width: 100%; margin-top: 6px; padding: 10px 12px;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--text); outline: none;
}
.login-card button, .btn {
  width: 100%; margin-top: 8px; padding: 11px 14px; border: 0; border-radius: 10px;
  background: var(--teal); color: #06221d; font-weight: 600;
}
.btn.small { width: auto; margin: 0; padding: 7px 10px; font-size: 13px; }
.btn.ghost, .ghost {
  background: transparent; color: var(--text); border: 1px solid var(--line);
}
.btn.danger { background: var(--rose); color: #2a0610; }
.error { color: var(--rose); min-height: 1.2em; font-size: 13px; }

.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100%; }
aside {
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  display: flex; flex-direction: column; gap: 18px;
}
.brand.compact { margin: 6px 8px 10px; }
.brand.compact strong { display: block; }
nav { display: flex; flex-direction: column; gap: 4px; }
nav button, .ghost {
  text-align: left; padding: 10px 12px; border-radius: 10px;
  border: 0; background: transparent; color: var(--muted);
}
nav button.active, nav button:hover { background: var(--teal-dim); color: var(--text); }
.aside-foot { margin-top: auto; padding: 8px; color: var(--muted); font-size: 13px; }
.aside-foot #who { margin-bottom: 8px; }

main { padding: 22px 28px 48px; }
.top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.top h2 { margin: 0 0 18px; font-size: 26px; }
.top-meta { color: var(--muted); font-size: 13px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}
.card h3 { margin: 0 0 6px; font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }
.card .n { font-family: "IBM Plex Mono", monospace; font-size: 26px; font-weight: 500; }
.card .sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.grid-2 { display: grid; grid-template-columns: 1.4fr .8fr; gap: 12px; margin-top: 12px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; }
.mono { font-family: "IBM Plex Mono", monospace; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; }
.pill.local { background: rgba(125,255,179,.12); color: var(--mint); }
.pill.paid { background: rgba(122,162,255,.12); color: var(--blue); }
.pill.off { background: rgba(255,107,122,.12); color: var(--rose); }
.pill.on { background: var(--teal-dim); color: var(--teal); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar input, .toolbar select { width: auto; min-width: 180px; }

.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 80px; gap: 8px; align-items: center; font-size: 12px; }
.bar { height: 8px; background: #1b2430; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--blue)); }

.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  display: grid; place-items: center; z-index: 20;
}
.modal-card {
  width: min(520px, 92vw); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 16px; padding: 20px;
}
.modal-card h3 { margin: 0 0 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.keybox {
  background: #0a1210; border: 1px dashed var(--teal); border-radius: 10px;
  padding: 10px; word-break: break-all; font-family: "IBM Plex Mono", monospace; font-size: 13px;
}

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  aside { flex-direction: row; flex-wrap: wrap; }
  .kpis, .grid-2 { grid-template-columns: 1fr; }
}
