/* ================================================
   GLOBALTRACK ADMIN PANEL — SHARED STYLES
   ================================================
   Navy + amber brand, clean dashboard aesthetic.
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&family=Manrope:wght@300;400;500;600;700&display=swap');

:root {
  --navy-900: #051429;
  --navy-800: #0a1f3d;
  --navy-700: #11305c;
  --navy-600: #1e4a8a;
  --navy-500: #2563a8;

  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --amber-600: #d97706;

  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  --success:  #10b981;
  --warning:  #f59e0b;
  --danger:   #ef4444;
  --info:     #0ea5e9;

  --white: #ffffff;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 6px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
  --shadow-xl: 0 24px 60px rgba(15, 23, 42, 0.18);

  --sidebar-w: 260px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: 'Manrope', system-ui, sans-serif;
  color: var(--slate-800);
  background: var(--slate-50);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  color: var(--navy-900);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

code, .mono { font-family: 'JetBrains Mono', monospace; }

/* ================================
   LAYOUT — SIDEBAR + MAIN
   ================================ */
.admin-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: linear-gradient(180deg, var(--navy-900), var(--navy-800));
  color: var(--white);
  padding: 24px 18px;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  z-index: 50;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 24px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--amber-500), var(--amber-600));
  color: var(--navy-900);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(245, 158, 11, 0.35);
}

.sidebar-brand-text {
  font-family: 'Outfit', sans-serif;
  font-size: 17px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.01em;
}

.sidebar-brand-text span { color: var(--amber-400); }

.sidebar-brand-sub {
  font-size: 10px;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  margin-top: 2px;
}

.sidebar-section-label {
  font-size: 10px;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  padding: 16px 10px 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  color: var(--slate-300);
  border-radius: 10px;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s;
  position: relative;
}

.sidebar-link i {
  width: 16px;
  font-size: 14px;
  color: var(--slate-400);
  transition: color 0.2s;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
}

.sidebar-link:hover i { color: var(--amber-400); }

.sidebar-link.active {
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber-400);
  font-weight: 600;
}

.sidebar-link.active i { color: var(--amber-400); }

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: -18px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--amber-500);
  border-radius: 0 4px 4px 0;
}

.sidebar-badge {
  margin-left: auto;
  background: var(--amber-500);
  color: var(--navy-900);
  border-radius: 100px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  min-width: 22px;
  text-align: center;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: background 0.2s;
}

.sidebar-user:hover { background: rgba(255, 255, 255, 0.08); }

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--amber-500), var(--amber-600));
  color: var(--navy-900);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 11px;
  color: var(--slate-400);
}

/* Main */
.main {
  grid-column: 2;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top bar */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--slate-200);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-title h1 {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}

.topbar-title .sub {
  font-size: 13px;
  color: var(--slate-500);
  font-weight: 500;
}

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

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  background: var(--slate-100);
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  color: var(--navy-800);
  font-size: 18px;
}

/* Content area */
.content {
  padding: 28px 32px;
  flex: 1;
}

/* ================================
   BUTTONS
   ================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1;
}

.btn i { font-size: 13px; }

.btn-primary {
  background: linear-gradient(135deg, var(--amber-500), var(--amber-600));
  color: var(--navy-900);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
}

.btn-navy {
  background: var(--navy-800);
  color: var(--white);
}
.btn-navy:hover {
  background: var(--navy-900);
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--white);
  color: var(--slate-700);
  border-color: var(--slate-200);
}
.btn-ghost:hover {
  background: var(--slate-50);
  border-color: var(--slate-300);
  color: var(--navy-800);
}

.btn-danger {
  background: var(--white);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: var(--danger);
  color: var(--white);
  border-color: var(--danger);
}

.btn-success {
  background: var(--success);
  color: var(--white);
}
.btn-success:hover {
  background: #059669;
  transform: translateY(-1px);
}

.btn-sm { padding: 7px 12px; font-size: 12px; }
.btn-icon {
  width: 36px; height: 36px; padding: 0;
}

/* ================================
   STAT CARDS (dashboard)
   ================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: all 0.25s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--slate-300);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--amber-500);
}

.stat-card.success::before { background: var(--success); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.info::before { background: var(--info); }
.stat-card.danger::before { background: var(--danger); }

.stat-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.stat-card-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.1);
  color: var(--amber-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.stat-card.success .stat-card-icon { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.stat-card.warning .stat-card-icon { background: rgba(245, 158, 11, 0.1); color: var(--amber-600); }
.stat-card.info    .stat-card-icon { background: rgba(14, 165, 233, 0.1); color: var(--info); }
.stat-card.danger  .stat-card-icon { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

.stat-card-value {
  font-family: 'Outfit', sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: var(--navy-900);
  letter-spacing: -0.02em;
}

.stat-card-sub {
  font-size: 12px;
  color: var(--slate-500);
  margin-top: 4px;
}

/* ================================
   PANEL / CARD
   ================================ */
.panel {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
}

.panel-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.panel-title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-title i { color: var(--amber-500); font-size: 14px; }

.panel-body { padding: 20px 24px; }

/* ================================
   TABLE
   ================================ */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

table.tbl thead th {
  background: var(--slate-50);
  color: var(--slate-600);
  font-weight: 700;
  text-align: left;
  padding: 12px 18px;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--slate-200);
  white-space: nowrap;
}

table.tbl tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--slate-100);
  vertical-align: middle;
}

table.tbl tbody tr:hover { background: var(--slate-50); }
table.tbl tbody tr:last-child td { border-bottom: none; }

.tbl-tracking {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--navy-900);
  font-size: 12.5px;
}

.tbl-route {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--slate-600);
  font-size: 12.5px;
}

.tbl-route i { font-size: 10px; color: var(--amber-500); }

.tbl-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.tbl-empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--slate-500);
}

.tbl-empty i {
  font-size: 36px;
  color: var(--slate-300);
  margin-bottom: 12px;
  display: block;
}

.tbl-sub {
  display: block;
  font-size: 11.5px;
  color: var(--slate-500);
  margin-top: 2px;
}

.tbl-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  padding: 3px 7px;
  background: var(--slate-100);
  border-radius: 5px;
  color: var(--navy-700);
}

table.tbl td a {
  color: var(--navy-700);
  text-decoration: none;
}
table.tbl td a:hover {
  color: var(--amber-600);
  text-decoration: underline;
}

.channel-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  margin-right: 5px;
  margin-bottom: 4px;
  background: var(--slate-100);
  border-radius: 100px;
  font-size: 11.5px;
  color: var(--navy-700);
  font-weight: 500;
}
.channel-tag i { font-size: 10px; color: var(--amber-600); }

.action-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.2px;
  background: var(--slate-100);
  color: var(--slate-700);
}
.action-pill i { font-size: 10px; }
.action-pill.info    { background: rgba(59, 130, 246, 0.10);  color: #2563eb; }
.action-pill.success { background: rgba(16, 185, 129, 0.10);  color: #059669; }
.action-pill.danger  { background: rgba(239, 68, 68, 0.10);   color: #dc2626; }
.action-pill.warn    { background: rgba(245, 158, 11, 0.12);  color: #b45309; }
.action-pill.neutral { background: var(--slate-100);           color: var(--slate-700); }

/* ================================
   STATUS PILL
   ================================ */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill.in-transit { background: rgba(245, 158, 11, 0.12); color: var(--amber-600); }
.status-pill.customs    { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.status-pill.delivered  { background: rgba(16, 185, 129, 0.12); color: #059669; }
.status-pill.pending    { background: rgba(100, 116, 139, 0.12); color: var(--slate-600); }
.status-pill.verified   { background: rgba(16, 185, 129, 0.12); color: #059669; }
.status-pill.rejected   { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

/* ================================
   FORMS
   ================================ */
.form-section {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
  overflow: hidden;
}

.form-section-head {
  padding: 16px 22px;
  background: var(--slate-50);
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-section-head .num {
  width: 24px;
  height: 24px;
  background: var(--navy-800);
  color: var(--amber-400);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  font-family: 'Outfit';
  flex-shrink: 0;
}

.form-section-head h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}

.form-section-head .desc {
  margin-left: auto;
  font-size: 12px;
  color: var(--slate-500);
}

.form-section-body { padding: 22px; }

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

.field-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.field-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field.full { grid-column: 1 / -1; }

.field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--slate-700);
  display: flex;
  align-items: center;
  gap: 6px;
}

.field label .req { color: var(--danger); }
.field label .hint { color: var(--slate-400); font-weight: 500; font-size: 11px; }

.field input,
.field select,
.field textarea {
  padding: 11px 14px;
  border: 1.5px solid var(--slate-200);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  background: var(--white);
  color: var(--slate-800);
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--amber-500);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.field textarea { resize: vertical; min-height: 80px; }

.field .input-group {
  display: flex;
  gap: 8px;
}

.field .input-group input { flex: 1; }

/* Checkbox row */
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1.5px solid var(--slate-200);
  border-radius: 10px;
  background: var(--slate-50);
  cursor: pointer;
  user-select: none;
}

.check-row input { width: 16px; height: 16px; accent-color: var(--amber-500); cursor: pointer; }
.check-row label { font-size: 13.5px; font-weight: 600; color: var(--slate-700); cursor: pointer; margin: 0; }

/* ================================
   REPEATABLE ROWS (history, route, steps)
   ================================ */
.repeat-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.repeat-item {
  border: 1.5px solid var(--slate-200);
  border-radius: 12px;
  padding: 16px;
  background: var(--slate-50);
  position: relative;
}

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

.repeat-item-head .label {
  font-size: 12px;
  font-weight: 700;
  color: var(--slate-700);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.repeat-item-head .label .num {
  background: var(--navy-800);
  color: var(--amber-400);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
}

.btn-remove {
  background: transparent;
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  transition: background 0.15s;
}

.btn-remove:hover { background: rgba(239, 68, 68, 0.1); }

.btn-add {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--white);
  border: 1.5px dashed var(--slate-300);
  border-radius: 10px;
  color: var(--slate-700);
  font-weight: 600;
  font-size: 13px;
  transition: all 0.2s;
  margin-top: 14px;
  width: 100%;
  justify-content: center;
}

.btn-add:hover {
  border-color: var(--amber-500);
  background: rgba(245, 158, 11, 0.04);
  color: var(--amber-600);
}

/* ================================
   FORM PAGE LAYOUT
   ================================ */
.form-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: flex-start;
}

.form-nav {
  position: sticky;
  top: 90px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.form-nav-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 10px 12px;
  border-bottom: 1px solid var(--slate-200);
  margin-bottom: 8px;
}

.form-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-600);
  border-radius: 8px;
  transition: all 0.15s;
}

.form-nav a:hover { background: var(--slate-50); color: var(--navy-800); }
.form-nav a.active { background: rgba(245, 158, 11, 0.08); color: var(--amber-600); }

.form-nav a .num {
  width: 20px;
  height: 20px;
  background: var(--slate-100);
  color: var(--slate-600);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 800;
  font-family: 'Outfit';
}

.form-nav a.active .num { background: var(--amber-500); color: var(--navy-900); }

.form-main { min-width: 0; }

.form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 16px 22px;
  position: sticky;
  bottom: 16px;
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.06);
}

.form-footer .note {
  font-size: 12.5px;
  color: var(--slate-500);
}

.form-footer-actions { display: flex; gap: 10px; }

/* ================================
   SEARCH / FILTER BAR
   ================================ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 240px;
  max-width: 420px;
}

.search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate-400);
  font-size: 13px;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 11px 14px 11px 38px;
  border: 1.5px solid var(--slate-200);
  border-radius: 10px;
  font-family: inherit;
  font-size: 13.5px;
  background: var(--white);
  transition: border-color 0.15s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--amber-500);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

.filter-pills {
  display: flex;
  gap: 8px;
  background: var(--white);
  padding: 4px;
  border: 1.5px solid var(--slate-200);
  border-radius: 10px;
}

.filter-pills button {
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--slate-600);
  border-radius: 7px;
  transition: all 0.15s;
}

.filter-pills button.active {
  background: var(--navy-800);
  color: var(--amber-400);
}

.filter-pills button:not(.active):hover { background: var(--slate-50); }

/* ================================
   LOGIN PAGE
   ================================ */
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 20%, rgba(245, 158, 11, 0.08), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(10, 31, 61, 0.06), transparent 50%),
    linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 100%);
  position: relative;
  overflow: hidden;
}

.login-shell::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 50px 50px;
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

.login-card {
  background: var(--white);
  border-radius: 24px;
  padding: 44px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-xl);
  position: relative;
  z-index: 2;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-bottom: 28px;
}

.login-brand-icon {
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, var(--navy-800), var(--navy-900));
  color: var(--amber-400);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: var(--shadow-md);
}

.login-brand-text {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--navy-900);
}

.login-brand-text span { color: var(--amber-500); }

.login-title {
  text-align: center;
  font-size: 22px;
  margin-bottom: 6px;
}

.login-subtitle {
  text-align: center;
  color: var(--slate-500);
  font-size: 14px;
  margin-bottom: 28px;
}

.login-form { display: flex; flex-direction: column; gap: 16px; }

.login-form button[type="submit"] {
  padding: 13px 20px;
  background: linear-gradient(135deg, var(--navy-800), var(--navy-900));
  color: var(--white);
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.2s;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.login-form button[type="submit"]:hover {
  background: linear-gradient(135deg, var(--navy-900), #020713);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(10, 31, 61, 0.3);
}

.login-form button[disabled] { opacity: 0.6; cursor: not-allowed; transform: none; }

.login-error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--danger);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  display: none;
  align-items: center;
  gap: 10px;
}

.login-error.show { display: flex; }

.login-footer {
  text-align: center;
  margin-top: 22px;
  font-size: 12px;
  color: var(--slate-400);
}

/* ================================
   TOAST
   ================================ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--navy-900);
  color: var(--white);
  padding: 14px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 13.5px;
  box-shadow: var(--shadow-xl);
  z-index: 10000;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 400px;
}

.toast.show { opacity: 1; transform: translateY(0); }

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

.toast i { font-size: 16px; }

/* ================================
   MODAL
   ================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.2s;
}

.modal-backdrop.show { display: flex; opacity: 1; }

.modal {
  background: var(--white);
  border-radius: 18px;
  padding: 0;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  transform: scale(0.96);
  transition: transform 0.2s;
}

.modal-backdrop.show .modal { transform: scale(1); }

.modal-head { padding: 22px 26px 0; }
.modal-head h3 { font-size: 18px; margin-bottom: 6px; }
.modal-head p  { color: var(--slate-500); font-size: 13.5px; }

.modal-body { padding: 18px 26px 22px; }

.modal-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--slate-200);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--slate-900);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.modal-input:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, .15);
}

.modal-foot {
  padding: 14px 26px;
  background: var(--slate-50);
  border-top: 1px solid var(--slate-200);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-radius: 0 0 18px 18px;
}

/* ================================
   LOADING / EMPTY STATES
   ================================ */
.loader {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.center-load {
  text-align: center;
  padding: 60px 20px;
  color: var(--slate-500);
}

.center-load .loader {
  color: var(--amber-500);
  margin-bottom: 14px;
  width: 28px;
  height: 28px;
  border-width: 3px;
}

/* ================================
   RESPONSIVE
   ================================ */
@media (max-width: 980px) {
  .form-layout { grid-template-columns: 1fr; }
  .form-nav {
    position: static;
    display: flex;
    overflow-x: auto;
    gap: 6px;
    padding: 10px;
  }
  .form-nav-title { display: none; }
  .form-nav a { flex-shrink: 0; padding: 8px 12px; }
  .field-grid.cols-3, .field-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .admin-shell { grid-template-columns: 1fr; }
  .main { grid-column: 1; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
    width: 280px;
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-xl); }
  .menu-toggle { display: flex; }
  .content { padding: 20px 18px; }
  .topbar { padding: 14px 18px; }
  .topbar-title h1 { font-size: 18px; }
  .field-grid { grid-template-columns: 1fr; }
  .field-grid.cols-3, .field-grid.cols-4 { grid-template-columns: 1fr; }
  .stat-card-value { font-size: 26px; }
  .form-footer { flex-direction: column; align-items: stretch; }
  .form-footer-actions { width: 100%; }
  .form-footer-actions .btn { flex: 1; }
}

@media (max-width: 480px) {
  .login-card { padding: 32px 24px; }
  .panel-head { padding: 14px 18px; }
  .panel-body { padding: 16px 18px; }
  .form-section-body { padding: 16px; }
}

/* Print: hide chrome on shipment-form preview etc. */
@media print {
  .sidebar, .topbar, .form-nav, .form-footer { display: none !important; }
  .main { grid-column: 1; }
  .admin-shell { grid-template-columns: 1fr; }
}

/* Backdrop for mobile sidebar */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 49;
}
.sidebar-backdrop.show { display: block; }
