:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #18202f;
  --muted: #647086;
  --line: #dfe4ea;
  --brand: #176b5c;
  --brand-dark: #105044;
  --accent: #c65f3a;
  --warn: #9a5a00;
  --danger: #b42318;
  --ok: #087443;
  --shadow: 0 10px 30px rgba(27, 35, 50, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  background: #17202d;
  color: #f9fafb;
  padding: 24px 18px;
}

.brand {
  font-size: 17px;
  font-weight: 750;
  margin: 0 0 22px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav a,
.nav button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 9px 10px;
  background: transparent;
  color: #d8dee8;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.nav a.active,
.nav a:hover,
.nav button:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
  text-decoration: none;
}

.main {
  padding: 28px;
  max-width: 1320px;
  width: 100%;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

h1,
h2,
h3 {
  letter-spacing: 0;
  line-height: 1.2;
}

h1 {
  margin: 0;
  font-size: 28px;
}

h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.muted {
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.span-3 {
  grid-column: span 3;
}

.span-4 {
  grid-column: span 4;
}

.span-6 {
  grid-column: span 6;
}

.span-8 {
  grid-column: span 8;
}

.span-12 {
  grid-column: span 12;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.metric {
  min-height: 110px;
}

.metric strong {
  display: block;
  font-size: 30px;
  line-height: 1.1;
  margin-top: 8px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  background: #eef2f6;
  color: #3b4658;
  font-size: 12px;
  font-weight: 650;
}

.badge.ok {
  background: #e8f6ee;
  color: var(--ok);
}

.badge.warn {
  background: #fff3d8;
  color: var(--warn);
}

.badge.danger {
  background: #fde9e7;
  color: var(--danger);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inline-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
  align-items: end;
}

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1.15fr)) minmax(160px, 0.8fr);
  gap: 12px;
  align-items: end;
}

.schedule-grid label {
  margin-bottom: 0;
}

.schedule-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.schedule-actions form {
  margin: 0;
}

.schedule-actions button {
  min-height: 44px;
  min-width: 180px;
}

.compact-form {
  margin-top: 12px;
}

.preview-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}

.preview-meta div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfcfd;
}

.preview-meta strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.preview-frame {
  width: 100%;
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  padding: 8px 13px;
  background: var(--brand);
  color: #ffffff;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

button:disabled,
input[type="submit"]:disabled {
  cursor: wait;
  opacity: 0.78;
}

.button:hover,
button:hover {
  background: var(--brand-dark);
  text-decoration: none;
}

.button.secondary,
button.secondary {
  border-color: var(--line);
  background: #ffffff;
  color: var(--text);
}

.button.secondary:hover,
button.secondary:hover {
  background: #f0f3f6;
}

.button.danger,
button.danger {
  border-color: #f3b8b1;
  background: #fff7f6;
  color: var(--danger);
}

.button.danger:hover,
button.danger:hover {
  background: #fde9e7;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfd6df;
  border-radius: 8px;
  padding: 10px 11px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

select[multiple] {
  min-height: 118px;
}

textarea {
  min-height: 150px;
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: #2b3545;
  font-weight: 650;
}

.check-row {
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  font-weight: 500;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.login-page,
.training-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #f5f7f9, #e9f1ef);
}

.phish-page {
  display: block;
  padding: 0;
  background: #f2f5f8;
}

.login-card,
.training-card {
  width: min(760px, 100%);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.phish-wrap {
  min-height: 100vh;
}

.phish-shell {
  --portal: var(--brand);
  --portal-dark: var(--brand-dark);
  --portal-soft: #eaf5f1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 247, 250, 0.96)),
    #f4f7fa;
  color: var(--text);
}

.landing-amber {
  --portal: #9a5a00;
  --portal-dark: #6f4100;
  --portal-soft: #fff6e5;
}

.landing-indigo {
  --portal: #4f46e5;
  --portal-dark: #3730a3;
  --portal-soft: #eef2ff;
}

.landing-rose {
  --portal: #be123c;
  --portal-dark: #881337;
  --portal-soft: #fff1f2;
}

.landing-blue {
  --portal: #2563eb;
  --portal-dark: #1d4ed8;
  --portal-soft: #eff6ff;
}

.landing-slate {
  --portal: #475569;
  --portal-dark: #334155;
  --portal-soft: #f1f5f9;
}

.landing-cyan {
  --portal: #0891b2;
  --portal-dark: #0e7490;
  --portal-soft: #ecfeff;
}

.landing-violet {
  --portal: #7c3aed;
  --portal-dark: #6d28d9;
  --portal-soft: #f5f3ff;
}

.landing-green {
  --portal: #15803d;
  --portal-dark: #166534;
  --portal-soft: #f0fdf4;
}

.landing-orange {
  --portal: #c2410c;
  --portal-dark: #9a3412;
  --portal-soft: #fff7ed;
}

.phish-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
  padding: 16px clamp(22px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(24, 32, 47, 0.02);
}

.phish-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 220px;
}

.phish-logo-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--portal);
  color: #ffffff;
  font-weight: 850;
}

.phish-logo strong,
.phish-logo span {
  display: block;
}

.phish-logo strong {
  font-size: 17px;
}

.phish-logo span {
  color: var(--muted);
  font-size: 12px;
}

.phish-nav {
  display: flex;
  justify-content: center;
  gap: clamp(14px, 3vw, 32px);
  color: #4b5567;
  font-size: 14px;
  font-weight: 650;
}

.phish-session {
  border: 1px solid color-mix(in srgb, var(--portal) 25%, #ffffff);
  border-radius: 999px;
  padding: 6px 11px;
  background: var(--portal-soft);
  color: var(--portal-dark);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.phish-breadcrumb {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.phish-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  gap: clamp(24px, 5vw, 64px);
  align-items: start;
  width: min(1140px, calc(100% - 44px));
  margin: 0 auto;
  padding: clamp(36px, 7vw, 82px) 0 36px;
}

.phish-copy h1 {
  max-width: 720px;
  margin: 0 0 16px;
  font-size: clamp(32px, 4vw, 48px);
}

.phish-copy p {
  max-width: 680px;
  color: #435067;
  font-size: 18px;
}

.phish-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 720px;
  margin-top: 28px;
}

.phish-status div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: #ffffff;
}

.phish-status span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.phish-status strong {
  font-size: 16px;
}

.phish-summary {
  max-width: 720px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 20px 16px;
  background: #ffffff;
}

.phish-summary strong,
.phish-support strong {
  font-size: 16px;
}

.phish-summary ul {
  margin: 10px 0 0;
  padding-left: 20px;
  color: #435067;
}

.phish-support {
  max-width: 720px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--portal);
  border-radius: 8px;
  padding: 15px 18px;
  background: #ffffff;
}

.phish-support p {
  margin: 7px 0 0;
  font-size: 15px;
}

.phish-form {
  border: 1px solid var(--line);
  border-top: 5px solid var(--portal);
  border-radius: 8px;
  padding: 26px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.phish-form h2 {
  margin-bottom: 6px;
  font-size: 22px;
}

.phish-form > p {
  margin: 0 0 18px;
  color: var(--muted);
}

.phish-form label {
  margin-bottom: 13px;
}

.phish-form input {
  min-height: 46px;
  background: #fbfcfd;
}

.phish-form input:focus {
  outline: 2px solid color-mix(in srgb, var(--portal) 25%, transparent);
  border-color: var(--portal);
  background: #ffffff;
}

.phish-reference {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--portal-soft);
  color: #435067;
}

.phish-reference span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.phish-reference strong {
  text-align: right;
}

.phish-form button {
  width: 100%;
  min-height: 48px;
  border-color: var(--portal);
  background: var(--portal);
}

.phish-form button:hover {
  background: var(--portal-dark);
}

.phish-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(22px, 5vw, 72px);
  border-top: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
}

.landing-card {
  border-top: 6px solid var(--brand);
}

.landing-eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.landing-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 14px 0;
  background: #fbfcfd;
}

.landing-details ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.landing-amber {
  border-top-color: var(--warn);
}

.landing-indigo {
  border-top-color: #4f46e5;
}

.landing-rose {
  border-top-color: #be123c;
}

.landing-blue {
  border-top-color: #2563eb;
}

.landing-slate {
  border-top-color: #475569;
}

.landing-cyan {
  border-top-color: #0891b2;
}

.landing-violet {
  border-top-color: #7c3aed;
}

.landing-green {
  border-top-color: var(--ok);
}

.landing-orange {
  border-top-color: #c2410c;
}

.notice {
  border-left: 4px solid var(--brand);
  background: #edf7f4;
  padding: 12px 14px;
  margin: 14px 0;
}

.error {
  border-left: 4px solid var(--danger);
  background: #fff0ee;
  padding: 12px 14px;
  margin: 14px 0;
}

.success {
  border-left: 4px solid var(--ok);
  background: #eef8f2;
  padding: 12px 14px;
  margin: 14px 0;
}

.pending-banner {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 50;
  max-width: min(360px, calc(100vw - 36px));
  border: 1px solid #b9d9d1;
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  padding: 12px 14px;
  background: #ffffff;
  color: var(--text);
  box-shadow: var(--shadow);
  font-weight: 650;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.pending-banner.is-visible {
  opacity: 1;
  transform: translateY(0);
}

form.is-submitting {
  cursor: wait;
}

pre {
  white-space: pre-wrap;
  background: #101828;
  color: #f8fafc;
  border-radius: 8px;
  padding: 14px;
  overflow-x: auto;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .span-3,
  .span-4,
  .span-6,
  .span-8,
  .span-12 {
    grid-column: span 12;
  }

  .inline-grid {
    grid-template-columns: 1fr;
  }

  .schedule-grid {
    grid-template-columns: 1fr;
  }

  .schedule-actions {
    display: grid;
  }

  .schedule-actions button {
    width: 100%;
  }

  .phish-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .phish-logo {
    min-width: 0;
  }

  .phish-nav {
    width: 100%;
    justify-content: flex-start;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .phish-main {
    grid-template-columns: 1fr;
    width: min(100% - 28px, 720px);
    padding: 26px 0 24px;
  }

  .phish-copy h1 {
    font-size: 28px;
  }

  .phish-copy p {
    font-size: 16px;
  }

  .phish-status {
    grid-template-columns: 1fr;
    margin-top: 20px;
  }

  .phish-form {
    padding: 22px;
  }

  .phish-reference {
    align-items: flex-start;
    flex-direction: column;
  }

  .phish-reference strong {
    text-align: left;
  }

  .phish-footer {
    flex-direction: column;
    gap: 4px;
  }

  .preview-meta {
    grid-template-columns: 1fr;
  }
}
