:root {
  --bg: #060909;
  --bg-soft: #0d1311;
  --surface: #0d1412;
  --surface-2: #101917;
  --line: #203129;
  --text: #e6ffee;
  --muted: #91b89f;
  --accent: #35d977;
  --accent-2: #83ffb3;
  --danger: #ff6a79;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(circle at 75% 0%, #0c1a14 0%, #050707 44%, #030404 100%);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}
.bg-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.2;
}
.tree-scene {
  position: absolute;
  right: 1%;
  bottom: -18px;
  width: 520px;
  height: 420px;
  opacity: 0.55;
  filter: drop-shadow(0 0 24px rgba(58, 220, 123, 0.2));
}
.tree-cliff {
  position: absolute;
  right: 0;
  top: 42px;
  width: 320px;
  height: 130px;
  background: linear-gradient(160deg, rgba(104, 255, 163, 0.2), rgba(12, 24, 18, 0.05) 54%);
  clip-path: polygon(100% 0, 12% 0, 0 32%, 25% 100%, 100% 100%);
  border: 1px solid rgba(109, 232, 158, 0.34);
  box-shadow: 0 0 44px rgba(78, 198, 120, 0.16);
}
.tree-trunk {
  position: absolute;
  right: 112px;
  top: 120px;
  width: 20px;
  height: 170px;
  background: linear-gradient(180deg, #4f815f, #1a3522);
  transform: skew(-12deg);
  box-shadow: 0 0 14px rgba(86, 233, 141, 0.24);
}
.tree-branch {
  position: absolute;
  height: 7px;
  background: linear-gradient(90deg, rgba(149, 255, 190, 0.68), rgba(30, 73, 44, 0.16));
  border-radius: 6px;
  transform-origin: left center;
}
.tree-branch.br1 { right: 130px; top: 138px; width: 120px; transform: rotate(-22deg); }
.tree-branch.br2 { right: 122px; top: 168px; width: 154px; transform: rotate(-14deg); }
.tree-branch.br3 { right: 120px; top: 204px; width: 126px; transform: rotate(-2deg); }
.tree-branch::after {
  content: "";
  position: absolute;
  right: -10px;
  top: -16px;
  width: 18px;
  height: 42px;
  background: linear-gradient(180deg, rgba(121, 250, 175, 0.56), rgba(17, 49, 29, 0.08));
  border-radius: 8px;
  transform: skew(-8deg);
}
.tree-canopy {
  position: absolute;
  top: 78px;
  right: 38px;
  width: 220px;
  height: 170px;
  border-radius: 42% 58% 52% 48% / 56% 41% 59% 44%;
  background:
    radial-gradient(circle at 36% 34%, rgba(149, 255, 190, 0.74), rgba(31, 120, 61, 0.08) 62%),
    radial-gradient(circle at 64% 42%, rgba(104, 225, 150, 0.52), rgba(16, 58, 29, 0.14) 72%);
  box-shadow: 0 0 50px rgba(76, 210, 127, 0.2);
}
.floaters {
  position: absolute;
  inset: 0;
}
.float-box {
  position: absolute;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(131, 255, 179, 0.25);
  background: rgba(53, 217, 119, 0.05);
  box-shadow: 0 0 24px rgba(53, 217, 119, 0.1);
  animation: float-up linear infinite;
}
.float-box.b1 { left: 10%; bottom: -60px; animation-duration: 20s; animation-delay: 0s; }
.float-box.b2 { left: 21%; bottom: -60px; animation-duration: 16s; animation-delay: -4s; width: 18px; height: 18px; }
.float-box.b3 { left: 36%; bottom: -60px; animation-duration: 25s; animation-delay: -3s; }
.float-box.b4 { left: 52%; bottom: -60px; animation-duration: 19s; animation-delay: -8s; width: 30px; height: 30px; }
.float-box.b5 { left: 66%; bottom: -60px; animation-duration: 22s; animation-delay: -10s; }
.float-box.b6 { left: 74%; bottom: -60px; animation-duration: 17s; animation-delay: -6s; width: 16px; height: 16px; }
.float-box.b7 { left: 84%; bottom: -60px; animation-duration: 24s; animation-delay: -13s; }
.float-box.b8 { left: 92%; bottom: -60px; animation-duration: 18s; animation-delay: -2s; width: 20px; height: 20px; }
.leaf {
  position: absolute;
  width: 11px;
  height: 7px;
  border-radius: 12px 12px 12px 2px;
  background: rgba(148, 255, 187, 0.75);
  box-shadow: 0 0 8px rgba(86, 233, 141, 0.45);
  animation: leaf-drift linear infinite;
}
.leaf.l1 { left: 58%; top: 18%; animation-duration: 11s; }
.leaf.l2 { left: 64%; top: 23%; animation-duration: 13s; animation-delay: -4s; }
.leaf.l3 { left: 69%; top: 15%; animation-duration: 10s; animation-delay: -2s; }
.leaf.l4 { left: 74%; top: 19%; animation-duration: 12s; animation-delay: -6s; }
.leaf.l5 { left: 80%; top: 21%; animation-duration: 14s; animation-delay: -8s; }
.leaf.l6 { left: 86%; top: 17%; animation-duration: 9s; animation-delay: -3s; }
.parcel {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(153, 255, 195, 0.36);
  background: rgba(53, 217, 119, 0.1);
  box-shadow: 0 0 14px rgba(53, 217, 119, 0.16);
  animation: parcel-flow linear infinite;
}
.parcel.p1 { left: 46%; top: 76%; animation-duration: 16s; }
.parcel.p2 { left: 30%; top: 80%; animation-duration: 18s; animation-delay: -5s; }
.parcel.p3 { left: 16%; top: 72%; animation-duration: 15s; animation-delay: -9s; }
.parcel.p4 { left: 8%; top: 78%; animation-duration: 19s; animation-delay: -12s; }

.dashboard-layout { min-height: 100vh; display: grid; grid-template-columns: 220px 1fr; }
.sidebar {
  background: linear-gradient(180deg, #0d1512, #0a100e);
  border-right: 1px solid #1e2c26;
  padding: .9rem .65rem;
  position: relative;
  z-index: 2;
}
.brand { font-weight: 800; letter-spacing: .04em; margin: .2rem .45rem 1rem; font-size: 1rem; }
.brand span { color: var(--accent-2); }
.side-nav { display: grid; gap: .4rem; }
.side-link {
  text-align: left; background: transparent; color: #c7e2d0; border: 1px solid transparent;
  border-radius: 0; padding: .58rem .68rem; cursor: pointer;
}
.side-link:hover,.side-link.active { background: rgba(53,217,119,.14); border-color: #315641; color: #eefff4; }
.app { padding: .85rem .95rem 1.1rem; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: 0; padding: .7rem .8rem;
  position: relative;
  z-index: 2;
}
.page-title { font-weight: 700; font-size: 1.05rem; }
.menu { display: flex; gap: .45rem; }
.menu-btn {
  border: 1px solid #2b4237; border-radius: 0; padding: .45rem .78rem; background: #111a16; color: #cde8d7; cursor: pointer;
}
.menu-btn.active,.menu-btn:hover { border-color: #4eb379; color: #bbffd7; background: #15241c; }
.panel {
  margin-top: .75rem; border: 1px solid var(--line); border-radius: 0; padding: .9rem;
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
  position: relative;
  z-index: 2;
  animation: rise-in 420ms ease both;
}
.hero h1 { margin: .2rem 0; font-size: clamp(1.5rem,3vw,2rem); }
.hero h1 span { color: var(--accent-2); }
.hero { min-height: 56px; }
.results-ready { min-height: 0; }
.badge {
  display: inline-block; font-size: .7rem; padding: .25rem .55rem;
  border: 1px solid #2f5b45; border-radius: 0; color: #93edb9; background: rgba(53,217,119,.08);
}
.subtitle { color: var(--muted); margin: .5rem 0 0; }
.content-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: .75rem; }
.panel-title { margin: 0 0 .7rem; font-size: .88rem; text-transform: uppercase; letter-spacing: .06em; }
.tracking-form { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: .62rem; }
.tracking-notice {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  background: rgba(53, 217, 119, 0.06);
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}
label { display: flex; flex-direction: column; gap: .34rem; font-size: .82rem; color: var(--muted); }
input,select,button {
  border: 1px solid #2b4237; background: #0d1512; color: var(--text); border-radius: 0; padding: .62rem .72rem;
}
input:focus,select:focus { outline: none; border-color: #4eb379; box-shadow: 0 0 0 3px rgba(53,217,119,.14); }
button { cursor: pointer; font-weight: 600; }
button:not(.side-link):not(.menu-btn):not(.history-item):not(.ghost-btn) {
  background: linear-gradient(120deg,#1f9c57,#147941); border-color: #1f9c57; color: #effff5;
}
button:not(.side-link):not(.menu-btn):not(.history-item):not(.ghost-btn):hover { filter: brightness(1.07); }
#submit-btn {
  justify-self: start;
  width: min(100%, 228px);
  min-height: 56px;
  padding: 0 1.35rem;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(131, 255, 179, 0.55);
  background: linear-gradient(165deg, #26cf76 0%, #169052 42%, #0d6e3d 100%);
  clip-path: polygon(6% 0, 94% 0, 100% 22%, 100% 78%, 94% 100%, 6% 100%, 0 78%, 0 22%);
  position: relative;
  box-shadow:
    0 0 0 1px rgba(53, 217, 119, 0.35),
    0 14px 32px rgba(10, 72, 38, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}
#submit-btn::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 7px;
  transform: translateX(-50%);
  width: 68px;
  height: 6px;
  background: rgba(231, 255, 242, 0.28);
  border-radius: 2px;
}
#submit-btn:not(:disabled):hover {
  transform: translateY(-2px);
  filter: brightness(1.09);
  box-shadow:
    0 0 0 1px rgba(131, 255, 179, 0.45),
    0 18px 40px rgba(10, 72, 38, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
#submit-btn:not(:disabled):active {
  transform: translateY(0);
  filter: brightness(0.96);
}
#submit-btn:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  filter: grayscale(0.15);
}
.results .empty,.hint,.order-muted,.modal-small { color: var(--muted); }
.results-footer { margin-top: 0.85rem; font-size: 0.82rem; color: var(--muted); }
.status {
  display: inline-flex; align-items: center; padding: .24rem .58rem; font-size: .72rem;
  border: 1px solid #3f8d5d; border-radius: 0; background: rgba(53,217,119,.14); color: #9cffc8;
}
.status.in_transit,.status.pending,.status.out_for_delivery { color: #ffd594; background: rgba(255,186,81,.16); border-color: #916d35; }
.status.exception,.status.failed { color: #ff9fad; background: rgba(255,106,121,.16); border-color: #9a4c57; }
.grid { margin-top: .75rem; display: grid; grid-template-columns: repeat(auto-fit,minmax(160px,1fr)); gap: .55rem; }
.kpi { border: 1px solid var(--line); border-radius: 0; background: #111a16; padding: .55rem; }
.kpi .label { color: var(--muted); font-size: .72rem; }
.events { margin-top: .7rem; display: grid; gap: .45rem; }
.event { border: 1px solid var(--line); border-radius: 0; background: #0f1814; padding: .55rem; }
.event .meta { color: var(--muted); font-size: .8rem; }
.history-list { display: grid; gap: .42rem; }
.history-item {
  width: 100%; display: flex; justify-content: space-between; gap: .35rem;
  border: 1px solid #2b4237; border-radius: 0; background: #0f1814; color: var(--text); padding: .48rem;
}
.carrier-list { margin: 0; padding-left: 1rem; color: var(--muted); max-height: 300px; overflow: auto; }
.orders-head,.orders-toolbar {
  display: grid; grid-template-columns: 1fr auto; gap: .45rem; align-items: center;
  border: 1px solid var(--line); border-radius: 0; background: #111a16; padding: .45rem .55rem; margin-bottom: .55rem;
}
.orders-toolbar { grid-template-columns: 1fr 190px; }
.orders-toolbar .ghost-btn { height: 100%; }
.orders-list { overflow-x: auto; }
.orders-table { min-width: 1080px; border: 1px solid var(--line); border-radius: 0; overflow: hidden; }
.orders-row {
  display: grid; grid-template-columns: 2fr 1fr .85fr .95fr 1.05fr 1fr .85fr 58px;
  border-bottom: 1px solid var(--line); background: #0f1814;
}
.orders-row:last-child { border-bottom: 0; }
.orders-header { background: #16201b; color: #89a693; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.cell { min-height: 54px; padding: .54rem; display: flex; align-items: center; gap: .32rem; }
.shipment-main { display: grid; gap: .16rem; }
.shipment-title { font-weight: 700; font-size: .9rem; color: #d7fbe6; }
.shipment-sub { font-size: .76rem; color: var(--muted); }
.order-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--accent-2); }
.action-btn { justify-content: center; }
.action-btn a { color: #b0bcd5; text-decoration: none; }
.delete-order-btn {
  border: 1px solid #8d4e56;
  color: #ffb5be;
  background: rgba(255, 106, 121, 0.12);
  padding: 0.22rem 0.5rem;
  font-size: 0.72rem;
}
.delete-order-btn:hover { filter: brightness(1.1); }
.timer-badge {
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  color: #9ae8bc;
}
.timer-upcoming { color: #9ae8bc; }
.timer-due { color: #ffb5be; font-weight: 700; }
.timer-muted { color: var(--muted); font-size: 0.74rem; }
.timer-inline { font-size: 0.82rem; color: #c5f5dc; }
.timer-cell { align-items: flex-start; flex-direction: column; gap: 0.15rem; }
.logs-table-wrap {
  overflow-x: auto;
  margin-top: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #0f1814;
}
.logs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.logs-table th,
.logs-table td {
  border-bottom: 1px solid var(--line);
  padding: 0.45rem 0.5rem;
  text-align: left;
  vertical-align: top;
}
.logs-table th {
  background: #16201b;
  color: #89a693;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.68rem;
}
.logs-empty {
  color: var(--muted);
  padding: 1rem !important;
  text-align: center;
}
.orders-row.order-clickable { cursor: pointer; transition: background .12s ease; }
.orders-row.order-clickable:hover { background: #15211b; }
.last-update-cell { font-size: 0.78rem; line-height: 1.35; min-width: 0; }
.last-update-main { color: var(--text); font-weight: 600; }
.last-update-sub { color: var(--muted); font-size: 0.72rem; margin-top: 0.12rem; }
.modal {
  position: fixed; inset: 0; z-index: 40; background: rgba(10,13,21,.62);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal-card {
  width: min(1020px, 96vw); max-height: 92vh; overflow: auto;
  background: #0f1814; border: 1px solid var(--line); border-radius: 0; padding: .85rem; color: var(--text);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: .55rem; margin-bottom: .7rem; }
.modal-title { font-size: 1.1rem; font-weight: 800; color: #ddffea; }
.modal-subtitle { font-size: .8rem; color: var(--muted); margin-top: .15rem; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.modal-panel { border: 1px solid var(--line); border-radius: 0; background: #101b16; padding: .7rem; margin-bottom: .65rem; }
.modal-panel h3 { margin: 0 0 .5rem; font-size: .95rem; }
.modal-status { margin-bottom: .35rem; font-weight: 700; color: #7af3af; }
.modal-events { display: grid; gap: .5rem; max-height: 320px; overflow: auto; }
.modal-event { border: 1px solid var(--line); border-radius: 0; background: #0f1914; padding: .5rem; }
.ghost-btn { background: #101a15; border: 1px solid #2d493a; border-radius: 0; color: #b4d8c2; }
.hidden { display: none; }
a { color: #7ddda7; }

@keyframes float-up {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translateY(-110vh) rotate(180deg); opacity: 0; }
}
@keyframes leaf-drift {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0.1; }
  20% { opacity: 1; }
  100% { transform: translate(-220px, 180px) rotate(190deg); opacity: 0; }
}
@keyframes parcel-flow {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  16% { opacity: 1; }
  100% { transform: translate(520px, -120px) rotate(120deg); opacity: 0; }
}

@keyframes rise-in {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@media (max-width: 1120px) {
  .dashboard-layout { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .content-grid, .modal-grid { grid-template-columns: 1fr; }
  .tree-scene { width: 360px; height: 280px; right: -20px; top: 20px; opacity: 0.3; }
}
