/* ==========================================================================
   Ashleen Investments — Shared Design System
   One stylesheet, linked from every staff/applicant page. Component classes
   here are additive: page-specific <style> blocks can still override or
   extend, but colors/spacing/radius should come from the variables below
   so pages stay visually consistent as they're modernized one at a time.
   ========================================================================== */

:root {
  /* Brand */
  --navy: #14152b;
  --navy-700: #1a1c3a;
  --navy-600: #232552;
  --gold: #c9a227;
  --gold-600: #b08f1f;

  /* Neutrals */
  --bg: #f4f5f7;
  --surface: #ffffff;
  --border: #e4e7ec;
  --border-strong: #d3d7df;
  --text: #1f2430;
  --text-muted: #667085;
  --text-faint: #98a2b3;

  /* Semantic */
  --success: #1b7a43;
  --success-bg: #e3f7ea;
  --warning: #b5560a;
  --warning-bg: #fff1e0;
  --danger: #c4293a;
  --danger-bg: #fce8ea;
  --info: #1456c9;
  --info-bg: #e7eefd;
  --purple: #6f3fb0;
  --purple-bg: #efe5fb;

  /* Geometry */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(20, 21, 43, 0.06);
  --shadow-md: 0 4px 16px rgba(20, 21, 43, 0.08);
  --shadow-lg: 0 12px 32px rgba(20, 21, 43, 0.12);

  /* Type */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---- Reset & base ---- */
.ai-theme, .ai-theme * { box-sizing: border-box; }
.ai-theme {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
}
.ai-theme h1, .ai-theme h2, .ai-theme h3, .ai-theme h4 {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--navy);
}

/* ---- Top bar ---- */
.ai-topbar {
  background: var(--navy);
  color: #fff;
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}
.ai-topbar .brand { display: flex; align-items: center; gap: 14px; }
.ai-topbar .brand .logo { font-size: 19px; font-weight: 700; color: var(--gold); letter-spacing: 0.5px; }
.ai-topbar .brand .title { font-size: 13px; color: rgba(255,255,255,0.7); border-left: 1px solid rgba(255,255,255,0.2); padding-left: 14px; }
.ai-topbar .user { display: flex; align-items: center; gap: 14px; font-size: 13px; color: rgba(255,255,255,0.85); }

/* ---- Layout ---- */
.ai-container { max-width: 1400px; margin: 0 auto; padding: 28px; }

/* ---- Buttons ---- */
.ai-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  line-height: 1.2;
}
.ai-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ai-btn-primary { background: var(--navy); color: #fff; }
.ai-btn-primary:hover:not(:disabled) { background: var(--navy-600); }
.ai-btn-gold { background: var(--gold); color: var(--navy); }
.ai-btn-gold:hover:not(:disabled) { background: var(--gold-600); }
.ai-btn-success { background: var(--success); color: #fff; }
.ai-btn-success:hover:not(:disabled) { background: #156536; }
.ai-btn-danger { background: var(--danger); color: #fff; }
.ai-btn-danger:hover:not(:disabled) { background: #a4202e; }
.ai-btn-outline { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.ai-btn-outline:hover:not(:disabled) { border-color: var(--navy); color: var(--navy); }
.ai-btn-ghost { background: transparent; color: var(--text-muted); }
.ai-btn-ghost:hover:not(:disabled) { background: var(--bg); color: var(--text); }

/* ---- Cards & stat cards ---- */
.ai-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.ai-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.ai-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.ai-stat-card .label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.ai-stat-card .value { font-size: 28px; font-weight: 700; color: var(--navy); line-height: 1; }
.ai-stat-card.accent-success .value { color: var(--success); }
.ai-stat-card.accent-warning .value { color: var(--warning); }
.ai-stat-card.accent-danger .value { color: var(--danger); }
.ai-stat-card.accent-purple .value { color: var(--purple); }

/* ---- Badges ---- */
.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.ai-badge-success { background: var(--success-bg); color: var(--success); }
.ai-badge-warning { background: var(--warning-bg); color: var(--warning); }
.ai-badge-danger { background: var(--danger-bg); color: var(--danger); }
.ai-badge-info { background: var(--info-bg); color: var(--info); }
.ai-badge-purple { background: var(--purple-bg); color: var(--purple); }
.ai-badge-neutral { background: var(--bg); color: var(--text-muted); }

/* ---- Tables ---- */
.ai-table-wrap { overflow-x: auto; }
.ai-table { width: 100%; border-collapse: collapse; }
.ai-table th, .ai-table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
.ai-table th { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; background: #fafbfc; }
.ai-table tbody tr:hover { background: #fafbfc; }
.ai-table tbody tr:last-child td { border-bottom: none; }

/* ---- Tabs ---- */
.ai-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; flex-wrap: wrap; }
.ai-tab {
  padding: 11px 18px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.ai-tab:hover { color: var(--navy); }
.ai-tab.active { color: var(--navy); border-bottom-color: var(--gold); }

/* ---- Forms ---- */
.ai-form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.ai-form-group label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.ai-input, .ai-select, .ai-textarea {
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ai-input:focus, .ai-select:focus, .ai-textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(20, 21, 43, 0.08);
}

/* ---- Modal ---- */
.ai-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(20, 21, 43, 0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.ai-modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 1100px; max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.ai-modal-header {
  background: var(--navy);
  color: #fff;
  padding: 18px 24px;
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; z-index: 10;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.ai-modal-close { background: none; border: none; color: rgba(255,255,255,0.8); font-size: 22px; cursor: pointer; line-height: 1; }
.ai-modal-close:hover { color: #fff; }
.ai-modal-body { padding: 24px; }

/* ---- Misc ---- */
.ai-empty-state { text-align: center; padding: 56px 20px; color: var(--text-muted); font-size: 14px; }
.ai-section-title { font-size: 18px; font-weight: 700; color: var(--navy); margin-bottom: 18px; }
.ai-spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff;
  border-radius: 50%; animation: ai-spin 0.7s linear infinite;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }

/* ---- Unread message badge — small count pill on a Messages/Chat button ---- */
.unread-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  margin-left: 6px; border-radius: 999px;
  background: #d32f2f; color: #fff;
  font-size: 11px; font-weight: 700; line-height: 1;
  vertical-align: middle;
}
