/* ==========================================================================
   顺通汽修 · 清爽专业蓝白风响应式样式（手机 App + 电脑宽屏工作台）
   零外部字体/框架依赖，极致小巧
   ========================================================================== */

:root {
  --bg: #F4F6FA;
  --surface: #FFFFFF;
  --surface-alt: #F8FAFC;
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-soft: #EFF6FF;
  --primary-border: #BFDBFE;
  --orange: #F97316;
  --orange-dark: #EA580C;
  --orange-soft: #FFF7ED;
  --orange-border: #FED7AA;
  --green: #10B981;
  --green-dark: #059669;
  --green-soft: #ECFDF5;
  --red: #EF4444;
  --red-soft: #FEF2F2;
  --text: #0F172A;
  --text-sub: #475569;
  --text-muted: #94A3B8;
  --border: #E2E8F0;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 6px 20px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 14px 36px rgba(15, 23, 42, 0.12);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --sidebar-w: 236px;
  --bottom-nav-h: 66px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

@media (max-width: 1023px) {
  input, textarea, select {
    font-size: 16px;
  }
}

button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Boot Loader */
.boot-loader {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text-sub);
}
.boot-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--primary-soft);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Login View (PWA App Style)
   ========================================================================== */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 40px;
  background: linear-gradient(180deg, #E8F1FF 0%, #F4F6FA 42%, #F4F6FA 100%);
}

.login-brand {
  text-align: center;
  margin-bottom: 26px;
}

.login-logo {
  width: 78px;
  height: 78px;
  border-radius: 20px;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.28);
  margin-bottom: 14px;
}

.login-title {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text);
}

.login-subtitle {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--text-sub);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 26px 22px 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(226, 232, 240, 0.7);
}

.login-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-wrap .field-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  display: flex;
  pointer-events: none;
}

.input-icon-wrap input {
  width: 100%;
  height: 50px;
  padding: 0 46px 0 42px;
  border-radius: 13px;
  border: 1.5px solid var(--border);
  background: var(--surface-alt);
  font-size: 16px;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.input-icon-wrap input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.eye-btn {
  position: absolute;
  right: 10px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-radius: 8px;
}
.eye-btn:hover { color: var(--text); }

.remember-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 20px;
  font-size: 14px;
  color: var(--text-sub);
  user-select: none;
  cursor: pointer;
}

.remember-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.login-hint {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 13px;
  text-align: center;
}

.login-footer {
  margin-top: 28px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ==========================================================================
   App Shell (Responsive Mobile + Desktop)
   ========================================================================== */
.app-shell {
  min-height: 100vh;
  display: flex;
}

/* Desktop Sidebar */
.sidebar {
  display: none;
}

.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 16px);
}

/* Mobile Top Header */
.mobile-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(244, 246, 250, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 12px 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.brand-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-inline img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.brand-inline .brand-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.3px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-sub);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.page-container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 16px 24px;
}

/* Mobile Bottom Nav */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.05);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  height: 100%;
}

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-item.cta-item {
  color: var(--primary);
}

.bottom-nav-cta-pill {
  width: 44px;
  height: 30px;
  border-radius: 15px;
  background: linear-gradient(135deg, #3B82F6, #1D4ED8);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

/* ==========================================================================
   Common Buttons, Cards, Pills & Realistic License Plates
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  transition: transform 0.1s, background 0.16s, box-shadow 0.16s, opacity 0.16s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #1D4ED8, #1E40AF);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--surface-alt);
  border-color: #CBD5E1;
}

.btn-soft-blue {
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.btn-soft-blue:hover:not(:disabled) {
  background: #DBEAFE;
}

.btn-green-outline {
  background: var(--green-soft);
  color: var(--green-dark);
  border: 1px solid #A7F3D0;
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 10px;
}
.btn-green-outline:hover:not(:disabled) {
  background: #D1FAE5;
}

.btn-danger-soft {
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid #FECACA;
}
.btn-danger-soft:hover:not(:disabled) {
  background: #FEE2E2;
}

.btn-sm {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 9px;
}

.btn-lg {
  height: 50px;
  font-size: 16px;
  border-radius: 14px;
}

.btn-block {
  width: 100%;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(226, 232, 240, 0.75);
}

/* Realistic Chinese License Plate Badges */
.plate-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  letter-spacing: 0.6px;
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 14px;
  line-height: 1.25;
  white-space: nowrap;
  user-select: all;
}

.plate-badge.plate-lg {
  font-size: 21px;
  padding: 7px 16px;
  border-radius: 10px;
  letter-spacing: 1px;
}

.plate-blue {
  background: linear-gradient(180deg, #2563EB 0%, #1D4ED8 100%);
  color: #FFFFFF;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.65), 0 2px 6px rgba(29, 78, 216, 0.24);
}

.plate-green {
  background: linear-gradient(180deg, #F0FDF4 0%, #BBF7D0 38%, #4ADE80 100%);
  color: #0F172A;
  box-shadow: inset 0 0 0 1.5px rgba(21, 128, 61, 0.55), 0 2px 6px rgba(22, 163, 74, 0.2);
}

.plate-yellow {
  background: linear-gradient(180deg, #FDE047 0%, #FACC15 100%);
  color: #0F172A;
  box-shadow: inset 0 0 0 1.5px rgba(15, 23, 42, 0.45);
}

/* Status & Category Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-maintenance {
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.badge-repair {
  background: var(--orange-soft);
  color: var(--orange-dark);
}
.badge-paid {
  background: var(--green-soft);
  color: var(--green-dark);
}
.badge-unpaid {
  background: #FFEDD5;
  color: #C2410C;
}

/* ==========================================================================
   Search Bar & KPI Strip
   ========================================================================== */
.workspace-top-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.search-box {
  position: relative;
  flex: 1;
}

.search-box .search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  display: flex;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 48px;
  padding: 0 42px 0 44px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 15px;
  transition: border-color 0.16s, box-shadow 0.16s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #E2E8F0;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.desktop-only-cta {
  display: none;
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.kpi-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 13px 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(226, 232, 240, 0.75);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: transform 0.15s, border-color 0.15s;
}

.kpi-card.clickable { cursor: pointer; }
.kpi-card.clickable:hover { border-color: var(--primary-border); }

.kpi-label {
  font-size: 12px;
  color: var(--text-sub);
  font-weight: 600;
}

.kpi-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-top: 2px;
  line-height: 1.2;
}

.kpi-value.text-orange { color: var(--orange-dark); }
.kpi-value.text-green { color: var(--green-dark); }
.kpi-sub {
  font-size: 11px;
  color: var(--orange-dark);
  font-weight: 600;
  margin-top: 2px;
}

.kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kpi-icon.blue { background: var(--primary-soft); color: var(--primary); }
.kpi-icon.green { background: var(--green-soft); color: var(--green-dark); }
.kpi-icon.indigo { background: #EEF2FF; color: #4F46E5; }
.kpi-icon.orange { background: var(--orange-soft); color: var(--orange); }

/* Section Header & Filter Tabs */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.section-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.filter-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.filter-pill {
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface);
  color: var(--text-sub);
  border: 1px solid var(--border);
  white-space: nowrap;
  transition: all 0.15s;
}

.filter-pill.active {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

/* ==========================================================================
   Mobile Vehicle & Record Cards
   ========================================================================== */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.vehicle-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 15px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(226, 232, 240, 0.8);
  cursor: pointer;
  transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s;
}

.vehicle-card:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-md);
}

.vehicle-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.vehicle-card-left {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.price-text {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}
.price-text.unpaid { color: var(--orange-dark); }

.vehicle-meta {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.maint-highlights {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
}

.maint-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--text);
}

.maint-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.maint-dot.blue { background: var(--primary); }
.maint-dot.orange { background: var(--orange); }

.maint-label {
  color: var(--text-sub);
  font-weight: 600;
  flex-shrink: 0;
}

/* Search Quick Create Banner */
.quick-create-banner {
  background: var(--primary-soft);
  border: 1.5px dashed var(--primary-border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  color: var(--text-sub);
}
.empty-state h3 {
  margin: 12px 0 6px;
  font-size: 17px;
  color: var(--text);
}
.empty-state p {
  margin: 0 0 18px;
  font-size: 14px;
}
.empty-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ==========================================================================
   Desktop Table + Split Quick Preview Panel
   ========================================================================== */
.desktop-workspace-split {
  display: none;
}

.data-table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  text-align: left;
  padding: 11px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 13px 12px;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}

.data-table tbody tr {
  cursor: pointer;
  transition: background 0.12s;
}

.data-table tbody tr:hover {
  background: #F8FAFC;
}

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

.link-btn {
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
}
.link-btn:hover { text-decoration: underline; }

/* ==========================================================================
   Vehicle Detail & Timeline View
   ========================================================================== */
.subpage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

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

.subpage-title {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
}

.profile-hero {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}

.profile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.phone-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 14px;
}

.dual-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.summary-box {
  border-radius: 14px;
  padding: 13px 14px;
}
.summary-box.blue {
  background: var(--primary-soft);
  border: 1px solid #DBEAFE;
}
.summary-box.orange {
  background: var(--orange-soft);
  border: 1px solid var(--orange-border);
}
.summary-box-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
}
.summary-box-main {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  margin: 3px 0 2px;
}
.summary-box-sub {
  font-size: 12px;
  color: var(--text-sub);
  word-break: break-word;
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.timeline-item {
  display: flex;
  gap: 12px;
  position: relative;
}

.timeline-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 6px;
  flex-shrink: 0;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2.5px solid #FFFFFF;
  box-shadow: 0 0 0 2px var(--primary);
  background: var(--primary);
}
.timeline-dot.repair {
  background: var(--orange);
  box-shadow: 0 0 0 2px var(--orange);
}

.timeline-line {
  width: 2px;
  flex: 1;
  background: var(--border);
  margin-top: 6px;
  min-height: 24px;
}

.timeline-item:last-child .timeline-line {
  display: none;
}

.timeline-card {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border-radius: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.timeline-date {
  font-weight: 800;
  font-size: 14px;
  color: var(--text);
}

.timeline-items-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 4px 0;
}

.timeline-note {
  font-size: 13px;
  color: var(--text-sub);
  background: var(--surface-alt);
  padding: 8px 10px;
  border-radius: 9px;
  margin-top: 8px;
}

.timeline-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

.sticky-bottom-cta {
  position: sticky;
  bottom: calc(var(--bottom-nav-h) + 12px);
  z-index: 20;
  margin-top: 18px;
}

/* ==========================================================================
   Quick Entry Form ("记一笔")
   ========================================================================== */
.form-stack {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 8px;
}

.plate-input-group {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.province-btn {
  min-width: 64px;
  height: 50px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  color: #FFFFFF;
  font-size: 19px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 12px;
  flex-shrink: 0;
}

.plate-text-input {
  flex: 1;
  min-width: 0;
  height: 50px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface-alt);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.plate-text-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.auto-match-banner {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 11px;
  background: var(--green-soft);
  color: #065F46;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.plate-suggestions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.plate-sugg-chip {
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.plate-sugg-chip:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  background: var(--bg);
  padding: 5px;
  border-radius: 13px;
}

.seg-btn {
  height: 44px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-sub);
  transition: all 0.16s;
}

.seg-btn.active-blue {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25);
}

.seg-btn.active-orange {
  background: var(--orange);
  color: #FFFFFF;
  box-shadow: 0 3px 10px rgba(249, 115, 22, 0.25);
}

.seg-btn.active-green {
  background: var(--green);
  color: #FFFFFF;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.25);
}

.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip {
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  background: var(--bg);
  color: var(--text);
  border: 1.5px solid transparent;
  transition: all 0.14s;
}

.tag-chip:hover {
  border-color: var(--primary-border);
}

.tag-chip.selected {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.22);
}

.custom-tag-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

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

.text-input, .textarea-input {
  width: 100%;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1.5px solid var(--border);
  background: var(--surface-alt);
  font-size: 15px;
  transition: border-color 0.15s, background 0.15s;
}

.text-input { height: 46px; }
.textarea-input { min-height: 82px; resize: vertical; }

.text-input:focus, .textarea-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.helper-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 7px;
}

.mini-chip {
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 600;
}
.mini-chip:hover { background: #DBEAFE; }

/* Province Picker Popover Modal */
.province-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.province-cell {
  height: 42px;
  border-radius: 10px;
  background: var(--bg);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  border: 1.5px solid transparent;
}
.province-cell.active {
  background: var(--primary);
  color: #FFFFFF;
}
.province-cell:hover:not(.active) {
  border-color: var(--primary);
}

/* ==========================================================================
   Stats & Credit Management View
   ========================================================================== */
.stats-hero-card {
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 60%, #1E40AF 100%);
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
  margin-bottom: 14px;
}

.stats-hero-label {
  font-size: 13px;
  opacity: 0.88;
}

.stats-hero-amount {
  font-size: 34px;
  font-weight: 800;
  margin: 4px 0 16px;
  letter-spacing: -0.5px;
}

.stats-hero-subgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.stats-hero-subitem .lbl {
  font-size: 12px;
  opacity: 0.82;
}
.stats-hero-subitem .val {
  font-size: 18px;
  font-weight: 800;
  margin-top: 2px;
}

.unpaid-alert-bar {
  background: var(--orange-soft);
  border: 1px solid var(--orange-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  color: #9A3412;
  font-weight: 700;
}

.stats-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.chart-bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  align-items: end;
  height: 165px;
  padding-top: 24px;
}

.chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 6px;
}

.chart-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-dark);
}

.chart-bar-track {
  width: 100%;
  max-width: 30px;
  flex: 1;
  background: #EFF6FF;
  border-radius: 8px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.chart-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, #3B82F6, #1D4ED8);
  border-radius: 8px 8px 4px 4px;
  min-height: 4px;
  transition: height 0.35s ease;
}

.chart-lbl {
  font-size: 12px;
  color: var(--text-sub);
  font-weight: 600;
}

.unpaid-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #F1F5F9;
}
.unpaid-row:last-child { border-bottom: none; }

/* ==========================================================================
   Settings View
   ========================================================================== */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  max-width: 820px;
}

.tag-manage-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
}

.tag-remove-x {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #CBD5E1;
  color: #FFFFFF;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tag-remove-x:hover { background: var(--red); }

/* ==========================================================================
   Modals & Toasts
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
}

.modal-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow-lg);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.toast-root {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 380px;
}

.toast {
  background: #0F172A;
  color: #FFFFFF;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: toastIn 0.2s ease;
}
.toast.success { background: #059669; }
.toast.error { background: #DC2626; }

/* Subtle calm network retry indicator (replaces scary red errors on weak networks) */
.net-banner {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 115;
  background: #1E3A8A;
  color: #FFFFFF;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.net-banner-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #60A5FA;
  animation: pulseDot 1s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

.offline-retry-bar {
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  color: #92400E;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
}

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

/* ==========================================================================
   Desktop Breakpoint (>= 1024px)
   ========================================================================== */
@media (min-width: 1024px) {
  .mobile-topbar,
  .bottom-nav,
  .mobile-only-list {
    display: none !important;
  }

  .sidebar {
    display: flex;
    flex-direction: column;
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 20px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
  }

  .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 8px 22px;
  }

  .sidebar-brand img {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.22);
  }

  .sidebar-brand .name {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.2;
  }

  .sidebar-brand .sub {
    font-size: 12px;
    color: var(--text-muted);
  }

  .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
  }

  .sidebar-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 14px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-sub);
    transition: background 0.14s, color 0.14s;
    text-align: left;
  }

  .sidebar-item:hover {
    background: var(--surface-alt);
    color: var(--text);
  }

  .sidebar-item.active {
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 700;
  }

  .sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
  }

  .main-area {
    padding-bottom: 24px;
  }

  .page-container {
    padding: 24px 28px 36px;
  }

  .desktop-only-cta {
    display: inline-flex;
  }

  .kpi-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
  }

  .kpi-card {
    padding: 18px 20px;
  }

  .kpi-value {
    font-size: 26px;
  }

  .desktop-workspace-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 16px;
    align-items: start;
  }

  .preview-sticky {
    position: sticky;
    top: 20px;
  }

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

  .modal-backdrop {
    align-items: center;
  }

  .sticky-bottom-cta {
    bottom: 20px;
  }
}
