/* @import must be first (before any rules) or parsers break on semicolons in the font URL */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* ============================================
   EMARIS FREIGHT TRACKER — 2026 DESIGN SYSTEM
   ============================================ */

/* Read-only / locked fields (dark UI — matches modals & dashboard) */
.field-invoice-locked,
select.field-invoice-locked {
  pointer-events: none;
  background: rgba(30, 41, 59, .88) !important;
  color: var(--clr-text-muted) !important;
  border-color: rgba(255, 255, 255, .08) !important;
  cursor: not-allowed;
  opacity: 1;
}

/* ── CSS Variables ── */
:root {
  /* Primary Palette */
  --clr-bg: #0a0e1a;
  --clr-bg-secondary: #111827;
  --clr-surface: rgba(17, 24, 39, .72);
  --clr-surface-light: rgba(30, 41, 59, .55);

  /* Accent */
  --clr-accent: #ff8c00;
  --clr-accent-glow: rgba(255, 140, 0, .35);
  --clr-accent2: #a855f7;
  --clr-accent2-glow: rgba(168, 85, 247, .30);
  --clr-accent3: #ff6b35;
  --clr-success: #34d399;
  --clr-warning: #fbbf24;
  --clr-danger: #f87171;
  --clr-info: #60a5fa;

  /* Text */
  --clr-text: #e2e8f0;
  --clr-text-muted: #94a3b8;
  --clr-text-heading: #f8fafc;

  /* Borders */
  --border-glass: 1px solid rgba(255, 255, 255, .08);
  --border-radius: 14px;
  --border-radius-sm: 8px;
  --border-radius-lg: 20px;
  --border-radius-xl: 28px;
  --border-radius-pill: 9999px;

  /* Shadows / Glow */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .25);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, .35);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, .45);
  --shadow-glow: 0 0 20px var(--clr-accent-glow);

  /* Transitions */
  --ease-smooth: cubic-bezier(.4, 0, .2, 1);
  --transition: .3s var(--ease-smooth);

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  /* Sidebar */
  --sidebar-w: 270px;
  --sidebar-collapsed: 72px;
  --topbar-h: 64px;
}

/* ── Reset ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Outfit', sans-serif;
  background: var(--clr-bg);
  color: var(--clr-text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--clr-accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--clr-accent2);
}

img {
  max-width: 100%;
  display: block;
}

ul {
  list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--clr-text-heading);
  font-weight: 600;
  line-height: 1.25;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.25rem;
}

h4 {
  font-size: 1.1rem;
}

/* ── Utility Classes ── */
.text-accent {
  color: var(--clr-accent);
}

.text-accent2 {
  color: var(--clr-accent2);
}

.text-muted {
  color: var(--clr-text-muted);
}

.text-success {
  color: var(--clr-success);
}

.text-warning {
  color: var(--clr-warning);
}

.text-danger {
  color: var(--clr-danger);
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-sm {
  font-size: .85rem;
}

.text-xs {
  font-size: .75rem;
}

.text-lg {
  font-size: 1.15rem;
}

.fw-300 {
  font-weight: 300;
}

.fw-400 {
  font-weight: 400;
}

.fw-500 {
  font-weight: 500;
}

.fw-600 {
  font-weight: 600;
}

.fw-700 {
  font-weight: 700;
}

.fw-800 {
  font-weight: 800;
}

.d-flex {
  display: flex;
}

.d-grid {
  display: grid;
}

.align-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.flex-wrap {
  flex-wrap: wrap;
}

.gap-1 {
  gap: var(--sp-1);
}

.gap-2 {
  gap: var(--sp-2);
}

.gap-3 {
  gap: var(--sp-3);
}

.gap-4 {
  gap: var(--sp-4);
}

.gap-5 {
  gap: var(--sp-5);
}

.gap-6 {
  gap: var(--sp-6);
}

.mt-1 {
  margin-top: var(--sp-1);
}

.mt-2 {
  margin-top: var(--sp-2);
}

.mt-3 {
  margin-top: var(--sp-3);
}

.mt-4 {
  margin-top: var(--sp-4);
}

.mt-5 {
  margin-top: var(--sp-5);
}

.mt-6 {
  margin-top: var(--sp-6);
}

.mb-3 {
  margin-bottom: var(--sp-3);
}

.mb-4 {
  margin-bottom: var(--sp-4);
}

.mb-5 {
  margin-bottom: var(--sp-5);
}

.mb-6 {
  margin-bottom: var(--sp-6);
}

.p-3 {
  padding: var(--sp-3);
}

.p-4 {
  padding: var(--sp-4);
}

.p-5 {
  padding: var(--sp-5);
}

.p-6 {
  padding: var(--sp-6);
}

.w-100 {
  width: 100%;
}

.hidden {
  display: none !important;
}

/* ── Scrollbar (standard properties; avoids invalid ::-webkit-* rulesets in Firefox) ── */
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .12) transparent;
}

/* ── Animated Background (Login) ── */
.animated-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #0a0e1a 0%, #1a0e00 40%, #0f172a 100%);
}

.animated-bg .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: .45;
  animation: orbFloat 12s ease-in-out infinite alternate;
}

.animated-bg .orb:nth-child(1) {
  width: 450px;
  height: 450px;
  background: var(--clr-accent);
  top: -10%;
  left: -5%;
}

.animated-bg .orb:nth-child(2) {
  width: 550px;
  height: 550px;
  background: var(--clr-accent2);
  bottom: -15%;
  right: -10%;
  animation-delay: -4s;
  animation-duration: 16s;
}

.animated-bg .orb:nth-child(3) {
  width: 350px;
  height: 350px;
  background: var(--clr-accent3);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -8s;
  animation-duration: 20s;
}

@keyframes orbFloat {
  0% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(40px, -30px) scale(1.15);
  }

  100% {
    transform: translate(-20px, 20px) scale(.95);
  }
}

/* ── Noise overlay ── */
.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .035;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 10px 22px;
  border: none;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-size: .9rem;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, .12) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition);
}

.btn:hover::after {
  opacity: 1;
}

.btn-primary {
  background: linear-gradient(135deg, var(--clr-accent), #cc6a00);
  color: #000;
  font-weight: 600;
  box-shadow: 0 0 18px var(--clr-accent-glow);
}

.btn-primary:hover {
  box-shadow: 0 0 30px var(--clr-accent-glow);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--clr-surface-light);
  color: var(--clr-text);
  border: var(--border-glass);
}

.btn-secondary:hover {
  background: rgba(30, 41, 59, .75);
  transform: translateY(-2px);
}

.btn-danger {
  background: linear-gradient(135deg, var(--clr-danger), #c0392b);
  color: #fff;
  font-weight: 600;
}

.btn-danger:hover {
  box-shadow: 0 0 20px rgba(248, 113, 113, .35);
  transform: translateY(-2px);
}

.btn-success {
  background: linear-gradient(135deg, var(--clr-success), #059669);
  color: #000;
  font-weight: 600;
}

.btn-success:hover {
  box-shadow: 0 0 20px rgba(52, 211, 153, .35);
  transform: translateY(-2px);
}

.btn-accent2 {
  background: linear-gradient(135deg, var(--clr-accent2), #7c3aed);
  color: #fff;
  font-weight: 600;
}

.btn-accent2:hover {
  box-shadow: 0 0 20px var(--clr-accent2-glow);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 6px 14px;
  font-size: .8rem;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1rem;
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--border-radius-sm);
}

/* ── Form Elements ── */
.form-group {
  margin-bottom: var(--sp-5);
  position: relative;
}

.form-group label {
  display: block;
  margin-bottom: var(--sp-2);
  font-size: .85rem;
  font-weight: 500;
  color: var(--clr-text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--border-radius-sm);
  background: rgba(15, 23, 42, .6);
  border: 1px solid rgba(255, 255, 255, .08);
  color: var(--clr-text);
  font-family: 'Outfit', sans-serif;
  font-size: .95rem;
  transition: all var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--clr-accent);
  box-shadow: 0 0 0 3px var(--clr-accent-glow);
  background: rgba(15, 23, 42, .85);
}

.form-control::placeholder {
  color: rgba(148, 163, 184, .5);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--sp-4);
}

@media (max-width: 768px) {

  .form-row,
  .form-row-3 {
    grid-template-columns: 1fr;
  }
}

/* ── Checkbox / Toggle ── */
.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  display: inline-block;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch .slider {
  position: absolute;
  inset: 0;
  border-radius: 26px;
  cursor: pointer;
  background: rgba(255, 255, 255, .1);
  transition: var(--transition);
}

.toggle-switch .slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: var(--transition);
}

.toggle-switch input:checked+.slider {
  background: var(--clr-accent);
}

.toggle-switch input:checked+.slider::before {
  transform: translateX(22px);
}

/* ── Tables ── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--border-radius);
  border: var(--border-glass);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

.data-table thead {
  background: rgba(15, 23, 42, .8);
}

.data-table thead th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--clr-text-muted);
  text-transform: uppercase;
  font-size: .75rem;
  letter-spacing: .8px;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.data-table tbody tr {
  transition: background var(--transition);
  border-bottom: 1px solid rgba(255, 255, 255, .04);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, .04);
}

.data-table tbody td {
  padding: 12px 16px;
  white-space: nowrap;
}

/* ── Badges / Tags ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--border-radius-pill);
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.badge-success {
  background: rgba(52, 211, 153, .15);
  color: var(--clr-success);
}

.badge-warning {
  background: rgba(251, 191, 36, .15);
  color: var(--clr-warning);
}

.badge-danger {
  background: rgba(248, 113, 113, .15);
  color: var(--clr-danger);
}

.badge-info {
  background: rgba(96, 165, 250, .15);
  color: var(--clr-info);
}

.badge-accent {
  background: rgba(255, 140, 0, .12);
  color: var(--clr-accent);
}

.badge-accent2 {
  background: rgba(168, 85, 247, .15);
  color: var(--clr-accent2);
}

.badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

/* ── Cards ── */
.card {
  background: var(--clr-surface);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: var(--border-glass);
  border-radius: var(--border-radius);
  padding: var(--sp-6);
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.card:hover {
  border-color: rgba(255, 255, 255, .12);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

/* ── Stat Cards ── */
.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: var(--sp-4);
}

.stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--clr-text-heading);
  line-height: 1.1;
  margin-bottom: var(--sp-1);
}

.stat-card .stat-label {
  font-size: .82rem;
  color: var(--clr-text-muted);
  font-weight: 400;
}

.stat-card .stat-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .78rem;
  font-weight: 600;
  margin-top: var(--sp-2);
}

.stat-card .stat-change.up {
  color: var(--clr-success);
}

.stat-card .stat-change.down {
  color: var(--clr-danger);
}

.stat-card .stat-bg-icon {
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 5rem;
  opacity: .04;
  pointer-events: none;
}

/* ── Toast / Notifications ── */
.toast-container {
  position: fixed;
  top: var(--sp-6);
  right: var(--sp-6);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.toast {
  min-width: 320px;
  padding: 14px 20px;
  border-radius: var(--border-radius);
  background: var(--clr-surface);
  backdrop-filter: blur(20px);
  border: var(--border-glass);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  animation: toastIn .4s var(--ease-smooth);
  transform-origin: right center;
}

.toast.leaving {
  animation: toastOut .35s var(--ease-smooth) forwards;
}

.toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.toast-success .toast-icon {
  background: rgba(52, 211, 153, .15);
  color: var(--clr-success);
}

.toast-danger .toast-icon {
  background: rgba(248, 113, 113, .15);
  color: var(--clr-danger);
}

.toast-info .toast-icon {
  background: rgba(96, 165, 250, .15);
  color: var(--clr-info);
}

.toast-warning .toast-icon {
  background: rgba(251, 191, 36, .15);
  color: var(--clr-warning);
}

.toast-body {
  flex: 1;
}

.toast-title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--clr-text-heading);
}

.toast-message {
  font-size: .82rem;
  color: var(--clr-text-muted);
  margin-top: 2px;
}

.toast-close {
  background: none;
  border: none;
  color: var(--clr-text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 2px;
  line-height: 1;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(60px) scale(.9);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateX(60px) scale(.85);
  }
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .65);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: all .3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  width: 98%;
  max-width: 800px;
  max-height: 95vh;
  overflow-y: auto;
  background: var(--clr-bg-secondary);
  border: var(--border-glass);
  border-radius: var(--border-radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  transform: translateY(30px) scale(.95);
  transition: all .35s var(--ease-smooth);
}

.modal.modal-lg {
  max-width: 1200px;
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-6);
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: var(--border-glass);
  background: transparent;
  color: var(--clr-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all var(--transition);
}

.modal-close:hover {
  background: rgba(255, 255, 255, .06);
  color: var(--clr-text);
}

/* Shipment modal — line items & weight summary (readable on dark background) */
.shipment-items-section .shipment-items-panel {
  background: rgba(15, 23, 42, .55);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--border-radius-sm);
  overflow-x: auto;
}

.shipment-items-table {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.shipment-items-table thead th {
  padding: 12px 10px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--clr-text-muted);
  text-align: center;
  vertical-align: bottom;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  background: rgba(15, 23, 42, .75);
}

.shipment-items-table tbody td {
  padding: 12px 10px;
  vertical-align: middle;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.shipment-items-table tbody tr:last-child td {
  border-bottom: none;
}

.shipment-items-table .form-control {
  padding: 10px 8px;
  font-size: .9rem;
  text-align: center;
  min-height: 42px;
}

/* Computed volumetric column — same family as other cells, slightly emphasized */
.shipment-items-table .shipment-item-vol.form-control {
  background: rgba(51, 65, 85, .65) !important;
  border-color: rgba(168, 85, 247, .25) !important;
  color: var(--clr-accent2) !important;
  font-weight: 600;
}

.shipment-items-table .shipment-item-vol.field-invoice-locked {
  background: rgba(51, 65, 85, .72) !important;
  border-color: rgba(168, 85, 247, .3) !important;
  color: var(--clr-accent2) !important;
  opacity: 1;
}

.shipment-modal-totals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
  padding: var(--sp-5);
  margin-bottom: var(--sp-5);
  background: rgba(15, 23, 42, .72);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--border-radius-sm);
}

.shipment-modal-totals .form-group {
  margin-bottom: 0;
}

.shipment-modal-totals .form-control,
.shipment-modal-totals .form-control[readonly] {
  background: rgba(30, 41, 59, .92) !important;
  border: 1px solid rgba(255, 255, 255, .12) !important;
  color: var(--clr-text) !important;
  font-weight: 600;
}

.shipment-modal-totals .shipment-chargeable-highlight .form-control {
  border-color: rgba(255, 140, 0, .5) !important;
  box-shadow: 0 0 0 1px rgba(255, 140, 0, .12);
  color: var(--clr-accent) !important;
}

.shipment-modal-totals .shipment-chargeable-highlight label {
  color: var(--clr-accent);
}

@media (max-width: 640px) {
  .shipment-modal-totals {
    grid-template-columns: 1fr;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: var(--sp-1);
  background: rgba(15, 23, 42, .5);
  border-radius: var(--border-radius-sm);
  padding: 4px;
  border: var(--border-glass);
  width: fit-content;
}

.tab-btn {
  padding: 8px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-size: .85rem;
  font-weight: 500;
  background: transparent;
  color: var(--clr-text-muted);
  transition: all var(--transition);
}

.tab-btn:hover {
  color: var(--clr-text);
}

.tab-btn.active {
  background: var(--clr-accent);
  color: #000;
  font-weight: 600;
  box-shadow: 0 0 12px var(--clr-accent-glow);
}

/* ── Search Bar ── */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box .search-icon {
  position: absolute;
  left: 14px;
  color: var(--clr-text-muted);
  font-size: .9rem;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  background: rgba(15, 23, 42, .5);
  border: var(--border-glass);
  border-radius: var(--border-radius-pill);
  color: var(--clr-text);
  font-family: 'Outfit', sans-serif;
  font-size: .88rem;
  transition: all var(--transition);
  outline: none;
}

.search-box input:focus {
  border-color: var(--clr-accent);
  box-shadow: 0 0 0 3px var(--clr-accent-glow);
}

/* ── Progress Bar ── */
.progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  overflow: hidden;
}

.progress-bar .fill {
  height: 100%;
  border-radius: 8px;
  transition: width .6s var(--ease-smooth);
}

.progress-accent .fill {
  background: linear-gradient(90deg, var(--clr-accent), #cc6a00);
}

.progress-success .fill {
  background: linear-gradient(90deg, var(--clr-success), #059669);
}

.progress-warning .fill {
  background: linear-gradient(90deg, var(--clr-warning), #d97706);
}

.progress-danger .fill {
  background: linear-gradient(90deg, var(--clr-danger), #c0392b);
}

/* ── Avatar ── */
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-weight: 600;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--clr-accent), var(--clr-accent2));
  color: #000;
}

.avatar-lg {
  width: 56px;
  height: 56px;
  font-size: 1.2rem;
}

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-5);
  justify-content: flex-end;
}

.pagination button {
  width: 34px;
  height: 34px;
  border-radius: var(--border-radius-sm);
  border: var(--border-glass);
  background: transparent;
  color: var(--clr-text-muted);
  cursor: pointer;
  font-family: 'Outfit';
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.pagination button:hover {
  background: rgba(255, 255, 255, .06);
  color: var(--clr-text);
}

.pagination button.active {
  background: var(--clr-accent);
  color: #000;
  border-color: var(--clr-accent);
  font-weight: 600;
}

/* ── Spinner ── */
.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255, 255, 255, .15);
  border-top-color: var(--clr-accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: var(--sp-12) var(--sp-6);
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: var(--sp-4);
  opacity: .3;
}

.empty-state h3 {
  font-size: 1.15rem;
  margin-bottom: var(--sp-2);
}

.empty-state p {
  color: var(--clr-text-muted);
  font-size: .9rem;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: rgba(10, 14, 26, .92);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, .06);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width .35s var(--ease-smooth);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  padding: var(--sp-6);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  min-height: var(--topbar-h);
}

.sidebar-brand .brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  color: #000;
  flex-shrink: 0;
}

.sidebar-brand .brand-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--clr-text-heading);
  white-space: nowrap;
}

.sidebar-brand .brand-sub {
  font-size: .68rem;
  color: var(--clr-text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-top: -2px;
}

.sidebar-nav {
  flex: 1;
  padding: var(--sp-4) var(--sp-3);
}

.nav-section {
  margin-bottom: var(--sp-5);
}

.nav-section-title {
  font-size: .68rem;
  font-weight: 600;
  color: var(--clr-text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 0 var(--sp-3);
  margin-bottom: var(--sp-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px var(--sp-3);
  border-radius: var(--border-radius-sm);
  color: var(--clr-text-muted);
  font-size: .9rem;
  font-weight: 400;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  white-space: nowrap;
}

.nav-item:hover {
  color: var(--clr-text);
  background: rgba(255, 255, 255, .04);
}

.nav-item.active {
  color: var(--clr-accent);
  background: rgba(255, 140, 0, .08);
  font-weight: 500;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 3px;
  background: var(--clr-accent);
}

.nav-item .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--clr-accent);
  color: #000;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--border-radius-pill);
}

.sidebar-footer {
  padding: var(--sp-4) var(--sp-3);
  border-top: 1px solid rgba(255, 255, 255, .06);
}

/* ── Top Bar ── */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  z-index: 90;
  background: rgba(10, 14, 26, .8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-6);
  transition: left .35s var(--ease-smooth);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.topbar-title {
  font-size: 1.15rem;
  font-weight: 600;
}

.topbar-breadcrumb {
  font-size: .8rem;
  color: var(--clr-text-muted);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--border-radius-sm);
  border: var(--border-glass);
  background: transparent;
  color: var(--clr-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition);
  position: relative;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, .06);
  color: var(--clr-text);
}

.icon-btn .notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--clr-danger);
  border: 2px solid var(--clr-bg);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 6px 12px 6px 6px;
  border-radius: var(--border-radius-pill);
  background: rgba(255, 255, 255, .04);
  border: var(--border-glass);
  cursor: pointer;
  transition: all var(--transition);
}

.user-profile:hover {
  background: rgba(255, 255, 255, .08);
}

.user-profile .user-info {
  line-height: 1.2;
}

.user-profile .user-name {
  font-size: .85rem;
  font-weight: 600;
}

.user-profile .user-role {
  font-size: .7rem;
  color: var(--clr-text-muted);
}

/* ── Main Content Area ── */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: var(--sp-6);
  min-height: calc(100vh - var(--topbar-h));
  transition: margin-left .35s var(--ease-smooth);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .topbar {
    left: 0;
  }

  .main-content {
    margin-left: 0;
  }
}

/* ── Animations ── */
.fade-in {
  animation: fadeIn .5s var(--ease-smooth);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-up {
  animation: slideUp .5s var(--ease-smooth);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* stagger children animations */
.stagger>* {
  opacity: 0;
  animation: fadeIn .5s var(--ease-smooth) forwards;
}

.stagger>*:nth-child(1) {
  animation-delay: .05s;
}

.stagger>*:nth-child(2) {
  animation-delay: .1s;
}

.stagger>*:nth-child(3) {
  animation-delay: .15s;
}

.stagger>*:nth-child(4) {
  animation-delay: .2s;
}

.stagger>*:nth-child(5) {
  animation-delay: .25s;
}

.stagger>*:nth-child(6) {
  animation-delay: .3s;
}

/* ── Chart placeholder styling ── */
.chart-placeholder {
  width: 100%;
  height: 220px;
  border-radius: var(--border-radius);
  background: linear-gradient(135deg, rgba(255, 140, 0, .05), rgba(168, 85, 247, .05));
  border: 1px dashed rgba(255, 255, 255, .08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-text-muted);
  font-size: .85rem;
  position: relative;
  overflow: hidden;
}

.chart-bar-group {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 180px;
  padding: 0 var(--sp-4);
}

.chart-bar {
  width: 28px;
  border-radius: 6px 6px 0 0;
  transition: height .8s var(--ease-smooth);
}

/* ── Dropdown Manager Cards ── */
.dropdown-mgr-card {
  background: rgba(15, 23, 42, .5);
  border: var(--border-glass);
  border-radius: var(--border-radius);
  padding: var(--sp-5);
}

.dropdown-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--border-radius-pill);
  background: rgba(255, 140, 0, .1);
  color: var(--clr-accent);
  font-size: .78rem;
  font-weight: 500;
  margin: 3px;
}

.dropdown-tag .remove-tag {
  cursor: pointer;
  opacity: .6;
  font-size: .7rem;
}

.dropdown-tag .remove-tag:hover {
  opacity: 1;
}

/* ── Activity List ── */
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

/* ── Standalone Additional Fees Block ── */
.additional-fees-standalone-block {
    transition: all 0.3s ease;
}
.additional-fees-standalone-block:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.2) !important;
    background: rgba(255,255,255,0.03) !important;
}
.additional-fees-standalone-block .data-table {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}
.additional-fees-standalone-block .form-control {
    background: rgba(15, 23, 42, 0.6) !important;
    border-color: rgba(148, 163, 184, 0.2) !important;
}

.activity-text {
  font-size: .88rem;
}

.activity-time {
  font-size: .75rem;
  color: var(--clr-text-muted);
  margin-top: 2px;
}

/* ── Timeline ── */
.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, .08);
}

.timeline-item {
  position: relative;
  margin-bottom: var(--sp-5);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--clr-accent);
  border: 3px solid var(--clr-bg);
}

.timeline-item .tl-date {
  font-size: .72rem;
  color: var(--clr-text-muted);
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.timeline-item .tl-text {
  font-size: .88rem;
}

/* ── Gradient text ── */
.gradient-text {
  background: linear-gradient(135deg, var(--clr-accent), var(--clr-accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── File Upload Area ── */
.upload-area {
  border: 2px dashed rgba(255, 255, 255, .1);
  border-radius: var(--border-radius);
  padding: var(--sp-8);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.upload-area:hover {
  border-color: var(--clr-accent);
  background: rgba(255, 140, 0, .03);
}

.upload-area .upload-icon {
  font-size: 2rem;
  margin-bottom: var(--sp-3);
  color: var(--clr-text-muted);
}

/* ── Notification Dropdown ── */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--clr-bg-secondary);
  border: var(--border-glass);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all .25s var(--ease-smooth);
  z-index: 200;
}

.notif-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.notif-item {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  cursor: pointer;
  transition: background var(--transition);
}

.notif-item:hover {
  background: rgba(255, 255, 255, .03);
}

.notif-item.unread {
  background: rgba(255, 140, 0, .04);
}

/* ── Print Styles ── */
@media print {

  .sidebar,
  .topbar,
  .toast-container {
    display: none !important;
  }

  .main-content {
    margin: 0 !important;
    padding: 20px !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .card {
    background: #f9f9f9;
    border: 1px solid #ddd;
  }
}

/* ── Custom Searchable Select (Integrated) ── */
.custom-searchable-select {
  position: relative;
}

.search-results-overlay {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--clr-bg-secondary);
  border: 1px solid var(--clr-accent);
  border-radius: var(--border-radius-sm);
  margin-top: 4px;
  max-height: 250px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
}

.search-results-overlay.invoice-picker-results {
  max-height: min(360px, 55vh);
}

/* Invoice list: keep action icons on one horizontal row */
.data-table td.invoice-actions-cell {
  white-space: nowrap;
  vertical-align: middle;
}

.data-table td.invoice-actions-cell .invoice-action-btns {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
}

.search-result-item {
  padding: 10px 15px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  transition: background var(--transition);
}

.search-result-item:hover {
  background: rgba(255, 140, 0, .15);
}

.search-result-item .text-xs {
  margin-top: 2px;
}

/* ── Hide Number Spinners ── */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* ── Quote Item Cards ── */
.quote-items-grid {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.quote-item-card {
  background: rgba(255, 255, 255, .02);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  overflow: hidden;
  transition: all .3s ease;
}

.quote-item-card:hover {
  border-color: rgba(255, 140, 0, .3);
  background: rgba(255, 255, 255, .03);
  box-shadow: var(--shadow-sm);
}

.item-card-header {
  padding: 8px 15px;
  background: rgba(255, 255, 255, .03);
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.item-number {
  font-size: .75rem;
  font-weight: 700;
  color: var(--clr-accent);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.item-remove-btn {
  background: none;
  border: none;
  color: var(--clr-danger);
  cursor: pointer;
  opacity: .5;
  transition: opacity .2s;
}

.item-remove-btn:hover {
  opacity: 1;
}

.item-card-body {
  padding: 15px;
}

.card-field-full {
  margin-bottom: 12px;
}

.card-field-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.card-field-row:last-child {
  margin-bottom: 0;
}

.field-item label,
.card-field-full label,
.field-item-wide label,
.field-item-result label {
  display: block;
  font-size: .7rem;
  color: var(--clr-text-muted);
  margin-bottom: 5px;
  font-weight: 500;
  text-transform: uppercase;
}

.field-item-wide {
  grid-column: span 1;
}

.result-box {
  background: rgba(15, 23, 42, .5);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: .85rem;
  height: 40px;
  display: flex;
  align-items: center;
  color: var(--clr-text-muted);
}

.result-box.billable-active {
  border-color: rgba(255, 140, 0, .3);
  color: var(--clr-accent);
  font-weight: 700;
}

.item-card-footer {
  padding: 10px 15px;
  background: rgba(255, 140, 0, .05);
  border-top: 1px solid rgba(255, 140, 0, .1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-label {
  font-size: .7rem;
  font-weight: 600;
  color: var(--clr-text-muted);
}

.footer-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--clr-accent);
}