:root {
  color-scheme: light;
  --ink: #17201b;
  --muted: #66746d;
  --line: #d8e0da;
  --panel: #ffffff;
  --soft: #f4f7f2;
  --field: #f9faf7;
  --green: #1f6f4a;
  --green-dark: #174b36;
  --gold: #b9842c;
  --brick: #9f4c3a;
  --shadow: 0 18px 45px rgba(23, 32, 27, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--soft);
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  background: var(--green);
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: var(--green-dark);
}

label {
  display: block;
  margin-top: 14px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  color: var(--ink);
  padding: 12px;
}

textarea {
  resize: vertical;
  line-height: 1.55;
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(23, 32, 27, 0.52), rgba(23, 32, 27, 0.42)),
    url("https://images.unsplash.com/photo-1503387762-592deb58ef4e?auto=format&fit=crop&w=1800&q=80") center/cover;
}

.login-panel {
  width: min(440px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  padding: 30px;
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-mark.small {
  width: 42px;
  height: 42px;
  font-size: 0.8rem;
}

.login-panel h1 {
  margin: 18px 0 8px;
  font-size: clamp(2rem, 8vw, 3.2rem);
  line-height: 1;
}

.login-panel p {
  margin: 0 0 22px;
  color: var(--muted);
}

.login-error {
  min-height: 24px;
  margin: 12px 0 0 !important;
  color: var(--brick) !important;
  font-weight: 700;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px 16px;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--line);
}

.sidebar-brand span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item,
.logout-button,
.secondary-button {
  background: transparent;
  color: var(--ink);
  border: 1px solid transparent;
  text-align: left;
  padding: 10px 12px;
}

.nav-item:hover,
.nav-item.active,
.secondary-button:hover {
  background: var(--soft);
  border-color: var(--line);
  color: var(--green-dark);
}

.logout-button {
  margin-top: auto;
  border-color: var(--line);
  text-align: center;
}

.main-panel {
  min-width: 0;
  padding: 28px;
}

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.topbar h2 {
  margin: 0;
  font-size: 2rem;
}

.status-pill {
  border: 1px solid rgba(185, 132, 44, 0.35);
  border-radius: 999px;
  background: #fff8ea;
  color: #7b551c;
  padding: 8px 12px;
  font-size: 0.86rem;
  font-weight: 800;
  white-space: normal;
}

.status-pill.compact {
  padding: 6px 10px;
}

.view {
  display: none;
}

.active-view {
  display: block;
}

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

.metric-card,
.work-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 26px rgba(23, 32, 27, 0.06);
}

.metric-card {
  padding: 18px;
}

.metric-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin: 10px 0 6px;
  font-size: 2rem;
}

.metric-card p,
.work-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.two-column,
.generator-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.work-panel {
  padding: 20px;
}

.work-panel h3 {
  margin: 0 0 14px;
  font-size: 1.12rem;
}

.task-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--ink);
}

.task-list input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--green);
}

.large-note {
  font-size: 1.08rem;
  color: var(--ink) !important;
  font-weight: 800;
}

.rule-box {
  margin-top: 16px;
  border-left: 4px solid var(--green);
  background: var(--soft);
  padding: 14px;
  line-height: 1.5;
}

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

.panel-heading h3 {
  margin: 0;
}

.secondary-button {
  min-height: 36px;
  border-color: var(--line);
  text-align: center;
  font-size: 0.9rem;
}

.output-panel pre {
  min-height: 360px;
  max-height: 520px;
  overflow: auto;
  margin: 0;
  white-space: pre-wrap;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111a15;
  color: #e8f3ec;
  padding: 16px;
  line-height: 1.55;
}

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

.calendar-card {
  min-height: 170px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  padding: 14px;
}

.calendar-card h4 {
  margin: 0 0 8px;
}

.calendar-card p {
  margin: 0 0 10px;
}

.calendar-card ul {
  margin: 0;
  padding-left: 18px;
  line-height: 1.55;
}

.video-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.video-row {
  display: grid;
  grid-template-columns: 80px minmax(180px, 1fr) 150px 130px;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.video-row:nth-child(even) {
  background: var(--field);
}

.video-row:last-child {
  border-bottom: 0;
}

.video-row.header {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
  background: var(--soft);
}

.tag {
  width: fit-content;
  border-radius: 999px;
  background: #e9f3ed;
  color: var(--green-dark);
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 900;
}

.button-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.button-row button {
  padding: 0 18px;
}

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

.admin-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  padding: 16px;
}

.admin-grid h4 {
  margin: 0 0 8px;
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: block;
    padding: 14px;
  }

  .sidebar-brand {
    padding-bottom: 12px;
  }

  .nav-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 12px;
  }

  .nav-item {
    text-align: center;
  }

  .logout-button {
    width: 100%;
    margin-top: 10px;
  }

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

  .two-column,
  .generator-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .main-panel {
    padding: 18px;
  }

  .topbar {
    display: grid;
  }

  .topbar h2 {
    font-size: 1.55rem;
  }

  .metric-grid,
  .calendar-grid,
  .nav-list {
    grid-template-columns: 1fr;
  }

  .video-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .video-row.header {
    display: none;
  }
}

