/* Safana Cargo — shared design tokens for the PHP-native public site and
   admin dashboard. One file, used by both, so they never visually drift
   apart the way two separate stylesheets would over time. */

:root {
  --color-navy: #023d5b;
  --color-navy-dark: #012536;
  --color-orange: #e44122;
  --color-orange-dark: #c23015;
  --color-bg: #f6f8fa;
  --color-surface: #ffffff;
  --color-border: #e2e8ef;
  --color-heading: #0f2a3a;
  --color-text: #33454f;
  --color-muted: #6b7c86;
  --color-success: #1a9c5c;
  --color-warning: #c98a12;
  --color-danger: #d33636;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 3px rgba(2, 30, 46, 0.08);
  --shadow-md: 0 8px 24px rgba(2, 30, 46, 0.10);
  --shadow-lg: 0 16px 40px rgba(2, 30, 46, 0.14);
  --font-sans: "DM Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --sidebar-w: 264px;
  --sidebar-w-collapsed: 78px;
  --topbar-h: 68px;
  --ease: cubic-bezier(.4, 0, .2, 1);
  --dur-fast: .15s;
  --dur-base: .25s;
  /* Chart palette — used by inline SVG charts (dashboard trend/status). */
  --chart-1: var(--color-orange);
  --chart-2: var(--color-navy);
  --chart-3: #1a9c5c;
  --chart-4: #c98a12;
  --chart-5: #6b7c86;
}

[data-theme="dark"] {
  --color-bg: #0b1c27;
  --color-surface: #102a38;
  --color-border: #1c3a49;
  --color-heading: #f1f7fa;
  --color-text: #c3d3da;
  --color-muted: #8ba2ac;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 44px rgba(0, 0, 0, 0.55);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}
h1, h2, h3, h4, h5 { color: var(--color-heading); margin: 0 0 .5em; font-weight: 800; letter-spacing: -0.01em; }
p { line-height: 1.65; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 999px; border: none; font-weight: 700;
  font-size: 14px; transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--color-orange); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--color-orange-dark); }
.btn-secondary { background: var(--color-navy); color: #fff; }
.btn-secondary:hover { background: var(--color-navy-dark); }
.btn-outline { background: transparent; color: var(--color-navy); border: 1.5px solid var(--color-border); }
[data-theme="dark"] .btn-outline { color: var(--color-heading); }
.btn-outline:hover { border-color: var(--color-orange); color: var(--color-orange); }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* Cards */
.card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 24px;
}
.card-hover { transition: box-shadow .25s ease, transform .25s ease; }
.card-hover:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

/* Forms */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--color-heading); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--color-border);
  background: var(--color-surface); color: var(--color-text); font-family: inherit; font-size: 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--color-orange); box-shadow: 0 0 0 3px rgba(228, 65, 34, .15);
}
.field-error { color: var(--color-danger); font-size: 12.5px; margin-top: 5px; }
.field-hint { color: var(--color-muted); font-size: 12.5px; margin-top: 5px; }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--color-border); background: var(--color-surface); }
table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
table.data-table th {
  text-align: left; padding: 13px 16px; background: var(--color-bg); color: var(--color-muted);
  font-size: 12px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700;
  border-bottom: 1px solid var(--color-border); white-space: nowrap;
}
table.data-table td { padding: 13px 16px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
table.data-table tbody tr:hover { background: var(--color-bg); }
table.data-table tbody tr:last-child td { border-bottom: none; }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-success { background: rgba(26,156,92,.14); color: var(--color-success); }
.badge-warning { background: rgba(201,138,18,.14); color: var(--color-warning); }
.badge-danger { background: rgba(211,54,54,.14); color: var(--color-danger); }
.badge-muted { background: var(--color-bg); color: var(--color-muted); border: 1px solid var(--color-border); }
.badge-navy { background: rgba(2,61,91,.12); color: var(--color-navy); }
[data-theme="dark"] .badge-navy { background: rgba(255,255,255,.1); color: var(--color-heading); }
.badge-info { background: rgba(47,124,184,.14); color: #2f7cb8; }
[data-theme="dark"] .badge-info { background: rgba(96,178,230,.16); color: #7fc2ec; }

/* Toasts */
#toast-stack { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--color-surface); border: 1px solid var(--color-border); border-left: 4px solid var(--color-navy);
  border-radius: var(--radius-sm); padding: 13px 18px; box-shadow: var(--shadow-md); min-width: 260px;
  font-size: 14px; animation: toast-in .2s ease;
}
.toast.success { border-left-color: var(--color-success); }
.toast.error { border-left-color: var(--color-danger); }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(2,20,30,.55); display: none; align-items: center; justify-content: center; z-index: 9000; padding: 20px; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--color-surface); border-radius: var(--radius-md); box-shadow: var(--shadow-md); max-width: 460px; width: 100%; padding: 26px; }
.modal h3 { margin-bottom: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* Utility */
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mb-18 { margin-bottom: 18px; }
.muted { color: var(--color-muted); }
.text-right { text-align: right; }
.hidden { display: none !important; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
