/* ══ Reset & Base ══ */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f5f5f5;
  color: #333;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: 52px;
}
input, select, textarea, button {
  font-size: 14px;
  font-family: inherit;
}
button {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  transition: opacity 0.15s;
}
button:active { opacity: 0.75; }
button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ══ Layout ══ */
#app { max-width: 500px; margin: 0 auto; min-height: 100vh; }
.page-title { font-size: 18px; font-weight: 600; padding: 12px 16px; background: #fff; border-bottom: 1px solid #eee; }
.content { padding: 12px 16px; }

/* ══ Login ══ */
.login-box {
  max-width: 320px; margin: 80px auto 0; padding: 32px 24px;
  background: #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.login-box h2 { text-align: center; font-size: 20px; margin-bottom: 24px; color: #07C160; }
.login-box input {
  width: 100%; padding: 10px 12px; margin-bottom: 12px;
  border: 1px solid #ddd; border-radius: 6px; outline: none;
}
.login-box input:focus { border-color: #07C160; }
.login-box .btn-login {
  width: 100%; padding: 10px; background: #07C160; color: #fff;
  font-size: 16px; font-weight: 600; border-radius: 6px;
}
.login-error { color: #e53e3e; font-size: 13px; text-align: center; margin-top: 8px; display: none; }
.login-box .remember-row {
  display: flex; align-items: center; gap: 6px; margin-bottom: 12px; font-size: 13px; color: #666; cursor: pointer;
}
.login-box .remember-row input[type="checkbox"] { width: auto; margin: 0; accent-color: #07C160; }

/* ══ Bottom Tab Bar ══ */
.tab-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 500px; height: 50px;
  background: #fff; border-top: 1px solid #e5e5e5;
  display: flex; z-index: 100;
  padding: 0 4px;
}
.tab-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-size: 11px; color: #999; gap: 1px;
  cursor: pointer; border: none; background: none;
  padding: 4px 0; min-width: 0;
}
.tab-item .tab-icon { font-size: 18px; }
.tab-item.active { color: #07C160; }

/* ══ Calendar ══ */
.calendar { background: #fff; border-radius: 8px; padding: 8px; }
.calendar-header { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px 8px; }
.calendar-header .month-label { font-size: 15px; font-weight: 600; }
.calendar-header button { padding: 4px 10px; background: #f0f0f0; font-size: 16px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.calendar-weekday { text-align: center; font-size: 12px; color: #999; padding: 4px 0; }
.calendar-day {
  text-align: center; padding: 6px 2px 4px; border-radius: 6px;
  cursor: pointer; min-height: 48px; font-size: 14px; font-weight: 600;
  position: relative; transition: background 0.15s;
}
.calendar-day:hover { background: #e8f8ef; }
.calendar-day.empty { cursor: default; }
.calendar-day.empty:hover { background: none; }
.calendar-day.today { border: 2px solid #07C160; }
.calendar-day.selected { background: #e8f8ef; }
.calendar-day .day-num { display: block; }
.calendar-day .day-count { font-size: 11px; font-weight: 400; margin-top: 2px; }
.calendar-day .day-count.green { color: #07C160; }
.calendar-day .day-count.orange { color: #e8590c; }
.calendar-day .day-count.red { color: #e53e3e; }
.calendar-day .day-count.yellow { color: #f0a030; }
/* 排班状态 — 仅改状态文字颜色，日历格子和日期数字不变色 */
.sched-status-up   { color: #07C160; }
.sched-status-wash { color: #f0a030; }
.sched-status-rest { color: #e53e3e; }

/* ══ Workorder Card ══ */
.wo-card {
  background: #fff; border-radius: 8px; padding: 12px;
  margin-bottom: 8px; border-left: 4px solid #ddd;
}
.wo-card.dispatched { border-left-color: #07C160; background: #f0fdf5; }
.wo-card.undispatched { border-left-color: #f0a030; background: #fffdf0; }
.wo-card.canceled { border-left-color: #ccc; background: #f5f5f5; }
.wo-card .wo-field { font-size: 13px; line-height: 1.7; }
.wo-card .wo-field .label { color: #999; margin-right: 4px; }
.wo-card .wo-field.bottom { font-size: 12px; color: #999; }
.wo-card .wo-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.wo-card .wo-actions button { font-size: 12px; padding: 6px 12px; border-radius: 4px; }
.btn-dispatch { background: #07C160; color: #fff; }
.btn-changetime { background: #1971c2; color: #fff; }
.btn-delete { background: #e53e3e; color: #fff; }
.btn-forward { background: #6d28d9; color: #fff; }
.btn-service { background: #e67e22; color: #fff; }

/* ══ Forms ══ */
.form-section { background: #fff; border-radius: 8px; padding: 14px; margin-bottom: 10px; }
.form-group { margin-bottom: 12px; }
.form-group label { font-size: 13px; color: #666; display: block; margin-bottom: 4px; font-weight: 500; }
.form-group input, .form-group select {
  width: 100%; padding: 9px 10px; border: 1px solid #ddd;
  border-radius: 6px; outline: none; background: #fff;
}
.form-group input:focus, .form-group select:focus { border-color: #07C160; }
.form-group input.readonly { background: #f5f5f5; color: #999; }
.form-row { display: flex; gap: 8px; }
.form-row .form-group { flex: 1; }
.btn-primary { background: #07C160; color: #fff; font-weight: 600; padding: 10px 24px; font-size: 15px; }
.btn-block { display: block; width: 100%; }
.btn-sm { font-size: 12px; padding: 5px 10px; }
.btn-outline { background: #fff; border: 1px solid #ddd; color: #333; }
.btn-outline.active { border-color: #07C160; color: #07C160; background: #e8f8ef; }

/* ══ Option buttons (house type etc) ══ */
.opt-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.opt-btn {
  padding: 6px 14px; border-radius: 16px; background: #f5f5f5;
  border: 1px solid #e5e5e5; font-size: 13px; color: #666;
}
.opt-btn.active { background: #e8f8ef; border-color: #07C160; color: #07C160; }

/* ══ Checkbox group ══ */
.cb-group { display: flex; flex-wrap: wrap; gap: 8px; }
.cb-group label { display: flex; align-items: center; gap: 4px; font-size: 13px; cursor: pointer; }
.cb-group input[type="checkbox"] { width: auto; }

/* ══ Modal / Popup ══ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center; z-index: 200;
}
.modal-box { background: #fff; border-radius: 12px; padding: 20px; min-width: 280px; max-width: 90vw; max-height: 70vh; overflow-y: auto; }
.modal-box h3 { font-size: 16px; margin-bottom: 12px; }
.modal-box .modal-actions { display: flex; gap: 8px; margin-top: 16px; justify-content: flex-end; }

/* ══ Utilities ══ */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mb-8 { margin-bottom: 8px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.text-red { color: #e53e3e; }
.text-green { color: #07C160; }
.text-orange { color: #e8590c; }
.text-gray { color: #999; }

/* ══ Account list ══ */
.acct-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid #f0f0f0;
}
.acct-item .acct-info { font-size: 13px; flex: 1; }
.acct-item .acct-actions { display: flex; gap: 6px; }

/* ══ Schedule grid for manage ══ */
.sched-day {
  text-align: center; padding: 6px 2px 4px; border-radius: 6px;
  cursor: pointer; min-height: 56px; font-size: 13px;
  transition: background 0.15s;
}
.sched-day:hover { background: #e8f8ef; }
.sched-day .s-num { font-weight: 600; display: block; }
.sched-day .s-up { display: block; font-size: 11px; color: #07C160; }
.sched-day .s-wash { display: block; font-size: 11px; color: #f0a030; }
.sched-day .s-rest { display: block; font-size: 11px; color: #e53e3e; }

/* ══ Chart placeholder ══ */
.chart-area { background: #fff; border-radius: 8px; padding: 16px; min-height: 200px; margin-top: 10px; }
.chart-area canvas { width: 100% !important; }

/* ══ Segment buttons ══ */
.segment { display: flex; background: #f0f0f0; border-radius: 8px; overflow: hidden; }
.segment button {
  flex: 1; padding: 8px; background: none; border-radius: 0;
  font-size: 13px; color: #666;
}
.segment button.active { background: #07C160; color: #fff; }

/* ══ Change hint ══ */
.back-arrow { color: #666; user-select: none; }
.back-arrow:hover { color: #07C160; }

.cancel-banner {
  background: #fff5f5; border: 1px solid #e53e3e; border-radius: 8px;
  padding: 10px 14px; margin: 8px 0; text-align: center;
}

.btn-acknowledge { background: #e53e3e; color: #fff; }
.btn-confirm { background: #07C160; color: #fff; }
.btn-confirm.confirmed { background: #aaa; color: #fff; cursor: default; }

.tel-link {
  display: inline-block; font-size: 18px; margin-left: 6px;
  text-decoration: none; vertical-align: middle; color: #1a73e8;
}

.change-hint {
  background: #e8f8ef; border-radius: 6px; padding: 8px 12px;
  font-size: 13px; color: #07C160; margin: 8px 0;
}

/* �T�T Modal �T�T */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); z-index: 9999;
  display: flex; align-items: center; justify-content: center;
}
.modal-box {
  background: #fff; border-radius: 12px; width: 90%; max-width: 500px;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid #eee;
  font-size: 16px; font-weight: 600;
}
.modal-body { padding: 16px; }
.modal-footer { padding: 12px 16px; border-top: 1px solid #eee; }
.btn-close { background: none; border: none; font-size: 20px; cursor: pointer; color: #999; padding: 0 4px; line-height: 1; }

/* �T�T Photo overlay �T�T */
.photo-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.9); z-index: 99999;
  display: flex; align-items: center; justify-content: center;
}
.photo-overlay img { max-width: 95%; max-height: 95%; object-fit: contain; }
.overlay-close { position: absolute; top: 16px; right: 16px; background: rgba(255,255,255,0.2); border: none; color: #fff; font-size: 24px; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; }

/* �T�T Attachment thumbnails �T�T */
.att-thumb { transition: transform 0.15s; }
.att-thumb:hover { transform: scale(1.05); }

/* �T�T Finance summary �T�T */
.finance-summary {
  display: flex; gap: 8px;
}
.summary-row {
  flex: 1; text-align: center; padding: 12px 8px;
  background: #f8f9fa; border-radius: 8px; font-size: 13px;
}
.summary-row .val { display: block; font-size: 18px; margin-top: 4px; color: #333; }

/* �T�T Info list (detail view) �T�T */
.info-list { font-size: 14px; }
.info-row { margin-bottom: 6px; display: flex; }
.info-row .lbl { color: #999; min-width: 70px; flex-shrink: 0; }
.info-row .val { color: #333; word-break: break-all; }

/* �T�T Button group (filter toggle) �T�T */
.btn-group .btn-sm.active { background: #07C160; color: #fff; border-color: #07C160; }

/* �T�T Action button variants �T�T */
.mb-8 { margin-bottom: 8px; }
.btn-lg { padding: 14px 20px; font-size: 16px; font-weight: 600; }

/* ── Date Picker (Monday-start) ── */
.dp-input { cursor:pointer; background:#fafafa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E") no-repeat right 12px center !important; padding-right:36px !important; }
.date-picker-overlay { position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.35); z-index:10000; display:flex; align-items:center; justify-content:center; }
.date-picker-box { background:#fff; border-radius:14px; width:330px; max-width:92vw; padding:18px; box-shadow:0 10px 40px rgba(0,0,0,0.18); }
.dp-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.dp-nav { background:none; border:none; font-size:18px; cursor:pointer; padding:6px 12px; color:#333; border-radius:6px; }
.dp-nav:hover { background:#f5f5f5; }
.dp-title { font-size:17px; font-weight:700; color:#333; }
.dp-weekdays { display:grid; grid-template-columns:repeat(7,1fr); text-align:center; font-size:12px; color:#999; font-weight:600; margin-bottom:6px; }
.dp-weekdays div { padding:6px 0; }
.dp-grid { display:grid; grid-template-columns:repeat(7,1fr); text-align:center; gap:2px; }
.dp-day { padding:10px 0; font-size:14px; cursor:pointer; border-radius:8px; color:#333; }
.dp-day:hover { background:#e8f8ee; }
.dp-day.dp-today { color:#07C160; font-weight:700; }
.dp-day.dp-selected { background:#07C160; color:#fff; font-weight:700; }
.dp-day.dp-selected.dp-today { background:#07C160; color:#fff; }
.dp-day.dp-empty { cursor:default; }
.dp-footer { text-align:center; margin-top:14px; }
.dp-today-btn { background:none; border:1px solid #07C160; color:#07C160; padding:7px 20px; border-radius:8px; font-size:13px; cursor:pointer; }
.dp-today-btn:hover { background:#e8f8ee; }

/* ═══ 数据 Tab 按钮网格 ═══ */
.data-btn-grid {
  display: flex; flex-direction: column; gap: 12px;
}
.data-btn {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 20px 18px;
  background: #fff; border: none; border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  cursor: pointer; transition: transform 0.12s, box-shadow 0.12s;
  text-align: left;
}
.data-btn:active { transform: scale(0.98); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.data-btn-icon { font-size: 28px; }
.data-btn-label { font-size: 16px; font-weight: 600; color: #333; }

/* 数据表格 */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.data-table th { background: #f0f2f5; padding: 10px 8px; text-align: left; font-weight: 600; color: #555; position: sticky; top: 0; }
.data-table td { padding: 8px; border-bottom: 1px solid #eee; color: #333; }
.data-table tr:hover { background: #f7f8fa; }

/* 报价 */
.quote-cat-card { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid #e8e8e8; border-radius: 12px; padding: 16px; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.quote-cat-card:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.quote-cat-icon { font-size: 28px; flex-shrink: 0; }
.quote-cat-name { font-size: 16px; font-weight: 700; color: #333; }
.quote-cat-arrow { font-size: 22px; color: #ccc; margin-left: auto; }
.quote-cat-card:nth-child(1) { background: linear-gradient(135deg, #e8f4fd, #dceefb); border-color: #b3d9f2; }
.quote-cat-card:nth-child(2) { background: linear-gradient(135deg, #eaf7e4, #ddf2d3); border-color: #b8d9a3; }
.quote-cat-card:nth-child(3) { background: linear-gradient(135deg, #fff3e0, #ffe8cc); border-color: #f5c489; }
.quote-cat-card:nth-child(4) { background: linear-gradient(135deg, #f3e8f7, #e9d6f2); border-color: #c9a8d9; }


/* 底部上滑导航菜单 */
.nav-sheet-mask { position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,0.45); opacity: 0; transition: opacity .2s; }
.nav-sheet-mask.show { opacity: 1; }
.nav-sheet { position: absolute; left: 0; right: 0; bottom: 0; background: #fff; border-radius: 16px 16px 0 0; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .25s ease; }
.nav-sheet-mask.show .nav-sheet { transform: translateY(0); }
.nav-sheet-grabber { width: 40px; height: 4px; border-radius: 2px; background: #ddd; margin: 0 auto 12px; }
.nav-sheet-title { font-size: 15px; font-weight: 600; color: #333; margin-bottom: 4px; text-align: center; line-height: 1.4; word-break: break-all; }
.nav-sheet-hint { font-size: 11px; color: #999; margin-bottom: 12px; text-align: center; }
.nav-sheet-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px 16px; border: none; border-radius: 12px; font-size: 16px; font-weight: 600; color: #fff; cursor: pointer; margin-bottom: 8px; text-align: left; }
.nav-sheet-btn .ico { font-size: 20px; flex-shrink: 0; }
.nav-sheet-btn .sub { margin-left: auto; font-size: 11px; font-weight: 400; opacity: 0.85; }
.nav-sheet-btn.tx { background: #07c160; }
.nav-sheet-btn.amap { background: #1677ff; }
.nav-sheet-btn.baidu { background: #ff4d4f; }
.nav-sheet-btn:active { opacity: 0.85; }
.nav-sheet-cancel { display: block; width: 100%; padding: 13px; border: none; border-radius: 12px; background: #f2f2f2; color: #333; font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 2px; }
