:root {
  --pitch: #0f3d2e;
  --pitch-2: #145c43;
  --lime: #c6f24e;
  --bg: #f3f5f2;
  --card: #fff;
  --text: #16211b;
  --muted: #65726b;
  --line: #e1e7e2;
  --danger: #c2362b;
  --warn: #b7791f;
  --ok: #1e8a4c;
  --info: #2563a8;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 40, 30, .06), 0 6px 18px rgba(16, 40, 30, .05);
  font-family: Inter, system-ui, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--pitch-2); }
h1, h2, h3 { font-family: 'Barlow Condensed', Inter, sans-serif; letter-spacing: .2px; margin: 0; }
h1 { font-size: 30px; }
h3 { font-size: 18px; margin-bottom: 10px; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* layout */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; background: linear-gradient(90deg, var(--pitch) 232px, transparent 232px); }
.side { background: var(--pitch); color: #dfeae4; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow: auto;
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 60px, transparent 60px 120px); }
.brand { display: flex; gap: 10px; align-items: center; padding: 2px 8px 18px; }
.brand .mark { width: 36px; height: 36px; border-radius: 50%; background: var(--lime); color: var(--pitch); display: grid; place-items: center; font-size: 19px; flex: none; }
.brand b { font-family: 'Barlow Condensed'; font-size: 21px; color: #fff; display: block; line-height: 1; }
.brand small { color: #9fb8aa; font-size: 11px; }
.nav a { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 8px; color: #dfeae4; text-decoration: none; font-weight: 500; margin-bottom: 2px; }
.nav a:hover { background: rgba(255,255,255,.07); }
.nav a.on { background: var(--lime); color: var(--pitch); font-weight: 600; }
.nav .grp { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #8fae9e; margin: 16px 12px 6px; }
.main { min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top .sp { flex: 1; }
.btn.menu-btn { display: none; }
.page { padding: 24px; max-width: 1280px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.head p { margin: 4px 0 0; color: var(--muted); }

/* blocos */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack > * + * { margin-top: 14px; }
.kpi .lbl { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.kpi .val { font-family: 'Barlow Condensed'; font-size: 32px; font-weight: 700; margin: 4px 0 2px; }
.kpi.dark { background: var(--pitch); color: #fff; border-color: var(--pitch); }
.kpi.dark .lbl, .kpi.dark .muted { color: #a9c4b6; }
.kpi .val.ok { color: var(--ok); } .kpi .val.bad { color: var(--danger); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

/* tabela */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr.click { cursor: pointer; } tr.click:hover td { background: #f7faf8; }
.empty { padding: 36px; text-align: center; color: var(--muted); }

/* elementos */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--pitch); background: var(--pitch); color: #fff; padding: 9px 14px; border-radius: 8px; font: 600 13.5px Inter, sans-serif; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--pitch-2); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.lime { background: var(--lime); color: var(--pitch); border-color: var(--lime); }
.btn.ghost { background: transparent; color: var(--text); border-color: #cdd5d0; }
.btn.ghost:hover { background: #eef2ef; }
.btn.danger { background: transparent; color: var(--danger); border-color: #e9b8b3; }
.btn.danger:hover { background: #fbecea; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
label.f { display: grid; gap: 5px; font-weight: 600; font-size: 12.5px; color: #33423a; min-width: 0; }
label.f small { font-weight: 400; color: var(--muted); }
input, select, textarea { font: 14px Inter, sans-serif; padding: 9px 10px; border: 1px solid #cfd8d2; border-radius: 8px; background: #fff; color: var(--text); width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--lime); border-color: var(--pitch-2); }
input[type=color] { padding: 2px; height: 40px; }
input[type=checkbox] { width: auto; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.b-ATIVO, .b-PAGA, .b-ok { background: #e2f4e8; color: var(--ok); }
.b-TESTE, .b-executando, .b-aguardando { background: #e3eefb; color: var(--info); }
.b-SUSPENSO, .b-VENCIDA, .b-erro { background: #fbe3e0; color: var(--danger); }
.b-PENDENTE { background: #fdf1dc; color: var(--warn); }
.b-CANCELADO, .b-CANCELADA { background: #eceeed; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: #c9d1cc; }
.dot.open { background: #25d366; }
.bar { height: 7px; background: #e9eeea; border-radius: 99px; overflow: hidden; min-width: 70px; }
.bar > i { display: block; height: 100%; background: var(--pitch-2); border-radius: 99px; }
.bar.warn > i { background: var(--warn); } .bar.full > i { background: var(--danger); }
.logo-sm { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; background: #eef2ef; display: grid; place-items: center; flex: none; font-size: 16px; }
.chart { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; align-items: end; height: 180px; padding-top: 10px; }
.chart .col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart .bars { display: flex; gap: 4px; align-items: flex-end; height: 140px; }
.chart .bars i { width: 16px; border-radius: 5px 5px 0 0; background: #d6ded9; display: block; }
.chart .bars i.r { background: var(--pitch-2); }
.chart small { color: var(--muted); font-size: 11.5px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.loglist { list-style: none; margin: 0; padding: 0; }
.loglist li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; }
.loglist li span { min-width: 0; overflow-wrap: anywhere; }
.loglist li:last-child { border: 0; }
.loglist time { color: var(--muted); font-size: 12px; white-space: nowrap; min-width: 96px; }
pre.out { background: #0f1a15; color: #cfe8da; padding: 12px; border-radius: 8px; max-height: 320px; overflow: auto; font-size: 12px; white-space: pre-wrap; word-break: break-word; }
.secret { display: flex; gap: 8px; align-items: center; background: #f4f7f5; border: 1px dashed #c8d3cc; padding: 8px 10px; border-radius: 8px; }
.secret code { flex: 1; overflow-wrap: anywhere; }
.alert { padding: 10px 12px; border-radius: 8px; background: #fdf1dc; color: #7a520f; }
.alert.bad { background: #fbe3e0; color: #8a2219; }
.alert.ok { background: #e2f4e8; color: #145c32; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 9px 14px; font: 600 13.5px Inter; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; }
.tabs button.on { color: var(--pitch); border-color: var(--pitch); }
.qr { display: grid; grid-template-columns: 230px 1fr; gap: 18px; align-items: center; }
.qr img { width: 230px; height: 230px; background: #fff; border-radius: 10px; padding: 6px; border: 1px solid var(--line); }
.preview { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; color: #fff; }
.preview .mark { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--lime); color: var(--pitch); overflow: hidden; }
.preview .mark img { width: 100%; height: 100%; object-fit: cover; }

/* modal e toasts */
.modal-bg { position: fixed; inset: 0; background: rgba(10, 25, 18, .45); display: grid; place-items: start center; padding: 40px 16px; overflow: auto; z-index: 50; }
.modal { background: #fff; border-radius: 14px; width: min(760px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.sm { width: min(460px, 100%); }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal header h2 { font-size: 22px; }
.modal .body { padding: 18px 20px; }
.modal footer { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.x { border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--muted); }
.section-t { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; margin: 18px 0 10px; }
.section-t:first-child { margin-top: 0; }
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 60; }
.toast { background: var(--pitch); color: #fff; padding: 11px 14px; border-radius: 9px; box-shadow: var(--shadow); max-width: 380px; }
.toast.err { background: var(--danger); }

/* login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login .art { background: var(--pitch); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.03) 0 70px, transparent 70px 140px); }
.login .art h1 { font-size: 46px; line-height: 1.02; max-width: 520px; }
.login .art em { color: var(--lime); font-style: normal; }
.login form { align-self: center; justify-self: center; width: min(360px, 90%); display: grid; gap: 14px; }

@media (max-width: 960px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; background: none; }
  .side { position: fixed; inset: 0 auto 0 0; width: 250px; transform: translateX(-100%); transition: transform .2s; z-index: 40; }
  .side.open { transform: none; }
  .btn.menu-btn { display: inline-flex; }
  .page { padding: 16px; }
  .top { padding: 10px 16px; }
  .g2, .g4 { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login .art { padding: 28px 20px; }
  .login .art h1 { font-size: 34px; }
  .qr { grid-template-columns: 1fr; justify-items: center; }
  .hide-sm { display: none; }
}
