:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #f7faf8;
  --bg-strong: #eef6f1;
  --panel: #ffffff;
  --panel-soft: #fafcfb;
  --text: #12251b;
  --muted: #6d7d73;
  --muted-soft: #93a49a;
  --border: #e3ece6;
  --border-soft: #eef4f0;
  --brand: #10915b;
  --brand-strong: #087045;
  --brand-deep: #06422e;
  --brand-soft: #e8f7ef;
  --brand-tint: #f3fbf6;
  --warning: #b45309;
  --warning-bg: #fff7ed;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow: 0 18px 48px rgba(18, 37, 27, 0.08);
  --shadow-soft: 0 8px 24px rgba(18, 37, 27, 0.05);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(232, 247, 239, 0.55) 0 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(180deg, #fbfdfb 0%, var(--bg) 44%, #f4f8f5 100%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body.modal-open {
  overflow: hidden;
}

body,
button,
input,
textarea,
select {
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button,
.button-secondary {
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--brand);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 760;
  min-height: 44px;
  padding: 11px 16px;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

button:hover,
.button-secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(16, 145, 91, 0.18);
}

button:focus-visible,
.button-secondary:focus-visible,
.nav a:focus-visible,
.badge:focus-visible {
  outline: 3px solid rgba(31, 138, 86, 0.24);
  outline-offset: 2px;
}

.button-secondary {
  background: #ffffff;
  border-color: var(--border);
  color: #264237;
  box-shadow: 0 1px 2px rgba(16, 37, 26, 0.04);
}

.button-secondary:hover {
  border-color: rgba(16, 145, 91, 0.28);
  background: var(--brand-tint);
  color: var(--brand-strong);
}

.button-danger {
  background: var(--danger-bg);
  border-color: #fecaca;
  color: var(--danger);
  box-shadow: none;
}

.button-danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  box-shadow: 0 10px 22px rgba(185, 28, 28, 0.14);
  color: #991b1b;
}

.compact {
  min-height: 36px;
  padding: 8px 12px;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.panel {
  width: min(720px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 32px;
}

.panel-narrow {
  width: min(420px, 100%);
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.15;
}

h1 {
  font-size: clamp(30px, 2.2vw, 38px);
  letter-spacing: -0.025em;
}

h2 {
  font-size: 22px;
}

.muted {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.form {
  display: grid;
  gap: 16px;
}

.form label {
  display: grid;
  gap: 8px;
  color: #31463b;
  font-size: 13px;
  font-weight: 750;
}

.form input,
.form textarea,
.form select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 44px;
  padding: 11px 14px;
  font: inherit;
  background: #fbfdfc;
  color: var(--text);
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.form input,
.form select {
  height: 44px;
}

.form select {
  appearance: none;
  background-color: #fbfdfc;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 19px,
    calc(100% - 13px) 19px;
  background-repeat: no-repeat;
  background-size:
    5px 5px,
    5px 5px;
  padding-right: 38px;
}

.form textarea {
  resize: vertical;
}

.form input:focus,
.form textarea:focus,
.form select:focus {
  background: #ffffff;
  border-color: rgba(16, 145, 91, 0.45);
  box-shadow: 0 0 0 4px rgba(16, 145, 91, 0.10);
  outline: none;
}

.alert {
  border-radius: var(--radius-md);
  margin: 0 0 16px;
  padding: 12px 14px;
  font-weight: 700;
}

.alert.error {
  background: var(--danger-bg);
  color: var(--danger);
}

.alert.success {
  background: #ecfdf3;
  color: #166534;
}

.admin-layout {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow: auto;
  padding: 22px 18px;
  background: rgba(255, 255, 255, 0.88);
  border-right: 1px solid var(--border);
  box-shadow: 10px 0 32px rgba(18, 37, 27, 0.035);
  color: var(--text);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 3px 4px 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--brand);
  box-shadow: 0 12px 24px rgba(16, 145, 91, 0.20);
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  color: var(--text);
  font-size: 18px;
  letter-spacing: -0.01em;
}

.brand-copy span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.sidebar-kicker {
  margin: 0 0 18px;
  padding: 0 5px;
  color: var(--muted-soft);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 12px;
  color: #51675b;
  font-weight: 760;
  transition:
    background-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.nav a:hover {
  background: var(--brand-tint);
  color: var(--brand-strong);
}

.nav a.active {
  background: var(--brand);
  color: var(--brand-strong);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(16, 145, 91, 0.18);
}

.nav-icon {
  align-items: center;
  background: #eff6f2;
  border-radius: 9px;
  color: var(--brand);
  display: inline-flex;
  flex: 0 0 auto;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.nav-icon::before {
  background: currentColor;
  border-radius: 3px;
  content: "";
  display: block;
  height: 12px;
  opacity: 0.95;
  width: 12px;
}

.nav-icon.dashboard::before {
  box-shadow: 7px 0 0 -3px currentColor, 0 7px 0 -3px currentColor, 7px 7px 0 -3px currentColor;
}

.nav-icon.kiosks::before,
.nav-icon.frames::before {
  border-radius: 2px;
  height: 14px;
  width: 10px;
}

.nav-icon.config::before {
  border-radius: 999px;
}

.nav-icon.backgrounds::before {
  height: 10px;
  transform: rotate(45deg);
  width: 10px;
}

.nav-icon.media::before {
  border-radius: 2px;
  height: 10px;
  width: 14px;
}

.nav-icon.coupons::before {
  border-radius: 999px;
  height: 8px;
  width: 16px;
}

.nav-icon.reports::before {
  height: 14px;
  width: 4px;
  box-shadow: 6px 4px 0 currentColor, 12px -3px 0 currentColor;
}

.nav a.active .nav-icon {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.sidebar-footer {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 22px;
  padding: 14px;
  border-radius: 16px;
  background: var(--brand-tint);
  border: 1px solid var(--border-soft);
}

.sidebar-status-dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 999px;
  background: #18b66f;
  box-shadow: 0 0 0 6px rgba(24, 182, 111, 0.12);
  flex: 0 0 auto;
}

.sidebar-footer strong {
  display: block;
  margin-bottom: 2px;
  font-size: 14px;
}

.sidebar-footer span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.admin-main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 34px 16px;
  background: rgba(247, 250, 248, 0.82);
  border-bottom: 1px solid rgba(227, 236, 230, 0.86);
  backdrop-filter: blur(18px);
}

.topbar .eyebrow {
  margin-bottom: 6px;
}

.topbar h2 {
  font-size: 25px;
  letter-spacing: -0.02em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-chip {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  min-height: 34px;
  padding: 7px 11px;
}

.status-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #1ab364;
  box-shadow: 0 0 0 6px rgba(26, 179, 100, 0.12);
}

.content {
  display: grid;
  gap: 20px;
  width: min(100%, 1500px);
  margin: 0 auto;
  padding: 26px 34px 42px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
  gap: 22px;
  padding: 28px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
}

.hero-copy {
  display: grid;
  gap: 14px;
}

.hero-copy h1 {
  font-size: clamp(34px, 3vw, 46px);
  letter-spacing: -0.03em;
}

.hero-copy .muted {
  max-width: 64ch;
}

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

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

.summary-card {
  display: grid;
  gap: 8px;
  padding: 15px;
  background: var(--panel-soft);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  box-shadow: none;
}

.summary-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.summary-card strong {
  color: var(--brand-strong);
  font-size: 25px;
  line-height: 1.1;
}

.summary-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.page-heading {
  align-items: flex-end;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-heading h1 {
  font-size: clamp(30px, 2.4vw, 40px);
  letter-spacing: -0.025em;
}

.stacked-cell {
  display: grid;
  gap: 4px;
}

.stacked-cell span {
  color: var(--muted);
  font-size: 13px;
}

.stats-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.stat-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 12px;
  min-height: 128px;
  padding: 18px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: none;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: var(--brand);
}

.stat-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stat-card strong {
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.stat-card.warning::before {
  background: #ef4444;
}

.stat-card.warning {
  border-color: #f5c2c2;
  background: linear-gradient(180deg, #ffffff 0%, #fff8f8 100%);
}

.stat-card.success::before {
  background: #16a34a;
}

.stat-card.neutral::before {
  background: #64748b;
}

.stat-card.soft::before {
  background: #84cc16;
}

.content-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: none;
}

.dashboard-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
}

.dashboard-charts-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.8fr);
}

.chart-panel-wide {
  grid-row: span 2;
}

.chart-body {
  display: grid;
  gap: 16px;
  padding: 20px 22px 22px;
}

.daily-line-chart {
  background: #f8fcf9;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  display: grid;
  gap: 10px;
  padding: 16px 14px 12px;
}

.daily-line-chart svg {
  display: block;
  height: 260px;
  overflow: visible;
  width: 100%;
}

.chart-grid-line,
.chart-axis-line {
  stroke: #dce8df;
  stroke-width: 1;
}

.chart-grid-line {
  stroke-dasharray: 4 7;
}

.chart-axis-line {
  stroke-width: 1.5;
}

.line-chart-path {
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.line-chart-path.revenue {
  stroke: var(--brand);
}

.line-chart-path.sessions {
  stroke: #a7d8ba;
  stroke-width: 3;
}

.line-chart-dot {
  stroke: #ffffff;
  stroke-width: 2.5;
}

.line-chart-dot.revenue {
  fill: var(--brand);
}

.line-chart-dot.sessions {
  fill: #a7d8ba;
}

.daily-line-labels {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(14, minmax(0, 1fr));
}

.daily-line-labels span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.chart-legend span {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 7px;
}

.legend-dot {
  border-radius: 999px;
  display: inline-flex;
  height: 9px;
  width: 9px;
}

.legend-dot.revenue {
  background: var(--brand);
}

.legend-dot.sessions {
  background: #b7dec7;
}

.horizontal-chart {
  display: grid;
  gap: 14px;
}

.horizontal-chart-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(110px, 0.9fr) minmax(120px, 1.3fr) minmax(58px, auto);
}

.row-label {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.row-label strong {
  color: var(--text);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.row-bar-track {
  background: #f0f6f2;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.row-bar {
  background: var(--brand);
  border-radius: inherit;
  display: block;
  height: 100%;
  min-width: 4px;
}

.row-bar.secondary {
  background: #7bc69d;
}

.row-bar.danger {
  background: #ef6461;
}

.horizontal-chart-row b {
  color: var(--text);
  font-size: 13px;
  text-align: right;
}

.compact-bars {
  gap: 12px;
}

.health-stack {
  display: grid;
  gap: 18px;
}

.health-label {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.health-label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.health-label b {
  color: var(--text);
  font-size: 18px;
}

.health-track {
  background: #f0f6f2;
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}

.health-track span {
  border-radius: inherit;
  display: block;
  height: 100%;
  min-width: 4px;
}

.health-track .online {
  background: var(--brand);
}

.health-track .maintenance {
  background: #f59e0b;
}

.health-track .offline {
  background: #cbd5d0;
}

.compact-empty {
  padding: 10px 0;
}

.panel-header {
  align-items: flex-start;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px;
}

.panel-header span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.panel-header .eyebrow {
  margin-bottom: 6px;
}

.empty-state {
  color: var(--muted);
  padding: 28px 22px;
}

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

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

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

.data-table tbody tr:hover {
  background: #f8fbf9;
}

.data-table th {
  background: #fbfdfc;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

.table-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

.badge {
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  background: #e8efe9;
  color: #355043;
  font-size: 12px;
  font-weight: 800;
}

.badge.success {
  background: #dcfce7;
  color: #166534;
}

.badge.warning {
  background: #fef3c7;
  color: var(--warning);
}

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

.badge.muted {
  background: #e5e7eb;
  color: #4b5563;
}

.form-panel {
  padding: 20px;
}

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

.field-span-2 {
  grid-column: 1 / -1;
}

.field-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

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

.checkbox-field input {
  width: 18px;
  height: 18px;
  margin: 0;
}

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

.form-note {
  display: grid;
  gap: 8px;
}

.preview-toolbar {
  align-items: center;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
}

.preview-toolbar strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}

.preview-toolbar span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  line-height: 1.5;
}

.field-error {
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
}

.two-column-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}

.theme-config-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  padding: 20px;
}

.theme-form-fields {
  display: grid;
  gap: 18px;
}

.color-input-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 54px minmax(0, 1fr);
}

.color-input-row input[type="color"] {
  cursor: pointer;
  height: 44px;
  padding: 4px;
}

.theme-preview-card {
  align-self: stretch;
  background: var(--preview-bg);
  border: 1px solid rgba(16, 145, 91, 0.12);
  border-radius: 22px;
  box-shadow: none;
  color: var(--preview-text);
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: center;
  min-height: 340px;
  padding: 26px;
}

.theme-preview-card h3 {
  color: var(--preview-primary);
  font-size: 28px;
  line-height: 1.05;
  margin: 0;
}

.theme-preview-card p {
  color: color-mix(in srgb, var(--preview-primary) 62%, #ffffff);
  font-weight: 800;
  margin: 0;
}

.theme-preview-card button {
  background: var(--preview-button-bg);
  border-radius: 14px;
  color: var(--preview-button-text);
  width: 160px;
}

.theme-preview-pill {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.68);
  border-radius: 999px;
  color: var(--preview-primary);
  font-size: 12px;
  font-weight: 900;
  padding: 8px 12px;
  text-transform: uppercase;
}

.theme-preview-frame {
  background: rgba(255, 255, 255, 0.72);
  border: 3px solid var(--preview-primary);
  border-radius: 18px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, 1fr);
  height: 180px;
  padding: 16px;
  width: 150px;
}

.theme-preview-frame span {
  background: rgba(255, 255, 255, 0.88);
  border: 2px solid color-mix(in srgb, var(--preview-primary) 70%, #ffffff);
  border-radius: 10px;
}

.detail-grid {
  display: grid;
  gap: 20px;
  padding: 20px 22px 22px;
}

.definition-list {
  display: grid;
  gap: 16px;
  margin: 0;
}

.definition-list div {
  display: grid;
  gap: 4px;
}

.definition-list dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.definition-list dd {
  margin: 0;
  line-height: 1.5;
}

.code-block {
  margin: 0;
  overflow: auto;
  padding: 20px;
  background: #10251a;
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.5;
}

.code-block.compact {
  max-width: 420px;
  padding: 12px;
}

.thumb {
  width: 72px;
  height: 96px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
}

.thumb.wide {
  width: 112px;
  height: 72px;
}

.preview-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 40;
}

.preview-modal[hidden] {
  display: none;
}

.preview-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(8, 20, 14, 0.58);
  backdrop-filter: blur(3px);
  border-radius: 0;
}

.preview-modal-card {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  max-height: min(90vh, 980px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 20px;
  display: grid;
  gap: 18px;
}

.preview-modal-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.preview-modal-header h2 {
  font-size: 24px;
}

.preview-controls {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.preview-samples {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.preview-sample-item {
  display: grid;
  gap: 8px;
}

.preview-sample-item img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
}

.preview-sample-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.preview-stage-shell {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  justify-content: center;
}

.preview-stage {
  position: relative;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #d7e7dc;
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.preview-stage > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.preview-slots {
  position: absolute;
  inset: 0;
}

.preview-slot {
  position: absolute;
  overflow: hidden;
  border: 2px solid rgba(31, 138, 86, 0.6);
  border-radius: 12px;
  background: rgba(31, 138, 86, 0.08);
  box-shadow: 0 10px 20px rgba(15, 31, 21, 0.08);
}

.preview-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-slot-placeholder {
  align-items: center;
  color: rgba(31, 138, 86, 0.9);
  display: flex;
  font-size: 28px;
  font-weight: 900;
  height: 100%;
  justify-content: center;
  background:
    linear-gradient(135deg, rgba(31, 138, 86, 0.08) 0%, rgba(255, 255, 255, 0.92) 100%);
}

.preview-status {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.preview-status.error {
  color: var(--danger);
}

@media (max-width: 1200px) {
  .dashboard-hero {
    grid-template-columns: 1fr;
  }

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

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

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

  .sidebar-footer {
    display: none;
  }

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

  .dashboard-charts-grid {
    grid-template-columns: 1fr;
  }

  .chart-panel-wide {
    grid-row: auto;
  }

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

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

  .theme-config-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 20px;
  }

  .panel {
    padding: 24px;
  }

  .topbar,
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .content {
    padding: 20px 16px 28px;
  }

  .dashboard-hero {
    padding: 22px;
  }

  .hero-copy h1,
  .page-heading h1 {
    font-size: 28px;
  }

  .hero-summary,
  .stats-grid,
  .form-grid,
  .nav,
  .horizontal-chart-row,
  .preview-controls {
    grid-template-columns: 1fr;
  }

  .daily-line-chart svg {
    height: 190px;
  }

  .daily-line-labels span {
    font-size: 10px;
    transform: rotate(-35deg);
  }

  .preview-toolbar,
  .preview-modal-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    padding: 16px 16px 18px;
  }

  .panel-header,
  .detail-grid {
    padding-left: 16px;
    padding-right: 16px;
  }

  .preview-modal {
    padding: 12px;
  }

  .preview-modal-card {
    padding: 16px;
  }
}

.public-result-body {
  background: #f6faf7;
  color: var(--text);
  min-height: 100vh;
}

.public-result-shell {
  margin: 0 auto;
  max-width: 980px;
  padding: 28px 18px 44px;
}

.public-result-hero {
  margin-bottom: 22px;
}

.public-result-hero h1 {
  font-size: 34px;
  line-height: 1.1;
  margin: 4px 0 10px;
}

.public-result-hero span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.public-result-section {
  margin-top: 22px;
}

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

.public-result-heading h2 {
  font-size: 20px;
  margin: 0;
}

.public-result-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.public-media-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.public-media-item {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 0;
  overflow: hidden;
}

.public-media-item img,
.public-media-item video {
  background: #0f1f17;
  display: block;
  max-height: 78vh;
  object-fit: contain;
  width: 100%;
}

.public-media-item a {
  margin: 12px;
}

.public-download-list {
  display: grid;
  gap: 10px;
}

.admin-media-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  padding: 0 20px 20px;
}

.admin-media-item {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 0;
  overflow: hidden;
  position: relative;
}

.admin-media-item img,
.admin-media-item video {
  background: #10251a;
  display: block;
  max-height: 460px;
  object-fit: contain;
  width: 100%;
}

.admin-media-item figcaption {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.admin-media-item figcaption strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.admin-media-item figcaption span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-media-select {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: inline-flex;
  gap: 6px;
  left: 10px;
  padding: 6px 8px;
  position: absolute;
  top: 10px;
}

.admin-media-print-form {
  display: grid;
  gap: 16px;
}

.admin-media-print-panel {
  align-items: end;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 1fr) 140px auto minmax(180px, auto);
  padding: 16px 20px 0;
}

.muted-text {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 720px) {
  .public-result-shell {
    padding: 22px 12px 32px;
  }

  .public-result-hero h1 {
    font-size: 28px;
  }

  .public-result-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .public-media-grid {
    grid-template-columns: 1fr;
  }

  .admin-media-grid {
    grid-template-columns: 1fr;
    padding: 0 12px 16px;
  }

  .admin-media-print-panel {
    grid-template-columns: 1fr;
    padding: 16px 12px 0;
  }
}
