:root {
  --bg: #06162b;
  --surface: rgba(9, 29, 55, 0.88);
  --surface-soft: rgba(255, 255, 255, 0.08);
  --ink: #eef7ff;
  --muted: #b6cce2;
  --line: rgba(255, 255, 255, 0.18);
  --brand: #18bdf2;
  --brand-dark: #0796cf;
  --brand-deep: #081b33;
  --accent: #f59e0b;
  --success: #0f8f5f;
  --shadow: 0 18px 46px rgba(15, 31, 51, 0.13);
  --glow: 0 0 0 1px rgba(14, 165, 233, 0.25), 0 10px 26px rgba(14, 165, 233, 0.26);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(4, 17, 35, 0.18), rgba(4, 17, 35, 0.28)),
    url("assets/login-bg.svg") center top / cover fixed,
    #06162b;
  color: var(--ink);
  font-family: Tahoma, Arial, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
  background: var(--brand-dark);
  box-shadow: var(--glow);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 7px;
  background: rgba(245, 249, 253, 0.94);
  color: #223042;
  padding: 0 12px;
}

input:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.16);
  outline: none;
}

textarea {
  min-height: 92px;
  padding: 12px;
  resize: vertical;
}

a {
  color: var(--brand);
}

.app-shell {
  width: min(1240px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 36px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(4, 17, 35, 0.72);
  backdrop-filter: blur(14px);
  color: #fff;
  box-shadow: 0 18px 42px rgba(7, 23, 44, 0.18);
}

.eyebrow,
.muted,
.hint {
  color: var(--muted);
}

.topbar .eyebrow {
  color: #8bd8ff;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 13px;
}

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

h1 {
  margin-bottom: 0;
  font-size: 28px;
  color: #fff;
}

h2 {
  margin-bottom: 16px;
  font-size: 24px;
}

h3 {
  font-size: 18px;
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.tab,
.ghost,
.side-link {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.tab {
  min-height: 38px;
  border-radius: 999px;
  background: transparent;
  color: #dbeafe;
  border-color: transparent;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.tab.is-active,
.side-link.is-active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: var(--glow);
}

.view,
.admin-page {
  display: none;
}

.view.is-active,
.admin-page.is-active {
  display: block;
}

.panel,
.dashboard {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: #fff;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.split-panel {
  min-height: 560px;
}

.split-panel,
.portal-grid {
  align-items: stretch;
}

.split-panel,
.portal-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 16px;
}

.split-panel:has(.result-area[hidden]),
.portal-grid:has(#customer-portal[hidden]) {
  grid-template-columns: minmax(320px, 460px);
  justify-content: center;
  min-height: 620px;
  align-items: center;
}

.lookup,
.result-area,
.panel {
  padding: 24px;
}

.lookup {
  position: relative;
  overflow: hidden;
  color: #fff;
  border-color: rgba(14, 165, 233, 0.28);
  background:
    linear-gradient(rgba(9, 36, 68, 0.68), rgba(6, 24, 46, 0.82)),
    url("assets/login-bg.svg") center / cover;
}

.lookup::before,
.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 44px 28px;
  opacity: 0.65;
}

.lookup > *,
.auth-card > * {
  position: relative;
}

.lookup .eyebrow,
.lookup .hint {
  color: #bde8ff;
}

.lookup input {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.94);
}

.stack-form {
  display: grid;
  gap: 12px;
}

.support-line {
  margin: 14px 0 0;
  font-size: 12px;
}

.inline-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.tucked {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.login-box {
  width: min(460px, 100%);
  margin: 58px auto;
  padding: 34px 26px 26px;
}

.auth-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  color: #fff;
  border-color: rgba(125, 211, 252, 0.38);
  background:
    radial-gradient(circle at 50% -18%, rgba(255, 241, 184, 0.42), transparent 24%),
    rgba(13, 42, 78, 0.72);
  box-shadow: 0 24px 70px rgba(2, 12, 28, 0.44);
  backdrop-filter: blur(18px);
}

.auth-card::after {
  content: "";
  position: absolute;
  top: -18px;
  right: 50%;
  width: 150px;
  height: 80px;
  transform: translateX(50%);
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(255, 231, 180, 0.62), transparent 68%);
  filter: blur(4px);
}

.auth-card h2,
.auth-card strong {
  color: #fff;
}

.auth-card h2 {
  margin-bottom: 18px;
  font-size: 29px;
  font-weight: 800;
}

.auth-title {
  text-align: center;
}

.auth-eyebrow {
  text-align: center;
}

.auth-card .eyebrow,
.auth-card .hint {
  color: #c7e9ff;
}

.auth-card input {
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: rgba(245, 249, 253, 0.94);
  color: #243142;
  text-align: left;
  direction: ltr;
  padding: 0 18px;
}

.auth-card button:not(.ghost) {
  height: 48px;
  border-radius: 999px;
  background: #1fb4e7;
  box-shadow: 0 10px 22px rgba(31, 180, 231, 0.24);
}

.auth-card button:not(.ghost):hover {
  background: #0e9ed2;
}

.auth-card .ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #e6f6ff;
  font-size: 12px;
  direction: ltr;
}

.auth-options label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.auth-options input[type="checkbox"] {
  width: 13px;
  height: 13px;
  min-height: 13px;
  padding: 0;
  accent-color: var(--brand);
}

.text-link {
  height: auto !important;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent !important;
  color: #fff;
  box-shadow: none !important;
  font-size: inherit;
}

.text-link:hover {
  background: transparent;
  color: #7dd3fc;
  box-shadow: none;
}

.strong-link {
  font-weight: 800;
}

.auth-switch {
  margin: 12px 0 0;
  text-align: center;
  color: #e6f6ff;
  direction: ltr;
  font-size: 13px;
}

.auth-submit {
  margin-top: 2px;
}

.auth-card .tucked {
  margin-top: 16px;
  padding-top: 16px;
  border-top-color: rgba(255, 255, 255, 0.22);
}

.auth-card .ghost:hover {
  background: rgba(14, 165, 233, 0.28);
}

.login-brand,
.sidebar-brand,
.section-title,
.card-head,
.shipment-row,
.detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-card .login-brand {
  align-items: start;
  margin-bottom: 8px;
}

.auth-card .brand-mark {
  margin-top: 2px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
}

.login-box .brand-mark {
  width: 52px;
  height: 52px;
  font-size: 24px;
}

.dashboard {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: 660px;
  overflow: hidden;
}

.admin-sidebar {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, #0d2a50, #07182e);
  color: #fff;
}

.sidebar-brand {
  justify-content: start;
  margin-bottom: 10px;
}

.side-link {
  width: 100%;
  justify-content: start;
  text-align: right;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #dbeafe;
  border-color: rgba(255, 255, 255, 0.1);
}

.side-link:hover {
  background: rgba(14, 165, 233, 0.2);
  box-shadow: none;
}

.admin-main {
  padding: 24px;
  min-width: 0;
  color: #fff;
}

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

.form-grid textarea,
.form-grid button {
  grid-column: 1 / -1;
}

.compact-form {
  margin: 12px 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.shipment-list,
.alert-list,
.event-list {
  display: grid;
  gap: 10px;
}

.shipment-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.shipment-row:hover {
  border-color: rgba(14, 165, 233, 0.45);
  box-shadow: 0 12px 24px rgba(14, 165, 233, 0.12);
  transform: translateY(-1px);
}

.row-open {
  display: grid;
  gap: 5px;
  min-height: auto;
  padding: 0;
  background: transparent;
  color: #fff;
  text-align: right;
}

.row-open:hover {
  background: transparent;
  color: var(--brand);
  box-shadow: none;
}

.row-open span {
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  max-width: 100%;
  padding: 0 10px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 700;
  white-space: normal;
}

.shipment-card,
.detail-page,
.customer-card,
.alert,
.event-item,
.note-box,
.global-summary p {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.shipment-card,
.detail-page {
  padding: 22px;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.details-grid p,
.global-summary p {
  margin: 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.details-grid span,
.global-summary span,
.event-item span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.timeline {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  padding: 12px 14px;
  border-right: 4px solid var(--brand);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
}

.timeline p {
  margin: 6px 0;
  color: var(--muted);
}

.detail-actions {
  flex-wrap: wrap;
  justify-content: start;
  margin: 18px 0;
}

.detail-actions input {
  flex: 1 1 280px;
}

.detail-columns {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
}

.note-box,
.alert,
.event-item,
.customer-card {
  padding: 12px;
}

.customer-card {
  display: grid;
  gap: 6px;
  cursor: pointer;
}

.customer-card span {
  color: var(--success);
  font-weight: 700;
}

.global-track-form,
.assistant-box {
  display: grid;
  grid-template-columns: 1fr 190px 150px;
  gap: 10px;
  margin-bottom: 14px;
}

.assistant-box {
  grid-template-columns: 1fr 150px;
}

.global-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.assistant-answer {
  min-height: 110px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  line-height: 1.8;
}

.narrow-form {
  width: min(520px, 100%);
}

@media (max-width: 920px) {
  .topbar,
  .split-panel,
  .portal-grid,
  .dashboard,
  .detail-columns,
  .global-summary {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
    align-items: stretch;
  }

  .admin-sidebar {
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }

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

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 18px, 1240px);
    padding-top: 12px;
  }

  h1 {
    font-size: 26px;
  }

  .tabs,
  .section-title,
  .shipment-row,
  .card-head,
  .login-brand,
  .detail-actions,
  .inline-actions,
  .global-track-form,
  .assistant-box,
  .form-grid,
  .details-grid {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .admin-main,
  .lookup,
  .result-area,
  .panel,
  .shipment-card,
  .detail-page {
    padding: 16px;
  }
}

@media print {
  body {
    background: #fff;
  }

  body * {
    visibility: hidden;
  }

  .print-invoice,
  .print-invoice * {
    visibility: visible;
  }

  .print-invoice {
    position: fixed;
    inset: 0;
    padding: 32px;
    color: #111;
    background: #fff;
  }
}
