/* ============================================================
   LogiXpress Global Design System
   Brand: #1A3D6B (navy), #E8A020 (amber), #F5F7FA (bg)
   ============================================================ */

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

:root {
  --navy: #1A3D6B;
  --navy-dark: #122c50;
  --navy-light: #235191;
  --amber: #E8A020;
  --amber-dark: #c4861a;
  --amber-light: #f5c050;
  --white: #ffffff;
  --bg: #F5F7FA;
  --bg2: #EEF2F7;
  --text: #1A202C;
  --text2: #4A5568;
  --text3: #A0AEC0;
  --border: #E2E8F0;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(26,61,107,0.10);
  --shadow-lg: 0 12px 48px rgba(26,61,107,0.18);
  --shadow-sm: 0 2px 8px rgba(26,61,107,0.07);
  --transition: all 0.25s cubic-bezier(.4,0,.2,1);
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── Typography ─────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.25; color: var(--text); }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.75rem); }
p  { color: var(--text2); line-height: 1.7; }
a  { text-decoration: none; color: inherit; }

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: var(--radius);
  font-family: 'Inter', sans-serif; font-weight: 600; font-size: 0.95rem;
  cursor: pointer; border: none; transition: var(--transition);
  white-space: nowrap; letter-spacing: 0.01em;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--amber); color: var(--navy-dark);
  box-shadow: 0 4px 16px rgba(232,160,32,0.4);
}
.btn-primary:hover { background: var(--amber-dark); box-shadow: 0 6px 24px rgba(232,160,32,0.5); transform: translateY(-1px); }
.btn-navy {
  background: var(--navy); color: white;
  box-shadow: 0 4px 16px rgba(26,61,107,0.3);
}
.btn-navy:hover { background: var(--navy-dark); transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: var(--navy);
  border: 2px solid var(--navy);
}
.btn-outline:hover { background: var(--navy); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }
.btn-sm { padding: 8px 18px; font-size: 0.85rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 16px 40px; font-size: 1.05rem; border-radius: var(--radius); }
.btn-icon { padding: 10px; border-radius: var(--radius-sm); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }

/* ─── Cards ──────────────────────────────────────────────── */
.card {
  background: white; border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 32px; border: 1px solid var(--border);
}
.card-sm { padding: 20px; border-radius: var(--radius); }

/* ─── Inputs ─────────────────────────────────────────────── */
.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-group label { font-weight: 600; font-size: 0.875rem; color: var(--text); }
.input-group label span { color: var(--danger); margin-left: 2px; }

input, select, textarea {
  font-family: 'Inter', sans-serif; font-size: 0.95rem;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 16px;
  color: var(--text); transition: var(--transition); width: 100%;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--navy); box-shadow: 0 0 0 3px rgba(26,61,107,0.12);
  background: white;
}
input::placeholder, textarea::placeholder { color: var(--text3); }
textarea { resize: vertical; min-height: 100px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234A5568' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px; }

/* ─── Badge ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 20px;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em;
}
.badge-pending    { background: #FEF3C7; color: #92400E; }
.badge-in_transit { background: #DBEAFE; color: #1E40AF; }
.badge-delivered  { background: #D1FAE5; color: #065F46; }
.badge-returned   { background: #FEE2E2; color: #991B1B; }
.badge-cancelled  { background: #F3F4F6; color: #374151; }

/* ─── Toast ──────────────────────────────────────────────── */
#toast-container {
  position: fixed; top: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  background: white; border-radius: var(--radius);
  padding: 16px 20px; box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--success);
  min-width: 280px; max-width: 380px;
  animation: slideIn 0.3s ease;
}
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.info { border-left-color: var(--info); }
.toast-icon { font-size: 1.3rem; }
.toast-text { flex: 1; font-size: 0.9rem; font-weight: 500; color: var(--text); }
.toast-close { cursor: pointer; color: var(--text3); font-size: 1.1rem; line-height: 1; }
.toast-close:hover { color: var(--text); }

/* ─── Modal ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px; backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}
.modal {
  background: white; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 640px;
  max-height: 90vh; overflow-y: auto;
  animation: scaleIn 0.25s ease;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 32px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: white; z-index: 1;
}
.modal-header h3 { font-size: 1.2rem; }
.modal-close {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; background: var(--bg); border: none;
  font-size: 1.2rem; color: var(--text2); transition: var(--transition);
}
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-body { padding: 32px; }
.modal-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 20px 32px; border-top: 1px solid var(--border);
}

/* ─── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ─── Animations ─────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes scaleIn { from { transform: scale(0.95); opacity: 0 } to { transform: scale(1); opacity: 1 } }
@keyframes slideIn { from { transform: translateX(100px); opacity: 0 } to { transform: translateX(0); opacity: 1 } }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }
@keyframes spin { to { transform: rotate(360deg) } }
@keyframes pulse { 0%,100% { opacity:1 } 50% { opacity:.5 } }
@keyframes shimmer { 0% { background-position: -200% 0 } 100% { background-position: 200% 0 } }
@keyframes float { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-12px) } }
@keyframes truckMove { 0% { transform: translateX(-60px) } 100% { transform: translateX(60px) } }

.animate-fadeIn { animation: fadeIn 0.4s ease forwards; }
.animate-slideUp { animation: slideUp 0.5s ease forwards; }

/* ─── Loading Skeleton ───────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ─── Grid utilities ─────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ─── Divider ─────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 24px 0; }

/* ─── Status Timeline Shared ─────────────────────────────── */
.timeline { position: relative; padding: 0; list-style: none; }
.timeline::before {
  content: ''; position: absolute; left: 20px; top: 12px; bottom: 12px;
  width: 2px; background: var(--border);
}
.timeline-item {
  display: flex; gap: 20px; padding: 0 0 28px;
  position: relative; animation: slideUp 0.4s ease both;
}
.timeline-dot {
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0; position: relative; z-index: 1;
  box-shadow: var(--shadow-sm); border: 3px solid white;
}
.timeline-content { flex: 1; padding-top: 8px; }
.timeline-content strong { display: block; font-size: 0.95rem; color: var(--text); margin-bottom: 4px; }
.timeline-content span { font-size: 0.83rem; color: var(--text3); }
.timeline-content p { font-size: 0.88rem; color: var(--text2); margin-top: 6px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item.active .timeline-dot { box-shadow: 0 0 0 6px rgba(26,61,107,0.1); }
