/* ===================================================================
   SCRAPPRO - Modern Automotive Scrap ERP Stylesheet
   Dark Navy / Charcoal Theme with Safety Amber / Orange Accents
   =================================================================== */

:root {
  --bg-main: #090d16;
  --bg-card: #0f172a;
  --bg-card-hover: #162036;
  --bg-surface: #1e293b;
  --bg-surface-light: #2d3b55;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #f59e0b;
  
  --primary: #f59e0b;       /* Safety Amber */
  --primary-hover: #d97706;
  --primary-glow: rgba(245, 158, 11, 0.25);
  
  --accent: #ea580c;        /* High Heat Orange */
  --accent-blue: #0284c7;   /* Electric Cyan */
  --success: #10b981;       /* Emerald */
  --warning: #f59e0b;       /* Amber */
  --danger: #ef4444;        /* Crimson */
  --info: #38bdf8;          /* Sky */
  --purple: #8b5cf6;        /* Violet */
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --sidebar-width: 260px;
  --header-height: 68px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px rgba(245, 158, 11, 0.2);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

/* App Shell Layout */
#app {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.8);
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-weight: 900;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
  line-height: 1.2;
}

.brand-badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
  font-weight: 700;
}

/* Navigation Links */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 5px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.nav-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  font-weight: 700;
  padding: 12px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.nav-item:hover {
  background: var(--bg-surface);
  color: var(--text-main);
  transform: translateX(3px);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
  color: var(--primary);
  font-weight: 600;
  border-left: 3px solid var(--primary);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke-width: 2;
}

.nav-badge {
  margin-left: auto;
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 600;
}

.nav-badge.danger {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}
.nav-badge.warning {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

/* Sidebar Footer (Role info) */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.6);
}

.user-snippet {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  object-fit: cover;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-badge {
  display: inline-block;
  font-size: 10.5px;
  color: var(--primary);
  font-weight: 600;
  background: rgba(245, 158, 11, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
}

/* Main Content Area */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: calc(100% - var(--sidebar-width));
}

/* Header */
.top-header {
  height: var(--header-height);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-main);
  cursor: pointer;
}

.search-trigger-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.2s;
  width: 320px;
}

.search-trigger-btn:hover {
  border-color: var(--primary);
  color: var(--text-main);
}

.search-kbd {
  margin-left: auto;
  background: var(--bg-card);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  border: 1px solid var(--border-color);
  color: var(--text-dim);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Role Selector in Header */
.role-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  font-size: 12.5px;
}

.role-picker label {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
}

.role-select {
  background: transparent;
  border: none;
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.role-select option {
  background: var(--bg-card);
  color: var(--text-main);
}

/* Quick Action Button */
.btn-quick-action {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #000;
  font-weight: 700;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-quick-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.45);
}

/* Icon Buttons (Notifications, Help, Settings) */
.icon-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}

.icon-btn:hover {
  color: var(--text-main);
  border-color: var(--primary);
}

.badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}

/* Main View Body */
.content-container {
  padding: 28px;
  flex: 1;
}

/* Breadcrumbs & View Titles */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.view-title-group h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.view-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}

.view-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Common UI Elements */
/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #000;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface);
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: var(--bg-surface-light);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}
.btn-success:hover {
  background: var(--success);
  color: #000;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.badge-dot-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-success .badge-dot-indicator { background: #10b981; }

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.badge-warning .badge-dot-indicator { background: #f59e0b; }

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.badge-danger .badge-dot-indicator { background: #ef4444; }

.badge-info {
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.3);
}
.badge-info .badge-dot-indicator { background: #38bdf8; }

.badge-purple {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.3);
}
.badge-purple .badge-dot-indicator { background: #8b5cf6; }

.badge-neutral {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid var(--border-color);
}
.badge-neutral .badge-dot-indicator { background: #94a3b8; }

/* Cards & Panels */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Metric Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

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

.stat-content {
  flex: 1;
  min-width: 0;
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.stat-label {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-trend {
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }
.stat-trend.neutral { color: var(--text-dim); }

/* Data Tables */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table-toolbar {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  gap: 16px;
  flex-wrap: wrap;
  background: rgba(15, 23, 42, 0.4);
}

.table-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 7px 14px;
  border-radius: var(--radius-md);
  width: 280px;
}

.table-search input {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 13px;
  outline: none;
  width: 100%;
}

.table-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-select {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 7px 12px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  outline: none;
  cursor: pointer;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

table.data-table th {
  background: var(--bg-surface);
  color: var(--text-muted);
  font-weight: 600;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.8px;
  white-space: nowrap;
}

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

table.data-table tbody tr {
  transition: background 0.15s ease;
}

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

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(245, 158, 11, 0.1);
  transform: translateY(20px) scale(0.98);
  transition: transform 0.2s ease;
}

.modal-dialog.large {
  max-width: 900px;
}

.modal-dialog.xlarge {
  max-width: 1100px;
}

.modal-backdrop.active .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.modal-close-btn:hover {
  color: #fff;
  background: var(--bg-surface);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(15, 23, 42, 0.5);
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-grid.col-3 {
  grid-template-columns: repeat(3, 1fr);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.col-span-2 {
  grid-column: span 2;
}

.form-group.col-span-3 {
  grid-column: span 3;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* Photo upload previewer */
.photo-uploader {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  background: rgba(30, 41, 59, 0.4);
  cursor: pointer;
  transition: all 0.2s;
}

.photo-uploader:hover {
  border-color: var(--primary);
  background: rgba(245, 158, 11, 0.05);
}

.photo-preview-grid {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.photo-thumb {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-color);
}

/* Kanban Board (for CRM & Tasks) */
.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
}

.kanban-col {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  min-width: 290px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
}

.kanban-col-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.6);
}

.kanban-col-title {
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-cards {
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.kanban-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.kanban-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

/* Delivery Tracking Stepper & Map */
.tracking-timeline {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin: 30px 10px;
}

.tracking-timeline::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 20px;
  right: 20px;
  height: 4px;
  background: var(--bg-surface);
  z-index: 1;
}

.tracking-progress-bar {
  position: absolute;
  top: 18px;
  left: 20px;
  height: 4px;
  background: linear-gradient(90deg, #10b981, #f59e0b);
  z-index: 2;
  transition: width 0.4s ease;
}

.tracking-step {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100px;
}

.step-node {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: 8px;
  transition: all 0.2s;
}

.tracking-step.completed .step-node {
  background: var(--success);
  border-color: var(--success);
  color: #000;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.4);
}

.tracking-step.active .step-node {
  background: var(--primary);
  border-color: var(--primary);
  color: #000;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.5);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.step-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.tracking-step.completed .step-title,
.tracking-step.active .step-title {
  color: #fff;
}

/* Simulated Vector Map */
.simulated-map {
  width: 100%;
  height: 240px;
  background: #0d1525;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

/* Global Search Modal Overlay */
.search-modal-dialog {
  max-width: 640px;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.search-input-wrap input {
  background: transparent;
  border: none;
  font-size: 16px;
  color: #fff;
  outline: none;
  width: 100%;
}

.search-results-list {
  max-height: 420px;
  overflow-y: auto;
  padding: 10px;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s;
}

.search-result-item:hover {
  background: var(--bg-surface);
}

/* Notifications Drawer */
.notif-dropdown {
  position: absolute;
  top: calc(var(--header-height) - 5px);
  right: 28px;
  width: 380px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: none;
}

.notif-dropdown.show {
  display: block;
}

.notif-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notif-list {
  max-height: 380px;
  overflow-y: auto;
}

.notif-item {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.notif-item.unread {
  background: rgba(245, 158, 11, 0.05);
}

.notif-item:hover {
  background: var(--bg-surface);
}

/* Printable Invoice Styles */
.invoice-container {
  background: #fff;
  color: #0f172a;
  padding: 40px;
  border-radius: var(--radius-lg);
  max-width: 820px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 24px;
  margin-bottom: 24px;
}

.invoice-brand h2 {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.5px;
}

.invoice-badge-status {
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
}

.invoice-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 28px;
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}

.invoice-table th {
  background: #f1f5f9;
  color: #334155;
  font-weight: 700;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid #cbd5e1;
}

.invoice-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  color: #1e293b;
}

.invoice-totals {
  margin-left: auto;
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.invoice-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.invoice-total-row.grand {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
  border-top: 2px solid #0f172a;
  padding-top: 8px;
}

@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .sidebar, .top-header, .btn, .modal-backdrop, .no-print {
    display: none !important;
  }
  .main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
  }
  .content-container {
    padding: 0 !important;
  }
  .invoice-container {
    box-shadow: none !important;
    padding: 0 !important;
  }
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
    width: 100%;
  }
  .mobile-toggle {
    display: block;
  }
  .search-trigger-btn {
    width: 200px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid.col-3 {
    grid-template-columns: 1fr;
  }
  .form-group.col-span-2,
  .form-group.col-span-3 {
    grid-column: span 1;
  }
}
