/* ============================================
   MONTAVILLA TOOLS DASHBOARD - MAIN STYLES
   ============================================ */

:root {
  --bg-dark: #f8f9fa;
  --bg-card: #ffffff;
  --bg-hover: #f1f3f5;
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --accent-blue: #3b82f6;
  --accent-light-blue: #dbeafe;
  --accent-green: #10b981;
  --accent-yellow: #f59e0b;
  --accent-red: #ef4444;
  --accent-purple: #8b5cf6;
  --border-color: #e5e7eb;
  --sidebar-bg: #1e293b;
  --sidebar-hover: #334155;
  --sidebar-active: #475569;
  --sidebar-width: 220px;
  --sidebar-collapsed: 48px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
}

html.nav-shell-restoring body > #navigation-container,
html.nav-shell-restoring body > .page-wrapper {
  visibility: hidden;
}

/* ============================================
   APP CONTAINER - SIDEBAR LAYOUT
   ============================================ */

.app-container {
  display: flex;
  min-height: 100vh;
  background: var(--bg-dark);
}

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

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: white;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  transition: width 0.3s ease;
  z-index: 100;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 56px;
  gap: 0.5rem;
}

.sidebar.collapsed .sidebar-header {
  padding: 0.5rem 0;
  justify-content: center;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
  flex: 1;
}

.logo-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.logo-image {
  height: 32px;
  width: auto;
  flex-shrink: 0;
  object-fit: contain;
}

.sidebar.collapsed .logo-text {
  display: none;
}

.sidebar.collapsed .logo-icon,
.sidebar.collapsed .logo-image {
  display: none;
}

.sidebar.collapsed .sidebar-logo {
  display: none;
}

.sidebar-toggle {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: background 0.2s;
}

.sidebar.collapsed .sidebar-toggle {
  margin: 0 auto;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Sidebar Navigation Links */
.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
}

.sidebar.collapsed .sidebar-nav {
  display: none;
}

.nav-section {
  margin-bottom: 0.5rem;
}

.nav-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
  padding: 0.5rem 1rem;
  margin-top: 0.5rem;
}

.sidebar.collapsed .nav-section-title {
  display: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
  white-space: nowrap;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.nav-link.active {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: white;
}

.nav-icon {
  font-size: 1.25rem;
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-text {
  font-size: 0.9rem;
  flex: 1;
}

.sidebar.collapsed .nav-text {
  display: none;
}

.nav-badge {
  background: var(--accent-yellow);
  color: #1e293b;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.sidebar.collapsed .nav-badge {
  display: none;
}

.nav-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0.5rem 1rem;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar.collapsed .sidebar-footer {
  display: none;
}

.user-info-sidebar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: white;
  font-size: 0.875rem;
  flex-shrink: 0;
}

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

.sidebar.collapsed .user-details {
  display: none;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  text-transform: capitalize;
}

.sidebar-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.sidebar-action-btn {
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
}

.sidebar-action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

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

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: margin-left 0.3s ease;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.api-status-banner {
  width: 100%;
  background: #b91c1c;
  color: #fff;
  font-weight: 600;
  text-align: center;
  padding: 0.75rem 1rem;
  border-radius: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.api-status-banner.hidden {
  display: none;
}

.main-content.sidebar-collapsed {
  margin-left: var(--sidebar-collapsed);
}

/* Top Header Bar */
.top-header {
  background: white;
  padding: 1rem 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.header-subtitle {
  font-size: 0.813rem;
  color: var(--text-secondary);
  margin: 0;
}

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

.local-dev-db-flag {
  background: #b91c1c;
  color: #fff;
  border: 1px solid #7f1d1d;
  border-radius: 6px;
  padding: 0.35rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
  max-width: 34rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.local-dev-db-flag.hidden {
  display: none;
}

.header-feature-request-btn {
  white-space: nowrap;
}

/* Header User Section */
.header-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-left: 1rem;
  border-left: 1px solid var(--border-color);
  position: relative;
}

.header-user-button {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: background-color 0.2s;
}

.header-user-button:hover {
  background-color: var(--bg-hover);
}

.header-user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.125rem;
}

.header-user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.header-user-role {
  font-size: 0.7rem;
  text-transform: capitalize;
}

.dropdown-arrow {
  font-size: 0.625rem;
  color: var(--text-secondary);
  transition: transform 0.2s;
}

.header-user-button:hover .dropdown-arrow {
  color: var(--text-primary);
}

/* User Dropdown Menu */
.user-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
}

.user-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  text-decoration: none;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.dropdown-item:hover {
  background-color: var(--bg-hover);
}

.dropdown-item:first-child {
  border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
  border-radius: 0 0 8px 8px;
}

.dropdown-icon {
  font-size: 1.125rem;
}

.dropdown-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 0.25rem 0;
}

/* Store Selector */
.store-selector-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.store-selector-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Page Content */
.page-content {
  flex: 1;
  padding: 2.5rem 2rem 1.5rem 2rem;
  max-width: 1800px;
  margin: 0 auto;
  width: 100%;
}

.page-wrapper {
  padding: 1rem 2rem 1.5rem 2rem;
  max-width: 1800px;
  margin: 0 auto;
  width: 100%;
}

/* ============================================
   CARDS
   ============================================ */

.card {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.card-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.card-header h2 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-header p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* ============================================
   TAB NAVIGATION
   ============================================ */

.tab-nav {
  display: flex;
  gap: 0.25rem;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 1.5rem;
  overflow-x: hidden;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 0.875rem 1.5rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  top: 2px;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--accent-blue);
  background: var(--bg-hover);
}

.tab-btn.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Sub-tabs (nested within main tabs) */
.sub-tab-nav {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-tertiary);
  border-radius: 6px;
  padding: 3px;
}

.sub-tab-btn {
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sub-tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.sub-tab-btn.active {
  color: var(--text-primary);
  background: var(--bg-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.print-queue-subtab {
  display: none;
}

.print-queue-subtab.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* Expandable rows */
.expand-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}

.expand-btn:hover {
  color: var(--text-primary);
}

.expand-btn.expanded {
  transform: none;
}

.detail-row {
  background: var(--bg-secondary);
}

.detail-row td {
  padding: 0 !important;
}

.detail-content {
  padding: 1rem 1.5rem;
  border-left: 3px solid var(--accent-blue);
  margin-left: 1rem;
}

.detail-content .detail-table {
  width: 100%;
  margin-top: 0.5rem;
}

.detail-content .detail-table th,
.detail-content .detail-table td {
  padding: 0.5rem;
  font-size: calc(0.8125rem + 2pt);
}

.store-orders-container {
  padding: 1rem;
  background: var(--bg-secondary);
}

.store-order-row {
  display: grid;
  grid-template-columns: auto 1fr 1fr 1fr 1fr auto;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--bg-primary);
  border-radius: 6px;
  margin-bottom: 0.5rem;
  align-items: center;
}

.store-order-row:last-child {
  margin-bottom: 0;
}

.store-order-item td {
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
  font-size: calc(0.875rem + 2pt);
  vertical-align: top;
}

.store-order-ticket {
  font-weight: 700;
}

.store-order-items-inline {
  margin-top: 0.00rem;
  line-height: 1.4;
}

.store-order-item-inline-row {
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.store-order-item-inline-row.is-printed {
  background: #dcfce7;
}

/* ============================================
   FORMS
   ============================================ */

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

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.form-control {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.875rem;
  transition: all 0.2s;
  background: white;
}

.form-control-sm {
  padding: 0.375rem 0.5rem;
  font-size: 0.75rem;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-light-blue);
}

.form-control:disabled {
  background: var(--bg-dark);
  cursor: not-allowed;
}

.permissions-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--bg-hover);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.permissions-checkboxes label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: normal;
  font-size: 0.875rem;
  margin: 0;
  cursor: pointer;
}

.permissions-checkboxes input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

select.form-control {
  cursor: pointer;
}

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

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

.form-help {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

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

.btn {
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent-blue);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #2563eb;
  opacity: 0.9;
}

.btn-secondary {
  background: var(--bg-dark);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  background: #e5e7eb;
}

.btn-success {
  background: var(--accent-green);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: #059669;
  opacity: 0.9;
}

.btn-danger {
  background: var(--accent-red);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
  opacity: 0.9;
}

.btn-warning {
  background: var(--accent-yellow);
  color: white;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.813rem;
}

.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  padding: 0.5rem;
  min-width: 36px;
  min-height: 36px;
}

/* ============================================
   TABLES
   ============================================ */

.table-container {
  overflow-x: auto;
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead {
  background: var(--sidebar-bg);
  color: white;
}

th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

th[data-sort] {
  cursor: pointer;
  user-select: none;
}

.sort-indicator {
  margin-left: 0.35rem;
  font-size: 0.7rem;
  opacity: 0.7;
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

tbody tr:hover {
  background: var(--bg-hover);
}

#printQueueStoresTable tbody tr.detail-row:hover {
  background: var(--bg-secondary);
}

#printQueueStoresTable tbody tr.detail-row:hover td {
  background: var(--bg-secondary);
}

.store-order-item:hover {
  background-color: var(--bg-hover);
}

.store-order-item,
.store-order-item td {
  cursor: default;
}

.deliveries-table th,
.deliveries-table td {
  padding: 0.5rem 0.75rem;
}

tbody tr:last-child td {
  border-bottom: none;
}

.clickable-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
}

.clickable-row:hover {
  background-color: #f1f5f9;
}

.clickable-row.row-selected {
  background-color: #dcfce7 !important;
}

.clickable-row.row-selected:hover {
  background-color: #bbf7d0 !important;
}

.pick-row.row-selected {
  background-color: #dcfce7;
}

.pick-row.row-selected:hover {
  background-color: #bbf7d0;
}

.store-order-item.row-selected {
  background-color: #dcfce7 !important;
}

.store-order-item.row-selected:hover {
  background-color: #bbf7d0 !important;
}

.print-item-row-printed td {
  background: #dcfce7;
}

.order-sub-row td {
  background: var(--bg-secondary);
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.section-row td {
  background: var(--bg-secondary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 16px;
  font-size: 0.85rem;
}

/* ============================================
   BADGES
   ============================================ */

.badge {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-pending {
  background: #fef3c7;
  color: #92400e;
}

.badge-picked {
  background: #dbeafe;
  color: #1e40af;
}

.badge-in-transit {
  background: #e0e7ff;
  color: #3730a3;
}

.badge-delivered {
  background: #d1fae5;
  color: #065f46;
}

.badge-no {
  background: #fee2e2;
  color: #991b1b;
  font-size: 0.85rem;
  padding: 0.35rem 0.8rem;
}

.badge-released {
  background: #d1fae5;
  color: #065f46;
  font-size: 0.85rem;
  padding: 0.35rem 0.8rem;
}

.badge-printed {
  background: #d1fae5;
  color: #065f46;
}

.badge-partial {
  background: #fef3c7;
  color: #92400e;
}

.badge-cancelled {
  background: #fee2e2;
  color: #991b1b;
}

.badge-repair-new {
  background: #fee2e2;
  color: #991b1b;
}

.badge-repair-service {
  background: #dbeafe;
  color: #1e40af;
}

.badge-repair-ready {
  background: #d1fae5;
  color: #065f46;
}

.badge-admin {
  background: #fae8ff;
  color: #86198f;
}

.badge-manager {
  background: #dbeafe;
  color: #1e40af;
}

.badge-employee {
  background: #e2e8f0;
  color: #475569;
}

.badge-delivery {
  background: #fee2e2;
  color: #991b1b;
  font-size: 0.8rem;
  padding: 0.375rem 0.75rem;
}

.notes-text {
  white-space: pre-wrap;
  background: var(--bg-secondary);
  padding: 0.75rem;
  border-radius: 4px;
  font-size: 0.875rem;
  border: 1px solid var(--border-color);
}

.backorder-row {
  background: #fef9e7;
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border-left: 4px solid var(--accent-green);
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border-left: 4px solid var(--accent-red);
}

.alert-warning {
  background: #fef3c7;
  color: #92400e;
  border-left: 4px solid var(--accent-yellow);
}

.alert-info {
  background: var(--accent-light-blue);
  color: var(--accent-blue);
  border-left: 4px solid var(--accent-blue);
}

/* ============================================
   SEARCH BOX
   ============================================ */

.search-box {
  position: relative;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-top: 0.25rem;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  z-index: 100;
}

.search-result-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.2s;
}

.search-result-item:last-child {
  border-bottom: none;
}

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

.search-result-item .item-no {
  font-weight: 600;
  color: var(--text-primary);
}

.search-result-item .item-desc {
  font-size: 0.813rem;
  color: var(--text-secondary);
}

.search-result-item .item-stock {
  font-size: 0.75rem;
  color: var(--accent-green);
  margin-top: 0.25rem;
}

/* ============================================
   CART / ITEM LIST
   ============================================ */

.cart-items {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  max-height: 500px;
  overflow-y: auto;
}

.cart-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

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

.cart-item-info {
  flex: 1;
}

.cart-item-info .item-no {
  font-weight: 600;
  color: var(--text-primary);
}

.cart-item-info .item-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qty-input {
  width: 70px;
  padding: 0.375rem 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  text-align: center;
}

/* ============================================
   EMPTY STATES
   ============================================ */

.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 3rem;
  opacity: 0.3;
  margin-bottom: 1rem;
}

.empty-state-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.empty-state-message {
  font-size: 0.875rem;
  max-width: 400px;
  margin: 0 auto;
}

.stat-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ============================================
   LOADING STATES
   ============================================ */

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner-dark {
  border-color: rgba(0, 0, 0, 0.1);
  border-top-color: var(--accent-blue);
}

.spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 4px;
}

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

.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 10;
  border-radius: 12px;
}

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

div.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  background: transparent;
}

div.modal.hidden {
  display: none !important;
}

div.modal>.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  cursor: pointer;
  border-radius: inherit;
}

div.modal>.modal-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  padding: 0;
  border-radius: 16px;
  background: white;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.25);
  overflow-y: auto;
  transform: translateY(-20px);
  transition: transform 0.25s ease;
}

div.modal:not(.hidden)>.modal-content {
  transform: translateY(0);
}

div.modal>.modal-content.modal-lg {
  max-width: 840px;
}

.feature-request-modal-content {
  max-width: 760px !important;
}

.feature-request-help {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.feature-request-context {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.85rem;
}

.feature-request-context-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.feature-request-context-value {
  font-size: 0.85rem;
  color: var(--text-primary);
  word-break: break-word;
}

.feature-request-textarea {
  min-height: 180px;
  resize: vertical;
}

.feature-request-feedback {
  margin-top: 0.75rem;
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 0.85rem;
  line-height: 1.35;
}

.feature-request-feedback.hidden {
  display: none;
}

.feature-request-feedback.error {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}

.feature-request-feedback.success {
  color: #14532d;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

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

.modal-header h3 {
  font-size: 1.125rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  line-height: 1;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Permissions checkboxes */
.permissions-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.permissions-checkboxes label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: normal;
  cursor: pointer;
}

/* ============================================
   PERMISSIONS GRID (Admin Role Management)
   ============================================ */

.permissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-dark);
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
}

.permission-section {
  background: var(--bg-card);
  border-radius: 0.375rem;
  padding: 1rem;
  border: 1px solid var(--border-color);
}

.permission-section-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  text-transform: capitalize;
}

.permission-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color 0.15s;
}

.permission-checkbox:hover {
  color: var(--text-primary);
}

.permission-checkbox input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
  accent-color: var(--accent-blue);
}

.permission-checkbox input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.permission-checkbox span {
  flex: 1;
}

/* Roles table status badge */
.role-status {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.role-status.active {
  background: #dcfce7;
  color: #166534;
}

.role-status.inactive {
  background: #fee2e2;
  color: #991b1b;
}

.system-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.375rem;
  background: #e0e7ff;
  color: #3730a3;
  border-radius: 0.25rem;
  font-size: 0.7rem;
  font-weight: 500;
  margin-left: 0.5rem;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: white;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 300px;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast-success {
  border-left: 4px solid var(--accent-green);
}

.toast-error {
  border-left: 4px solid var(--accent-red);
}

.toast-warning {
  border-left: 4px solid var(--accent-yellow);
}

/* ============================================
   GRID LAYOUTS
   ============================================ */

.grid {
  display: grid;
  gap: 1.5rem;
}

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

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

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid-sidebar {
  grid-template-columns: 2fr 1fr;
}

/* ============================================
   AUTO MESSAGING TRIGGERS
   ============================================ */

.auto-trigger-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.auto-trigger-grid .btn {
  width: 100%;
  justify-content: space-between;
}

.form-section h4 {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.template-section {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.template-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.template-hint {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.template-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.template-token {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--bg-dark);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: grab;
  border: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.template-token:hover {
  border-color: var(--accent-blue);
  color: var(--text-primary);
}

.template-token:active {
  cursor: grabbing;
}

.vendor-labels {
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.vendor-labels .vendor-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: var(--bg-dark);
  margin-right: 0.4rem;
  margin-top: 0.4rem;
  font-size: 0.75rem;
}

/* ============================================
   STATS / KPI CARDS - See Dashboard Stat Cards section for main styles
   ============================================ */

/* ============================================
   INVENTORY TABLE STYLES
   ============================================ */

.inventory-row {
  cursor: pointer;
}

.inventory-row:hover {
  background: var(--accent-light-blue) !important;
}

.inventory-row.selected {
  background: #dbeafe !important;
}

.stock-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.stock-badge.in-stock {
  background: #d1fae5;
  color: #065f46;
}

.stock-badge.low-stock {
  background: #fef3c7;
  color: #92400e;
}

.stock-badge.out-of-stock {
  background: #fee2e2;
  color: #991b1b;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-muted {
  color: var(--text-secondary);
}

.font-bold {
  font-weight: 700;
}

.mt-1 {
  margin-top: 0.5rem;
}

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

.mt-3 {
  margin-top: 1.5rem;
}

.mb-0 {
  margin-bottom: 0;
}

.mb-1 {
  margin-bottom: 0.5rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

.mb-3 {
  margin-bottom: 1.5rem;
}

.flex {
  display: flex;
}

.flex-between {
  justify-content: space-between;
}

.flex-center {
  align-items: center;
}

.flex-wrap {
  flex-wrap: wrap;
}

.gap-1 {
  gap: 0.5rem;
}

.gap-2 {
  gap: 1rem;
}

/* ============================================
   LOGIN/REGISTER PAGE SPECIFIC
   ============================================ */

.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  padding: 2rem;
}

.auth-card {
  background: white;
  border-radius: 16px;
  padding: 3rem 2.5rem;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 440px;
}

.auth-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.auth-header h1 {
  font-size: 1.875rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 0.938rem;
}

.auth-footer {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.auth-footer a:hover {
  color: #2563eb;
  text-decoration: underline;
}

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

@media (max-width: 1024px) {

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

  .grid-sidebar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

  .main-content {
    margin-left: 0;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .top-header {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
  }

  .header-actions {
    gap: 0.5rem;
  }

  .header-feature-request-btn {
    font-size: 0.72rem;
    padding: 0.4rem 0.55rem;
  }

  .local-dev-db-flag {
    max-width: 11rem;
    font-size: 0.59rem;
    padding: 0.28rem 0.4rem;
  }

  .header-user {
    padding-left: 0.75rem;
  }

  .header-user-info {
    display: none;
  }

  .page-title {
    font-size: 1rem;
  }

  .header-subtitle {
    display: none;
  }

  .page-content {
    padding: 1rem;
  }

  .tab-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ============================================
   AUTH PAGE LOGO
   ============================================ */

.auth-logo {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.auth-logo-image {
  height: 80px;
  width: auto;
  margin-bottom: 1.5rem;
  object-fit: contain;
}

/* Auth Page Form Styling */
.auth-card .form-group {
  margin-bottom: 1.25rem;
}

.auth-card .form-group label {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  display: block;
  color: var(--text-primary);
}

.auth-card .form-control {
  padding: 0.75rem 1rem;
  font-size: 0.938rem;
  border: 2px solid var(--border-color);
  transition: all 0.2s ease;
}

.auth-card .form-control:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.auth-card .btn-block {
  margin-top: 1.5rem;
  padding: 0.875rem;
  font-size: 1rem;
  font-weight: 600;
}

/* ============================================
   DASHBOARD STAT CARDS
   ============================================ */

.stat-card {
  background: white;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border-left: 3px solid var(--border-color);
  transition: all 0.2s ease;
}

.stat-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.stat-card.is-clickable {
  cursor: pointer;
}

.stat-card.is-clickable:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.stat-card-blue {
  border-left-color: var(--accent-blue);
}

.stat-card-green {
  border-left-color: var(--accent-green);
}

.stat-card-yellow {
  border-left-color: var(--accent-yellow);
}

.stat-card-red {
  border-left-color: var(--accent-red);
}

.stat-card-purple {
  border-left-color: var(--accent-purple);
}

.stat-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

/* ============================================
   QUICK ACTIONS
   ============================================ */

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  padding: 1rem;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  background: var(--bg-hover);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s;
  border: 2px solid transparent;
}

.quick-action-btn:hover {
  background: white;
  border-color: var(--accent-blue);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15);
}

.quick-action-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.quick-action-text {
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
}

/* ============================================
   RECENT TRANSFER ITEMS
   ============================================ */

.recent-transfer-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
}

.recent-transfer-item:hover {
  background: var(--bg-hover);
}

.recent-transfer-item:last-child {
  border-bottom: none;
}

.transfer-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.transfer-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ============================================
   ALERTS LIST
   ============================================ */

.alerts-list {
  max-height: 400px;
  overflow-y: auto;
}

.alert-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

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

.alert-item-warning {
  border-left: 4px solid var(--accent-yellow);
}

.alert-item-critical {
  border-left: 4px solid var(--accent-red);
}

.alert-icon {
  font-size: 1.25rem;
}

.alert-content {
  flex: 1;
}

/* ============================================
   TOP MOVERS
   ============================================ */

.top-movers-list {
  max-height: 400px;
  overflow-y: auto;
}

.top-mover-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.top-mover-item:last-child {
  border-bottom: none;
}

.top-mover-rank {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-blue-light);
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.top-mover-info {
  flex: 1;
  min-width: 0;
}

.top-mover-name {
  font-weight: 600;
  color: var(--text-primary);
}

.top-mover-meta {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: 0.2rem;
}

.top-mover-units {
  font-weight: 700;
  color: var(--accent-blue);
  white-space: nowrap;
}

/* ============================================
   PRODUCT GROUPS
   ============================================ */

.groups-list {
  max-height: 500px;
  overflow-y: auto;
}

.group-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s;
}

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

.group-item.active {
  background: #dbeafe;
  border-left: 4px solid var(--accent-blue);
}

.group-item-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.group-item-count {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.group-settings {
  background: var(--bg-hover);
  padding: 1rem;
  border-radius: 8px;
}

.group-settings h4 {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

/* ============================================
   SELECTED ITEMS
   ============================================ */

.selected-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--bg-hover);
  border-radius: 8px;
  margin-top: 0.5rem;
}

.selected-item button {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--accent-red);
  font-size: 1rem;
}

.selected-items-list h4 {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.selected-item-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--accent-light-blue);
  color: var(--accent-blue);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  margin: 0.25rem;
}

.selected-item-chip button {
  background: transparent;
  border: none;
  cursor: pointer;
  color: inherit;
  font-size: 0.9rem;
  padding: 0;
  margin-left: 0.25rem;
}

/* ============================================
   SEARCH RESULTS LIST
   ============================================ */

.search-results-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-top: 0.5rem;
}

.search-result-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.2s;
}

.search-result-row:last-child {
  border-bottom: none;
}

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

.search-result-row.selected {
  background: #dbeafe;
}

.search-result-row input[type="checkbox"] {
  flex-shrink: 0;
}

/* ============================================
   USER CELLS
   ============================================ */

.user-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
}

.pagination-info {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ============================================
   LINK STYLE
   ============================================ */

.link {
  color: var(--accent-blue);
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent-blue);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.link-button:hover {
  text-decoration: underline;
}

.row-warning {
  background-color: #f59e0b;
}

.row-status-pending {
  background-color: #fef3c7;
}

.row-status-received {
  background-color: #dbeafe;
}

.row-status-scheduled {
  background-color: #d1fae5;
}

.row-repair-new {
  background-color: #fee2e2;
}

.row-repair-service {
  background-color: #dbeafe;
}

.row-repair-ready {
  background-color: #fef3c7;
}

.table-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.5rem 1rem;
  padding: 0.5rem 0 0.75rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.table-legend-top {
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 0.75rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0;
}

.legend-swatch {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 4px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  display: inline-block;
}

.legend-backorder {
  background: #f59e0b;
  border-color: rgba(15, 23, 42, 0.12);
}

.delivery-modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.6rem;
  min-height: 0;
  height: 100%;
}

#deliveryDetailModal .modal-content.modal-lg {
  max-width: 1120px;
  height: min(92vh, 900px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#deliveryDetailModal .modal-header {
  padding: 0.75rem 1rem;
}

#deliveryDetailModal .modal-header h3 {
  font-size: 1rem;
}

#deliveryDetailModal .modal-body {
  padding: 0.75rem;
  min-height: 0;
  overflow: hidden;
  display: flex;
}

.delivery-modal-main {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.95fr);
  gap: 0.6rem;
}

.delivery-modal-col {
  min-height: 0;
  display: grid;
  gap: 0.6rem;
}

.delivery-modal-col-primary {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.delivery-modal-col-secondary {
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
}

#deliveryDetailModal .section-card {
  padding: 0.62rem 0.68rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  display: grid;
  gap: 0.42rem;
  min-height: 0;
}

#deliveryDetailModal .section-title {
  font-weight: 700;
  font-size: 0.82rem;
  color: #0f172a;
}

.delivery-hero-card {
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 52%, #eefbf6 100%);
}

.delivery-hero-header {
  display: flex;
  justify-content: space-between;
  gap: 0.55rem;
  align-items: flex-start;
}

.delivery-hero-copy {
  min-width: 0;
}

.delivery-hero-ticket {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}

.delivery-hero-customer {
  margin: 0.12rem 0 0;
  font-size: 0.8rem;
  color: #1e293b;
  font-weight: 600;
}

.delivery-hero-route {
  margin: 0.14rem 0 0;
  font-size: 0.75rem;
  color: #475569;
  line-height: 1.3;
}

.delivery-hero-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.28rem;
}

.delivery-actions-card {
  gap: 0.5rem;
}

.delivery-action-schedule-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
}

.delivery-schedule-field {
  min-width: 0;
}

.delivery-schedule-display {
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.45rem 0.58rem;
  min-height: 34px;
  display: flex;
  align-items: center;
}

#deliveryDetailModal .summary-label {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  font-weight: 700;
}

#deliveryDetailModal .summary-value {
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.3;
  color: #0f172a;
}

.delivery-notes-input {
  min-height: 72px;
  resize: none;
}

.delivery-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.34rem;
}

.delivery-action-buttons .btn {
  padding: 0.28rem 0.56rem;
  font-size: 0.73rem;
}

.delivery-summary {
  display: grid;
  gap: 0.32rem 0.55rem;
}

.delivery-summary-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#deliveryDetailModal .summary-item {
  display: grid;
  gap: 0.15rem;
  padding: 0.24rem 0.34rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.delivery-details-card {
  overflow: visible;
}

.delivery-detail-groups {
  display: grid;
  gap: 0.55rem;
}

.delivery-detail-group {
  display: grid;
  gap: 0.34rem;
  padding: 0.42rem 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.delivery-detail-group-title {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.delivery-detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.26rem 0.7rem;
}

.delivery-detail-list-grouped {
  gap: 0.22rem 0.55rem;
}

.delivery-detail-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 0.45rem;
  align-items: baseline;
  padding: 0.2rem 0;
  border-bottom: 0;
}

.delivery-detail-label {
  font-size: 0.67rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 700;
}

.delivery-detail-value {
  font-size: 0.77rem;
  color: #0f172a;
  line-height: 1.3;
  word-break: break-word;
}

.delivery-text-block {
  white-space: pre-wrap;
  line-height: 1.35;
  font-size: 0.76rem;
  color: #334155;
}

.delivery-instructions-card {
  overflow: auto;
}

.delivery-exception-block {
  border: 1px solid #fecaca;
  background: #fff1f2;
  border-radius: 9px;
  padding: 0.35rem 0.45rem;
  display: grid;
  gap: 0.22rem;
  font-size: 0.74rem;
  color: #9f1239;
}

.delivery-items-card,
.delivery-communications-card {
  min-height: 0;
}

.delivery-items-table-wrap {
  min-height: 0;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.delivery-items-card thead {
  background: #f1f5f9;
  color: #334155;
}

.delivery-items-card th {
  padding: 0.5rem 0.56rem;
  font-size: 0.65rem;
  letter-spacing: 0.03em;
}

.delivery-items-card td {
  padding: 0.46rem 0.56rem;
  font-size: 0.72rem;
  border-bottom: 1px solid #e2e8f0;
}

.delivery-item-row td {
  vertical-align: top;
}

.delivery-item-row-backorder td {
  background: #fef9c3;
}

.delivery-item-row-backorder td:first-child {
  box-shadow: inset 3px 0 0 #ca8a04;
}

.delivery-item-no strong,
.delivery-item-description strong,
.delivery-item-qty strong {
  font-weight: 800;
  color: #0f172a;
}

.delivery-item-description strong {
  line-height: 1.35;
}

.delivery-item-backorder-flag {
  display: inline-block;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #854d0e;
}

#deliveryDetailModal .note-list {
  display: grid;
  gap: 0.34rem;
}

.delivery-communications-list {
  min-height: 0;
  overflow: auto;
}

#deliveryDetailModal .note-entry {
  padding: 0.34rem 0.42rem;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.74rem;
}

#deliveryDetailModal .note-meta {
  display: flex;
  gap: 0.42rem;
  justify-content: space-between;
  align-items: center;
  font-size: 0.68rem;
  margin-bottom: 0.18rem;
}

.delivery-communication-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
}

.delivery-schedule-modal {
  position: fixed;
  inset: 0;
  z-index: 1450;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem;
}

.delivery-schedule-modal.hidden {
  display: none;
}

.delivery-schedule-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.delivery-schedule-modal-panel {
  position: relative;
  width: min(420px, 100%);
  border-radius: 14px;
  border: 1px solid #dbe4ef;
  background: #ffffff;
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.3);
  overflow: hidden;
}

.delivery-schedule-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}

.delivery-schedule-modal-header h4 {
  margin: 0;
  font-size: 0.9rem;
  color: #0f172a;
}

.delivery-schedule-modal-body {
  display: grid;
  gap: 0.65rem;
  padding: 0.75rem;
}

.delivery-schedule-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
}

#deliveryDetailModal .form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

#deliveryDetailModal .form-field {
  display: grid;
  gap: 4px;
}

#deliveryDetailModal .form-textarea {
  width: 100%;
  min-height: 88px;
}

@media (max-width: 1200px) {
  .delivery-detail-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  #deliveryDetailModal .modal-content.modal-lg {
    max-width: 100%;
    height: calc(100vh - 1rem);
    border-radius: 14px;
  }

  #deliveryDetailModal .modal-body {
    overflow: auto;
    padding: 0.55rem;
  }

  .delivery-modal {
    height: auto;
    grid-template-rows: auto auto;
  }

  .delivery-modal-main {
    grid-template-columns: 1fr;
  }

  .delivery-modal-col-primary,
  .delivery-modal-col-secondary {
    grid-template-rows: auto;
  }

  .delivery-items-table-wrap,
  .delivery-communications-list {
    max-height: 190px;
  }

  .delivery-detail-list {
    grid-template-columns: 1fr;
  }

  .delivery-detail-row {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .delivery-action-schedule-row {
    grid-template-columns: 1fr;
  }

  .delivery-action-buttons .btn {
    flex: 1 1 calc(50% - 0.34rem);
  }

  .delivery-communication-entry {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   INFO BLOCK
   ============================================ */

.info-block label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.info-block p {
  font-size: 1rem;
  font-weight: 500;
}

/* ============================================
   MT-4 UTILITY
   ============================================ */

.mt-4 {
  margin-top: 2rem;
}

/* ============================================
   CARD FOOTER
   ============================================ */

.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-hover);
  border-radius: 0 0 12px 12px;
}

/* ============================================
   TRANSFER PAGE - 2/3 + 1/3 LAYOUT
   ============================================ */

.transfer-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1200px) {
  .transfer-layout {
    grid-template-columns: 1fr;
  }
}

/* Transfer Header with Store Selector */
.transfer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.transfer-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.store-selector-inline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.store-selector-inline label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.store-selector-inline select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.875rem;
  min-width: 150px;
}

/* Category Filter Pills */
.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  padding: 0.625rem 0.75rem;
  background: #f1f5f9;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.category-pill {
  padding: 0.5rem 1rem;
  border: 2px solid #cbd5e1;
  border-radius: 20px;
  background: white;
  font-size: 0.813rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #475569;
}

.category-pill:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  background: #f8fafc;
}

.category-pill.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: white;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* Brand Filter Pills (smaller) */
.brand-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  background: #fafafa;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}

.brand-pill {
  padding: 0.25rem 0.75rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  background: white;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #475569;
}

.brand-pill:hover {
  border-color: var(--accent-purple);
  color: var(--accent-purple);
  background: #faf5ff;
}

.brand-pill.active {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
  color: white;
  box-shadow: 0 1px 3px rgba(168, 85, 247, 0.4);
}

/* Brand-specific colors */
.brand-pill[data-brand="BABYLOCK"]:hover {
  border-color: #d4af37;
  color: #b8960f;
  background: #fffbf0;
}

.brand-pill[data-brand="BABYLOCK"].active {
  background: #d4af37;
  border-color: #d4af37;
  color: white;
  box-shadow: 0 1px 3px rgba(212, 175, 55, 0.4);
}

.brand-pill[data-brand="BROTHER"]:hover {
  border-color: #1e40af;
  color: #1e40af;
  background: #eff6ff;
}

.brand-pill[data-brand="BROTHER"].active {
  background: #1e40af;
  border-color: #1e40af;
  color: white;
  box-shadow: 0 1px 3px rgba(30, 64, 175, 0.4);
}

.brand-pill[data-brand="GRACE"]:hover {
  border-color: #38bdf8;
  color: #0284c7;
  background: #f0f9ff;
}

.brand-pill[data-brand="GRACE"].active {
  background: #38bdf8;
  border-color: #38bdf8;
  color: white;
  box-shadow: 0 1px 3px rgba(56, 189, 248, 0.4);
}

.brand-pill[data-brand="JANOME"]:hover {
  border-color: #dc2626;
  color: #dc2626;
  background: #fef2f2;
}

.brand-pill[data-brand="JANOME"].active {
  background: #dc2626;
  border-color: #dc2626;
  color: white;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.4);
}

.brand-pill[data-brand="BERNINA"]:hover {
  border-color: #dc2626;
  color: #dc2626;
  background: #fef2f2;
}

.brand-pill[data-brand="BERNINA"].active {
  background: #dc2626;
  border-color: #dc2626;
  color: white;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.4);
}

.brand-pill[data-brand="BERNETTE"]:hover {
  border-color: #dc2626;
  color: #dc2626;
  background: #fef2f2;
}

.brand-pill[data-brand="BERNETTE"].active {
  background: white;
  border-color: #dc2626;
  color: #dc2626;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.4);
}

.brand-pill[data-brand="JUKI"]:hover {
  border-color: #2563eb;
  color: #2563eb;
  background: #eff6ff;
}

.brand-pill[data-brand="JUKI"].active {
  background: white;
  border-color: #2563eb;
  color: #2563eb;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.4);
}

/* Orders Page Header */
.orders-header {
  padding: 1rem 1.25rem;
  background: linear-gradient(to bottom, #fff, #f8fafc);
  border-bottom: 1px solid var(--border-color);
}

.orders-header .tab-nav {
  margin-bottom: 0.875rem;
  border-bottom: none;
  gap: 0.5rem;
  background: #e2e8f0;
  padding: 0.25rem;
  border-radius: 10px;
  width: fit-content;
}

.orders-header .tab-btn {
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  border-bottom: none;
  top: 0;
  font-weight: 500;
  font-size: 0.875rem;
  color: #64748b;
  background: transparent;
  transition: all 0.15s ease;
}

.orders-header .tab-btn:hover {
  color: #334155;
  background: rgba(255, 255, 255, 0.5);
}

.orders-header .tab-btn.active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  border-bottom: none;
}

.orders-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.orders-filters .form-control {
  flex: 0 0 auto;
}

.orders-filters input[type="text"] {
  flex: 1;
  max-width: 280px;
}

.orders-filters input[type="date"] {
  width: 140px;
}

/* Tab Toolbars (shared styles for all tab toolbars) */
.tab-toolbar,
.print-queue-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 0.875rem 1.25rem;
  background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 85px; /* Below the site header */
  z-index: 40;
  margin: -1.5rem -1.5rem 0 -1.5rem;
  width: calc(100% + 3rem);
  box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0);
  transition: box-shadow 0.2s ease;
}

.tab-toolbar.is-stuck,
.print-queue-toolbar.is-stuck {
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.15);
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.toolbar-divider {
  width: 1px;
  height: 32px;
  background: #cbd5e1;
  margin: 0 0.5rem;
}

.toolbar-search {
  position: relative;
  display: flex;
  align-items: center;
}

.toolbar-search .search-icon {
  position: absolute;
  left: 0.75rem;
  color: #94a3b8;
  pointer-events: none;
}

.toolbar-search-input {
  padding: 0.625rem 1rem 0.625rem 2.5rem;
  font-size: 0.9375rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  width: 220px;
  transition: all 0.15s ease;
}

.toolbar-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
  width: 260px;
}

.toolbar-search-input::placeholder {
  color: #94a3b8;
}

.toolbar-search .search-icon {
  width: 18px;
  height: 18px;
}

/* Toolbar-specific element sizing */
.print-queue-toolbar .btn-sm,
.tab-toolbar .btn-sm {
  padding: 0.625rem 1rem;
  font-size: 0.9375rem;
}

.print-queue-toolbar .form-control-sm,
.tab-toolbar .form-control-sm {
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
}

.print-queue-toolbar .sub-tab-btn,
.tab-toolbar .sub-tab-btn {
  padding: 0.625rem 1.125rem;
  font-size: 0.9375rem;
}

/* Outline danger button variant */
.btn-outline-danger {
  background: transparent;
  border: 1px solid #fca5a5;
  color: #dc2626;
}

.btn-outline-danger:hover {
  background: #fef2f2;
  border-color: #f87171;
}

/* Button with icon alignment */
.btn svg {
  flex-shrink: 0;
}

.btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

/* Legacy support */
.print-queue-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
}

.form-control-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.813rem;
  border-radius: 6px;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.813rem;
  border-radius: 6px;
}

.btn-ghost {
  background: transparent;
  border: 1px solid #cbd5e1;
  color: #64748b;
}

.btn-ghost:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #334155;
}

/* Pagination Controls */
.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

.pagination-info {
  font-size: 0.875rem;
  color: #64748b;
}

.pagination-buttons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pagination-page {
  font-size: 0.875rem;
  color: #475569;
  font-weight: 500;
}

.pagination-buttons .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Bulk Action Bar */
.bulk-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 1rem;
  background: linear-gradient(135deg, #dcfce7 0%, #d1fae5 100%);
  border-bottom: 1px solid #86efac;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bulk-count {
  font-weight: 600;
  color: #166534;
  font-size: 0.875rem;
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Inventory Toolbar - Search + Store Selector */
.inventory-toolbar {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
  align-items: center;
}

.inventory-search-input {
  flex: 1;
  padding: 0.625rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.875rem;
  transition: border-color 0.2s;
}

.inventory-search-input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.store-selector-compact {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.store-selector-compact label {
  font-size: 0.813rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.store-selector-compact select {
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.875rem;
  min-width: 130px;
}

/* Inventory Table - Transfer Request */
.inventory-request-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.inventory-request-table thead {
  background: var(--sidebar-bg);
  color: white;
  position: sticky;
  top: 0;
  z-index: 10;
}

.inventory-request-table th {
  padding: 0.5rem 0.625rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.inventory-request-table td {
  padding: 0.375rem 0.625rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.inventory-request-table tbody tr:hover {
  background: #f0f9ff;
}

.inventory-request-table .item-desc-cell {
  max-width: 250px;
}

.inventory-request-table .item-desc-cell .item-desc {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.938rem;
  line-height: 1.3;
}

.inventory-request-table .item-desc-cell .item-no {
  color: #9ca3af;
  font-size: 0.813rem;
  font-weight: 400;
  margin-top: 0.125rem;
}

.inventory-request-table .qty-cell {
  text-align: center;
  white-space: nowrap;
}

.inventory-request-table .qty-input {
  width: 60px;
  padding: 0.375rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  text-align: center;
  font-size: 0.875rem;
}

.inventory-request-table .notes-input {
  width: 120px;
  padding: 0.375rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.813rem;
}

.inventory-request-table .btn-add-item {
  padding: 0.375rem 0.75rem;
  background: var(--accent-green);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.inventory-request-table .btn-add-item:hover {
  background: #15803d;
}

.inventory-request-table .btn-add-item:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* Stock Level Colors */
.stock-available {
  color: var(--accent-green);
  font-weight: 600;
}

.stock-low {
  color: var(--accent-yellow);
  font-weight: 600;
}

.stock-none {
  color: var(--accent-red);
  font-weight: 600;
}

/* Sortable Column Headers */
.inventory-request-table th.sortable {
  user-select: none;
  transition: background 0.2s;
}

.inventory-request-table th.sortable:hover {
  background: rgba(255, 255, 255, 0.1);
}

.inventory-request-table th.sortable .sort-indicator {
  display: inline-block;
  margin-left: 0.25rem;
  font-size: 0.7rem;
  opacity: 0.8;
}

/* Inventory Offsets Controls */
.offsets-subtabs {
  display: flex;
  gap: 0.5rem;
  padding: 0 1rem 0.5rem;
}

.offset-subtab-btn {
  border-radius: 999px;
  padding: 0.35rem 1rem;
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
  background: white;
  transition: background 0.2s, border-color 0.2s;
}

.offset-subtab-btn.active {
  background: var(--accent-blue-light);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  box-shadow: 0 1px 3px rgba(15, 118, 255, 0.25);
}

.offset-section {
  padding: 0 1rem 1.5rem;
}

.inventory-request-table tbody tr.offset-row-dirty,
.inventory-request-table tbody tr.offset-row-applied {
  background: rgba(255, 245, 157, 0.5);
}

.inventory-request-table tbody tr.offset-row-dirty:hover,
.inventory-request-table tbody tr.offset-row-applied:hover {
  background: rgba(255, 245, 157, 0.65);
}

.offset-qty-control {
  display: inline-flex;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
  align-items: center;
}

.offset-qty-control button {
  border: none;
  background: none;
  width: 32px;
  height: 32px;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background 0.15s;
}

.offset-qty-control button:hover {
  background: rgba(15, 118, 255, 0.08);
}

.offset-qty-input {
  width: 60px;
  border: none;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.15rem 0;
  background: transparent;
}

.offset-qty-input:focus {
  outline: none;
}

.offset-qty-input.positive {
  color: var(--success-color);
}

.offset-qty-input.negative {
  color: var(--danger-color);
}

.offset-sign {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  margin-left: 0.5rem;
  font-weight: 600;
  border-radius: 6px;
  padding: 0.2rem 0.4rem;
  background: #f3f4f6;
  color: var(--text-secondary);
}

.offset-sign.positive {
  color: var(--success-color);
}

.offset-sign.negative {
  color: var(--danger-color);
}

.inventory-value-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.inventory-adjusted-label {
  display: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--danger-color);
}

.inventory-adjusted-label.visible {
  display: inline-flex;
}

.offset-report-table {
  width: 100%;
  border-collapse: collapse;
}

.offset-report-table th,
.offset-report-table td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.offset-report-table td:last-child {
  text-align: center;
}

.offset-report-table tbody tr:last-child td {
  border-bottom: none;
}

/* Inventory List Container */
.inventory-list-container {
  height: clamp(360px, calc(100vh - 320px), 760px);
  overflow-y: scroll;
  overscroll-behavior: contain;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: white;
}

/* Transfer Cart - Sticky on right */
.transfer-cart {
  position: sticky;
  top: 1rem;
}

.transfer-cart .card {
  margin-bottom: 0;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.cart-header h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.cart-count {
  background: var(--accent-blue);
  color: white;
  padding: 0.25rem 0.625rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.cart-items-list {
  max-height: 400px;
  overflow-y: auto;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  gap: 0.75rem;
}

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

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-info .item-no {
  font-weight: 400;
  font-size: 0.875rem;
  color: #9ca3af;
}

.cart-item-info .item-desc {
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 600;
  margin-top: 0.4rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-item-info .item-notes {
  font-size: 0.7rem;
  color: var(--accent-blue);
  font-style: italic;
  margin-top: 0.25rem;
}

.cart-item-qty {
  font-weight: 600;
  color: var(--accent-blue);
  white-space: nowrap;
  align-self: center;
  font-size: 1.4rem;
  line-height: 1;
  display: flex;
  align-items: center;
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--accent-red);
  cursor: pointer;
  font-size: 2rem !important;
  padding: 0.5rem;
  opacity: 0.7;
  transition: opacity 0.2s;
  line-height: 1;
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
}

.cart-item-remove:hover {
  opacity: 1;
}

.cart-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-secondary);
}

.cart-empty-icon {
  font-size: 2.5rem;
  opacity: 0.3;
  margin-bottom: 0.5rem;
}

.cart-summary {
  border-top: 2px solid var(--border-color);
  padding-top: 1rem;
  margin-top: 1rem;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.cart-summary-row.total {
  font-weight: 700;
  font-size: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

/* Notes Form */
.transfer-notes-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.transfer-notes-section label {
  display: block;
  font-size: 0.813rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.transfer-notes-section textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.813rem;
  resize: vertical;
  min-height: 60px;
}

/* ============================================
   NOTIFICATIONS
   ============================================ */

.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.notification-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.2s;
}

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

.notification-item:hover {
  background-color: var(--bg-hover);
}

.notification-unread {
  background-color: #eff6ff;
  border-left: 3px solid var(--accent-blue);
}

.notification-read {
  opacity: 0.7;
}

.notification-content {
  flex: 1;
}

.notification-title {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.notification-message {
  font-size: 0.813rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.notification-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.notification-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: 1rem;
}

.btn-xs {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 4px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  min-width: 300px;
  max-width: 400px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  pointer-events: auto;
  animation: slideIn 0.3s ease-out;
  border-left: 4px solid;
}

.toast.toast-success {
  border-left-color: var(--success-color);
}

.toast.toast-error {
  border-left-color: var(--danger-color);
}

.toast.toast-info {
  border-left-color: var(--accent-blue);
}

.toast.toast-warning {
  border-left-color: var(--warning-color);
}

.toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  line-height: 1;
}

.toast-success .toast-icon {
  color: var(--success-color);
}

.toast-error .toast-icon {
  color: var(--danger-color);
}

.toast-info .toast-icon {
  color: var(--accent-blue);
}

.toast-warning .toast-icon {
  color: var(--warning-color);
}

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

.toast-title {
  font-weight: 600;
  margin: 0 0 0.25rem 0;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.toast-message {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.4;
  word-wrap: break-word;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.2s;
}

.toast-close:hover {
  color: var(--text-primary);
}

.toast.toast-exit {
  animation: slideOut 0.3s ease-in forwards;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

@media (max-width: 768px) {
  .toast-container {
    left: 1rem;
    right: 1rem;
  }

  .toast {
    min-width: auto;
    max-width: none;
  }
}

/* Search Results Dropdown */
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  margin-top: 4px;
}

.search-result-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background-color: #f8f9fa;
}

.search-result-item strong {
  color: var(--primary-color);
  font-weight: 600;
}

.form-group {
  position: relative;
}

/* ============================================
   ACCOUNT SETTINGS STYLES
   ============================================ */

.settings-form {
  padding: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.form-help {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  margin-top: 1rem;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.form-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent-blue);
}

/* ============================================
   REPAIR SYSTEM STYLES
   ============================================ */

/* Form control large (for iPad touch targets) */
.form-control-lg {
  font-size: 1.125rem;
  padding: 0.875rem 1rem;
  min-height: 52px;
}

/* Status badges for repair system */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-received { background: #e3f2fd; color: #1565c0; }
.status-in_progress { background: #fff3e0; color: #ef6c00; }
.status-waiting_parts { background: #fce4ec; color: #c2185b; }
.status-on_hold { background: #f3e5f5; color: #7b1fa2; }
.status-ready { background: #e8f5e9; color: #2e7d32; }
.status-picked_up { background: #eceff1; color: #546e7a; }

/* Age color indicators */
.age-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.age-dot.green { background: var(--accent-green); }
.age-dot.yellow { background: var(--accent-yellow); }
.age-dot.red { background: var(--accent-red); }

/* Priority badges */
.priority-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  margin-left: 0.5rem;
}

.priority-rush {
  background: #ffebee;
  color: var(--accent-red);
}

.priority-warranty {
  background: #fff3e0;
  color: #e65100;
}

/* Success button */
.btn-success {
  background: var(--accent-green);
  color: white;
  border: none;
}

.btn-success:hover {
  background: #059669;
}

/* ============================================
   NEW CUSTOMERS PAGE STYLES
   ============================================ */

/* Toolbar (similar to print queue) */
.new-customers-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 0.875rem 1.25rem;
  background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 40;
}

.new-customers-toolbar .toolbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.new-customers-toolbar .toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.new-customers-toolbar .toolbar-search {
  position: relative;
  display: flex;
  align-items: center;
}

.new-customers-toolbar .toolbar-search-input {
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.875rem;
  width: 280px;
  background: white;
}

.new-customers-toolbar .toolbar-search-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.new-customers-toolbar .search-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--text-secondary);
  pointer-events: none;
}

/* Auto toggles */
.auto-create-toggle,
.auto-reject-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: #f1f5f9;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.2s;
  border-radius: 22px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--accent-green);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(18px);
}

.toggle-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.toggle-switch input:checked ~ .toggle-label,
.auto-create-toggle:has(input:checked) .toggle-label {
  color: var(--accent-green);
}

.auto-reject-toggle .toggle-switch input:checked + .toggle-slider {
  background-color: var(--accent-red);
}

.auto-reject-toggle:has(input:checked) .toggle-label {
  color: var(--accent-red);
}

/* Page tabs */
.page-tabs {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.page-tab {
  background: none;
  border: none;
  padding: 0.5rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.page-tab:hover {
  color: var(--text-primary);
}

.page-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent-blue);
}

.page-tab .tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 0.15rem 0.5rem;
  margin-left: 0.5rem;
  border-radius: 999px;
  background: var(--bg-dark);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
}

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.stats-row .stat-card.is-clickable {
  cursor: pointer;
}

.stats-row .stat-card.is-active {
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.18);
}

@media (max-width: 768px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Submission info card in modal */
.submission-info-card {
  background: var(--bg-dark);
  border-radius: 8px;
  padding: 1.25rem;
  border: 1px solid var(--border-color);
}

.submission-info-card h3 {
  margin-bottom: 1rem;
  font-size: 1rem;
  color: var(--text-primary);
}

.submission-info-card .info-block {
  margin-bottom: 0.75rem;
}

.submission-info-card .info-block label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.submission-info-card .info-block p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

/* Matches section */
.matches-section h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

/* Matches accordion */
.matches-accordion {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.match-item {
  border-bottom: 1px solid var(--border-color);
}

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

.match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  cursor: pointer;
  background: var(--bg-card);
  transition: background-color 0.15s ease;
}

.match-header:hover {
  background: var(--bg-dark);
}

.match-header-info {
  flex: 1;
}

.match-indicators {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.expand-indicator {
  color: var(--text-secondary);
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.match-content {
  padding: 0 1rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  background: var(--bg-dark);
}

.match-content.expanded {
  max-height: 1000px;
  padding: 1rem;
}

/* Field comparison grid */
.field-comparison-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.field-comparison {
  display: grid;
  grid-template-columns: 100px 1fr 30px 1fr;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem;
  border-radius: 4px;
  background: var(--bg-card);
}

.field-comparison.field-different {
  background: #fffbeb;
}

.field-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.field-new {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem;
  border-radius: 4px;
  font-size: 0.875rem;
}

.field-new.field-highlight {
  background: #dcfce7;
  border: 1px solid #86efac;
}

.field-arrow {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.field-existing {
  padding: 0.375rem 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.field-select-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent-green);
}

/* Match badges */
.match-badge {
  font-size: 0.65rem;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.match-badge-phone {
  background: #dbeafe;
  color: #1e40af;
}

.match-badge-email {
  background: #dcfce7;
  color: #166534;
}

.match-badge-address {
  background: #fef3c7;
  color: #92400e;
}

.match-badge-name {
  background: #f3e8ff;
  color: #6b21a8;
}

/* Status badges for submissions */
.badge-pending {
  background: #fef3c7;
  color: #92400e;
}

.badge-matched {
  background: #dbeafe;
  color: #1e40af;
}

.badge-created {
  background: #dcfce7;
  color: #166534;
}

.badge-rejected {
  background: #fee2e2;
  color: #991b1b;
}

.badge-info_update {
  background: #ede9fe;
  color: #5b21b6;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

/* Source badges */
.badge-source-api {
  background: #e0e7ff;
  color: #3730a3;
}

.badge-source-n8n-email {
  background: #fce7f3;
  color: #9d174d;
}

.badge-source-manual {
  background: #f3f4f6;
  color: #374151;
}

/* Match actions */
.match-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

/* Empty state small */
.empty-state-small {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

.empty-state-small p {
  margin: 0;
}

/* ============================================
   NEW DELIVERY WORKFLOW
   ============================================ */

.new-delivery-modal .modal-content {
  max-width: 1100px;
}

.new-delivery-mode-tabs {
  margin-bottom: 0.85rem;
}

.new-delivery-mode-tabs .tab-btn {
  flex: 1 1 0;
}

.new-delivery-top {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.new-delivery-search {
  display: grid;
  gap: 0.55rem;
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid #e6e9ef;
  background: #f8fafc;
}

.new-delivery-modal .search-bar {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.new-delivery-modal .search-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
}

.new-delivery-search-input {
  width: 100%;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.new-delivery-search-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.new-delivery-ticket-box {
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid #e6e9ef;
  background: #ffffff;
  display: grid;
  gap: 0.55rem;
}

.new-delivery-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.new-delivery-panel {
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid #e6e9ef;
  background: #f8fafc;
  display: grid;
  gap: 0.55rem;
}

.selected-customer {
  display: grid;
  gap: 0.35rem;
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid #dbe2ea;
  background: #ffffff;
}

.selected-customer-name {
  font-weight: 700;
  color: #1f2937;
}

.selected-customer-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.new-delivery-modal .search-container {
  position: relative;
}

.new-delivery-modal .autocomplete-dropdown {
  position: absolute;
  top: calc(100% - 2px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
  max-height: 320px;
  overflow-y: auto;
  z-index: 20;
  display: none;
}

.new-delivery-modal .autocomplete-dropdown.visible {
  display: block;
}

.new-delivery-modal .autocomplete-item {
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.15s ease;
}

.new-delivery-modal .autocomplete-item:last-child {
  border-bottom: none;
}

.new-delivery-modal .autocomplete-item:hover {
  background: rgba(59, 130, 246, 0.08);
}

.new-delivery-modal .autocomplete-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.new-delivery-modal .autocomplete-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.new-delivery-modal .autocomplete-no-results,
.new-delivery-modal .autocomplete-loading {
  padding: 0.85rem 0.9rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-align: center;
}

.new-delivery-modal .autocomplete-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.new-delivery-modal .autocomplete-loading .mini-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(59, 130, 246, 0.2);
  border-top-color: var(--accent-blue);
  animation: cm-spin 0.7s linear infinite;
}

.new-delivery-modal .selected-customer-badge {
  display: none;
  align-items: center;
  gap: 0.5rem;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.new-delivery-modal .selected-customer-badge.visible {
  display: flex;
}

.new-delivery-modal .selected-customer-badge .badge-name {
  font-weight: 600;
}

.new-delivery-modal .selected-customer-badge .badge-email {
  color: var(--text-secondary);
}

.new-delivery-modal .selected-customer-badge .clear-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  font-size: 1rem;
  border-radius: 4px;
}

.new-delivery-modal .selected-customer-badge .clear-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

.new-delivery-modal .quick-customer-selector-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.new-delivery-modal .quick-customer-selector-row .text-muted {
  font-size: 0.75rem;
}

.new-delivery-modal .quick-customer-picker {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0.75rem;
}

.new-delivery-modal .quick-customer-picker.hidden {
  display: none;
}

.new-delivery-modal .quick-customer-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.56);
}

.new-delivery-modal .quick-customer-picker-dialog {
  position: relative;
  width: min(560px, 100%);
  max-height: min(78vh, 620px);
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid #dbe2ea;
  background: #ffffff;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}

.new-delivery-modal .quick-customer-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid #e2e8f0;
}

.new-delivery-modal .quick-customer-picker-header h4 {
  margin: 0;
  font-size: 0.95rem;
  color: #0f172a;
}

.new-delivery-modal .quick-customer-picker-body {
  display: grid;
  gap: 0.5rem;
  padding: 0.75rem;
}

.new-delivery-modal .quick-customer-picker .autocomplete-dropdown {
  position: relative;
  top: 0;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: none;
  margin-top: 0.45rem;
  max-height: 260px;
}

.ticket-list {
  display: grid;
  gap: 0.55rem;
  max-height: 200px;
  overflow-y: auto;
}

.ticket-card {
  text-align: left;
  padding: 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.ticket-card.selected {
  border-color: #16a34a;
  background: #dcfce7;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
}

.ticket-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.ticket-title {
  font-weight: 700;
  color: #111827;
}

.ticket-doc {
  margin-left: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.ticket-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.ticket-meta {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.ticket-items {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-primary);
  opacity: 0.9;
  line-height: 1.35;
}

.ticket-badges {
  margin-top: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.ticket-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.ticket-badge-delivery {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}

.ticket-badge-existing {
  background: #fef9c3;
  color: #92400e;
  border-color: #fde68a;
}

.new-delivery-items {
  display: grid;
  gap: 0.6rem;
}

.new-delivery-item-card {
  padding: 0.65rem;
  border-radius: 12px;
  border: 1px solid #e6e9ef;
  background: #ffffff;
  display: grid;
  gap: 0.5rem;
}

.new-delivery-modal .section-title {
  font-size: 0.9rem;
}

.new-delivery-modal .form-row {
  gap: 0.55rem;
}

.new-delivery-modal .form-field {
  gap: 4px;
}

.new-delivery-modal .form-field label {
  font-size: 0.78rem;
}

.new-delivery-modal .form-control {
  padding: 0.5rem 0.7rem;
  font-size: 0.82rem;
}

.new-delivery-modal .form-textarea {
  min-height: 70px;
}

.new-delivery-modal .modal-body {
  padding: 1.1rem;
}

.quick-delivery-textarea {
  min-height: 84px;
}

.item-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: #111827;
}

.item-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: #ede9fe;
  color: #5b21b6;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.checkbox-line input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.transfer-large-view-modal {
  position: fixed;
  inset: 0;
  z-index: 2200;
  background: rgba(2, 6, 23, 0.84);
  padding: 0.65rem;
}

.transfer-large-view-shell {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  background: linear-gradient(150deg, #f8fafc 0%, #eff6ff 55%, #f0fdf4 100%);
  border: 1px solid #cbd5e1;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.45);
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  overflow: hidden;
}

.transfer-large-view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.transfer-large-view-header h2 {
  margin: 0;
  font-size: 1.2rem;
  color: #0f172a;
}

.transfer-large-view-header p {
  margin: 0.15rem 0 0;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: #475569;
}

.transfer-large-view-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 0.2rem;
  overflow: hidden;
}

.transfer-large-view-card {
  border-radius: 12px;
  border: 2px solid #dbe4ef;
  background: #f9fbff;
  padding: 0.08rem 0.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
}

.transfer-large-view-card.customer {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.transfer-large-view-card.stock {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.transfer-large-view-title-row {
  width: 100%;
  text-align: center;
  line-height: 0.94;
  overflow: hidden;
}

.transfer-large-view-description {
  display: inline;
  font-size: clamp(2.55rem, 7.7vh, 9.25rem);
  line-height: 0.92;
  font-weight: 900;
  color: #111827;
  overflow-wrap: anywhere;
}

.transfer-large-view-qty-inline {
  display: inline-flex;
  align-items: baseline;
  gap: 0.08rem;
  margin-left: 0.14rem;
  white-space: nowrap;
  vertical-align: baseline;
}

.transfer-large-view-qty-label {
  letter-spacing: 0.03em;
  font-size: clamp(1.15rem, 3.5vh, 4rem);
  font-weight: 900;
  color: #475569;
}

.transfer-large-view-qty-value {
  font-size: clamp(2.7rem, 8vh, 9.6rem);
  line-height: 0.92;
  font-weight: 900;
  color: #ff1f1f;
}

.transfer-large-view-empty {
  grid-column: 1 / -1;
  border-radius: 12px;
  border: 2px dashed #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.transfer-large-view-grid.density-medium .transfer-large-view-card {
  padding: 0.06rem 0.08rem;
}

.transfer-large-view-grid.density-medium .transfer-large-view-description {
  font-size: clamp(2.1rem, 6.25vh, 7rem);
}

.transfer-large-view-grid.density-medium .transfer-large-view-qty-value {
  font-size: clamp(2.3rem, 6.7vh, 7.4rem);
}

.transfer-large-view-grid.density-compact .transfer-large-view-card {
  padding: 0.04rem 0.06rem;
}

.transfer-large-view-grid.density-compact .transfer-large-view-description {
  font-size: clamp(1.65rem, 4.85vh, 5.55rem);
}

.transfer-large-view-grid.density-compact .transfer-large-view-qty-value {
  font-size: clamp(1.95rem, 5.35vh, 6rem);
}

.transfer-large-view-grid.density-tight .transfer-large-view-card,
.transfer-large-view-grid.density-extreme .transfer-large-view-card {
  padding: 0.02rem 0.04rem;
}

.transfer-large-view-grid.density-tight .transfer-large-view-description,
.transfer-large-view-grid.density-extreme .transfer-large-view-description {
  font-size: clamp(1.28rem, 3.7vh, 4.45rem);
}

.transfer-large-view-grid.density-tight .transfer-large-view-qty-label,
.transfer-large-view-grid.density-extreme .transfer-large-view-qty-label {
  font-size: clamp(0.82rem, 2.3vh, 2.65rem);
}

.transfer-large-view-grid.density-tight .transfer-large-view-qty-value,
.transfer-large-view-grid.density-extreme .transfer-large-view-qty-value {
  font-size: clamp(1.45rem, 4.2vh, 4.95rem);
}

@media (max-width: 1400px) {
  .transfer-large-view-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .transfer-large-view-grid {
    grid-template-columns: 1fr;
  }
}

body.transfer-large-view-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  body.picking-mode #itemsTable thead {
    display: none;
  }

  body.picking-mode #itemsTable,
  body.picking-mode #itemsTable tbody,
  body.picking-mode #itemsTable tr,
  body.picking-mode #itemsTable td {
    display: block;
    width: 100%;
  }

  body.picking-mode #itemsTable tbody tr {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
  }

  body.picking-mode #itemsTable tbody tr.section-row {
    border: none;
    background: transparent;
    margin: 1rem 0 0.5rem;
    padding: 0;
  }

  body.picking-mode #itemsTable tbody tr.section-row td {
    padding: 0.25rem 0;
    font-weight: 700;
  }

  body.picking-mode #itemsTable td {
    border-bottom: none;
    padding: 0.35rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }

  body.picking-mode #itemsTable td::before {
    content: attr(data-label);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
  }

  body.picking-mode #itemsTable td.pick-cell {
    justify-content: flex-start;
  }

  body.picking-mode #itemsTable td.actions-cell {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
}

/* ============================================
   DELIVERIES OPERATIONS BOARD
   ============================================ */

.deliveries-dashboard-shell {
  border: 1px solid #dbe4ef;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.deliveries-dashboard-header {
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(140deg, #f9fbff 0%, #f2f8ff 45%, #eef7f3 100%);
}

.deliveries-header-row {
  gap: 1rem;
}

.deliveries-header-row p {
  margin-top: 0.4rem;
}

.deliveries-control-row {
  margin-top: 1rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.deliveries-tab-nav {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.deliveries-tab-btn {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 10px;
  padding: 0.42rem 0.74rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.deliveries-tab-btn:hover {
  background: #dbeafe;
}

.deliveries-tab-btn.active {
  color: #ffffff;
  border-color: #0f766e;
  background: linear-gradient(120deg, #0f766e, #2563eb);
}

.deliveries-tab-pane {
  margin-top: 0.95rem;
}

.deliveries-focus-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.95rem;
}

.focus-pill {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.focus-pill:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.focus-pill.active {
  color: #ffffff;
  border-color: #0f766e;
  background: linear-gradient(120deg, #0f766e, #2563eb);
}

.deliveries-search-wrap {
  min-width: 280px;
  max-width: 460px;
  flex: 1;
}

.deliveries-last-updated {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: #64748b;
}

.deliveries-live-status {
  font-weight: 700;
}

.deliveries-live-status.connected {
  color: #15803d;
}

.deliveries-live-status.connecting {
  color: #b45309;
}

.deliveries-live-status.disconnected {
  color: #b91c1c;
}

.deliveries-kpi-grid {
  margin-top: 1.1rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.delivery-kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
}

.delivery-kpi-card.kpi-alert {
  border-color: #fbbf24;
  background: #fff8e6;
}

.delivery-kpi-card.kpi-warning {
  border-color: #f59e0b;
  background: #fff7ed;
}

.delivery-kpi-card.kpi-danger {
  border-color: #f87171;
  background: #fff1f2;
}

.delivery-kpi-card.kpi-good {
  border-color: #34d399;
  background: #ecfdf5;
}

.kpi-label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin: 0;
}

.kpi-value {
  margin-top: 0.3rem;
  margin-bottom: 0;
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.15;
  color: #0f172a;
}

.kpi-meta {
  margin-top: 0.2rem;
  margin-bottom: 0;
  font-size: 0.72rem;
  color: #7c2d12;
}

.delivery-calendar-card {
  margin-top: 0.1rem;
  border: 1px solid #dbe4ef;
  border-radius: 12px;
  background: #ffffff;
  padding: 0.8rem;
}

.delivery-google-panel {
  border: 1px solid #dbe4ef;
  border-radius: 12px;
  background: #f8fafc;
  padding: 0.75rem;
  margin-bottom: 0.8rem;
}

.delivery-google-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.delivery-google-header h3 {
  margin: 0;
  font-size: 0.95rem;
}

.delivery-google-status-wrap {
  display: flex;
  align-items: center;
}

.delivery-google-actions {
  margin-top: 0.55rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.delivery-google-lists {
  margin-top: 0.65rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.delivery-google-list-card {
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  background: #ffffff;
  padding: 0.55rem;
}

.delivery-google-list {
  margin-top: 0.42rem;
  display: flex;
  flex-direction: column;
  gap: 0.36rem;
  max-height: 220px;
  overflow-y: auto;
}

.delivery-google-item {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.42rem;
  background: #f8fafc;
}

.delivery-google-item-title {
  margin: 0;
  font-size: 0.73rem;
  font-weight: 700;
  color: #0f172a;
}

.delivery-google-item-meta {
  margin-top: 0.13rem;
  font-size: 0.66rem;
  color: #475569;
}

.delivery-google-item-share {
  margin-top: 0.3rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.69rem;
  color: #334155;
}

.delivery-google-item-share input[type="checkbox"] {
  transform: translateY(1px);
}

.delivery-calendar-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.delivery-calendar-toolbar h3 {
  margin: 0;
  font-size: 1rem;
}

.delivery-calendar-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.delivery-calendar-nav {
  display: flex;
  gap: 0.35rem;
}

.delivery-month-weekdays {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.3rem;
}

.delivery-month-weekdays span {
  text-align: center;
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.delivery-month-grid {
  margin-top: 0.35rem;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.3rem;
}

.delivery-month-day {
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  min-height: 96px;
  background: #ffffff;
  padding: 0.34rem;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.delivery-month-day.is-outside-month {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.delivery-month-day.is-today {
  border-color: #60a5fa;
  box-shadow: inset 0 0 0 1px #bfdbfe;
}

.delivery-month-day.is-selected {
  border-color: #0284c7;
  box-shadow: inset 0 0 0 1px #7dd3fc;
  background: #f0f9ff;
}

.delivery-month-day:focus-visible {
  outline: 2px solid #0284c7;
  outline-offset: 1px;
}

.delivery-month-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
}

.delivery-month-day-number {
  font-size: 0.75rem;
  font-weight: 700;
  color: #0f172a;
}

.delivery-month-day.is-outside-month .delivery-month-day-number {
  color: #94a3b8;
}

.delivery-month-day-count {
  font-size: 0.6rem;
  font-weight: 700;
  color: #0f766e;
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  border-radius: 999px;
  padding: 0.08rem 0.3rem;
}

.delivery-month-day-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.delivery-month-preview {
  margin: 0;
  border: 1px solid #dbe4ef;
  border-radius: 7px;
  background: #f8fafc;
  padding: 0.09rem 0.26rem;
  font-size: 0.61rem;
  line-height: 1.2;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.delivery-google-preview {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1e40af;
}

.delivery-month-more-btn {
  border: none;
  background: transparent;
  padding: 0.05rem 0;
  margin: 0;
  text-align: left;
  font-size: 0.61rem;
  font-weight: 700;
  color: #0369a1;
  cursor: pointer;
}

.delivery-month-more-btn:hover,
.delivery-month-more-btn:focus-visible {
  color: #0c4a6e;
  text-decoration: underline;
  outline: none;
}

.delivery-month-item {
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  padding: 0.26rem 0.32rem;
  background: #f8fafc;
}

.delivery-month-item.google-event {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.delivery-month-item.google-event .delivery-month-item-title {
  color: #1e3a8a;
}

.delivery-month-item.google-event .delivery-month-item-meta {
  color: #1d4ed8;
}

.delivery-month-item-title {
  margin: 0;
  font-size: 0.67rem;
  font-weight: 700;
  color: #0f172a;
}

.delivery-month-item-meta {
  margin-top: 0.12rem;
  font-size: 0.64rem;
  color: #475569;
}

.delivery-month-item-actions {
  margin-top: 0.16rem;
  display: flex;
  gap: 0.22rem;
  flex-wrap: wrap;
}

.delivery-month-more {
  margin-top: 0.1rem;
  font-size: 0.64rem;
  color: #64748b;
  font-weight: 700;
}

.delivery-calendar-unscheduled {
  margin-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
  padding-top: 0.7rem;
}

.delivery-calendar-unscheduled-list {
  margin-top: 0.45rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.delivery-calendar-unscheduled-item {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 0.45rem;
}

.delivery-calendar-unscheduled-item p {
  margin: 0;
}

.delivery-calendar-unscheduled-item.unscheduled-aging {
  border-color: #fecaca;
  background: #fff1f2;
}

.delivery-calendar-unscheduled-item .title {
  font-size: 0.73rem;
  font-weight: 700;
  color: #0f172a;
}

.delivery-calendar-unscheduled-item .meta {
  margin-top: 0.14rem;
  font-size: 0.67rem;
  color: #475569;
}

.delivery-calendar-unscheduled-item .delivery-calendar-actions {
  margin-top: 0.26rem;
}

.delivery-calendar-day {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  padding: 0.55rem;
  min-height: 140px;
}

.delivery-calendar-day h4 {
  margin: 0;
  font-size: 0.8rem;
  color: #0f172a;
}

.delivery-calendar-day .day-subtitle {
  margin-top: 0.15rem;
  margin-bottom: 0.45rem;
  font-size: 0.68rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.delivery-calendar-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.delivery-calendar-day-detail {
  margin-top: 0.72rem;
  border: 1px solid #dbe4ef;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 0.58rem;
}

.delivery-calendar-day-detail .delivery-lane-subtitle {
  margin-top: 0.16rem;
  margin-bottom: 0.5rem;
}

.delivery-calendar-day-detail .delivery-calendar-list {
  max-height: 320px;
  overflow: auto;
  padding-right: 0.1rem;
}

.delivery-calendar-item {
  border: 1px solid #dbe4ef;
  border-radius: 9px;
  background: #ffffff;
  padding: 0.45rem;
}

.delivery-calendar-item.google-event {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.delivery-calendar-item.google-event .title {
  color: #1e3a8a;
}

.delivery-calendar-item.google-event .meta {
  color: #1d4ed8;
}

.delivery-calendar-item .title {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 700;
  color: #0f172a;
}

.delivery-calendar-item .meta {
  margin-top: 0.14rem;
  font-size: 0.68rem;
  color: #475569;
}

.delivery-calendar-actions {
  margin-top: 0.34rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.btn-calendar {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 999px;
  font-size: 0.69rem;
  font-weight: 700;
  line-height: 1.3;
  padding: 0.22rem 0.6rem;
  text-decoration: none;
}

.btn-calendar:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.deliveries-board-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.delivery-lane {
  border: 1px solid #dbe4ef;
  border-radius: 12px;
  background: #ffffff;
  min-height: 240px;
  padding: 0.8rem;
}

.delivery-lane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.delivery-lane-header h3 {
  margin: 0;
  font-size: 0.95rem;
}

.delivery-lane-count {
  min-width: 28px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 0.2rem 0.48rem;
  background: #f8fafc;
}

.delivery-lane-subtitle {
  margin-top: 0.3rem;
  margin-bottom: 0.55rem;
  font-size: 0.76rem;
  color: #64748b;
}

.delivery-lane-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.delivery-lane-empty {
  border: 1px dashed #d1d5db;
  border-radius: 10px;
  padding: 0.8rem;
  text-align: center;
  color: #64748b;
  font-size: 0.78rem;
  background: #f8fafc;
}

.delivery-ticket-card {
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  padding: 0.62rem 0.68rem;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.delivery-ticket-card:hover {
  border-color: #60a5fa;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.delivery-ticket-card.unreviewed {
  border-left: 4px solid #f59e0b;
  background: #fffaf0;
}

.delivery-ticket-card.backorder {
  border-left: 4px solid #f97316;
}

.delivery-ticket-card.repair {
  border-left: 4px solid #8b5cf6;
}

.delivery-ticket-card.inter-store {
  box-shadow: inset 0 0 0 1px #facc15;
  background: #fffbeb;
}

.delivery-ticket-card.store-aging {
  border-left: 4px solid #ef4444;
  background: #fff7f7;
}

.delivery-ticket-card.unscheduled-aging {
  border-left: 4px solid #dc2626;
  box-shadow: inset 0 0 0 1px #fecdd3;
  background: #fff1f2;
}

.delivery-ticket-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.45rem;
}

.delivery-ticket-title {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
  color: #0f172a;
}

.delivery-ticket-customer {
  margin-top: 0.22rem;
  margin-bottom: 0;
  font-size: 0.78rem;
  color: #334155;
}

.delivery-ticket-route {
  margin-top: 0.18rem;
  margin-bottom: 0;
  font-size: 0.72rem;
  color: #475569;
}

.delivery-ticket-meta {
  margin-top: 0.32rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.delivery-ticket-actions {
  margin-top: 0.42rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.34rem;
}

.delivery-ticket-actions .btn {
  min-height: 30px;
  padding: 0.24rem 0.62rem;
}

.delivery-chip {
  font-size: 0.68rem;
  padding: 0.16rem 0.44rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  color: #334155;
  background: #f8fafc;
}

.delivery-chip.status-pending { border-color: #bfdbfe; color: #1d4ed8; background: #eff6ff; }
.delivery-chip.status-received { border-color: #22d3ee; color: #0e7490; background: #ecfeff; }
.delivery-chip.status-scheduled { border-color: #86efac; color: #15803d; background: #f0fdf4; }
.delivery-chip.status-out_for_delivery { border-color: #facc15; color: #854d0e; background: #fefce8; }
.delivery-chip.status-exception { border-color: #fca5a5; color: #b91c1c; background: #fff1f2; }
.delivery-chip.status-delivered { border-color: #bbf7d0; color: #166534; background: #f0fdf4; }

.delivery-chip.repair-needs_pickup { border-color: #ddd6fe; color: #6d28d9; background: #f5f3ff; }
.delivery-chip.repair-in_shop { border-color: #c4b5fd; color: #5b21b6; background: #ede9fe; }
.delivery-chip.repair-ready_for_delivery { border-color: #6ee7b7; color: #047857; background: #ecfdf5; }

.delivery-chip.reviewed { border-color: #86efac; color: #166534; background: #ecfdf5; }
.delivery-chip.unreviewed { border-color: #fcd34d; color: #92400e; background: #fffbeb; }
.delivery-chip.backorder { border-color: #fdba74; color: #9a3412; background: #fff7ed; }
.delivery-chip.source-interstore { border-color: #facc15; color: #854d0e; background: #fefce8; }
.delivery-chip.store-aging { border-color: #fca5a5; color: #b91c1c; background: #fff1f2; }
.delivery-chip.unscheduled-aging { border-color: #fca5a5; color: #b91c1c; background: #fff1f2; }

.delivery-feed-card {
  margin-top: 0.9rem;
  border: 1px solid #dbe4ef;
  border-radius: 12px;
  background: #ffffff;
  padding: 0.85rem;
}

.delivery-events-feed {
  margin-top: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 280px;
  overflow-y: auto;
}

.delivery-event {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.5rem 0.62rem;
  background: #f8fafc;
}

.delivery-event p {
  margin: 0;
}

.delivery-event .event-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #0f172a;
}

.delivery-event .event-meta {
  margin-top: 0.18rem;
  font-size: 0.72rem;
  color: #64748b;
}

.deliveries-table th:nth-child(4),
.deliveries-table td:nth-child(4),
.deliveries-table th:nth-child(7),
.deliveries-table td:nth-child(7),
.deliveries-table th:nth-child(8),
.deliveries-table td:nth-child(8) {
  white-space: nowrap;
}

.deliveries-row-priority-critical {
  background: #fff7ed;
}

.deliveries-row-priority-attention {
  background: #fffbeb;
}

.deliveries-row-priority-normal {
  background: #f8fafc;
}

.deliveries-truncation-note {
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: #64748b;
}

@media (max-width: 1320px) {
  .deliveries-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deliveries-board-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .delivery-calendar-unscheduled-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .delivery-google-lists {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .delivery-calendar-card {
    padding: 0.7rem;
  }

  .delivery-calendar-toolbar {
    gap: 0.55rem;
  }

  .delivery-calendar-toolbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .delivery-month-weekdays {
    margin-top: 0.55rem;
    gap: 0.18rem;
  }

  .delivery-month-weekdays span {
    font-size: 0.55rem;
    letter-spacing: 0.02em;
  }

  .delivery-month-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.18rem;
  }

  .delivery-month-day {
    min-height: 72px;
    border-radius: 8px;
    padding: 0.22rem;
  }

  .delivery-month-day-number {
    font-size: 0.68rem;
  }

  .delivery-month-day-count {
    font-size: 0.54rem;
    padding: 0.03rem 0.22rem;
  }

  .delivery-month-preview {
    font-size: 0.52rem;
    padding: 0.06rem 0.17rem;
  }

  .delivery-month-day-list .delivery-month-preview:nth-of-type(n+2) {
    display: none;
  }

  .delivery-month-more-btn {
    font-size: 0.54rem;
  }

  .delivery-calendar-day-detail {
    margin-top: 0.6rem;
    padding: 0.45rem;
  }

  .delivery-calendar-day-detail .delivery-calendar-list {
    max-height: 270px;
  }

  .delivery-calendar-actions .btn-calendar {
    min-height: 30px;
  }

  .delivery-calendar-unscheduled-list {
    grid-template-columns: 1fr;
  }

  .delivery-google-actions .btn {
    width: 100%;
  }

  .deliveries-board-grid {
    grid-template-columns: 1fr;
  }

  .deliveries-search-wrap {
    max-width: 100%;
    min-width: 0;
    width: 100%;
  }

  .deliveries-header-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* ============================================
   WAREHOUSE DASHBOARD
   ============================================ */

.warehouse-dashboard-mode {
  min-height: 100vh;
}

.warehouse-dashboard-mode .warehouse-dashboard-page {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0.85rem 1rem 1rem;
}

.warehouse-dashboard-mode.warehouse-dashboard-nav-hidden #sidebar {
  transform: translateX(-100%);
}

.warehouse-dashboard-mode.warehouse-dashboard-nav-hidden #main-content {
  margin-left: 0 !important;
}

.warehouse-dashboard-mode.warehouse-dashboard-nav-hidden #main-content .top-header {
  display: none;
}

.warehouse-dashboard-mode.warehouse-dashboard-nav-hidden .warehouse-dashboard-page {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.55rem 0.75rem 0.65rem;
}

.warehouse-dashboard-mode.warehouse-dashboard-nav-hidden,
.warehouse-dashboard-mode.warehouse-dashboard-nav-hidden #main-content {
  height: 100vh;
  overflow: hidden;
}

.warehouse-dashboard-mode:not(.warehouse-dashboard-nav-hidden) .warehouse-dashboard-page .page-header {
  display: none;
}

.warehouse-nav-toggle {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: 0.45rem;
  z-index: 270;
  font-size: 0.86rem;
  padding: 0.42rem 0.8rem;
}

.warehouse-dashboard-page .page-header {
  display: none;
}

.warehouse-dashboard-page .page-header h1 {
  font-size: 1.45rem;
  line-height: 1.1;
}

.warehouse-dashboard-page .page-subtitle {
  font-size: 0.86rem;
}

.warehouse-toolbar {
  margin: 0 0 0.28rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.warehouse-last-updated {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.warehouse-error {
  margin-bottom: 0.5rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid rgba(220, 38, 38, 0.3);
  background: rgba(254, 226, 226, 0.7);
  color: #991b1b;
  border-radius: 8px;
  font-weight: 600;
}

.warehouse-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.4rem;
}

.warehouse-kpi {
  background: white;
  border-radius: 10px;
  padding: 0.72rem 0.9rem;
  min-height: 124px;
  border: 2px solid var(--border-color);
}

.warehouse-kpi-email {
  border-color: #b45309;
}

.warehouse-kpi-transfers {
  border-color: #1d4ed8;
}

.warehouse-kpi-shipments {
  border-color: #0f766e;
}

.warehouse-kpi-label {
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 700;
  color: #000000;
}

.warehouse-kpi-value {
  font-size: clamp(1.9rem, 3vw, 2.7rem);
  line-height: 1;
  margin: 0.24rem 0;
  font-weight: 800;
  color: var(--text-primary);
}

.warehouse-kpi-subtext {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.warehouse-board-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.warehouse-dashboard-mode.warehouse-dashboard-nav-hidden .warehouse-board-grid {
  grid-template-rows: repeat(2, minmax(0, 1fr));
  flex: 1;
  min-height: 0;
}

.warehouse-dashboard-mode.warehouse-dashboard-nav-hidden .warehouse-large-orders-card {
  grid-row: span 2;
}

.warehouse-board-grid .card {
  margin-bottom: 0;
}

.warehouse-board-card {
  min-height: 220px;
  max-height: 300px;
  display: flex;
  flex-direction: column;
  padding: 0.6rem 0.68rem;
}

.warehouse-dashboard-mode.warehouse-dashboard-nav-hidden .warehouse-board-card {
  min-height: 0;
  max-height: none;
  height: 100%;
}

.warehouse-clickable-card {
  cursor: pointer;
  transition: box-shadow 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.warehouse-clickable-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

.warehouse-clickable-card:focus-visible {
  outline: 3px solid rgba(29, 78, 216, 0.35);
  outline-offset: 2px;
}

.warehouse-board-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.28rem;
  padding-bottom: 0.35rem;
}

.warehouse-board-card-header h2 {
  margin: 0;
  font-size: 1.08rem;
}

.warehouse-board-list {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable both-edges;
}

.warehouse-list-item {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.45rem;
  border-bottom: 1px solid var(--border-color);
}

.warehouse-list-item:last-child {
  border-bottom: none;
}

.warehouse-list-main {
  min-width: 0;
  flex: 1;
}

.warehouse-list-side {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  flex-shrink: 0;
}

.warehouse-open-order-cost {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f766e;
}

.warehouse-open-order-qty-line {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.25;
}

.warehouse-open-order-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  justify-content: flex-end;
}

.warehouse-list-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-list-meta {
  font-size: 0.88rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-board-card .badge {
  font-size: 0.72rem;
  padding: 0.2rem 0.42rem;
}

.warehouse-transfer-count {
  font-size: 1.18rem;
  font-weight: 800;
  color: #1d4ed8;
}

.warehouse-email-card .warehouse-email-note {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-align: right;
  max-width: 28ch;
}

.warehouse-empty {
  padding: 0.6rem 0.45rem;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
}

@media (max-width: 1100px) {
  .warehouse-kpi-grid {
    grid-template-columns: 1fr;
  }

  .warehouse-board-grid {
    grid-template-columns: 1fr;
  }

  .warehouse-toolbar {
    justify-content: flex-start;
  }

  .warehouse-board-card {
    min-height: 240px;
    max-height: 320px;
  }

  .warehouse-email-card .warehouse-email-note {
    text-align: left;
    max-width: 100%;
  }
}
