/* ============================================================
   BADMINTON ASSOCIATION - GLOBAL DESIGN SYSTEM
   Palette: Alpine Frost + Volcanic accent
   Fonts: Plus Jakarta Sans (display) + Inter (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@300;400;500;600&display=swap');

/* ── CSS VARIABLES ─────────────────────────────────────────── */
:root {
  --primary: #1a3a6b;
  --primary-light: #2e5090;
  --primary-dark: #0f2347;
  --accent: #e8401c;
  --accent-light: #ff6b47;
  --accent-soft: #fff0ec;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --info: #0284c7;
  --info-soft: #e0f2fe;
  --white: #ffffff;
  --bg: #f5f7fb;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Inter', sans-serif;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; border: none; outline: none; }
input, select, textarea { font-family: inherit; outline: none; }

/* ── SCROLLBAR ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--border-light); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── TYPOGRAPHY ────────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; color: var(--text-primary); }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }
h4 { font-size: 1.1rem; }
p { color: var(--text-secondary); }

/* ── LAYOUT ────────────────────────────────────────────────── */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.page-wrapper { min-height: 100vh; display: flex; flex-direction: column; }

/* ── NAVBAR ────────────────────────────────────────────────── */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--primary);
}
.navbar-brand .brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.1rem;
}
.navbar-actions { display: flex; align-items: center; gap: 12px; }
.navbar-user {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.875rem; color: var(--text-secondary);
}
.navbar-user .user-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 0.75rem; font-weight: 700;
  font-family: var(--font-display);
}

/* ── NOTIFICATION BELL ─────────────────────────────────────── */
.notif-btn {
  position: relative;
  width: 38px; height: 38px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
  font-size: 1.1rem;
}
.notif-btn:hover { background: var(--border); color: var(--primary); }
.notif-badge {
  position: absolute; top: 4px; right: 4px;
  width: 16px; height: 16px;
  background: var(--accent);
  border-radius: 50%;
  font-size: 0.6rem; font-weight: 700;
  color: white; display: flex; align-items: center; justify-content: center;
  border: 2px solid white;
  animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* ── SIDEBAR ───────────────────────────────────────────────── */
.app-layout { display: flex; min-height: calc(100vh - 64px); }
.sidebar {
  width: 240px; min-width: 240px;
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  display: flex; flex-direction: column;
  position: sticky; top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
}
.sidebar-section { padding: 0 12px; margin-bottom: 8px; }
.sidebar-label {
  font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-muted); padding: 8px 12px 4px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem; font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
}
.sidebar-link:hover { background: var(--bg); color: var(--primary); }
.sidebar-link.active { background: #e8f0fb; color: var(--primary); font-weight: 600; }
.sidebar-link .link-icon { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-link .link-badge {
  margin-left: auto;
  background: var(--accent);
  color: white; font-size: 0.65rem; font-weight: 700;
  padding: 2px 6px; border-radius: var(--radius-full);
}

/* ── MAIN CONTENT ──────────────────────────────────────────── */
.main-content { flex: 1; padding: 28px; overflow-x: hidden; }
.page-header { margin-bottom: 24px; }
.page-header h2 { font-size: 1.5rem; color: var(--text-primary); }
.page-header p { color: var(--text-muted); font-size: 0.875rem; margin-top: 4px; }

/* ── CARDS ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow); }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}
.card-title { font-size: 1rem; font-weight: 700; color: var(--text-primary); font-family: var(--font-display); }

/* ── STAT CARDS ────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex; align-items: center; gap: 16px;
  transition: var(--transition);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--primary);
}
.stat-card.accent::before { background: var(--accent); }
.stat-card.success::before { background: var(--success); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.danger::before { background: var(--danger); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}
.stat-icon.blue { background: #e8f0fb; color: var(--primary); }
.stat-icon.red { background: var(--accent-soft); color: var(--accent); }
.stat-icon.green { background: var(--success-soft); color: var(--success); }
.stat-icon.yellow { background: var(--warning-soft); color: var(--warning); }
.stat-icon.purple { background: #f3e8ff; color: #7c3aed; }
.stat-value { font-size: 1.8rem; font-weight: 800; font-family: var(--font-display); color: var(--text-primary); line-height: 1; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; font-weight: 500; }

/* ── BUTTONS ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 600;
  font-family: var(--font-display);
  transition: var(--transition);
  white-space: nowrap;
  cursor: pointer;
}
.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(26,58,107,0.3);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(26,58,107,0.4); }
.btn-accent {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px rgba(232,64,28,0.3);
}
.btn-accent:hover { background: #c73516; transform: translateY(-1px); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #15803d; transform: translateY(-1px); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b91c1c; transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: #e8f0fb; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg); color: var(--primary); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn-loading { position: relative; color: transparent !important; }
.btn-loading::after {
  content: ''; position: absolute;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── FORMS ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; margin-bottom: 6px;
  font-size: 0.8rem; font-weight: 600;
  color: var(--text-primary); font-family: var(--font-display);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.form-label .required { color: var(--accent); margin-left: 2px; }
.form-control {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem; color: var(--text-primary);
  background: var(--white);
  transition: var(--transition);
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,58,107,0.1); }
.form-control::placeholder { color: var(--text-muted); }
.form-control.error { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220,38,38,0.1); }
.form-control.success { border-color: var(--success); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 0.75rem; color: var(--danger); margin-top: 4px; display: none; }
.form-error.show { display: block; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── FILE UPLOAD ───────────────────────────────────────────── */
.file-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg);
}
.file-upload-area:hover, .file-upload-area.dragover {
  border-color: var(--primary);
  background: #e8f0fb;
}
.file-upload-area .upload-icon { font-size: 2rem; color: var(--text-muted); margin-bottom: 8px; }
.file-upload-area p { font-size: 0.875rem; color: var(--text-muted); }
.file-upload-area .file-name { font-size: 0.8rem; color: var(--success); font-weight: 600; margin-top: 8px; }

/* ── TABLES ────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead { background: var(--bg); }
thead th {
  padding: 12px 16px; text-align: left;
  font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
tbody tr { border-bottom: 1px solid var(--border-light); transition: var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg); }
tbody td { padding: 12px 16px; color: var(--text-secondary); vertical-align: middle; }
tbody td strong { color: var(--text-primary); font-weight: 600; }

/* ── BADGES ────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.badge-pending { background: var(--warning-soft); color: var(--warning); }
.badge-approved { background: var(--success-soft); color: var(--success); }
.badge-rejected { background: var(--danger-soft); color: var(--danger); }
.badge-forwarded { background: var(--info-soft); color: var(--info); }
.badge-primary { background: #e8f0fb; color: var(--primary); }
.badge-open { background: var(--success-soft); color: var(--success); }
.badge-closed { background: var(--danger-soft); color: var(--danger); }

/* ── ALERTS ────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 0.875rem; display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 16px; border: 1px solid transparent;
}
.alert-success { background: var(--success-soft); color: #15803d; border-color: #bbf7d0; }
.alert-danger { background: var(--danger-soft); color: #b91c1c; border-color: #fecaca; }
.alert-warning { background: var(--warning-soft); color: #92400e; border-color: #fde68a; }
.alert-info { background: var(--info-soft); color: #0369a1; border-color: #bae6fd; }
.alert-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }

/* ── MODAL ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: var(--transition);
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95) translateY(10px);
  transition: var(--transition);
}
.modal-overlay.show .modal { transform: scale(1) translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-title { font-size: 1.2rem; font-weight: 700; font-family: var(--font-display); }
.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 1.1rem;
  transition: var(--transition); cursor: pointer;
}
.modal-close:hover { background: var(--danger-soft); color: var(--danger); }

/* ── NOTIFICATION PANEL ────────────────────────────────────── */
.notif-panel {
  position: fixed; top: 64px; right: 0;
  width: 360px; max-height: calc(100vh - 64px);
  background: var(--white);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  z-index: 200;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: var(--transition-slow);
}
.notif-panel.open { transform: translateX(0); }
.notif-panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.notif-panel-header h3 { font-size: 0.95rem; font-weight: 700; font-family: var(--font-display); }
.notif-list { flex: 1; overflow-y: auto; }
.notif-item {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer; transition: var(--transition);
  display: flex; gap: 12px; align-items: flex-start;
}
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: #f0f5ff; }
.notif-item.unread:hover { background: #e8f0fb; }
.notif-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary); flex-shrink: 0; margin-top: 6px;
}
.notif-item.unread .notif-dot { background: var(--accent); }
.notif-item-title { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.notif-item-msg { font-size: 0.75rem; color: var(--text-muted); line-height: 1.4; }
.notif-item-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; }

/* ── LANDING PAGE ──────────────────────────────────────────── */
.landing-page {
  min-height: 100vh;
  background: var(--white);
  display: flex; flex-direction: column;
}
.landing-hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  padding: 80px 20px 100px;
  text-align: center;
  position: relative; overflow: hidden;
}
.landing-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.landing-hero .hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: white; padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.8rem; font-weight: 600;
  margin-bottom: 24px;
  backdrop-filter: blur(8px);
  animation: fadeInDown 0.6s ease;
}
.landing-hero h1 {
  color: white; font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800; margin-bottom: 16px;
  animation: fadeInUp 0.6s ease 0.1s both;
}
.landing-hero h1 span { color: #fbbf24; }
.landing-hero p {
  color: rgba(255,255,255,0.8); font-size: 1.1rem;
  max-width: 560px; margin: 0 auto 40px;
  animation: fadeInUp 0.6s ease 0.2s both;
}
.portal-cards {
  display: flex; gap: 24px; justify-content: center; flex-wrap: wrap;
  padding: 0 20px;
  margin-top: -60px; position: relative; z-index: 10;
  animation: fadeInUp 0.6s ease 0.3s both;
}
.portal-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  width: 320px;
  box-shadow: var(--shadow-xl);
  text-align: center;
  transition: var(--transition-slow);
  border: 2px solid transparent;
  cursor: pointer;
}
.portal-card:hover { transform: translateY(-8px); border-color: var(--primary); box-shadow: 0 24px 60px rgba(26,58,107,0.2); }
.portal-card.admin-card:hover { border-color: var(--accent); }
.portal-icon {
  width: 72px; height: 72px;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; margin: 0 auto 20px;
}
.portal-icon.player-icon { background: linear-gradient(135deg, #e8f0fb, #c7d9f5); color: var(--primary); }
.portal-icon.admin-icon { background: linear-gradient(135deg, var(--accent-soft), #ffd5cc); color: var(--accent); }
.portal-card h3 { font-size: 1.3rem; margin-bottom: 8px; }
.portal-card p { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 24px; line-height: 1.5; }
.portal-card .portal-actions { display: flex; flex-direction: column; gap: 10px; }

/* ── AUTH PAGES ────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
  padding: 20px;
  position: relative; overflow: hidden;
}
.auth-page::before {
  content: '🏸';
  position: absolute; font-size: 20rem; opacity: 0.03;
  top: -60px; right: -60px; transform: rotate(30deg);
  pointer-events: none;
}
.auth-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%; max-width: 480px;
  box-shadow: var(--shadow-xl);
  animation: fadeInUp 0.5s ease;
}
.auth-logo {
  text-align: center; margin-bottom: 28px;
}
.auth-logo .logo-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; margin: 0 auto 12px;
}
.auth-logo h2 { font-size: 1.4rem; color: var(--text-primary); }
.auth-logo p { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.auth-divider {
  text-align: center; margin: 20px 0;
  position: relative;
}
.auth-divider::before {
  content: ''; position: absolute;
  top: 50%; left: 0; right: 0; height: 1px;
  background: var(--border);
}
.auth-divider span {
  background: var(--white); padding: 0 12px;
  font-size: 0.75rem; color: var(--text-muted);
  position: relative;
}
.auth-footer { text-align: center; margin-top: 20px; font-size: 0.8rem; color: var(--text-muted); }
.auth-footer a { color: var(--primary); font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

/* ── DOUBLES PARTNER SECTION ───────────────────────────────── */
.partner-section {
  background: #f0f5ff;
  border: 1.5px solid #c7d9f5;
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 8px;
  animation: slideDown 0.3s ease;
}
.partner-section-title {
  font-size: 0.8rem; font-weight: 700;
  color: var(--primary); text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 14px;
  display: flex; align-items: center; gap: 6px;
}

/* ── ENTRY STATUS TRACKER ──────────────────────────────────── */
.status-tracker {
  display: flex; align-items: center; gap: 0;
  margin: 16px 0;
}
.tracker-step {
  display: flex; flex-direction: column; align-items: center;
  flex: 1; position: relative;
}
.tracker-step::before {
  content: ''; position: absolute;
  top: 14px; left: 50%; right: -50%;
  height: 2px; background: var(--border);
  z-index: 0;
}
.tracker-step:last-child::before { display: none; }
.tracker-step.done::before { background: var(--success); }
.tracker-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; color: var(--text-muted);
  position: relative; z-index: 1;
  transition: var(--transition);
}
.tracker-step.done .tracker-dot { background: var(--success); color: white; }
.tracker-step.active .tracker-dot { background: var(--primary); color: white; box-shadow: 0 0 0 4px rgba(26,58,107,0.2); }
.tracker-step.rejected .tracker-dot { background: var(--danger); color: white; }
.tracker-label { font-size: 0.65rem; color: var(--text-muted); margin-top: 6px; text-align: center; font-weight: 500; }
.tracker-step.done .tracker-label { color: var(--success); }
.tracker-step.active .tracker-label { color: var(--primary); font-weight: 700; }

/* ── AI MAIL EDITOR ────────────────────────────────────────── */
.mail-editor {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.mail-editor-toolbar {
  background: var(--bg);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}
.mail-editor-toolbar span {
  font-size: 0.75rem; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.06em;
}
.mail-body {
  padding: 16px;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-primary);
  min-height: 300px;
  white-space: pre-wrap;
  word-break: break-word;
}
.mail-body[contenteditable="true"] { outline: none; }
.mail-body[contenteditable="true"]:focus { background: #fafbff; }
.prompt-input-area {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  display: flex; gap: 10px; align-items: center;
}
.prompt-input {
  flex: 1; padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  background: var(--white);
  transition: var(--transition);
}
.prompt-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,58,107,0.1); }
.prompt-input::placeholder { color: var(--text-muted); }

/* ── SEARCH & FILTER BAR ───────────────────────────────────── */
.filter-bar {
  display: flex; gap: 12px; align-items: center;
  flex-wrap: wrap; margin-bottom: 20px;
}
.search-input-wrap {
  position: relative; flex: 1; min-width: 200px;
}
.search-input-wrap .search-icon {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); font-size: 0.9rem;
}
.search-input-wrap input {
  width: 100%; padding: 9px 14px 9px 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  background: var(--white);
  transition: var(--transition);
}
.search-input-wrap input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,58,107,0.1); }

/* ── EMPTY STATE ───────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 1rem; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 0.875rem; }

/* ── TOAST NOTIFICATIONS ───────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999; display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--primary);
  display: flex; align-items: center; gap: 12px;
  min-width: 280px; max-width: 380px;
  animation: slideInRight 0.3s ease;
  font-size: 0.875rem;
}
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }
.toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast-msg { flex: 1; color: var(--text-primary); font-weight: 500; }
.toast-close { color: var(--text-muted); cursor: pointer; font-size: 1rem; }
.toast-close:hover { color: var(--text-primary); }

/* ── LOADING SPINNER ───────────────────────────────────────── */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}
.spinner-sm { width: 20px; height: 20px; border-width: 2px; margin: 0; }

/* ── TABS ──────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.tab-btn {
  padding: 10px 20px;
  font-size: 0.875rem; font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  cursor: pointer; background: none;
  font-family: var(--font-display);
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }

/* ── CATEGORY CHIPS ────────────────────────────────────────── */
.category-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.category-chip {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.75rem; font-weight: 700;
  background: var(--bg); color: var(--text-secondary);
  border: 1.5px solid var(--border);
  cursor: pointer; transition: var(--transition);
}
.category-chip:hover { border-color: var(--primary); color: var(--primary); background: #e8f0fb; }
.category-chip.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ── ANIMATIONS ────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

.animate-in { animation: fadeInUp 0.5s ease both; }
.animate-in-delay-1 { animation-delay: 0.1s; }
.animate-in-delay-2 { animation-delay: 0.2s; }
.animate-in-delay-3 { animation-delay: 0.3s; }

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

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .sidebar.mobile-open { display: flex; position: fixed; top: 64px; left: 0; z-index: 150; height: calc(100vh - 64px); box-shadow: var(--shadow-xl); }
  .main-content { padding: 16px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .portal-cards { flex-direction: column; align-items: center; }
  .portal-card { width: 100%; max-width: 360px; }
  .notif-panel { width: 100%; }
  .auth-card { padding: 28px 20px; }
  .modal { padding: 24px 20px; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .table-wrapper { font-size: 0.8rem; }
  .landing-hero { padding: 60px 20px 80px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .tabs { overflow-x: auto; }
  .tab-btn { white-space: nowrap; }
}

/* ── UTILITY ───────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-primary-color { color: var(--primary); }
.font-bold { font-weight: 700; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-4 { margin-bottom: 4px; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; } .flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }