:root {
  --bg:#f3f6f4;
  --panel:#ffffff;
  --ink:#101828;
  --muted:#667085;
  --line:#d0d5dd;
  --forest:#0b241c;
  --evergreen:#164536;
  --yield:#1fa77a;
  --mint:#dff7ec;
  --gold:#f4c95d;
  --clay:#c8544d;
  --blue:var(--evergreen);
  --navy:var(--forest);
  --green:var(--yield);
  --red:var(--clay);
  --shadow:0 18px 50px rgba(16,24,40,.10);
}
* { box-sizing:border-box; }
body {
  margin:0;
  min-height:100vh;
  font-family:Inter, "Segoe UI", Arial, sans-serif;
  background:var(--bg);
  color:var(--ink);
}
body.auth-page {
  display:grid;
  place-items:center;
  padding:28px;
  background:radial-gradient(circle at 18% 16%, rgba(31,167,122,.16) 0, transparent 28%), var(--bg);
}
.login-shell { width:min(1120px, 100%); display:grid; grid-template-columns:minmax(0,1fr) 430px; gap:28px; align-items:stretch; }
.login-panel { border-radius:18px; background:linear-gradient(135deg,var(--forest),var(--evergreen)); color:white; padding:42px; min-height:560px; display:flex; flex-direction:column; justify-content:center; box-shadow:var(--shadow); }
.brand-mark { display:inline-flex; align-items:center; margin-bottom:54px; }
.brand-mark img { width:176px; height:auto; display:block; }
.eyebrow { color:#bfead7; font-size:12px; font-weight:900; letter-spacing:.08em; text-transform:uppercase; }
h1 { margin:12px 0 0; font-size:42px; line-height:1.05; letter-spacing:0; max-width:620px; }
.login-panel p { color:#d0d5dd; line-height:1.55; max-width:610px; font-size:16px; }
.approval-note { margin-top:30px; border:1px solid rgba(255,255,255,.16); background:rgba(255,255,255,.07); color:#eef2ff; border-radius:10px; padding:14px 16px; max-width:560px; }
.login-card, .card { background:var(--panel); border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow); }
.login-card { padding:34px; align-self:center; }
.login-card h2, .card h2 { margin:0 0 8px; font-size:24px; }
.login-card p, .card p { color:var(--muted); margin:0 0 20px; line-height:1.45; }
label { display:block; font-size:12px; font-weight:900; color:var(--muted); text-transform:uppercase; margin:14px 0 6px; }
input, select { width:100%; min-height:44px; border:1px solid var(--line); border-radius:9px; padding:10px 12px; font:inherit; background:#fff; }
button, .button { display:inline-flex; align-items:center; justify-content:center; border:0; border-radius:9px; min-height:44px; padding:10px 15px; background:var(--evergreen); color:#fff; font:inherit; font-weight:900; cursor:pointer; text-decoration:none; }
button.secondary, .button.secondary { background:#eef2f0; color:var(--evergreen); }
button.danger { background:var(--red); }
button:disabled { opacity:.6; cursor:not-allowed; }
.full-button { width:100%; margin-top:20px; }
.auth-alt { margin-top:18px; color:var(--muted); font-size:14px; text-align:center; }
.auth-alt a, .meta a { color:var(--evergreen); font-weight:900; text-decoration:none; }
.actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-top:18px; }
.message { border-radius:9px; padding:10px 12px; margin:12px 0; background:#eef2ff; color:#1d4ed8; font-size:13px; }
.message[data-type="error"] { background:#fee2e2; color:#991b1b; }
.message[data-type="success"] { background:#dcfce7; color:#166534; }
.shell { width:min(980px, 100%); display:grid; grid-template-columns:1fr 420px; gap:20px; align-items:stretch; margin:24px auto; }
.brand { padding:30px; display:flex; flex-direction:column; justify-content:space-between; min-height:430px; background:linear-gradient(135deg,var(--forest),var(--evergreen)); color:#fff; border-radius:14px; }
.brand p { color:#d0d5dd; line-height:1.55; max-width:560px; }
.card { padding:26px; }
body.data-page { padding:0; background:var(--bg); }
.data-shell { width:min(1180px, 100%); margin:0 auto; padding:28px; }
.data-hero { background:linear-gradient(135deg,var(--forest),var(--evergreen)); color:#fff; border-radius:14px; padding:28px; display:flex; justify-content:space-between; gap:18px; align-items:flex-end; box-shadow:var(--shadow); }
.data-hero h1 { font-size:34px; }
.data-hero p { color:#d0d5dd; max-width:760px; line-height:1.5; }
.data-hero-actions { display:flex; gap:10px; flex-wrap:wrap; }
.data-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; margin-top:18px; align-items:start; }
.updates-card { margin-top:18px; }
.table-wrap { max-height:520px; overflow:auto; border:1px solid var(--line); border-radius:8px; }
table { width:100%; border-collapse:collapse; font-size:13px; }
th, td { padding:11px 12px; border-bottom:1px solid #e6ebf1; text-align:left; vertical-align:middle; }
th { background:#f8fafc; color:#475467; font-size:11px; text-transform:uppercase; font-weight:900; }
td button { min-height:34px; padding:7px 10px; margin-right:6px; }
.meta { margin-top:16px; font-size:13px; color:var(--muted); }
@media (max-width:900px) {
  body.auth-page { padding:14px; align-items:start; }
  .login-shell, .shell, .data-grid { grid-template-columns:1fr; }
  .login-panel { min-height:auto; padding:26px; }
  .brand-mark { margin-bottom:26px; } .brand-mark img { width:150px; }
  h1 { font-size:30px; }
  .login-card { align-self:stretch; padding:24px; }
  .data-shell { padding:16px; }
  .data-hero { align-items:flex-start; flex-direction:column; }
}
@media (max-width:560px) {
  .actions, .data-hero-actions { flex-direction:column; align-items:stretch; }
  button, .button { width:100%; }
}

body.admin-page .shell { width:min(1380px, 100%); grid-template-columns:320px minmax(0,1fr); }
.admin-stack { display:flex; flex-direction:column; gap:24px; }
.admin-panel { min-width:0; }
.section-heading { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; margin-bottom:12px; }
.section-heading h2 { margin-bottom:6px; }
.status-pill { display:inline-flex; align-items:center; min-height:24px; border-radius:999px; padding:3px 9px; font-weight:900; font-size:12px; text-transform:uppercase; }
.status-pill.success { background:#dcfce7; color:#166534; }
.status-pill.failed { background:#fee2e2; color:#991b1b; }
.status-pill.running { background:#eef2ff; color:#1d4ed8; }
.muted-cell { color:var(--muted); }
.plan-preview-panel { border:1px solid #b6dccd; border-radius:10px; padding:18px; background:#f4fbf8; }
.plan-preview-actions { display:flex; flex-wrap:wrap; gap:9px; }
.plan-preview-actions button { width:auto; min-width:130px; }
.plan-preview-actions button.active { background:var(--forest); color:#fff; border-color:var(--forest); }
.plan-preview-actions .preview-reset { background:#fff; color:#b42318; border:1px solid #f1b8b2; }
.plan-preview-actions .preview-reset:disabled { color:#98a2b3; border-color:var(--line); cursor:not-allowed; }
.preview-status { display:inline-flex; min-height:30px; align-items:center; border-radius:999px; padding:5px 11px; background:#dff6ec; color:var(--evergreen); font-size:12px; font-weight:900; white-space:nowrap; }
.preview-note { margin:12px 0 0; color:var(--muted); font-size:12px; }
.plan-preview-banner { position:fixed; z-index:1190; left:50%; bottom:16px; transform:translateX(-50%); width:min(720px,calc(100vw - 28px)); display:flex; align-items:center; justify-content:center; gap:12px; min-height:44px; padding:8px 14px; background:#fff1c7; color:#4b3a06; border:1px solid #e7c963; border-radius:9px; box-shadow:0 16px 38px rgba(16,24,40,.2); font-weight:800; text-align:center; }
.plan-preview-banner button { width:auto; min-height:30px; padding:5px 10px; background:#fff; color:#4b3a06; border:1px solid #c9a936; border-radius:6px; font-size:12px; }
@media (max-width:560px) { .plan-preview-actions button { width:100%; } .plan-preview-banner { align-items:flex-start; flex-direction:column; gap:5px; } }
@media (max-width:1100px) {
  body.admin-page .shell { grid-template-columns:1fr; }
  body.admin-page .brand { min-height:auto; }
}
@media (max-width:700px) {
  .section-heading { flex-direction:column; }
}
.data-upgrade-gate { min-height:280px; display:grid; grid-template-columns:auto minmax(0,1fr); place-items:center start; align-content:center; gap:18px; padding:30px; border:1px solid #cfe0d9; border-radius:8px; background:#f4faf7; }
.data-upgrade-gate[hidden] { display:none !important; }
.data-upgrade-gate h3 { margin:6px 0 8px; font-size:24px; }
.data-upgrade-gate p { max-width:520px; color:#667085; line-height:1.55; }
.data-upgrade-icon { width:52px; height:52px; display:grid; place-items:center; border-radius:8px; background:#0b3b2e; color:#45ddb0; font-size:22px; font-weight:900; }
@media (max-width:640px) { .data-upgrade-gate { grid-template-columns:1fr; place-items:start; padding:22px; } }
.module-support-link { padding:12px 14px; background:#edf8f3; border-left:3px solid var(--yield); border-radius:6px; }
.module-support-link a { color:var(--evergreen); font-weight:900; text-decoration-thickness:1px; text-underline-offset:3px; }
