/* ── WICE Chapter Dashboard CSS ───────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --purple:     #4C1D95;
  --purple-mid: #6D28D9;
  --purple-lt:  #EDE9FE;
  --pink:       #BE185D;
  --gold:       #D97706;
  --gray-50:    #F9FAFB;
  --gray-100:   #F3F4F6;
  --gray-200:   #E5E7EB;
  --gray-400:   #9CA3AF;
  --gray-600:   #4B5563;
  --gray-800:   #1F2937;
  --sidebar-w:  260px;
}

body { font-family: 'Inter', sans-serif; background: var(--gray-50); color: var(--gray-800); min-height: 100vh; }

/* ── Layout ───────────────────────────────────────────── */
.ch-layout { display: flex; min-height: 100vh; }
.ch-main   { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }

/* ── Sidebar ──────────────────────────────────────────── */
.ch-sidebar {
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid var(--gray-200);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.ch-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--gray-200);
}
.ch-sidebar-brand img { width: 40px; height: 40px; object-fit: contain; }
.ch-brand-name { font-size: .95rem; font-weight: 800; color: var(--purple); line-height: 1.2; }
.ch-brand-sub  { font-size: .72rem; color: var(--gray-400); font-weight: 500; }

.ch-nav { flex: 1; padding: 16px 12px; }
.ch-nav-section {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gray-400);
  padding: 0 8px;
  margin: 12px 0 6px;
}
.ch-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: .87rem;
  font-weight: 500;
  color: var(--gray-600);
  text-decoration: none;
  transition: background .15s, color .15s;
  margin-bottom: 2px;
  position: relative;
}
.ch-link i { width: 18px; text-align: center; font-size: .9rem; }
.ch-link:hover  { background: var(--gray-100); color: var(--purple-mid); }
.ch-link.active { background: var(--purple-lt); color: var(--purple-mid); font-weight: 700; }

.ch-badge {
  margin-left: auto;
  background: #EF4444;
  color: #fff;
  font-size: .68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 20px;
}

.ch-sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ch-admin-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ch-admin-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--purple-lt);
  color: var(--purple-mid);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .9rem; flex-shrink: 0;
}
.ch-admin-name { font-size: .82rem; font-weight: 700; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.ch-admin-role { font-size: .72rem; color: var(--gray-400); }
.ch-logout { color: var(--gray-400); text-decoration: none; font-size: 1rem; transition: color .15s; flex-shrink: 0; }
.ch-logout:hover { color: #EF4444; }

/* ── Topbar ───────────────────────────────────────────── */
.ch-topbar {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.ch-page-title { font-size: 1.1rem; font-weight: 800; color: var(--gray-800); display: flex; align-items: center; gap: 10px; }
.ch-page-title i { color: var(--purple-mid); }
.ch-topbar-actions { display: flex; align-items: center; gap: 10px; }

/* ── Content ──────────────────────────────────────────── */
.ch-content { padding: 24px 28px; flex: 1; }

/* ── Stat cards ───────────────────────────────────────── */
.ch-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.ch-stat-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.ch-stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.ch-stat-label  { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-400); margin-bottom: 4px; }
.ch-stat-value  { font-size: 1.65rem; font-weight: 800; color: var(--gray-800); line-height: 1; }
.ch-stat-sub    { font-size: .75rem; color: var(--gray-400); margin-top: 4px; }

/* ── Data card ────────────────────────────────────────── */
.ch-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}
.ch-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  font-weight: 700;
  font-size: .92rem;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ch-card-body { padding: 20px; }

/* ── Table ────────────────────────────────────────────── */
.ch-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.ch-table th {
  background: var(--gray-50);
  border-bottom: 2px solid var(--gray-200);
  padding: 10px 14px;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-400);
  white-space: nowrap;
}
.ch-table td { padding: 12px 14px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.ch-table tbody tr:last-child td { border-bottom: none; }
.ch-table tbody tr:hover { background: var(--gray-50); }

/* ── Badges ───────────────────────────────────────────── */
.ch-badge-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
}
.ch-badge-approved { background: #D1FAE5; color: #065F46; }
.ch-badge-pending  { background: #FEF3C7; color: #92400E; }
.ch-badge-rejected { background: #FEE2E2; color: #991B1B; }
.ch-badge-wice     { background: var(--purple-lt); color: var(--purple-mid); }
.ch-badge-visitor  { background: var(--gray-100); color: var(--gray-600); }

/* ── Buttons ──────────────────────────────────────────── */
.ch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: background .15s, color .15s;
}
.ch-btn-primary  { background: var(--purple-mid); color: #fff; }
.ch-btn-primary:hover { background: var(--purple); color: #fff; }
.ch-btn-success  { background: #10B981; color: #fff; }
.ch-btn-success:hover { background: #059669; color: #fff; }
.ch-btn-danger   { background: #EF4444; color: #fff; }
.ch-btn-danger:hover  { background: #DC2626; color: #fff; }
.ch-btn-outline  { background: transparent; color: var(--gray-600); border: 1px solid var(--gray-200); }
.ch-btn-outline:hover { background: var(--gray-100); color: var(--gray-800); }
.ch-btn-sm { padding: 5px 10px; font-size: .78rem; }
.ch-btn-icon { padding: 6px 10px; }

/* ── Forms ────────────────────────────────────────────── */
.ch-form-group { margin-bottom: 16px; }
.ch-form-group label { display: block; font-size: .82rem; font-weight: 600; color: var(--gray-600); margin-bottom: 5px; }
.ch-form-group input,
.ch-form-group select,
.ch-form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: .88rem;
  color: var(--gray-800);
  background: #fff;
  outline: none;
  transition: border-color .15s;
  font-family: inherit;
}
.ch-form-group input:focus,
.ch-form-group select:focus,
.ch-form-group textarea:focus { border-color: var(--purple-mid); }

/* ── Filter bar ───────────────────────────────────────── */
.ch-filter { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.ch-search { position: relative; }
.ch-search i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--gray-400); font-size: .85rem; }
.ch-search input { padding-left: 34px; width: 220px; }

/* ── Alert ────────────────────────────────────────────── */
.ch-alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: .88rem;
}
.ch-alert-success { background: #D1FAE5; color: #065F46; }
.ch-alert-error   { background: #FEE2E2; color: #991B1B; }
.ch-alert-info    { background: #DBEAFE; color: #1E40AF; }

/* ── Login page ───────────────────────────────────────── */
.ch-login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #4C1D95 0%, #7C3AED 60%, #BE185D 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.ch-login-box {
  background: #fff;
  border-radius: 20px;
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
}
.ch-login-logo { text-align: center; margin-bottom: 28px; }
.ch-login-logo img { width: 60px; height: 60px; object-fit: contain; }
.ch-login-title { text-align: center; font-size: 1.4rem; font-weight: 800; color: var(--purple); margin-bottom: 4px; }
.ch-login-sub   { text-align: center; font-size: .85rem; color: var(--gray-400); margin-bottom: 28px; }

/* ── Pagination ───────────────────────────────────────── */
.ch-pagination { display: flex; gap: 4px; align-items: center; justify-content: center; padding: 16px 0 0; }
.ch-pag-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border: 1px solid var(--gray-200);
  border-radius: 7px;
  font-size: .83rem;
  font-weight: 600;
  color: var(--gray-600);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.ch-pag-btn:hover { background: var(--gray-100); }
.ch-pag-btn.active { background: var(--purple-mid); color: #fff; border-color: var(--purple-mid); }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 1100px) { .ch-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px)  {
  .ch-sidebar { transform: translateX(-100%); }
  .ch-main { margin-left: 0; }
  .ch-content { padding: 16px; }
  .ch-stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) { .ch-stats { grid-template-columns: 1fr; } }
