/* ==========================================================
   MENTORHUB — GLOBAL DESIGN SYSTEM
   Palette: Midnight campus navy + amber (AI/insight) + teal (positive)
   Type: Poppins (display) / Inter (body)
   ========================================================== */

:root {
  --navy-950: #0c1224;
  --navy-900: #131a2c;
  --navy-800: #1c2540;
  --navy-700: #2a3558;
  --navy-100: #e7eaf3;

  --amber-500: #f5a623;
  --amber-400: #ffc266;
  --teal-500: #2dd4bf;
  --teal-600: #14b8a6;
  --coral-500: #ef6461;

  --bg-app: #f5f6fb;
  --bg-card: #ffffff;
  --text-primary: #171b2e;
  --text-secondary: #6b7280;
  --border-soft: #e7e9f3;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --shadow-soft: 0 8px 30px rgba(19, 26, 44, 0.08);
  --shadow-card: 0 4px 16px rgba(19, 26, 44, 0.06);
  --shadow-hover: 0 14px 34px rgba(19, 26, 44, 0.14);

  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-app);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, .brand-font {
  font-family: 'Poppins', sans-serif;
  letter-spacing: -0.02em;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c9cee0; border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Glass utility ---------- */
.glass {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14.5px;
  transition: var(--transition);
}
.btn-block { width: 100%; }
.btn-primary {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
  color: #fff;
  box-shadow: var(--shadow-card);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.btn-accent {
  background: linear-gradient(135deg, var(--amber-500), var(--amber-400));
  color: var(--navy-950);
}
.btn-accent:hover { transform: translateY(-2px); }
.btn-outline {
  border: 1.5px solid var(--border-soft);
  color: var(--text-primary);
  background: #fff;
}
.btn-outline:hover { border-color: var(--navy-700); }
.btn-danger { background: var(--coral-500); color: #fff; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 8px; }
.btn-icon { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }

/* ---------- Layout shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 264px;
  background: linear-gradient(180deg, var(--navy-950), var(--navy-900));
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: var(--transition);
}
.sidebar.collapsed { width: 84px; }
.sidebar.collapsed .side-label, .sidebar.collapsed .brand-text, .sidebar.collapsed .side-section-title { display: none; }

.side-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 26px 22px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.side-brand i { font-size: 24px; color: var(--amber-500); }
.side-brand .brand-text h2 { font-size: 18px; color: #fff; }
.side-brand .brand-text span { font-size: 11px; color: rgba(255,255,255,0.5); }

.side-nav { flex: 1; overflow-y: auto; padding: 18px 12px; }
.side-section-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: rgba(255,255,255,0.35); margin: 18px 12px 8px;
}
.side-link {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 14px; border-radius: 12px; color: rgba(255,255,255,0.75);
  font-size: 14.5px; font-weight: 500; margin-bottom: 4px;
  transition: var(--transition);
}
.side-link i { width: 20px; text-align: center; font-size: 16px; }
.side-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.side-link.active {
  background: linear-gradient(135deg, var(--amber-500), #d98c1f);
  color: var(--navy-950); font-weight: 600;
  box-shadow: 0 6px 18px rgba(245,166,35,0.35);
}

.side-collapse-btn {
  margin: 10px 16px 20px; color: rgba(255,255,255,0.5); font-size: 13px;
  display: flex; align-items: center; gap: 8px;
}

/* ---------- Main content area ---------- */
.main-content { margin-left: 264px; flex: 1; min-width: 0; transition: var(--transition); }
.sidebar.collapsed ~ .main-content { margin-left: 84px; }

.topbar {
  height: 74px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; background: rgba(245,246,251,0.85); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--border-soft);
}
.topbar-search {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--border-soft); border-radius: 12px;
  padding: 10px 16px; width: 340px; max-width: 40vw;
}
.topbar-search input { border: none; outline: none; flex: 1; font-size: 14px; background: transparent; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.icon-btn {
  position: relative; width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--border-soft); color: var(--text-secondary);
  transition: var(--transition);
}
.icon-btn:hover { background: var(--navy-900); color: #fff; }
.badge-dot {
  position: absolute; top: 6px; right: 8px; width: 8px; height: 8px;
  background: var(--coral-500); border-radius: 50%; border: 2px solid #fff;
}
.topbar-profile { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-900));
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600;
}
.profile-meta span { display: block; }
.profile-meta .name { font-size: 14px; font-weight: 600; }
.profile-meta .role { font-size: 12px; color: var(--text-secondary); text-transform: capitalize; }

.page-body { padding: 28px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.page-header h1 { font-size: 24px; }
.page-header p { color: var(--text-secondary); font-size: 14px; margin-top: 4px; }
.breadcrumb { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.breadcrumb span { color: var(--navy-900); font-weight: 600; }

/* ---------- Cards & Grid ---------- */
.grid { display: grid; gap: 20px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); padding: 22px; transition: var(--transition);
  border: 1px solid var(--border-soft);
}
.card:hover { box-shadow: var(--shadow-hover); }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.card-sub { font-size: 12.5px; color: var(--text-secondary); }

.stat-card { display: flex; align-items: flex-start; justify-content: space-between; }
.stat-card .stat-icon {
  width: 50px; height: 50px; border-radius: 14px; display: flex;
  align-items: center; justify-content: center; font-size: 20px; color: #fff;
}
.stat-icon.bg-navy { background: linear-gradient(135deg, var(--navy-900), var(--navy-700)); }
.stat-icon.bg-amber { background: linear-gradient(135deg, var(--amber-500), #d98c1f); }
.stat-icon.bg-teal { background: linear-gradient(135deg, var(--teal-500), var(--teal-600)); }
.stat-icon.bg-coral { background: linear-gradient(135deg, var(--coral-500), #c94b48); }
.stat-value { font-size: 28px; font-weight: 700; margin: 10px 0 2px; }
.stat-label { font-size: 13px; color: var(--text-secondary); }
.stat-trend { font-size: 12px; font-weight: 600; margin-top: 8px; display: inline-flex; align-items: center; gap: 4px; }
.stat-trend.up { color: var(--teal-600); }
.stat-trend.down { color: var(--coral-500); }

/* AI insight card */
.ai-card {
  background: linear-gradient(135deg, var(--navy-950), var(--navy-800));
  color: #fff; border-radius: var(--radius-lg); padding: 22px;
  position: relative; overflow: hidden;
}
.ai-card::after {
  content: ''; position: absolute; width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(245,166,35,0.25), transparent 70%);
  top: -60px; right: -60px;
}
.ai-card .ai-tag {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--amber-500);
  background: rgba(245,166,35,0.12); padding: 5px 10px; border-radius: 20px; margin-bottom: 12px;
}
.risk-pill { padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; display: inline-block; }
.risk-low { background: rgba(45,212,191,0.15); color: var(--teal-600); }
.risk-medium { background: rgba(245,166,35,0.15); color: #b8790f; }
.risk-high { background: rgba(239,100,97,0.15); color: var(--coral-500); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); }
table.data-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.data-table th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-secondary); padding: 12px 16px; border-bottom: 1px solid var(--border-soft);
}
.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--border-soft); font-size: 14px; }
.data-table tr:hover td { background: #fafbff; }
.table-avatar { display: flex; align-items: center; gap: 10px; }
.table-avatar .avatar { width: 34px; height: 34px; font-size: 13px; }

.status-badge { padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.status-active, .status-present, .status-approved, .status-pass, .status-completed { background: rgba(45,212,191,0.15); color: var(--teal-600); }
.status-inactive, .status-absent, .status-rejected, .status-fail { background: rgba(239,100,97,0.15); color: var(--coral-500); }
.status-pending, .status-late, .status-requested { background: rgba(245,166,35,0.15); color: #b8790f; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.form-group { margin-bottom: 18px; position: relative; }
.form-group label:not(.checkbox-label) {
  display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: var(--text-primary);
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border-soft); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; background: #fff; transition: var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--navy-700); box-shadow: 0 0 0 4px rgba(42,53,88,0.08);
}
.form-group.floating input { padding: 18px 14px 8px 40px; }
.form-group.floating label { position: absolute; left: 40px; top: 16px; color: var(--text-secondary); font-size: 14px; transition: var(--transition); pointer-events: none; }
.form-group.floating input:focus + label,
.form-group.floating input:not(:placeholder-shown) + label {
  top: 6px; font-size: 11px; font-weight: 600; color: var(--navy-700);
}
.form-group.floating i { position: absolute; left: 14px; top: 18px; color: var(--text-secondary); }

/* ---------- Modal ---------- */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(12,18,36,0.5);
  z-index: 200; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box { background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 560px; padding: 26px; max-height: 88vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-close { font-size: 20px; color: var(--text-secondary); }

/* ---------- Misc ---------- */
.section-title { font-size: 17px; font-weight: 700; margin-bottom: 16px; }
.divider { height: 1px; background: var(--border-soft); margin: 20px 0; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-secondary); }
.empty-state i { font-size: 38px; margin-bottom: 12px; color: var(--border-soft); }

.progress-bar { height: 8px; background: var(--border-soft); border-radius: 20px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--teal-500), var(--teal-600)); }
.progress-bar.warn span { background: linear-gradient(90deg, var(--amber-500), #d98c1f); }
.progress-bar.danger span { background: linear-gradient(90deg, var(--coral-500), #c94b48); }

.toast-container { position: fixed; top: 20px; right: 20px; z-index: 999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: #fff; border-left: 4px solid var(--teal-500); border-radius: 10px; padding: 14px 18px;
  box-shadow: var(--shadow-hover); font-size: 14px; min-width: 260px; animation: slideIn 0.3s ease;
}
.toast.error { border-color: var(--coral-500); }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.skeleton { background: linear-gradient(90deg, #eef0f8 25%, #f7f8fc 37%, #eef0f8 63%); background-size: 400% 100%; animation: skeleton-loading 1.4s ease infinite; border-radius: 8px; }
@keyframes skeleton-loading { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .topbar-search { display: none; }
  .page-body { padding: 18px; }
}
