:root {
  --ink: #092238;
  --muted: #5c7284;
  --line: rgba(17, 72, 88, 0.14);
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: #ffffff;
  --green: #087d73;
  --green-2: #23b8a8;
  --blue: #226ca8;
  --amber: #f1a647;
  --red: #c94848;
  --soft: #edf8f5;
  --shadow: 0 24px 70px rgba(15, 52, 73, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "HarmonyOS Sans SC", "MiSans", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(35, 184, 168, 0.18), transparent 30%),
    radial-gradient(circle at 92% 12%, rgba(241, 166, 71, 0.18), transparent 28%),
    linear-gradient(135deg, #eef8f5 0%, #f7fbff 48%, #eef7f2 100%);
}

body.auth-locked {
  overflow: hidden;
}

body.auth-locked .sidebar,
body.auth-locked .app-shell {
  display: none;
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: rgba(255, 255, 255, 0.72);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
  z-index: 20;
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  color: #fff;
  font-size: 30px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--green), var(--green-2));
  box-shadow: 0 18px 35px rgba(8, 125, 115, 0.25);
}

.brand-copy span,
.eyebrow {
  display: block;
  letter-spacing: 0.24em;
  font-size: 12px;
  color: #5d7890;
}

.brand-copy strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

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

.nav a {
  padding: 14px 16px;
  border-radius: 16px;
  color: #31546b;
  text-decoration: none;
  font-weight: 700;
}

.nav a:hover,
.nav a.active {
  color: #fff;
  background: linear-gradient(135deg, var(--green), #0b6c8e);
  box-shadow: 0 12px 24px rgba(8, 125, 115, 0.2);
}

.sidebar-note {
  margin-top: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(237, 248, 245, 0.86);
}

.sidebar-note span {
  font-weight: 900;
  color: var(--green);
}

.sidebar-note p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.app-shell {
  margin-left: 260px;
  padding: 30px 34px 60px;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 26px 28px;
  border-radius: 28px;
}

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

h1 {
  margin-bottom: 8px;
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 12px;
  font-size: 38px;
}

h3 {
  margin-bottom: 0;
  font-size: 24px;
}

.subtitle,
.muted {
  color: var(--muted);
  line-height: 1.8;
}

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

.user-badge {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--green);
  background: rgba(255, 255, 255, 0.74);
  font-weight: 900;
}

.ghost-btn,
.danger-outline-btn,
.simulator-grid button,
.mini-btn,
.primary-btn,
.upload-btn {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  font-weight: 800;
}

.ghost-btn,
.mini-btn {
  color: var(--green);
  background: rgba(8, 125, 115, 0.1);
}

.danger-outline-btn {
  color: var(--red);
  background: rgba(201, 72, 72, 0.1);
}

.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--green-2));
  box-shadow: 0 14px 28px rgba(8, 125, 115, 0.2);
}

.section {
  margin-top: 24px;
}

.page-section-hidden {
  display: none !important;
}

.module-hero {
  margin-top: 24px;
  padding: 30px 34px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    radial-gradient(circle at 92% 20%, rgba(35, 184, 168, 0.18), transparent 22%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(237, 248, 245, 0.82));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.module-hero h2 {
  margin: 8px 0 10px;
  font-size: clamp(32px, 3vw, 46px);
  letter-spacing: -0.04em;
}

.module-hero p:last-child {
  max-width: 860px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.8;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 30px;
  padding: 34px;
  border-radius: 32px;
  overflow: hidden;
  background:
    radial-gradient(circle at 86% 20%, rgba(255, 255, 255, 0.42), transparent 17%),
    linear-gradient(135deg, #087d73, #23b8a8);
  color: #fff;
}

.hero-panel .eyebrow,
.hero-panel p {
  color: rgba(255, 255, 255, 0.82);
}

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

.hero-badge,
.pill,
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 800;
  white-space: nowrap;
}

.hero-badge {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.pill,
.count-badge {
  color: var(--green);
  background: rgba(8, 125, 115, 0.09);
}

.kpi-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.kpi-card {
  min-height: 148px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 46px rgba(15, 52, 73, 0.09);
}

.kpi-card span {
  color: var(--muted);
  font-weight: 700;
}

.kpi-card strong {
  display: block;
  margin-top: 16px;
  font-size: 38px;
  letter-spacing: -0.04em;
}

.kpi-card em {
  display: block;
  margin-top: 8px;
  color: #6b8292;
  font-style: normal;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}

.panel {
  padding: 22px;
  border-radius: 26px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

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

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

.simulator-grid button {
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--blue));
  box-shadow: 0 14px 26px rgba(8, 125, 115, 0.2);
}

.simulator-grid button:nth-child(2n) {
  background: linear-gradient(135deg, #d6852e, #ebad51);
}

.map-canvas {
  position: relative;
  min-height: 238px;
  border-radius: 24px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(8, 125, 115, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(8, 125, 115, 0.06) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, rgba(35, 184, 168, 0.16), transparent 34%),
    #f7fcfb;
  background-size: 32px 32px, 32px 32px, auto, auto;
  border: 1px solid var(--line);
}

.vehicle-dot {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 8px rgba(8, 125, 115, 0.12);
}

.vehicle-dot.alert {
  background: var(--red);
  box-shadow: 0 0 0 8px rgba(201, 72, 72, 0.12);
}

.vehicle-dot span {
  position: absolute;
  left: 22px;
  top: -8px;
  min-width: 86px;
  padding: 5px 8px;
  border-radius: 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(15, 52, 73, 0.1);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
}

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

th,
td {
  padding: 16px 18px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  color: #52708a;
  background: rgba(237, 248, 245, 0.82);
  font-size: 14px;
}

tr:last-child td {
  border-bottom: 0;
}

.status {
  display: inline-flex;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  color: var(--green);
  background: rgba(8, 125, 115, 0.1);
}

.status.warn {
  color: #a56510;
  background: rgba(241, 166, 71, 0.16);
}

.status.danger {
  color: var(--red);
  background: rgba(201, 72, 72, 0.12);
}

.card-list,
.feed-list {
  display: grid;
  gap: 12px;
}

.info-card,
.feed-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
}

.info-card strong,
.feed-item strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}

.student-card {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: center;
}

.student-avatar {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, var(--green), var(--blue));
}

.student-avatar img,
.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.info-card p,
.feed-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.feed-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}

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

.mini-btn.danger {
  color: #fff;
  background: linear-gradient(135deg, var(--red), #e0715c);
}

.empty {
  padding: 30px;
  border: 1px dashed var(--line);
  border-radius: 20px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  max-width: 420px;
  padding: 16px 18px;
  border-radius: 18px;
  color: #fff;
  background: rgba(9, 34, 56, 0.92);
  box-shadow: 0 20px 40px rgba(9, 34, 56, 0.28);
  transform: translateY(30px);
  opacity: 0;
  pointer-events: none;
  transition: 0.25s ease;
  z-index: 100;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.hidden {
  display: none !important;
}

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

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 34, 56, 0.42);
  backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(880px, 100%);
  max-height: min(92vh, 860px);
  overflow: auto;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 30px 90px rgba(9, 34, 56, 0.28);
}

.login-card {
  max-width: 520px;
}

.modal-head,
.modal-actions,
.student-photo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: var(--green);
  background: rgba(8, 125, 115, 0.09);
  font-size: 26px;
  font-weight: 900;
}

.student-photo-row {
  justify-content: flex-start;
  margin: 20px 0;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 22px;
  background: rgba(237, 248, 245, 0.55);
}

.photo-preview {
  width: 92px;
  height: 92px;
  border-radius: 26px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #5f7587;
  font-weight: 900;
  background: #fff;
  border: 1px solid var(--line);
}

.upload-btn {
  display: inline-flex;
  align-items: center;
  color: var(--green);
  background: rgba(8, 125, 115, 0.09);
  cursor: pointer;
}

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

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

.form-grid label {
  display: grid;
  gap: 8px;
  color: #4d6b80;
  font-weight: 700;
}

.form-grid .check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.check-label input {
  width: 18px;
  height: 18px;
  min-height: auto;
  padding: 0;
  border-radius: 4px;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.form-grid textarea {
  min-height: 92px;
  padding: 12px 14px;
  resize: vertical;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  border-color: rgba(8, 125, 115, 0.42);
  box-shadow: 0 0 0 4px rgba(8, 125, 115, 0.08);
}

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

.modal-actions {
  justify-content: flex-end;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

@media (max-width: 1120px) {
  .sidebar {
    position: static;
    width: auto;
    flex-direction: row;
    align-items: center;
  }

  .nav,
  .sidebar-note {
    display: none;
  }

  .app-shell {
    margin-left: 0;
    padding: 18px;
  }

  .topbar,
  .hero-panel {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }

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

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

@media (max-width: 680px) {
  .kpi-grid,
  .simulator-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    position: static;
  }

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

  .student-card {
    grid-template-columns: 54px 1fr;
  }

  .student-card .mini-btn {
    grid-column: 1 / -1;
  }

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