/* ============================================================
   ISTANBUL EKSPRES MOVE MANAGER -- style.css v28-clean
   One clean file. No duplicate rules.
   ============================================================ */

/* ============================================================
   1. CSS VARIABLES
   ============================================================ */
:root {
  --sidebar-width: 80px;
  --topbar-height: 0px;

  --color-primary: #1a2942;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-accent-light: #eff6ff;

  --color-text-primary: #111827;
  --color-text-secondary: #4b5563;
  --color-text-muted: #9ca3af;
  --color-text-inverse: #ffffff;

  --color-bg-page: #f8fafc;
  --color-bg-card: #ffffff;
  --color-bg-subtle: #f8fafc;
  --color-bg-hover: #f1f5f9;
  --color-bg-secondary: #f8fafc;

  --color-border: #e5e9ef;
  --color-border-light: #f0f4f8;
  --color-border-focus: #2563eb;

  --color-status-planned: #f97316;
  --color-status-ongoing: #eab308;
  --color-status-completed: #16a34a;
  --color-status-cancelled: #dc2626;

  --color-danger: #dc2626;
  --color-danger-light: #fef2f2;
  --color-danger-border: #fecaca;
  --color-success: #16a34a;
  --color-success-light: #f0fdf4;
  --color-success-border: #bbf7d0;

  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 12px;
  --spacing-lg: 16px;
  --spacing-xl: 24px;
  --spacing-2xl: 32px;
  --spacing-3xl: 48px;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 999px;

  --font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --font-size-xs: 11px;
  --font-size-sm: 13px;
  --font-size-base: 14px;
  --font-size-md: 15px;
  --font-size-lg: 17px;
  --font-size-xl: 20px;
  --font-size-2xl: 24px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-card-hover: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-panel: -8px 0 40px rgba(0,0,0,0.12);

  --transition-fast: 0.12s ease;
  --transition-base: 0.18s ease;

  --input-height: 38px;
  --input-height-sm: 32px;

  /* Legacy compat */
  --header-height: var(--topbar-height);
  --color-bg-tertiary: #f8fafc;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --line-height-normal: 1.5;
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 24px rgba(0,0,0,0.08);
}

/* ============================================================
   2. BASE RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  overflow: hidden;
  max-width: 100vw;
}
body {
  font-family: var(--font-family);
  background: #f8f9fb;
  margin: 0; padding: 0;
  color: var(--color-text-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

body.modal-open { overflow: hidden; }

/* ============================================================
   3. TOP BAR
   ============================================================ */

/* ============================================================
   4. APP SHELL
   ============================================================ */
.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
}

/* ============================================================
   5. SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: #f8f9fb;
  z-index: 150;
  display: flex;
  flex-direction: column;
  overflow-y: hidden;
  transition: transform var(--transition-base);
  border-right: 1px solid #e5e9ef;
}

.sidebar-nav {
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sidebar-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  padding: 10px 4px !important;
  background: transparent !important;
  border: none !important;
  border-radius: 6px !important;
  margin: 1px 6px !important;
  width: calc(100% - 12px) !important;
  color: #64748b !important;
  font-size: 10px !important;
  font-weight: 500 !important;
  cursor: pointer;
  height: auto !important;
  position: relative;
  transition: all var(--transition-fast);
  font-family: var(--font-family) !important;
  text-align: center !important;
  box-shadow: none !important;
  white-space: normal !important;
}

.sidebar-item:hover { background: #f1f5f9 !important; color: #1e293b !important; }

.sidebar-item.active {
  background: #2563eb !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

.sidebar-item.active::before { display: none; }

.sidebar-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  color: inherit;
}

.sidebar-icon svg { width: 18px; height: 18px; }
.sidebar-item.active .sidebar-icon { color: #ffffff; }

/* Sidebar logo */
.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 0 12px;
  border-bottom: 1px solid #e5e9ef;
  flex-shrink: 0;
}
.sidebar-globe {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

/* Sidebar nav grows to fill space */
.sidebar-nav {
  flex: 1;
  overflow-y: hidden;
  padding: 8px 0;
}

/* Sidebar bottom controls */
.sidebar-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px 0 16px;
  border-top: 1px solid #e5e9ef;
  flex-shrink: 0;
}

.sidebar-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-avatar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: opacity 0.12s;
  box-shadow: none;
}
.sidebar-avatar-btn:hover { opacity: 0.8; box-shadow: none; }
.sidebar-bottom-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(100% - 12px);
  height: 36px;
  background: none;
  border: none;
  border-radius: 6px;
  color: #64748b;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  box-shadow: none;
  padding: 0;
  margin: 0 6px;
}
.sidebar-bottom-icon-btn:hover { background: #f1f5f9; color: #1e293b; box-shadow: none; }

/* Settings Modal */
.settings-modal-section { padding: 16px 22px; border-bottom: 1px solid var(--color-border); }
.settings-modal-section:last-child { border-bottom: none; }
.settings-section-title { font-size: 10px; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 12px; }
.settings-field { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.settings-field-label { color: var(--color-text-secondary); font-size: 12px; flex-shrink: 0; }
.settings-field-value { color: var(--color-text-primary); font-weight: 500; font-size: 13px; }
.settings-lang-toggle { display: flex; border: 1px solid var(--color-border); border-radius: var(--radius-sm); overflow: hidden; }
.settings-lang-opt { padding: 5px 16px; font-size: 12px; font-weight: 500; background: none; border: none; cursor: pointer; color: var(--color-text-secondary); height: auto; box-shadow: none; border-radius: 0; transition: background 0.1s; }
.settings-lang-opt:hover { background: var(--color-bg-subtle); box-shadow: none; }
.settings-lang-opt.active { background: var(--color-accent); color: #fff; font-weight: 600; }
.settings-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--color-accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; flex-shrink: 0; }
.settings-user-row { display: flex; align-items: center; gap: 12px; padding: 4px 0 12px; }
.settings-user-details { flex: 1; }
.settings-user-name { font-size: 15px; font-weight: 600; color: var(--color-text-primary); }
.settings-user-email { font-size: 12px; color: var(--color-text-secondary); margin-top: 2px; }
.settings-user-tag { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: var(--color-bg-subtle); color: var(--color-text-secondary); border: 1px solid var(--color-border); text-transform: capitalize; margin-top: 4px; display: inline-block; }
.settings-user-tag.role-admin { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
.settings-user-tag.role-operations { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }

.settings-admin-role-select { font-size: 12px; padding: 3px 8px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: #fff; color: var(--color-text-primary); cursor: pointer; }

.sidebar-label {
  font-size: 10px;
  letter-spacing: 0;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 68px;
}

/* ============================================================
   6. MAIN CONTENT
   ============================================================ */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  height: 100vh;
  background: #f8f9fb;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  z-index: 1;
}

/* ============================================================
   7. VIEW CONTAINERS
   ============================================================ */
.view-container {
  padding: 24px 28px;
  min-height: calc(100vh - var(--topbar-height));
  background: #f8f9fb;
}
.view-container.dashboard-view {
  padding: 20px 24px;
  min-height: unset;
  overflow: hidden;
}
.view-container.hidden { display: none; }

/* ============================================================
   8. LIST VIEW HEADER
   ============================================================ */
.list-view-header { margin-bottom: 16px; }

.list-view-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.view-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -0.3px;
}

/* Primary action button (New Move, Add Agent, etc.) */
.btn-primary-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 16px;
  height: 34px;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-family);
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.btn-primary-action:hover { background: var(--color-accent-hover); color: #fff; border: none; box-shadow: 0 2px 8px rgba(37,99,235,0.3); }

/* Filter bar */
.list-view-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 8px 14px;
  box-shadow: var(--shadow-sm);
}

.filter-search-left {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  order: 2;
  justify-content: flex-end;
}
.filter-search-left .search-input-wrap {
  width: 100%;
  max-width: 320px;
}
.filter-dropdowns-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  order: 1;
}
.filter-dropdown-wrap + select { display: none !important; }

/* Search inputs */
.list-search-input,
#searchInput, #agentSearchInput, #documentsSearchInput,
#quoteSearchInput, #storageSearchInput {
  height: 30px;
  padding: 0 10px 0 28px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 12px;
  background: var(--color-bg-subtle);
  color: var(--color-text-primary);
  font-family: var(--font-family);
  min-width: 200px;
  width: 100%;
  flex: 1;
  transition: all var(--transition-fast);
}
.list-search-input:focus, #searchInput:focus, #agentSearchInput:focus,
#documentsSearchInput:focus, #quoteSearchInput:focus, #storageSearchInput:focus {
  outline: none;
  border-color: var(--color-border-focus);
  background: #fff;
}
/* Search icon wrapper */
.search-input-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 1;
  min-width: 200px;
}
.search-input-wrap svg {
  position: absolute;
  left: 9px;
  pointer-events: none;
  flex-shrink: 0;
}

/* Filter buttons */
.filter-btn {
  height: 28px;
  padding: 0 12px;
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-family);
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.filter-btn:hover { background: var(--color-bg-hover); color: var(--color-text-primary); }
.filter-btn.active { color: #fff; border-color: transparent; font-weight: 600; }
.filter-btn[data-status="All"].active    { background: #2563eb; }
.filter-btn[data-status="Planned"].active  { background: #f97316; }
.filter-btn[data-status="Ongoing"].active  { background: #eab308; }
.filter-btn[data-status="Completed"].active { background: #16a34a; }
.filter-btn[data-status="Cancelled"].active { background: #dc2626; }

/* Hide native selects -- replaced by custom dropdown buttons */
.list-view-filters select,

/* Custom filter dropdown button */
.filter-dropdown-wrap { position: relative; }
.filter-dropdown-btn {
  height: 28px;
  padding: 0 10px;
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-family);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.filter-dropdown-btn:hover { background: var(--color-bg-hover); color: var(--color-text-primary); }
.filter-dropdown-btn.active {
  background: #eff6ff;
  border-color: #2563eb;
  color: #2563eb;
  font-weight: 600;
}
.filter-dropdown-menu {
  display: none;
  position: fixed;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  z-index: 300;
  min-width: 140px;
  overflow: hidden;
}
.filter-dropdown-menu.open { display: block; }
.filter-dropdown-opt {
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font-family);
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.filter-dropdown-opt:hover { background: var(--color-bg-subtle); }
.filter-dropdown-opt.selected { font-weight: 600; color: #2563eb; }

/* Search inputs grow to fill space */

/* ============================================================
   9. SUB-TAB BUTTONS (Agents/Brokers, Documents Search/Library)
      -- ONE definition, used everywhere
   ============================================================ */
.agent-type-tab,

/* ============================================================
   10. LIST BODY + COLUMN HEADER
   ============================================================ */
.list-body {
  background: transparent;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Column header row above list */

/* ============================================================
   11. DATA TABLE -- used by Moves, Quotes, Agents, Storage
   ============================================================ */

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid #e5e9ef;
}

.data-table thead tr {
  background: #f8fafc;
  border-bottom: 2px solid #e5e9ef;
}
.data-table thead th {
  background: #f8fafc;
}

.data-table th {
  padding: 10px 14px;
  font-size: 10px;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
}

.data-table tbody tr {
  border-bottom: 1px solid #e9ecef;
  cursor: pointer;
  transition: background 0.1s;
}

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

.data-table tbody tr:hover {
  background: #f0f4ff;
  border-left-color: #2563eb;
}

.data-table tbody tr.selected {
  background: #fff;
}

.data-table td {
  padding: 15px 14px;
  font-size: 13px;
  color: #374151;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Status cell -- never clip the badge */
.data-table td:nth-child(4) {
  overflow: visible;
}

/* Mode cell -- single line, never clip */
.data-table td:nth-child(5) {
  white-space: nowrap;
  overflow: visible;
}

.data-table td:nth-child(5) .mode-badge {
  margin-right: 3px;
}

/* Mode badges inline */
.data-table td .mode-badge + .mode-badge {
  margin-left: 4px;
}

/* Client column -- name truncates, tag stays inside */
.data-table td:first-child {
  overflow: hidden;
  max-width: 0;
}

.data-table td:first-child > div {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  overflow: hidden;
}

.data-table td:first-child .job-card-client,
.data-table td:first-child .quote-card-client,
.data-table td:first-child .row-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

.data-table td .job-card-tag {
  flex-shrink: 0;
  max-width: 100px;
}

/* -- TEXT ELEMENTS (shared) -- */
.row-name {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-sub {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

/* -- BADGES -- */
.status-label {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  border: 1px solid;
  white-space: nowrap;
}
.status-Planned   { color: #f97316; border-color: #f97316; background: #fff7ed; }
.status-Ongoing   { color: #eab308; border-color: #eab308; background: #fefce8; }
.status-Completed { color: #16a34a; border-color: #16a34a; background: #f0fdf4; }
.status-Cancelled { color: #dc2626; border-color: #dc2626; background: #fef2f2; }
.status-Draft     { color: #f97316; border-color: #f97316; background: #fff7ed; }
.status-Sent      { color: #eab308; border-color: #eab308; background: #fefce8; }
.status-Booked    { color: #16a34a; border-color: #16a34a; background: #f0fdf4; }
.status-Rejected  { color: #dc2626; border-color: #dc2626; background: #fef2f2; }
.status-Expired   { color: #6b7280; border-color: #d1d5db; background: #f3f4f6; }
.status-InStorage { color: #2563eb; border-color: #2563eb; background: #eff6ff; }
.status-Released  { color: #6b7280; border-color: #9ca3af; background: #f9fafb; }

.mode-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 400;
  color: #4b5563;
  white-space: nowrap;
}

/* Keep old class names working */
.job-card-tag { display: inline-flex; align-items: center; padding: 2px 7px; background: #7c3aed; color: #fff; border-radius: var(--radius-full); font-size: 10px; font-weight: 600; letter-spacing: 0.3px; text-transform: uppercase; white-space: nowrap; }
.job-card-paid   { font-size: 11px; font-weight: 600; color: #16a34a; white-space: nowrap; }
.job-card-unpaid { font-size: 11px; font-weight: 600; color: #dc2626; white-space: nowrap; }
.job-card-code   { font-size: 11px; color: #9ca3af; font-weight: 500; font-family: ui-monospace, monospace; white-space: nowrap; }
.job-card-client { font-size: 14px; font-weight: 600; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-card-route  { font-size: 12px; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; }
.job-card-type   { font-size: 12px; color: #6b7280; }
.quote-card-client { font-size: 14px; font-weight: 600; color: #111827; }
.quote-card-code   { font-size: 11px; color: #9ca3af; font-weight: 500; font-family: ui-monospace, monospace; white-space: nowrap; }
.quote-card-route  { font-size: 12px; color: #6b7280; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Active/Status badges in storage */

/* Membership badges */
.membership-badge { display: inline-flex; padding: 2px 7px; border-radius: var(--radius-sm); font-size: 10px; font-weight: 600; margin-right: 4px; }
.membership-badge:last-child { margin-right: 0; }
.membership-FIDI { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.membership-IAM  { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* ============================================================
   12. DETAIL PANEL (slide-in overlay)
   ============================================================ */
.detail-panel-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.2);
  z-index: 300;
  opacity: 0;
  transition: opacity var(--transition-base);
}
.detail-panel-backdrop.visible { opacity: 1; }
.detail-panel-backdrop.hidden { display: none; }

.detail-panel {
  position: fixed;
  top: var(--topbar-height); right: 0; bottom: 0;
  width: 84%;
  background: #fff;
  z-index: 400;
  box-shadow: var(--shadow-panel);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  visibility: hidden;
  pointer-events: none;
}

.detail-panel.open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.detail-panel.hidden {
  transform: translateX(100%);
  visibility: hidden;
  pointer-events: none;
}

.detail-panel-inner {
  flex: 1;
  overflow-y: auto;
  padding: 28px 28px 28px 28px;
  position: relative;
}

.detail-panel-close {
  position: absolute;
  top: 20px; right: 20px;
  width: 32px; height: 32px; padding: 0;
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
  transition: all var(--transition-fast);
}
.detail-panel-close:hover { background: #fee2e2; border-color: #dc2626; color: #dc2626; }

/* ============================================================
   13. DETAIL PANEL CONTENT STYLES
   ============================================================ */
.details-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.details-card-title {
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin: 0 0 14px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f4f8;
}

.details-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
}

.detail-item { display: flex; flex-direction: column; gap: 3px; }
.detail-label { font-size: 10px; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.detail-value { font-size: 13px; color: #111827; font-weight: 500; }
.detail-value-link { font-size: 13px; color: var(--color-accent); font-weight: 500; text-decoration: underline; cursor: pointer; }
.detail-value-link:hover { color: var(--color-accent-hover); }

.details-section { margin-bottom: 20px; }
.details-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.details-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  margin: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f4f8;
  width: 100%;
}

/* h4 inside detail panel */
.detail-panel-inner h4 {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  margin: 20px 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f4f8;
  letter-spacing: 0;
  text-transform: none;
}

.move-details-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.move-details-header h3 { margin: 0; font-size: 18px; font-weight: 700; color: #111827; }
.move-status-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

/* Detail page header badges */
.status-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; border: 1.5px solid currentColor; }
.status-badge.planned   { color: #f97316; background: #fff7ed; }
.status-badge.ongoing   { color: #eab308; background: #fefce8; }
.status-badge.completed { color: #16a34a; background: #f0fdf4; }
.status-badge.cancelled { color: #dc2626; background: #fef2f2; }

.payment-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.payment-badge.paid   { color: #16a34a; background: #f0fdf4; border: 1.5px solid #16a34a; }
.payment-badge.unpaid { color: #dc2626; background: #fef2f2; border: 1.5px solid #dc2626; }

.type-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 500; background: #f3f4f6; border: 1.5px solid #e5e7eb; color: #374151; }

/* ============================================================
   MOVE WIZARD
   ============================================================ */
.wizard-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 660px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  position: relative;
  border: 1px solid var(--color-border);
  box-shadow: 0 20px 40px rgba(0,0,0,0.18);
  overflow: hidden;
}

.wizard-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
}

.wizard-header {
  padding: 24px 56px 0 28px;
  flex-shrink: 0;
}

.wizard-step-bar {
  margin-bottom: 24px;
  padding-top: 18px;
}

.wizard-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  font-family: var(--font-family);
  transition: all 0.2s;
}
.wizard-step-num.done { background: var(--color-accent); color: #fff; }
.wizard-step-num.active { background: var(--color-accent); color: #fff; outline: 3px solid var(--color-accent-light); outline-offset: 1px; }
.wizard-step-num.todo { background: var(--color-bg-subtle); color: var(--color-text-secondary); border: 1px solid var(--color-border); }

.wizard-step-line {
  flex: 1;
  height: 1px;
  background: var(--color-border);
  margin: 0 8px;
}
.wizard-step-line.done { background: var(--color-accent); }

.wizard-body {
  padding: 0 28px 24px;
  overflow-y: auto;
  flex: 1;
}

.wizard-step-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 4px;
  font-family: var(--font-family);
}

.wizard-step-subtitle {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
  font-family: var(--font-family);
}

.wizard-optional {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-left: 5px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.wizard-section {
  padding: 18px 0;
  border-bottom: 1px solid var(--color-border-light);
}
.wizard-section:first-of-type { padding-top: 0; }
.wizard-section:last-of-type { border-bottom: none; padding-bottom: 0; }

.wizard-field-label {
  font-size: 11px;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 7px;
  font-family: var(--font-family);
  display: block;
}

.wizard-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.wizard-toggle-grid { display: grid; gap: 8px; }
.wizard-toggle-grid.c2 { grid-template-columns: 1fr 1fr; }
.wizard-toggle-grid.c3 { grid-template-columns: 1fr 1fr 1fr; }

.wizard-toggle-btn {
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-card);
  cursor: pointer;
  text-align: center;
  transition: all 0.12s;
  color: var(--color-text-primary);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-family);
  width: 100%;
}
.wizard-toggle-btn:hover { background: var(--color-bg-subtle); border-color: var(--color-accent); }
.wizard-toggle-btn.selected { border: 2px solid var(--color-accent); background: var(--color-accent); color: #fff; font-weight: 600; }

.wizard-footer {
  padding: 14px 28px;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-bg-subtle);
  flex-shrink: 0;
  gap: 8px;
}

.wizard-footer-right { display: flex; gap: 8px; align-items: center; }

.wizard-btn-back {
  font-size: 13px;
  color: var(--color-text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 4px;
  height: 34px;
  font-family: var(--font-family);
}
.wizard-btn-back:hover { color: var(--color-text-primary); }

.wizard-btn-skip {
  height: 34px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-family);
  transition: all var(--transition-fast);
}
.wizard-btn-skip:hover { border-color: var(--color-accent); color: var(--color-accent); }

.wizard-btn-continue {
  height: 34px;
  padding: 0 20px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--color-accent);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-family);
  transition: all var(--transition-fast);
  min-width: 120px;
}
.wizard-btn-continue:hover { background: var(--color-accent-hover); box-shadow: 0 2px 8px rgba(37,99,235,0.3); }

/* Wizard step cards (move steps) */
.wizard-step-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 8px;
  background: var(--color-bg-card);
  display: flex;
  align-items: center;
  gap: 12px;
}
.wizard-step-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--color-border);
}
.wizard-step-card-icon { font-size: 16px; }
.wizard-step-card-body { flex: 1; }

.wizard-step-card-date { font-size: 13px; font-weight: 600; color: var(--color-text-primary); font-family: var(--font-family); }

.wizard-add-step-btn {
  width: 100%;
  padding: 11px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-align: center;
  margin-top: 4px;
  font-family: var(--font-family);
  transition: all 0.12s;
}
.wizard-add-step-btn:hover { background: var(--color-bg-subtle); color: var(--color-accent); border-color: var(--color-accent); }

.wizard-add-step-form {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 8px;
  background: var(--color-bg-subtle);
}

/* ============================================================
   OVERVIEW TAB v2
   ============================================================ */
.ov-wrap { max-width: 1400px; width: 100%; }

.ov-3col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.ov-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.ov-full { margin-bottom: 12px; }

/* Card base */
.ov-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.ov-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  border-bottom: 1px solid var(--color-border-light);
}
.ov-card-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.ov-card-edit {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0;
  font-family: var(--font-family);
}
.ov-card-edit:hover { color: var(--color-accent-hover); }

/* Schedule office filter dropdown */
.schedule-office-select {
  width: auto;
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-family: var(--font-family);
  background: #fff;
  color: var(--color-text-primary);
}
#scheduleDayView {
  background: #f8f9fb;
}
#scheduleDayView .step-card-v2 {
  background: #ffffff;
  border: 1px solid var(--color-border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}
#scheduleDayView .step-card-v2.completed {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

/* Agents/Brokers subtabs */
.agents-subtabs,
.documents-subtabs {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #e5e9ef;
  margin-bottom: -9px;
  padding-bottom: 0;
}
.agents-subtabs .detail-tab-btn,
.documents-subtabs .detail-tab-btn {
  font-size: 13px;
}

/* Tag toggle buttons in job form */
.tag-toggle-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.tag-toggle-btn {
  padding: 4px 12px;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  background: #fff;
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-family);
  transition: all var(--transition-fast);
}
.tag-toggle-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }
.tag-toggle-btn.selected { background: var(--color-accent); border-color: var(--color-accent); color: #fff; font-weight: 600; }
.ov-card-body { padding: 14px 18px; }

/* Section dividers inside cards */
.ov-section { padding: 10px 0; border-bottom: 1px solid var(--color-border-light); }
.ov-section:first-child { padding-top: 0; }
.ov-section:last-child { border-bottom: none; padding-bottom: 0; }

/* Field grid */
.ov-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; }
.ov-grid-1 { display: grid; grid-template-columns: 1fr; gap: 10px; }
.ov-field { display: flex; flex-direction: column; gap: 3px; }
.ov-label { font-size: 10px; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.ov-value { font-size: 13px; color: var(--color-text-primary); font-weight: 500; }

/* Route */
.ov-route-row { display: flex; align-items: stretch; gap: 10px; }
.ov-route-point { flex: 1; background: var(--color-bg-subtle); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 10px 14px; }
.ov-route-label { font-size: 10px; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; margin-bottom: 4px; }
.ov-route-city { font-size: 13px; font-weight: 600; color: var(--color-text-primary); }
.ov-route-detail { font-size: 11px; color: var(--color-text-secondary); margin-top: 2px; }
.ov-route-arrow { display: flex; align-items: center; color: #9ca3af; font-size: 16px; flex-shrink: 0; }

/* Agent/broker boxes */
.ov-agents-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ov-agent-box { background: var(--color-bg-subtle); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 10px 12px; }
.ov-agent-role { font-size: 10px; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 3px; }
.ov-agent-name { font-size: 12px; font-weight: 600; color: var(--color-text-primary); }
.ov-agent-loc { font-size: 11px; color: var(--color-text-secondary); margin-top: 1px; }

/* Freight cards */
.ov-freight-card { border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.ov-freight-header { display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; }
.ov-freight-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; }
.ov-freight-body { padding: 0 18px 14px; }
.ov-freight-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.ov-freight-row { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid rgba(0,0,0,0.07); }
.ov-freight-row:last-child { border-bottom: none; }
.ov-freight-label { font-size: 11px; color: #4b5563; }
.ov-freight-value { font-size: 11px; font-weight: 600; color: var(--color-text-primary); }

.ov-freight-card.sea { background: #e0f2fe; border: 1px solid #7dd3fc; }
.ov-freight-card.sea .ov-freight-header { border-bottom: 1px solid #7dd3fc; }
.ov-freight-card.sea .ov-freight-title { color: #0369a1; }
.ov-freight-card.sea .ov-card-edit { color: #0369a1; }
.ov-freight-card.sea .ov-freight-row { border-bottom-color: rgba(3,105,161,0.1); }

.ov-freight-card.air { background: #ede9fe; border: 1px solid #a78bfa; }
.ov-freight-card.air .ov-freight-header { border-bottom: 1px solid #a78bfa; }
.ov-freight-card.air .ov-freight-title { color: #6d28d9; }
.ov-freight-card.air .ov-card-edit { color: #6d28d9; }
.ov-freight-card.air .ov-freight-row { border-bottom-color: rgba(109,40,217,0.1); }

.ov-freight-card.land { background: #d1fae5; border: 1px solid #6ee7b7; }
.ov-freight-card.land .ov-freight-header { border-bottom: 1px solid #6ee7b7; }
.ov-freight-card.land .ov-freight-title { color: #047857; }
.ov-freight-card.land .ov-card-edit { color: #047857; }
.ov-freight-card.land .ov-freight-row { border-bottom-color: rgba(4,120,87,0.1); }

/* Vehicles */
.ov-vehicles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.ov-vehicle-card { background: var(--color-bg-subtle); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 10px 12px; }
.ov-vehicle-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.ov-vehicle-num { font-size: 12px; font-weight: 600; color: var(--color-text-primary); }
.ov-vehicle-mode { font-size: 10px; background: var(--color-accent-light); color: var(--color-accent); padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.ov-vehicle-row { display: flex; justify-content: space-between; margin-bottom: 3px; }
.ov-vehicle-label { font-size: 10px; color: #9ca3af; text-transform: uppercase; }
.ov-vehicle-value { font-size: 11px; color: var(--color-text-primary); font-weight: 500; }

/* Responsive */
@media (max-width: 1100px) {
  .ov-3col { grid-template-columns: 1fr 1fr; }
  .ov-3col > *:last-child { grid-column: span 2; }
}
@media (max-width: 800px) {
  .ov-3col, .ov-2col { grid-template-columns: 1fr; }
  .ov-3col > *:last-child { grid-column: span 1; }
}

/* -- Searchable dropdown ------------------------------ */
.ov-search-dropdown { position: relative; }
.ov-search-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-family: var(--font-family);
  background: var(--color-bg-card);
  color: var(--color-text-primary);
}
.ov-search-input:focus { outline: none; border-color: var(--color-accent); }
.ov-search-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  max-height: 220px;
  overflow-y: auto;
  z-index: 300;
}
.ov-search-item {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--color-text-primary);
  cursor: pointer;
  font-family: var(--font-family);
}
.ov-search-item:hover { background: var(--color-bg-subtle); }
.ov-search-item.selected { background: var(--color-accent-light); color: var(--color-accent); font-weight: 600; }
.ov-search-item-sub { font-size: 11px; color: var(--color-text-secondary); margin-top: 1px; }
.ov-search-empty { padding: 10px 12px; font-size: 13px; color: var(--color-text-secondary); font-style: italic; }

/* -- Overview edit modal ------------------------------ */
.ov-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 10003;
}
.ov-modal {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: 0 20px 40px rgba(0,0,0,0.18);
  width: 100%;
  max-width: 580px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ov-modal.wide { max-width: 780px; }
.ov-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.ov-modal-title { font-size: 15px; font-weight: 600; color: var(--color-text-primary); font-family: var(--font-family); }
.ov-modal-close { background: none; border: none; cursor: pointer; font-size: 18px; color: var(--color-text-secondary); font-family: var(--font-family); padding: 0 4px; }
.ov-modal-close:hover { color: var(--color-text-primary); }
.ov-modal-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.ov-modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--color-border);
  display: flex; justify-content: flex-end; gap: 8px;
  background: var(--color-bg-subtle);
  flex-shrink: 0;
}
.ov-modal-section { margin-bottom: 18px; }
.ov-modal-section:last-child { margin-bottom: 0; }
.ov-modal-section-title {
  font-size: 11px; font-weight: 700; color: var(--color-text-secondary);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border-light);
}
.ov-modal-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ov-modal-field { display: flex; flex-direction: column; gap: 5px; }
.ov-modal-label { font-size: 11px; font-weight: 600; color: var(--color-text-secondary); text-transform: uppercase; letter-spacing: 0.4px; font-family: var(--font-family); }
.ov-modal-field input,
.ov-modal-field select,
.ov-modal-field textarea {
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-family: var(--font-family);
  color: var(--color-text-primary);
  background: var(--color-bg-card);
  width: 100%;
}
.ov-modal-field textarea { min-height: 72px; resize: vertical; }
.ov-modal-field input:focus,
.ov-modal-field select:focus,
.ov-modal-field textarea:focus { outline: none; border-color: var(--color-accent); }

/* Force 24h time display on all time inputs */
input[type="time"]::-webkit-datetime-edit-ampm-field { display: none; }
input[type="time"] { -webkit-appearance: none; }

/* Step card three-level hierarchy */
.wizard-step-card-detail {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-top: 2px;
  font-family: var(--font-family);
}
.wizard-step-card-notes {
  font-size: 11px;
  font-weight: 400;
  color: #9ca3af;
  margin-top: 2px;
  font-style: italic;
  font-family: var(--font-family);
}

/* ============================================================
   STEPS TAB v2
   ============================================================ */

/* Progress bar -- single continuous bar */
.steps-progress-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding: 14px 18px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.steps-progress-track {
  flex: 1;
  height: 6px;
  background: var(--color-border-light);
  border-radius: 3px;
  overflow: hidden;
}
.steps-progress-fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.steps-progress-fill.complete { background: #10b981; }
.steps-progress-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  white-space: nowrap;
  font-family: var(--font-family);
}
.steps-progress-fraction {
  font-size: 12px;
  color: var(--color-text-secondary);
  font-family: var(--font-family);
}

/* Step card v2 */
.step-card-v2 {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: border-color 0.15s;
  overflow: hidden;
}
.step-card-v2.completed {
  border-color: #a7f3d0;
  background: #f0fdf4;
}
.step-card-v2.scheduled {
  border-color: #bfdbfe;
}

.step-card-v2-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

/* Checkbox toggle */

/* Step content */
.step-card-v2-content { flex: 1; min-width: 0; }
.step-card-v2-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  font-family: var(--font-family);
  margin-bottom: 2px;
}
.step-card-v2.completed .step-card-v2-title {
  color: var(--color-text-secondary);
}
.step-card-v2-meta {
  font-size: 11px;
  color: var(--color-text-secondary);
  font-family: var(--font-family);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.step-card-v2-meta span { display: inline-flex; align-items: center; gap: 3px; }

/* Actions */
.step-card-v2-actions { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }
.step-action-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
  font-family: var(--font-family);
}
.step-action-btn:hover { background: var(--color-bg-subtle); border-color: var(--color-accent); }
.step-action-btn.danger:hover { background: #fef2f2; border-color: #fca5a5; }

/* Add step button */
.step-add-btn {
  width: 100%;
  padding: 12px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-align: center;
  font-family: var(--font-family);
  transition: all 0.12s;
  margin-top: 4px;
}
.step-add-btn:hover { background: var(--color-bg-subtle); color: var(--color-accent); border-color: var(--color-accent); }

/* ============================================================
   BILLING TAB
   ============================================================ */

.tab-indicator-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #f97316; vertical-align: middle; margin-left: 4px; position: relative; top: -1px; }

/* ============================================================
   14. DASHBOARD
   ============================================================ */
.dashboard-view {
  padding: 20px 24px;
  height: calc(100vh - var(--topbar-height));
  max-height: calc(100vh - var(--topbar-height));
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dashboard-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

@media (max-width: 1100px) {
  
  
}
@media (max-width: 768px) {
  
  
}

/* ============================================================
   NEW DASHBOARD REDESIGN
   ============================================================ */

/* KPI Cards Row */
.db-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.db-kpi-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  transition: box-shadow 0.12s, border-color 0.12s;
  position: relative;
  overflow: hidden;
}
.db-kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--db-kpi-color, var(--color-border));
}
.db-kpi-card:hover { box-shadow: var(--shadow-md); border-color: #d1d5db; }
.db-kpi-number {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1;
  letter-spacing: -0.5px;
}
.db-kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.db-kpi-sub {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.db-kpi-card.db-kpi-orange { --db-kpi-color: #f97316; }
.db-kpi-card.db-kpi-orange .db-kpi-number { color: #ea580c; }
.db-kpi-card.db-kpi-yellow { --db-kpi-color: #eab308; }
.db-kpi-card.db-kpi-yellow .db-kpi-number { color: #ca8a04; }
.db-kpi-card.db-kpi-green { --db-kpi-color: #16a34a; }
.db-kpi-card.db-kpi-green .db-kpi-number { color: #16a34a; }
.db-kpi-card.db-kpi-neutral { --db-kpi-color: #6b7280; }
.db-kpi-card.db-kpi-neutral .db-kpi-number { color: #374151; }

.wizard-pill-btn {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-card);
  color: var(--color-text-secondary);
  font-size: 13px;
  font-family: var(--font-family);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.wizard-pill-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }
.wizard-pill-btn.selected { background: var(--color-accent); border-color: var(--color-accent); color: #fff; font-weight: 600; }

/* Main dashboard grid */
.db-main-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  flex: 2;
  min-height: 0;
}

/* Bottom grid */
.db-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

/* Section cards */
.db-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.db-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px 11px;
  border-bottom: 1px solid var(--color-border);
  background: #fafbfc;
  flex-shrink: 0;
}
.db-card-title {
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.db-card-badge {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: #ef4444;
  border-radius: 10px;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
}
.db-card-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* Agenda rows */
.db-date-header {
  font-size: 11px;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 16px 4px;
  background: #f9fafb;
  border-bottom: 1px solid #f0f4f8;
  position: sticky;
  top: 0;
  z-index: 1;
}
.db-date-header.db-today {
  color: #2563eb;
  background: #eff6ff;
}
.db-agenda-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border-bottom: 1px solid #f9fafb;
  cursor: pointer;
  transition: background 0.1s;
  font-size: 13px;
}
.db-agenda-row:hover { background: #f9fafb; }
.db-agenda-row:last-child { border-bottom: none; }
.db-agenda-code {
  font-size: 11px;
  font-family: ui-monospace, monospace;
  color: #9ca3af;
  flex-shrink: 0;
  min-width: 90px;
}
.db-agenda-client {
  flex: 1;
  font-weight: 500;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.db-agenda-step {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  flex-shrink: 0;
}
.db-agenda-overdue { color: #dc2626 !important; }

/* Needs Attention rows */
.db-attn-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 16px;
  border-bottom: 1px solid #f9fafb;
  cursor: pointer;
  transition: background 0.1s;
  font-size: 12px;
}
.db-attn-row:hover { background: #f9fafb; }
.db-attn-row:last-child { border-bottom: none; }
.db-attn-chip {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.2px;
  margin-top: 1px;
}
.db-attn-chip-overdue { background: #fee2e2; color: #dc2626; }
.db-attn-chip-schedule { background: #fef3c7; color: #d97706; }
.db-attn-chip-quote { background: #ede9fe; color: #7c3aed; }
.db-attn-chip-manager { background: #e0f2fe; color: #0369a1; }
.db-attn-text {
  flex: 1;
  color: #374151;
  line-height: 1.4;
}
.db-attn-code {
  font-size: 11px;
  font-family: ui-monospace, monospace;
  color: #9ca3af;
  flex-shrink: 0;
}

/* Quote follow-up rows */
.db-quote-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border-bottom: 1px solid #f9fafb;
  cursor: pointer;
  transition: background 0.1s;
  font-size: 13px;
}
.db-quote-row:hover { background: #f9fafb; }
.db-quote-row:last-child { border-bottom: none; }
.db-quote-client {
  flex: 1;
  font-weight: 500;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.db-quote-route {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
  flex-shrink: 0;
}
.db-quote-expiry {
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
}
.db-quote-expiry-urgent { color: #dc2626; }
.db-quote-expiry-soon { color: #ea580c; }
.db-quote-expiry-ok { color: #9ca3af; }
.db-quote-code {
  font-size: 11px;
  font-family: ui-monospace, monospace;
  color: #9ca3af;
  flex-shrink: 0;
}

/* Empty state */
.db-empty {
  padding: 24px 16px;
  text-align: center;
  color: #9ca3af;
  font-size: 13px;
}

/* Status chip colors in KPI */

@media (max-width: 1200px) {
  .db-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .db-main-grid { grid-template-columns: 1fr; }
  .db-bottom-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .db-kpi-row { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   15. BUTTONS
   ============================================================ */
button {
  padding: 6px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-family);
  height: var(--input-height-sm);
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  white-space: nowrap;
  transition: all var(--transition-fast);
}
button:hover:not(:disabled) { background: var(--color-bg-subtle); border-color: var(--color-border); color: var(--color-text-primary); box-shadow: var(--shadow-sm); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button[type="submit"], button.btn-primary { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
button[type="submit"]:hover:not(:disabled), button.btn-primary:hover:not(:disabled) { background: var(--color-accent-hover); border-color: var(--color-accent-hover); color: #fff; }
button.btn-danger { background: #fff; color: var(--color-danger); border-color: var(--color-danger); min-width: 60px; }

.cost-item-btn {
  padding: 2px 6px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  cursor: pointer;
  border-radius: var(--radius-sm);
}

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

.cost-item-delete:hover {
  background: #fee2e2;
  color: #dc2626;
}

.cost-grand-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
  padding-top: var(--spacing-md);
  border-top: 2px solid var(--color-border);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
}

/* ============================================================
   PAYMENT SECTION
   ============================================================ */

/* ============================================================
   FORMS
   ============================================================ */
form {
  display: grid;
  gap: var(--spacing-xl);
}

label {
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-sm);
  display: block;
}

input,
select,
textarea {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--font-size-base);
  background: var(--color-bg-card);
  transition: all var(--transition-base);
  height: var(--input-height);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
}

input::placeholder,
textarea::placeholder {
  color: var(--color-text-muted);
  font-family: var(--font-family);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 3px var(--color-accent-light);
}

textarea {
  resize: vertical;
  min-height: 100px;
  height: auto;
}

/* Form multi-column layouts */
.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
}

.form-row-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

@media (max-width: 600px) {
  .form-row-2col,
  .form-row-3col {
    grid-template-columns: 1fr;
  }
}

.form-row-2col label,
.form-row-3col label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-size: var(--font-size-sm);
}

.form-row-2col select,
.form-row-3col select {
  width: 100%;
}

/* Form section divider */
.form-section-divider {
  display: flex;
  align-items: center;
  margin: var(--spacing-lg) 0 var(--spacing-md) 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.form-section-divider::before,
.form-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.form-section-divider::before {
  margin-right: var(--spacing-md);
}

.form-section-divider::after {
  margin-left: var(--spacing-md);
}

/* ============================================================
   MODE GROUP (Checkboxes)
   ============================================================ */
.mode-group {
  display: flex;
  gap: var(--spacing-lg);
  flex-wrap: wrap;
}

.mode-group label {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-weight: var(--font-weight-normal);
  cursor: pointer;
}

.mode-group input[type="checkbox"],
.mode-group input[type="radio"] {
  width: auto;
  height: auto;
  cursor: pointer;
  accent-color: var(--color-primary);
}

/* ============================================================
   CHECKLIST
   ============================================================ */
#checklistSection {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

#checklistItems {
  max-height: 200px;
  overflow-y: auto;
  padding-right: var(--spacing-xs);
}

#checklistInput {
  min-height: 80px;
  width: 100%;
}

#setChecklistBtn {
  align-self: flex-end;
}

/* NOTES */
#notesSection {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#notesList {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#notesList.notes-list-scrollable {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 4px;
}

.note-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  background: var(--color-bg-card);
}

.note-meta {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-xs);
}

.note-text {
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  line-height: 1.6;
}

/* DOCUMENTS */
#documentsSection {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

#documentsList {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  max-height: 250px;
  overflow-y: auto;
  padding-right: var(--spacing-xs);
}

.document-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border: none;
  border-bottom: 1px solid #eaecf0;
  border-radius: 0;
  background: #fff;
  gap: 12px;
  transition: background 0.1s;
  cursor: pointer;
}
.document-item:first-child { border-radius: 12px 12px 0 0; }
.document-item:last-child { border-bottom: none; border-radius: 0 0 12px 12px; }
.document-item:only-child { border-radius: 12px; border-bottom: none; }
.document-item:hover {
  background: #f9fafb;
}

.document-main {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  flex: 1;
  min-width: 0;
}

.document-name {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
}

.document-meta {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  display: block;
}

.document-link {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-base);
}

.document-link:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

/* Archived quote links have a subtle different styling */

.document-actions {
  display: flex;
  gap: var(--spacing-sm);
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.document-actions button {
  padding: 4px 10px;
  font-size: var(--font-size-xs);
  white-space: nowrap;
}

/* Document form layout */
.document-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.document-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}

.document-form-left,
.document-form-right {
  display: flex;
  flex-direction: column;
}

.document-form-right {
  justify-content: flex-start;
}

.document-form-left label,
.document-form-right label {
  font-size: var(--font-size-xs);
  margin-bottom: 4px;
  color: var(--color-text-secondary);
}

.document-form-right .drop-zone {
  flex: 1;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* Hide document URL visually (kept for logic) */

.details-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

.details-section-title {
  margin: 0;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Agent cards within details section */
#agentDetails {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

#agentDetails .agent-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  cursor: pointer;
  transition: all var(--transition-base);
}

#agentDetails .agent-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-card);
}

#agentDetails .agent-card h3 {
  margin: 0 0 var(--spacing-xs) 0;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
}

#agentDetails .agent-card p {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* Payment Status Card */
.payment-status-card {
  margin-top: var(--spacing-md);
}

.payment-status-card .details-grid {
  margin-top: var(--spacing-sm) !important;
  gap: var(--spacing-md) var(--spacing-2xl);
}

.payment-status-card .detail-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

.payment-status-card 

.payment-status-card 

.payment-status-card 

.payment-status-card 

#stepsContainer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  background: var(--color-bg-card);
}

.step-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-sm);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--color-border);
}

.step-card-header-title {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
}

.step-card-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-sm);
}

@media (max-width: 768px) {
  .step-card-body {
    grid-template-columns: 1fr;
  }
}

.step-card-body > div.full-width {
  grid-column: 1 / -1;
}

.step-card-body label {
  font-size: var(--font-size-xs);
  margin-bottom: var(--spacing-xs);
}

.step-card-body input,
.step-card-body textarea {
  font-size: var(--font-size-sm);
}

.step-save-btn {
  padding: 6px 12px;
  font-size: var(--font-size-sm);
}

.step-card-actions {
  grid-column: 1 / -1;
}

/* SCHEDULE CALENDAR */
.month-nav {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.month-nav button {
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-bg-card);
  cursor: pointer;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  height: auto;
}

.month-nav button:hover {
  background: var(--color-bg-hover);
}

.month-nav span {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  min-width: 140px;
  text-align: center;
}

/* Schedule Office Filter */

.schedule-calendar-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  margin: var(--spacing-lg) 0 var(--spacing-sm) 0;
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--color-border);
}

.schedule-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--spacing-sm);
}

.calendar-day {
  min-height: 80px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-sm);
  font-size: var(--font-size-base);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all var(--transition-base);
}

.calendar-day:hover:not(.empty) {
  background: var(--color-accent-light);
  border-color: var(--color-accent);
}

.calendar-day.empty {
  background: transparent;
  border: none;
  cursor: default;
}

.calendar-day .day-number {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 13px;
}

/* Badges container - bottom of cell */
.calendar-day .day-badges {
  display: flex;
  gap: 3px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 4px;
}

.calendar-day .day-badge {
  padding: 1px 6px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}

/* Blue pill for pending/uncompleted */
.calendar-day .day-badge-pending {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

/* Green pill for completed */
.calendar-day .day-badge-completed {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.calendar-day.has-moves { }

/* Today - day number in filled blue circle */
.calendar-day.today .day-number {
  background: var(--color-accent);
  color: #ffffff;
  font-weight: 700;
}

/* Remove selected highlight - navigation happens immediately */
.calendar-day.selected { }
.calendar-day.selected.today { }

/* Holiday - very subtle tint + red number */
.calendar-day.holiday {
  background: #fff5f5;
}

.calendar-day.holiday .day-number {
  color: #dc2626;
  font-weight: 700;
}

.calendar-day.holiday.selected { }

/* SCHEDULE STEP CARDS */

.schedule-step-fields-view {
  margin-top: var(--spacing-md);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.schedule-field-row {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-sm);
  gap: var(--spacing-md);
}

.schedule-field-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.schedule-field-value {
  color: var(--color-text-primary);
  text-align: right;
  word-break: break-word;
}

@media (max-width: 768px) {
  
}

.schedule-step-actions {
  display: flex;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
  flex-wrap: wrap;
}

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

.schedule-extra-form > div:nth-last-child(2),
.schedule-extra-form > div:last-child {
  grid-column: 1 / -1;
}

.schedule-extra-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

/* SCHEDULE DAY NOTES */

.schedule-day-notes-actions {
  display: flex;
  gap: var(--spacing-sm);
  margin-top: 8px;
  flex-wrap: wrap;
}

/* MODAL */
/* ============================================================
   MODALS
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-2xl);
  z-index: 10010;
}

.hidden {
  display: none !important;
}

/* Generic Modal (for confirms/inputs) */
.generic-modal-content {
  background: var(--color-bg-card);
  width: 100%;
  max-width: 420px;
  padding: var(--spacing-2xl);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  font-family: var(--font-family);
}

.generic-modal-content h2 {
  margin: 0 0 var(--spacing-md) 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  font-family: var(--font-family);
  color: var(--color-text-primary);
}

.generic-modal-content p {
  margin: 0 0 var(--spacing-lg) 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-base);
  font-family: var(--font-family);
}

.generic-modal-inputs {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.generic-modal-inputs label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  font-family: var(--font-family);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-xs);
}

.generic-modal-inputs input,
.generic-modal-inputs select,
.generic-modal-inputs textarea {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  background: var(--color-bg-card);
  color: var(--color-text-primary);
}

.generic-modal-inputs input:focus,
.generic-modal-inputs select:focus,
.generic-modal-inputs textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-light);
}

.generic-modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-sm);
}

.generic-modal-buttons .btn-secondary {
  padding: var(--spacing-sm) var(--spacing-lg);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
}

.generic-modal-buttons .btn-secondary:hover {
  background: var(--color-bg-hover);
}

.generic-modal-buttons .btn-primary {
  padding: var(--spacing-sm) var(--spacing-lg);
  background: var(--color-accent);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
  color: white;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
}

.generic-modal-buttons .btn-primary:hover {
  background: var(--color-accent-hover);
}

.generic-modal-buttons .btn-danger {
  padding: var(--spacing-sm) var(--spacing-lg);
  background: #dc2626;
  border: 1px solid #dc2626;
  border-radius: var(--radius-md);
  color: white;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
}

.generic-modal-buttons .btn-danger:hover {
  background: #b91c1c;
}

.modal-card {
  background: var(--color-bg-card);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--spacing-3xl);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

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

.modal-header h2 {
  margin: 0;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.close-button {
  background: transparent;
  font-size: var(--font-size-2xl);
  cursor: pointer;
  border: none;
  color: var(--color-text-muted);
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.close-button:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-md);
  margin-top: var(--spacing-2xl);
  padding-top: var(--spacing-xl);
  border-top: 1px solid var(--color-border);
}

.modal-actions button[type="button"] {
  background: var(--color-bg-subtle);
  color: var(--color-text-secondary);
}

.modal-hint {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-top: calc(-1 * var(--spacing-sm));
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--color-bg-subtle);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--color-accent);
}

/* ============================================================
   FOOTER / ADMIN TOOLS
   ============================================================ */
footer {
  margin-top: var(--spacing-3xl);
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--font-size-base);
  padding: var(--spacing-xl) 0;
}

.admin-tools {
  margin-top: var(--spacing-3xl);
  background: #fefce8;
  border: 1px solid #fbbf24;
  padding: 16px;
  border-radius: 8px;
  font-size: var(--font-size-sm);
}

.admin-tools h3 {
  margin: 0 0 12px 0;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: #78350f;
}

.admin-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.admin-tools button {
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid #d97706;
  background: var(--color-bg-card);
  color: #78350f;
  cursor: pointer;
  font-weight: 500;
}

.admin-tools button:hover {
  background: #fef3c7;
}

.admin-tools textarea {
  width: 100%;
  font-family: 'Courier New', monospace;
  font-size: var(--font-size-xs);
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid #d97706;
  background: #fffbeb;
}

.admin-tools p {
  margin: 8px 0 0 0;
  font-size: var(--font-size-xs);
  color: #78350f;
}

#importArea {
  margin-top: 12px;
  padding: 12px;
  background: #fffbeb;
  border-radius: var(--radius-md);
  border: 1px solid #fbbf24;
}

#importArea p {
  margin: 0 0 8px 0;
  font-size: var(--font-size-sm);
  color: #78350f;
}

/* RESPONSIVE ADJUSTMENTS */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .left-panel,
  .right-panel {
    padding: 14px;
  }

  .header-row {
    flex-direction: column;
    align-items: flex-start;
  }

  

  .schedule-calendar {
    gap: 4px;
  }

  .calendar-day {
    min-height: 50px;
    padding: 4px;
  }
}

/* SCROLLBAR STYLING */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Status Labels for Quotes */
.status-label.status-draft {
  background: var(--color-bg-subtle);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.status-label.status-sent {
  background: #dbeafe;
  color: #1e40af;
}

.status-label.status-accepted {
  background: #d1fae5;
  color: #065f46;
}

.status-label.status-converted {
  background: #fef3c7;
  color: #92400e;
}

.status-label.status-expired {
  background: #fee2e2;
  color: #991b1b;
}

/* Insurance Toggle Section */
.insurance-toggle-section {
  margin-top: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.insurance-toggle-label {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  cursor: pointer;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
}

.insurance-toggle-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.insurance-fields {
  margin-top: var(--spacing-md);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--color-border);
}

.insurance-fields-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--spacing-md);
}

.insurance-fields-grid label {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.insurance-fields-grid input {
  width: 100%;
  padding: var(--spacing-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
}

/* Quote Modal - Larger width */

/* Form Section Titles */

.charge-row {
  display: grid;
  grid-template-columns: 2fr 1fr 100px 40px;
  gap: var(--spacing-sm);
  align-items: center;
}

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

.charge-row input,
.charge-row select {
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  background: var(--color-bg-card);
}

.charge-row button {
  padding: var(--spacing-sm);
  background: var(--color-danger-light);
  color: #991b1b;
  border: 1px solid var(--color-danger-border);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all var(--transition-base);
  height: auto;
}

.charge-row button:hover {
  background: var(--color-danger-border);
}

/* ============================================================
   QUOTE CHECKLIST IMPROVEMENTS
   ============================================================ */

/* Checklist containers */
#quotationIncludesChecklist,
#additionalChargesChecklist {
  padding: 12px;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

/* Each checklist item */
#quotationIncludesChecklist label,
#additionalChargesChecklist label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 400;
  cursor: pointer;
  font-size: var(--font-size-sm);
  margin-bottom: 10px;
  padding: 8px 10px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  transition: all 0.2s;
  line-height: 1.4;
}

#quotationIncludesChecklist label:hover,
#additionalChargesChecklist label:hover {
  background: #f0f9ff;
  border-color: #3b82f6;
}

#quotationIncludesChecklist label:last-child,
#additionalChargesChecklist label:last-child {
  margin-bottom: 0;
}

/* Checkbox itself */
#quotationIncludesChecklist input[type="checkbox"],
#additionalChargesChecklist input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: #3b82f6;
}

/* Section headers within checklist - only target direct div children that are headers, not checklist sections */
#quotationIncludesChecklist > div:not(.checklist-section),
#additionalChargesChecklist > div:not(.checklist-section) {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 16px 0 8px 0;
  padding-bottom: 6px;
  border-bottom: 1px dashed #d1d5db;
}

/* Checklist sections should have normal text */
#quotationIncludesChecklist .checklist-section,
#additionalChargesChecklist .checklist-section {
  text-transform: none;
}

#quotationIncludesChecklist > div:first-child,
#additionalChargesChecklist > div:first-child {
  margin-top: 0;
}

/* Hint text within checklist */
#quotationIncludesChecklist > p,
#additionalChargesChecklist > p {
  color: #9ca3af;
  font-size: var(--font-size-sm);
  font-style: italic;
  margin: 0;
  padding: 8px;
}

/* Conditional hint text (smaller text in parentheses) */
#quotationIncludesChecklist label span,
#additionalChargesChecklist label span {
  color: #9ca3af;
  font-size: 11px;
}

/* Custom items section */
#customIncludedItems,
#additionalChargesList {
  list-style: none;
  padding: 0;
  margin: 0 0 12px 0;
}

#customIncludedItems li,
#additionalChargesList li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  border: 1px solid transparent;
}

#customIncludedItems li {
  background: #f0f9ff;
  border-color: #bfdbfe;
}

#additionalChargesList li {
  background: #fffbeb;
  border-color: #fde68a;
}

#customIncludedItems li:last-child,
#additionalChargesList li:last-child {
  margin-bottom: 0;
}

/* Scrollbar for checklists */
#quotationIncludesChecklist::-webkit-scrollbar,
#additionalChargesChecklist::-webkit-scrollbar {
  width: 6px;
}

#quotationIncludesChecklist::-webkit-scrollbar-track,
#additionalChargesChecklist::-webkit-scrollbar-track {
  background: var(--color-border);
  border-radius: 3px;
}

#quotationIncludesChecklist::-webkit-scrollbar-thumb,
#additionalChargesChecklist::-webkit-scrollbar-thumb {
  background: #9ca3af;
  border-radius: 3px;
}

#quotationIncludesChecklist::-webkit-scrollbar-thumb:hover,
#additionalChargesChecklist::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

/* Quote Details - use existing detail-card styles but add these specifics */
#quoteDetails .details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
  margin-top: 12px;
  margin-bottom: 20px;
}

/* Quote charges table */
.quote-charges-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
  margin-top: var(--spacing-sm);
}

.quote-charges-table td {
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--color-border);
}

.quote-charges-table .charge-category {
  width: 75%;
}

.quote-charges-table .charge-amount {
  width: 25%;
  text-align: right;
  white-space: nowrap;
}

.quote-charges-table .total-row td {
  background: var(--color-bg-subtle);
  font-weight: var(--font-weight-semibold);
}

/* Quote charges section */
.quote-charges-section {
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--color-border);
}

.quote-charges-info {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-sm);
}

/* Mode-specific section title colors */
.details-section-title.mode-sea {
  color: #0369a1;
}

.details-section-title.mode-air {
  color: #7c3aed;
}

.details-section-title.mode-land {
  color: #059669;
}

/* Quote includes list */

/* Quote terms */

/* Quote validity box */

/* Quote actions */

/* Responsive adjustments */
@media (max-width: 768px) {
  
  
  .charge-row {
    grid-template-columns: 1fr;
  }
  
  
  
  
}

/* ============================================================
   MODE-SPECIFIC JOB FIELDS
   ============================================================ */

.job-mode-fields {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
}

.job-mode-fields-title {
  margin: 0 0 10px 0;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

/* Sea fields */
#jobSeaFields,
#quoteSeaFields {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
}

.job-mode-fields-title-sea {
  color: #0369a1;
}

/* Air fields */
#jobAirFields,
#quoteAirFields {
  background: #f5f3ff;
  border: 1px solid #c4b5fd;
}

.job-mode-fields-title-air {
  color: #7c3aed;
}

/* Land fields */
#jobRoadFields,
#quoteRoadFields {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.job-mode-fields-title-land {
  color: #059669;
}

/* Vehicle fields */
#jobVehicleFields,
#quoteVehicleFields {
  background: #fefce8;
  border: 1px solid #fde047;
}

.job-mode-fields-title-vehicle {
  color: #a16207;
}

/* ============================================================
   COLLAPSIBLE STEP CARDS
   ============================================================ */

.step-card-collapsible {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin-bottom: 12px;
  background: var(--color-bg-card);
  overflow: hidden;
  border-left: 4px solid #d1d5db;
}

.step-card-collapsible.status-scheduled {
  border-left-color: #3b82f6;
}

.step-card-collapsible.status-completed {
  border-left-color: #10b981;
}

.step-card-collapse-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  background: var(--color-bg-subtle);
  border-bottom: 1px solid transparent;
  transition: background 0.2s;
  gap: 12px;
}

.step-card-collapse-header:hover {
  background: var(--color-bg-subtle);
}

.step-card-collapse-header.expanded {
  border-bottom-color: var(--color-border);
}

.step-card-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

/* Progress/Status Indicator */
.step-status-indicator {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  flex-shrink: 0;
}

.step-status-indicator.pending {
  background: var(--color-bg-subtle);
  border: 2px solid #d1d5db;
  color: #9ca3af;
}

.step-status-indicator.scheduled {
  background: #dbeafe;
  border: 2px solid #3b82f6;
  color: #1d4ed8;
}

.step-status-indicator.completed {
  background: #d1fae5;
  border: 2px solid #10b981;
  color: #059669;
}

/* Step Title and Info */
.step-card-title {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step-card-subtitle {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.step-card-subtitle span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Expand/Collapse Arrow */
.step-card-arrow {
  font-size: var(--font-size-xs);
  color: #9ca3af;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.step-card-arrow.expanded {
  transform: rotate(180deg);
}

/* Collapsible Body */
.step-card-collapse-body {
  padding: 16px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-card);
}

.step-card-collapse-body.hidden {
  display: none;
}

/* Time Dropdown Selectors */

/* Extra Job Cards - Consistent Styling */

/* Progress Bar for Move Steps */
.steps-progress-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--color-bg-subtle);
  border-radius: var(--radius-md);
}

.steps-progress-segment {
  flex: 1;
  height: 6px;
  background: var(--color-border);
  border-radius: 3px;
  overflow: hidden;
}

.steps-progress-segment.completed {
  background: #10b981;
}

.steps-progress-segment.scheduled {
  background: #3b82f6;
}

.steps-progress-text {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-left: 12px;
  white-space: nowrap;
}

/* Move Details - Mode Specific Info Boxes */
.mode-info-box {
  padding: 12px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  font-size: var(--font-size-sm);
}

.mode-info-box.sea {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
}

.mode-info-box.air {
  background: #f5f3ff;
  border: 1px solid #c4b5fd;
}

.mode-info-box.land {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.mode-info-box.vehicle {
  background: #fefce8;
  border: 1px solid #fde047;
}

.mode-info-box h5 {
  margin: 0 0 8px 0;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mode-info-box.sea h5 { color: #0369a1; }
.mode-info-box.air h5 { color: #7c3aed; }
.mode-info-box.land h5 { color: #059669; }
.mode-info-box.vehicle h5 { color: #a16207; }

.mode-info-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px dashed var(--color-border);
}

.mode-info-row:last-child {
  border-bottom: none;
}

.mode-info-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.mode-info-value {
  font-weight: 500;
  color: var(--color-text-primary);
}

/* Time Badge for Schedule */

/* Checklist Items List */
.checklist-items-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Add Checklist Item Button */
.checklist-add-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  margin-top: 10px;
  background: var(--color-bg-subtle);
  border: 1px dashed #d1d5db;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: var(--font-size-sm);
  transition: all 0.2s;
}

.checklist-add-btn:hover {
  background: var(--color-bg-subtle);
  border-color: #9ca3af;
  color: var(--color-text-secondary);
}

/* ============================================================
   COMPLETION & DELETE BUTTONS
   ============================================================ */

/* Completion Toggle Button */
.complete-btn {
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid #d1d5db;
  background: var(--color-bg-card);
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: var(--font-size-xs);
  font-weight: 500;
  transition: all 0.2s;
}

.complete-btn:hover {
  background: #f0fdf4;
  border-color: #86efac;
  color: #059669;
}

.complete-btn.completed {
  background: #d1fae5;
  border-color: #10b981;
  color: #059669;
}

.complete-btn.completed:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

/* Delete Step Button */
.delete-step-btn {
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #dc2626;
  cursor: pointer;
  font-size: var(--font-size-xs);
  font-weight: 500;
  transition: all 0.2s;
}

.delete-step-btn:hover {
  background: #fee2e2;
  border-color: #f87171;
}

/* ============================================================
   SCHEDULE OFFICE GROUPING
   ============================================================ */

/* ============================================================
   EXTRA JOB CARD STYLING
   ============================================================ */

/* ============================================================
   SCHEDULE ADD FORM
   ============================================================ */

/* ============================================================
   MEDIA (PHOTOS/VIDEOS) SECTION
   ============================================================ */

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.media-card {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-bg-card);
  transition: box-shadow 0.2s;
}

.media-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.media-preview {
  width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-subtle);
  overflow: hidden;
}

.media-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-label {
  padding: 8px 10px;
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-top: 1px solid var(--color-border);
}

.media-uploader {
  padding: 4px 10px;
  font-size: 10px;
  color: var(--color-text-secondary);
  background: var(--color-bg-subtle);
}

.media-actions {
  display: flex;
  gap: 4px;
  padding: 8px 10px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
}

.media-actions button {
  flex: 1;
  padding: 4px 8px;
  font-size: 11px;
}

.media-upload-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

@media (max-width: 768px) {
  .media-upload-form .document-form-row {
    grid-template-columns: 1fr;
  }
  
  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

/* ============================================================
   ADD MOVE STEP DROPDOWN
   ============================================================ */

.step-type-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 100;
  min-width: 220px;
  max-height: 300px;
  overflow-y: auto;
}

.step-type-dropdown.hidden {
  display: none;
}

.step-type-dropdown > div {
  padding: 10px 14px;
  cursor: pointer;
  font-size: var(--font-size-sm);
  border-bottom: 1px solid var(--color-bg-subtle);
  transition: background 0.15s;
}

.step-type-dropdown > div:last-child {
  border-bottom: none;
}

.step-type-dropdown > div:hover {
  background: var(--color-bg-subtle);
}

/* ============================================================
   AGENTS PAGE POLISH
   ============================================================ */

/* Agent Details Panel */
#agentDetailsPanel {
  padding: var(--spacing-xl);
}

#agentDetailsPanel > h3 {
  margin: 0 0 var(--spacing-xs) 0;
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

#agentDetailsPanel > p {
  margin: 0 0 var(--spacing-lg) 0;
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
}

#agentDetailsPanel > p strong {
  color: var(--color-text-primary);
  margin-right: var(--spacing-sm);
}

/* Agent Actions Buttons */
/* Agent Detail Header */

/* Agent name with type badge - for details panel */

/* Agent card name row - for list cards */

/* Agent card badges row */

.btn-icon {
  padding: var(--spacing-xs) var(--spacing-md);
  font-size: var(--font-size-xs);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  border-radius: var(--radius-md);
  height: auto;
}

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

/* Agent Membership Badges */

.membership-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-md);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-sm);
}

/* Membership Checkboxes in Form */

/* Legacy agent-actions (hide if not used) */

/* Recent Moves Section */
#agentDetailsPanel > h4 {
  margin: var(--spacing-xl) 0 var(--spacing-md) 0;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#agentDetailsPanel > ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

#agentDetailsPanel > ul > li

#agentDetailsPanel > ul > li

/* ============================================================
   DOCUMENTS PAGE POLISH
   ============================================================ */

/* Documents Search Section */
#documentsSearchSection {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
}

#documentsListGlobal {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

/* Resource Library Polish */
#resourceLibraryContainer {
  padding-top: var(--spacing-xs);
}

#resourceLibraryContainer > div:first-child {
  margin-bottom: var(--spacing-xl);
}

/* Resource Categories */

/* Resource Items */
.resource-items {
  padding: 8px 12px;
  background: #f8f9fb;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Empty State Styling */
.empty-state {
  text-align: center;
  padding: var(--spacing-3xl) var(--spacing-xl);
  color: var(--color-text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: var(--spacing-md);
  opacity: 0.5;
}

.empty-state-text {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  font-style: italic;
  padding: 24px 0;
  text-align: center;
  width: 100%;
}

/* MOVE TAG BADGE -- handled by .job-card-tag in base CSS */

/* When tag exists, add padding to job code so they don't overlap */

.move-details-tag {
  display: inline-block;
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  color: white;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: var(--spacing-md);
  vertical-align: middle;
}

/* ============================================================
   IMPROVED CONTACTS SECTION
   ============================================================ */

.contacts-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.contact-card {
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  transition: all var(--transition-base);
}

.contact-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.contact-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--spacing-sm);
}

.contact-card-name {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin: 0;
}

.contact-card-actions {
  display: flex;
  gap: var(--spacing-xs);
}

.contact-card-actions button {
  padding: 4px 10px;
  font-size: var(--font-size-xs);
  height: auto;
  border-radius: var(--radius-sm);
}

.contact-card-info {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.contact-card-info-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.contact-card-info-item::before {
  font-size: var(--font-size-xs);
}

.contact-card-info-item.email::before {
  content: "";
}

.contact-card-info-item.phone::before {
  content: "";
}

.contact-card-notes {
  margin-top: var(--spacing-sm);
  padding-top: var(--spacing-sm);
  border-top: 1px dashed var(--color-border);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  font-style: italic;
}

.contact-form-container {
  background: var(--color-bg-card);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  margin-top: var(--spacing-lg);
}

.contact-form-container.hidden {
  display: none;
}

.contact-form-title {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin: 0 0 var(--spacing-lg) 0;
}

.contact-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-md);
}

.contact-form-grid .full-width {
  grid-column: 1 / -1;
}

.contact-form-grid label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-xs);
}

.contact-form-grid input,
.contact-form-grid textarea {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-family: inherit;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.contact-form-grid input:focus,
.contact-form-grid textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.contact-form-actions {
  display: flex;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-lg);
  justify-content: flex-end;
}

.contact-form-actions .cancel-btn {
  background: var(--color-bg-card);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.contact-form-actions .cancel-btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

/* ============================================================
   DATE INPUT FORMAT HINT
   ============================================================ */
input[type="date"] {
  position: relative;
}

/* ============================================================
   DOCUMENTS SPLIT VIEW (Side by Side)
   ============================================================ */
/* Documents Tab Switcher - matches agent-type-tabs */

/* documents-type-tab uses detail-tab-btn styles */

/* Resource library - remove duplicate headers when in tabbed view */
#resourceLibraryPanel #resourceLibraryContainer 

#resourceLibraryPanel #resourceLibraryContainer {
  flex: 1;
  overflow-y: auto;
}

/* ============================================================
   RESPONSIVE HEADER
   ============================================================ */
@media (max-width: 1100px) {
  
  
  
}

@media (max-width: 900px) {
  
  
  
  
  
  
  
}

@media (max-width: 768px) {
  
  
  .header-left {
    width: 100%;
    text-align: center;
    margin-bottom: var(--spacing-sm);
  }
  
  
  
  .header-right {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
  }
  
  .main-content {
    margin-top: 120px;
  }
}

/* ============================================================
   DRAG AND DROP UPLOAD ZONES
   ============================================================ */
.drop-zone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  background: #fafafa;
  position: relative;
}

.drop-zone:hover {
  border-color: var(--color-primary);
  background: #f5f5f5;
}

.drop-zone.drag-over {
  border-color: var(--color-primary);
  background: #eff6ff;
  border-style: solid;
}

.drop-zone-text {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  pointer-events: none;
}

.drop-zone-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.drop-zone.has-file .drop-zone-text {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-medium);
}

/* Resource Library drop zone */
.resource-drop-zone {
  margin-top: var(--spacing-xs);
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   DASHBOARD VIEW
   ============================================================ */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.login-box {
  background: white;
  padding: var(--spacing-2xl);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 400px;
  margin: var(--spacing-md);
}

.login-logo-img {
  display: block;
  max-width: 280px;
  height: auto;
  margin: 0 auto var(--spacing-xl) auto;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.login-field label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
}

.login-field input {
  padding: var(--spacing-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  transition: border-color var(--transition-base);
}

.login-field input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.login-btn {
  padding: var(--spacing-md);
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: background var(--transition-base);
  margin-top: var(--spacing-sm);
}

.login-btn:hover:not(:disabled) {
  background: var(--color-accent-hover);
}

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

.login-error {
  background: #fef2f2;
  color: #dc2626;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  text-align: center;
}

.login-success {
  background: #f0fdf4;
  color: #16a34a;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  text-align: center;
}

.forgot-password-link {
  display: block;
  text-align: center;
  margin-top: var(--spacing-md);
  color: #64748b;
  font-size: var(--font-size-sm);
  text-decoration: none;
  transition: color 0.2s;
}

.forgot-password-link:hover {
  color: #3b82f6;
  text-decoration: underline;
}

/* ============================================================
   CONNECTION STATUS INDICATOR
   ============================================================ */

/* ============================================================
   LOGOUT BUTTON
   ============================================================ */

/* ============================================================
   IDLE WARNING
   ============================================================ */
.idle-warning {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: var(--radius-md);
  padding: var(--spacing-md) var(--spacing-lg);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 10001;
  animation: slideIn 0.3s ease;
}

.idle-warning p {
  margin: 0 0 var(--spacing-sm) 0;
  color: #92400e;
  font-weight: var(--font-weight-medium);
}

.idle-warning button {
  background: #f59e0b;
  color: white;
  border: none;
  padding: var(--spacing-xs) var(--spacing-md);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: var(--font-weight-medium);
}

.idle-warning button:hover {
  background: #d97706;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============================================================
   LOGOUT MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10002;
  animation: fadeIn 0.2s ease;
}

.logout-modal {
  background: white;
  padding: var(--spacing-xl);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 90%;
  text-align: center;
  animation: slideUp 0.2s ease;
}

.logout-modal h3 {
  margin: 0 0 var(--spacing-md) 0;
  color: var(--color-text-primary);
  font-size: var(--font-size-lg);
}

.logout-modal p {
  margin: 0 0 var(--spacing-lg) 0;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.logout-modal-buttons {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
}

.logout-modal-buttons button {
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--transition-base);
}

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

.btn-secondary:hover {
  background: var(--color-border);
}

.btn-danger {
  background: #dc2626;
  color: white;
  border: none;
}

.btn-danger:hover {
  background: #b91c1c;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

/* Text styles */

/* Flex utilities */

/* Spacing */

/* Empty state */
.empty-state-text {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  font-style: italic;
  padding: var(--spacing-lg);
  text-align: center;
}

/* Quote Options Styling */
.mode-options-container {
  margin-top: 16px;
}

.mode-option-block {
  margin-bottom: 16px;
  border-radius: 8px;
  overflow: hidden;
}

.mode-option-block.sea-option {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
}

.mode-option-block.air-option {
  background: #f5f3ff;
  border: 1px solid #c4b5fd;
}

.mode-option-block.road-option {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.option-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 14px;
}

.option-header.sea-header { 
  background: #e0f2fe; 
  color: #0369a1; 
}

.option-header.air-header { 
  background: #ede9fe; 
  color: #7c3aed; 
}

.option-header.road-header { 
  background: #d1fae5; 
  color: #059669; 
}

.option-delete-btn {
  background: transparent;
  border: none;
  color: #dc2626;
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
}

.option-delete-btn:hover {
  background: rgba(220, 38, 38, 0.1);
}

.option-content {
  padding: 16px;
}

.option-details-section {
  margin-bottom: 16px;
}

.option-details-section h5 {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: inherit;
}

.option-charges-section {
  border-top: 1px dashed rgba(0,0,0,0.1);
  padding-top: 16px;
}

.option-charges-section h5 {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: inherit;
}

.option-charges-section .charges-hint {
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 12px;
}

.option-charges-list {
  margin-bottom: 12px;
}

.option-add-charge-btn {
  margin-bottom: 12px;
}

/* ============================================
   DOCUMENT PREVIEW MODAL
   ============================================ */

.doc-preview-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: var(--spacing-lg);
}

.doc-preview-modal {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 1000px;
  height: 85vh;
  max-height: 900px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.doc-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
  flex-shrink: 0;
}

.doc-preview-title {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-md);
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: calc(100% - 50px);
}

.doc-preview-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.doc-preview-close:hover {
  background: var(--color-bg-tertiary);
  color: var(--color-text);
}

.doc-preview-content {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-tertiary);
}

.doc-preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #ffffff;
}

.doc-preview-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.doc-preview-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
  color: var(--color-text-muted);
}

.doc-preview-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: doc-preview-spin 0.8s linear infinite;
}

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

.doc-preview-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
  text-align: center;
  padding: var(--spacing-2xl);
}

.doc-preview-icon {
  font-size: 48px;
}

.doc-preview-filename {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-lg);
  color: var(--color-text);
  word-break: break-all;
}

.doc-preview-notice {
  color: var(--color-text-muted);
  font-size: var(--font-size-md);
}

.doc-preview-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
  flex-shrink: 0;
}

.doc-preview-btn {
  padding: var(--spacing-sm) var(--spacing-xl);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--color-accent);
  color: white;
}

.doc-preview-btn:hover {
  background: var(--color-accent-hover);
}

.doc-preview-btn-secondary {
  background: var(--color-bg-tertiary);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.doc-preview-btn-secondary:hover {
  background: var(--color-bg-card);
  border-color: var(--color-accent);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .doc-preview-overlay {
    padding: 0;
  }
  
  .doc-preview-modal {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
  }
  
  .doc-preview-footer {
    flex-direction: column;
  }
  
  .doc-preview-btn {
    width: 100%;
  }

  /* Quote/HTML iframe: min-width so it doesn't squeeze, content scrollable */
  .doc-preview-content {
    overflow-x: auto !important;
    overflow-y: auto !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
  }
  .doc-preview-iframe {
    min-width: 700px !important;
    width: 700px !important;
    height: 100% !important;
  }
}

/* ============================================================
   TARGETED FIXES -- All remaining issues
   ============================================================ */

/* -- 1. MOVES: Tag should not be absolute-positioned -- */
/* The tag is now inline in the row-cell, not absolute */
.job-card-tag {
  display: inline-flex !important;
  align-items: center !important;
  position: static !important;
  padding: 2px 7px !important;
  background: #7c3aed !important;
  color: #fff !important;
  border-radius: 999px !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  letter-spacing: 0.3px !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
  max-width: none !important;
  box-shadow: none !important;
}

/* -- 2. MOVES: status badge cleaner -- */
.status-label {
  display: inline-flex !important;
  align-items: center !important;
  padding: 3px 9px !important;
  border-radius: 6px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.3px !important;
  white-space: nowrap !important;
  border: 1.5px solid !important;
}

/* -- 3. MOVES: row-cell baseline alignment -- */

/* -- 4. FILTER BAR: fix dropdown truncation -- */
/* -- 5. QUOTES: split Type and Language into separate columns -- */
/* Handled in JS createCard -- CSS just needs to match */
.quote-type-cell { font-size: 12px; color: #4b5563; }
.quote-lang-cell { font-size: 11px; color: #9ca3af; }

/* -- 6. AGENTS: fix column proportions so nothing truncates -- */

.membership-badge {
  display: inline-flex !important;
  align-items: center !important;
  padding: 3px 8px !important;
  border-radius: 5px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
}
.membership-FIDI { background: #dcfce7 !important; color: #166534 !important; border: 1px solid #86efac !important; }
.membership-IAM  { background: #dbeafe !important; color: #1e40af !important; border: 1px solid #93c5fd !important; }

/* -- 7. STORAGE: code should not be blue/monospace -- */

/* Storage grid: client gets the main column, code is secondary */

/* -- 8. ROW DIVIDERS: clear visible separator -- */
.job-card, .quote-card, 
.job-card:last-child, .quote-card:last-child,

/* -- 9. DOCUMENTS: tabs same style as Agents/Brokers -- */

/* Remove any underline pseudo-elements on doc tabs */

/* -- 11. STORAGE FILTERS: side by side -- */

/* -- 12. DOCUMENT LIST: clear dividers -- */
.document-item {
  border-bottom: 1px solid #eaecf0 !important;
}

.document-item:last-child {
  border-bottom: none !important;
}

/* ============================================================
   DETAIL PAGE -- Full page navigation (Router-based)
   ============================================================ */

.detail-page-view {
  padding: 24px 32px 40px;
  min-height: calc(100vh - var(--topbar-height));
  background: #f8f9fb;
}

/* -- Breadcrumb -- */
.detail-page-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 13px;
}

.breadcrumb-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 4px 0;
  height: auto;
  color: #2563eb;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-family);
  box-shadow: none;
}
.breadcrumb-back:hover { color: #1d4ed8; background: none; box-shadow: none; }

.breadcrumb-sep {
  color: #9ca3af;
  font-size: 13px;
}

.breadcrumb-current {
  color: #374151;
  font-size: 13px;
  font-weight: 500;
}

/* -- Page header -- */
.detail-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #f0f4f8;
}

.detail-page-title-area {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.detail-page-title {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  margin: 0;
  letter-spacing: -0.3px;
}

.detail-page-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-page-code {
  font-size: 12px;
  color: #9ca3af;
  font-weight: 500;
}

.detail-page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* -- Tab bar -- */
.detail-page-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid #e5e9ef;
  margin-bottom: 24px;
}

.detail-tab-btn {
  padding: 10px 18px;
  height: auto;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: #6b7280;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-family);
  box-shadow: none;
  transition: color 0.12s, border-color 0.12s;
  margin-bottom: -1px;
}
.detail-tab-btn:hover { color: #111827; background: none; box-shadow: none; }
.detail-tab-btn.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  font-weight: 600;
  background: none;
  box-shadow: none;
}

/* -- Tab content area -- */
.detail-page-tab-content {
  max-width: 100%;
}

.detail-page-content {
  max-width: 100%;
}

/* -- Inline status dropdown -- */
.inline-status-wrap {
  position: relative;
  display: inline-flex;
}

.inline-status-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  height: 30px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-family);
  border: 1.5px solid currentColor;
  transition: all 0.1s;
  box-shadow: none;
  white-space: nowrap;
}
.inline-status-btn.status-Planned   { color: #f97316; background: #fff7ed; border-color: #f97316; }
.inline-status-btn.status-Ongoing   { color: #eab308; background: #fefce8; border-color: #eab308; }
.inline-status-btn.status-Completed { color: #16a34a; background: #f0fdf4; border-color: #16a34a; }
.inline-status-btn.status-Cancelled { color: #dc2626; background: #fef2f2; border-color: #dc2626; }
.inline-status-btn.status-Draft     { color: #f97316; background: #fff7ed; border-color: #f97316; }
.inline-status-btn.status-Sent      { color: #eab308; background: #fefce8; border-color: #eab308; }
.inline-status-btn.status-Booked    { color: #16a34a; background: #f0fdf4; border-color: #16a34a; }
.inline-status-btn.status-Rejected  { color: #dc2626; background: #fef2f2; border-color: #dc2626; }
.inline-status-btn.status-Expired   { color: #6b7280; background: #f3f4f6; border-color: #d1d5db; }
.inline-status-btn.status-InStorage { color: #2563eb; background: #eff6ff; border-color: #2563eb; }
.inline-status-btn.status-Released  { color: #6b7280; background: #f9fafb; border-color: #9ca3af; }
.inline-status-btn:hover { filter: brightness(0.95); box-shadow: none; }

.inline-status-dropdown {
  position: fixed;
  background: #fff;
  border: 1px solid #e5e9ef;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 99999;
  min-width: 130px;
  overflow: hidden;
}

.inline-status-opt {
  display: block;
  width: 100%;
  padding: 8px 14px;
  height: auto;
  background: none;
  border: none;
  border-radius: 0;
  text-align: left;
  font-size: 13px;
  font-weight: 400;
  color: #374151;
  cursor: pointer;
  font-family: var(--font-family);
  box-shadow: none;
  transition: background 0.1s;
}
.inline-status-opt:hover { background: #f9fafb; box-shadow: none; }
.inline-status-opt.current { font-weight: 600; color: #111827; background: #f3f4f6; }

/* -- List view: white background, cleaner rows -- */
/* List views keep the page bg */
#movesView, #quotesView, #agentsView, #storageView, #documentsView {
  background: #f8f9fb;
}

#dashboardView {
  height: 100vh;
  box-sizing: border-box;
}

/* ============================================================
   FIXES -- Status colors, row layout, resource library
   ============================================================ */

/* -- INLINE STATUS: don't let overflow hidden clip the dropdown -- */

/* The list-body border + radius still needs to look contained */
.list-body > .job-card:first-child,
.list-body > .quote-card:first-child,
.list-body > 

/* -- MOVES: tighter row height -- */
.job-card, .quote-card, 

/* -- DETAIL PAGE: cleaner card titles -- */
.details-card-title {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #6b7280 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.6px !important;
  padding-bottom: 12px !important;
  border-bottom: 1px solid #f0f4f8 !important;
  margin: 0 0 16px 0 !important;
}

/* -- COST BREAKDOWN: style the raw form elements -- */
.cost-breakdown-section {
  background: #fff !important;
  border: 1px solid var(--color-border) !important;
  border-radius: 12px !important;
  padding: 20px !important;
  margin-bottom: 12px !important;
}

.cost-breakdown-section select {
  max-width: 200px;
  margin-bottom: 12px;
}

/* -- DETAIL PAGE: tab content padding -- */
.detail-page-tab-content {
  padding-top: 4px;
}

.detail-page-tab-content .details-card {
  margin-bottom: 16px;
}

/* -- MOVE TABLE: column header consistent with row -- */

/* -- PDF EDITOR --------------------------------------------- */
[data-edit-id] { cursor: text; transition: outline 0.1s; }
[data-edit-id]:hover { outline: 1px dashed rgba(37,99,235,0.45); outline-offset: 2px; border-radius: 2px; }
[data-edit-id]:focus { outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: 2px; }
/* Don't override backgrounds on colored elements */
.mode-header[data-edit-id]:focus,
.section-header[data-edit-id]:focus { background: inherit; }
tr[data-edit-id] { cursor: pointer; }
tr[data-edit-id]:hover td { background: rgba(37,99,235,0.04); }
tr[data-edit-id].pdf-row-selected td { background: rgba(37,99,235,0.08); }

/* -- QUOTE DETAILS COMPACT CARDS --------------------------- */
.ov-card-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  font-family: var(--font-family);
}
.ov-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}

/* Storage cost box */

/* PDF editor locked cells */
.pdf-no-edit { cursor: default !important; user-select: text; }
.pdf-no-edit:hover { outline: none !important; }

/* ============================================================
   RESPONSIVE LAYOUT
   ============================================================ */

/* ── Mobile top bar (hidden on desktop) ── */
.mobile-top-bar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  z-index: 300;
  align-items: center;
  padding: 0 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* ── Hamburger button ── */
.mobile-hamburger {
  display: flex;
  width: 36px; height: 36px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--color-text-primary);
  transition: background 0.12s;
  flex-shrink: 0;
}
.mobile-hamburger:hover { background: var(--color-bg-subtle); }

/* ── Sidebar overlay backdrop ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 190;
  transition: opacity 0.25s;
}
.sidebar-overlay.active { display: block; }

@media (max-width: 768px) {
  .sidebar-overlay { top: 52px; } /* Start below top bar */
}

/* ============================================================
   MOBILE BREAKPOINT (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {

  /* ── 1. Show top bar, hide desktop hamburger ── */
  .mobile-top-bar { display: flex; }

  /* ── 2. Page scrolling ── */
  html, body { overflow: auto !important; }
  .app-shell { overflow: visible !important; }

  /* ── 3. Sidebar: wider drawer with labels, slides in from left ── */
  .sidebar {
    width: 260px !important;
    top: 52px !important;  /* Start below top bar */
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
    z-index: 200;
    box-shadow: 4px 0 24px rgba(0,0,0,0.18);
  }
  .sidebar.mobile-open { transform: translateX(0); }

  /* Show sidebar labels on mobile drawer */
  .sidebar-label {
    display: inline !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    max-width: none !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
  }
  /* Override desktop column layout to row for mobile drawer */
  .sidebar-item {
    flex-direction: row !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 14px !important;
    padding: 13px 20px !important;
    border-radius: 8px !important;
    margin: 2px 8px !important;
    width: calc(100% - 16px) !important;
    font-size: 14px !important;
    height: auto !important;
    min-height: 48px !important;
    text-align: left !important;
  }
  .sidebar-icon {
    flex-shrink: 0;
    width: 22px !important;
    height: 22px !important;
  }
  /* Hide globe logo on mobile — top bar takes its place */
  .sidebar-logo { display: none !important; }
  .sidebar-bottom {
    flex-direction: row !important;
    padding: 12px 20px !important;
    gap: 12px !important;
    align-items: center !important;
    justify-content: flex-start !important;
  }
  .sidebar-avatar-btn { width: auto !important; }
  .sidebar-bottom-icon-btn { width: 40px !important; height: 40px !important; }

  /* ── 4. Main content: full width, below top bar ── */
  .main-content {
    margin-left: 0 !important;
    height: auto !important;
    min-height: 100vh;
    overflow-y: visible !important;
    padding-top: 52px;
  }

  /* ── 5. View containers ── */
  .view-container {
    padding: 4px 12px 24px !important;
    min-height: auto !important;
  }

  /* ── 6. Dashboard ── */
  .view-container.dashboard-view {
    padding: 4px 12px 24px !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
  .dashboard-content {
    overflow: visible !important;
    flex: none !important;
    height: auto !important;
    gap: 12px !important;
  }
  .db-kpi-row { grid-template-columns: repeat(2, 1fr) !important; flex-shrink: 0 !important; }
  .db-main-grid { grid-template-columns: 1fr !important; flex: none !important; height: auto !important; }
  .db-bottom-grid { grid-template-columns: 1fr !important; flex: none !important; height: auto !important; }
  .db-card { flex: none !important; height: auto !important; }
  .db-card-body { max-height: 240px; overflow-y: auto; }
  .db-kpi-sub { display: none; }

  /* ── 7. List view headers ── */
  .list-view-header { margin-bottom: 10px; }
  .list-view-title-row { flex-wrap: wrap; gap: 8px; }
  .list-view-filters { flex-direction: column; gap: 8px; }
  .filter-search-left { width: 100%; }
  .filter-dropdowns-right { width: 100%; flex-wrap: wrap; gap: 6px; }
  .filter-dropdowns-right select { flex: 1; min-width: 100px; font-size: 12px; }

  /* ── 8. Tables: horizontal scroll ── */
  .list-body { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 500px; font-size: 12px !important; }
  .data-table th { padding: 8px 10px !important; font-size: 10px !important; }
  .data-table td { padding: 10px 10px !important; font-size: 12px !important; }

  /* ── 9. Detail pages ── */
  .detail-page-view {
    padding: 8px 12px 24px !important;
    min-height: auto !important;
  }
  .ov-grid { grid-template-columns: 1fr !important; }
  .ov-2col, .ov-3col { grid-template-columns: 1fr !important; }

  /* ── 10. Detail page header: stack ── */
  .detail-page-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }
  .detail-page-actions { width: 100% !important; flex-wrap: wrap !important; gap: 8px !important; }
  .detail-page-actions button { flex: 1; min-width: 100px; font-size: 12px !important; height: auto !important; padding: 8px 10px !important; }

  /* ── 11. ov-modals: slide up from bottom ── */
  .ov-modal {
    max-width: 100% !important;
    max-height: 92vh !important;
    margin: 0 !important;
    border-radius: 16px 16px 0 0 !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
  }
  .ov-modal-overlay { align-items: flex-end !important; }
  .ov-modal-body { max-height: 60vh !important; overflow-y: auto !important; }

  /* ── 12. Wizards: full screen ── */
  .modal { padding: 8px !important; }
  .wizard-card {
    max-width: 100% !important;
    width: 100% !important;
    max-height: calc(100vh - 16px) !important;
    height: calc(100vh - 16px) !important;
    border-radius: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  .wizard-header { padding: 14px 44px 0 14px !important; flex-shrink: 0 !important; }
  .wizard-step-bar { overflow-x: auto; padding-bottom: 4px; margin-bottom: 8px !important; }
  .wizard-body {
    padding: 12px 14px !important;
    flex: 1 !important;
    overflow-y: auto !important;
    min-height: 0 !important;
  }
  .wizard-footer { padding: 10px 14px !important; flex-shrink: 0 !important; }
  .wizard-step-title { font-size: 15px !important; margin-bottom: 2px !important; }
  .wizard-step-subtitle { font-size: 12px !important; margin-bottom: 14px !important; }

  /* ── 13. Wizard charges: horizontal scroll ── */
  .qw-charges-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .quote-charges-table { font-size: 11px !important; min-width: 280px; }
  .quote-charges-table td { padding: 5px 6px !important; }

  /* ── 14. Detail tabs: horizontal scroll ── */
  .detail-tab-btn { white-space: nowrap; }

  /* ── 15. Quote HTML viewer: min-width + horizontal scroll ── */
  .quote-html-frame-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .quote-html-frame-wrap iframe {
    min-width: 700px !important;
    width: 700px !important;
  }
}

@media (max-width: 480px) {
  .db-kpi-row { grid-template-columns: 1fr 1fr !important; }
  .db-kpi-number { font-size: 20px !important; }
  .db-kpi-label { font-size: 10px !important; }
  .view-container { padding: 12px 10px 20px !important; }
}
