/* Mileage Map Generator - Enterprise Design System */
:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg-primary: #0b0f17;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --bg-card: #111827;
  --border-color: #2e384d;
  --border-focus: #3b82f6;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-primary: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: rgba(37, 99, 235, 0.12);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius-sm: 2px;
  --radius-md: 2px;
  --radius-lg: 3px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.35);
  --sidebar-width: 240px;
  --scrollbar-track: rgba(15, 23, 42, 0.4);
  --scrollbar-thumb: #334155;
  --scrollbar-thumb-hover: #475569;
}

[data-theme="light"] {
  color-scheme: light;
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --border-color: #cbd5e1;
  --border-focus: #1d4ed8;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --accent-primary: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-light: rgba(29, 78, 216, 0.08);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.08);
  --scrollbar-track: rgba(241, 245, 249, 0.6);
  --scrollbar-thumb: #cbd5e1;
  --scrollbar-thumb-hover: #94a3b8;
}

/* Custom Adaptive Scrollbar - dynamically matches dark/light mode */
html, body, * {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-hover);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* Layout */
#auth-container {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-primary);
  padding: 20px;
}

#app-container {
  display: none;
  width: 100vw;
  min-height: 100vh;
}

#app-container.active {
  display: flex;
}

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

.sidebar-brand {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  min-height: 68px;
}

.brand-logo-container {
  display: flex;
  align-items: center;
  text-decoration: none;
  width: 100%;
}

.brand-logo-img {
  height: 38px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

/* Auth Brand Logo */
.auth-brand-logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
}

.auth-brand-logo-img {
  height: 48px;
  width: auto;
  max-width: 280px;
  object-fit: contain;
  display: block;
}

/* Theme Switching for Brand Logos */
html[data-theme="dark"] .logo-light,
:root[data-theme="dark"] .logo-light {
  display: none !important;
}

html[data-theme="dark"] .logo-dark,
:root[data-theme="dark"] .logo-dark {
  display: block !important;
}

html[data-theme="light"] .logo-light,
:root[data-theme="light"] .logo-light {
  display: block !important;
}

html[data-theme="light"] .logo-dark,
:root[data-theme="light"] .logo-dark {
  display: none !important;
}

.nav-menu {
  list-style: none;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  user-select: none;
  border: 1px solid transparent;
}

.nav-item:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.nav-item.active {
  background-color: var(--accent-light);
  color: var(--accent-primary);
  font-weight: 600;
  border-color: rgba(37, 99, 235, 0.35);
}

.nav-item .nav-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-color: var(--bg-secondary);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.user-details {
  overflow: hidden;
}

.user-email {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.user-badge {
  font-size: 10px;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.user-badge::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background-color: var(--success);
}

/* Main Content Wrapper */
main.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
}

/* Header */
header.topbar {
  height: 60px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.page-title-group h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.page-title-group p {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

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

/* Content View */
.content-area {
  padding: 24px 28px;
  flex: 1;
}

.page-view {
  display: none;
}

.page-view.active {
  display: block;
}

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

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease;
}

.stat-card:hover {
  border-color: var(--accent-primary);
}

.stat-info span {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
}

.stat-info h3 {
  font-size: 24px;
  font-weight: 700;
  margin-top: 6px;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.stat-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* Quick Actions */
.section-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.action-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  user-select: none;
}

.action-card:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--accent-primary);
}

.action-card-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--accent-primary);
  flex-shrink: 0;
}

.action-card-text h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.action-card-text p {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

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

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

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

table.data-table td {
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  white-space: nowrap;
}

/* Only Origin and Destination cells wrap when necessary */
table.data-table td.cell-address,
table.data-table td.cell-origin,
table.data-table td.cell-dest,
#trips-table-body td:nth-child(2),
#trips-table-body td:nth-child(3),
#dashboard-recent-trips-body td:nth-child(2),
#dashboard-recent-trips-body td:nth-child(3),
#report-preview-table-body td:nth-child(2),
#report-preview-table-body td:nth-child(3),
#import-preview-body td:nth-child(2),
#import-preview-body td:nth-child(3),
#report-unverified-list td:nth-child(2),
#report-unverified-list td:nth-child(3) {
  white-space: normal !important;
  word-break: break-word;
  max-width: 320px;
}

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

table.data-table tbody tr:hover {
  background-color: var(--bg-tertiary);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  border: 1px solid transparent;
}

.badge-info {
  background-color: var(--accent-light);
  color: var(--accent-primary);
  border-color: rgba(37, 99, 235, 0.3);
}

.badge-success {
  background-color: rgba(16, 185, 129, 0.12);
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.3);
}

.badge-warning {
  background-color: rgba(245, 158, 11, 0.12);
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.3);
}

/* Uniform Distance & Reimbursement Badges */
.distance-badge-stack {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
  white-space: nowrap;
}

.distance-badge-stack .badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2.5px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  min-width: 68px;
  text-align: center;
  justify-content: center;
  box-sizing: border-box;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  user-select: none;
  line-height: 1.2;
}

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

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

.btn-success {
  background-color: #107c41;
  color: white;
  border-color: #107c41;
}

.btn-success:hover {
  background-color: #0b5e31;
  border-color: #0b5e31;
}

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

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

.btn-danger {
  background-color: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
}

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

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

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

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

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-card form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

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

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1;
  min-height: 0;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

/* Global No-Wrap enforcement */
.btn,
.btn-sm,
.btn-pill,
.btn-icon,
.badge,
.badge-verified,
.badge-unverified,
.anomaly-tag,
.audit-badge,
.settings-tab-btn,
.sidebar-nav-item,
.section-title,
.stat-card-title,
.stat-card-value,
.budget-name,
.summary-metric,
label,
.form-group label {
  white-space: nowrap;
}

/* Form inputs */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease;
}

.form-control:focus {
  border-color: var(--border-focus);
}

/* Date & Time Picker Controls with Dark Mode Support */
input[type="date"].form-control,
input[type="time"].form-control,
input[type="datetime-local"].form-control {
  cursor: pointer;
}

[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[type="datetime-local"] {
  color-scheme: dark;
}

[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.2);
  cursor: pointer;
  opacity: 0.85;
}

[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator:hover,
[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

[data-theme="light"] input[type="date"],
[data-theme="light"] input[type="time"],
[data-theme="light"] input[type="datetime-local"] {
  color-scheme: light;
}

[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="light"] input[type="time"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.75;
}

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

/* Map Container */
#map {
  width: 100%;
  height: 520px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  z-index: 10;
}

/* Auth Card */
.auth-box {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}



.auth-header p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 18px 0;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.auth-divider span {
  padding: 0 10px;
}

.google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 9px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

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

.apple-btn {
  background-color: #000000;
  color: #ffffff !important;
  border: 1px solid #000000;
}

.apple-btn:hover {
  background-color: #1f1f1f;
}

[data-theme="dark"] .apple-btn {
  background-color: #ffffff;
  color: #000000 !important;
  border: 1px solid #ffffff;
}

[data-theme="dark"] .apple-btn:hover {
  background-color: #e5e5ea;
}

/* Toast notifications */
#toast-container {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  right: calc(20px + env(safe-area-inset-right, 0px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10000;
  pointer-events: none;
}

@media (max-width: 640px) {
  #toast-container {
    bottom: auto;
    top: calc(16px + env(safe-area-inset-top, 0px));
    left: 14px;
    right: 14px;
    align-items: center;
  }
}

.toast {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: 380px;
  pointer-events: auto;
}

@media (max-width: 640px) {
  .toast {
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-info { border-left: 3px solid var(--accent-primary); }

/* Drag and drop import zone */
.drop-zone {
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  background-color: var(--bg-primary);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent-primary);
  background-color: var(--accent-light);
}

.drop-zone-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* iOS Safe Area & Mobile Responsive */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

@media (max-width: 900px) {
  aside.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.45);
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
  aside.sidebar.mobile-open {
    transform: translateX(0);
  }
  main.main-content {
    margin-left: 0;
    width: 100%;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
  }
  .mobile-menu-btn {
    display: inline-flex !important;
  }
  input, select, textarea {
    font-size: 16px !important; /* Prevents iOS auto-zoom on input focus */
  }
}

/* User Profile in Sidebar */
.clickable-profile {
  cursor: pointer;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.clickable-profile:hover {
  background-color: var(--bg-hover);
}

/* Settings Tabs */
.settings-tab-btn {
  background: none;
  border: none;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}

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

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

/* Table Button Groups */
.table-route-group,
.table-actions-group {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: nowrap;
}

.table-actions-group {
  justify-content: flex-end;
}

.table-route-group .btn,
.table-actions-group .btn {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* Admin Timeframe Filter Buttons */
.admin-timeframe-btn {
  font-size: 11.5px !important;
  padding: 4px 11px !important;
  font-weight: 600 !important;
  border-radius: var(--radius-sm) !important;
}

.admin-timeframe-btn.active {
  background-color: var(--accent-primary) !important;
  color: #ffffff !important;
  border-color: var(--accent-primary) !important;
}

/* Expense Code Tag Chips */
.expense-code-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.expense-code-chip .remove-code-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 2px;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.expense-code-chip .remove-code-btn:hover {
  color: var(--danger);
}

/* Quick-fill Pills for Office & Home */
.quick-fill-pills {
  display: flex;
  gap: 5px;
  align-items: center;
}

.btn-pill {
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.4;
}

.btn-pill:hover {
  background-color: var(--accent-light);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

/* Cost Center Budget & Spend Cards */
.budget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.budget-card {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.budget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.budget-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.budget-bar-track {
  width: 100%;
  height: 8px;
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

[data-theme="light"] .budget-bar-track {
  background-color: rgba(0, 0, 0, 0.08);
}

.budget-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.budget-stats-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

/* Mileage Anomaly Badges */
.anomaly-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 2px;
  font-size: 10.5px;
  font-weight: 600;
}

.anomaly-tag-danger {
  background-color: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

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

.anomaly-tag-info {
  background-color: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Audit Log Table */
.audit-badge {
  display: inline-block;
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Address Autocomplete Dropdown */
.address-autocomplete-wrapper {
  position: relative;
  width: 100%;
}

.address-suggestions-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 1050;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.45), 0 8px 10px -6px rgba(0, 0, 0, 0.25);
  max-height: 240px;
  overflow-y: auto;
  list-style: none;
  padding: 4px 0;
  margin: 0;
}

.address-suggestion-item {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  transition: background-color 0.12s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .address-suggestion-item {
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

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

.address-suggestion-item:hover,
.address-suggestion-item.active {
  background-color: var(--accent-light);
}

.address-suggestion-icon {
  color: var(--accent-primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.address-suggestion-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.address-suggestion-main {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.address-suggestion-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Calculating distance indicator pulse */
.distance-calculating-pulse {
  animation: pulseDistance 1.2s infinite ease-in-out;
}

@keyframes pulseDistance {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Import Preview Alert & Row Verification */
.import-warning-banner {
  background-color: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.45;
}

.import-row-flagged {
  background-color: rgba(245, 158, 11, 0.07) !important;
}

.import-row-flagged td {
  border-top: 1px solid rgba(245, 158, 11, 0.25) !important;
  border-bottom: 1px solid rgba(245, 158, 11, 0.25) !important;
}

.badge-verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-unverified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: help;
}

/* App Store Download Badge */
.sidebar-appstore-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 7px 11px;
  margin-bottom: 10px;
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
  width: 100%;
  transition: all 0.15s ease;
  user-select: none;
  outline: none;
}

.sidebar-appstore-btn:hover {
  background-color: rgba(37, 99, 235, 0.1);
  border-color: var(--accent-primary);
}

.sidebar-appstore-btn svg {
  flex-shrink: 0;
  color: var(--text-primary);
}

.appstore-badge-text {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.15;
}

.appstore-badge-sub {
  font-size: 8.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.appstore-badge-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}



