/* ==========================================================================
   KESHRI EXPRESS LOGISTICS ERP — SIGNATURE CARGO RED & VIBRANT INDUSTRIAL THEME
   Premium Express Logistics UI/UX with Micro-Interactions & Fluid Animations
   ========================================================================== */

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

:root {
  /* Signature Cargo Red & Vibrant Accent Palette */
  --brand-red: #dc2626;
  --brand-red-dark: #991b1b;
  --brand-red-deep: #7f1d1d;
  --brand-red-hover: #b91c1c;
  --brand-red-subtle: #fef2f2;
  --brand-red-glow: rgba(220, 38, 38, 0.25);

  --brand-gold: #f59e0b;
  --brand-gold-dark: #d97706;
  --brand-gold-subtle: #fffbeb;

  --brand-navy: #0f172a;
  --brand-navy-dark: #090d16;
  --brand-navy-light: #1e293b;
  --brand-blue: #2563eb;

  /* Surfaces & Neutral Backgrounds */
  --surface-bg: #f8fafc;
  --surface-card: #ffffff;
  --surface-toolbar: #f1f5f9;
  --border-main: #e2e8f0;
  --border-red: #fecaca;
  --border-focus: #dc2626;

  /* Typography */
  --text-heading: #0f172a;
  --text-body: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  /* Status Colors */
  --status-success-bg: #ecfdf5;
  --status-success-text: #065f46;
  --status-success-border: #a7f3d0;

  --status-warning-bg: #fffbeb;
  --status-warning-text: #92400e;
  --status-warning-border: #fde68a;

  --status-danger-bg: #fef2f2;
  --status-danger-text: #991b1b;
  --status-danger-border: #fecaca;

  --status-info-bg: #eff6ff;
  --status-info-text: #1e40af;
  --status-info-border: #bfdbfe;

  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 12px 24px -6px rgba(220, 38, 38, 0.15), 0 4px 8px -2px rgba(15, 23, 42, 0.05);
  --shadow-glow: 0 0 20px rgba(220, 38, 38, 0.35);

  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* Animations & Keyframe Motions */
@keyframes beacon-pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

@keyframes green-beacon {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-fade-up {
  animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.beacon-dot-red {
  width: 10px;
  height: 10px;
  background: var(--brand-red);
  border-radius: 50%;
  display: inline-block;
  animation: beacon-pulse 2s infinite;
}

.beacon-dot-green {
  width: 10px;
  height: 10px;
  background: #10b981;
  border-radius: 50%;
  display: inline-block;
  animation: green-beacon 2s infinite;
}

/* Base Global Reset */
html, body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  background-color: var(--surface-bg) !important;
  color: var(--text-body) !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  color: var(--text-heading);
  font-weight: 700 !important;
  letter-spacing: -0.02em;
}

code, pre, .font-mono, .awb-badge, .invoice-badge {
  font-family: 'JetBrains Mono', Consolas, monospace !important;
}

/* Top Enterprise Header */
.modern-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 60%, #450a0a 100%) !important;
  border-bottom: 3px solid var(--brand-red);
  color: #ffffff;
  padding: 0 24px;
  height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.modern-header .brand-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffffff !important;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modern-header .brand-badge {
  font-size: 11px;
  font-weight: 800;
  background: var(--brand-red);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px var(--brand-red-glow);
}

.modern-header .user-info-area {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-header-logoff {
  background: rgba(220, 38, 38, 0.2);
  border: 1px solid var(--brand-red);
  color: #fecaca;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-header-logoff:hover {
  background: var(--brand-red);
  color: #ffffff;
  box-shadow: 0 4px 12px var(--brand-red-glow);
  transform: translateY(-1px);
}

/* Sub-Navigation Bar */
.modern-nav {
  background: #ffffff !important;
  border-bottom: 1px solid var(--border-main) !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.03);
  padding: 0 20px;
  border-radius: 0 !important;
  margin-bottom: 0 !important;
}

.modern-nav .navbar-nav > li > a {
  color: var(--text-heading) !important;
  font-weight: 600;
  font-size: 13px;
  padding: 15px 16px;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.modern-nav .navbar-nav > li > a:hover,
.modern-nav .navbar-nav > li.active > a {
  color: var(--brand-red) !important;
  background: #fff5f5 !important;
  border-bottom-color: var(--brand-red);
}

/* Page Header Banner */
.modern-page-head {
  background: #ffffff;
  border-bottom: 1px solid var(--border-main);
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.modern-page-head h1 {
  font-size: 21px;
  margin: 0 0 4px 0;
  font-weight: 800;
  color: var(--brand-navy);
}

/* Cards & Panels */
.erp-card {
  background: var(--surface-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.erp-card:hover {
  border-color: #cbd5e1;
}

.erp-card-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-main);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.erp-card-title {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--brand-navy);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.erp-card-body {
  padding: 20px;
}

/* Operational Data Tables */
.erp-table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.erp-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0;
  font-size: 12.5px;
}

.erp-table thead th {
  background: #0f172a;
  color: #f8fafc;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  padding: 11px 14px;
  border-bottom: 2px solid var(--brand-red);
  border-top: none;
  white-space: nowrap;
  vertical-align: middle;
}

.erp-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-main);
  color: var(--text-body);
  vertical-align: middle;
}

.erp-table tbody tr {
  transition: background-color 0.15s ease;
}

.erp-table tbody tr:hover {
  background-color: #fff1f2;
}

.erp-table tbody tr:last-child td {
  border-bottom: none;
}

/* Form Controls & Inputs */
.form-control, .input-sm {
  border-radius: var(--radius-sm) !important;
  border: 1px solid var(--border-main) !important;
  box-shadow: none !important;
  font-size: 13px !important;
  height: 36px !important;
  padding: 6px 12px !important;
  color: var(--text-heading) !important;
  transition: all 0.2s ease !important;
}

.form-control:focus {
  border-color: var(--brand-red) !important;
  outline: 0 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
}

label {
  font-weight: 600 !important;
  font-size: 12.5px !important;
  color: #334155 !important;
  margin-bottom: 5px !important;
}

/* Premium Buttons */
.btn {
  font-weight: 700 !important;
  font-size: 13px !important;
  border-radius: var(--radius-sm) !important;
  padding: 7px 16px !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--brand-red) !important;
  border-color: var(--brand-red) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px var(--brand-red-glow);
}
.btn-primary:hover {
  background: var(--brand-red-hover) !important;
  border-color: var(--brand-red-hover) !important;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35) !important;
  transform: translateY(-1px);
}

.btn-default {
  background: #ffffff !important;
  border-color: var(--border-main) !important;
  color: #334155 !important;
}
.btn-default:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
  transform: translateY(-1px);
}

.btn-success {
  background: #059669 !important;
  border-color: #059669 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25);
}
.btn-success:hover {
  background: #047857 !important;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
  transform: translateY(-1px);
}

.btn-danger {
  background: #b91c1c !important;
  border-color: #b91c1c !important;
  color: #ffffff !important;
}

.btn-xs {
  padding: 4px 10px !important;
  font-size: 11.5px !important;
}

/* Status Badges */
.badge-pill-modern {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 50px;
  line-height: 1.2;
}

.badge-success {
  background-color: var(--status-success-bg);
  color: var(--status-success-text);
  border: 1px solid var(--status-success-border);
}

.badge-warning {
  background-color: var(--status-warning-bg);
  color: var(--status-warning-text);
  border: 1px solid var(--status-warning-border);
}

.badge-danger {
  background-color: var(--status-danger-bg);
  color: var(--status-danger-text);
  border: 1px solid var(--status-danger-border);
}

.badge-info, .badge-primary {
  background-color: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.badge-red {
  background-color: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

/* Quick Action Buttons Grid */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.quick-action-btn {
  background: #ffffff;
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none !important;
  color: var(--text-heading) !important;
  font-weight: 700;
  font-size: 12.5px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.quick-action-btn i {
  font-size: 20px;
  color: var(--brand-red);
  transition: transform 0.2s ease;
}

.quick-action-btn:hover {
  border-color: var(--brand-red);
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(220, 38, 38, 0.12);
  color: var(--brand-red) !important;
}

.quick-action-btn:hover i {
  transform: scale(1.15);
}

/* Dashboard Metric Stat Cards */
.stat-card-grid, .kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card, .kpi-card {
  background: #ffffff;
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.stat-card:hover, .kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: #cbd5e1;
}

.stat-icon-box, .kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.stat-card:hover .stat-icon-box,
.kpi-card:hover .kpi-icon {
  transform: scale(1.1);
}

.stat-icon-blue { background: #eff6ff; color: #2563eb; }
.stat-icon-green { background: #ecfdf5; color: #059669; }
.stat-icon-purple { background: #faf5ff; color: #9333ea; }
.stat-icon-amber { background: #fffbeb; color: #d97706; }
.stat-icon-rose { background: #fff1f2; color: #e11d48; }
.stat-icon-cyan { background: #ecfeff; color: #0891b2; }

.stat-content {
  flex: 1;
}

.stat-label, .kpi-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value, .kpi-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--brand-navy);
  line-height: 1.15;
  margin: 4px 0 2px 0;
  font-family: 'JetBrains Mono', monospace;
}

.stat-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.kpi-card:hover .kpi-icon {
  transform: scale(1.1);
}

.icon-red { background: #fef2f2; color: #dc2626; }
.icon-blue { background: #eff6ff; color: #1d4ed8; }
.icon-green { background: #ecfdf5; color: #047857; }
.icon-gold { background: #fffbeb; color: #d97706; }
.icon-navy { background: #f1f5f9; color: #0f172a; }

/* Responsive Media Queries */
@media (max-width: 991px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .modern-page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

@media (max-width: 767px) {
  .modern-header {
    height: auto;
    padding: 12px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .modern-header .user-info-area {
    width: 100%;
    justify-content: space-between;
  }
  .modern-header .brand-title {
    font-size: 16px;
  }
  
  .erp-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .erp-card-header .pull-right {
    width: 100%;
    float: none !important;
  }
  .erp-card-header input[type="text"] {
    width: 100% !important;
  }
  
  .erp-table th, .erp-table td {
    padding: 9px 10px;
    font-size: 12px;
  }
  
  .btn {
    width: 100%;
    margin-bottom: 6px;
  }
}

@media (max-width: 575px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .modern-page-head h1 {
    font-size: 18px;
  }
  .erp-card-body {
    padding: 16px 14px;
  }
}
