:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-soft: #f1f7f8;
  --ink: #18202b;
  --muted: #667081;
  --line: #e0e5ee;
  --brand: #7d2cc7;
  --brand-dark: #42116d;
  --accent: #25c6c8;
  --accent-dark: #077d89;
  --warning: #a86512;
  --warning-bg: #fff6df;
  --success: #0b807b;
  --success-bg: #e4f8f6;
  --danger: #a13c69;
  --danger-bg: #fff0f6;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 0%, rgba(125,44,199,.12), transparent 28%),
    radial-gradient(circle at 96% 6%, rgba(37,198,200,.16), transparent 30%),
    var(--bg);
  color: var(--ink);
}
button, select { font: inherit; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 280px 1fr; }
.sidebar {
  background: linear-gradient(180deg, #1d0d35 0%, #21113b 48%, #083f49 100%);
  color: #f5fbff;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
  box-shadow: 18px 0 42px rgba(24, 18, 53, .18);
}
.brand { display: flex; gap: 13px; align-items: center; min-width: 0; }
.brand-logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255,255,255,.96);
  padding: 5px;
  box-shadow: 0 12px 28px rgba(0,0,0,.18);
}
.brand strong, .brand span { display: block; }
.brand strong { letter-spacing: 0; }
.brand span, .sidebar-footer span { color: #c6d2df; font-size: 13px; margin-top: 2px; }
.nav-list { display: grid; gap: 8px; }
.nav-item {
  color: #edf5fa;
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
}
.nav-item.active, .nav-item:hover {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.13);
  color: #ffffff;
}
.icon { width: 24px; height: 24px; display: grid; place-items: center; background: rgba(37,198,200,.18); border-radius: 6px; }
.sidebar-footer { margin-top: auto; padding: 14px; border: 1px solid rgba(255,255,255,.14); border-radius: 8px; background: rgba(255,255,255,.07); }
.sidebar-footer strong { display: block; margin-top: 6px; font-size: 14px; line-height: 1.35; }
.main-content { padding: 28px; display: grid; gap: 22px; max-width: 1440px; width: 100%; }
.topbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
h1, h2, p { margin: 0; }
h1 { font-size: 30px; line-height: 1.15; color: #201a2f; }
h2 { font-size: 18px; }
.eyebrow { color: var(--accent-dark); font-size: 12px; font-weight: 800; letter-spacing: 0; text-transform: uppercase; margin-bottom: 5px; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.icon-button, .primary-button, .report-actions button { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; min-height: 42px; padding: 0 14px; cursor: pointer; }
.icon-button { width: 42px; padding: 0; font-size: 20px; color: var(--brand); }
.primary-button { background: linear-gradient(135deg, var(--brand) 0%, var(--accent-dark) 100%); color: white; border-color: transparent; font-weight: 700; box-shadow: 0 10px 22px rgba(62, 30, 126, .18); }
.primary-button:hover { filter: brightness(.96); }
.filters { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 12px; }
.filters label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
.filters select { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; min-height: 42px; padding: 0 12px; color: var(--ink); }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric, .panel { background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 28px rgba(47, 34, 74, .07); }
.metric { padding: 18px; display: grid; gap: 8px; position: relative; overflow: hidden; }
.metric::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--brand), var(--accent)); }
.metric span, .metric small { color: var(--muted); }
.metric strong { font-size: 28px; line-height: 1; }
.metric.warning { background: var(--warning-bg); border-color: #efd38a; }
.metric.warning strong { color: var(--warning); }
.metric.success { background: var(--success-bg); border-color: #b9e8e4; }
.metric.success strong { color: var(--success); }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, .9fr); gap: 14px; align-items: start; }
.panel { padding: 18px; min-width: 0; }
.panel.wide { min-height: 350px; }
.panel-header { display: flex; justify-content: space-between; gap: 12px; align-items: start; margin-bottom: 18px; }
.status-pill { color: var(--brand-dark); background: #f1e9fb; border: 1px solid #dcc8f4; border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.bar-chart { width: 100%; max-width: 100%; height: 255px; display: flex; align-items: end; gap: 6px; padding-top: 24px; border-bottom: 1px solid var(--line); overflow: hidden; }
.bar { flex: 1 1 0; min-width: 0; display: grid; align-items: end; gap: 7px; height: 100%; }
.bar-fill { width: 100%; background: linear-gradient(180deg, #8b32d1 0%, #25c6c8 100%); border-radius: 6px 6px 0 0; min-height: 12px; position: relative; box-shadow: inset 0 1px 0 rgba(255,255,255,.35); }
.bar-fill:hover::after { content: attr(data-value); position: absolute; left: 50%; bottom: calc(100% + 7px); transform: translateX(-50%); background: #201a2f; color: #fff; font-size: 12px; padding: 5px 7px; border-radius: 6px; white-space: nowrap; }
.bar-label { text-align: center; font-size: 11px; color: var(--muted); overflow: hidden; }
.category-list, .alert-list, .insight-list { display: grid; gap: 12px; }
.insight-list div { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(180deg, #ffffff, #f5fbfb); }
.insight-list span { color: var(--muted); font-size: 13px; font-weight: 700; }
.insight-list strong { color: var(--ink); text-align: right; }
.category-row { display: grid; gap: 6px; }
.category-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.progress { height: 8px; background: var(--surface-soft); border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: inherit; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 690px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0; }
.badge { display: inline-flex; align-items: center; min-height: 26px; border-radius: 999px; padding: 0 9px; font-size: 12px; font-weight: 800; }
.badge.review { background: var(--warning-bg); color: var(--warning); }
.badge.ok { background: var(--success-bg); color: var(--success); }
.badge.payable { white-space: nowrap; }
.badge.lancado { background: #edf5ff; color: #28619d; }
.badge.a-vencer { background: var(--warning-bg); color: var(--warning); }
.badge.pago { background: var(--success-bg); color: var(--success); }
.badge.atrasado { background: var(--danger-bg); color: var(--danger); }
.badge.conferencia { background: #f1e9fb; color: var(--brand-dark); }
.alert { border-left: 4px solid var(--warning); padding: 12px; background: var(--warning-bg); border-radius: 8px; }
.alert.high { border-color: var(--danger); background: var(--danger-bg); }
.alert strong { display: block; margin-bottom: 4px; }
.alert span { color: var(--muted); font-size: 13px; line-height: 1.45; }
.reports { margin-bottom: 28px; }
.report-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.report-actions button { text-align: left; font-weight: 700; background: linear-gradient(180deg, #ffffff, #f2f8f8); }
@media (max-width: 1040px) { .app-shell { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; } .nav-list { grid-template-columns: repeat(6, minmax(0, 1fr)); } .nav-item { justify-content: center; flex-wrap: wrap; text-align: center; } .metrics-grid, .content-grid, .report-actions { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .main-content { padding: 18px; } .topbar { align-items: stretch; flex-direction: column; } .filters, .metrics-grid, .content-grid, .report-actions, .nav-list { grid-template-columns: 1fr; } h1 { font-size: 25px; } .metric strong { font-size: 24px; } .bar-chart { gap: 4px; } .bar-label { font-size: 10px; } }


.is-hidden { display: none !important; }
.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .72fr);
  gap: 34px;
  align-items: center;
  padding: 46px;
  background:
    radial-gradient(circle at 14% 10%, rgba(125,44,199,.18), transparent 28%),
    radial-gradient(circle at 82% 78%, rgba(37,198,200,.20), transparent 30%),
    linear-gradient(135deg, #f9fbff 0%, #eff7f8 100%);
}
.login-brand-panel {
  min-height: 620px;
  border-radius: 8px;
  padding: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, #1d0d35 0%, #361158 48%, #064d59 100%);
  color: white;
  box-shadow: 0 24px 64px rgba(48, 33, 84, .22);
}
.login-brand-panel::after {
  content: "";
  position: absolute;
  width: 380px;
  height: 380px;
  right: -120px;
  bottom: -90px;
  background: radial-gradient(circle, rgba(37,198,200,.32), transparent 62%);
}
.login-brand-panel img {
  width: 112px;
  height: 112px;
  object-fit: contain;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 18px 36px rgba(0,0,0,.24);
  margin-bottom: 34px;
}
.login-brand-panel .eyebrow { color: #65f0ee; }
.login-brand-panel h1 {
  color: #ffffff;
  font-size: 44px;
  max-width: 760px;
  line-height: 1.05;
  margin-bottom: 18px;
}
.login-copy {
  color: #d8e5ec;
  max-width: 620px;
  font-size: 17px;
  line-height: 1.65;
}
.login-signal {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 34px;
  position: relative;
  z-index: 1;
  color: #f7fbff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}
.login-signal span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 7px rgba(37,198,200,.16);
}
.login-card {
  background: rgba(255,255,255,.95);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 24px 54px rgba(47, 34, 74, .12);
  display: grid;
  gap: 18px;
}
.login-card-header { display: grid; gap: 8px; }
.login-card-header h2 { font-size: 27px; color: #201a2f; }
.login-card-header p { color: var(--muted); line-height: 1.5; }
.secure-pill {
  justify-self: start;
  color: var(--accent-dark);
  background: #e6f8f7;
  border: 1px solid #bfe9e7;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}
.login-card label { display: grid; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 800; }
.login-card input[type="email"], .login-card input[type="password"] {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--ink);
  background: #ffffff;
  outline: none;
}
.login-card input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(125,44,199,.11); }
.login-options { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.checkbox-row { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 8px !important; font-weight: 700 !important; }
.checkbox-row input { accent-color: var(--brand); }
.link-button { border: 0; background: transparent; padding: 0; color: var(--brand); font-weight: 800; cursor: pointer; }
.login-submit {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent-dark) 100%);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(62,30,126,.18);
}
.login-submit:hover { filter: brightness(.96); }
.logout-button {
  margin-top: 12px;
  width: 100%;
  min-height: 36px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  color: #f8fdff;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}
@media (max-width: 920px) {
  .login-screen { grid-template-columns: 1fr; padding: 20px; }
  .login-brand-panel { min-height: auto; padding: 30px; }
  .login-brand-panel h1 { font-size: 32px; }
}
@media (max-width: 540px) {
  .login-card { padding: 20px; }
  .login-options { align-items: stretch; flex-direction: column; }
  .login-brand-panel img { width: 82px; height: 82px; }
}
