* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(15,107,255,.09), transparent 32%),
    radial-gradient(circle at top right, rgba(14,165,233,.08), transparent 24%),
    linear-gradient(180deg, #f7f9fd 0%, #f3f6fb 100%);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
svg { width: 18px; height: 18px; }

.app-shell { display: grid; grid-template-columns: 312px 1fr; min-height: 100vh; transition: grid-template-columns .24s ease; }
.app-shell.collapsed { grid-template-columns: 96px 1fr; }
.premium-shell { position: relative; }

.sidebar {
  background: linear-gradient(180deg, #07111f 0%, #0c1726 60%, #101c2d 100%);
  color: #e5eefc;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: visible;
  border-right: 1px solid rgba(255,255,255,.06);
  box-shadow: inset -1px 0 0 rgba(255,255,255,.04);
  z-index: 12;
}
.premium-sidebar.collapsed { padding-inline: 14px; }
.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand.compact { justify-content: center; width: 100%; }
.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0f6bff, #00d1ff);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 14px 30px rgba(14,165,233,.28);
  flex: 0 0 auto;
}
.brand-title { font-weight: 800; letter-spacing: -0.04em; font-size: 1.15rem; }
.brand-subtitle { font-size: .75rem; color: #95a3b8; }
.sidebar-section-label {
  color: #7f8ea4;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  padding: 0 10px 10px;
}
.nav-groups { display: grid; gap: 10px; }
.nav-group { position: relative; }
.nav-group.active .nav-group-trigger {
  background: linear-gradient(135deg, rgba(15,107,255,.16), rgba(0,209,255,.09));
  color: #fff;
  border-color: rgba(56,189,248,.22);
}
.nav-group-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.02);
  color: #dbe7f7;
  border-radius: 16px;
  padding: 12px 13px;
  transition: .18s ease;
}
.nav-group-trigger:hover {
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.11);
}
.nav-group-title { flex: 1; text-align: left; font-weight: 700; }
.nav-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  flex: 0 0 auto;
}
.nav-icon.small { width: 18px; height: 18px; opacity: .9; }
.nav-chevron {
  margin-left: auto;
  opacity: .7;
  transition: transform .18s ease;
}
.nav-chevron.open { transform: rotate(90deg); }
.nav-group-menu {
  display: grid;
  gap: 8px;
  padding: 10px 0 0 14px;
}
.nav-group:not(.open) .nav-group-menu { display: none; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: #bfd0e6;
  border-radius: 14px;
  transition: .18s ease;
}
.nav-item:hover, .nav-item.active, .nav-item.router-link-active {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.premium-sidebar.collapsed .nav-group-trigger {
  justify-content: center;
  padding: 14px 10px;
}
.premium-sidebar.collapsed .nav-group.active .nav-group-trigger {
  box-shadow: 0 10px 24px rgba(15,107,255,.18);
}
.nav-flyout {
  position: absolute;
  top: 0;
  left: calc(100% + 14px);
  min-width: 250px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.98);
  box-shadow: 0 28px 70px rgba(15,23,42,.18);
  backdrop-filter: blur(16px);
  z-index: 30;
}
.nav-flyout-title {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  margin-bottom: 10px;
  font-weight: 800;
}
.nav-flyout .nav-item {
  color: var(--text);
  border: 1px solid transparent;
}
.nav-flyout .nav-item:hover, .nav-flyout .nav-item.active, .nav-flyout .nav-item.router-link-active {
  background: #f3f7ff;
  color: var(--primary);
  border-color: rgba(15,107,255,.08);
}

.content { min-width: 0; }
.premium-content { position: relative; }
.topbar {
  min-height: 84px;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(15,23,42,.06);
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 18px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .73rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--primary);
  font-weight: 900;
}
.topbar h1 { font-size: 1.28rem; margin: 4px 0 0; letter-spacing: -0.04em; }
.company-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(15,23,42,.06);
  border-radius: 16px;
  padding: 10px 14px;
  background: rgba(255,255,255,.9);
}
.company-chip .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 0 0 4px rgba(15,107,255,.12);
}
.company-chip strong, .user-meta strong { display: block; font-size: .88rem; }
.company-chip small, .user-meta span { display: block; color: var(--muted); font-size: .74rem; }
.user-chip { display: flex; gap: 10px; align-items: center; font-size: .88rem; color: var(--muted); }
.premium-user-chip {
  border: 1px solid rgba(15,23,42,.06);
  border-radius: 18px;
  padding: 8px 10px 8px 8px;
  background: rgba(255,255,255,.92);
}
.avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0f6bff, #38bdf8);
  color: white;
  font-weight: 900;
}
.main { padding: 28px; max-width: 1520px; margin: 0 auto; }
.premium-main { padding-top: 30px; }
.mobile-only { display: none; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(15,23,42,.06);
  border-radius: 22px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  padding: 20px;
}
.card-title { margin: 0 0 12px; font-size: 1rem; letter-spacing: -0.02em; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn {
  border: 0;
  border-radius: 14px;
  padding: 10px 14px;
  background: #e2e8f0;
  color: var(--text);
  font-weight: 800;
  transition: .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; box-shadow: 0 14px 30px rgba(15,107,255,.22); }
.btn.dark { background: var(--dark); color: white; }
.btn.danger { background: #fee2e2; color: #991b1b; }
.btn.ghost { background: rgba(255,255,255,.75); border: 1px solid rgba(15,23,42,.08); }
.btn.soft-danger { color: #991b1b; }
.icon-btn {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.06);
  color: inherit;
}
.premium-topbar .icon-btn {
  background: rgba(255,255,255,.88);
  border-color: rgba(15,23,42,.08);
  color: var(--text);
}
.input, .select, .textarea {
  width: 100%;
  border: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.94);
  border-radius: 14px;
  padding: 10px 12px;
  outline: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: rgba(15,107,255,.35);
  box-shadow: 0 0 0 4px rgba(15,107,255,.08);
}
.textarea { min-height: 92px; resize: vertical; }
.label { display: grid; gap: 6px; color: var(--muted); font-size: .82rem; font-weight: 700; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.table-wrap { overflow: auto; border: 1px solid rgba(15,23,42,.06); border-radius: 18px; }
table { width: 100%; border-collapse: collapse; background: rgba(255,255,255,.96); }
th, td { text-align: left; padding: 14px 12px; border-bottom: 1px solid rgba(15,23,42,.06); vertical-align: top; }
th { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: #f8fafc; }
td { font-size: .9rem; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; font-size: .76rem; font-weight: 800; background: #e2e8f0; color: #334155; white-space: nowrap; }
.badge.success { background: #dcfce7; color: #166534; }
.badge.warning { background: #fef3c7; color: #92400e; }
.badge.danger { background: #fee2e2; color: #991b1b; }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(285px, 1fr); gap: 16px; overflow-x: auto; padding-bottom: 18px; }
.kanban-column { background: rgba(239,245,252,.92); border: 1px solid rgba(15,23,42,.06); border-radius: 22px; padding: 12px; min-height: 72vh; }
.kanban-title { display: flex; justify-content: space-between; align-items: center; font-weight: 850; margin: 4px 4px 12px; }
.order-card { background: rgba(255,255,255,.96); border: 1px solid rgba(15,23,42,.06); border-radius: 18px; padding: 14px; margin-bottom: 12px; box-shadow: 0 10px 24px rgba(15,23,42,.06); }
.order-code { font-weight: 900; color: var(--primary); }
.order-meta { color: var(--muted); font-size: .82rem; line-height: 1.45; margin-top: 8px; }
.order-card-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at top left, rgba(14,165,233,.22), transparent 38%), #07111f; }
.login-card { width: min(460px, 100%); background: rgba(255,255,255,.98); border-radius: 28px; padding: 32px; box-shadow: 0 30px 100px rgba(0,0,0,.28); }
.login-card h1 { margin: 0 0 8px; letter-spacing: -0.06em; }
.login-card p { margin: 0 0 24px; color: var(--muted); }
.alert { border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; background: #fee2e2; color: #991b1b; font-weight: 700; }
.empty { color: var(--muted); text-align: center; padding: 30px; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: grid; place-items: center; padding: 18px; z-index: 30; }
.modal { width: min(820px, 100%); max-height: 92vh; overflow: auto; background: white; border-radius: 24px; box-shadow: 0 30px 100px rgba(0,0,0,.3); padding: 24px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.timeline { display: grid; gap: 12px; }
.timeline-item { border-left: 3px solid var(--primary); padding-left: 12px; color: var(--muted); }
.timeline-item strong { color: var(--text); }
.muted-text { color: var(--muted); font-size: .9rem; line-height: 1.55; }
.callout { border: 1px solid rgba(15,23,42,.06); border-left: 4px solid var(--primary); background: #f8fafc; border-radius: 14px; padding: 14px; margin-top: 12px; color: var(--muted); }
.template-card { text-align: left; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease; }
.template-card:hover { transform: translateY(-2px); box-shadow: 0 18px 36px rgba(15,23,42,.12); }
.template-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.template-card p { color: var(--muted); margin: 10px 0; }
.stage-list { display: grid; gap: 10px; }
.stage-row { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 12px; align-items: flex-start; border: 1px solid rgba(15,23,42,.06); border-radius: 16px; padding: 12px; background: #fff; }
.stage-order { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: #eef6ff; color: var(--primary); font-weight: 900; }
a.badge { text-decoration: none; }
.full-span { grid-column: 1 / -1; }
.pill-check { display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(15,23,42,.06); border-radius: 999px; padding: 9px 12px; background: #fff; color: var(--muted); font-weight: 800; font-size: .82rem; }
.message-cell { max-width: 420px; white-space: pre-wrap; line-height: 1.45; color: var(--muted); }
.success-box { border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; background: #dcfce7; color: #166534; font-weight: 800; }
.wide-modal { width: min(1120px, 100%); }
.qr-box { display: flex; gap: 18px; align-items: center; border: 1px dashed rgba(15,23,42,.12); border-radius: 18px; padding: 14px; background: #f8fafc; }
.qr-box img { width: 190px; height: 190px; border-radius: 14px; background: #fff; padding: 8px; border: 1px solid rgba(15,23,42,.06); }
.checklist-row input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--primary); }
.alert-card { border-left: 5px solid #f59e0b; }
.alert-card.critical { border-left-color: #ef4444; }
.alert-card.warning { border-left-color: #f59e0b; }
.alert-card.info { border-left-color: #0ea5e9; }
.tracking-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top left, rgba(15,107,255,.22), transparent 36%), #07111f; }
.tracking-card { width: min(880px, 100%); background: rgba(255,255,255,.98); border-radius: 30px; padding: 30px; box-shadow: 0 30px 100px rgba(0,0,0,.32); }
.tracking-hero { border-radius: 24px; padding: 24px; background: linear-gradient(135deg, #eef6ff, #f8fafc); border: 1px solid rgba(15,23,42,.06); }
.tracking-hero h1 { margin: 10px 0 6px; font-size: clamp(1.7rem, 4vw, 3rem); letter-spacing: -.06em; }
.tracking-hero p { margin: 0; color: var(--muted); font-weight: 800; }
.tracking-status { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px; border: 1px solid rgba(15,23,42,.06); border-radius: 18px; margin-top: 18px; }
.tracking-status strong { display: block; font-size: 1.3rem; margin-top: 4px; }

/* Dashboard premium */
.dashboard-premium { gap: 22px; }
.hero-panel {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 24px;
  padding: 26px;
  background:
    radial-gradient(circle at top right, rgba(14,165,233,.18), transparent 24%),
    linear-gradient(135deg, #07111f 0%, #0f172a 48%, #10233d 100%);
  color: white;
  overflow: hidden;
  position: relative;
}
.hero-panel::after {
  content: '';
  position: absolute;
  width: 360px;
  height: 360px;
  right: -120px;
  top: -120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56,189,248,.26), transparent 65%);
}
.hero-copy, .hero-metrics { position: relative; z-index: 1; }
.hero-copy h2 { margin: 10px 0; font-size: clamp(1.5rem, 2.8vw, 2.4rem); letter-spacing: -.06em; max-width: 14ch; }
.hero-copy p { margin: 0; color: rgba(255,255,255,.78); line-height: 1.65; max-width: 64ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.hero-actions .btn.ghost { background: rgba(255,255,255,.08); color: white; border-color: rgba(255,255,255,.12); }
.hero-metrics {
  display: grid;
  gap: 14px;
  align-content: center;
}
.hero-metric {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.08);
}
.hero-metric small { display: block; color: rgba(255,255,255,.68); margin-bottom: 4px; }
.hero-metric strong { font-size: 1.2rem; letter-spacing: -.04em; }
.metric-ring {
  width: 14px;
  height: 48px;
  border-radius: 999px;
  display: inline-block;
  background: linear-gradient(180deg, rgba(255,255,255,.24), rgba(255,255,255,.08));
}
.metric-ring.blue { background: linear-gradient(180deg, #60a5fa, #0ea5e9); }
.metric-ring.amber { background: linear-gradient(180deg, #fbbf24, #f59e0b); }
.metric-ring.red { background: linear-gradient(180deg, #fb7185, #ef4444); }
.metric-card-grid .metric-card { text-align: left; min-height: 150px; }
.metric-card {
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.92));
}
.metric-card-head { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 700; }
.metric-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 1.2rem;
  font-weight: 900;
}
.metric-icon.cyan { background: #ecfeff; color: #0891b2; }
.metric-icon.blue { background: #eef4ff; color: #2563eb; }
.metric-icon.emerald { background: #ecfdf5; color: #059669; }
.metric-icon.red { background: #fef2f2; color: #dc2626; }
.metric-card-label { font-size: .84rem; }
.metric-card-value { font-size: 2.2rem; font-weight: 900; letter-spacing: -.06em; margin-top: 18px; }
.metric-card-hint { color: var(--muted); margin-top: 8px; font-size: .84rem; }
.danger-tint { background: linear-gradient(180deg, #fff, #fff7f7); }
.focus-grid { align-items: stretch; }
.focus-card { display: flex; flex-direction: column; justify-content: space-between; min-height: 190px; }
.focus-card h3 { margin: 4px 0 0; font-size: 1.2rem; letter-spacing: -.04em; }
.focus-card p { color: var(--muted); line-height: 1.6; margin: 14px 0 18px; }
.focus-top { display: flex; justify-content: space-between; gap: 14px; }
.focus-badge {
  min-width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  font-weight: 900;
  font-size: 1.15rem;
  color: var(--text);
  background: rgba(255,255,255,.78);
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.06);
}
.soft-blue { background: linear-gradient(180deg, #ffffff, #f5f9ff); }
.soft-amber { background: linear-gradient(180deg, #ffffff, #fffaf0); }
.soft-red { background: linear-gradient(180deg, #ffffff, #fff5f5); }
.panel-card { padding: 22px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.panel-head h3 { margin: 4px 0 0; font-size: 1.08rem; letter-spacing: -.03em; }
.list-bars { display: grid; gap: 14px; }
.bar-row { display: grid; gap: 8px; }
.bar-label-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: .92rem; }
.bar-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #e7eef8;
  overflow: hidden;
}
.bar-track.soft { background: #edf2f7; }
.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--primary), #38bdf8);
}
.bar-fill.secondary { background: linear-gradient(135deg, #64748b, #0ea5e9); }
.dashboard-table-wrap { border-radius: 18px; }
.critical-list { display: grid; gap: 12px; }
.critical-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid rgba(15,23,42,.06);
  border-radius: 18px;
  background: #fbfdff;
}
.critical-meta {
  display: grid;
  justify-items: end;
  gap: 8px;
  color: var(--muted);
  font-size: .86rem;
  text-align: right;
}

@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-panel { grid-template-columns: 1fr; }
}
@media (max-width: 920px) {
  .app-shell, .app-shell.collapsed { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; overflow: visible; }
  .premium-sidebar.collapsed { padding-inline: 16px; }
  .nav-flyout { position: static; left: auto; margin-top: 10px; }
  .grid-4, .grid-3, .grid-2, .form-grid { grid-template-columns: 1fr; }
  .topbar { position: static; align-items: flex-start; gap: 12px; flex-direction: column; }
  .topbar-right, .topbar-left { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .mobile-only { display: inline-grid; }
  .company-chip, .premium-user-chip { width: 100%; justify-content: space-between; }
  .stage-row { grid-template-columns: 1fr; }
  .stage-order { width: auto; }
  .full-span { grid-column: auto; }
  .message-cell { max-width: 260px; }
  .qr-box, .tracking-status, .critical-item { flex-direction: column; align-items: flex-start; }
  .qr-box img { width: 150px; height: 150px; }
}
