/* ==========================================================================
   EXPRESSSHIP COURIER AGGREGATOR — B2B SAAS DESIGN SYSTEM
   Professional Enterprise Dark Theme with Crisp Typography & SVG Icons
   ========================================================================== */

:root {
  /* Surface & Background Colors */
  --bg-canvas: #090d16;
  --bg-surface: #0e1626;
  --bg-card: #131d31;
  --bg-card-hover: #18243c;
  --bg-sidebar: #0a1120;
  --bg-input: #0b1220;
  --bg-modal: #111a2e;
  
  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-color: #1e2c45;
  --border-card: #223250;
  --border-focus: #3b82f6;
  --border-hover: rgba(255, 255, 255, 0.16);

  /* Brand Accents */
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-glow: rgba(59, 130, 246, 0.2);
  --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  
  --accent: #8b5cf6;
  --accent-hover: #7c3aed;
  --accent-glow: rgba(139, 92, 246, 0.2);

  --success: #10b981;
  --success-hover: #059669;
  --success-glow: rgba(16, 185, 129, 0.2);

  --warning: #f59e0b;
  --warning-hover: #d97706;
  --warning-glow: rgba(245, 158, 11, 0.2);

  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-glow: rgba(239, 68, 68, 0.2);

  --info: #06b6d4;
  --info-glow: rgba(6, 182, 212, 0.2);

  /* Typography Colors */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-inverse: #0f172a;

  /* Typography Families & Weights */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', 'Inter', system-ui, sans-serif;

  /* Sizing & Geometry */
  --sidebar-width: 270px;
  --header-height: 70px;
  --radius-xl: 18px;
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 28px -4px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 20px -3px rgba(59, 130, 246, 0.35);

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */

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

html {
  font-size: 14.5px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-canvas);
  color: var(--text-main);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(10, 17, 32, 0.5);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* ==========================================================================
   SVG ICON SYSTEM
   ========================================================================== */

.icon {
  width: 1.15rem;
  height: 1.15rem;
  display: inline-block;
  vertical-align: -0.15em;
  stroke-width: 1.85;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.icon-xs { width: 0.85rem; height: 0.85rem; }
.icon-sm { width: 1rem; height: 1rem; }
.icon-md { width: 1.25rem; height: 1.25rem; }
.icon-lg { width: 1.5rem; height: 1.5rem; }
.icon-xl { width: 1.9rem; height: 1.9rem; }

/* Spinners */
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   APP LAYOUT
   ========================================================================== */

.app-container {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-canvas);
  position: relative;
}

/* Mobile Header Bar (Only on small screens) */
.mobile-topbar {
  display: none;
  height: 56px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 0 1rem;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.mobile-nav-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.4rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ==========================================================================
   SIDEBAR NAVIGATION
   ========================================================================== */

.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0.9rem;
  flex-shrink: 0;
  z-index: 105;
  transition: transform var(--transition-normal);
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0.35rem 1.15rem 0.35rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.15rem;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.brand-text h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
  line-height: 1.2;
}

.brand-text span {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* Merchant Selector Card */
.merchant-selector-card {
  background: linear-gradient(180deg, rgba(19, 29, 49, 0.8) 0%, rgba(14, 22, 38, 0.9) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.85rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast);
}

.merchant-selector-card:hover {
  border-color: rgba(59, 130, 246, 0.35);
}

.merchant-selector-card label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #93c5fd;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.merchant-selector-card select {
  width: 100%;
  background: var(--bg-canvas);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.merchant-selector-card select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.merchant-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  background: rgba(139, 92, 246, 0.16);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.35);
}

/* Nav Menu */
.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 100%;
  text-align: left;
  position: relative;
}

.nav-item .icon {
  color: var(--text-dim);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.05);
}

.nav-item:hover .icon {
  color: var(--text-main);
  transform: translateX(2px);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.16) 0%, rgba(59, 130, 246, 0.06) 100%);
  color: #ffffff;
  font-weight: 600;
  border: 1px solid rgba(59, 130, 246, 0.35);
  box-shadow: inset 2px 0 0 0 var(--primary);
}

.nav-item.active .icon {
  color: #60a5fa;
}

.nav-pill {
  margin-left: auto;
  font-size: 0.72rem;
  padding: 0.12rem 0.45rem;
  border-radius: 12px;
  font-weight: 700;
}

.pill-new {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 10px var(--primary-glow);
}

/* Sidebar Footer & Credit Card */
.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.credit-card {
  background: linear-gradient(135deg, #111a33 0%, #1a153b 100%);
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 0.85rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.credit-card::before {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.credit-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #c4b5fd;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.credit-amount {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin-top: 0.25rem;
  letter-spacing: -0.01em;
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */

.main-content {
  flex-grow: 1;
  padding: 1.75rem 2.25rem;
  overflow-y: auto;
  min-width: 0;
}

.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.75rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-title-area h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.page-title-area p {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #ffffff;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.user-avatar:hover {
  transform: scale(1.05);
  border-color: #60a5fa;
}

/* Low Credit Warning Banner */
.alert {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-left: 4px solid var(--warning);
  color: #fde68a;
}

/* Tabs */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: tabFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ==========================================================================
   DASHBOARD STATS CARDS
   ========================================================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.95rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-primary .stat-icon { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.stat-warning .stat-icon { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.stat-info .stat-icon    { background: rgba(6, 182, 212, 0.15); color: #38bdf8; border: 1px solid rgba(6, 182, 212, 0.3); }
.stat-accent .stat-icon  { background: rgba(139, 92, 246, 0.15); color: #c084fc; border: 1px solid rgba(139, 92, 246, 0.3); }
.stat-success .stat-icon { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.stat-danger .stat-icon  { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }

.stat-details {
  min-width: 0;
}

.stat-title {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-muted);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-details h3 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  margin-top: 0.15rem;
}

/* ==========================================================================
   PANELS, CARDS & LAYOUTS
   ========================================================================== */

.dashboard-panels-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.15rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.panel-header h3 {
  font-size: 1.08rem;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.margin-top-1 { margin-top: 1rem; }
.margin-top-2 { margin-top: 1.75rem; }

/* Filter Bar */
.filter-bar {
  display: flex;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.filter-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.filter-group select, .filter-group input {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.filter-group select:focus, .filter-group input:focus {
  border-color: var(--primary);
}

/* ==========================================================================
   TABLES & DATA GRIDS
   ========================================================================== */

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.86rem;
}

.data-table th {
  padding: 0.75rem 0.9rem;
  background: rgba(10, 17, 32, 0.7);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

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

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.data-table code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  background: rgba(15, 23, 42, 0.8);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  color: #7dd3fc;
}

/* ==========================================================================
   STATUS BADGES & PILLS
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.6rem;
  border-radius: 20px;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.2;
}

.badge-source {
  background: rgba(100, 116, 139, 0.18);
  color: #cbd5e1;
  border: 1px solid rgba(100, 116, 139, 0.3);
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
}

.badge-success { background: rgba(16, 185, 129, 0.16); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.35); }
.badge-warning { background: rgba(245, 158, 11, 0.16); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.35); }
.badge-danger  { background: rgba(239, 68, 68, 0.16); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.35); }
.badge-info    { background: rgba(59, 130, 246, 0.16); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.35); }
.badge-secondary { background: rgba(148, 163, 184, 0.12); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.25); }

/* Order Status Pills */
.status-new             { background: rgba(59, 130, 246, 0.18); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.4); }
.status-review_required { background: rgba(245, 158, 11, 0.18); color: #fde047; border: 1px solid rgba(245, 158, 11, 0.4); }
.status-approved        { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.4); }
.status-shipped,
.status-in_transit      { background: rgba(139, 92, 246, 0.18); color: #c4b5fd; border: 1px solid rgba(139, 92, 246, 0.4); }
.status-delivered       { background: rgba(16, 185, 129, 0.22); color: #34d399; border: 1px solid #10b981; }
.status-returned,
.status-failed          { background: rgba(239, 68, 68, 0.18); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.4); }

/* Faze porudžbine u listi (kolona "Status"); radnje za trgovca su istaknute */
.phase-scheduled        { background: rgba(14, 165, 233, 0.18); color: #7dd3fc; border: 1px solid rgba(14, 165, 233, 0.4); }
.phase-cancelled        { background: rgba(100, 116, 139, 0.18); color: #cbd5e1; border: 1px solid rgba(100, 116, 139, 0.4); }
.phase-action           { font-weight: 700; border-width: 2px; border-style: solid; }
.phase-awaiting_payment { background: rgba(245, 158, 11, 0.28); color: #fde68a; border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15); }
.phase-problem          { background: rgba(239, 68, 68, 0.28); color: #fecaca; border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15); }

.badge-env {
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
}
.env-prod { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.env-test { background: rgba(245, 158, 11, 0.2); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.4); }
/* izbor_kurira.md: crvena TEST oznaka za porudžbinu na test nalogu (kurir neće doći) */
.badge-test-courier { display: inline-block; padding: 0.05rem 0.4rem; border-radius: 4px; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.04em; background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.6); }

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1.05rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  text-decoration: none;
  line-height: 1.25;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed !important;
  pointer-events: none;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--primary-glow);
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 14px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-hover);
}

.btn-success {
  background: var(--success);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--success-glow);
}
.btn-success:hover {
  background: var(--success-hover);
  transform: translateY(-1px);
}

.btn-warning {
  background: var(--warning);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--warning-glow);
}
.btn-warning:hover {
  background: var(--warning-hover);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--danger-glow);
}
.btn-danger:hover {
  background: var(--danger-hover);
  transform: translateY(-1px);
}

.btn-accent {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--accent-glow);
}
.btn-accent:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-info {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.35);
}
.btn-info:hover {
  background: rgba(59, 130, 246, 0.25);
}

.btn-sm {
  padding: 0.32rem 0.65rem;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

.btn-link {
  background: transparent;
  color: var(--primary);
  border: none;
  padding: 0.2rem 0.4rem;
}
.btn-link:hover {
  color: #60a5fa;
  text-decoration: underline;
}

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */

.form-group {
  margin-bottom: 1.15rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  outline: none;
  font-size: 0.88rem;
  font-family: inherit;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-dim);
}

.form-group small {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.74rem;
  color: var(--text-dim);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
}

/* ==========================================================================
   MODALS
   ========================================================================== */

.modal-backdrop {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(5, 10, 22, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.show {
  display: flex;
}

.modal-box {
  background: var(--bg-modal);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.96) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding: 1.15rem 1.4rem;
  background: rgba(14, 22, 38, 0.6);
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

.modal-close {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: var(--border-color);
}

.modal-body {
  padding: 1.35rem 1.4rem;
  overflow-y: auto;
  max-height: calc(90vh - 130px);
}

.modal-footer {
  padding: 0.95rem 1.4rem;
  border-top: 1px solid var(--border-color);
  background: rgba(14, 22, 38, 0.6);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* ==========================================================================
   COURIERS & ACCOUNTS SECTION
   ========================================================================== */

.couriers-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.courier-accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 1.25rem;
}

.courier-account-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.courier-account-card:hover {
  border-color: rgba(59, 130, 246, 0.35);
  transform: translateY(-2px);
}

.card-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.card-top h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
}

.card-details {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.84rem;
  margin-bottom: 1.15rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.detail-row span {
  color: var(--text-muted);
}

.card-actions {
  margin-top: auto;
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.quick-couriers-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.quick-courier-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0.95rem;
  background: rgba(14, 22, 38, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.quick-courier-item:hover {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(14, 22, 38, 0.85);
}

.quick-courier-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.quick-courier-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #60a5fa;
}

/* ==========================================================================
   WSP ADDRESS VALIDATION & AUTOCOMPLETE
   ========================================================================== */

.wsp-autocomplete-wrapper {
  position: relative;
  width: 100%;
}

.wsp-autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 1050;
  background: var(--bg-surface);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  max-height: 220px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 4px 0;
}

.wsp-autocomplete-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.wsp-autocomplete-item:last-child {
  border-bottom: none;
}

.wsp-autocomplete-item:hover, .wsp-autocomplete-item.active {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.wsp-status-badge {
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  transition: all var(--transition-fast);
}

.wsp-status-unverified {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.wsp-status-checking {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.wsp-status-valid {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.45);
}

.wsp-status-invalid {
  background: rgba(239, 68, 68, 0.16);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.45);
}

.wsp-step-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* ==========================================================================
   TRACKING TIMELINE & STEPPER
   ========================================================================== */

.tracking-stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  background: rgba(14, 22, 38, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.95rem;
}

.tracking-step {
  text-align: center;
  position: relative;
}

.tracking-step-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin: 0 auto 0.4rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--bg-card);
  color: var(--text-dim);
  border: 2px solid var(--border-color);
}

.tracking-step.completed .tracking-step-circle {
  background: var(--success);
  color: #ffffff;
  border-color: var(--success);
}

.tracking-step.active .tracking-step-circle {
  background: var(--primary);
  color: #ffffff;
  border-color: #60a5fa;
  box-shadow: 0 0 10px var(--primary-glow);
}

.tracking-step-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.tracking-step.completed .tracking-step-label,
.tracking-step.active .tracking-step-label {
  color: #f1f5f9;
  font-weight: 600;
}

.tracking-timeline {
  position: relative;
  margin: 1.2rem 0;
  padding-left: 1.75rem;
}

.tracking-timeline::before {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 7px;
  width: 2px;
  background: var(--border-color);
}

.tracking-item {
  position: relative;
  margin-bottom: 1.15rem;
}

.tracking-item:last-child {
  margin-bottom: 0;
}

.tracking-dot {
  position: absolute;
  left: -1.75rem;
  top: 5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #64748b;
  border: 3px solid var(--bg-canvas);
  box-shadow: 0 0 0 2px #64748b;
  z-index: 2;
}

.tracking-dot.delivered  { background: var(--success); box-shadow: 0 0 0 2px var(--success); }
.tracking-dot.in-transit { background: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.tracking-dot.created    { background: var(--warning); box-shadow: 0 0 0 2px var(--warning); }

.tracking-card {
  background: rgba(14, 22, 38, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  transition: border-color var(--transition-fast);
}

.tracking-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 1024px) {
  .dashboard-panels-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }

  .mobile-topbar {
    display: flex;
  }

  .sidebar {
    width: 100%;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-sidebar);
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    overflow-y: auto;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-content {
    padding: 1.25rem 1rem;
  }

  .top-header {
    margin-bottom: 1.25rem;
  }

  .page-title-area h1 {
    font-size: 1.35rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .modal-box {
    width: 95%;
    max-height: 94vh;
    padding: 0;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    width: 100%;
    justify-content: space-between;
  }

  .filter-group select, .filter-group input {
    width: 65%;
  }

  .shipping-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   FAZA 2A.1: SHIPPING OPERATIONAL SUMMARY, SELECTION, DISPATCH DATE & PAGINATION
   ========================================================================== */
.shipping-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.summary-mini-card {
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.summary-mini-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Modern Selection Button */
.btn-selection {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted, #94a3b8);
  transition: all 0.15s ease-in-out;
  white-space: nowrap;
}

.btn-selection:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
}

.btn-selection.selected {
  background: #4f46e5;
  border-color: #6366f1;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.35);
}

.btn-selection.selected:hover {
  background: #4338ca;
  border-color: #4f46e5;
}

.btn-selection:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.08);
  background: transparent;
  color: #64748b;
}

.btn-select-all-header {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.25rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 5px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted, #94a3b8);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-select-all-header:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
}

.btn-select-all-header.selected {
  background: #4f46e5;
  border-color: #6366f1;
  color: #ffffff;
}

tr.row-selected {
  background: rgba(99, 102, 241, 0.08) !important;
}

/* Dispatch Date Styling */
.dispatch-date-cell {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
}

.dispatch-tag {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dispatch-tag.dispatch-today {
  color: #10b981;
}

.dispatch-tag.dispatch-scheduled {
  color: #60a5fa;
}

.dispatch-tag.dispatch-none {
  color: #94a3b8;
  font-weight: 500;
}

.dispatch-date-val {
  font-size: 0.74rem;
  font-weight: 600;
  color: #cbd5e1;
  letter-spacing: 0.3px;
}

/* Pagination Bar */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  flex-wrap: wrap;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.1);
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

.pagination-info {
  font-size: 0.82rem;
  color: var(--text-muted, #94a3b8);
  font-weight: 500;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main, #f8fafc);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.page-btn:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
}

.page-btn.active {
  background: #4f46e5;
  border-color: #6366f1;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.35);
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  color: #64748b;
  border-color: rgba(255, 255, 255, 0.06);
}

.page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 32px;
  font-size: 0.85rem;
  color: var(--text-muted, #94a3b8);
}



/* Lista porudžbina: tabovi, pretraga, kolona "Primljeno", oznaka "Istorija" */
.orders-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.orders-tabs {
  display: inline-flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 3px;
}

.orders-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.orders-tab:hover { color: var(--text-main); }

.orders-tab.active {
  background: var(--primary-glow);
  color: var(--text-main);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.orders-tab-count {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(100, 116, 139, 0.25);
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  min-width: 1.4rem;
  text-align: center;
}

.orders-search {
  flex: 1 1 320px;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 0.75rem;
  color: var(--text-muted);
}

.orders-search:focus-within { border-color: var(--primary); }

.orders-search input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 0.88rem;
  padding: 0.55rem 0;
}

.orders-search-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin: -0.2rem 0 0.6rem;
}

.received-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  white-space: nowrap;
}

.received-at {
  font-variant-numeric: tabular-nums;
  font-size: 0.84rem;
}

.badge-history {
  background: rgba(100, 116, 139, 0.18);
  color: #cbd5e1;
  border: 1px solid rgba(100, 116, 139, 0.4);
  font-size: 0.68rem;
  vertical-align: middle;
}

@media (max-width: 480px) {
  .orders-list-toolbar { flex-direction: column; align-items: stretch; }
  .orders-tabs { justify-content: space-between; }
  .orders-tab { flex: 1; justify-content: center; padding: 0.4rem 0.4rem; }
  .orders-search { flex-basis: auto; }
}
