:root {
  --orange: #ee4d2d;
  --orange-dark: #c73719;
  --navy: #08264a;
  --ink: #132033;
  --muted: #66758c;
  --line: #e3e8ef;
  --bg: #f2f5f9;
  --soft: #fff4ef;
  --danger: #e9324f;
  --good: #11a66a;
  --warning: #f59e0b;
  --card: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 247, 242, .9) 0%, rgba(245, 247, 251, .94) 42%, rgba(238, 242, 247, .96) 100%),
    url("assets/shopee-pattern.jpg") right top / min(520px, 62vw) auto no-repeat fixed;
}

body.login-flow .hero,
body.register-flow .hero {
  position: relative;
  min-height: 152px;
  display: grid;
  align-items: center;
  overflow: hidden;
  background:
    linear-gradient(105deg, rgba(238, 77, 45, .97) 0%, rgba(255, 98, 61, .93) 52%, rgba(255, 176, 0, .78) 100%),
    url("assets/shopee-pattern.jpg") right center / 360px auto repeat;
}

body.login-flow .hero::before,
body.register-flow .hero::before {
  content: "";
  position: absolute;
  inset: -40px -90px auto auto;
  width: 260px;
  aspect-ratio: 1;
  background: url("assets/mascot-packages.jpg") center / cover no-repeat;
  border-radius: 42px;
  opacity: .22;
  transform: rotate(10deg);
  animation: heroFloat 6s ease-in-out infinite;
}

body.login-flow .hero::after,
body.register-flow .hero::after {
  content: "";
  position: absolute;
  inset: auto auto -86px -80px;
  width: 240px;
  aspect-ratio: 1;
  background: url("icons/shopee-bag.svg") center / contain no-repeat;
  opacity: .16;
  animation: softDrift 8s ease-in-out infinite;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(255, 255, 255, .86);
  border-bottom: 1px solid rgba(226, 232, 240, .9);
  backdrop-filter: blur(14px);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.top-actions:has(.icon-exit.hidden) {
  display: none;
}

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

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--orange) url("assets/shopee-square.png") center / cover no-repeat;
  color: transparent;
  font-size: 0;
  font-weight: 950;
  box-shadow: 0 14px 30px rgba(238, 77, 45, .24);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 17px;
  font-weight: 950;
  color: var(--navy);
}

.brand div span {
  color: var(--orange);
  font-weight: 900;
}

.shell {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 42px;
}

body.driver-session {
  background:
    linear-gradient(180deg, rgba(238, 77, 45, .72) 0%, rgba(238, 77, 45, .54) 30%, rgba(244, 92, 48, .42) 100%),
    url("assets/truck-orange.jpg") center top / cover fixed no-repeat;
}

body.driver-session .topbar {
  background: rgba(255, 255, 255, .92);
}

body.driver-session .hero {
  background:
    linear-gradient(135deg, rgba(8, 38, 74, .94), rgba(238, 77, 45, .84)),
    url("assets/truck-orange.jpg") center / cover no-repeat;
  box-shadow: 0 20px 46px rgba(90, 22, 8, .22);
}

body.driver-session .panel {
  background: rgba(255, 255, 255, .94);
  border-color: rgba(255, 210, 194, .72);
}

.hero {
  display: block;
  padding: 26px 28px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--orange), #ff623d);
  color: white;
  box-shadow: 0 18px 42px rgba(238, 77, 45, .18);
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .82);
}

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

h1 {
  margin-bottom: 6px;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.04;
  letter-spacing: 0;
}

.hero-copy p:last-child {
  margin-bottom: 0;
  color: rgba(255, 255, 255, .9);
  font-size: 16px;
  line-height: 1.35;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.panel {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 16px 42px rgba(15, 23, 42, .08);
}

.login-panel {
  max-width: 520px;
  margin-top: 14px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(105deg, rgba(255, 255, 255, .995) 0%, rgba(255, 255, 255, .985) 68%, rgba(255, 244, 239, .94) 100%),
    radial-gradient(circle at 92% 18%, rgba(238, 77, 45, .12), transparent 30%);
}

.login-panel .grid-form,
.login-panel .actions,
.login-panel .message,
.login-panel .auth-help {
  max-width: 390px;
}

.auth-head {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-chip {
  width: max-content;
  min-height: 28px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff4ef;
  color: #98320f;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .8px;
  text-transform: uppercase;
}

.auth-head h2 {
  margin: 0;
  font-size: 28px;
}

.auth-head p {
  max-width: 390px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.auth-help {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #ffe0d5;
}

.auth-help span {
  min-height: 28px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 244, 239, .78);
  color: #9a3412;
  font-size: 11px;
  font-weight: 900;
}

.login-panel::before {
  content: "";
  position: absolute;
  right: -66px;
  bottom: -54px;
  z-index: -1;
  width: 250px;
  aspect-ratio: 1;
  background: url("assets/shopee-square.png") center / cover no-repeat;
  border-radius: 42px;
  opacity: .055;
  transform: rotate(-10deg);
  animation: softDrift 9s ease-in-out infinite;
}

.login-panel::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 20px;
  z-index: -1;
  width: 84px;
  aspect-ratio: 1;
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(238, 77, 45, .18), rgba(255, 176, 0, .10)),
    url("assets/mascot-driver.png") center bottom / 78px auto no-repeat;
  opacity: .2;
  animation: mascotBreathe 4.2s ease-in-out infinite;
}

h2 {
  margin-bottom: 4px;
  color: var(--navy);
  font-size: 24px;
}

.hint {
  color: var(--muted);
  line-height: 1.5;
}

.grid-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

label {
  display: grid;
  gap: 8px;
  color: #98320f;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .8px;
  text-transform: uppercase;
}

input {
  width: 100%;
  height: 56px;
  padding: 0 16px;
  border: 1px solid #ffc9b5;
  border-radius: 14px;
  outline: none;
  background: white;
  color: var(--ink);
  font-size: 19px;
  font-weight: 900;
}

input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(238, 77, 45, .13);
}

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

button {
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  background: var(--orange);
  color: white;
  cursor: pointer;
  font-size: 15px;
  font-weight: 950;
  box-shadow: 0 12px 24px rgba(238, 77, 45, .18);
}

button:hover {
  background: var(--orange-dark);
}

button.ghost {
  border: 1px solid #ffd1c2;
  background: white;
  color: var(--orange);
  box-shadow: none;
}

button:disabled {
  cursor: wait;
  opacity: .68;
}

.icon-exit {
  min-width: 48px;
  padding: 0 14px;
}

.message {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--danger);
  font-weight: 900;
}

.driver-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.driver-workspace {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.driver-summary {
  margin-top: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(255, 246, 242, .94)),
    url("assets/mascot-packages.jpg") right 24px bottom 14px / 148px auto no-repeat;
}

.driver-summary .driver-head,
.driver-summary .kpis {
  max-width: calc(100% - 120px);
}

.driver-summary h2 {
  margin: 12px 0 6px;
  font-size: clamp(24px, 4vw, 34px);
}

.driver-summary p {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 0;
  color: #98320f;
}

.driver-card-note {
  width: min(330px, 100%);
  padding: 14px;
  border: 1px solid #ffd1c2;
  border-radius: 16px;
  background: rgba(255, 244, 239, .72);
}

.driver-card-note strong,
.driver-card-note span {
  display: block;
}

.driver-card-note strong {
  color: var(--navy);
  font-size: 14px;
}

.driver-card-note span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 800;
}

.driver-head h2 {
  margin-bottom: 4px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--soft);
  color: #9a3412;
  font-size: 12px;
  font-weight: 950;
}

.live-tag {
  background: #ecfdf5;
  color: #067647;
  border: 1px solid #bbf7d0;
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #16a34a;
  box-shadow: 0 0 0 0 rgba(22, 163, 74, .58);
  animation: livePulse 1.4s ease-out infinite;
}

@keyframes livePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, .58);
  }

  70% {
    box-shadow: 0 0 0 9px rgba(22, 163, 74, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0);
  }
}

.kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.kpi {
  min-height: 108px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fbff;
  position: relative;
  overflow: hidden;
}

.kpi::after {
  content: "";
  position: absolute;
  inset: auto 14px 12px 14px;
  height: 4px;
  border-radius: 999px;
  background: #dbe6f2;
}

.kpi.danger::after {
  background: var(--danger);
}

.kpi.warning::after {
  background: var(--warning);
}

.kpi.good::after {
  background: var(--good);
}

.kpi span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.kpi strong {
  display: block;
  margin-top: 8px;
  font-size: 32px;
  line-height: 1;
  color: var(--navy);
}

.kpi small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 850;
}

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

.action-callout {
  margin-top: 0;
  min-height: 190px;
  display: grid;
  align-content: start;
  gap: 8px;
  background:
    linear-gradient(90deg, rgba(255, 248, 235, .98), rgba(255, 255, 255, .92)),
    url("assets/mascot-alert.jpg") right 18px center / 112px auto no-repeat;
}

.action-callout h3,
.action-callout p,
.action-callout strong,
.action-callout .tag {
  max-width: calc(100% - 118px);
}

.action-callout h3 {
  margin: 8px 0 0;
  color: var(--navy);
  font-size: 22px;
}

.action-callout p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-weight: 750;
}

.action-callout strong {
  margin-top: 12px;
  color: var(--warning);
  font-size: 44px;
  line-height: 1;
}

.good-callout {
  background:
    linear-gradient(90deg, rgba(236, 253, 245, .98), rgba(255, 255, 255, .92)),
    url("assets/mascot-packages.jpg") right 18px center / 112px auto no-repeat;
}

.good-callout strong {
  color: var(--good);
}

.kpi.danger strong {
  color: var(--danger);
}

.kpi.warning strong {
  color: var(--warning);
}

.kpi.good strong {
  color: var(--good);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 22px;
  margin-bottom: 10px;
}

.section-title h3 {
  margin: 0;
  color: var(--navy);
  font-size: 18px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}

.admin-dashboard {
  margin-top: 18px;
}

.admin-tools {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fbff;
}

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

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

.admin-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fbff;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.1fr) 1.6fr 48px;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid #e8eef6;
}

.bar-row:first-of-type {
  border-top: 0;
}

.bar-row strong,
.bar-row span {
  display: block;
}

.bar-row strong {
  color: var(--navy);
  font-size: 13px;
}

.bar-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf5;
}

.bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), #ffb000);
}

.bar-row b {
  color: var(--navy);
  font-size: 18px;
  text-align: right;
}

.mini-bar {
  padding: 10px 0;
  border-top: 1px solid #e8eef6;
}

.mini-bar:first-of-type {
  border-top: 0;
}

.mini-bar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.mini-bar-head strong {
  color: var(--navy);
  font-size: 13px;
}

.mini-bar-head b {
  color: var(--orange);
  font-size: 18px;
}

.mini-bar small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-weight: 800;
}

.alert-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 170px;
  background: linear-gradient(180deg, #fff8f5, #ffffff);
}

.alert-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.alert-card strong {
  margin-top: 8px;
  color: var(--navy);
  font-size: 42px;
  line-height: 1;
}

.alert-card small {
  margin-top: 10px;
  color: var(--danger);
  font-weight: 900;
}

.wide-card {
  margin-top: 14px;
}

.admin-floating-back {
  margin-top: 18px;
}

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

th {
  padding: 14px 12px;
  background: var(--navy);
  color: white;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
}

td {
  padding: 14px 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  vertical-align: top;
  line-height: 1.35;
}

tr:nth-child(even) td {
  background: #fbfdff;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef4fb;
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
}

.pill.red {
  background: #fff1f3;
  color: var(--danger);
}

.pill.good {
  background: #ecfdf5;
  color: #067647;
}

.pill.warning {
  background: #fff7df;
  color: #9a5b00;
}

.pill.critical {
  background: #e9324f;
  color: white;
}

.empty-state {
  display: grid;
  gap: 8px;
  padding: 20px;
  border: 1px dashed #b9c6d7;
  border-radius: 16px;
  background: #f8fbff;
  color: var(--muted);
}

.empty-state strong {
  color: var(--navy);
  font-size: 18px;
}

.br-link {
  min-height: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--navy);
  font-size: 12px;
  font-weight: 950;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  box-shadow: none;
}

.br-link:hover {
  background: transparent;
  color: var(--orange);
}

.br-link:disabled {
  cursor: default;
  color: var(--navy);
  text-decoration: none;
}

.attention-row td {
  background: #fff8eb !important;
}

td small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-weight: 800;
}

.found-title {
  margin-top: 28px;
}

.action-panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 38, 74, .46);
  backdrop-filter: blur(6px);
}

.action-panel {
  position: relative;
  width: min(520px, 100%);
  padding: 22px;
  border: 1px solid #ffd1c2;
  border-radius: 20px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .98), rgba(255, 244, 239, .94)),
    url("assets/mascot-not-approved.png") right 18px center / 130px auto no-repeat;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
}

.action-panel h3,
.action-panel p,
.action-panel .action-grid,
.action-panel .tag {
  max-width: calc(100% - 126px);
}

.action-panel .tag {
  background: #fff4ef;
}

.action-panel h3 {
  margin: 14px 0 6px;
  color: var(--navy);
  font-size: 22px;
}

.action-panel p {
  color: var(--muted);
  line-height: 1.45;
}

.action-grid {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.action-grid button {
  justify-content: center;
  width: 100%;
}

.action-close {
  position: absolute;
  top: 12px;
  right: 12px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 999px;
  background: white;
  color: var(--orange);
}

.danger-text {
  color: var(--danger) !important;
}

.hidden {
  display: none !important;
}

@keyframes heroFloat {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotate(10deg);
  }

  50% {
    transform: translate3d(-10px, 10px, 0) rotate(7deg);
  }
}

@keyframes softDrift {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotate(-10deg);
  }

  50% {
    transform: translate3d(10px, -8px, 0) rotate(-6deg);
  }
}

@keyframes mascotBreathe {
  0%, 100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-5px) scale(1.03);
  }
}

@media (max-width: 820px) {
  .topbar {
    padding: 12px 14px;
  }

  .shell {
    width: min(100% - 24px, 1120px);
  }

  .hero {
    padding: 22px;
  }

  .login-panel {
    margin-top: 12px;
  }

  .login-panel::before {
    width: 190px;
    right: -58px;
    bottom: -38px;
  }

  .login-panel::after {
    width: 62px;
  }

  .login-panel .grid-form,
  .login-panel .actions,
  .login-panel .message,
  .login-panel .auth-help,
  .driver-summary .driver-head,
  .driver-summary .kpis,
  .action-callout h3,
  .action-callout p,
  .action-callout strong,
  .action-callout .tag,
  .action-panel h3,
  .action-panel p,
  .action-panel .action-grid,
  .action-panel .tag {
    max-width: none;
  }

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

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

@media (max-width: 540px) {
  .brand div span {
    display: none;
  }

  .panel {
    padding: 16px;
  }

  body.login-flow .hero,
  body.register-flow .hero {
    min-height: 132px;
    padding: 20px;
    background:
      linear-gradient(115deg, rgba(238, 77, 45, .98), rgba(255, 98, 61, .94)),
      url("assets/shopee-pattern.jpg") right center / 280px auto repeat;
  }

  body.login-flow .hero::before,
  body.register-flow .hero::before {
    width: 160px;
    inset: -28px -70px auto auto;
    opacity: .18;
  }

  body.login-flow .hero::after,
  body.register-flow .hero::after {
    width: 160px;
    inset: auto auto -70px -64px;
  }

  .login-panel {
    border-radius: 18px;
    background:
      linear-gradient(135deg, rgba(255, 255, 255, .995), rgba(255, 247, 242, .96)),
      radial-gradient(circle at 100% 6%, rgba(238, 77, 45, .1), transparent 34%);
  }

  .login-panel::before {
    width: 190px;
    opacity: .045;
    right: -80px;
  }

  .login-panel::after {
    width: 58px;
    opacity: .16;
  }

  .driver-summary,
  .action-callout,
  .good-callout,
  .action-panel {
    background-image: linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(255, 244, 239, .94));
  }

  .actions button {
    width: 100%;
  }

  .top-actions,
  .top-actions button {
    width: 100%;
  }

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

  table {
    min-width: 680px;
  }

  .admin-tools,
  .admin-grid,
  .admin-grid-3,
  .bar-row {
    grid-template-columns: 1fr;
  }

  .bar-row b {
    text-align: left;
  }
}
