/* 上门维修预约派单系统 - 主样式 */
:root {
  --primary: #2563EB;
  --primary-dark: #1d4ed8;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;
  --sidebar-w: 240px;
}

/* =================== 后台通用 =================== */
body.admin-body {
  background: #f1f5f9;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: #1e293b;
  overflow-y: auto;
  z-index: 100;
  transition: transform .3s;
}

.sidebar-logo {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: .75rem;
  color: #fff;
  text-decoration: none;
}
.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: #fff;
}
.sidebar-logo .logo-text {
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.2;
}

.sidebar-nav { padding: .5rem 0; }
.sidebar-section { padding: .5rem 1rem .25rem; font-size: .7rem; text-transform: uppercase; color: rgba(255,255,255,.35); letter-spacing: .08em; }
.sidebar-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem 1.25rem;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: .875rem;
  transition: all .15s;
  border-left: 3px solid transparent;
}
.sidebar-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.sidebar-item.active { color: #fff; background: rgba(37,99,235,.3); border-left-color: var(--primary); }
.sidebar-item i { width: 18px; text-align: center; font-size: 1rem; }

.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: .75rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}

.page-content { padding: 1.5rem; flex: 1; }

/* =================== 卡片 =================== */
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}
.stat-icon.blue  { background: #EFF6FF; color: var(--primary); }
.stat-icon.green { background: #ECFDF5; color: var(--success); }
.stat-icon.yellow{ background: #FFFBEB; color: var(--warning); }
.stat-icon.red   { background: #FEF2F2; color: var(--danger); }
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .8rem; color: #64748b; margin-top: .2rem; }

.card-box {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  overflow: hidden;
}
.card-box .card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 600;
}

/* =================== 用户/师傅/代理端 =================== */
body.front-body {
  background: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.front-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 1rem 1.25rem;
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
}
.front-header h1 { font-size: 1.1rem; margin: 0; font-weight: 600; }

/* =================== 底部导航（SVG图标，无外部字体依赖）=================== */
.front-nav {
  background: #fff;
  border-top: 1px solid #eef0f5;
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex;
  z-index: 100;
  box-shadow: 0 -1px 16px rgba(0,0,0,.07);
  /* 安全区适配（iPhone底部）*/
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-tab {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: .5rem .25rem .42rem;
  color: #b0b8cc;           /* 未激活：浅蓝灰，不刺眼 */
  text-decoration: none;
  font-size: .62rem;
  font-weight: 500;
  gap: .22rem;
  transition: color .18s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.nav-tab .nav-icon-wrap {
  width: 36px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px;
  transition: background .18s;
}
.nav-tab svg {
  width: 20px; height: 20px;
  fill: currentColor;
  display: block;
  flex-shrink: 0;
  transition: transform .18s;
}
.nav-tab span {
  display: block;
  line-height: 1;
  letter-spacing: .01em;
}
/* 激活态：图标区域加彩色胶囊背景 */
.nav-tab.active {
  color: var(--primary);
}
.nav-tab.active .nav-icon-wrap {
  background: rgba(37,99,235,.1);
}
.nav-tab.active svg {
  transform: scale(1.08);
}
/* 点击波纹 */
.nav-tab:active svg {
  transform: scale(.92);
}

.front-content { padding: 1rem; padding-bottom: 5rem; }

/* 服务卡片 */
.service-card {
  background: #fff;
  border-radius: 12px;
  padding: 1rem;
  display: flex; align-items: center; gap: .875rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  text-decoration: none;
  color: inherit;
  transition: transform .15s, box-shadow .15s;
}
.service-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.service-icon-wrap {
  width: 48px; height: 48px;
  background: #EFF6FF;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: var(--primary);
  flex-shrink: 0;
}

/* 订单状态时间轴 */
.order-timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.order-timeline::before {
  content: ''; position: absolute;
  left: 15px; top: 0; bottom: 0;
  width: 2px; background: #e2e8f0;
}
.timeline-item { display: flex; gap: 1rem; padding-bottom: 1.25rem; position: relative; }
.timeline-dot {
  width: 30px; height: 30px; border-radius: 50%;
  background: #e2e8f0; color: #94a3b8;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; flex-shrink: 0; z-index: 1;
}
.timeline-item.done .timeline-dot { background: var(--success); color: #fff; }
.timeline-item.active .timeline-dot { background: var(--primary); color: #fff; }

/* 登录页 */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #EFF6FF 0%, #F0FDF4 100%);
  padding: 1.5rem;
}
.login-box {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(37,99,235,.1);
  padding: 2rem;
  width: 100%; max-width: 400px;
}
.login-logo {
  text-align: center;
  margin-bottom: 1.75rem;
}
.login-logo .icon { font-size: 3rem; color: var(--primary); }
.login-logo h2 { font-size: 1.3rem; font-weight: 700; margin: .5rem 0 .25rem; }
.login-logo p { color: #64748b; font-size: .875rem; margin: 0; }

/* 表单 */
.form-label { font-weight: 500; font-size: .875rem; }
.form-control, .form-select {
  border-radius: 8px;
  border-color: #e2e8f0;
  padding: .6rem .875rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.btn-primary-custom {
  background: var(--primary);
  border: none; border-radius: 8px;
  color: #fff; font-weight: 600;
  padding: .7rem 1.5rem;
  width: 100%; font-size: 1rem;
  cursor: pointer; transition: background .15s;
}
.btn-primary-custom:hover { background: var(--primary-dark); }

/* 首页banner */
.home-banner {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 16px;
  padding: 1.5rem;
  color: #fff;
  margin-bottom: 1.25rem;
}
.home-banner h2 { font-size: 1.3rem; margin: 0 0 .5rem; }
.home-banner p { font-size: .875rem; opacity: .85; margin: 0; }

/* 订单卡片 */
.order-card {
  background: #fff;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: .75rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.order-card .order-no { font-size: .75rem; color: #94a3b8; }
.order-card .order-title { font-weight: 600; margin: .25rem 0; }

/* Toast */
.toast-container { position: fixed; top: 1rem; right: 1rem; z-index: 9999; }

/* 响应式 */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
}

/* 上传预览 */
.upload-preview {
  display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem;
}
.preview-img {
  width: 80px; height: 80px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid #e2e8f0;
}

/* 评分星星 */
.stars { color: #F59E0B; }

/* 徽章调整 */
.badge { font-weight: 500; }

/* 工单操作按钮 */
.action-btns { display: flex; gap: .5rem; flex-wrap: wrap; }

/* 无数据 */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #94a3b8;
}
.empty-state i { font-size: 3rem; margin-bottom: 1rem; }
.empty-state svg { width: 3rem; height: 3rem; margin-bottom: 1rem; fill: #94a3b8; }
