/* =====================================================================
   UDA CYBER-CLUBS // DEDICATED ADMIN PORTAL STYLESHEET
   ===================================================================== */

:root {
  --admin-bg: #f8fafc;
  --admin-surface: #ffffff;
  --admin-sidebar-bg: #ffffff;
  --admin-border: #e2e8f0;
  --admin-border-focus: #0284c7;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --primary-accent: #0284c7;
  --primary-glow: rgba(2, 132, 199, 0.15);
  --it-cyan: #0284c7;
  --en-gold: #d97706;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;

  --font-hud: 'Chakra Petch', sans-serif;
  --font-body: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Roboto Mono', monospace;
  --font-cond: 'Barlow Condensed', sans-serif;

  --topbar-height: 64px;
  --sidebar-width: 260px;
}

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

body.theme-admin {
  background-color: var(--admin-bg);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
}

/* =====================================================================
   LAYOUT ARCHITECTURE
   ===================================================================== */
.admin-layout {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* =====================================================================
   TOPBAR
   ===================================================================== */
.admin-topbar {
  height: var(--topbar-height);
  background: var(--admin-surface);
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-hex {
  width: 40px;
  height: 40px;
  background: #fff5f7;
  border: 1.5px solid #f472b6;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(244, 114, 182, 0.2);
}

.brand-flower-img {
  width: 26px;
  height: auto;
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-school {
  font-family: var(--font-hud);
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.5px;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--primary-accent);
  letter-spacing: 0.5px;
  font-weight: 600;
}

.topbar-center {
  display: flex;
  align-items: center;
}

.scope-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0369a1;
  padding: 6px 14px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}

.scope-pulse {
  width: 8px;
  height: 8px;
  background: #0284c7;
  border-radius: 50%;
  animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-user-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.role-badge {
  background: var(--primary-accent);
  color: #ffffff;
  font-family: var(--font-hud);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.admin-name {
  font-weight: 700;
  font-size: 12px;
  color: #1e293b;
}

.admin-club-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
}

.btn-action-nav,
.btn-action-logout {
  font-family: var(--font-hud);
  font-size: 11px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-action-nav {
  background: #f8fafc;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.btn-action-nav:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-action-logout {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.btn-action-logout:hover {
  background: #fca5a5;
  color: #991b1b;
}

/* =====================================================================
   WORKSPACE (SIDEBAR + STAGE)
   ===================================================================== */
.admin-workspace {
  display: flex;
  flex: 1;
  height: calc(100vh - var(--topbar-height));
  overflow: hidden;
}

/* Sidebar */
.admin-sidebar {
  width: var(--sidebar-width);
  background: var(--admin-sidebar-bg);
  border-right: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 12px;
  flex-shrink: 0;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-hud);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.nav-tab .tab-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-tab .tab-icon svg {
  width: 100%;
  height: 100%;
}

.nav-tab:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.nav-tab.active {
  background: #e0f2fe;
  color: var(--primary-accent);
  border-color: #bae6fd;
}

.tab-badge {
  margin-left: auto;
  background: #f1f5f9;
  color: #64748b;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.nav-tab.active .tab-badge {
  background: var(--primary-accent);
  color: #ffffff;
}

.sidebar-footer {
  padding-top: 12px;
  border-top: 1px solid var(--admin-border);
}

.system-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.sys-dot {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
}

.sys-text {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #64748b;
  font-weight: 600;
}

.sys-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
}

/* Main Stage */
.admin-stage {
  flex: 1;
  background: var(--admin-bg);
  overflow-y: auto;
  padding: 24px 32px 60px 32px;
}

.admin-view {
  display: none;
}

.admin-view.active {
  display: block;
}

/* View Header */
.view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--admin-border);
}

.hud-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-accent);
  letter-spacing: 1.5px;
  display: block;
  margin-bottom: 4px;
}

.view-title {
  font-family: var(--font-hud);
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
}

.btn-primary-action,
.btn-secondary-action {
  font-family: var(--font-hud);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 9px 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary-action {
  background: var(--primary-accent);
  color: #ffffff;
  border: none;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

.btn-primary-action:hover {
  background: #0284c7;
  transform: translateY(-1px);
}

.btn-secondary-action {
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.btn-secondary-action:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #94a3b8;
}

/* =====================================================================
   KPI METRICS GRID
   ===================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s;
}

.kpi-card:hover {
  transform: translateY(-2px);
}

.kpi-card.highlight-pending {
  border-color: #fde68a;
  background: #fffbeb;
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.kpi-icon.it { background: #e0f2fe; }
.kpi-icon.en { background: #fef3c7; }
.kpi-icon.warning { background: #fef08a; }
.kpi-icon.success { background: #dcfce7; }

.kpi-content {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-family: var(--font-hud);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.kpi-sub {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 4px;
}

.kpi-link {
  font-size: 11.5px;
  font-weight: 700;
  color: #b45309;
  text-decoration: none;
  margin-top: 6px;
}

.kpi-link:hover {
  text-decoration: underline;
}

/* Distribution Panels */
.dashboard-panels-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 10px;
}

.dash-panel {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.panel-header {
  border-bottom: 1px solid var(--admin-border);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.panel-title {
  font-family: var(--font-hud);
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.5px;
}

.club-stat-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.c-info {
  width: 190px;
  display: flex;
  flex-direction: column;
}

.c-info strong { font-size: 13px; color: #1e293b; }
.c-info span { font-size: 11px; }

.c-bar-wrap {
  flex: 1;
  height: 10px;
  background: #f1f5f9;
  border-radius: 5px;
  overflow: hidden;
}

.c-bar.it-bar { background: var(--it-cyan); height: 100%; border-radius: 5px; }
.c-bar.en-bar { background: var(--en-gold); height: 100%; border-radius: 5px; }

.c-count {
  width: 60px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  text-align: right;
  color: #0f172a;
}

.campus-stat-box {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.campus-card {
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--admin-border);
}

.campus-card.danang { background: #f0fdf4; border-color: #bbf7d0; }
.campus-card.daklak { background: #eff6ff; border-color: #bfdbfe; }

.c-tag {
  font-family: var(--font-hud);
  font-size: 10px;
  font-weight: 800;
  color: #475569;
  display: block;
  margin-bottom: 2px;
}

.campus-card h4 {
  font-family: var(--font-hud);
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.c-addr {
  font-size: 11.5px;
  color: #64748b;
  margin: 4px 0 10px 0;
}

.c-metric {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-accent);
}

/* =====================================================================
   FILTER TOOLBAR
   ===================================================================== */
.admin-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.search-box {
  flex: 1;
}

.filter-input {
  width: 100%;
  padding: 8px 14px;
  background: #f8fafc;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s;
}

.filter-input:focus {
  background: #ffffff;
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group label {
  font-family: var(--font-hud);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.filter-select {
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-select:focus {
  border-color: var(--primary-accent);
  background: #ffffff;
}

/* =====================================================================
   DATA TABLES
   ===================================================================== */
.data-table-container {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  overflow-x: auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: left;
}

.admin-table th {
  background: #f8fafc;
  color: #334155;
  font-family: var(--font-hud);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 12px 14px;
  border-bottom: 2px solid var(--admin-border);
  white-space: nowrap;
}

.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--admin-border);
  color: #334155;
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: #f8fafc;
}

/* Badges & Tags */
.club-pill {
  display: inline-block;
  font-family: var(--font-hud);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.club-pill.it { background: #e0f2fe; color: #0284c7; }
.club-pill.english { background: #fef3c7; color: #d97706; }

.campus-chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
}

.status-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.status-badge.pending {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.status-badge.approved {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.status-badge.rejected {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* Action Buttons */
.action-group {
  display: flex;
  gap: 5px;
  align-items: center;
}

.btn-approve {
  background: #16a34a;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  transition: all 0.2s;
}

.btn-approve:hover { background: #15803d; }

.btn-reject {
  background: #ef4444;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  transition: all 0.2s;
}

.btn-reject:hover { background: #dc2626; }

.btn-delete {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-delete:hover {
  background: #fecaca;
  color: #991b1b;
}

.btn-edit {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #7dd3fc;
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  transition: all 0.2s;
}

.btn-edit:hover {
  background: #bae6fd;
  color: #075985;
}

.btn-checkin {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #86efac;
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  transition: all 0.2s;
}

.btn-checkin:hover {
  background: #dcfce7;
  color: #166534;
}

.btn-checked {
  background: #16a34a;
  color: #ffffff;
  border: 1px solid #15803d;
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  transition: all 0.2s;
}

.btn-checked:hover {
  background: #15803d;
}

/* =====================================================================
   MODAL WINDOW
   ===================================================================== */
.admin-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.admin-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
}

.modal-dialog {
  position: relative;
  width: 90%;
  max-width: 680px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
  padding: 28px;
  z-index: 10;
  transform: scale(0.96);
  transition: transform 0.25s ease;
}

.admin-modal.open .modal-dialog {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--admin-border);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.modal-title {
  font-family: var(--font-hud);
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}

.modal-close {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #475569;
}

.modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.admin-form .form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 14px;
}

.admin-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-form .form-group.full-width {
  grid-column: 1 / -1;
  margin-bottom: 14px;
}

.admin-form label {
  font-family: var(--font-hud);
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  letter-spacing: 0.3px;
}

.req { color: #dc2626; }

.admin-input {
  width: 100%;
  padding: 9px 12px;
  background: #f8fafc;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s;
}

.admin-input:focus {
  background: #ffffff;
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--admin-border);
  padding-top: 18px;
  margin-top: 20px;
}

.btn-cancel {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #cbd5e1;
  padding: 8px 18px;
  border-radius: 6px;
  font-family: var(--font-hud);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.btn-submit {
  background: var(--primary-accent);
  color: #ffffff;
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  font-family: var(--font-hud);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

/* =====================================================================
   HUD NOTIFICATION TOAST
   ===================================================================== */
.admin-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #ffffff;
  border: 1px solid var(--admin-border);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
  border-radius: 8px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 200;
  transform: translateY(100px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.admin-toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.admin-toast.error {
  border-color: #ef4444;
}

.toast-dot {
  width: 10px;
  height: 10px;
  background: #10b981;
  border-radius: 50%;
}

.admin-toast.error .toast-dot {
  background: #ef4444;
}

.toast-title {
  font-family: var(--font-hud);
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
}

.toast-msg {
  font-size: 12px;
  color: var(--text-muted);
}
