@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #000;
  --fg: #fff;
  --muted: #909090;
  --faint: #5a5a5a;
  --line: #181818;
  --line-2: #242424;
  --surface: #0c0c0c;
  --danger: #e5575b;
  --ok: #5cc08a;
  --ls: -0.035em;          /* tracking base, mais confortavel que -7% */
  --ls-tight: -0.045em;    /* titulos grandes */
}
html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', -apple-system, sans-serif;
  letter-spacing: var(--ls);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button { font-family: inherit; letter-spacing: inherit; cursor: pointer; color: inherit; background: none; border: none; }
a { color: inherit; }
.hidden { display: none !important; }

/* ---------- buttons / fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 22px; border-radius: 12px; font-weight: 500; font-size: 16px;
  border: 1px solid var(--line-2); color: var(--fg); transition: .15s;
}
.btn svg { width: 19px; height: 19px; }
.btn:hover { border-color: #3a3a3a; }
.btn.primary { background: var(--fg); color: #000; border-color: var(--fg); font-weight: 600; }
.btn.primary:hover { opacity: .9; }
.btn.danger { color: var(--danger); border-color: #3a1d1f; }
.btn.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.block { width: 100%; }
.field {
  width: 100%; background: var(--surface); border: 1px solid var(--line-2);
  color: var(--fg); padding: 15px 16px; border-radius: 12px;
  font-family: inherit; letter-spacing: inherit; font-size: 16px;
}
.field::placeholder { color: var(--faint); }
.field:focus { outline: none; border-color: #3a3a3a; }
.msg { font-size: 14px; color: var(--muted); margin-top: 14px; min-height: 18px; }
.msg.ok { color: var(--ok); }
.msg.err { color: var(--danger); }

/* ---------- LOGIN ---------- */
#login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-box { width: 100%; max-width: 360px; text-align: center; }
.login-logo { height: 30px; width: auto; object-fit: contain; margin-bottom: 24px; }
#login p { color: var(--muted); font-size: 15px; margin-bottom: 26px; }
.login-box .field { text-align: center; margin-bottom: 12px; }
.login-box .btn { width: 100%; }

/* ---------- APP SHELL ---------- */
#app { display: grid; grid-template-columns: 286px 1fr; min-height: 100vh; }
.sidebar { padding: 40px 28px; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; margin-bottom: 44px; }
.brand img { height: 22px; width: auto; object-fit: contain; }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav button {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  color: var(--muted); font-size: 16px; font-weight: 500;
  padding: 11px 12px; border-radius: 10px; transition: .15s;
}
.nav button svg { width: 21px; height: 21px; color: var(--muted); flex: none; transition: .15s; }
.nav button:hover { background: var(--surface); color: #cfcfcf; }
.nav button:hover svg { color: #cfcfcf; }
.nav button.active { color: var(--fg); background: var(--surface); }
.nav button.active svg { color: var(--fg); }

.userbox { display: flex; align-items: center; gap: 12px; margin-top: 22px; padding: 10px 12px; border-radius: 10px; text-align: left; }
.userbox:hover { background: var(--surface); }
.userbox .avatar { width: 38px; height: 38px; border-radius: 10px; background: #1c1c1c; border: 1px solid var(--line-2); flex: none; }
.userbox .uinfo { display: flex; flex-direction: column; line-height: 1.3; overflow: hidden; }
.userbox .uname { font-size: 15px; color: var(--fg); }
.userbox .uemail { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- MAIN ---------- */
.main { padding: 56px 64px; overflow-y: auto; }
.crumb { font-size: 14px; color: var(--faint); margin-bottom: 8px; }
.crumb b { color: var(--muted); font-weight: 400; }
.title { font-size: 36px; font-weight: 700; letter-spacing: var(--ls-tight); margin-bottom: 36px; }

/* tabs (config) */
.tabs { display: flex; gap: 6px; margin-bottom: 40px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tabs button {
  display: flex; align-items: center; gap: 9px; color: var(--muted);
  font-size: 15px; font-weight: 500; padding: 12px 14px; margin-bottom: -1px;
  border-bottom: 1.5px solid transparent;
}
.tabs button svg { width: 18px; height: 18px; color: var(--muted); }
.tabs button:hover { color: #cfcfcf; }
.tabs button.active { color: var(--fg); border-bottom-color: var(--fg); }
.tabs button.active svg { color: var(--fg); }

/* panels */
.panel { max-width: 580px; }
.panel h3 { font-size: 19px; font-weight: 600; letter-spacing: var(--ls-tight); margin-bottom: 6px; }
.panel .sub { color: var(--muted); font-size: 15px; margin-bottom: 24px; }
.row { display: flex; justify-content: space-between; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.row:last-of-type { border-bottom: none; }
.row .k { color: var(--muted); }
.badge { font-size: 13px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); }
.badge.active { color: var(--ok); border-color: #1f3a2b; }
.badge.inactive, .badge.canceled, .badge.past_due { color: var(--danger); border-color: #3a1d1f; }
.stack { display: flex; flex-direction: column; gap: 14px; max-width: 380px; }
.hint { color: var(--muted); font-size: 14px; }

.danger-zone { margin-top: 40px; border: 1px solid #2a1517; border-radius: 14px; padding: 24px; }
.danger-zone h4 { color: var(--danger); font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.danger-zone p { color: var(--muted); font-size: 14px; margin-bottom: 18px; max-width: 440px; }

/* ---------- INICIO (hero) ---------- */
.hero { min-height: calc(100vh - 112px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.hero .logo { width: 72px; height: 72px; object-fit: cover; border-radius: 20px; margin-bottom: 28px; }
.hero h2 { font-size: 34px; font-weight: 700; letter-spacing: var(--ls-tight); margin-bottom: 12px; }
.hero p { color: var(--muted); font-size: 17px; max-width: 420px; margin-bottom: 32px; }
.hero .btn { padding: 16px 28px; font-size: 17px; }
.hero .status-pill { margin-top: 26px; display: inline-flex; align-items: center; gap: 9px; font-size: 14px; color: var(--muted); }
.hero .status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.hero .status-pill .dot.on { background: var(--ok); }
.linked-note { margin-top: 18px; font-size: 14px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.linked-note svg { width: 16px; height: 16px; color: var(--ok); }

@media (max-width: 760px) {
  #app { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; align-items: center; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--line); padding: 20px; }
  .brand { margin-bottom: 0; margin-right: auto; }
  .nav { flex-direction: row; flex: none; }
  .nav button span { display: none; }
  .userbox { margin-top: 0; }
  .userbox .uinfo { display: none; }
  .main { padding: 32px 22px; }
}
