/* ============================================================
   ABS LMS Design System
   Deep Navy / Royal Blue / Warm Gold / White
   ============================================================ */

:root {
  --navy: #0b1f3a;
  --navy-800: #102a4f;
  --navy-700: #16345f;
  --blue: #1e4fa3;
  --blue-600: #1a4590;
  --blue-50: #eaf1fb;
  --gold: #c9a227;
  --gold-600: #ad8a1f;
  --gold-50: #fbf3dc;
  --white: #ffffff;
  --gray-25: #fbfbfc;
  --gray-50: #f6f7f9;
  --gray-100: #eef0f3;
  --gray-200: #e2e5ea;
  --gray-300: #cbd1db;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-900: #101828;
  --green: #16a34a;
  --green-50: #eafaf0;
  --red: #dc2626;
  --red-50: #fdecec;
  --amber: #d97706;
  --amber-50: #fef6e7;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08);
  --sidebar-w: 264px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-weight: 700; margin: 0 0 4px; color: var(--navy); letter-spacing: -0.01em; }
h1 { font-size: 24px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0 0 8px; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
small, .text-sm { font-size: 12.5px; }
.text-muted { color: var(--gray-500); }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* ---------------- Layout shell ---------------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-800) 100%);
  color: #cfd9ea;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  overflow-y: auto;
  z-index: 40;
  transition: transform .2s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand .mark {
  width: 38px; height: 38px; border-radius: 9px;
  background: var(--gold);
  color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; flex-shrink: 0;
}
.sidebar-brand .name { font-weight: 700; color: #fff; font-size: 14.5px; line-height: 1.25; }
.sidebar-brand .sub { font-size: 11px; color: #93a4c2; }
.sidebar-nav { padding: 12px 10px 30px; }
.nav-group-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  color: #6d80a4; padding: 14px 12px 6px;
  font-weight: 700;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px; color: #c3cee2;
  font-size: 13.5px; font-weight: 500; margin-bottom: 1px; cursor: pointer;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; text-decoration: none; }
.nav-item.active { background: var(--gold); color: var(--navy); font-weight: 700; }
.nav-item .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .55; flex-shrink: 0; }
.nav-sub { padding-left: 20px; display: none; }
.nav-group.open .nav-sub { display: block; }
.nav-sub .nav-item { font-size: 13px; padding: 7px 12px; }
.nav-toggle { cursor: pointer; user-select: none; }
.nav-toggle .chev { margin-left: auto; transition: transform .15s; font-size: 10px; opacity: .7; }
.nav-group.open .nav-toggle .chev { transform: rotate(90deg); }

.main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 62px; background: #fff; border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 30;
}
.topbar .page-title { font-weight: 700; color: var(--navy); font-size: 16px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.user-chip { display: flex; align-items: center; gap: 9px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--blue-50); color: var(--blue);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
  overflow: hidden; flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-chip .meta { line-height: 1.25; }
.user-chip .uname { font-size: 13px; font-weight: 600; color: var(--gray-900); }
.user-chip .urole { font-size: 11px; color: var(--gray-500); text-transform: capitalize; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  background: var(--gray-50); border: 1px solid var(--gray-200); color: var(--gray-600); cursor: pointer; position: relative;
}
.icon-btn:hover { background: var(--gray-100); }
.badge-dot { position: absolute; top: -3px; right: -3px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; border-radius: 8px; min-width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; padding: 0 3px; }
.content { padding: 24px; max-width: 1400px; width: 100%; margin: 0 auto; }

.mobile-menu-btn { display: none; }
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .mobile-menu-btn { display: flex; }
  .content { padding: 16px; }
}

/* ---------------- Auth pages ---------------- */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 20% 20%, var(--navy-700), var(--navy) 60%);
  padding: 20px;
}
.auth-card {
  background: #fff; border-radius: 16px; width: 100%; max-width: 400px;
  padding: 36px 32px; box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.auth-brand { text-align: center; margin-bottom: 26px; }
.auth-brand .mark {
  width: 52px; height: 52px; border-radius: 12px; background: var(--gold); color: var(--navy);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 12px;
  font-weight: 800; font-size: 19px;
}
.auth-brand h1 { font-size: 17px; margin-bottom: 2px; }
.auth-brand p { color: var(--gray-500); font-size: 12.5px; }

/* ---------------- Cards / grid ---------------- */
.card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-body { padding: 20px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-header h2, .card-header h3 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------------- Stat cards ---------------- */
.stat-card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.stat-card .stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-card .stat-label { color: var(--gray-500); font-size: 12.5px; font-weight: 600; }
.stat-card .stat-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.stat-card .stat-value { font-size: 26px; font-weight: 800; color: var(--navy); }
.stat-card .stat-sub { font-size: 11.5px; color: var(--gray-500); }
.ic-blue { background: var(--blue-50); color: var(--blue); }
.ic-gold { background: var(--gold-50); color: var(--gold-600); }
.ic-green { background: var(--green-50); color: var(--green); }
.ic-red { background: var(--red-50); color: var(--red); }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.3px; }
table.table th {
  text-align: left; padding: 10px 14px; background: var(--gray-50); color: var(--gray-600);
  font-weight: 700; text-transform: uppercase; font-size: 10.8px; letter-spacing: .04em;
  border-bottom: 1px solid var(--gray-200); white-space: nowrap;
}
table.table td { padding: 11px 14px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
table.table tr:last-child td { border-bottom: none; }
table.table tr:hover td { background: var(--gray-25); }
.table-empty { padding: 40px 20px; text-align: center; color: var(--gray-500); }

/* ---------------- Badges ---------------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: capitalize; }
.badge-green { background: var(--green-50); color: var(--green); }
.badge-red { background: var(--red-50); color: var(--red); }
.badge-amber { background: var(--amber-50); color: var(--amber); }
.badge-blue { background: var(--blue-50); color: var(--blue); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px; font-size: 13.3px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; line-height: 1.2;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-600); text-decoration: none; }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-600); text-decoration: none; color: var(--navy); }
.btn-outline { background: #fff; border-color: var(--gray-300); color: var(--gray-700); }
.btn-outline:hover { background: var(--gray-50); text-decoration: none; }
.btn-danger { background: var(--red-50); color: var(--red); }
.btn-danger:hover { background: #fbdada; text-decoration: none; }
.btn-sm { padding: 6px 11px; font-size: 12.3px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------------- Forms ---------------- */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 700px) { .form-row { grid-template-columns: 1fr; } }
label { display: block; font-size: 12.5px; font-weight: 700; color: var(--gray-700); margin-bottom: 6px; }
label .req { color: var(--red); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time],
input[type=datetime-local], input[type=number], input[type=file], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--gray-300); border-radius: 8px;
  font-size: 13.5px; font-family: inherit; background: #fff; color: var(--gray-900);
}
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-50); }
.help-text { font-size: 11.5px; color: var(--gray-500); margin-top: 4px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }
.select-multi { min-height: 120px; }

/* ---------------- Alerts / flash ---------------- */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 13.3px; margin-bottom: 16px; display: flex; align-items: flex-start; gap: 10px; }
.alert-success { background: var(--green-50); color: #0f6a30; border: 1px solid #bfe8cf; }
.alert-error { background: var(--red-50); color: #a01818; border: 1px solid #f3bcbc; }
.alert-info { background: var(--blue-50); color: var(--blue-600); border: 1px solid #bcd3f0; }

/* ---------------- Misc ---------------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar input, .toolbar select { width: auto; min-width: 160px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--gray-200); margin-bottom: 18px; flex-wrap: wrap; }
.tab { padding: 10px 14px; font-size: 13px; font-weight: 600; color: var(--gray-500); border-bottom: 2px solid transparent; cursor: pointer; }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.empty-state { text-align: center; padding: 50px 20px; color: var(--gray-500); }
.empty-state .ic { font-size: 34px; margin-bottom: 10px; }
.divider { height: 1px; background: var(--gray-200); margin: 18px 0; }
.pill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { background: var(--gray-100); border-radius: 20px; padding: 4px 10px; font-size: 11.5px; color: var(--gray-700); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; font-size: 13.3px; }
.kv dt { color: var(--gray-500); font-weight: 600; }
.kv dd { margin: 0; color: var(--gray-900); }
.progress-bar { background: var(--gray-100); border-radius: 20px; height: 8px; overflow: hidden; }
.progress-bar > div { height: 100%; background: var(--blue); }
.join-btn { background: var(--green); color: #fff; }
.join-btn:hover { background: #128a3e; color: #fff; text-decoration: none; }
.meeting-link-hidden { color: var(--gray-500); font-size: 12px; font-style: italic; }
