/* ==============================================================================
   TashTech × ASEM Malaysia Admissions Admin Portal
   High-Contrast Modern Editorial Dashboard (Light & Dark Theme Support)
   ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root, [data-theme="dark"] {
  --bg-main: #090d16;
  --bg-header: rgba(14, 20, 34, 0.96);
  --bg-card: #121a2c;
  --bg-card-hover: #19233a;
  --bg-input: #0d1424;
  
  --border-subtle: #243048;
  --border-strong: #3d4f73;
  --border-focus: #ff5e14;
  
  --text-main: #ffffff;
  --text-muted: #e2e8f0;
  --text-dim: #94a3b8;
  
  --th-bg: #18233c;
  --th-color: #ffffff;
  --td-border: #1a253e;
  
  --accent-orange: #ff5e14;
  --accent-orange-hover: #ff7636;
  --accent-green: #10b981;
  --accent-cyan: #06b6d4;
  --accent-blue: #38bdf8;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --font-main: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="light"] {
  --bg-main: #f1f5f9;
  --bg-header: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-input: #ffffff;
  
  --border-subtle: #cbd5e1;
  --border-strong: #94a3b8;
  --border-focus: #ea580c;
  
  --text-main: #0f172a;
  --text-muted: #1e293b;
  --text-dim: #475569;
  
  --th-bg: #e2e8f0;
  --th-color: #0f172a;
  --td-border: #e2e8f0;
  
  --accent-orange: #ea580c;
  --accent-orange-hover: #c2410c;
  --accent-green: #16a34a;
  --accent-cyan: #0891b2;
  --accent-blue: #0284c7;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }

/* ==============================================================================
   1. PASSWORD LOGIN GATE
   ============================================================================== */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-orange), #ff9800);
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.tt-badge {
  background: var(--accent-orange);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.35);
}

.login-brand-text {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
  color: var(--text-main);
}

.login-card h2 {
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}

.login-card p {
  color: var(--text-dim);
  font-size: 0.88rem;
  margin-bottom: 24px;
  line-height: 1.5;
}

.login-input-group {
  margin-bottom: 20px;
  text-align: left;
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrap input {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  color: var(--text-main);
  font-size: 1.1rem;
  font-family: var(--font-mono);
  outline: none;
  transition: all 0.15s;
  letter-spacing: 2px;
}

.password-input-wrap input:focus {
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 3px rgba(255, 94, 20, 0.25);
}

.btn-login {
  width: 100%;
  padding: 13px;
  background: var(--accent-orange);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.3);
}

.btn-login:hover {
  background: var(--accent-orange-hover);
  transform: translateY(-1px);
}

.login-error {
  color: #ef4444;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 10px;
  display: none;
}

.login-footer-hint {
  margin-top: 22px;
  font-size: 0.8rem;
  color: var(--text-dim);
}
.login-footer-hint a {
  color: var(--accent-orange);
  font-weight: 600;
}

/* ==============================================================================
   2. MAIN ADMIN DASHBOARD
   ============================================================================== */
.dashboard-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.dash-header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 14px 28px;
  backdrop-filter: blur(12px);
}

.dash-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

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

.dash-brand-title {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
}

.dash-tag {
  background: rgba(234, 88, 12, 0.15);
  color: var(--accent-orange);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(234, 88, 12, 0.35);
  font-family: var(--font-mono);
}

.dash-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 0.82rem;
}

.btn-outline {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-strong);
}
.btn-outline:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-dim);
}

.btn-excel {
  background: #16a34a;
  color: #ffffff;
  border-color: #15803d;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
}
.btn-excel:hover {
  background: #15803d;
}

/* Dashboard Tabs */
.dash-nav-tabs {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border-subtle);
}

.nav-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-dim);
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 14px 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s;
}

.nav-tab-btn:hover {
  color: var(--text-main);
}

.nav-tab-btn.active {
  color: var(--accent-orange);
  border-bottom-color: var(--accent-orange);
}

.tab-badge {
  background: rgba(234, 88, 12, 0.2);
  color: var(--accent-orange);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

/* Main Content */
.dash-content {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 28px 40px;
  flex: 1;
}

.dash-pane { display: none; }
.dash-pane.active { display: block; }

/* ==============================================================================
   3. KPI CARDS (HIGH CONTRAST)
   ============================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s, border-color 0.15s;
}

.kpi-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.kpi-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-icon {
  font-size: 1.3rem;
}

.kpi-value {
  font-size: 2.2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-main);
  line-height: 1.1;
  margin-bottom: 6px;
}

.kpi-sub {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-weight: 500;
}
.kpi-sub.highlight {
  color: var(--accent-orange);
  font-weight: 700;
}

/* ==============================================================================
   4. ANALYTICS CHARTS (HIGH CONTRAST)
   ============================================================================== */
.analytics-grid-2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 20px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.chart-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.chart-subtitle {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 18px;
}

.chart-bars-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chart-bar-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.chart-bar-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}
.chart-bar-label strong {
  color: var(--accent-orange);
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.chart-bar-track {
  height: 8px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.chart-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-orange), #fb923c);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.chart-empty {
  color: var(--text-dim);
  font-size: 0.85rem;
  padding: 20px 0;
  text-align: center;
}

/* ==============================================================================
   5. SUBMISSIONS TABLE (PERFECT HIGH CONTRAST)
   ============================================================================== */
.table-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

/* Search Box: High Contrast, Never Glaring White */
.table-search {
  flex: 1;
  min-width: 260px;
}

.table-search input {
  width: 100%;
  background: var(--bg-input) !important;
  border: 1.5px solid var(--border-strong) !important;
  border-radius: var(--radius-md) !important;
  padding: 10px 16px !important;
  color: var(--text-main) !important;
  font-size: 0.88rem !important;
  outline: none !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.15s ease;
}
.table-search input::placeholder {
  color: var(--text-dim) !important;
}
.table-search input:focus {
  border-color: var(--accent-orange) !important;
  box-shadow: 0 0 0 3px rgba(255, 94, 20, 0.25) !important;
}

/* Filters: High Contrast Dropdowns */
.table-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.table-filters select {
  background: var(--bg-input) !important;
  border: 1.5px solid var(--border-strong) !important;
  border-radius: var(--radius-md) !important;
  padding: 10px 14px !important;
  color: var(--text-main) !important;
  font-size: 0.85rem !important;
  font-weight: 500;
  outline: none !important;
  cursor: pointer;
  transition: all 0.15s ease;
}
.table-filters select:focus {
  border-color: var(--accent-orange) !important;
  box-shadow: 0 0 0 3px rgba(255, 94, 20, 0.25) !important;
}
.table-filters select option {
  background-color: var(--bg-card);
  color: var(--text-main);
  padding: 8px;
}

/* Table Container & Headings */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

/* Table Header: Pure White Bold Text */
.data-table th {
  background: var(--th-bg) !important;
  color: var(--th-color) !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  padding: 14px 16px;
  border-bottom: 2px solid var(--border-subtle);
  white-space: nowrap;
}

/* Table Body: High Contrast Rows */
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--td-border);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background-color 0.1s ease;
}
.data-table tbody tr:hover {
  background-color: var(--bg-card-hover);
}

.cell-primary {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.9rem;
}

.cell-sub {
  color: var(--text-dim);
  font-size: 0.78rem;
  display: block;
  margin-top: 2px;
}

/* Status Badges */
.status-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.status-yes {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.status-basic-knowledge {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.status-no {
  background: rgba(148, 163, 184, 0.18);
  color: var(--text-dim);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

/* CV Download Badge */
.badge-cv {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(239, 68, 68, 0.35);
  transition: all 0.15s;
}
.badge-cv:hover {
  background: #ef4444;
  color: #ffffff;
}

.badge-none {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.table-empty {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 60px 20px;
}

/* ==============================================================================
   6. CANDIDATE DOSSIER MODAL
   ============================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-window {
  width: 100%;
  max-width: 760px;
  max-height: 88vh;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
}

.modal-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-top: 3px;
}

.btn-close-modal {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-dim);
  font-size: 1.3rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.15s;
}
.btn-close-modal:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.dossier-actions-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.dossier-section {
  margin-bottom: 22px;
}

.dossier-section h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-orange);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dossier-dl {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 8px 16px;
  font-size: 0.88rem;
}

.dossier-dl dt {
  color: var(--text-dim);
  font-weight: 600;
}

.dossier-dl dd {
  color: var(--text-main);
  font-weight: 500;
}

.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .dash-header { padding: 12px 16px; }
  .dash-content { padding: 16px 14px 30px; }
  .dash-nav-tabs { padding: 0 16px; }
  .analytics-grid-2col { grid-template-columns: 1fr; }
  .dossier-dl { grid-template-columns: 1fr; gap: 4px; }
  .dossier-dl dt { margin-top: 8px; }
}
