/* Modo escuro por omissão. Cores todas em variáveis — o resto da folha
   herda destas, nada de cores fixas espalhadas. */
:root {
    --bg: #16171a;
    --surface: #1e2024;
    --surface-2: #24262b;
    --border: #2f323a;
    --border-strong: #3c4049;
    --text: #e7e8ea;
    --muted: #9a9da5;
    --accent: #2fb98d;
    --accent-soft: #12352b;
    --danger: #e06b6b;
    --danger-soft: #3a1f1f;
    --warn: #e0a54b;
    --warn-soft: #382a15;
    --radius: 8px;
    color-scheme: dark;
}

/* Tema claro opcional: <html data-theme="light"> ou <body class="theme-light"> */
:root[data-theme="light"],
.theme-light {
    --bg: #f7f6f3;
    --surface: #ffffff;
    --surface-2: #faf9f6;
    --border: #e4e2dc;
    --border-strong: #cfccc4;
    --text: #26251f;
    --muted: #6b6a63;
    --accent: #0f6e56;
    --accent-soft: #e1f5ee;
    --danger: #a32d2d;
    --danger-soft: #fcebeb;
    --warn: #854f0b;
    --warn-soft: #faeeda;
    color-scheme: light;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 232px;
    flex: 0 0 232px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 20px 0;
}
.sidebar .brand {
    padding: 0 20px 18px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}
.sidebar .brand strong { display: block; font-size: 15px; font-weight: 600; }
.sidebar .brand span { font-size: 12px; color: var(--muted); }
.sidebar .brand img { max-width: 150px; max-height: 40px; margin-bottom: 8px; display: block; }
.sidebar nav a {
    display: block;
    padding: 9px 20px;
    color: var(--text);
    font-size: 14px;
    border-left: 3px solid transparent;
}
.sidebar nav a:hover { background: var(--bg); text-decoration: none; }
.sidebar nav a.active { border-left-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.sidebar .foot { padding: 16px 20px 0; margin-top: 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }

.main { flex: 1; padding: 28px 32px; max-width: 1180px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 22px; gap: 16px; }
h1 { font-size: 21px; font-weight: 600; margin: 0 0 4px; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 14px; font-weight: 600; margin: 0 0 10px; }
.subtitle { color: var(--muted); font-size: 13px; margin: 0; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 18px;
}
.card.tight { padding: 14px 16px; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }

.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat .value { font-size: 24px; font-weight: 600; line-height: 1.2; }
.stat .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--border); }
td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge.active { background: var(--accent-soft); color: var(--accent); }
.badge.pending { background: var(--surface-2); color: var(--muted); }
.badge.past_due { background: var(--warn-soft); color: var(--warn); }
.badge.suspended, .badge.revoked, .badge.expired { background: var(--danger-soft); color: var(--danger); }
.badge.trial { background: #23203a; color: #b3a7f0; }

code, .mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 13px; }
.key { background: var(--surface-2); padding: 2px 6px; border-radius: 4px; letter-spacing: .03em; }

label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 5px; }
.hint { font-size: 12px; color: var(--muted); margin: 4px 0 0; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=date], input[type=datetime-local], select, textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea { min-height: 70px; resize: vertical; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.check input { width: auto; }

.btn {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}
.btn:hover { text-decoration: none; opacity: .92; }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.sm { padding: 4px 9px; font-size: 13px; }

.flash { padding: 11px 14px; border-radius: var(--radius); margin-bottom: 18px; font-size: 14px; border: 1px solid; }
.flash.ok { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.flash.erro { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }

.empty { color: var(--muted); font-size: 14px; padding: 18px 0; text-align: center; }
.split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; }
@media (max-width: 1000px) { .split { grid-template-columns: 1fr; } }

.timeline { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.timeline li { padding: 7px 0; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border-bottom: none; }
.timeline .when { color: var(--muted); font-size: 12px; }

.centered { max-width: 480px; margin: 60px auto; }
.install { max-width: 720px; margin: 40px auto; padding: 0 20px; }
.steps { display: flex; gap: 6px; margin-bottom: 22px; flex-wrap: wrap; }
.steps span { font-size: 12px; padding: 5px 11px; border-radius: 20px; background: var(--surface-2); color: var(--muted); }
.steps span.done { background: var(--accent-soft); color: var(--accent); }
.steps span.current { background: var(--accent); color: #fff; }

.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.checklist li:last-child { border-bottom: none; }
.checklist .ok { color: var(--accent); font-weight: 500; }
.checklist .no { color: var(--danger); font-weight: 500; }
.checklist .detail { font-size: 12px; color: var(--muted); }

.warning { background: var(--warn-soft); border: 1px solid var(--warn); color: var(--warn); padding: 12px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; }
.toolbar { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .field { margin-bottom: 0; }
.inline-form { display: inline; }


/* Caixas de código (ex.: linha do cron) coerentes com o tema */
pre.mono, .code-box {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-all;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}


/* Linha de credencial copiável */
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input { flex: 1; font-size: 13px; }
.btn.sm { padding: 5px 11px; font-size: 13px; }
.btn.ghost { background: transparent; border: 1px solid var(--border-strong); color: var(--text); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
