:root {
  color-scheme: light;
  --ink: #14283f;
  --muted: #70849b;
  --line: #e0e8f0;
  --bg: #edf5fa;
  --card: rgba(255, 255, 255, .9);
  --navy: #142b45;
  --navy-2: #213d5c;
  --mint: #39d4ae;
  --cyan: #54b8f7;
  --gold: #b7892d;
  --ok: #16a66a;
  --warn: #9a6900;
  --bad: #c13c58;
  --info: #2674b7;
  --shadow: 0 18px 55px rgba(25, 61, 91, .09);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(ellipse at 82% 5%, rgba(88, 220, 197, .2), transparent 30rem),
    radial-gradient(ellipse at 5% 34%, rgba(87, 168, 248, .15), transparent 34rem),
    linear-gradient(145deg, #f7fafc 0%, #eaf3f9 60%, #eef2fb 100%);
  min-height: 100vh;
}
a { color: #216f9f; }
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 258px;
  color: #eaf4ff;
  padding: 28px 18px;
  flex-shrink: 0;
  background: linear-gradient(165deg, #142c47, #1e4260 70%, #23556a);
  box-shadow: 12px 0 38px rgba(23, 52, 78, .12);
}
.brand { font-weight: 800; letter-spacing: .055em; }
.brand small { display: block; color: #9cb6cd; font-weight: 500; letter-spacing: 0; margin-top: 5px; }
.sidebar nav { display: flex; flex-direction: column; gap: 6px; margin-top: 34px; }
.sidebar a {
  color: #c9d9e7;
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 13px;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.sidebar a:hover, .sidebar a.active { background: rgba(116, 218, 213, .15); color: #fff; transform: translateX(2px); }
.content { flex: 1; padding: clamp(22px, 4vw, 48px); max-width: 1440px; margin: 0 auto; min-width: 0; }
.top { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 22px; }
h1 { font-size: clamp(1.55rem, 2.2vw, 2rem); letter-spacing: -.035em; margin: 0; }
h2 { font-size: 1.15rem; letter-spacing: -.02em; margin: 0 0 12px; }
.muted { color: var(--muted); }
.flash { background: #fff9e8; border: 1px solid #f0d99f; color: #775900; padding: 14px 16px; border-radius: 16px; margin-bottom: 18px; box-shadow: var(--shadow); }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .88);
  border-radius: 22px;
  padding: 21px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.card .num { font-size: 1.75rem; font-weight: 780; letter-spacing: -.04em; }
.card .lbl { color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.toolbar { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 14px; }
input, select, textarea, button {
  font: inherit; padding: 11px 13px; border-radius: 12px;
  border: 1px solid #d5e0e9; background: rgba(255, 255, 255, .92); color: var(--ink);
  outline: none; transition: border-color .18s ease, box-shadow .18s ease;
}
input:focus, select:focus, textarea:focus { border-color: #5acdb8; box-shadow: 0 0 0 4px rgba(57, 212, 174, .14); }
textarea { width: 100%; min-height: 88px; }
textarea.sales { min-height: 240px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
button, .btn {
  background: linear-gradient(135deg, #1b3c59, #255572); color: #fff; border: 0;
  text-decoration: none; display: inline-block; cursor: pointer; padding: 11px 16px;
  border-radius: 12px; font-weight: 680; box-shadow: 0 7px 16px rgba(31, 76, 106, .13);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
button:hover, .btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(31, 76, 106, .18); filter: brightness(1.08); }
button.secondary, .btn.secondary { background: #e9f1f6; color: var(--ink); box-shadow: none; }
button.warn { background: #aa780d; }
button.danger { background: #b74358; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid rgba(255,255,255,.88); border-radius: 20px; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); background: rgba(239, 246, 250, .7); }
.badge { display: inline-block; padding: 6px 11px; border-radius: 999px; font-size: .78rem; font-weight: 720; background: #e9f0f5; }
.badge-active { background: #e0f8ee; color: var(--ok); }
.badge-expired, .badge-quota_exhausted, .badge-stats_error, .badge-disabled { background: #fff0f2; color: var(--bad); }
.badge-scheduled { background: #fff5dc; color: var(--warn); }
.meter { height: 10px; background: #e4edf2; border-radius: 99px; overflow: hidden; margin-top: 8px; }
.meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--mint), var(--cyan)); }
.grid-2 { display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; }
.stack { display: grid; gap: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions form { margin: 0; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(440px, 100%); background: rgba(255,255,255,.88); border: 1px solid #fff; border-radius: 26px; padding: 32px; box-shadow: 0 24px 80px rgba(30, 69, 102, .16); backdrop-filter: blur(18px); }
.login-card h1 { margin: 14px 0 6px; }
.login-card label { display: grid; gap: 7px; color: #4c6379; font-size: .9rem; font-weight: 650; }
.error { color: var(--bad); }
dl { display: grid; grid-template-columns: 190px 1fr; gap: 10px 16px; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; font-weight: 630; overflow-wrap: anywhere; }
.public-wrap { min-height: 100vh; display: grid; place-items: start center; padding: clamp(16px, 4vw, 42px); }
.public-card { width: min(960px, 100%); }
.public-card > .card { border-radius: 28px; }
.public-card .brand { color: var(--ink) !important; }
.public-card .stack > div:first-child { margin-bottom: 5px; }
.public-card .stack > div:first-child .brand { font-size: .8rem; color: #648096 !important; }
.public-card .stack > div:first-child .muted { margin: 8px 0 0; }
.public-card .badge { box-shadow: inset 0 0 0 1px rgba(255,255,255,.7); }
.status-card { gap: 22px; padding: clamp(22px, 4vw, 38px); }
.status-hero { display: flex; align-items: center; gap: 18px; min-height: 142px; padding: 5px 3px 20px; position: relative; }
.status-mark { width: 76px; height: 76px; flex: 0 0 76px; display: grid; place-items: center; border-radius: 24px; color: #063147; font-size: 2.8rem; font-weight: 800; background: linear-gradient(140deg, #52dfbb, #62b9f7); box-shadow: 0 12px 28px rgba(63, 191, 195, .25); }
.status-title { min-width: 0; }
.status-title h1 { margin: 8px 0 4px; font-size: clamp(1.8rem, 4vw, 2.55rem); }
.status-title .muted { margin: 0; }
.status-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: #67839b; font-size: .73rem; font-weight: 800; letter-spacing: .12em; margin: 0; }
.live-pill { display: inline-flex; align-items: center; gap: 6px; color: #129b68; background: #e5f9ef; border-radius: 999px; padding: 5px 9px; letter-spacing: 0; font-size: .72rem; }
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: #2cc487; box-shadow: 0 0 0 3px rgba(44,196,135,.13); }
.status-state { margin-left: auto; align-self: flex-start; }
.status-state .badge { padding: 8px 12px; }
.status-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.status-tile { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 19px; border: 1px solid #e7edf2; border-radius: 20px; background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(246,250,252,.88)); }
.tile-label { color: #6e879e; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.status-tile strong { color: #172f49; font-size: clamp(1.22rem, 2.4vw, 1.72rem); line-height: 1.2; letter-spacing: -.035em; overflow-wrap: anywhere; }
.status-tile strong.tile-date { font-size: clamp(1rem, 1.7vw, 1.28rem); }
.tile-note { color: var(--muted); font-size: .86rem; }
.status-tile .meter { width: 100%; margin-top: 2px; }
.status-details { padding: 21px; border-radius: 20px; background: rgba(239, 246, 250, .76); }
.status-section-title { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.section-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 13px; color: #129e84; background: #ddf8ef; font-size: 1.2rem; }
.status-section-title h2 { margin: 0 0 4px; }
.status-section-title p { margin: 0; font-size: .88rem; }
.status-details dl { grid-template-columns: minmax(120px, .7fr) minmax(0, 1fr); gap: 0; }
.status-details dt, .status-details dd { padding: 11px 0; border-bottom: 1px solid #e0e9ef; }
.status-details dt:last-of-type, .status-details dd:last-of-type { border-bottom: 0; }
.status-footnote { margin: 0; font-size: .85rem; }
.warn-box { background: #fff2f2; border-radius: 14px; padding: 14px; color: var(--bad); }
@media (max-width: 900px) {
  .layout { display: block; }
  .sidebar { width: 100%; padding: 18px 20px; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; margin-top: 18px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .content { padding: 22px 18px; }
}
@media (max-width: 600px) {
  .public-wrap { padding: 14px; }
  .public-card > .card { padding: 22px 19px; border-radius: 24px; }
  .status-hero { align-items: flex-start; gap: 13px; flex-wrap: wrap; }
  .status-mark { width: 58px; height: 58px; flex-basis: 58px; border-radius: 18px; font-size: 2.2rem; }
  .status-title { flex: 1; }
  .status-state { position: absolute; top: 4px; right: 0; }
  .status-title h1 { padding-right: 75px; }
  .status-summary { grid-template-columns: 1fr; }
  .status-tile { padding: 16px; }
  .status-details { padding: 17px; }
  .status-details dl { grid-template-columns: 1fr; }
  .status-details dt { padding: 10px 0 2px; border: 0; }
  .status-details dd { padding: 0 0 10px; }
  .cards { gap: 10px; }
  .cards .card { padding: 16px; }
  dl { grid-template-columns: 1fr; gap: 5px; }
  dd { margin-bottom: 10px; }
  .login-card { padding: 25px 21px; }
  th, td { padding: 11px; }
}
