/* UNILINK CRM — Logo 配色：深蓝 #010066 + 金 #FCC800 */

:root {
  /* 主色 */
  --brand-navy: #010066;
  --brand-navy-2: #1a2080;
  --brand-navy-3: #4a5099;
  --brand-gold: #FCC800;
  --brand-gold-2: #d4a800;
  --brand-gold-3: #ffd933;

  /* 中性色 */
  --bg: #f7f8fc;
  --bg-card: #ffffff;
  --border: #e1e4eb;
  --text: #0f1a2e;
  --text-2: #4a556b;
  --text-3: #8a93a7;

  /* 状态色 */
  --green: #2da558;
  --green-bg: #e8f6ee;
  --orange: #e8843c;
  --orange-bg: #fdf0e3;
  --red: #d8364a;
  --red-bg: #fbe7ea;
  --blue: #2c87d4;
  --blue-bg: #e7f1fb;

  --shadow-sm: 0 1px 2px rgba(1, 0, 102, 0.06);
  --shadow: 0 4px 12px rgba(1, 0, 102, 0.08);
  --shadow-lg: 0 8px 32px rgba(1, 0, 102, 0.12);
  --radius: 8px;
  --radius-lg: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--brand-navy); text-decoration: none; }
a:hover { text-decoration: underline; }

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

/* ============== 顶栏 Header ============== */
.app-header {
  background: var(--brand-navy);
  color: #fff;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.5px;
}

.app-header .logo svg { display: block; }

.app-header nav {
  display: flex;
  gap: 4px;
  align-items: center;
  flex: 1;
  margin-left: 32px;
}

.app-header nav a {
  color: rgba(255, 255, 255, 0.85);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  transition: background 0.15s;
}

.app-header nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
}

.app-header nav a.active {
  background: var(--brand-gold);
  color: var(--brand-navy);
  font-weight: 600;
}

.app-header .right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-header .role-pill {
  background: var(--brand-gold);
  color: var(--brand-navy);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.app-header .lang-toggle {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 4px 10px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
}

.app-header .lang-toggle:hover {
  background: rgba(255, 255, 255, 0.22);
}

.app-header .username {
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
}

.app-header .logout-btn {
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 4px 10px;
  border-radius: var(--radius);
  font-size: 12px;
}

.app-header .logout-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* ============== 主区域 ============== */
.app-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--brand-navy);
}

.page-subtitle {
  color: var(--text-2);
  margin: 0 0 20px;
  font-size: 13px;
}

/* ============== 卡片 ============== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.card.no-padding { padding: 0; }
.card h2 { margin: 0 0 16px; font-size: 16px; color: var(--brand-navy); }
.card h3 { margin: 0 0 12px; font-size: 14px; color: var(--text-2); font-weight: 600; }

.card-grid {
  display: grid;
  gap: 16px;
}
.card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.card-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .card-grid.cols-3, .card-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .card-grid.cols-2, .card-grid.cols-3, .card-grid.cols-4 { grid-template-columns: 1fr; }
}

/* 统计卡片 */
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 6px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--brand-navy);
  margin: 0;
}

.stat-sub {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 4px;
}

.stat.gold {
  background: linear-gradient(135deg, var(--brand-gold) 0%, var(--brand-gold-2) 100%);
  color: var(--brand-navy);
  border-color: var(--brand-gold-2);
}
.stat.gold .stat-label, .stat.gold .stat-value, .stat.gold .stat-sub {
  color: var(--brand-navy);
}

.stat.navy {
  background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-navy-2) 100%);
  color: #fff;
}
.stat.navy .stat-label { color: rgba(255, 255, 255, 0.7); }
.stat.navy .stat-value { color: #fff; }
.stat.navy .stat-sub { color: rgba(255, 255, 255, 0.85); }

/* ============== 表格 ============== */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  background: #fafbfd;
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

tbody td {
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  color: var(--text);
}

tbody tr:hover { background: #f6f7fb; cursor: pointer; }
tbody tr:last-child td { border-bottom: none; }

/* 阶段徽章 */
.stage-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.stage-enquiry { background: #f1f3f9; color: #5a6480; }
.stage-application_submitted { background: var(--blue-bg); color: var(--blue); }
.stage-con_offer { background: #fff5d9; color: #a07a00; }
.stage-full_offer { background: var(--orange-bg); color: var(--orange); }
.stage-deposit { background: #e8e8fb; color: #4a4abf; }
.stage-coe { background: #fbe7f4; color: #a8408b; }
.stage-visa_lodged { background: #d9efff; color: #1c5fae; }
.stage-visa_granted { background: var(--green-bg); color: var(--green); }

/* 渠道徽章 */
.channel-pill {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  background: #f0f2f7;
  color: var(--text-2);
}
.channel-pill.unilink {
  background: var(--brand-gold);
  color: var(--brand-navy);
  font-weight: 700;
}

/* ============== 筛选条 ============== */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-bar input, .filter-bar select {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  background: #fff;
  font-family: inherit;
}

.filter-bar input:focus, .filter-bar select:focus {
  outline: 2px solid var(--brand-gold);
  outline-offset: -1px;
}

.filter-bar button {
  background: var(--brand-navy);
  color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 13px;
}

.filter-bar button:hover { background: var(--brand-navy-2); }

.filter-bar button.secondary {
  background: #fff;
  color: var(--text-2);
  border: 1px solid var(--border);
}

/* ============== 漏斗 / 进度 ============== */
.funnel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
}

.funnel-label { width: 180px; color: var(--text); font-weight: 500; }
.funnel-count { width: 50px; text-align: right; font-weight: 700; color: var(--brand-navy); }
.funnel-pct { width: 50px; text-align: right; color: var(--text-2); font-size: 12px; }

.funnel-bar-track {
  flex: 1;
  height: 14px;
  background: #f0f2f7;
  border-radius: 7px;
  overflow: hidden;
}

.funnel-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-navy) 0%, var(--brand-navy-2) 100%);
  border-radius: 7px;
  transition: width 0.3s;
}

.funnel-bar-fill.gold {
  background: linear-gradient(90deg, var(--brand-gold) 0%, var(--brand-gold-2) 100%);
}

/* ============== 学生详情时间线 ============== */
.timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 0;
  font-size: 12px;
}

.timeline-step {
  background: #f0f2f7;
  color: var(--text-3);
  padding: 4px 10px;
  border-radius: 999px;
  position: relative;
}

.timeline-step.done {
  background: var(--green-bg);
  color: var(--green);
  font-weight: 600;
}

.timeline-step.current {
  background: var(--brand-gold);
  color: var(--brand-navy);
  font-weight: 700;
  box-shadow: 0 0 0 3px var(--brand-gold-3);
}

.timeline-step .date {
  font-size: 10px;
  opacity: 0.8;
  margin-left: 4px;
}

/* ============== 登录页 ============== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-navy-2) 100%);
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-gold) 0%, var(--brand-gold-2) 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.login-logo .brand {
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-navy);
  letter-spacing: 1.5px;
}

.login-logo .sub {
  font-size: 12px;
  color: var(--text-2);
  letter-spacing: 0.5px;
}

.login-card h1 {
  font-size: 18px;
  margin: 0 0 6px;
  color: var(--brand-navy);
  text-align: center;
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.login-card input {
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
}

.login-card input:focus {
  outline: 2px solid var(--brand-gold);
  outline-offset: -1px;
  border-color: var(--brand-navy);
}

.login-card button {
  padding: 11px 16px;
  background: var(--brand-navy);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  margin-top: 4px;
}

.login-card button:hover { background: var(--brand-navy-2); }
.login-card button:disabled { opacity: 0.5; cursor: not-allowed; }

.login-card .lang-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 12px;
}

.login-card .lang-row a {
  color: var(--text-3);
}

.login-card .err {
  background: var(--red-bg);
  color: var(--red);
  padding: 8px 10px;
  border-radius: var(--radius);
  font-size: 12px;
  text-align: center;
}

/* ============== 通用按钮 ============== */
.btn {
  display: inline-block;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary { background: var(--brand-navy); color: #fff; }
.btn-primary:hover { background: var(--brand-navy-2); }
.btn-gold { background: var(--brand-gold); color: var(--brand-navy); }
.btn-gold:hover { background: var(--brand-gold-2); }
.btn-secondary { background: #fff; color: var(--text-2); border: 1px solid var(--border); }
.btn-secondary:hover { background: #f6f7fb; }
.btn-danger { background: var(--red); color: #fff; }

/* 加载 / 空状态 */
.loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-3);
}

.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-3);
  font-size: 13px;
}

/* 工具类 */
.muted { color: var(--text-3); }
.text-right { text-align: right; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
