:root {
  --bg: #f3f1ea;
  --surface: rgba(255, 255, 255, 0.76);
  --surface-strong: #ffffff;
  --surface-dark: #12312b;
  --text: #14231e;
  --muted: #62706a;
  --line: rgba(20, 35, 30, 0.1);
  --accent: #198c6b;
  --accent-deep: #0f6a51;
  --accent-soft: #daf4eb;
  --warn: #f3a347;
  --danger: #d85f4e;
  --shadow: 0 24px 70px rgba(20, 35, 30, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(25, 140, 107, 0.16), transparent 28%),
    radial-gradient(circle at bottom right, rgba(243, 163, 71, 0.18), transparent 24%),
    linear-gradient(135deg, #f6f4ef 0%, #e6ede8 100%);
}

button {
  font: inherit;
  cursor: pointer;
}

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

.sidebar {
  padding: 32px 24px;
  background: linear-gradient(180deg, #11342c 0%, #0c2721 100%);
  color: #f5fbf7;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #35c798, #1f8b6d);
  color: white;
}

.brand-mark img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.brand h1,
.sidebar-card h2,
.hero-card h3,
.topbar h2,
.panel h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
  color: inherit;
  opacity: 0.72;
}

.sidebar-copy,
.sidebar-card p,
.muted {
  color: var(--muted);
}

.sidebar-copy,
.sidebar-card p {
  color: rgba(245, 251, 247, 0.76);
  line-height: 1.7;
}

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

.nav-item {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: #effaf4;
  transition: 180ms ease;
}

.nav-item:hover,
.nav-item.active {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(53, 199, 152, 0.5);
}

.nav-lock-card {
  padding: 16px;
  border-radius: 18px;
  display: grid;
  gap: 6px;
  color: #f6fffb;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06)),
    radial-gradient(circle at top right, rgba(53, 199, 152, 0.18), transparent 40%);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.nav-lock-card strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
}

.nav-lock-card span {
  color: rgba(246, 255, 251, 0.74);
  font-size: 0.9rem;
  line-height: 1.55;
}

.sidebar-card {
  margin-top: auto;
  padding: 20px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.topbar,
.hero-card,
.panel {
  background: var(--surface);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow);
}

.topbar {
  position: relative;
  z-index: 100;
  border-radius: 28px;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.notification-wrapper,
.settings-wrapper {
  position: relative;
  z-index: 110;
}

.notification-btn,
.settings-btn,
.secondary-btn {
  border: 1px solid rgba(20, 35, 30, 0.1);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  font-weight: 700;
}

.notification-btn,
.settings-btn {
  min-height: 48px;
  padding: 0 16px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 22px rgba(20, 35, 30, 0.08);
}

.notification-btn {
  min-width: 52px;
  position: relative;
  padding-inline: 12px;
}

.notification-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.notification-badge {
  position: absolute;
  top: -6px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--danger);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  border: 2px solid #ffffff;
}

.notification-dropdown,
.settings-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 200;
  width: min(420px, calc(100vw - 48px));
  max-height: min(64vh, 560px);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding: 16px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(20, 35, 30, 0.08);
  box-shadow: 0 30px 70px rgba(20, 35, 30, 0.18);
  backdrop-filter: blur(18px);
}

.notification-dropdown-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.notification-dropdown-header {
  display: grid;
  gap: 4px;
}

.settings-dropdown {
  display: grid;
  gap: 10px;
  width: min(320px, calc(100vw - 48px));
}

.settings-dropdown::-webkit-scrollbar,
.notification-dropdown::-webkit-scrollbar {
  width: 8px;
}

.settings-dropdown::-webkit-scrollbar-track,
.notification-dropdown::-webkit-scrollbar-track {
  background: rgba(20, 35, 30, 0.06);
  border-radius: 999px;
}

.settings-dropdown::-webkit-scrollbar-thumb,
.notification-dropdown::-webkit-scrollbar-thumb {
  background: rgba(25, 140, 107, 0.5);
  border-radius: 999px;
}

.settings-label {
  margin-bottom: 4px;
}

.settings-action {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid rgba(20, 35, 30, 0.08);
  background: #f6faf8;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.settings-action-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #ffffff;
}

.settings-action-danger {
  color: var(--danger);
  background: rgba(216, 95, 78, 0.08);
}

.status-pill,
.primary-btn,
.ghost-btn,
.tag,
.badge,
.meta-chip,
.trend {
  border-radius: 999px;
}

.status-pill {
  padding: 10px 14px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 700;
}

.primary-btn,
.ghost-btn {
  border: 0;
  padding: 11px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  text-decoration: none;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: white;
}

.ghost-btn {
  background: rgba(25, 140, 107, 0.08);
  color: var(--accent-deep);
}

.hero-card {
  margin-top: 22px;
  border-radius: 32px;
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 20px;
  background:
    linear-gradient(135deg, rgba(17, 52, 44, 0.95), rgba(20, 99, 77, 0.86)),
    linear-gradient(180deg, #ffffff, #f2faf6);
  color: #f6fffb;
}

.hero-copy .eyebrow,
.hero-copy p,
.hero-highlight p {
  color: rgba(246, 255, 251, 0.78);
}

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

.hero-highlight div {
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-highlight span {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 700;
}

.dashboard-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.panel {
  border-radius: 28px;
  padding: 22px;
  min-width: 0;
}

.panel.span-2 {
  grid-column: span 2;
}

.panel-header,
.item-row,
.truck-footer,
.timeline-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.report-actions .ghost-btn {
  white-space: nowrap;
}

.report-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin: 16px 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(25, 140, 107, 0.05);
}

.report-controls label {
  flex: 1 1 220px;
}

.report-controls span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.summary-grid,
.mini-grid,
.role-grid,
.route-card-grid,
.truck-grid,
.report-grid {
  display: grid;
  gap: 16px;
}

.summary-grid {
  margin-top: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card,
.mini-card,
.role-card,
.route-card,
.truck-card,
.report-card,
.stack-item,
.insight-item {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
}

.stat-card strong,
.mini-card strong,
.report-card strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 1.9rem;
  font-family: "Space Grotesk", sans-serif;
}

.stack-list,
.timeline-list,
.insight-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.meta-chip,
.tag,
.badge,
.trend {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
}

.meta-chip,
.tag,
.badge {
  padding: 8px 12px;
}

.tag {
  background: rgba(25, 140, 107, 0.12);
  color: var(--accent-deep);
}

.tag.warning {
  background: rgba(243, 163, 71, 0.18);
  color: #a05d0c;
}

.tag.positive {
  background: rgba(53, 199, 152, 0.18);
  color: #0f6a51;
}

.badge.high,
.badge.in-progress,
.badge.on-route {
  background: rgba(216, 95, 78, 0.12);
  color: var(--danger);
}

.badge.medium,
.badge.starting-route,
.badge.maintenance,
.badge.under-maintenance {
  background: rgba(243, 163, 71, 0.16);
  color: #a05d0c;
}

.badge.low,
.badge.completed,
.badge.available,
.badge.done {
  background: rgba(53, 199, 152, 0.16);
  color: #0f6a51;
}

.badge.scheduled,
.badge.unavailable,
.badge.delayed,
.badge.not-done {
  background: rgba(17, 52, 44, 0.1);
  color: #12312b;
}

.mini-grid,
.route-card-grid,
.truck-grid,
.report-grid {
  margin-top: 16px;
}

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

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

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

.report-grid.compact {
  grid-template-columns: 1fr;
}

.record-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field-full {
  grid-column: 1 / -1;
}

.field span {
  font-size: 0.95rem;
  font-weight: 700;
}

.field input,
.field select,
.field textarea,
.toolbar-search input,
.toolbar select,
.toolbar input[type="date"] {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(20, 35, 30, 0.12);
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  font: inherit;
}

.field textarea {
  min-height: 140px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.toolbar-search input:focus,
.toolbar select:focus,
.toolbar input[type="date"]:focus {
  outline: 2px solid rgba(25, 140, 107, 0.18);
  border-color: rgba(25, 140, 107, 0.55);
}

.day-picker-shell {
  padding: 14px 0 4px;
  border-radius: 20px;
  background: transparent;
}

.day-picker-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.day-picker-header .eyebrow {
  margin: 0;
}

.day-picker-hint {
  color: var(--accent-deep);
  font-size: 0.86rem;
  font-weight: 800;
}

.day-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.day-option {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(25, 140, 107, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  box-shadow: 0 8px 18px rgba(20, 35, 30, 0.06);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.day-option:hover {
  transform: translateY(-2px);
  border-color: rgba(25, 140, 107, 0.42);
  background: rgba(25, 140, 107, 0.08);
}

.day-option strong,
.day-option span {
  display: inline;
  line-height: 1;
}

.day-option strong {
  color: var(--accent-deep);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.96rem;
}

.day-option span {
  color: inherit;
  font-size: 0;
  font-weight: 800;
}

.day-option.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(15, 106, 81, 0.24);
}

.day-option.active::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
}

.day-option.active strong,
.day-option.active span {
  color: #ffffff;
}

.helper-text {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
}

/* Login and account settings */
.login-body {
  min-height: 100vh;
}

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

.login-card {
  position: relative;
  width: min(880px, 100%);
  padding: clamp(22px, 4vw, 36px);
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.72)),
    radial-gradient(circle at top right, rgba(25, 140, 107, 0.16), transparent 38%);
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-back-link {
  position: absolute;
  top: 24px;
  right: 24px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--accent-deep);
  background: rgba(218, 244, 235, 0.86);
  border: 1px solid rgba(25, 140, 107, 0.12);
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(20, 35, 30, 0.08);
  transition: 180ms ease;
}

.login-back-link:hover {
  transform: translateY(-1px);
  color: #fff;
  background: var(--accent);
}

.login-card .brand {
  align-items: center;
  padding-right: 180px;
}

.login-card .brand h1 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.45rem);
  line-height: 1;
}

.login-copy {
  margin-top: 26px;
  padding: 24px;
  border-radius: 28px;
  color: #f6fffb;
  background:
    linear-gradient(135deg, rgba(18, 49, 43, 0.96), rgba(25, 140, 107, 0.86)),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 32%);
  overflow: hidden;
}

.login-copy h2,
.account-setup-card h3,
.form-section-title h3,
.account-email-notice h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.login-copy h2 {
  max-width: 680px;
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1;
}

.login-copy p:not(.eyebrow) {
  max-width: 680px;
  margin: 12px 0 0;
  color: rgba(246, 255, 251, 0.78);
  line-height: 1.7;
}

.login-form {
  margin-top: 18px;
  grid-template-columns: 1fr;
}

.login-form-footer {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

.forgot-password-link {
  color: var(--accent-deep);
  font-weight: 800;
  text-decoration: none;
}

.forgot-password-link:hover {
  text-decoration: underline;
}

.forgot-complete-actions {
  margin-top: 18px;
}

.flash-message {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(20, 35, 30, 0.08);
  background: rgba(255, 255, 255, 0.82);
  font-weight: 800;
  box-shadow: 0 12px 34px rgba(20, 35, 30, 0.08);
}

.flash-message.error {
  color: #943628;
  background: rgba(216, 95, 78, 0.12);
  border-color: rgba(216, 95, 78, 0.22);
}

.flash-message.success {
  color: var(--accent-deep);
  background: rgba(25, 140, 107, 0.12);
  border-color: rgba(25, 140, 107, 0.22);
}

.main-content > .flash-message {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 500;
  width: min(420px, calc(100vw - 32px));
  margin-top: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
}

.main-content > .flash-message.error {
  background: rgba(255, 244, 242, 0.98);
}

.main-content > .flash-message.success {
  background: rgba(235, 250, 244, 0.98);
}

.account-setup-card,
.account-password-form {
  margin-top: 18px;
  border-radius: 28px;
  border: 1px solid rgba(20, 35, 30, 0.08);
  box-shadow: 0 18px 46px rgba(20, 35, 30, 0.08);
}

.account-setup-card {
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 18px;
  align-items: stretch;
}

.account-setup-card.needs-email {
  color: #f6fffb;
  background:
    linear-gradient(135deg, rgba(18, 49, 43, 0.98), rgba(15, 106, 81, 0.9)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.16), transparent 34%);
}

.account-setup-card.has-email {
  background:
    linear-gradient(135deg, rgba(218, 244, 235, 0.92), rgba(255, 255, 255, 0.9)),
    radial-gradient(circle at top right, rgba(25, 140, 107, 0.16), transparent 34%);
}

.account-setup-copy {
  min-width: 0;
  display: grid;
  align-content: center;
}

.account-setup-copy p:not(.eyebrow) {
  margin: 10px 0 0;
  line-height: 1.65;
}

.account-setup-card.needs-email .account-setup-copy p:not(.eyebrow) {
  color: rgba(246, 255, 251, 0.8);
}

.account-email-form {
  margin: 0;
  padding: 18px;
  align-content: center;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.account-email-form .field span {
  color: var(--text);
}

.email-status {
  margin-top: 16px;
  padding: 14px;
  display: grid;
  gap: 4px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.has-email .email-status {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(20, 35, 30, 0.08);
}

.email-status span,
.email-status em {
  color: var(--muted);
  font-size: 0.86rem;
  font-style: normal;
  font-weight: 800;
}

.needs-email .email-status span,
.needs-email .email-status em {
  color: rgba(246, 255, 251, 0.72);
}

.email-status strong {
  overflow-wrap: anywhere;
}

.account-password-form {
  padding: 20px;
  background: rgba(255, 255, 255, 0.78);
}

.form-section-title {
  padding-bottom: 4px;
}

.form-section-title h3 {
  font-size: 1.35rem;
}

.account-email-notice {
  margin-top: 18px;
  padding: 20px;
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(218, 244, 235, 0.92)),
    radial-gradient(circle at top right, rgba(25, 140, 107, 0.18), transparent 36%);
  border: 1px solid rgba(25, 140, 107, 0.16);
  box-shadow: var(--shadow);
}

.account-email-notice p:not(.eyebrow) {
  margin: 8px 0 0;
  max-width: 720px;
  color: var(--muted);
  line-height: 1.65;
}

body.email-gated .nav-item,
body.email-gated .hero-card,
body.email-gated .dashboard-grid,
body.email-gated [data-panel] {
  display: none !important;
}

body.email-gated .account-email-notice {
  min-height: 146px;
  padding: clamp(22px, 3vw, 30px);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(218, 244, 235, 0.98)),
    radial-gradient(circle at top right, rgba(25, 140, 107, 0.24), transparent 38%);
}

body.email-gated .account-email-notice .primary-btn {
  min-width: 146px;
  justify-content: center;
}

.toolbar,
.toolbar-split,
.toolbar-triple {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.toolbar {
  margin-top: 16px;
}

.toolbar-search {
  flex: 1 1 260px;
}

.toolbar > label:not(.toolbar-search),
.toolbar-split > label:not(.toolbar-search),
.toolbar-triple > label:not(.toolbar-search) {
  flex: 0 1 auto;
  min-width: 170px;
}

/* Overview module */
.overview-grid .stat-card {
  min-height: 148px;
}

.overview-schedule-list .stack-item,
.overview-route-list .stack-item,
.overview-monitoring-list .stack-item {
  min-height: 142px;
}

.overview-truck-grid .mini-card {
  text-align: center;
}

.role-grid {
  margin-top: 16px;
  grid-template-columns: 1fr;
}

.role-card strong {
  display: block;
  margin: 8px 0;
  font-size: 1.15rem;
  font-family: "Space Grotesk", sans-serif;
}

.overview-report-grid .report-card {
  padding: 16px;
}

.overview-report-grid .report-card strong {
  font-size: 1.55rem;
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e8ece9;
  overflow: hidden;
  margin: 12px 0 8px;
}

.progress-track.large {
  height: 12px;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #32b98b, #0f6a51);
}

.table-wrap {
  margin-top: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 22px;
}

/* Collection Schedule Management module */
.schedule-table-wrap table {
  min-width: 1040px;
}

.barangay-table-wrap table {
  min-width: 560px;
}

.monitoring-table-wrap table {
  min-width: 1120px;
}

.today-monitoring-board {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid rgba(25, 140, 107, 0.16);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(50, 185, 139, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(247, 252, 250, 0.96), #ffffff);
}

.today-monitoring-header,
.today-monitoring-grid,
.today-route-card {
  display: grid;
  gap: 14px;
}

.today-monitoring-header {
  grid-template-columns: 1fr auto;
  align-items: start;
  margin-bottom: 16px;
}

.today-monitoring-header h4 {
  margin: 4px 0 0;
  font-size: 1.08rem;
}

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

.today-route-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 38px rgba(20, 35, 30, 0.07);
}

.today-route-action {
  width: fit-content;
  margin-top: 4px;
}

.linked-route-summary {
  padding: 16px;
  border: 1px solid rgba(25, 140, 107, 0.16);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(232, 247, 241, 0.72), rgba(255, 255, 255, 0.92));
  color: var(--muted);
}

.linked-route-summary span,
.linked-route-summary strong,
.linked-route-summary small {
  display: block;
}

.linked-route-summary span {
  color: var(--accent-deep);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.linked-route-summary strong {
  margin-top: 4px;
  color: var(--text);
}

.linked-route-summary small {
  margin-top: 4px;
  line-height: 1.5;
}

.schedule-mini-grid .mini-card {
  border-top: 4px solid rgba(25, 140, 107, 0.18);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

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

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

th:last-child,
td:last-child {
  min-width: 170px;
}

.table-actions {
  min-width: 160px;
  display: grid;
  grid-template-columns: repeat(2, minmax(72px, 1fr));
  gap: 8px;
  align-items: center;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.action-btn {
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(25, 140, 107, 0.1);
  color: var(--accent-deep);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.action-btn:hover {
  transform: translateY(-1px);
  background: rgba(25, 140, 107, 0.18);
}

.action-btn:focus-visible {
  outline: 3px solid rgba(25, 140, 107, 0.22);
  outline-offset: 2px;
}

.action-btn.danger {
  background: rgba(216, 95, 78, 0.11);
  color: var(--danger);
}

.action-btn.danger:hover {
  background: rgba(216, 95, 78, 0.18);
}

.action-btn:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 16px;
}

/* Route Monitoring module */
.route-timeline-list .timeline-content {
  background: linear-gradient(180deg, #ffffff, #f7fcfa);
}

.route-monitor-grid .route-card {
  border-left: 4px solid rgba(25, 140, 107, 0.25);
}

.timeline-marker {
  width: 14px;
  height: 14px;
  margin-top: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #32b98b, #0f6a51);
  box-shadow: 0 0 0 6px rgba(50, 185, 139, 0.12);
}

.timeline-content {
  padding: 18px;
  border-radius: 22px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.timeline-meta {
  flex-wrap: wrap;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.subtle,
.truck-footer {
  color: var(--muted);
  font-size: 0.93rem;
}

/* Truck Availability module */
.truck-availability-grid .truck-card {
  background: linear-gradient(180deg, #ffffff, #f8fbfa);
}

.truck-status-grid .mini-card {
  text-align: center;
  border-bottom: 4px solid rgba(17, 52, 44, 0.12);
}

.report-card p,
.stack-item p,
.truck-card p,
.route-card p,
.insight-item p {
  margin: 6px 0 0;
}

.trend {
  padding: 6px 10px;
  background: rgba(25, 140, 107, 0.08);
  color: var(--accent-deep);
}

/* Reporting module */
.report-detail-grid .report-card {
  min-height: 210px;
}

.report-insight-list .insight-item {
  border-left: 4px solid rgba(243, 163, 71, 0.45);
}

/* Public schedule page */
.public-body {
  min-height: 100vh;
  padding: 28px;
}

.public-action-bar {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 20;
}

.public-action-bar a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(20, 35, 30, 0.1);
  box-shadow: 0 16px 36px rgba(20, 35, 30, 0.12);
  color: var(--accent-deep);
  font-weight: 800;
  text-decoration: none;
}

.public-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.public-hero {
  min-height: 420px;
  padding: 34px;
  border-radius: 34px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 26px;
  align-items: start;
  background:
    linear-gradient(135deg, rgba(17, 52, 44, 0.95), rgba(25, 140, 107, 0.82)),
    linear-gradient(180deg, #ffffff, #edf7f1);
  color: #f7fffb;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.55);
  overflow: hidden;
}

.public-brand {
  grid-column: 1 / -1;
}

.public-brand .eyebrow,
.public-hero-copy .eyebrow,
.public-hero-copy p {
  color: rgba(247, 255, 251, 0.76);
}

.public-brand h1,
.public-hero-copy h2,
.public-schedule-section h3,
.public-schedule-card h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.public-brand h1 {
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 0.96;
}

.public-hero-copy h2 {
  max-width: 780px;
  font-size: clamp(1.8rem, 3vw, 3.3rem);
  line-height: 1;
}

.public-hero-copy p {
  max-width: 720px;
  line-height: 1.75;
}

.public-hero-stats {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.public-hero-stats div,
.public-search-card,
.public-schedule-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(20, 35, 30, 0.08);
  box-shadow: 0 16px 42px rgba(20, 35, 30, 0.1);
}

.public-hero-stats div {
  padding: 16px;
  border-radius: 20px;
  color: var(--text);
}

.public-hero-stats strong {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 2rem;
  line-height: 1;
}

.public-hero-stats span,
.public-schedule-meta span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.public-search-card {
  align-self: end;
  padding: 22px;
  border-radius: 26px;
  color: var(--text);
}

.public-search-card .toolbar-search {
  display: block;
  margin: 14px 0 12px;
}

.public-schedule-section {
  margin-top: 24px;
  padding: 28px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.public-schedule-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.public-schedule-card {
  padding: 20px;
  border-radius: 24px;
}

.public-schedule-card .item-row {
  align-items: flex-start;
}

.public-schedule-meta {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.public-schedule-meta div {
  padding: 14px;
  border-radius: 18px;
  background: #f6faf8;
  border: 1px solid rgba(20, 35, 30, 0.07);
}

.public-schedule-meta strong {
  display: block;
  margin-top: 4px;
}

.public-empty {
  margin-top: 18px;
}

.hidden {
  display: none;
}

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

  .sidebar {
    padding: 24px 20px;
  }

  .sidebar-card {
    margin-top: 0;
  }

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

  .hero-card {
    grid-template-columns: 1fr;
  }

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

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

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

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

  .topbar {
    padding: 18px;
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-actions,
  .hero-highlight,
  .dashboard-grid,
  .summary-grid,
  .mini-grid,
  .route-card-grid,
  .today-monitoring-grid,
  .truck-grid,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-grid {
    display: grid;
  }

  .panel.span-2 {
    grid-column: span 1;
  }

  .topbar-actions {
    width: 100%;
    justify-content: stretch;
  }

  .record-form {
    grid-template-columns: 1fr;
  }

  .account-setup-card {
    grid-template-columns: 1fr;
  }

  .account-email-notice {
    flex-direction: column;
    align-items: flex-start;
  }

  .account-email-notice .primary-btn {
    width: 100%;
  }

  .field-full {
    grid-column: auto;
  }

  .toolbar-search,
  .toolbar > label:not(.toolbar-search),
  .toolbar-split > label:not(.toolbar-search),
  .toolbar-triple > label:not(.toolbar-search),
  .notification-wrapper,
  .settings-wrapper,
  .status-pill,
  .primary-btn,
  .ghost-btn,
  .secondary-btn,
  .notification-btn,
  .settings-btn {
    width: 100%;
    justify-content: center;
  }

  .notification-dropdown,
  .settings-dropdown {
    width: min(100%, calc(100vw - 36px));
    max-height: min(62vh, 460px);
  }

  .public-body {
    padding: 18px;
  }

  .public-action-bar {
    position: static;
    display: flex;
    justify-content: flex-end;
    margin-bottom: 14px;
  }

  .public-hero,
  .public-schedule-section {
    border-radius: 24px;
    padding: 22px;
  }

  .public-hero-stats,
  .public-schedule-grid,
  .public-schedule-meta {
    grid-template-columns: 1fr;
  }

  table {
    min-width: 720px;
  }
}

@media (max-width: 640px) {
  .sidebar {
    padding: 18px 14px;
    gap: 18px;
  }

  .brand {
    align-items: flex-start;
  }

  .brand h1 {
    font-size: 2.2rem;
    line-height: 1.05;
  }

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

  .main-content {
    padding: 14px;
  }

  .topbar,
  .hero-card,
  .panel,
  .login-card {
    border-radius: 22px;
    padding: 18px;
  }

  .login-shell {
    padding: 14px;
  }

  .login-back-link {
    position: static;
    width: 100%;
    margin-bottom: 16px;
  }

  .login-card .brand {
    padding-right: 0;
  }

  .login-copy,
  .account-setup-card,
  .account-password-form,
  .account-email-notice {
    border-radius: 20px;
    padding: 18px;
  }

  .account-email-form {
    border-radius: 18px;
    padding: 16px;
  }

  .public-body {
    padding: 14px;
  }

  .public-hero,
  .public-schedule-section,
  .public-schedule-card {
    border-radius: 20px;
    padding: 18px;
  }

  .hero-highlight div,
  .stat-card,
  .mini-card,
  .role-card,
  .route-card,
  .truck-card,
  .report-card,
  .stack-item,
  .insight-item,
  .timeline-content {
    padding: 16px;
  }

  .panel-header,
  .item-row,
  .truck-footer,
  .timeline-meta {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .notification-dropdown,
  .settings-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 100%;
    margin-top: 10px;
    max-height: min(58vh, 420px);
    overflow-x: hidden;
    overflow-y: auto;
  }

  .table-wrap {
    margin-inline: -4px;
    padding-bottom: 6px;
  }

  table {
    min-width: 620px;
  }

  th,
  td {
    padding: 12px 10px;
  }
}
