/* ============================================================
   AUN-QA / EdPEx Benchmarking System
   Main Stylesheet — Professional Navy/Teal Theme
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Variables ── */
:root {
  --navy:       #0f2957;
  --navy-dark:  #091d3e;
  --navy-light: #1a3d7c;
  --teal:       #0d9488;
  --teal-light: #14b8a6;
  --teal-pale:  #e6faf8;
  --gold:       #f59e0b;
  --danger:     #ef4444;
  --success:    #22c55e;
  --gray-100:   #f8f9fc;
  --gray-200:   #eef0f6;
  --gray-400:   #94a3b8;
  --gray-600:   #475569;
  --gray-800:   #1e293b;
  --sidebar-w:  260px;
  --header-h:   64px;
  --radius:     12px;
  --shadow:     0 4px 24px rgba(15,41,87,.10);
  --shadow-sm:  0 2px 8px  rgba(15,41,87,.07);
  --transition: .2s ease;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Sarabun', 'Inter', sans-serif;
  background: var(--gray-100);
  color: var(--gray-800);
  margin: 0;
  min-height: 100vh;
}

/* ── Auth Pages ── */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy-light) 50%, var(--teal) 100%);
  padding: 1.5rem;
}
.auth-card {
  background: #fff;
  border-radius: calc(var(--radius) * 1.5);
  box-shadow: 0 24px 64px rgba(0,0,0,.25);
  padding: 2.5rem 2.75rem;
  width: 100%;
  max-width: 480px;
  animation: slideUp .4s ease;
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1.75rem;
}
.auth-logo .brand-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--navy), var(--teal));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.2rem;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: linear-gradient(180deg, var(--navy-dark) 0%, var(--navy) 100%);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform var(--transition);
  overflow-y: auto;
}
.sidebar-brand {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,.08);
  text-decoration: none;
  min-height: var(--header-h);
}
.sidebar-brand .brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--teal), var(--teal-light));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem; flex-shrink: 0;
}
.sidebar-brand .brand-sub {
  font-size: .7rem;
  font-weight: 400;
  opacity: .65;
  display: block;
}
.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
}
.nav-section-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  padding: .75rem 1.5rem .3rem;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1.5rem;
  color: rgba(255,255,255,.72);
  text-decoration: none;
  font-size: .9rem;
  transition: all var(--transition);
  position: relative;
  border-radius: 0;
  margin: .1rem .75rem;
  border-radius: 8px;
}
.sidebar-link:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.sidebar-link.active {
  background: linear-gradient(90deg, var(--teal), var(--teal-light));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(13,148,136,.35);
}
.sidebar-link i { width: 18px; text-align: center; font-size: .95rem; }
.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: .65rem;
}
.sidebar-user .avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--teal), var(--gold));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; font-weight: 700; color: #fff;
}
.sidebar-user .user-info small { display: block; font-size: .72rem; color: rgba(255,255,255,.5); }
.sidebar-user .user-name { font-size: .85rem; color: #fff; font-weight: 500; }

/* ── Main Layout ── */
.content-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  gap: 1rem;
}
.topbar-title { font-size: 1.1rem; font-weight: 600; color: var(--navy); flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: .75rem; }
.main-content { flex: 1; padding: 2rem; }

/* ── Cards ── */
.card {
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  background: #fff;
}
.card-header {
  border-bottom: 1px solid var(--gray-200);
  background: transparent;
  padding: 1.1rem 1.5rem;
  font-weight: 600;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: .6rem;
}
.card-header i { color: var(--teal); }

/* ── Stat Cards ── */
.stat-card {
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
  color: inherit;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-card .stat-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; line-height: 1; }
.stat-card .stat-label { font-size: .82rem; opacity: .75; margin-top: .2rem; }
.stat-card.navy { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%); color: #fff; }
.stat-card.teal  { background: linear-gradient(135deg, var(--teal) 0%, var(--teal-light) 100%); color: #fff; }
.stat-card.gold  { background: linear-gradient(135deg, #d97706 0%, var(--gold) 100%); color: #fff; }
.stat-card.success { background: linear-gradient(135deg, #16a34a 0%, var(--success) 100%); color: #fff; }

/* ── Progress Bars ── */
.progress { height: 8px; border-radius: 4px; background: var(--gray-200); }
.progress-bar { border-radius: 4px; background: linear-gradient(90deg, var(--teal), var(--teal-light)); }

/* ── Badges ── */
.badge-aunqa { background: rgba(15,41,87,.12); color: var(--navy); font-weight: 600; padding: .3rem .7rem; border-radius: 6px; font-size: .78rem; }
.badge-edpex { background: rgba(13,148,136,.12); color: var(--teal); font-weight: 600; padding: .3rem .7rem; border-radius: 6px; font-size: .78rem; }

/* ── Tables ── */
.table thead th {
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  font-size: .82rem;
  letter-spacing: .03em;
  border: none;
  padding: .85rem 1rem;
}
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: var(--teal-pale); }
.table td { vertical-align: middle; border-color: var(--gray-200); font-size: .9rem; }

/* ── Forms ── */
.form-label { font-weight: 600; font-size: .85rem; color: var(--gray-600); margin-bottom: .35rem; }
.form-control, .form-select {
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  padding: .6rem .9rem;
  font-size: .9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus, .form-select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13,148,136,.15);
  outline: none;
}

/* ── Buttons ── */
.btn-navy {
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: #fff; border: none;
  border-radius: 8px; font-weight: 600;
  transition: all var(--transition);
}
.btn-navy:hover { filter: brightness(1.1); color: #fff; transform: translateY(-1px); }
.btn-teal {
  background: linear-gradient(135deg, var(--teal), var(--teal-light));
  color: #fff; border: none;
  border-radius: 8px; font-weight: 600;
  transition: all var(--transition);
}
.btn-teal:hover { filter: brightness(1.08); color: #fff; transform: translateY(-1px); }
.btn-outline-navy {
  border: 1.5px solid var(--navy); color: var(--navy);
  border-radius: 8px; font-weight: 600;
  transition: all var(--transition);
}
.btn-outline-navy:hover { background: var(--navy); color: #fff; }

/* ── Tabs ── */
.nav-pills .nav-link { border-radius: 8px; color: var(--gray-600); font-weight: 500; }
.nav-pills .nav-link.active {
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
}

/* ── Breadcrumb ── */
.breadcrumb-item a { color: var(--teal); text-decoration: none; }
.breadcrumb-item.active { color: var(--gray-600); }

/* ── Utilities ── */
.text-navy  { color: var(--navy) !important; }
.text-teal  { color: var(--teal) !important; }
.bg-navy    { background: var(--navy) !important; }
.bg-teal    { background: var(--teal) !important; }
.section-title { font-size: 1.1rem; font-weight: 700; color: var(--navy); margin-bottom: 1.25rem; }

/* ── Animations ── */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.animate-fadeIn { animation: fadeIn .4s ease; }

/* ── Responsive ── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-260px); }
  .sidebar.open { transform: translateX(0); --sidebar-w: 260px; }
  .topbar { padding: 0 1rem; }
  .main-content { padding: 1rem; }
}
