/* 小马哥运营工作台 - 样式 */

:root {
  --primary: #1565C0;
  --primary-light: #E3F2FD;
  --primary-dark: #0D47A1;
  --accent: #1565C0;
  --accent-light: #E3F2FD;
  --danger: #C62828;
  --success: #2E7D32;
  --bg: #FFFFFF;
  --bg-alt: #F8F6F3;
  --card: #FFFFFF;
  --text: #1A1A1A;
  --text-secondary: #888888;
  --text-light: #888888;
  --border: #E8E8E8;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(0,0,0,0.04);
  --sidebar-w: 200px;
  --sidebar-bg: #F8F6F3;
  --sidebar-text: #1A1A1A;
  --sidebar-active: #1565C0;
  --font-en: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-zh: 'PingFang SC', 'Noto Sans SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
}

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

body {
  font-family: var(--font-zh);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
}

/* ========== Login ========== */
.login-overlay {
  position: fixed;
  inset: 0;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.login-card {
  text-align: center;
  padding: 40px 32px;
  max-width: 360px;
  width: 90%;
}
.login-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  font-size: 15px;
  font-family: var(--font-en);
  text-align: center;
  letter-spacing: 0.1em;
  transition: border-color 0.2s;
}
.login-input:focus { outline: none; border-color: var(--primary); }
.login-select { outline: none; transition: border-color 0.2s; }
.login-select:focus { border-color: var(--primary); }
.login-error { font-size: 12px; color: var(--danger); margin-top: 8px; min-height: 18px; }

/* ========== App Shell ========== */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ========== Sidebar ========== */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  font-family: var(--font-en);
  z-index: 200;
  color: var(--text);
}

.sidebar-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 4px;
}
.sidebar-brand img {
  border-radius: 8px;
  width: 26px;
  height: 26px;
}
.sidebar-title {
  font-size: 14px;
  font-weight: 600;
  color: #171C1D;
  line-height: 20px;
  font-family: var(--font-en);
}

.sidebar-user {
  margin-top: 24px;
  text-align: center;
  cursor: pointer;
  padding: 8px;
  border-radius: 10px;
  transition: background 0.15s;
}
.sidebar-user:hover { background: rgba(0,0,0,0.03); }
.user-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  margin: 0 auto 8px;
  background: #e8eaeb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.user-name {
  font-size: 22px;
  font-weight: 600;
  color: #171C1D;
  line-height: 28px;
}
.user-role {
  font-size: 10px;
  font-weight: 400;
  color: #bbb;
  line-height: 14px;
  margin-top: 2px;
  font-family: var(--font-en);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-nav {
  margin-top: 32px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 8px;
  border-left: 3px solid transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.4;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}
.nav-item .nav-text {
  display: flex;
  flex-direction: column;
  line-height: 1.4;
}
.nav-item:hover {
  background: rgba(21,101,192,0.05);
  color: var(--text);
}
.nav-item.active {
  background: rgba(21,101,192,0.08);
  color: var(--primary);
  font-weight: 600;
  border-left-color: var(--primary);
}
.nav-icon {
  width: 18px; height: 18px;
  margin-right: 8px;
  flex-shrink: 0;
}
.nav-dot {
  width: 18px; height: 18px;
  background: var(--danger);
  border-radius: 50%;
  color: #FFF;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
}
.nav-zh { font-size: 14px; font-weight: inherit; color: inherit; }
.nav-en { font-size: 10px; color: var(--text-light); font-family: var(--font-en); font-weight: 400; }
.nav-item.active .nav-en { color: var(--primary); opacity: 0.7; }

.sidebar-footer { margin-top: auto; padding-top: 16px; }
.logout-btn {
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-light);
  line-height: 20px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-en);
  transition: color 0.15s;
}
.logout-btn:hover { color: var(--text); }
.logout-icon {
  width: 16px; height: 16px;
  margin-right: 12px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 199;
}

/* ========== Main Content ========== */
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 20px 40px;
  -webkit-overflow-scrolling: touch;
}

/* ========== Views ========== */
.view { display: none; }
.view.active { display: block; animation: fadeUp 0.3s ease both; }

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

/* ========== Mobile Bar ========== */
.mobile-bar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 4px 8px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 50;
}
.menu-btn { background: none; border: none; font-size: 20px; cursor: pointer; padding: 4px 8px; color: var(--text); }
.mobile-title { font-size: 15px; font-weight: 600; flex: 1; }

/* ========== Buttons ========== */
.btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; font-family: var(--font-en); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); font-weight: 500; }
.btn-outline:hover { background: #e8eaeb; }
.btn-block { display: block; width: 100%; padding: 12px; font-size: 14px; margin-top: 10px; }

/* ========== Date Bar ========== */
.date-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 0;
  margin-bottom: 4px;
}
.orders-top-bar .date-bar {
  justify-content: center;
}
.date-nav { background: none; border: none; font-size: 14px; color: var(--primary); cursor: pointer; padding: 4px 8px; font-weight: 600; }
.date-input {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  font-family: var(--font-en);
  background: #fff;
}

/* ========== Search ========== */
.search-bar { margin-bottom: 4px; }
.search-input {
  width: 100%;
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(101,132,196,0.08); }

/* ========== Summary ========== */
.summary-bar { text-align: center; font-size: 12px; color: var(--text-light); padding: 6px 0; }

/* ========== Kanban ========== */
.empty-state { text-align: center; color: var(--text-light); padding: 60px 20px; font-size: 14px; }

.route-section {
  background: var(--card);
  border-radius: 0 10px 10px 0;
  margin-bottom: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
}
.route-header {
  padding: 10px 14px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8f9fa;
  border-bottom: 1px solid var(--border);
}
.route-header .count { font-weight: 400; color: var(--text-light); font-size: 12px; font-family: var(--font-en); }

/* ========== Order Row (2-line layout) ========== */
.order-row {
  padding: 10px 14px;
  border-bottom: 1px solid #f5f6f7;
  cursor: pointer;
  transition: background 0.12s, transform 0.1s;
}
.order-row:last-child { border-bottom: none; }
.order-row:hover { background: #f5f8fa; }
.order-row:active { transform: scale(0.99); }
.order-row.cancelled { opacity: 0.5; text-decoration: line-through; }

.order-main {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.order-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}
.order-right {
  float: right;
  display: flex;
  align-items: center;
  gap: 4px;
}

.order-row .remark-dot { font-size: 12px; cursor: pointer; flex-shrink: 0; opacity: 0.4; transition: opacity 0.15s; }
.order-row .remark-dot:hover { opacity: 1; }
.order-row .remark-input {
  padding: 4px 6px; border: 1px solid var(--primary); border-radius: 4px;
  font-size: 12px; font-family: inherit; outline: none; width: 120px;
}
.order-row .order-no {
  color: var(--primary);
  font-size: 10px;
  font-family: var(--font-en);
  cursor: pointer;
  background: #f5f6f8;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}
.order-row .order-no:hover { background: #eef0f4; }
.order-row .copyable { cursor: pointer; }
.order-row .copyable:hover { text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
.order-row .sep { color: #d1d5db; font-size: 10px; }
.order-row .val { font-weight: 600; font-size: 14px; }
.order-row .order-sub .val { font-size: 11px; font-weight: 500; }
.order-row .val.dim { color: var(--text-light); font-weight: 400; }
.order-row .arrow { color: #d1d5db; font-size: 16px; flex-shrink: 0; }
.order-row .tag { font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 600; flex-shrink: 0; }
.tag.warn { background: #FFF3E0; color: #E65100; }
.tag.info { background: #FFEBEE; color: #C62828; }

/* ========== Dashboard ========== */
.view#viewDashboard { padding-top: 6px; }

/* Month selector bar */
.dash-month-bar {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}
.month-input {
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--font-en);
  background: #fff;
  cursor: pointer;
  font-weight: 500;
  color: var(--text);
}
.month-input:focus { outline: none; border-color: var(--primary); }

/* Header greeting */
.dash-header {
  margin-bottom: 6px;
}
.dash-greeting {
  font-family: var(--font-en);
  font-size: 38px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
}
.dash-greeting span {
  color: #1565C0;
}
.dash-quote {
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 4px;
  font-style: italic;
}

/* Top row: left(greeting+month+cards) + right(calendar) */
.dash-top-row {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
  align-items: stretch;
}
.dash-top-left {
  flex: 6;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dash-top-row .dash-calendar {
  flex: 4;
  min-width: 280px;
}
.dash-top-left .dash-summary-cards {
  margin-top: 10px;
}
.dash-top-left .dash-header {
  margin-bottom: 2px;
}
.dash-top-left .dash-month-bar {
  margin-bottom: 2px;
}

/* Middle row: left (line chart) + right (progress/hot dates/bar chart) */
.dash-middle-row {
  display: flex;
  gap: 20px;
  margin-bottom: 0;
  align-items: stretch;
}
.dash-left-col {
  flex: 6;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.dash-left-col .dash-chart-box {
  flex: 1;
}
.dash-right-col {
  flex: 4;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* bar chart in right column */
.dash-right-col .dash-chart-box {
  flex: 1;
  min-height: 160px;
}
.dash-right-col .dash-chart-box canvas {
  height: 140px;
  max-height: 140px;
}

/* 4 cards in 1 row */
.dash-summary-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

/* Charts in left col */
.dash-left-col .dash-chart-box {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.dash-left-col .dash-chart-box canvas {
  flex: 1;
  min-height: 200px;
}

/* Right col widgets */
.dash-widget {
  background: var(--card);
  border-radius: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow);
}
.dash-widget .widget-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.dash-widget .widget-icon { font-size: 16px; flex-shrink: 0; }
.dash-widget .widget-text { font-size: 12px; color: var(--text); flex: 1; }
.dash-widget .widget-val { font-size: 14px; font-weight: 700; font-family: var(--font-en); }
.dash-widget .widget-meta { font-size: 10px; color: var(--text-secondary); font-family: var(--font-en); }
.progress-bar-wrap {
  flex: 1;
  height: 6px;
  background: #e8e8e8;
  border-radius: 3px;
  overflow: hidden;
  min-width: 60px;
}
.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.6s ease;
}

/* Bottom row: route overview full width (second screen) */
.dash-bottom-row {
  background: #FFFFFF;
  margin: 0 -20px;
  padding: 24px 20px 32px;
  border-top: 1px solid var(--border);
}
.dash-card {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: fadeUp 0.4s ease both;
}
.dash-card:nth-child(1) { animation-delay: 0.05s; }
.dash-card:nth-child(2) { animation-delay: 0.1s; }
.dash-card:nth-child(3) { animation-delay: 0.15s; }
.dash-card:nth-child(4) { animation-delay: 0.2s; }

.dash-card .dash-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}
.dash-card .dash-sep {
  width: 48px;
  height: 0;
  border-bottom: 1px solid #E8E8E8;
  margin: 8px 0;
}
.dash-card .dash-num {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  font-family: var(--font-en);
  letter-spacing: -0.03em;
  line-height: 1;
}
.dash-card .dash-change {
  font-size: 11px;
  font-weight: 500;
  margin-top: 6px;
  font-family: var(--font-en);
  color: var(--text-secondary);
}
.dash-card .dash-change.up { color: #C62828; }
.dash-card .dash-change.down { color: #2E7D32; }

/* Calendar widget */
.dash-calendar {
  background: #092B42;
  border-radius: 14px;
  padding: 12px 14px;
  border: none;
  display: flex;
  flex-direction: column;
  color: #c8cdd0;
}
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.cal-nav {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #8a9295;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-en);
}
.cal-nav:hover { background: rgba(255,255,255,0.1); color: #F0F2F3; }
.cal-month {
  font-size: 13px;
  font-weight: 600;
  color: #F0F2F3;
  font-family: var(--font-en);
}
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 10px;
  color: #6a7378;
  margin-bottom: 4px;
  font-family: var(--font-en);
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-family: var(--font-en);
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  color: #c8cdd0;
  transition: background 0.15s;
  gap: 1px;
  padding: 3px 0;
}
.cal-day-num { line-height: 1; }
.cal-order-cnt {
  font-size: 9px;
  font-weight: 600;
  color: #FDB338;
  line-height: 1;
  background: rgba(253,179,56,0.2);
  border-radius: 3px;
  padding: 0 3px;
  min-width: 14px;
  text-align: center;
}
.cal-cell:hover { background: rgba(255,255,255,0.08); }
.cal-cell.today {
  font-weight: 700;
  color: #FDB338;
  background: rgba(253,179,56,0.15);
  border-radius: 6px;
}
.cal-cell.other-month { color: #4a5560; }
.cal-cell.has-event::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 4px;
  width: 5px; height: 5px;
  border-radius: 50%;
}
.cal-cell.evt-rest::after { background: #C62828; }
.cal-cell.evt-maintain::after { background: #1565C0; }
.cal-cell.evt-closed::after { background: #2E7D32; }
.cal-cell.evt-other::after { background: #888888; }
.cal-cell.selected {
  background: #1565C0;
  color: #fff;
  font-weight: 600;
}

/* Calendar tags */
.cal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.cal-tag {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 12px;
  border: none;
  background: rgba(255,255,255,0.08);
  color: #8a9295;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  white-space: nowrap;
}
.cal-tag:hover { background: rgba(255,255,255,0.15); color: #F0F2F3; }
.cal-tag.tag-rest.active { background: #C62828; color: #fff; }
.cal-tag.tag-maintain.active { background: #1565C0; color: #fff; }
.cal-tag.tag-closed.active { background: #2E7D32; color: #fff; }
.cal-tag.tag-other.active { background: #888; color: #fff; }
.cal-note {
  margin-top: 8px;
}
.cal-note-input {
  width: 100%;
  padding: 6px 8px;
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  font-size: 11px;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.15s;
  background: rgba(255,255,255,0.05);
  color: #F0F2F3;
}
.cal-note-input:focus { outline: none; border-color: #FDB338; }
.cal-note-input::placeholder { color: #6a7378; }

/* Chart boxes */
.dash-chart-box {
  background: var(--card);
  border-radius: 16px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.dash-chart-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.dash-chart-sub {
  font-size: 10px;
  color: #bbb;
  font-family: var(--font-en);
  font-weight: 500;
  margin-left: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.dash-chart-box canvas { max-height: 300px; margin-top: 16px; }

/* Hot dates (in right column) */
.dash-hot-dates {
  background: var(--card);
  border-radius: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.hot-dates-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}
.hot-dates-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.hot-date-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f8f9fa;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-family: var(--font-en);
  border: 1px solid var(--border);
}
.hot-date-item .hd-rank {
  font-weight: 700;
  font-size: 10px;
  color: #fff;
  background: var(--chart-orange);
  border-radius: 50%;
  width: 18px; height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hot-date-item:nth-child(1) .hd-rank { background: #FF6B35; }
.hot-date-item:nth-child(2) .hd-rank { background: #FFB400; }
.hot-date-item:nth-child(3) .hd-rank { background: #45B7AA; }
.hot-date-item .hd-date { font-weight: 600; color: var(--text); }
.hot-date-item .hd-count { color: var(--text-secondary); font-size: 11px; }

/* Channels-style route cards */
.dash-channels {
}
.dash-channels-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}
.dash-channels-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.channel-card {
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  border-left: 3px solid #888;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}
.channel-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.channel-card:active {
  transform: scale(0.98);
}
.channel-card .ch-icon {
  display: none;
}
.channel-card .ch-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.channel-card .ch-stat {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.channel-card .ch-change {
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-en);
  margin-top: 4px;
  color: var(--text-secondary);
}

/* Route modal */
#routeModalBody {
  max-height: 60vh;
  overflow-y: auto;
}
.route-sub-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.route-sub-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #f9fafb;
  border-radius: 8px;
}
.route-sub-bar {
  flex: 1;
  height: 8px;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
}
.route-sub-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.route-sub-name {
  font-size: 12px;
  font-weight: 500;
  min-width: 120px;
  color: var(--text);
}
.route-sub-pct {
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-en);
  min-width: 42px;
  text-align: right;
  color: var(--text);
}
.route-sub-revenue {
  font-size: 11px;
  font-family: var(--font-en);
  color: var(--text-secondary);
  min-width: 70px;
  text-align: right;
}
.route-sub-orders {
  font-size: 11px;
  font-family: var(--font-en);
  color: var(--text-light);
  min-width: 40px;
  text-align: right;
}

/* Orders page top bar */
.orders-top-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}
.orders-top-bar .search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.orders-top-bar .search-input {
  flex: 1;
}
.orders-top-bar .date-bar {
  padding: 0;
  margin-bottom: 0;
  justify-content: center;
}

/* Big import button */
.btn-import-lg {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: var(--font-en);
  transition: background 0.15s, transform 0.1s;
}
.btn-import-lg:hover { background: var(--primary-dark); }
.btn-import-lg:active { transform: scale(0.97); }

/* Search bar with import button */
.search-bar {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 4px;
}
.search-input {
  flex: 1;
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(16,81,134,0.08); }
/* ========== Messages ========== */
.view#viewMessages { padding-top: 24px; }
.message-board {
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  overflow: hidden;
  border: 1px solid var(--border);
}
.msg-header {
  padding: 18px 24px;
  font-family: var(--font-en);
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.msg-count { color: var(--primary); font-size: 12px; font-weight: 600; font-family: var(--font-en); }
.msg-body { border-top: 1px solid #f5f5f5; padding: 16px 24px; }
.msg-list { max-height: 400px; overflow-y: auto; margin-bottom: 12px; }
.msg-item {
  font-size: 13px; padding: 8px 0; border-bottom: 1px solid #fafafa;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
}
.msg-item:last-child { border-bottom: none; }
.msg-item .msg-text { flex: 1; word-break: break-all; }
.msg-item .msg-time { font-size: 10px; color: #ccc; white-space: nowrap; font-family: var(--font-en); }
.msg-item .msg-del { font-size: 11px; color: #ccc; cursor: pointer; border: none; background: none; padding: 0; }
.msg-item .msg-del:hover { color: var(--danger); }
.msg-input-row { display: flex; gap: 8px; }
.msg-input {
  flex: 1; padding: 8px 12px; border: 1.5px solid var(--border);
  border-radius: 8px; font-size: 13px; font-family: inherit; transition: border-color 0.15s;
}
.msg-input:focus { outline: none; border-color: var(--primary); }

/* ========== Modal ========== */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 300;
}
.modal.active { display: flex; align-items: center; justify-content: center; padding-top: 0; }
.modal-backdrop {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.3); backdrop-filter: blur(2px);
}
.modal-content {
  position: relative; background: var(--card); border-radius: 16px;
  width: 100%; max-width: 600px; max-height: 80vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(9,43,66,0.15);
  margin: 20px;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--card);
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close {
  background: none; border: none; font-size: 18px; cursor: pointer;
  color: var(--text-light); padding: 4px 8px; border-radius: 6px;
}
.modal-close:hover { background: #f5f5f5; }
.modal-body { padding: 16px 20px; }

.tabs { display: flex; gap: 0; margin-bottom: 14px; }
.tab {
  flex: 1; padding: 8px; border: 1.5px solid var(--border); background: #f8f9fa;
  font-size: 13px; font-weight: 600; cursor: pointer; text-align: center;
  font-family: inherit; transition: background 0.15s;
}
.tab:first-child { border-radius: 8px 0 0 8px; }
.tab:last-child { border-radius: 0 8px 8px 0; }
.tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

.paste-area {
  width: 100%; height: 150px; border: 1.5px solid var(--border);
  border-radius: 10px; padding: 12px; font-size: 13px;
  font-family: 'SF Mono', Menlo, monospace; resize: vertical; transition: border-color 0.15s;
}
.paste-area:focus { outline: none; border-color: var(--primary); }
.parse-result { margin-top: 10px; font-size: 12px; color: var(--text-light); }

.upload-zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 30px; border: 2px dashed var(--border); border-radius: 12px;
  cursor: pointer; font-size: 14px; color: var(--text-light);
  transition: border-color 0.15s, background 0.15s;
}
.upload-zone:hover { border-color: var(--primary); background: var(--primary-light); }
.upload-hint { font-size: 12px; color: #bbb; margin-top: 6px; }
.excel-preview { margin-top: 10px; font-size: 12px; max-height: 200px; overflow-y: auto; }

.template-text {
  background: #1e293b; color: #e2e8f0; border-radius: 10px; padding: 18px;
  font-family: 'SF Mono', Menlo, monospace; font-size: 12px; line-height: 1.8;
  white-space: pre-wrap; word-break: break-all;
}
.copy-feedback { text-align: center; font-size: 13px; color: var(--success); margin-top: 8px; opacity: 0; transition: opacity 0.3s; }
.copy-feedback.show { opacity: 1; }

.field-label { display: block; font-size: 12px; font-weight: 600; color: #555; margin-top: 10px; margin-bottom: 4px; }
.field-input {
  width: 100%; padding: 8px 10px; border: 1.5px solid var(--border);
  border-radius: 8px; font-size: 13px; font-family: inherit;
  transition: border-color 0.15s; background: #fff;
}
.field-input:focus { outline: none; border-color: var(--primary); }

.ocr-section { margin-bottom: 12px; }
.ocr-dropzone {
  display: flex; flex-direction: column; align-items: center; padding: 14px 16px;
  border: 2px dashed var(--primary); border-radius: 10px; cursor: pointer;
  font-size: 13px; color: var(--primary); background: var(--primary-light);
  outline: none; transition: background 0.2s, border-color 0.2s;
}
.ocr-dropzone:focus { border-color: var(--primary-dark); background: #dbeafe; }
.ocr-dropzone small { font-size: 11px; color: #888; margin-top: 4px; }
.ocr-file-link { color: var(--primary); text-decoration: underline; cursor: pointer; }
.ocr-status { font-size: 12px; color: var(--text-light); margin-top: 6px; text-align: center; }

.passenger-card {
  background: #f9fafb; border: 1.5px solid var(--border); border-radius: 10px;
  padding: 10px 12px; margin-top: 8px; display: grid;
  grid-template-columns: 1fr 1fr 1fr; gap: 6px;
}
.passenger-card input {
  padding: 6px 8px; border: 1px solid #ddd; border-radius: 6px;
  font-size: 12px; font-family: inherit;
}
.passenger-card input:focus { outline: none; border-color: var(--primary); }
.passenger-card .passenger-label { font-size: 10px; color: #888; grid-column: span 1; }
.passenger-card .passenger-remove {
  grid-column: 1 / -1; text-align: right; font-size: 11px;
  color: var(--danger); cursor: pointer; border: none; background: none;
}

.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: #1e293b; color: #fff; padding: 10px 20px; border-radius: 20px;
  font-size: 13px; z-index: 400; opacity: 0; transition: opacity 0.3s; pointer-events: none;
}
.toast.show { opacity: 1; }

.hidden { display: none !important; }

/* ========== Desktop ========== */
@media (min-width: 769px) {
  .mobile-bar { display: none; }
  .main-content { padding-top: 28px; }
}

/* ========== Mobile ========== */
@media (max-width: 768px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%); transition: transform 0.25s ease; box-shadow: none;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,0.15); }
  .sidebar-overlay.show { display: block; }
  .mobile-bar { display: flex; }
  .main-content { padding: 0 12px 40px; }

  .dash-greeting { font-size: 22px; }
  .dash-summary-cards { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .dash-top-row { flex-direction: column; gap: 12px; }
  .dash-top-row .dash-calendar { min-width: unset; }
  .dash-middle-row { flex-direction: column; gap: 12px; }
  .dash-right-col { min-width: unset; }
  .dash-calendar { min-width: unset; }
  .dash-bottom-row { margin-bottom: 12px; }
  .dash-channels-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-card .dash-num { font-size: 24px; }
  .dash-card { padding: 14px; }
  .hot-dates-list { gap: 6px; }
  .hot-date-item { font-size: 11px; padding: 5px 10px; }

  .order-row .val { font-size: 13px; }
  .order-row .order-sub .val { font-size: 10px; }
  .modal.active { padding-top: 16px; }
  .modal-content { border-radius: 16px 16px 0 0; max-height: 90vh; }
}

#msgNavDot { display: none; }
