:root {
  color-scheme: dark;
  font: 16px/1.5 system-ui, sans-serif;
  background: #12191e;
  color: #f5f9fb;
  --panel: #1b272f;
  --field: #141e25;
  --line: #3b515e;
  --muted: #c3d3dc;
  --cyan: #4ce0e7;
}
* { box-sizing: border-box; }
body { margin: 0; }
header {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 10px max(18px, calc((100% - 1120px) / 2));
  border-top: 3px solid var(--cyan);
  border-bottom: 1px solid var(--line);
  background: #182329;
}
.admin-brand, .header-actions { display: flex; align-items: center; gap: 10px; }
.admin-brand span { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--cyan); border-radius: 8px; color: var(--cyan); font-weight: 800; }
.billing-state { padding: 4px 9px; border: 1px solid #546a76; border-radius: 6px; color: var(--muted); font-size: .875rem; }
main { max-width: 1160px; margin: auto; padding: clamp(16px, 4vw, 36px) 20px; }
h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); margin: 0; line-height: 1.15; }
h2 { margin: 0; font-size: clamp(1.25rem, 2.5vw, 1.55rem); line-height: 1.3; }
h3 { margin-bottom: 4px; }
p { color: var(--muted); }
#page-title { margin-bottom: 16px; }
#status { margin: 6px 0 16px; }
#status:empty { margin: 0; }
.workspace-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.workspace-tools nav { display: flex; flex-wrap: wrap; gap: 4px; }
.workspace-tools nav button {
  color: var(--muted);
  background: transparent;
  font-weight: 600;
}
.workspace-tools nav button[aria-pressed=true] {
  color: var(--cyan);
  background: #253943;
  box-shadow: inset 0 -2px var(--cyan);
}
section { margin: 18px 0; padding: clamp(14px, 3vw, 26px); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
#plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
fieldset { min-width: 0; margin: 8px 0; padding: 12px; border: 1px solid var(--line); border-radius: 9px; }
legend { font-weight: 700; padding: 0 5px; }
label { display: grid; gap: 4px; margin: 8px 0; }
.checkbox { display: flex; gap: 9px; align-items: center; }
input, select, textarea, button { font: inherit; padding: 7px 10px; border-radius: 7px; min-height: 42px; }
input, select, textarea { width: 100%; min-width: 0; color: inherit; background: var(--field); border: 1px solid #657d89; }
input[type=checkbox] { width: 20px; min-height: 20px; accent-color: var(--cyan); flex: none; }
button { border: 1px solid transparent; font-weight: 700; color: #102326; background: var(--cyan); cursor: pointer; }
button.secondary, #customers button, #history button { color: #f5f9fb; background: #263842; border-color: #5a717e; }
button:disabled { opacity: .55; cursor: default; }
button:not(:disabled):hover { filter: brightness(1.1); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
#trial { display: grid; grid-template-columns: minmax(0, 220px); }
#promotions details { border: 1px solid var(--line); border-radius: 9px; padding: 10px 14px; margin-bottom: 12px; }
#promotions summary { cursor: pointer; font-weight: 650; }
#promotions fieldset { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr)); gap: 0 14px; border: 0; padding: 0; }
#promotions fieldset p { grid-column: 1 / -1; }
.form-actions { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; }
#publication-preview, #history li { overflow-wrap: anywhere; }
#history li { margin-bottom: 8px; }
#search { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
#search label { flex: 1 1 300px; margin: 0; max-width: 570px; }
#customers { display: flex; gap: .5rem; flex-wrap: wrap; }
#customer-details { overflow-wrap: anywhere; }
#customer-details section { padding: .75rem 0; border: 0; }
#customer-details form { display: grid; gap: .75rem; }
#customer-details .customer-field { display: grid; gap: .35rem; }
dialog {
  width: min(calc(100% - 28px), 500px);
  max-height: calc(100dvh - 28px);
  padding: clamp(14px, 4vw, 24px);
  color: inherit;
  background: var(--panel);
  border: 1px solid #627987;
  border-radius: 14px;
}
dialog::backdrop { background: #071018ba; }
.dialog-header, .dialog-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dialog-header { justify-content: space-between; }
.promo-plan label { margin-bottom: 4px; }
#free-year-status:empty { display: none; }
#free-year-code { font: 1rem ui-monospace, monospace; }
[hidden] { display: none !important; }
