:root {
  --bg: #eef8f5;
  --surface-2: #eaf7f2;
  --line: #d8ebe5;
  --teal: #12a883;
  --teal-dark: #08745f;
  --blue: #2386d1;
  --green: #12a883;
  --brand: #12a883;
  --brand-dark: #08745f;
  --soft: #eaf8f4;
  --shadow: 0 14px 34px rgba(10, 58, 76, 0.11);
}

body,
.app-view {
  background:
    linear-gradient(155deg, rgba(18, 168, 131, 0.12), rgba(35, 134, 209, 0.12) 48%, rgba(255, 255, 255, 0.88)),
    #f5fbf9;
}

.auth-view {
  background:
    linear-gradient(145deg, rgba(18, 168, 131, 0.22), rgba(35, 134, 209, 0.2)),
    #f6fbff;
}

.brand-panel,
.dashboard-hero {
  border: 0;
  background: linear-gradient(140deg, #0aa77e 0%, #108fb6 58%, #257fd0 100%);
  color: #fff;
  box-shadow: 0 18px 44px rgba(8, 83, 102, 0.22);
}

.brand-panel .eyebrow,
.dashboard-hero .eyebrow {
  color: #d9fff5;
}

.brand-copy,
.dashboard-hero .muted {
  color: rgba(255, 255, 255, 0.84);
}

.brand-mark {
  color: #08745f;
  background: #fff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.auth-panel,
.sidebar,
.topbar,
.metric-card,
.surface,
.tool-panel,
.item-card,
.resident-card,
.resident-edit-panel,
.incident-lane,
.incident-create-panel,
.today-court-card,
.slot-period,
.time-window-card,
.table-wrap,
.zone-tile,
.profile-button,
.card,
.timeline-row,
.item,
.login,
.reserve-card {
  border-color: rgba(8, 116, 95, 0.14) !important;
  background-color: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.topbar,
.top {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(8, 116, 95, 0.12);
  backdrop-filter: blur(12px);
}

.button-primary,
.btn.primary,
.auth-tab.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, #0aa77e, #2386d1);
  color: #fff;
  box-shadow: 0 10px 22px rgba(18, 168, 131, 0.2);
}

.button-primary:hover,
.button-primary:focus-visible,
.btn.primary:hover,
.btn.primary:focus-visible {
  background: linear-gradient(135deg, #08745f, #176eaf);
}

.button-ghost,
.btn.ghost,
.auth-tab {
  border-color: rgba(8, 116, 95, 0.18);
  background: #fff;
}

.main-nav .nav-button.is-active,
.nav-button.is-active,
.profile-button:hover,
.profile-button:focus-visible {
  color: #075f52;
  background: #e7f8f2;
}

.metric-card {
  position: relative;
  overflow: hidden;
  border-top: 4px solid #12a883;
  cursor: pointer;
}

.metric-card:nth-child(2n) {
  border-top-color: #2386d1;
}

.metric-value,
.today-court-head h3,
.timeline-head strong,
.slot-time,
.time {
  color: #08745f;
}

.dashboard-glance span,
.hero-stat,
.badge,
.door-chip {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.15);
}

.badge,
.door-chip {
  color: #08745f;
  background: #e9f8f3;
}

.badge.success {
  color: #06724d;
  background: #e5fff3;
}

.badge.warning {
  color: #8a5700;
  background: #fff6dd;
}

.today-booking,
.today-free,
.slot-button,
.timeline-slot,
.slot {
  border-color: #b8e7d8;
  background: #f2fcf8;
}

.slot-button.free:hover,
.slot-button.free:focus-visible,
.timeline-slot:not(.booked):hover,
.timeline-slot:not(.booked):focus-visible,
.slot:not([disabled]):hover,
.slot:not([disabled]):focus-visible {
  border-color: #12a883;
  box-shadow: 0 0 0 3px rgba(18, 168, 131, 0.14);
}

.slot-button.booked,
.timeline-slot.booked,
.slot[disabled] {
  color: #6c7880;
  border-color: #d9e2e6;
  background: #edf2f4;
  box-shadow: none;
}

.slot-button.mine,
.timeline-slot.selected,
.slot.active {
  color: #fff;
  border-color: #0aa77e;
  background: linear-gradient(135deg, #0aa77e, #2386d1);
}

.incident-lane.is-pending {
  background: linear-gradient(180deg, #fffaf0, #fff);
}

.incident-lane.is-resolved {
  background: linear-gradient(180deg, #effcf5, #fff);
}

.timeline-scroll {
  scrollbar-color: #12a883 #e8f2ef;
}

@media (max-width: 760px) {
  .app-main,
  .wrap {
    padding: 10px;
  }

  .topbar,
  .top {
    position: sticky;
    top: 0;
    z-index: 20;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
  }

  .metric-card {
    min-height: 94px;
    padding: 12px;
  }

  .metric-value {
    font-size: 1.55rem;
  }

  .metric-label {
    font-size: 0.84rem;
  }

  .dashboard-board,
  .dashboard-hero,
  .dashboard-section,
  .incidents-page,
  .incident-lanes,
  .today-courts-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-hero {
    gap: 12px;
    padding: 16px;
  }

  .dashboard-hero h2 {
    font-size: 1.28rem;
  }

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

  .dashboard-glance span,
  .hero-stat {
    min-width: 0;
  }

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

  .today-booking,
  .today-free,
  .slot-button.timeline-segment {
    grid-template-columns: 86px 1fr;
  }

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

  .timeline-row {
    padding: 8px;
  }

  .timeline-track {
    gap: 5px;
  }

  .timeline-slot {
    min-width: 72px;
  }

  .item {
    grid-template-columns: 58px 1fr;
  }

  .item .actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .item .actions .btn {
    flex: 1;
  }
}
