:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-alt: #f3f9fd;
  --text: #3a3a3a;
  --muted: #667085;
  --line: #d8e9f5;
  --accent: #2a8bcb;
  --accent-strong: #1b4f72;
  --blue: #5fade2;
  --yellow: #ffd34e;
  --amber: #9b6a00;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(27, 79, 114, 0.08);
}

* {
  box-sizing: border-box;
}

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

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

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 14px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: clamp(132px, 16vw, 190px);
  height: auto;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.nav-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.nav-button.is-active {
  border-color: var(--line);
  background: var(--surface-alt);
  color: var(--accent-strong);
  box-shadow: 0 8px 20px rgba(27, 79, 114, 0.06);
}

.app {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(22px, 4vw, 48px) 0 64px;
}

.auth-grid,
.workspace,
.section-grid,
.admin-grid {
  display: grid;
  gap: 18px;
}

.auth-grid {
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  align-items: start;
  min-height: calc(100vh - 140px);
}

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

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

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

.panel,
.stat,
.trip-row,
.reward-card,
.auth-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel.hero-panel {
  align-content: start;
  background: #ffffff;
}

.hero-logo {
  display: block;
  width: min(360px, 82vw);
  height: auto;
  margin-bottom: clamp(20px, 4vw, 34px);
}

.panel,
.auth-card {
  padding: clamp(18px, 3vw, 28px);
}

.panel.compact {
  padding: 18px;
}

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

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

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

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

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

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

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 14px;
  font-size: clamp(2rem, 6vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

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

.lead {
  max-width: 680px;
  font-size: 1.08rem;
}

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

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

.check-field {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
}

.check-field input {
  width: 18px;
  min-height: 18px;
}

.split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

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

.field span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

input,
select {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 128px;
  padding: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(42, 139, 203, 0.2);
  outline-offset: 2px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

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

.button.warning {
  background: var(--yellow);
  color: var(--text);
}

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

.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.stat {
  display: grid;
  gap: 8px;
  min-height: 126px;
  padding: 18px;
}

.stat-value {
  color: var(--accent-strong);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 850;
  line-height: 1;
}

.stat-label {
  color: var(--muted);
  font-weight: 700;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--accent-strong);
  font-weight: 800;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}

.status-dot.off {
  background: var(--danger);
}

.mode-bars {
  display: grid;
  gap: 12px;
}

.mode-bar {
  display: grid;
  gap: 6px;
}

.mode-line {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef5fa;
}

.mode-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.mode-fill.bike {
  background: var(--blue);
}

.mode-fill.motorized {
  background: var(--yellow);
}

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

.trip-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.1fr) repeat(4, minmax(92px, 0.7fr)) minmax(180px, 1.2fr);
  gap: 10px;
  align-items: center;
  padding: 14px;
}

.trip-row.header {
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--accent-strong);
  font-weight: 800;
}

.badge.blue {
  background: #e8f0fa;
  color: var(--blue);
}

.badge.amber {
  background: #fff4c7;
  color: var(--amber);
}

.reward-badge {
  background: var(--yellow);
  color: var(--text);
}

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

.reward-card {
  display: grid;
  gap: 12px;
  min-height: 210px;
  padding: 18px;
  border-top: 4px solid var(--yellow);
}

.privacy-list,
.redemption-list,
.feedback-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.privacy-list li,
.redemption-list li {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
}

.feedback-item {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.feedback-item p {
  margin-bottom: 0;
  white-space: pre-wrap;
}

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

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

.table th {
  color: var(--muted);
  font-size: 0.84rem;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 36px));
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  box-shadow: var(--shadow);
}

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

  .auth-grid,
  .admin-grid,
  .reward-grid {
    grid-template-columns: 1fr;
  }

  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8,
  .span-12 {
    grid-column: 1 / -1;
  }

  .trip-row,
  .trip-row.header {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  .app {
    width: min(100% - 22px, 1180px);
  }

  .nav {
    width: 100%;
    justify-content: flex-start;
  }

  .nav-button {
    flex: 1 1 120px;
  }

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