:root {
  --np-red: #e53935;
  --np-red-dark: #c62828;
  --np-red-soft: #fde8e8;
  --np-red-border: #f8b4b4;
  --np-bg: #f4f6f9;
  --np-surface: #ffffff;
  --np-text: #1e293b;
  --np-muted: #64748b;
  --np-border: #e2e8f0;
  --np-amber-bg: #fffbeb;
  --np-amber-border: #fde68a;
  --np-amber-text: #92400e;
  --np-blue-bg: #eff6ff;
  --np-blue-border: #bfdbfe;
  --np-blue-text: #1d4ed8;
  --np-green: #16a34a;
  --np-green-bg: #dcfce7;
  --np-purple: #7c3aed;
  --np-amber: #d97706;
  --np-radius: 12px;
  --np-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
  --np-sidebar-w: 252px;
  --np-header-h: 64px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--np-bg);
  color: var(--np-text);
  font-size: 14px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }

/* ===================== LOGIN SPLIT-CARD ===================== */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
}

.login-card {
  width: 100%;
  max-width: 1060px;
  min-height: 620px;
  background: var(--np-surface);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.10);
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  overflow: hidden;
  border: 1px solid #e9eef5;
}

.login-hero {
  position: relative;
  padding: 44px 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(circle at 85% 15%, rgba(229, 57, 53, 0.16), transparent 46%),
    radial-gradient(circle at 12% 88%, rgba(229, 57, 53, 0.22), transparent 52%),
    linear-gradient(160deg, #f8fafc 0%, #eef2f6 52%, #e6ebf2 100%);
  border-right: 1px solid var(--np-border);
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.hero-brand img { height: 42px; width: auto; object-fit: contain; }
.hero-brand-text strong { display: block; font-size: 15px; color: var(--np-red); letter-spacing: 0.4px; }
.hero-brand-text span { font-size: 11px; color: var(--np-muted); font-weight: 600; letter-spacing: 1px; }

.hero-title {
  margin: 0 0 12px;
  font-size: 34px;
  line-height: 1.2;
  font-weight: 800;
  color: #1f2937;
}
.hero-title .accent { color: var(--np-red); }
.hero-sub { margin: 0 0 28px; color: #475569; font-size: 15px; max-width: 440px; }

.hero-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.hero-feature-box {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 14px;
  padding: 18px 12px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}
.hero-feature-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--np-red-soft);
  color: var(--np-red);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  margin-bottom: 10px;
}
.hero-feature-box strong { display: block; font-size: 13px; color: #1e293b; }

.hero-stats {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.96);
  border-radius: 16px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.07);
}
.hero-stat-item { display: flex; align-items: center; gap: 10px; }
.hero-stat-badge {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--np-red-soft); color: var(--np-red);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0;
}
.hero-stat-item strong { display: block; font-size: 16px; color: #0f172a; }
.hero-stat-item span { font-size: 11px; color: var(--np-muted); }

.login-form-panel {
  padding: 36px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-lang-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}
.lang-pill {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--np-border); border-radius: 999px;
  padding: 5px 12px; font-size: 12px; font-weight: 600; color: #334155; background: #fff;
}
.login-heading { margin: 0 0 6px; font-size: 28px; font-weight: 800; color: #0f172a; }
.login-sub { margin: 0 0 26px; color: var(--np-muted); }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; font-size: 13px; color: #334155; margin-bottom: 6px; }
.req { color: var(--np-red); }

.input-wrap { position: relative; }
.form-control {
  width: 100%;
  height: 42px;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: var(--np-text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus {
  border-color: var(--np-red);
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.12);
}
textarea.form-control { height: auto; min-height: 76px; resize: vertical; }
.input-eye {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  border: none; background: transparent; cursor: pointer; color: var(--np-muted); padding: 4px;
}

.login-options {
  display: flex; align-items: center; justify-content: space-between;
  margin: 8px 0 20px; font-size: 13px;
}
.check-label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: #334155; }
.link-blue { color: #2563eb; font-weight: 600; cursor: pointer; }
.link-blue:hover { text-decoration: underline; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 18px; border-radius: 10px;
  font-weight: 600; border: 1px solid transparent; cursor: pointer;
  transition: background 0.15s, transform 0.08s, border-color 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--np-red); color: #fff; }
.btn-primary:hover { background: var(--np-red-dark); }
.btn-outline { background: #fff; border-color: #cbd5e1; color: #334155; }
.btn-outline:hover { border-color: var(--np-red); color: var(--np-red); background: #fff8f8; }
.btn-soft { background: var(--np-red-soft); color: var(--np-red); }
.btn-soft:hover { background: #fbd5d5; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; height: 44px; font-size: 15px; }

.login-support {
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--np-border);
  text-align: center; font-size: 13px; color: var(--np-muted);
}
.login-support .accent { color: var(--np-red); font-weight: 700; }
.login-footer { margin-top: 18px; font-size: 12.5px; color: var(--np-muted); text-align: center; }

/* ===================== APP SHELL ===================== */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.top-header {
  position: fixed; top: 0; left: 0; right: 0; height: var(--np-header-h);
  background: #fff; border-bottom: 1px solid var(--np-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; z-index: 40; gap: 14px;
}
.header-left { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.header-logo {
  display: flex; align-items: center; gap: 10px; width: calc(var(--np-sidebar-w) - 34px);
  cursor: pointer; flex-shrink: 0;
}
.header-logo img { height: 36px; width: auto; object-fit: contain; }
.header-logo strong { font-size: 15px; color: var(--np-red); display: block; line-height: 1.1; white-space: nowrap; }
.header-logo span { font-size: 10px; color: var(--np-muted); letter-spacing: 0.7px; white-space: nowrap; }

.header-cta {
  background: var(--np-red); color: #fff; border: none; border-radius: 999px;
  padding: 8px 15px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap; flex-shrink: 0;
}
.header-cta:hover { background: var(--np-red-dark); }
.header-link-btn {
  background: transparent; border: none; color: #334155; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 8px;
  white-space: nowrap; flex-shrink: 0;
}
.header-link-btn:hover { background: #f1f5f9; color: var(--np-red); }

.header-right { display: flex; align-items: center; gap: 12px; }
.global-search {
  display: flex; align-items: center; background: #f1f5f9; border-radius: 999px;
  padding: 3px 4px 3px 14px; width: 250px; border: 1px solid transparent;
}
.global-search:focus-within { border-color: var(--np-red); background: #fff; }
.global-search input {
  border: none; background: transparent; outline: none; width: 100%; font-size: 13px;
}
.global-search button {
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: var(--np-red); color: #fff; cursor: pointer; flex-shrink: 0;
}
.user-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px;
  border-radius: 999px; background: #f8fafc; border: 1px solid var(--np-border);
  font-weight: 600; font-size: 13px; cursor: pointer;
}
.demo-badge {
  background: #fef3c7; color: #92400e; font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
}

.app-body {
  display: flex;
  padding-top: var(--np-header-h);
  min-height: 100vh;
}

.sidebar {
  width: var(--np-sidebar-w);
  position: fixed; top: var(--np-header-h); bottom: 0; left: 0;
  background: #fff; border-right: 1px solid var(--np-border);
  overflow-y: auto; padding: 14px 12px 24px; z-index: 30;
}
.nav-section {
  font-size: 11px; font-weight: 700; color: var(--np-red);
  letter-spacing: 0.6px; padding: 14px 12px 6px; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px; margin-bottom: 3px;
  color: #334155; font-weight: 500; cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.nav-item:hover { background: #f8fafc; color: var(--np-red); }
.nav-item.active {
  background: var(--np-red-soft); color: var(--np-red); font-weight: 700;
}
.nav-item .ico { width: 20px; text-align: center; font-size: 15px; }

.main-content {
  margin-left: var(--np-sidebar-w);
  flex: 1;
  padding: 18px 24px 36px;
  min-width: 0;
}

.scam-banner {
  background: var(--np-red-soft);
  border: 1px solid var(--np-red-border);
  color: var(--np-red-dark);
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 18px;
  font-weight: 600;
  font-size: 13px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}

/* ===================== CARDS, GRIDS, TABLES ===================== */
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 12px;
}
.page-head h1 { margin: 0; font-size: 20px; font-weight: 800; color: #0f172a; }
.breadcrumb { font-size: 12.5px; color: var(--np-muted); }

.card {
  background: #fff; border: 1px solid var(--np-border);
  border-radius: var(--np-radius); box-shadow: var(--np-shadow);
  margin-bottom: 18px; overflow: hidden;
}
.card-header {
  padding: 14px 18px; border-bottom: 1px solid #f1f5f9;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.card-title { margin: 0; font-size: 14px; font-weight: 800; color: #0f172a; text-transform: uppercase; letter-spacing: 0.3px; }
.card-body { padding: 18px; }

.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 18px;
}
.kpi-card {
  background: #fff; border: 1px solid var(--np-border); border-radius: var(--np-radius);
  padding: 16px 18px; box-shadow: var(--np-shadow); display: flex; flex-direction: column; gap: 10px;
}
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; }
.kpi-value { font-size: 26px; font-weight: 800; line-height: 1.1; }
.kpi-label { font-size: 13px; color: var(--np-muted); font-weight: 600; margin-top: 4px; }
.kpi-bar { height: 5px; border-radius: 99px; background: #f1f5f9; overflow: hidden; }
.kpi-bar > div { height: 100%; border-radius: 99px; }
.kpi-link { font-size: 12px; font-weight: 700; color: var(--np-muted); cursor: pointer; }
.kpi-link:hover { color: var(--np-red); }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.create-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; align-items: start; }
.sticky-col { position: sticky; top: calc(var(--np-header-h) + 18px); }

.tip-bar {
  background: var(--np-amber-bg); border: 1px solid var(--np-amber-border);
  color: var(--np-amber-text); border-radius: 10px; padding: 10px 14px; font-size: 13px;
}
.info-bar {
  background: var(--np-blue-bg); border: 1px solid var(--np-blue-border);
  color: var(--np-blue-text); border-radius: 10px; padding: 10px 14px; font-weight: 600;
  text-align: center; margin-bottom: 14px;
}

.radio-pills { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px;
  border: 1px solid #cbd5e1; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 13px;
}
.radio-pill.active { border-color: var(--np-red); background: var(--np-red-soft); color: var(--np-red); }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: #f8fafc; color: #334155; font-size: 12px; font-weight: 700;
  text-transform: uppercase; text-align: left; padding: 11px 12px;
  border-bottom: 2px solid var(--np-border); white-space: nowrap;
}
.data-table td {
  padding: 12px; border-bottom: 1px solid #f1f5f9; vertical-align: top;
}
.data-table tr:hover td { background: #fcfcfd; }

.waybill-code { color: var(--np-red); font-weight: 800; font-size: 15px; cursor: pointer; }
.waybill-code:hover { text-decoration: underline; }
.status-pill {
  display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
}
.st-new { background: var(--np-red-soft); color: var(--np-red); }
.st-ok { background: var(--np-green-bg); color: var(--np-green); }
.st-ship { background: #fef3c7; color: #b45309; }
.st-ret { background: #dbeafe; color: #1d4ed8; }
.st-cancel { background: #f1f5f9; color: #64748b; }

.inline-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px;
  border: 1px solid #cbd5e1; border-radius: 6px; background: #fff;
  font-size: 12px; font-weight: 600; color: #334155; cursor: pointer;
}
.chip-btn:hover { border-color: var(--np-red); color: var(--np-red); }

.fee-box {
  background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 10px;
  padding: 12px 14px; margin-bottom: 14px;
}
.fee-row { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 13px; }
.fee-total { font-size: 16px; font-weight: 800; color: var(--np-red); border-top: 1px solid #e2e8f0; padding-top: 8px; margin-top: 6px; }

/* ===================== TIMELINE & CHART ===================== */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 18px 28px; border-left: 2px solid #e2e8f0; margin-left: 8px; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--np-red); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--np-red-soft);
}

.bar-chart { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 48px; align-items: center; gap: 10px; font-size: 13px; }
.bar-track { height: 12px; background: #f1f5f9; border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #e53935, #f97316); border-radius: 99px; }

/* ===================== TOAST & MODAL ===================== */
.toast-root {
  position: fixed; top: 20px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: #0f172a; color: #fff; padding: 12px 16px; border-radius: 10px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.22); font-weight: 600; font-size: 13px; max-width: 360px;
}
.toast.ok { background: #15803d; }
.toast.err { background: #b91c1c; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.52);
  display: flex; align-items: center; justify-content: center; z-index: 9000; padding: 16px;
}
.modal-box {
  background: #fff; border-radius: 16px; max-width: 520px; width: 100%;
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.25); overflow: hidden;
}
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--np-border); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { margin: 0; font-size: 16px; color: var(--np-red); }
.modal-body { padding: 18px 20px; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--np-border); display: flex; justify-content: flex-end; gap: 8px; }

.mobile-menu-btn { display: none; border: 1px solid var(--np-border); background: #fff; border-radius: 8px; padding: 6px 10px; cursor: pointer; }

@media (max-width: 980px) {
  .login-card { display: block; width: 100%; max-width: 460px; min-height: auto; }
  .login-hero { display: none; }
  .login-form-panel { padding: 28px 24px; }
  .create-layout { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .global-search { display: none; }
  .mobile-menu-btn { display: inline-flex; }
  .sidebar { transform: translateX(-100%); transition: transform 0.2s; }
  .sidebar.open { transform: translateX(0); box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15); }
  .main-content { margin-left: 0; padding: 14px; }
  .header-logo { width: auto; }
}
