:root {
  --blue-950: #050505;
  --blue-900: #071211;
  --blue-700: #09a9a0;
  --blue-500: #12c8bf;
  --sky-100: #e8fffc;
  --gold-500: #ffca22;
  --gold-600: #ffc107;
  --green-500: #1f9d61;
  --red-500: #d94747;
  --ink: #14211f;
  --muted: #647371;
  --line: #d9ebe8;
  --surface: #ffffff;
  --body: #f3fbfa;
  --shadow: 0 18px 45px rgba(4, 17, 16, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--body);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

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

body.login-active {
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 16%, rgba(18, 200, 191, 0.2), transparent 28%),
    radial-gradient(circle at 14% 84%, rgba(255, 202, 34, 0.15), transparent 28%),
    #050505;
}

.login-screen {
  min-height: 100vh;
  padding: clamp(18px, 4vw, 54px);
  display: none;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.5fr);
  gap: 28px;
  align-items: stretch;
  color: #fff;
}

body.login-active .login-screen {
  display: grid;
}

body.login-active .app-shell {
  display: none;
}

.login-brand-panel,
.login-card {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.login-brand-panel {
  min-height: 560px;
  padding: clamp(24px, 5vw, 58px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    linear-gradient(120deg, rgba(0, 0, 0, 0.88), rgba(7, 38, 36, 0.82)),
    radial-gradient(circle at 85% 20%, rgba(18, 200, 191, 0.4), transparent 28%);
}

.login-brand-panel img {
  width: min(320px, 100%);
  height: auto;
  padding: 8px;
  border-radius: 8px;
  background: #000;
}

.login-brand-panel > span {
  width: fit-content;
  margin-top: 30px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--gold-500);
  color: #050505;
  font-size: 0.8rem;
  font-weight: 900;
}

.login-brand-panel h1 {
  max-width: 780px;
  margin: 18px 0 0;
  font-size: clamp(2.15rem, 5vw, 5rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.login-brand-panel p {
  max-width: 640px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.05rem;
  line-height: 1.7;
}

.credential-grid {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.credential-grid button,
.credential-grid div {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  text-align: left;
}

.credential-grid button:hover {
  border-color: rgba(255, 202, 34, 0.7);
}

.credential-grid strong,
.credential-grid span {
  display: block;
}

.credential-grid span {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.86rem;
}

.feature-grid div {
  cursor: default;
}

.login-card {
  align-self: center;
  padding: clamp(22px, 4vw, 34px);
  display: grid;
  gap: 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
}

.login-card img {
  border-radius: 8px;
  background: #000;
}

.login-card h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.25rem);
}

.login-card small {
  color: var(--muted);
  line-height: 1.5;
}

.login-error {
  display: none;
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  color: #a21d1d;
  background: #fff1f1;
  font-weight: 800;
}

.login-error.show {
  display: block;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background: linear-gradient(180deg, #000, #071211 68%, #062b29);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: grid;
  gap: 12px;
  align-items: start;
  font-weight: 800;
  font-size: 1.15rem;
}

.brand img {
  width: min(220px, 100%);
  height: auto;
  background: #000;
  border-radius: 8px;
  padding: 6px;
}

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

.nav-links a {
  padding: 12px 14px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.82);
  transition: 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.sidebar-card {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-card p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.5;
  font-size: 0.9rem;
}

.page {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 86px;
  padding: 18px clamp(18px, 3vw, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(244, 248, 252, 0.9);
  border-bottom: 1px solid rgba(220, 229, 241, 0.82);
  backdrop-filter: blur(14px);
}

.topbar h1,
.hero-copy h2,
.section-heading h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(1.35rem, 2.2vw, 2rem);
}

.topbar-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-logo {
  display: none;
  width: 172px;
  height: auto;
  padding: 5px;
  border-radius: 8px;
  background: #000;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--blue-700);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

.role-switch,
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.85rem;
}

.user-chip {
  border-radius: 8px;
}

.user-chip strong {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--sky-100);
  color: #067b75;
}

.role-switch select {
  border: 0;
  color: var(--ink);
  background: transparent;
  font-weight: 800;
  outline: 0;
}

.status-pill,
.section-tag,
.product-mark {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.78rem;
}

.status-pill {
  padding: 8px 12px;
  background: #dcfffa;
  color: #067b75;
}

.status-pill.offline {
  background: #fff1f1;
  color: var(--red-500);
}

.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.menu-button span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--blue-900);
}

main {
  padding: 24px clamp(18px, 3vw, 40px) 0;
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 24px;
  align-items: stretch;
  color: #fff;
  background:
    linear-gradient(120deg, rgba(0, 0, 0, 0.97), rgba(7, 38, 36, 0.95)),
    radial-gradient(circle at 82% 18%, rgba(18, 200, 191, 0.42), transparent 29%),
    radial-gradient(circle at 25% 85%, rgba(255, 202, 34, 0.25), transparent 30%);
  border-radius: 8px;
  padding: clamp(24px, 5vw, 54px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.product-mark {
  padding: 8px 12px;
  color: #050505;
  background: var(--gold-500);
}

.hero-copy h2 {
  max-width: 820px;
  margin-top: 18px;
  font-size: clamp(2rem, 4.4vw, 4.3rem);
  line-height: 1.03;
}

.hero-copy p {
  max-width: 720px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.05rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 11px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-button {
  background: var(--gold-500);
  color: var(--blue-950);
  box-shadow: 0 12px 28px rgba(255, 197, 61, 0.26);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.secondary-button {
  background: #fff;
  color: #067b75;
  border: 1px solid var(--line);
}

.ghost-button {
  background: #050505;
  color: var(--gold-500);
  border: 1px solid rgba(255, 202, 34, 0.3);
}

.hero-panel {
  display: grid;
  gap: 14px;
  align-content: start;
}

.orbit-badge,
.route-card,
.map-preview {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.orbit-badge {
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.orbit-badge strong {
  font-size: 1.8rem;
}

.route-card {
  padding: 16px;
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 12px;
}

.route-card p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.76);
}

.route-dot {
  width: 12px;
  height: 12px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--blue-500);
  box-shadow: 0 0 0 6px rgba(18, 200, 191, 0.18);
}

.route-dot.warning {
  background: var(--gold-500);
  box-shadow: 0 0 0 6px rgba(255, 197, 61, 0.18);
}

.map-preview {
  position: relative;
  min-height: 170px;
  padding: 18px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
}

.map-preview span {
  position: absolute;
  left: 18px;
  bottom: 18px;
  color: rgba(255, 255, 255, 0.84);
  font-weight: 800;
}

.map-pin {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gold-500);
  border: 4px solid #fff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.pin-a { left: 24%; top: 30%; }
.pin-b { right: 26%; top: 42%; }
.pin-c { left: 54%; bottom: 34%; }

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

.stat-card,
.work-section,
.activity-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(8, 58, 120, 0.06);
}

.stat-card {
  padding: 18px;
}

.stat-card span,
.stat-card small {
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin: 8px 0 2px;
  color: #078982;
  font-size: clamp(1.5rem, 3vw, 2.35rem);
}

.work-section,
.activity-section {
  margin-top: 24px;
  padding: clamp(18px, 3vw, 28px);
  scroll-margin-top: 110px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.section-heading h2 {
  font-size: clamp(1.35rem, 2.6vw, 2rem);
}

.section-tag {
  padding: 8px 12px;
  background: var(--sky-100);
  color: var(--blue-700);
  white-space: nowrap;
}

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

label {
  display: grid;
  gap: 7px;
  color: var(--blue-950);
  font-weight: 800;
  font-size: 0.9rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--ink);
  background: #fff;
  outline: 0;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 4px rgba(18, 200, 191, 0.14);
}

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

.geo-box,
.allowance-box {
  min-height: 94px;
  padding: 14px;
  border: 1px dashed #b9c9de;
  border-radius: 8px;
  background: #f8fbff;
}

.geo-box p,
.allowance-box small {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.allowance-box span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.allowance-box strong {
  display: block;
  margin-top: 4px;
  color: #078982;
  font-size: 1.55rem;
}

.form-submit {
  justify-self: start;
}

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

.user-table-wrap {
  margin-top: 18px;
}

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

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

th {
  color: var(--blue-950);
  background: #f5f9ff;
  font-size: 0.82rem;
  text-transform: uppercase;
}

td {
  color: var(--ink);
  line-height: 1.45;
}

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

.doc-type {
  display: inline-flex;
  margin-bottom: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--sky-100);
  color: var(--blue-700);
  font-size: 0.76rem;
  font-weight: 900;
}

.approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-button {
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  background: #078982;
  color: #fff;
  font-weight: 800;
  font-size: 0.8rem;
}

.mini-button.finance {
  background: var(--gold-600);
  color: var(--blue-950);
}

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

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

.badge {
  display: inline-flex;
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef3fa;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.badge.approved {
  background: #e7f8ef;
  color: var(--green-500);
}

.badge.pending {
  background: #fff8df;
  color: #9a6a00;
}

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

.activity-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  background: #fbfdff;
}

.activity-item p {
  margin: 4px 0 0;
  color: var(--muted);
}

footer {
  margin-top: 30px;
  padding: 24px clamp(18px, 3vw, 40px);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: #fff;
  background: #000;
}

footer span {
  font-weight: 900;
}

footer small {
  color: rgba(255, 255, 255, 0.7);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(380px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--blue-950);
  box-shadow: var(--shadow);
  transform: translateY(24px);
  opacity: 0;
  pointer-events: none;
  transition: 0.25s ease;
}

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

@media (max-width: 1060px) {
  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-brand-panel {
    min-height: auto;
  }

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

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 40;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

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

  .menu-button {
    display: inline-block;
  }

  .topbar-logo {
    display: block;
  }

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

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

@media (max-width: 720px) {
  body.login-active {
    overflow: auto;
  }

  .login-screen {
    padding: 14px;
  }

  .login-brand-panel,
  .login-card {
    padding: 20px;
  }

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

  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .topbar-title {
    flex: 1 1 calc(100% - 58px);
  }

  .topbar-logo {
    width: min(172px, 44vw);
  }

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

  .hero-copy h2 {
    font-size: 2rem;
  }

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

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

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