/* ================================================================
   红心结招新系统 — 全局样式  v3.0
   设计方向：「边疆之光」— 温暖暗色 · 红心品牌 · 金暖点缀
   兼容桌面 / 平板 / 手机全尺寸
   ================================================================ */

/* ── CSS Variables ── */
:root {
  /* 品牌色 */
  --red: #E8192C;
  --red-light: #FF3B4E;
  --red-dark: #B81220;
  --red-glow: rgba(232, 25, 44, 0.22);
  --red-surface: rgba(232, 25, 44, 0.06);

  /* 暖金点缀 */
  --gold: #C8943E;
  --gold-light: #D4A94E;
  --gold-glow: rgba(200, 148, 62, 0.18);
  --gold-surface: rgba(200, 148, 62, 0.05);

  /* 背景层级 */
  --bg: #0D0C0C;
  --bg-alt: #111010;
  --bg-raised: #1A1818;
  --bg-overlay: rgba(13, 12, 12, 0.92);

  /* 卡片 & 表面 */
  --card-bg: rgba(255, 255, 255, 0.025);
  --card-bg-hover: rgba(255, 255, 255, 0.045);
  --card-border: rgba(255, 255, 255, 0.07);
  --card-border-hover: rgba(255, 255, 255, 0.13);

  /* 玻璃效果 */
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-bg-hover: rgba(255, 255, 255, 0.09);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-highlight: rgba(255, 255, 255, 0.06);

  /* 文字层级 */
  --text-primary: #F2F0EE;
  --text-secondary: #A8A5A0;
  --text-muted: #6B6762;
  --text-placeholder: #4A4742;

  /* 边框 */
  --border: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(232, 25, 44, 0.22);
  --border-focus: rgba(232, 25, 44, 0.35);

  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-red: 0 4px 20px rgba(232, 25, 44, 0.18);

  /* 字体 */
  --font-main: -apple-system, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-serif: "Noto Serif SC", "STSong", "Songti SC", "SimSun", serif;
  --font-mono: "SF Mono", "Fira Code", "Cascadia Code", monospace;

  /* 圆角 */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* 动效 */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Reset & Base ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body {
  font-family: var(--font-main);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-primary);
  background: var(--bg);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ── 背景氛围层 ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(232, 25, 44, 0.06) 0%, transparent 65%),
    radial-gradient(ellipse 50% 50% at 85% 80%, rgba(200, 148, 62, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 15% 30%, rgba(200, 148, 62, 0.03) 0%, transparent 55%),
    var(--bg);
  pointer-events: none;
}

/* ── 噪点纹理（低透明度叠加深度感） ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.35'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
  opacity: 0.025;
  pointer-events: none;
}

::selection { background: var(--red); color: #fff; }

a {
  color: var(--red);
  text-decoration: none;
  transition: color 0.25s var(--ease-out);
}
a:hover { color: var(--red-light); }

img { max-width: 100%; height: auto; }

/* ── Typography ── */
h1, h2, h3, h4, h5 { font-weight: 700; letter-spacing: 0.3px; line-height: 1.3; }
h1 { font-family: var(--font-serif); }
code { font-family: var(--font-mono); font-size: 0.88em; }

/* ── 动画关键帧 ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 var(--red-glow); }
  50%      { box-shadow: 0 0 0 8px transparent; }
}

/* ── Flash Messages ── */
.flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.55;
  animation: slideDown 0.4s var(--ease-out);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.flash-success {
  background: rgba(46, 204, 113, 0.1);
  color: #3dd68c;
  border: 1px solid rgba(46, 204, 113, 0.18);
}
.flash-error {
  background: rgba(232, 25, 44, 0.1);
  color: #FF5B6E;
  border: 1px solid rgba(232, 25, 44, 0.18);
}
.flash-info {
  background: rgba(74, 144, 217, 0.1);
  color: #7ab8f5;
  border: 1px solid rgba(74, 144, 217, 0.18);
}
.flash-warning {
  background: rgba(212, 160, 23, 0.1);
  color: #e8c84a;
  border: 1px solid rgba(212, 160, 23, 0.18);
}
.flash-icon { font-size: 17px; flex-shrink: 0; margin-top: 1px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.6px;
  cursor: pointer;
  transition: all 0.28s var(--ease-out);
  text-decoration: none;
  font-family: var(--font-main);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn-primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 2px 10px var(--red-glow);
}
.btn-primary:hover {
  background: var(--red-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px var(--red-glow);
}
.btn-primary:active { transform: translateY(0); box-shadow: 0 1px 4px var(--red-glow); }

.btn-secondary {
  background: var(--glass-bg);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}
.btn-secondary:hover {
  background: var(--glass-bg-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.btn-ghost {
  background: none;
  color: var(--text-secondary);
  padding: 6px 12px;
}
.btn-ghost:hover { color: var(--text-primary); background: var(--glass-bg); }

.btn-full { width: 100%; }
.btn-lg { padding: 14px 34px; font-size: 16px; border-radius: var(--radius); letter-spacing: 1px; }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 6px; }
.btn:disabled, .btn[disabled] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

/* ── Cards ── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
  transition: border-color 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.card:hover {
  border-color: var(--card-border-hover);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--text-primary);
}
.card-body { padding: 24px; }
.card-welcome {
  border-color: rgba(232, 25, 44, 0.14);
  background: rgba(232, 25, 44, 0.025);
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* ── Status Badge ── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
  color: var(--badge-color, #888);
  background: color-mix(in srgb, var(--badge-color, #888) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--badge-color, #888) 22%, transparent);
}
@supports not (color: color-mix(in srgb, red 10%, transparent)) {
  .status-badge { background: rgba(255, 255, 255, 0.05); }
}

/* ── Info Grid ── */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}
.info-item {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.018);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.03);
  transition: background 0.25s;
}
.info-item:hover { background: rgba(255, 255, 255, 0.035); }
.info-label {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.info-value { font-size: 14.5px; color: var(--text-primary); font-weight: 500; }

/* ── Forms ── */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
  letter-spacing: 0.3px;
}
.required { color: var(--red); }

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 15px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14.5px;
  font-family: var(--font-main);
  transition: all 0.25s var(--ease-out);
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--red);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(232, 25, 44, 0.08);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-placeholder); }

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B6762' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}
.form-group select option { background: var(--bg-raised); color: var(--text-primary); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-note { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.char-count { display: block; text-align: right; font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.form-section {
  padding: 26px 0;
  border-bottom: 1px solid var(--border);
}
.form-section:first-child { padding-top: 0; }
.form-section:last-child { border-bottom: none; padding-bottom: 0; }
.form-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 18px;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.form-section-title::before {
  content: '';
  width: 3px;
  height: 16px;
  background: var(--red);
  border-radius: 2px;
}
.form-actions { text-align: center; padding-top: 24px; }

/* ── File Upload ── */
.file-upload { position: relative; }
.file-upload input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 2;
}
.file-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 30px 20px;
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  text-align: center;
}
.file-upload:hover .file-upload-label,
.file-upload input[type="file"]:focus + .file-upload-label {
  border-color: var(--red);
  background: var(--red-surface);
}
.file-upload-icon { font-size: 34px; }
.file-upload-text { font-size: 14.5px; color: var(--text-secondary); font-weight: 600; }
.file-upload-hint { font-size: 12px; color: var(--text-muted); }

.file-preview { margin-top: 14px; text-align: center; }
.file-preview img {
  max-width: 180px;
  max-height: 180px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  object-fit: cover;
}

/* ── Tables ── */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.data-table th {
  padding: 13px 14px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.018);
  border-bottom: 2px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}
.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.035);
  color: var(--text-secondary);
  vertical-align: middle;
}
.data-table tbody tr {
  transition: background 0.2s;
}
.data-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.table-name {
  color: var(--text-primary);
  font-weight: 600;
  transition: color 0.2s;
}
.table-name:hover { color: var(--red); }

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.25s var(--ease-out);
  text-decoration: none;
}
.page-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.06);
}
.page-btn.active {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  box-shadow: 0 2px 8px var(--red-glow);
}

/* ── Auth Pages (Login / Register) ── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(232, 25, 44, 0.09) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 100%, rgba(200, 148, 62, 0.05) 0%, transparent 50%),
    var(--bg);
}
.auth-container {
  width: 100%;
  max-width: 420px;
  animation: fadeInUp 0.55s var(--ease-out);
}
.auth-header {
  text-align: center;
  margin-bottom: 30px;
}
.auth-logo-link {
  display: inline-block;
  margin-bottom: 14px;
  transition: transform 0.35s var(--ease-spring);
}
.auth-logo {
  height: 60px;
  width: auto;
  filter: drop-shadow(0 2px 8px rgba(232, 25, 44, 0.25));
}
.auth-logo-link:hover { transform: scale(1.06); }
.auth-title {
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 3px;
  margin-bottom: 2px;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--red) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-title span {
  color: var(--red);
  -webkit-text-fill-color: var(--red);
}
.auth-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  letter-spacing: 2px;
  margin-bottom: 4px;
}
.auth-slogan {
  font-size: 12.5px;
  color: var(--text-muted);
  letter-spacing: 1px;
  opacity: 0.75;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.035);
  border-radius: var(--radius);
  padding: 4px;
}
.auth-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  letter-spacing: 1px;
  font-family: var(--font-main);
}
.auth-tab.active {
  background: var(--red);
  color: #fff;
  box-shadow: 0 2px 10px var(--red-glow);
}
.auth-form { display: none; }
.auth-form.active { display: block; animation: fadeInUp 0.4s var(--ease-out); }

.auth-footer { text-align: center; margin-top: 26px; }
.auth-footer p { font-size: 13.5px; color: var(--text-muted); margin-bottom: 8px; }
.auth-footer .auth-switch { color: var(--red); cursor: pointer; font-weight: 600; }
.auth-footer .auth-switch:hover { color: var(--red-light); }
.auth-back { margin-top: 14px !important; }
.auth-back a { color: var(--text-muted); font-size: 13px; transition: color 0.25s; }
.auth-back a:hover { color: var(--text-primary); }

/* ── App Navigation ── */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 12, 12, 0.82);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.3s;
}
.app-nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  padding: 0 24px;
}
.app-nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.app-nav-brand {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, var(--text-primary) 40%, var(--red-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.app-nav-brand span {
  color: var(--red);
  -webkit-text-fill-color: var(--red);
}
.app-nav-label {
  font-size: 11.5px;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}
.app-nav-links { display: flex; align-items: center; gap: 2px; }
.app-nav-user {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-right: 14px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.025);
  border-radius: 6px;
}
.app-nav-link {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.25s var(--ease-out);
  letter-spacing: 0.4px;
  font-weight: 500;
}
.app-nav-link:hover { color: var(--text-primary); background: var(--glass-bg); }
.app-nav-link.active {
  color: var(--red);
  background: var(--red-surface);
}

/* ── Hamburger & Mobile Menu ── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
  position: relative;
  z-index: 101;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.35s var(--ease-out);
  transform-origin: center;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(10, 9, 9, 0.96);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
}
.mobile-menu.open {
  display: flex;
  opacity: 1;
  animation: fadeIn 0.3s var(--ease-out);
}
.mobile-menu a {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
  padding: 14px 32px;
  letter-spacing: 1.5px;
  text-decoration: none;
  transition: color 0.25s, transform 0.25s;
}
.mobile-menu a:hover { color: var(--red); transform: scale(1.04); }

/* ── App Main Layout ── */
.app-page { background: transparent; }
.app-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 24px 80px;
  animation: fadeInUp 0.45s var(--ease-out);
}
.admin-page .app-main { max-width: 1200px; }

/* ── Page Header ── */
.page-header { margin-bottom: 30px; }
.page-title {
  font-family: var(--font-serif);
  font-size: clamp(22px, 3.5vw, 34px);
  font-weight: 700;
  letter-spacing: 1.5px;
  margin-bottom: 7px;
  background: linear-gradient(135deg, var(--text-primary) 60%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-desc {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Welcome Section ── */
.welcome-icon { font-size: 52px; margin-bottom: 14px; }

/* ── Action Buttons ── */
.action-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.action-buttons .btn { flex-shrink: 0; }

/* ── Stats Grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px 18px;
  text-align: center;
  border-left: 3px solid var(--stat-color, var(--red));
  transition: all 0.3s var(--ease-out);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 60px; height: 60px;
  background: radial-gradient(circle, color-mix(in srgb, var(--stat-color, var(--red)) 6%, transparent) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(30%, -30%);
  pointer-events: none;
}
.stat-card:hover {
  border-color: var(--card-border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.stat-num {
  display: block;
  font-size: 30px;
  font-weight: 700;
  font-family: var(--font-serif);
  color: var(--text-primary);
  position: relative;
  z-index: 1;
}
.stat-label {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 1px;
  position: relative;
  z-index: 1;
}

/* ── Filter Bar ── */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.filter-tabs {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}
.filter-tab {
  padding: 6px 15px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.25s var(--ease-out);
}
.filter-tab:hover { color: var(--text-primary); background: var(--glass-bg); }
.filter-tab.active {
  color: var(--red);
  background: var(--red-surface);
  border-color: rgba(232, 25, 44, 0.18);
}
.filter-search { display: flex; gap: 8px; }
.filter-search input {
  padding: 7px 13px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13.5px;
  outline: none;
  min-width: 200px;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.filter-search input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(232, 25, 44, 0.06);
}
.filter-search input::placeholder { color: var(--text-placeholder); }

/* ── Batch Bar ── */
.batch-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 18px;
  background: var(--red-surface);
  border: 1px solid rgba(232, 25, 44, 0.12);
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: none;
}

/* ── Timeline ── */
.timeline {
  position: relative;
  padding-left: 42px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: linear-gradient(to bottom,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.04) 50%,
    rgba(255, 255, 255, 0.08) 100%);
  border-radius: 1px;
}
.timeline-item {
  position: relative;
  padding-bottom: 30px;
  animation: fadeInUp 0.5s var(--ease-out);
  animation-fill-mode: both;
}
.timeline-item:nth-child(1) { animation-delay: 0.05s; }
.timeline-item:nth-child(2) { animation-delay: 0.15s; }
.timeline-item:nth-child(3) { animation-delay: 0.25s; }
.timeline-item:nth-child(4) { animation-delay: 0.35s; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item.future { opacity: 0.35; }

.timeline-dot {
  position: absolute;
  left: -42px;
  top: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  background: var(--bg-raised);
  border: 2px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  z-index: 1;
  transition: all 0.4s var(--ease-out);
}
.timeline-dot.done {
  background: #2ecc71;
  border-color: #2ecc71;
  color: #fff;
  box-shadow: 0 2px 10px rgba(46, 204, 113, 0.2);
}
.timeline-dot.current {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 0 0 4px var(--red-glow);
  animation: pulse-glow 2s infinite;
}
.timeline-title { font-size: 15.5px; font-weight: 600; margin-bottom: 4px; color: var(--text-primary); }
.timeline-desc { font-size: 13.5px; color: var(--text-secondary); margin-bottom: 3px; }
.timeline-detail { font-size: 12.5px; color: var(--text-muted); }

/* ── Status Card ── */
.status-current {
  display: flex;
  align-items: center;
  gap: 18px;
}
.status-icon-lg { font-size: 44px; flex-shrink: 0; }

/* ── Admin: Resume Page ── */
.resume-page {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 44px 48px;
  max-width: 800px;
}
.resume-header { text-align: center; margin-bottom: 34px; }
.resume-photo { margin-bottom: 18px; }
.resume-photo img {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--red);
  box-shadow: 0 4px 16px rgba(232, 25, 44, 0.18);
}
.resume-name {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 7px;
}
.resume-meta {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.resume-contact {
  font-size: 13.5px;
  color: var(--text-muted);
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}
.resume-section { margin-bottom: 26px; }
.resume-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--red);
  margin-bottom: 11px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.8px;
}
.resume-text {
  font-size: 14.5px;
  line-height: 1.9;
  color: var(--text-secondary);
}
.resume-footer {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.resume-footer p { font-size: 12.5px; color: var(--text-muted); margin-bottom: 5px; }

/* ── Template Cards (Email Selection) ── */
.template-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}
.template-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 14px;
  border-radius: var(--radius);
  border: 2px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  text-align: center;
  background: rgba(255, 255, 255, 0.015);
}
.template-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.035);
  transform: translateY(-1px);
}
.template-card:has(input:checked) {
  border-color: var(--red);
  background: var(--red-surface);
  box-shadow: 0 0 0 1px rgba(232, 25, 44, 0.12);
}
.template-card input[type="radio"] { display: none; }
.template-icon { font-size: 26px; }
.template-label { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.template-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

/* ── Tutorial Steps ── */
.tutorial-steps { display: flex; flex-direction: column; gap: 0; }
.tutorial-step {
  display: flex;
  gap: 18px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}
.tutorial-step:last-child { border-bottom: none; padding-bottom: 0; }
.tutorial-step:first-child { padding-top: 0; }
.tutorial-step-num {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px var(--red-glow);
}
.tutorial-step-body { flex: 1; }
.tutorial-step-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.tutorial-step-body p { font-size: 13.5px; color: var(--text-secondary); line-height: 1.75; margin-bottom: 4px; }
.tutorial-screenshot { margin-top: 10px; }
.tutorial-step-body p strong { color: var(--text-primary); }

/* ── Import Loading Overlay ── */
.import-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10, 9, 9, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.import-loader { text-align: center; }
.import-spinner {
  width: 52px;
  height: 52px;
  margin: 0 auto 22px;
  border: 3px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.import-loading-text { font-size: 17px; font-weight: 600; color: var(--text-primary); margin-bottom: 7px; }
.import-loading-sub { font-size: 13px; color: var(--text-muted); }

/* ── Recipient List ── */
.recipient-list {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.012);
}
.recipient-list::-webkit-scrollbar { width: 5px; }
.recipient-list::-webkit-scrollbar-track { background: transparent; }
.recipient-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 3px; }

.recipient-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.035);
  cursor: pointer;
  transition: background 0.2s;
}
.recipient-item:hover { background: rgba(255, 255, 255, 0.018); }
.recipient-item:last-child { border-bottom: none; }
.recipient-item input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--red);
  cursor: pointer;
  flex-shrink: 0;
}
.recipient-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.recipient-info strong { font-size: 13.5px; color: var(--text-primary); }
.recipient-info .text-muted { font-size: 12px; }

/* ── Details/Summary ── */
details summary::-webkit-details-marker { display: none; }
details summary::marker { display: none; content: ''; }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — Tablet (≤900px)
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .template-cards { grid-template-columns: 1fr 1fr; }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-search { width: 100%; }
  .filter-search input { min-width: auto; flex: 1; }
  .filter-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 2px;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .filter-tabs::-webkit-scrollbar { display: none; }

  .resume-page { padding: 28px 22px; }
  .resume-contact { flex-direction: column; align-items: center; gap: 4px; }
  .info-grid { grid-template-columns: 1fr 1fr; }
  .auth-container { max-width: 400px; }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile (≤768px)
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  html { font-size: 15px; }

  .app-nav { position: relative; }
  .app-nav-links { display: none; }
  .hamburger { display: flex; }
  .app-nav-inner { height: 52px; padding: 0 14px; }
  .app-nav-brand { font-size: 15px; letter-spacing: 1px; }
  .app-nav-label { display: none; }
  .app-nav-user { display: none; }

  .app-main { padding: 20px 14px 56px; }

  .auth-page { padding: 16px; align-items: flex-start; padding-top: 36px; }
  .auth-title { font-size: 28px; letter-spacing: 2px; }
  .auth-logo { height: 48px; }
  .auth-tab { font-size: 13px; padding: 10px 8px; }
  .auth-form .form-group input { padding: 13px 14px; font-size: 16px; }
  .btn-full { padding: 13px; font-size: 15px; }
  .auth-container { padding: 0 4px; }

  .page-header { margin-bottom: 20px; }
  .page-title { font-size: 22px; letter-spacing: 1px; }
  .page-desc { font-size: 13px; }

  .card { border-radius: var(--radius); margin-bottom: 14px; }
  .card-header { padding: 15px 18px; flex-direction: column; align-items: flex-start; gap: 6px; }
  .card-body { padding: 17px; }
  .card-title { font-size: 15px; }

  .form-group { margin-bottom: 14px; }
  .form-group label { font-size: 12.5px; }
  .form-group textarea { font-size: 16px; }
  .form-section { padding: 18px 0; }
  .form-section-title { font-size: 13.5px; }
  .file-upload-label { padding: 22px 14px; }
  .file-upload-text { font-size: 13px; }
  .btn-lg { padding: 12px 28px; font-size: 14px; width: 100%; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card { padding: 14px 10px; border-radius: 10px; }
  .stat-num { font-size: 24px; }
  .stat-label { font-size: 11px; }

  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 8px 10px; }
  .data-table th { font-size: 10px; letter-spacing: 0.4px; }
  .table-name { font-size: 13px; }

  .info-grid { grid-template-columns: 1fr; gap: 8px; }
  .info-item { padding: 10px 13px; }

  .timeline { padding-left: 30px; }
  .timeline-dot { left: -30px; width: 28px; height: 28px; font-size: 11px; }
  .timeline-title { font-size: 14px; }
  .timeline-item { padding-bottom: 22px; }

  .status-current { flex-direction: column; align-items: flex-start; gap: 10px; }
  .status-icon-lg { font-size: 34px; }

  .resume-page { padding: 20px 16px; }
  .resume-header { text-align: left; }
  .resume-name { font-size: 22px; }
  .resume-contact { flex-direction: column; align-items: flex-start; gap: 4px; font-size: 13px; }
  .resume-meta { justify-content: flex-start; font-size: 13px; }
  .resume-photo img { width: 80px; height: 80px; }

  .filter-tabs { gap: 1px; }
  .filter-tab { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
  .filter-search { flex-direction: row; width: 100%; }
  .filter-search input { font-size: 16px; padding: 10px 12px; }

  .action-buttons { flex-direction: column; }
  .action-buttons .btn { width: 100%; text-align: center; justify-content: center; }

  .template-cards { grid-template-columns: 1fr 1fr; gap: 8px; }
  .template-card { padding: 14px 10px; }
  .template-icon { font-size: 22px; }
  .template-label { font-size: 12px; }

  .recipient-item { padding: 10px 12px; flex-wrap: wrap; }
  .recipient-info strong { font-size: 13px; }

  .tutorial-step { flex-direction: column; gap: 10px; padding: 18px 0; }
  .tutorial-step-num { width: 32px; height: 32px; font-size: 16px; }
  .tutorial-step-title { font-size: 14px; }

  .flash { padding: 10px 14px; font-size: 13px; border-radius: 10px; }
  .page-btn { padding: 6px 10px; font-size: 12px; }
  .import-spinner { width: 44px; height: 44px; }
  .import-loading-text { font-size: 15px; }

  .welcome-icon { font-size: 38px; }
  .status-badge { font-size: 11px; padding: 3px 8px; }
  .pagination { gap: 3px; }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — Small Phone (≤480px)
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  html { font-size: 14px; }

  .app-nav-inner { height: 48px; padding: 0 10px; }
  .app-main { padding: 14px 10px 40px; }

  .auth-page { padding: 12px; padding-top: 24px; }
  .auth-title { font-size: 24px; }
  .auth-container { max-width: 100%; }

  .page-title { font-size: 20px; }

  .card-body { padding: 14px; }
  .card-header { padding: 13px 15px; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .stat-card { padding: 11px 8px; }
  .stat-num { font-size: 21px; }

  .resume-page { padding: 16px 12px; }
  .template-cards { grid-template-columns: 1fr; }
  .data-table { font-size: 11px; }
  .data-table th, .data-table td { padding: 6px 8px; }

  .tutorial-step { padding: 14px 0; }
  .tutorial-step-body p { font-size: 12.5px; }

  .btn { padding: 8px 14px; font-size: 12.5px; }
  .form-group input[type="text"],
  .form-group input[type="email"],
  .form-group input[type="password"],
  .form-group input[type="tel"],
  .form-group select,
  .form-group textarea { font-size: 16px; padding: 10px 13px; }
}
