/* ============================================
   客户报备管理系统 - 全局样式
   简约商务风格
   ============================================ */

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

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  font-size: 14px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

/* === 布局 === */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* === 顶部导航 === */
.navbar {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.navbar-brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.navbar-nav { display: flex; gap: 4px; align-items: center; }
.navbar-nav a {
  padding: 8px 16px;
  border-radius: var(--radius);
  color: var(--gray-600);
  font-size: 14px;
  transition: all 0.15s;
}
.navbar-nav a:hover { background: var(--gray-100); text-decoration: none; color: var(--gray-800); }
.navbar-nav a.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.navbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--gray-500);
}
.navbar-user .badge {
  background: var(--primary);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
}

/* === 侧边栏 === */
.layout { display: flex; gap: 20px; min-height: calc(100vh - 56px); }
.sidebar {
  width: 220px;
  background: white;
  border-right: 1px solid var(--gray-200);
  padding: 16px 0;
  flex-shrink: 0;
}
.sidebar-section { margin-bottom: 8px; }
.sidebar-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gray-400);
  padding: 8px 20px;
  letter-spacing: 0.5px;
}
.sidebar a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  color: var(--gray-600);
  font-size: 14px;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}
.sidebar a:hover { background: var(--gray-50); text-decoration: none; color: var(--gray-800); }
.sidebar a.active { background: var(--primary-light); color: var(--primary-dark); border-left-color: var(--primary); font-weight: 600; }
.content { flex: 1; padding: 24px; min-width: 0; }

/* === 卡片 === */
.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  margin-bottom: 20px;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  font-weight: 600;
  font-size: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-body { padding: 20px; }

/* === 统计卡片 === */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
}
.stat-card .stat-label { font-size: 13px; color: var(--gray-500); margin-bottom: 4px; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; color: var(--gray-900); }
.stat-card .stat-icon { font-size: 24px; margin-bottom: 8px; }

/* === 表单 === */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.form-label .required { color: var(--danger); }
.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 14px;
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
textarea.form-control { min-height: 80px; resize: vertical; }
select.form-control { cursor: pointer; }
.form-hint { font-size: 12px; color: var(--gray-400); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* === 按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  font-family: inherit;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #b45309; }
.btn-outline {
  background: white;
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
}
.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-400); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn-block { width: 100%; }

/* === 表格 === */
.table-container { overflow-x: auto; }
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  background: var(--gray-50);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--gray-600);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}
.data-table tr:hover td { background: var(--gray-50); }
.data-table .text-center { text-align: center; }

/* === 状态标签 === */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}
.badge-pending { background: var(--warning-light); color: var(--warning); }
.badge-assigned { background: var(--primary-light); color: var(--primary-dark); }
.badge-approved { background: var(--success-light); color: var(--success); }
.badge-rejected { background: var(--danger-light); color: var(--danger); }
.badge-needs_update { background: #fef3c7; color: #92400e; }
.badge-active { background: var(--success-light); color: var(--success); }
.badge-disabled { background: var(--danger-light); color: var(--danger); }
.badge-admin { background: #ede9fe; color: #6d28d9; }
.badge-staff { background: var(--gray-100); color: var(--gray-600); }

/* === 提示框 === */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
}
.alert-error { background: var(--danger-light); color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: var(--success-light); color: #166534; border: 1px solid #bbf7d0; }
.alert-warning { background: var(--warning-light); color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: var(--primary-light); color: var(--primary-dark); border: 1px solid #bfdbfe; }

/* === 登录/注册页 === */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.auth-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  margin: 20px;
}
.auth-title { font-size: 24px; font-weight: 700; color: var(--gray-900); margin-bottom: 8px; }
.auth-subtitle { font-size: 14px; color: var(--gray-500); margin-bottom: 24px; }
.auth-logo { font-size: 36px; text-align: center; margin-bottom: 16px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--gray-500); }
.auth-tabs { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 2px solid var(--gray-200); }
.auth-tab { padding: 10px 20px; font-size: 14px; color: var(--gray-500); border-bottom: 2px solid transparent; margin-bottom: -2px; cursor: pointer; }
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* === 企业首页 === */
.home-page { min-height: 100vh; }
.home-header {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  padding: 16px 0;
}
.home-header .container { display: flex; justify-content: space-between; align-items: center; }
.home-hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  color: white;
  padding: 60px 0;
  text-align: center;
}
.home-hero h1 { font-size: 32px; font-weight: 700; margin-bottom: 12px; }
.home-hero p { font-size: 16px; opacity: 0.9; max-width: 600px; margin: 0 auto 24px; }
.home-hero .btn { font-size: 16px; padding: 12px 32px; }
.home-content { padding: 40px 0; }
.home-content .company-intro { font-size: 15px; color: var(--gray-600); line-height: 1.8; }
.home-image { width: 100%; max-height: 300px; object-fit: cover; border-radius: var(--radius); margin: 20px 0; }

/* === 详情页 === */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.detail-item { padding: 12px; background: var(--gray-50); border-radius: var(--radius); }
.detail-item .label { font-size: 12px; color: var(--gray-500); margin-bottom: 4px; }
.detail-item .value { font-size: 14px; color: var(--gray-800); font-weight: 500; }

/* === 时间线 === */
.timeline { padding-left: 20px; border-left: 2px solid var(--gray-200); }
.timeline-item { margin-bottom: 20px; position: relative; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -26px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
}
.timeline-item .timeline-time { font-size: 12px; color: var(--gray-400); }
.timeline-item .timeline-content { font-size: 14px; color: var(--gray-700); margin-top: 4px; }
.timeline-item .timeline-user { font-size: 13px; color: var(--primary); font-weight: 500; }

/* === 过滤栏 === */
.filter-bar {
  background: white;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.filter-bar .form-group { margin-bottom: 0; }
.filter-bar .form-control { min-width: 140px; }

/* === 空状态 === */
.empty-state { text-align: center; padding: 40px 20px; color: var(--gray-400); }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state .empty-text { font-size: 14px; }

/* === 工具类 === */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-400); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.d-flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.w-100 { width: 100%; }
.font-bold { font-weight: 700; }
.text-sm { font-size: 12px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 18px; }
.break-word { word-break: break-all; }
