:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --panel: #ffffff;
  --text: #172026;
  --muted: #66727d;
  --line: #d9dee5;
  --accent: #0f766e;
  --accent-dark: #0a5c56;
  --blue: #1d4ed8;
  --red: #b42318;
  --amber: #a15c07;
  --shadow: 0 12px 28px rgba(16, 24, 40, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

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

a {
  color: var(--blue);
}

button,
.button-link {
  border: 1px solid transparent;
  border-radius: 6px;
  min-height: 40px;
  padding: 0 14px;
  font: inherit;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.primary {
  background: var(--accent);
  color: #ffffff;
}

.primary:hover {
  background: var(--accent-dark);
}

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

.secondary:hover,
.button-link:hover {
  border-color: #aab4c0;
}

.full {
  width: 100%;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 40px;
  padding: 9px 10px;
  font: inherit;
  color: var(--text);
  background: #ffffff;
}

textarea {
  resize: vertical;
  min-height: 98px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

label input,
label textarea {
  color: var(--text);
  font-weight: 500;
}

.topbar {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px clamp(16px, 4vw, 40px);
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.topbar h1,
.login-panel h1 {
  margin: 2px 0 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.1;
}

.topbar nav,
.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.dashboard {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 22px clamp(14px, 3vw, 34px) 42px;
  display: grid;
  gap: 18px;
}

.status-strip,
.grid {
  display: grid;
  gap: 18px;
}

.status-strip {
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel,
.status-card,
.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel,
.status-card {
  padding: 18px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef2f6;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.chip.ok {
  background: #dff6ef;
  color: #0b6b4b;
}

.chip.warn {
  background: #fff3d6;
  color: var(--amber);
}

.chip.error {
  background: #ffe4e0;
  color: var(--red);
}

.track-line {
  margin: 0 0 18px;
  font-size: clamp(1.35rem, 4vw, 2.6rem);
  line-height: 1.06;
  font-weight: 850;
  overflow-wrap: anywhere;
}

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

.meta-grid.compact {
  grid-template-columns: 1fr;
  margin-bottom: 14px;
}

.meta-grid div {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  min-width: 0;
}

dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  margin-bottom: 3px;
}

dd {
  margin: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.stack {
  display: grid;
  gap: 14px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 0.92rem;
}

.check-row input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.inline-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.promo-days {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.promo-days .check-row {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.file-list,
.events {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  list-style: none;
}

.file-list li,
.events li {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.file-list code,
.events code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.event-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.event-message {
  font-weight: 800;
}

.event-time {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.18), transparent 38%),
    linear-gradient(315deg, rgba(29, 78, 216, 0.12), transparent 44%),
    var(--bg);
}

.login-shell {
  width: min(420px, 100%);
}

.login-panel {
  padding: 26px;
  display: grid;
  gap: 22px;
}

.form-error {
  margin: 0;
  color: var(--red);
  font-weight: 700;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: min(420px, calc(100vw - 36px));
  border-radius: 8px;
  background: #172026;
  color: #ffffff;
  padding: 13px 14px;
  box-shadow: var(--shadow);
  font-weight: 700;
}

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

@media (max-width: 820px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .status-strip,
  .grid.two,
  .grid.three,
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .topbar nav,
  .button-row {
    width: 100%;
  }

  .topbar button,
  .topbar .button-link,
  .button-row button {
    flex: 1 1 150px;
  }
}

@media (max-width: 520px) {
  .panel,
  .status-card,
  .login-panel {
    padding: 14px;
  }

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