:root {
  --bg: #eef3f0;
  --bg-elev: #ffffff;
  --sidebar: #f7faf8;
  --panel: #ffffff;
  --line: rgba(20, 50, 38, 0.1);
  --line-strong: rgba(20, 50, 38, 0.16);
  --text: #14241c;
  --muted: #5d7268;
  --accent: #0d9f56;
  --accent-2: #1577d4;
  --warn: #c4841d;
  --danger: #d64545;
  --ok: #0d9f56;
  --btn-text: #ffffff;
  --field-bg: #f3f7f5;
  --hover: rgba(13, 159, 86, 0.08);
  --active: rgba(13, 159, 86, 0.12);
  --shadow: 0 14px 36px rgba(20, 50, 38, 0.08);
  --radius: 14px;
  --sans: "Outfit", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sidebar-w: 270px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
}

body {
  background:
    radial-gradient(ellipse 70% 45% at 0% 0%, rgba(13, 159, 86, 0.1), transparent 55%),
    radial-gradient(ellipse 50% 35% at 100% 0%, rgba(21, 119, 212, 0.07), transparent 50%),
    linear-gradient(180deg, #f5f8f6 0%, var(--bg) 40%, #e8efe9 100%);
}

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

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

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, #ffffff 0%, #f4f8f6 100%);
  border-right: 1px solid var(--line);
  padding: 1.25rem 0.9rem 1rem;
  overflow: auto;
  z-index: 30;
  box-shadow: 4px 0 24px rgba(20, 50, 38, 0.04);
}

.sidebar-brand {
  padding: 0.35rem 0.7rem 1.2rem;
  animation: fade-up 0.45s ease both;
}

.sidebar-brand-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.sidebar-close {
  display: none !important;
  flex-shrink: 0;
  font-size: 1.05rem;
  line-height: 1;
}

.brand-name {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.brand-sub {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.nav-section {
  margin: 1rem 0.7rem 0.35rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.75rem;
  border-radius: 10px;
  color: #3d5248;
  font-size: 0.92rem;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover {
  background: var(--hover);
  color: var(--text);
}

.nav-link.active {
  background: var(--active);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(13, 159, 86, 0.28);
}

.nav-icon {
  width: 1.1rem;
  text-align: center;
  color: var(--accent);
  opacity: 0.85;
}

.sidebar-foot {
  padding: 0.85rem 0.55rem 0.25rem;
  border-top: 1px solid var(--line);
  margin-top: 0.75rem;
}

.sidebar-credit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.55rem 0.15rem 0.2rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.sidebar-credit a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.sidebar-credit a:hover {
  text-decoration: underline;
}

.conn-status {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: var(--field-bg);
  border: 1px solid var(--line);
}

.conn-status.ok {
  color: var(--ok);
}
.conn-status.bad {
  color: var(--danger);
}

.live-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
  margin-bottom: 0.9rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.live-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #0d9f56;
  box-shadow: 0 0 0 0 rgba(13, 159, 86, 0.45);
  animation: live-pulse 1.8s ease-out infinite;
}

.live-hint {
  margin-left: auto;
  font-size: 0.78rem;
  opacity: 0.85;
}

@keyframes live-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(13, 159, 86, 0.45);
  }
  70% {
    box-shadow: 0 0 0 0.55rem rgba(13, 159, 86, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(13, 159, 86, 0);
  }
}

.main-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.35rem;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  animation: fade-up 0.5s ease both;
}

.topbar-title {
  flex: 1;
  min-width: 0;
}

.topbar-title h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.topbar-title p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  font-size: 0.85rem;
  font-weight: 500;
}

.user-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 159, 86, 0.2);
}

.content {
  padding: 1.25rem 1.35rem 2rem;
  flex: 1;
  animation: fade-up 0.55s ease both;
}

.app-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
  padding: 0.85rem 1.35rem;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  font-size: 0.82rem;
  color: var(--muted);
}

.app-footer p {
  margin: 0;
}

.app-footer a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.app-footer a:hover {
  text-decoration: underline;
}

.footer-version strong {
  color: var(--text);
  font-family: var(--mono);
  font-weight: 500;
}

.icon-btn {
  display: none;
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 10px;
  cursor: pointer;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--btn-text);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, background 0.15s ease;
}

.btn:hover {
  filter: brightness(1.05);
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.btn.ghost {
  background: var(--bg-elev);
  border-color: var(--line-strong);
  color: var(--text);
}

.btn.ghost:hover {
  background: var(--hover);
  filter: none;
}

.email-tabs .btn.active {
  background: var(--hover);
  border-color: var(--line-strong);
  font-weight: 600;
}

.btn.danger {
  background: rgba(214, 69, 69, 0.1);
  border-color: rgba(214, 69, 69, 0.28);
  color: var(--danger);
}

.btn.emergency {
  background: #d64545;
  border-color: #c0392b;
  color: #fff;
}

.btn.emergency:hover {
  background: #e05555;
  filter: none;
}

.btn.emergency:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

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

.stat {
  padding: 1rem 1.05rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.stat .label {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat .value {
  margin: 0.45rem 0 0;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.stat .sub {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

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

.panel.panel--overflow {
  overflow: visible;
}

.panel.panel--overflow .panel-body {
  overflow: visible;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.05rem;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.panel-head p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.follow-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.follow-toggle input {
  accent-color: #0d9f56;
}

.panel-body {
  padding: 1rem 1.05rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
}

.grid-stack {
  display: grid;
  gap: 1rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.9rem;
}

.toolbar .spacer {
  flex: 1;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem;
  margin-bottom: 1rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
}

.filter-field {
  display: grid;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  min-width: 120px;
}

.filter-field.grow {
  flex: 1 1 180px;
  min-width: 160px;
}

.filter-field .field,
.filter-field .search {
  min-width: 130px;
}

.vehicle-picker {
  position: relative;
  z-index: 40;
  width: 100%;
  min-width: 0;
}

.vehicle-picker .search {
  width: 100%;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
}

.vehicle-picker-selected {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.vehicle-picker-selected.is-set {
  color: var(--ok, #0d9f56);
  font-weight: 600;
}

.vehicle-picker-list {
  position: relative;
  z-index: 50;
  max-height: 260px;
  overflow: auto;
  margin-top: 0.45rem;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 24px rgba(20, 40, 30, 0.1);
  display: grid;
  gap: 0.25rem;
}

.vehicle-picker-list[hidden] {
  display: none !important;
}

.vehicle-picker-option {
  display: grid;
  gap: 0.15rem;
  text-align: left;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.vehicle-picker-option:hover,
.vehicle-picker-option.active {
  background: var(--active);
  border-color: rgba(13, 159, 86, 0.25);
}

.vehicle-picker-option strong {
  font-size: 0.92rem;
}

.vehicle-picker-option span {
  font-size: 0.78rem;
  color: var(--muted);
}

.vehicle-picker-empty {
  padding: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.dr-controls {
  display: grid;
  gap: 0.85rem;
}

.dr-controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}

.dr-controls-row .filter-field {
  flex: 0 1 180px;
}

.dr-controls-row .filter-field .field {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.dr-controls .filter-actions {
  margin-left: 0;
}

@media (max-width: 720px) {
  .dr-controls-row .filter-field {
    flex: 1 1 140px;
  }
}

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-left: auto;
}

.field,
.search {
  appearance: none;
  width: 100%;
  border: 1px solid var(--line-strong);
  background: var(--field-bg);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field:focus,
.search:focus {
  border-color: rgba(13, 159, 86, 0.55);
  box-shadow: 0 0 0 3px rgba(13, 159, 86, 0.12);
  background: #ffffff;
}

.search {
  max-width: 280px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

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

label.form-label,
.form-label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.check-list {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field-bg);
  padding: 0.35rem;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

.check-row:hover {
  background: var(--hover);
}

.check-row input {
  margin-top: 0.15rem;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

table.data th,
table.data td {
  text-align: left;
  padding: 0.75rem 0.65rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

table.data th {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

table.data tr:hover td {
  background: var(--hover);
}

.mono {
  font-family: var(--mono);
  font-size: 0.8rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--mono);
}

.pill::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: currentColor;
}

.pill.ok {
  color: var(--ok);
  background: rgba(13, 159, 86, 0.12);
}
.pill.warn {
  color: var(--warn);
  background: rgba(196, 132, 29, 0.12);
}
.pill.bad {
  color: var(--danger);
  background: rgba(214, 69, 69, 0.1);
}
.pill.neutral {
  color: var(--muted);
  background: rgba(20, 50, 38, 0.06);
}

.row-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.map-frame {
  height: min(68vh, 640px);
  min-height: 420px;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}

.map-frame.sm {
  height: 360px;
  min-height: 300px;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.leaflet-container {
  background: #e8eee9;
  font: inherit;
}

.vehicle-marker-wrap {
  background: transparent !important;
  border: none !important;
}

.vehicle-marker {
  position: relative;
  width: 28px;
  height: 28px;
  transform: rotate(var(--heading, 0deg));
  transition: transform 0.35s ease;
}

.vehicle-marker-body {
  position: absolute;
  inset: 6px;
  background: var(--marker, #0d9f56);
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
}

.vehicle-marker.offline .vehicle-marker-body {
  border-radius: 50%;
  transform: none;
}

.vehicle-marker.moving .vehicle-marker-pulse {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  border: 2px solid var(--marker, #0d9f56);
  opacity: 0.55;
  animation: marker-pulse 1.4s ease-out infinite;
}

@keyframes marker-pulse {
  0% {
    transform: scale(0.7);
    opacity: 0.55;
  }
  100% {
    transform: scale(1.55);
    opacity: 0;
  }
}

.geofence-home-wrap {
  background: transparent !important;
  border: none !important;
}

.geofence-home {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #1a8af0, #1577d4);
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(21, 119, 212, 0.35);
}

.geofence-home.inactive {
  background: linear-gradient(145deg, #9aa6ae, #7d8a93);
  box-shadow: 0 2px 8px rgba(80, 90, 100, 0.25);
}

.geofence-home svg {
  display: block;
  margin-top: -1px;
}

.list-item.is-moving {
  border-color: rgba(13, 159, 86, 0.35);
  background: rgba(13, 159, 86, 0.06);
}

.live-map-layout {
  align-items: start;
}

.live-side {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.live-telem-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.live-telem-item {
  display: grid;
  gap: 0.25rem;
  padding: 0.65rem 0.7rem;
  border-radius: 10px;
  background: var(--field-bg);
  border: 1px solid var(--line);
}

.live-telem-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.live-telem-value {
  font-size: 0.95rem;
  font-weight: 600;
}

.live-telem-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.live-list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
  align-items: center;
}

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

.empty,
.loading,
.error-box {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
}

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

.under-dev {
  min-height: 52vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.under-dev-body {
  max-width: 28rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.under-dev-badge {
  display: inline-block;
  margin: 0 0 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(196, 140, 40, 0.35);
  background: rgba(196, 140, 40, 0.1);
  color: #9a6b12;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.under-dev-title {
  margin: 0 0 0.65rem;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.under-dev-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.list-compact {
  display: grid;
  gap: 0.55rem;
  max-height: 420px;
  overflow: auto;
}

.list-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem;
  padding: 0.75rem 0.8rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--field-bg);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.list-item:hover,
.list-item.active {
  background: var(--active);
  border-color: rgba(13, 159, 86, 0.28);
}

.list-item strong {
  display: block;
  font-size: 0.95rem;
}

.list-item span {
  color: var(--muted);
  font-size: 0.78rem;
}

.chart-bars {
  display: grid;
  gap: 0.65rem;
}

.bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 48px;
  gap: 0.6rem;
  align-items: center;
  font-size: 0.85rem;
}

.bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(20, 50, 38, 0.08);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform-origin: left;
  animation: grow 0.7s ease both;
}

.playback-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-top: 0.85rem;
}

.range {
  flex: 1;
  min-width: 160px;
}

.modal-root[hidden] {
  display: none !important;
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(20, 36, 28, 0.35);
  backdrop-filter: blur(4px);
  animation: fade 0.2s ease both;
}

.modal {
  width: min(560px, 100%);
  max-height: min(88vh, 760px);
  overflow: auto;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(20, 50, 38, 0.16);
  animation: fade-up 0.25s ease both;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.modal-body {
  padding: 1.1rem;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  padding: 0.9rem 1.1rem 1.1rem;
  border-top: 1px solid var(--line);
}

.toast-stack {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 120;
  display: grid;
  gap: 0.5rem;
  width: min(320px, calc(100vw - 2rem));
}

.toast {
  padding: 0.8rem 0.95rem;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  box-shadow: var(--shadow);
  font-size: 0.88rem;
  animation: fade-up 0.25s ease both;
}

.toast.ok {
  border-color: rgba(13, 159, 86, 0.35);
}
.toast.bad {
  border-color: rgba(214, 69, 69, 0.35);
}

.sidebar-open .sidebar {
  transform: translateX(0);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(16, 28, 22, 0.42);
  border: 0;
  padding: 0;
  cursor: pointer;
  animation: fade 0.2s ease both;
}

body.sidebar-open .sidebar-backdrop {
  display: block;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes grow {
  from {
    transform: scaleX(0.15);
  }
  to {
    transform: scaleX(1);
  }
}

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

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

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(var(--sidebar-w), 86vw);
    transform: translateX(-105%);
    transition: transform 0.25s ease;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-close {
    display: inline-grid !important;
    place-items: center;
  }

  .icon-btn {
    display: inline-grid;
    place-items: center;
  }

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

@media (max-width: 560px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .content {
    padding: 1rem;
  }
  .app-footer {
    padding: 0.75rem 1rem;
    flex-direction: column;
    align-items: flex-start;
  }
}
