:root {
  --bg: #f7f2e9;
  --panel: #fffdf9;
  --panel-strong: #fffdf9;
  --ink: #24211d;
  --muted: #6b6359;
  --accent: #1f6870;
  --accent-strong: #18545a;
  --border: rgba(181, 157, 118, 0.36);
  --warn: #b66d12;
  --danger: #b63131;
  --shadow: 0 18px 42px rgba(188, 166, 126, 0.22);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(214, 193, 156, 0.18), transparent 30%),
    linear-gradient(180deg, #fbf7f0 0%, var(--bg) 100%);
  min-height: 100vh;
}

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

code {
  font-family: "SFMono-Regular", monospace;
}

.brandmark {
  display: block;
  font-size: 1.85rem;
  line-height: 1.05;
  font-weight: 900;
  color: var(--ink);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.narrow {
  max-width: 480px;
}

.login-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  place-items: center;
}

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

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  padding: 28px 20px;
  border-right: 1px solid var(--border);
  background: rgba(251, 247, 239, 0.92);
}

.sidebar-nav {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.sidebar-nav a {
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  color: #6c655b;
  font-weight: 700;
}

.sidebar-nav a.active {
  color: white;
  background: var(--accent);
  border-color: var(--accent);
}

.brand-switcher {
  margin: 8px 0 6px;
}

.sidebar-divider {
  height: 1px;
  margin: 12px 0 4px;
  background: var(--border);
}

.sidebar-section-label {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.app-main {
  min-width: 0;
}

.page {
  width: 100%;
  padding: 28px 28px 48px;
}

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

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

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

.action-panel {
  margin-bottom: 20px;
}

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

.action-grid strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.8rem;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
}

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

.section-heading {
  margin-bottom: 14px;
}

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

h1,
h2 {
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 800;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.95rem;
}

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

input,
textarea,
select {
  width: 100%;
  padding: 12px 13px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #ffffff;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox input {
  width: auto;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  padding: 11px 16px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 700;
}

.button-secondary {
  background: #fffdf9;
  color: var(--accent-strong);
  border: 1px solid var(--accent);
}

.button-danger {
  background: var(--danger);
  color: white;
}

.flash {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 14px;
}

.flash-success {
  background: rgba(31, 104, 112, 0.08);
  color: var(--accent-strong);
}

.flash-error {
  background: rgba(140, 47, 47, 0.12);
  color: var(--danger);
}

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

.filters select,
.filters button,
.filters input {
  width: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

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

.table th {
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pill {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(31, 104, 112, 0.1);
  color: var(--accent-strong);
  font-size: 0.82rem;
}

.pill-warn {
  background: rgba(141, 93, 0, 0.12);
  color: var(--warn);
}

.block-form {
  margin-bottom: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.asset-card {
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 16px;
}

.compact-text {
  max-width: 420px;
  word-break: break-all;
}

.video-picker {
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
}

.picker-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 10px;
}

.picker-row:hover {
  background: rgba(31, 104, 112, 0.06);
}

.picker-row input {
  width: auto;
}

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

.calendar-day {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.55);
  min-height: 220px;
}

.calendar-day header {
  margin-bottom: 12px;
  font-weight: 700;
}

.calendar-card {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 12px;
  background: white;
  border: 1px solid var(--border);
}

.calendar-filled {
  border-color: rgba(31, 104, 112, 0.35);
}

.inline-form {
  display: grid;
  gap: 6px;
}

.inset-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.hero-panel {
  margin-bottom: 20px;
  background: #fffdf9;
}

.hero-note {
  max-width: 320px;
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(31, 104, 112, 0.14);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
  font-weight: 900;
}

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

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

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

.helper-panel {
  margin-top: 20px;
}

.token-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.token {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(31, 104, 112, 0.08);
  border: 1px solid rgba(31, 104, 112, 0.12);
}

.form-note {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

  .sidebar {
    position: static;
    min-height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .two-col,
  .stats-grid,
  .row,
  .row-2,
  .row-3,
  .row-4 {
    grid-template-columns: 1fr;
  }
}

.table-actions {
  white-space: nowrap;
}

.schedule-dialog {
  width: min(480px, calc(100% - 32px));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0;
}

.schedule-dialog::backdrop {
  background: rgba(0, 0, 0, 0.35);
}

.dialog-shell {
  padding: 22px 22px 0;
}

.schedule-dialog .stack {
  padding: 0 22px 22px;
}

.traffic-pill {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.traffic-red {
  background: rgba(140, 47, 47, 0.14);
  color: #7d1d1d;
}

.traffic-yellow {
  background: rgba(191, 128, 0, 0.18);
  color: #7a5200;
}

.traffic-green {
  background: rgba(38, 121, 72, 0.16);
  color: #1f6a3f;
}

.month-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.month-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.month-day {
  min-height: 170px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.month-day-required {
  background: rgba(244, 214, 114, 0.24);
  border-color: rgba(210, 172, 53, 0.4);
}

.month-day-complete {
  background: rgba(135, 198, 126, 0.24);
  border-color: rgba(76, 142, 78, 0.35);
}

.month-day header {
  margin-bottom: 8px;
  font-weight: 700;
}

.month-day-muted {
  opacity: 0.45;
}

.month-item {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
  padding: 8px;
  border-radius: 12px;
  background: white;
  border: 1px solid var(--border);
}

.schedule-settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.weekday-pills,
.weekday-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.weekday-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-weight: 700;
}

.weekday-pill-active {
  background: rgba(244, 214, 114, 0.35);
  color: #7a5200;
  border-color: rgba(210, 172, 53, 0.45);
}

.weekday-pill-large {
  width: 44px;
  height: 44px;
}

.weekday-option {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.weekday-option input {
  display: none;
}

.weekday-option input:checked + .weekday-pill {
  background: rgba(244, 214, 114, 0.35);
  color: #7a5200;
  border-color: rgba(210, 172, 53, 0.45);
}

.public-page {
  min-height: 100vh;
}

.public-watch {
  width: min(900px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.video-frame {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 30px rgba(61, 44, 18, 0.06);
}

.video-frame video {
  width: 100%;
  display: block;
  border-radius: 14px;
  background: black;
}

@media (max-width: 900px) {
  .two-col,
  .stats-grid,
  .action-grid,
  .calendar-grid,
  .month-grid,
  .month-weekdays {
    grid-template-columns: 1fr;
  }

  .hero-heading,
  .section-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .page {
    padding: 20px 16px 36px;
  }
}
