﻿/* ========================================================
   Logistics KPI Dashboard Custom Stylesheet (Standalone & Offline Ready)
   ======================================================== */

/* Safety & Global Typography */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Prompt', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #f8fafc;
  color: #1e293b;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* Base Layout & Container */
.max-w-7xl {
  max-width: 80rem;
}
.mx-auto {
  margin-left: auto;
  margin-right: auto;
}
.w-full {
  width: 100%;
}
.w-auto {
  width: auto;
}
.flex-1 {
  flex: 1 1 0%;
}
.flex-shrink-0 {
  flex-shrink: 0;
}
.relative {
  position: relative;
}
.absolute {
  position: absolute;
}
.-bottom-0\.5 { bottom: -0.125rem; }
.-right-0\.5 { right: -0.125rem; }
.bottom-0 { bottom: 0; }
.right-0 { right: 0; }
.top-0 { top: 0; }
.left-0 { left: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-50 { z-index: 50; }

/* Flexbox Utilities */
.flex {
  display: flex;
}
.inline-flex {
  display: inline-flex;
}
.flex-col {
  flex-direction: column;
}
.flex-row {
  flex-direction: row;
}
.flex-wrap {
  flex-wrap: wrap;
}
.items-center {
  align-items: center;
}
.items-start {
  align-items: flex-start;
}
.items-stretch {
  align-items: stretch;
}
.items-baseline {
  align-items: baseline;
}
.justify-between {
  justify-content: space-between;
}
.justify-center {
  justify-content: center;
}
.justify-start {
  justify-content: flex-start;
}
.justify-end {
  justify-content: flex-end;
}

/* Grid Utilities */
.grid {
  display: grid;
}
.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}
.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sm\:flex-row { flex-direction: row; }
  .sm\:inline { display: inline; }
  .sm\:inline-flex { display: inline-flex; }
  .sm\:hidden { display: none; }
}
@media (min-width: 1024px) {
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\:grid-cols-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .lg\:flex-row { flex-direction: row; }
  .lg\:items-center { align-items: center; }
  .lg\:justify-end { justify-content: flex-end; }
  .lg\:w-auto { width: auto; }
}
@media (min-width: 1280px) {
  .xl\:flex-row { flex-direction: row; }
  .xl\:items-center { align-items: center; }
  .xl\:justify-end { justify-content: flex-end; }
  .xl\:w-auto { width: auto; }
  .xl\:self-auto { align-self: auto; }
  .xl\:block { display: block; }
}

/* Gaps & Spacing */
.gap-1 { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-2\.5 { gap: 0.625rem; }
.gap-3 { gap: 0.75rem; }
.gap-3\.5 { gap: 0.875rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.space-y-1 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.25rem; }
.space-y-3\.5 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.875rem; }
.space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: 1rem; }
.space-y-6 > :not([hidden]) ~ :not([hidden]) { margin-top: 1.5rem; }

/* Paddings & Margins */
.p-1 { padding: 0.25rem; }
.p-1\.5 { padding: 0.375rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-2\.5 { padding-left: 0.625rem; padding-right: 0.625rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-3\.5 { padding-left: 0.875rem; padding-right: 0.875rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-3\.5 { padding-top: 0.875rem; padding-bottom: 0.875rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.pt-0\.5 { padding-top: 0.125rem; }
.pt-2 { padding-top: 0.5rem; }
.pb-3\.5 { padding-bottom: 0.875rem; }
.mt-0\.5 { margin-top: 0.125rem; }
.mt-1\.5 { margin-top: 0.375rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mr-1\.5 { margin-right: 0.375rem; }
.ml-1 { margin-left: 0.25rem; }
.ml-0\.5 { margin-left: 0.125rem; }

/* Dimensions */
.w-2 { width: 0.5rem; }
.h-2 { height: 0.5rem; }
.w-3 { width: 0.75rem; }
.h-3 { height: 0.75rem; }
.w-3\.5 { width: 0.875rem; }
.h-3\.5 { height: 0.875rem; }
.w-4 { width: 1rem; }
.h-4 { height: 1rem; }
.w-5 { width: 1.25rem; }
.h-5 { height: 1.25rem; }
.w-6 { width: 1.5rem; }
.h-6 { height: 1.5rem; }
.w-7 { width: 1.75rem; }
.h-7 { height: 1.75rem; }
.w-9 { width: 2.25rem; }
.h-9 { height: 2.25rem; }
.w-10 { width: 2.5rem; }
.h-10 { height: 2.5rem; }
.w-11 { width: 2.75rem; }
.h-11 { height: 2.75rem; }
.w-56 { width: 14rem; }
.h-1 { height: 0.25rem; }
.w-px { width: 1px; }

/* Typography */
.text-\[10px\] { font-size: 10px; }
.text-\[11px\] { font-size: 11px; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.uppercase { text-transform: uppercase; }
.leading-tight { line-height: 1.25; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Colors: Text */
.text-white { color: #ffffff; }
.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: #64748b; }
.text-slate-600 { color: #475569; }
.text-slate-700 { color: #334155; }
.text-slate-800 { color: #1e293b; }
.text-slate-900 { color: #0f172a; }
.text-blue-500 { color: #3b82f6; }
.text-blue-600 { color: #2563eb; }
.text-blue-700 { color: #1d4ed8; }
.text-blue-800 { color: #1e40af; }
.text-blue-900 { color: #1e3a8a; }
.text-emerald-500 { color: #10b981; }
.text-emerald-600 { color: #059669; }
.text-emerald-700 { color: #047857; }
.text-emerald-800 { color: #065f46; }
.text-indigo-500 { color: #6366f1; }
.text-indigo-600 { color: #4f46e5; }
.text-indigo-700 { color: #4338ca; }
.text-indigo-800 { color: #3730a3; }
.text-indigo-900 { color: #312e81; }
.text-rose-500 { color: #f43f5e; }
.text-rose-600 { color: #e11d48; }
.text-rose-700 { color: #be123c; }
.text-amber-500 { color: #f59e0b; }
.text-amber-600 { color: #d97706; }
.text-amber-700 { color: #b45309; }
.text-amber-800 { color: #92400e; }
.text-amber-900 { color: #78350f; }
.text-teal-600 { color: #0d9488; }
.text-teal-700 { color: #0f766e; }
.text-teal-900 { color: #134e4a; }
.text-purple-600 { color: #9333ea; }

/* Colors: Background */
.bg-white { background-color: #ffffff; }
.bg-slate-50 { background-color: #f8fafc; }
.bg-slate-100 { background-color: #f1f5f9; }
.bg-slate-200 { background-color: #e2e8f0; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-blue-600 { background-color: #2563eb; }
.bg-emerald-50 { background-color: #ecfdf5; }
.bg-emerald-100 { background-color: #d1fae5; }
.bg-emerald-500 { background-color: #10b981; }
.bg-indigo-50 { background-color: #eef2ff; }
.bg-indigo-600 { background-color: #4f46e5; }
.bg-rose-50 { background-color: #fff1f2; }
.bg-rose-100 { background-color: #ffe4e6; }
.bg-rose-600 { background-color: #e11d48; }
.bg-amber-50 { background-color: #fffbeb; }
.bg-amber-500 { background-color: #f59e0b; }
.bg-teal-50 { background-color: #f0fdfa; }

/* Gradients */
.bg-gradient-to-r {
  background-image: linear-gradient(to right, var(--tw-gradient-stops, #2563eb, #4f46e5));
}
.bg-gradient-to-tr {
  background-image: linear-gradient(to top right, var(--tw-gradient-stops, #2563eb, #6366f1));
}
.from-blue-600 { --tw-gradient-from: #2563eb; --tw-gradient-stops: var(--tw-gradient-from), #4f46e5; }
.via-indigo-600 { --tw-gradient-stops: #2563eb, #4f46e5, #38bdf8; }
.to-sky-400 { --tw-gradient-to: #38bdf8; }
.to-sky-500 { --tw-gradient-to: #0ea5e9; }
.to-indigo-600 { --tw-gradient-to: #4f46e5; }

/* Borders & Rounded */
.border { border-width: 1px; border-style: solid; }
.border-2 { border-width: 2px; border-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-white { border-color: #ffffff; }
.border-slate-100 { border-color: #f1f5f9; }
.border-slate-200 { border-color: #e2e8f0; }
.border-slate-300 { border-color: #cbd5e1; }
.border-blue-200 { border-color: #bfdbfe; }
.border-blue-300 { border-color: #93c5fd; }
.border-emerald-200 { border-color: #a7f3d0; }
.border-indigo-200 { border-color: #c7d2fe; }
.border-indigo-300 { border-color: #a5b4fc; }
.border-rose-200 { border-color: #fecdd3; }
.border-rose-300 { border-color: #fda4af; }
.border-amber-200 { border-color: #fde68a; }
.border-amber-300 { border-color: #fcd34d; }
.border-transparent { border-color: transparent; }

.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

/* Shadows */
.shadow-2xs { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); }
.shadow-xs { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow-sm { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); }
.shadow-blue-500\/25 { box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.25); }
.shadow-blue-600\/25 { box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.25); }
.shadow-inner { box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05); }

/* Rings */
.ring-1 { box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.2); }
.ring-4 { box-shadow: 0 0 0 4px #eff6ff; }

/* Buttons & Inputs */
button {
  font-family: inherit;
  border: none;
  cursor: pointer;
  background: none;
}
button:active {
  transform: scale(0.98);
}
select, input {
  font-family: inherit;
}

/* Custom Styled Header */
header {
  background-color: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}

/* Date filter active buttons */
.filter-date-btn {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #64748b;
  border-radius: 0.5rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.filter-date-btn:hover {
  background-color: #f1f5f9;
  color: #334155;
}
.filter-date-btn.active {
  background-color: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 1px 2px 0 rgba(37, 99, 235, 0.2);
}

/* Date mode tabs (All, Daily, Monthly, Yearly, Custom) - Modern Segmented Control */
.date-mode-btn {
  color: #64748b;
  background-color: transparent;
  border: none;
  cursor: pointer;
  border-radius: 0.625rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: -0.01em;
}
.date-mode-btn:hover {
  color: #0f172a;
  background-color: rgba(255, 255, 255, 0.7);
  transform: translateY(-0.5px);
}
.date-mode-btn.active {
  color: #2563eb !important;
  background-color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04) !important;
  transform: translateY(0);
}

/* Animations */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Transitions */
.transition-all {
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.transition-transform {
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.hover\:scale-105:hover {
  transform: scale(1.05);
}

/* Status Badges */
.badge-ontime {
  background-color: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.badge-delay {
  background-color: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
}
.badge-success {
  background-color: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}
.badge-unsuccess {
  background-color: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.badge-call-ok {
  background-color: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.badge-call-warn {
  background-color: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}
.badge-call-danger {
  background-color: #fff1f2;
  color: #e11d48;
  border: 1px solid #fecdd3;
}

/* Modal animation */
#modalImport:not(.hidden),
#modalEditJob:not(.hidden),
#modalCloudSettings:not(.hidden),
#modalExport:not(.hidden),
#modalDriverMaster:not(.hidden),
#modalDeleteByDate:not(.hidden) {
  animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* Print Optimization for Reports */
@media print {
  body {
    background-color: #ffffff !important;
    font-size: 11pt;
  }
  header, footer, nav, button, .print\:hidden, #syncBadge, .border-b, .filter-bar {
    display: none !important;
  }
}
