/* =============================================
   四川货运跟车学习平台 — 主题样式 v2.0
   设计系统：专业蓝 + 活力橙 / 移动端优先
   基于 UI/UX Pro Max 设计规范优化
   ============================================= */

/* ===== Design Tokens ===== */
:root {
  /* 品牌色 */
  --primary: #1E40AF;
  --primary-light: #DBEAFE;
  --primary-lighter: #EFF6FF;
  --primary-dark: #1E3A8A;
  --primary-darker: #172554;
  --primary-gradient: linear-gradient(135deg, #1E40AF 0%, #3B82F6 100%);
  --primary-gradient-soft: linear-gradient(135deg, rgba(30,64,175,0.08) 0%, rgba(59,130,246,0.04) 100%);

  --accent: #F97316;
  --accent-light: #FFEDD5;
  --accent-lighter: #FFF7ED;
  --accent-dark: #EA580C;
  --accent-gradient: linear-gradient(135deg, #F97316 0%, #FB923C 100%);

  /* 功能色 */
  --success: #10B981;
  --success-light: #D1FAE5;
  --success-dark: #059669;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --warning-dark: #D97706;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --danger-dark: #DC2626;
  --info: #3B82F6;
  --info-light: #DBEAFE;

  /* 中性色 */
  --bg: #F1F5F9;
  --bg-alt: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-input: #F8FAFC;
  --bg-hover: #F1F5F9;

  --text: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --text-inverse: #FFFFFF;

  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --border-dark: #CBD5E1;

  /* 阴影系统 */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.05);
  --shadow-primary: 0 4px 14px rgba(30, 64, 175, 0.25);
  --shadow-accent: 0 4px 14px rgba(249, 115, 22, 0.3);
  --shadow-card: 0 2px 8px rgba(15, 23, 42, 0.06);

  /* 圆角系统 */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* 间距系统 (4px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* 字体系统 */
  --font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  --font-size-xs: 12px;
  --font-size-sm: 13px;
  --font-size-base: 15px;
  --font-size-lg: 17px;
  --font-size-xl: 19px;
  --font-size-2xl: 22px;
  --font-size-3xl: 28px;
  --font-size-4xl: 36px;

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;

  /* 布局 */
  --nav-height: 68px;
  --topbar-height: 56px;
  --max-width-mobile: 640px;
  --max-width-tablet: 768px;

  /* 动画 */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background: var(--bg);
  color: var(--text);
  font-size: var(--font-size-base);
  line-height: 1.6;
  font-weight: var(--font-weight-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100dvh;
}

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

img { max-width: 100%; display: block; }

button { font-family: inherit; }

/* ===== Layout ===== */
.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.page-content {
  flex: 1;
  padding: var(--space-4);
  padding-bottom: calc(var(--nav-height) + var(--space-6));
  width: 100%;
  max-width: var(--max-width-mobile);
  margin: 0 auto;
}

/* ===== Top Bar ===== */
.top-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar-height);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.9);
}

.top-bar-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--text);
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.top-bar-title svg {
  width: 22px;
  height: 22px;
  color: var(--primary);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* ===== Bottom Navigation ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 6px 0 8px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 100;
  box-shadow: 0 -1px 3px rgba(0,0,0,0.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.95);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-decoration: none;
  padding: var(--space-1) var(--space-3);
  min-width: 64px;
  transition: all var(--transition-base);
  position: relative;
  cursor: pointer;
}

.nav-item svg {
  width: 24px;
  height: 24px;
  margin-bottom: 3px;
  transition: all var(--transition-base);
  stroke-width: 2;
}

.nav-item span {
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  transition: all var(--transition-base);
}

.nav-item:hover {
  color: var(--text-secondary);
}

.nav-item.active {
  color: var(--primary);
}

.nav-item.active svg {
  stroke: var(--primary);
  stroke-width: 2.5;
  transform: translateY(-1px);
}

.nav-item.active span {
  font-weight: var(--font-weight-semibold);
}

.nav-item::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%) scale(0);
  width: 20px;
  height: 3px;
  background: var(--primary-gradient);
  border-radius: 0 0 3px 3px;
  transition: transform var(--transition-base);
}

.nav-item.active::after {
  transform: translateX(-50%) scale(1);
}

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  transition: all var(--transition-base);
  border: 1px solid var(--border-light);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.card-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
}

.card-subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  gap: var(--space-2);
  line-height: 1.2;
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.1);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn:active {
  transform: scale(0.97);
}

.btn:active::before {
  opacity: 1;
}

.btn-primary {
  background: var(--primary-gradient);
  color: var(--text-inverse);
  box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(30, 64, 175, 0.35);
  transform: translateY(-1px);
  color: var(--text-inverse);
}

.btn-accent {
  background: var(--accent-gradient);
  color: var(--text-inverse);
  box-shadow: var(--shadow-accent);
}

.btn-accent:hover {
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
  transform: translateY(-1px);
  color: var(--text-inverse);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary-lighter);
  border-color: var(--primary-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
  color: var(--text-inverse);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
  background: var(--danger-dark);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.btn-success {
  background: var(--success);
  color: var(--text-inverse);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.btn-sm {
  padding: 7px 14px;
  font-size: var(--font-size-sm);
  border-radius: var(--radius-xs);
}

.btn-lg {
  padding: 15px 28px;
  font-size: var(--font-size-lg);
  border-radius: var(--radius);
  font-weight: var(--font-weight-bold);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ===== Forms ===== */
.form-group {
  margin-bottom: var(--space-4);
  position: relative;
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  margin-bottom: var(--space-2);
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-base);
  color: var(--text);
  background: var(--bg-input);
  transition: all var(--transition-base);
  outline: none;
  font-family: inherit;
}

.form-input:hover {
  border-color: var(--border-dark);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.1);
  background: var(--bg-card);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:disabled {
  background: var(--border-light);
  color: var(--text-muted);
  cursor: not-allowed;
}

.form-hint {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

.form-error {
  font-size: var(--font-size-sm);
  color: var(--danger);
  margin-top: var(--space-1);
  font-weight: var(--font-weight-medium);
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748B' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  background-color: var(--bg-card);
  cursor: pointer;
}

textarea.form-input {
  min-height: 100px;
  resize: vertical;
  line-height: 1.6;
}

/* 浮动标签输入框 */
.floating-input {
  position: relative;
}

.floating-input .form-input {
  padding-top: 20px;
  padding-bottom: 8px;
}

.floating-input .floating-label {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--font-size-base);
  color: var(--text-muted);
  pointer-events: none;
  transition: all var(--transition-fast);
  font-weight: var(--font-weight-normal);
}

.floating-input .form-input:focus + .floating-label,
.floating-input .form-input:not(:placeholder-shown) + .floating-label {
  top: 10px;
  transform: translateY(0);
  font-size: 11px;
  color: var(--primary);
  font-weight: var(--font-weight-semibold);
}

/* ===== Tags / Badges ===== */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  gap: 4px;
  line-height: 1.4;
}

.tag-blue {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.tag-orange {
  background: var(--accent-light);
  color: var(--accent-dark);
}

.tag-green {
  background: var(--success-light);
  color: var(--success-dark);
}

.tag-red {
  background: var(--danger-light);
  color: var(--danger-dark);
}

.tag-gray {
  background: var(--bg);
  color: var(--text-secondary);
}

.tag-yellow {
  background: var(--warning-light);
  color: var(--warning-dark);
}

.tag-sm {
  padding: 2px 8px;
  font-size: 11px;
}

.tag-lg {
  padding: 6px 14px;
  font-size: var(--font-size-sm);
}

/* ===== Driver Cards ===== */
.driver-card {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
  margin-bottom: var(--space-3);
  cursor: pointer;
  transition: all var(--transition-base);
}

.driver-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border);
  transform: translateY(-2px);
}

.driver-avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: var(--font-weight-bold);
  color: var(--text-inverse);
  flex-shrink: 0;
  box-shadow: var(--shadow-primary);
}

.driver-info {
  flex: 1;
  min-width: 0;
}

.driver-name {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.driver-meta {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-top: 2px;
}

.driver-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--space-2);
}

/* ===== Stars ===== */
.stars {
  color: var(--warning);
  font-size: var(--font-size-sm);
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
}

.stars-empty {
  color: var(--border);
}

/* ===== VIP Badge ===== */
.vip-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #F59E0B 0%, #F97316 100%);
  color: white;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
  letter-spacing: 0.5px;
}

/* ===== Section Title ===== */
.section-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--text);
  margin-bottom: var(--space-3);
  letter-spacing: -0.3px;
}

.section-subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-6);
  color: var(--text-muted);
}

.empty-state svg {
  width: 72px;
  height: 72px;
  margin-bottom: var(--space-4);
  opacity: 0.4;
}

.empty-state p {
  font-size: var(--font-size-base);
  margin-bottom: var(--space-4);
  color: var(--text-secondary);
}

/* ===== Login / Auth Pages ===== */
.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: linear-gradient(180deg, var(--primary-lighter) 0%, var(--bg) 40%);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 300px;
  height: 300px;
  background: var(--primary-gradient);
  border-radius: 50%;
  opacity: 0.05;
  filter: blur(60px);
}

.login-page::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -80px;
  width: 250px;
  height: 250px;
  background: var(--accent-gradient);
  border-radius: 50%;
  opacity: 0.05;
  filter: blur(60px);
}

.login-logo {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-extrabold);
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.login-subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
}

.login-form {
  width: 100%;
  max-width: 380px;
  position: relative;
  z-index: 1;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-5) 0;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ===== Hero Section (Landing) ===== */
.hero-section {
  text-align: center;
  padding: var(--space-10) 0 var(--space-8);
  position: relative;
}

.hero-icon {
  width: 88px;
  height: 88px;
  margin: 0 auto var(--space-4);
  background: var(--primary-gradient);
  border-radius: var(--radius-2xl);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-primary);
}

.hero-icon svg {
  width: 44px;
  height: 44px;
  color: white;
  stroke-width: 1.5;
}

.hero-title {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-extrabold);
  color: var(--text);
  margin-bottom: var(--space-2);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.hero-tagline {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-8);
}

/* ===== Feature Cards ===== */
.features-section {
  margin: var(--space-8) 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.feature-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  text-align: center;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
  transition: all var(--transition-base);
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-3);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-lighter);
}

.feature-icon svg {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

.feature-card:nth-child(2) .feature-icon {
  background: var(--accent-light);
}
.feature-card:nth-child(2) .feature-icon svg {
  color: var(--accent);
}

.feature-card:nth-child(3) .feature-icon {
  background: var(--success-light);
}
.feature-card:nth-child(3) .feature-icon svg {
  color: var(--success);
}

.feature-card:nth-child(4) .feature-icon {
  background: var(--warning-light);
}
.feature-card:nth-child(4) .feature-icon svg {
  color: var(--warning);
}

.feature-title {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  margin-bottom: 4px;
}

.feature-desc {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ===== Admin Sidebar ===== */
.admin-layout {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

.admin-sidebar {
  width: 240px;
  background: linear-gradient(180deg, var(--primary-darker) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 0;
  flex-shrink: 0;
  box-shadow: 2px 0 16px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.admin-sidebar .sidebar-header {
  padding: var(--space-5) var(--space-4);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.admin-sidebar .sidebar-header svg {
  width: 24px;
  height: 24px;
}

.admin-sidebar .sidebar-nav {
  padding: var(--space-2) 0;
}

.admin-sidebar .sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 12px var(--space-4);
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: var(--font-size-sm);
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
  margin: 2px var(--space-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.admin-sidebar .sidebar-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.admin-sidebar .sidebar-item:hover {
  background: rgba(255,255,255,0.08);
  color: white;
}

.admin-sidebar .sidebar-item.active {
  background: rgba(255,255,255,0.12);
  color: white;
  border-left-color: var(--accent);
  font-weight: var(--font-weight-semibold);
}

.admin-main {
  flex: 1;
  background: var(--bg);
  min-width: 0;
}

.admin-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-6);
}

/* ===== Tables ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
}

.data-table th {
  background: var(--bg-alt);
  padding: 12px 16px;
  text-align: left;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  font-size: var(--font-size-base);
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: var(--bg-alt);
}

/* ===== Stats Grid ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
  padding: var(--space-4);
  text-align: center;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-gradient);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-value {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-extrabold);
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.stat-label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-top: var(--space-1);
  font-weight: var(--font-weight-medium);
}

/* ===== Role Selector ===== */
.role-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.role-option {
  padding: var(--space-5) var(--space-3);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  background: var(--bg-card);
}

.role-option:hover {
  border-color: var(--primary-light);
  background: var(--primary-lighter);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.role-option.selected {
  border-color: var(--primary);
  background: var(--primary-lighter);
  box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.08);
}

.role-option .role-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-2);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
}

.role-option .role-icon svg {
  width: 28px;
  height: 28px;
  color: var(--primary);
}

.role-option:nth-child(2) .role-icon {
  background: var(--accent-light);
}
.role-option:nth-child(2) .role-icon svg {
  color: var(--accent);
}

.role-option .role-name {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
}

.role-option .role-desc {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ===== Utility Classes ===== */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-secondary); }
.text-sm { font-size: var(--font-size-sm); }
.text-xs { font-size: var(--font-size-xs); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.font-bold { font-weight: var(--font-weight-bold); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-medium { font-weight: var(--font-weight-medium); }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

.w-full { width: 100%; }

/* ===== Fee Display ===== */
.fee-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-size: var(--font-size-sm);
  border-bottom: 1px solid var(--border-light);
}

.fee-row:last-child {
  border-bottom: none;
}

.fee-label {
  color: var(--text-secondary);
}

.fee-value {
  color: var(--text);
  font-weight: var(--font-weight-semibold);
}

.fee-total {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--accent);
}

/* ===== Modal / Overlay ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: var(--space-5);
  animation: fadeIn var(--transition-base) ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp var(--transition-slow) cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-xl);
}

.modal-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-4);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ===== Skeleton Loading ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg) 25%, var(--border-light) 50%, var(--bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}

.skeleton-title {
  height: 20px;
  width: 60%;
  margin-bottom: 12px;
}

.skeleton-avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
}

.skeleton-card {
  height: 120px;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-3);
}

/* ===== Duration Picker ===== */
.duration-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.duration-option {
  padding: var(--space-3) var(--space-2);
  text-align: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  transition: all var(--transition-fast);
  background: var(--bg-card);
}

.duration-option:hover {
  border-color: var(--primary-light);
  background: var(--primary-lighter);
}

.duration-option.selected {
  border-color: var(--primary);
  background: var(--primary-lighter);
  color: var(--primary);
  font-weight: var(--font-weight-semibold);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.08);
}

/* ===== Notification Dot ===== */
.notif-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  position: absolute;
  top: 4px;
  right: 10px;
  box-shadow: 0 0 0 2px var(--bg-card);
}

/* ===== Divider ===== */
.divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-4) 0;
}

/* ===== Status Badge ===== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
}

.status-badge.active {
  background: var(--success-light);
  color: var(--success-dark);
}

.status-badge.pending {
  background: var(--warning-light);
  color: var(--warning-dark);
}

.status-badge.inactive {
  background: var(--bg);
  color: var(--text-muted);
}

/* ===== Search / Filter Bar ===== */
.filter-bar {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
}

.filter-bar .form-input {
  font-size: var(--font-size-sm);
  padding: 10px 12px;
}

/* ===== Avatar ===== */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  color: white;
  flex-shrink: 0;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: var(--font-size-sm);
}

.avatar-lg {
  width: 64px;
  height: 64px;
  font-size: var(--font-size-xl);
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: var(--topbar-height);
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--text);
  color: white;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  z-index: 300;
  opacity: 0;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--danger);
}

/* ===== Responsive ===== */
@media (min-width: 768px) {
  .page-content {
    max-width: var(--max-width-tablet);
    padding: var(--space-6);
    padding-bottom: calc(var(--nav-height) + var(--space-8));
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .features-grid {
    gap: var(--space-4);
  }
}

@media (max-width: 480px) {
  .duration-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .role-selector {
    grid-template-columns: 1fr 1fr;
  }

  .admin-sidebar {
    display: none;
  }

  .admin-page {
    padding: var(--space-4);
  }

  .hero-title {
    font-size: var(--font-size-2xl);
  }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== Focus States ===== */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn:focus-visible,
.form-input:focus-visible {
  outline-offset: 2px;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-dark);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
