/* Sistema Gestor — identidade visual única para landing, app das empresas e Super Admin */
:root {
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f1f3f6; --border: #e3e6eb; --text: #1b2330; --muted: #5f6b7a;
  --primary: #2357d9; --primary-ink: #ffffff; --primary-soft: #e8eefc; --success: #18794e; --success-soft: #e6f4ec;
  --warning: #9a6200; --warning-soft: #fff4dc; --danger: #c22a2a; --danger-soft: #fdeaea; --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px; color: var(--text); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; } h2 { font-size: 1.15rem; margin: 0 0 .75rem; } h3 { font-size: 1rem; margin: 0 0 .5rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- layout do app ---------- */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: #111827; color: #d1d5db; padding: 16px 10px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; padding: 6px 10px 16px; }
.sidebar .brand img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; background: #fff; }
.sidebar a { display: flex; align-items: center; gap: 10px; color: #d1d5db; padding: 9px 10px; border-radius: 8px; text-decoration: none; }
.sidebar a:hover { background: #1f2937; color: #fff; }
.sidebar a.active { background: var(--primary); color: #fff; }
.sidebar svg { width: 18px; height: 18px; flex: none; }
.sidebar .spacer { flex: 1; }
.main { padding: 24px 28px 48px; max-width: 1280px; width: 100%; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.btn.menu-toggle { display: none; margin-bottom: 12px; }
.banner { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.banner.warning { background: var(--warning-soft); color: var(--warning); } .banner.danger { background: var(--danger-soft); color: var(--danger); }
.banner.info { background: var(--primary-soft); color: var(--primary); }

/* ---------- componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; } .grid.k4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); } .grid.c2 { grid-template-columns: 1fr 1fr; }
.kpi .label { color: var(--muted); font-size: .85rem; } .kpi .value { font-size: 1.45rem; font-weight: 700; margin-top: 4px; } .kpi .sub { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 9px 14px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 40px; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); } .btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--danger); border-color: #f2c4c4; } .btn.danger:hover { background: var(--danger-soft); }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn.sm { padding: 5px 10px; min-height: 32px; font-size: .85rem; } .btn.link { border: 0; background: none; color: var(--primary); padding: 0; min-height: 0; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: .88rem; font-weight: 600; color: #344054; }
label.field .hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
input, select, textarea { font: inherit; padding: 9px 11px; border: 1px solid #cfd4dc; border-radius: 8px; background: #fff; color: var(--text); min-height: 40px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--primary); }
textarea { min-height: 90px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
table.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr.clickable { cursor: pointer; } .table tr.clickable:hover td { background: #fafbfd; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--success-soft); color: var(--success); } .badge.warn { background: var(--warning-soft); color: var(--warning); }
.badge.bad { background: var(--danger-soft); color: var(--danger); } .badge.info { background: var(--primary-soft); color: var(--primary); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; font: inherit; padding: 10px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 600; white-space: nowrap; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.chart { width: 100%; height: 180px; } .chart rect { fill: var(--primary); } .chart text { font-size: 10px; fill: var(--muted); }
.list-plain { list-style: none; padding: 0; margin: 0; } .list-plain li { padding: 8px 0; border-bottom: 1px solid var(--border); } .list-plain li:last-child { border: 0; }
.msg { padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); margin-bottom: 10px; white-space: pre-wrap; }
.msg.admin { background: var(--primary-soft); } .msg .meta { font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }
pre { background: var(--surface-2); padding: 12px; border-radius: 8px; overflow: auto; max-height: 420px; }

/* ---------- modal e avisos ---------- */
.overlay { position: fixed; inset: 0; background: rgba(17, 24, 39, .45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 720px; padding: 22px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.wide { max-width: 980px; }
.modal header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: #111827; color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); max-width: 380px; }
.toast.error { background: var(--danger); } .toast.success { background: var(--success); }

/* ---------- telas de acesso ---------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(160deg, #eef2fb, #f6f7f9); }
.auth .card { width: 100%; max-width: 420px; padding: 28px; }
.auth .logo { font-weight: 800; font-size: 1.2rem; color: var(--primary); margin-bottom: 18px; display: block; }

/* ---------- landing ---------- */
.lp-nav { display: flex; justify-content: space-between; align-items: center; padding: 16px 6vw; background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.lp-nav .logo { font-weight: 800; color: var(--primary); font-size: 1.15rem; }
.hero { padding: 72px 6vw 56px; background: linear-gradient(160deg, #eef2fb, #f6f7f9); }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); max-width: 760px; line-height: 1.15; }
.hero p { font-size: 1.15rem; color: var(--muted); max-width: 640px; }
.section { padding: 56px 6vw; } .section.alt { background: #fff; } .section h2 { font-size: 1.6rem; margin-bottom: 20px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.plan .price { font-size: 2rem; font-weight: 800; margin: 8px 0; } .plan ul { padding-left: 18px; color: var(--muted); }
.faq details { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
.faq summary { font-weight: 600; cursor: pointer; }
footer.lp { padding: 28px 6vw; color: var(--muted); border-top: 1px solid var(--border); background: #fff; display: flex; gap: 18px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 30% 0 0; z-index: 40; transform: translateX(-105%); transition: transform .2s; height: 100vh; }
  .sidebar.open { transform: none; }
  .btn.menu-toggle { display: inline-flex; }
  .main { padding: 16px; }
  .grid.c2 { grid-template-columns: 1fr; }
  .table th.hide-sm, .table td.hide-sm { display: none; }
}
@media print { .sidebar, .topbar .btn, .no-print { display: none !important; } .shell { display: block; } }
