:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #222536;
  --border: #2e3147;
  --text: #e8eaf0;
  --text2: #8b90a7;
  --text3: #555a72;
  --accent: #6366f1;
  --accent2: #818cf8;
  --green: #10b981;
  --red: #ef4444;
  --yellow: #f59e0b;
  --blue: #3b82f6;
  --purple: #a855f7;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,.4);
}

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

body {
  font-family: -apple-system,
    BlinkMacSystemFont, 'Inter',
    'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track {
  background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px; }

/* ── LOGIN ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 50%,
      rgba(99,102,241,.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%,
      rgba(168,85,247,.06) 0%, transparent 60%);
}

.login-card {
  width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  box-shadow: var(--shadow);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.login-logo .icon {
  width: 44px; height: 44px;
  background: linear-gradient(
    135deg, var(--accent), var(--purple));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.login-logo h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.login-logo span {
  font-size: 12px;
  color: var(--text2);
  display: block;
  margin-top: 1px;
}

.login-card h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.login-card p {
  color: var(--text2);
  font-size: 13px;
  margin-bottom: 28px;
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
}

.field input {
  width: 100%;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color .2s,
    box-shadow .2s;
  outline: none;
}

.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px
    rgba(99,102,241,.15);
}

.field input::placeholder {
  color: var(--text3);
}


.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-error {
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.2);
  color: #fca5a5;
}

.alert-success {
  background: rgba(16,185,129,.1);
  border: 1px solid rgba(16,185,129,.2);
  color: #6ee7b7;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  width: 100%;
}

.btn-primary:hover {
  background: var(--accent2);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px
    rgba(99,102,241,.4);
}

.btn-ghost {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--border);
}

.btn-success {
  background: var(--green);
  color: #fff;
}

.btn-success:hover {
  background: #0ea571;
  transform: translateY(-1px);
}

.btn-danger {
  background: rgba(239,68,68,.15);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,.2);
}

.btn-danger:hover {
  background: rgba(239,68,68,.25);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-icon {
  width: 32px; height: 32px;
  padding: 0;
  border-radius: 8px;
}

/* ── LAYOUT ── */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  bottom: 0;
  z-index: 50;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo .app-icon {
  width: 36px; height: 36px;
  background: linear-gradient(
    135deg, var(--accent), var(--purple));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.sidebar-logo h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.sidebar-logo span {
  font-size: 11px;
  color: var(--text3);
  display: block;
}

.sidebar-section {
  padding: 20px 12px 8px;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text3);
  padding: 0 8px;
  margin-bottom: 4px;
}

.sidebar-nav { flex: 1; overflow-y: auto; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-radius: var(--radius-sm);
  color: var(--text2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
  margin-bottom: 1px;
  position: relative;
}

.nav-item .nav-icon {
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 15px;
  flex-shrink: 0;
  background: transparent;
  transition: background .15s;
}

.nav-item:hover {
  color: var(--text);
  background: var(--surface2);
}

.nav-item:hover .nav-icon {
  background: var(--border);
}

.nav-item.active {
  color: var(--text);
  background: rgba(99,102,241,.12);
}

.nav-item.active .nav-icon {
  background: rgba(99,102,241,.2);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
}

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

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
}

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(
    135deg, var(--accent), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }

.user-info strong {
  display: block;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-info span {
  font-size: 11px;
  color: var(--text3);
}

.user-pill a {
  color: var(--text3);
  text-decoration: none;
  font-size: 16px;
  transition: color .15s;
}

.user-pill a:hover { color: var(--red); }

/* ── MAIN ── */
.main {
  margin-left: 240px;
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 60px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-title {
  flex: 1;
}

.topbar-title h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.topbar-title p {
  font-size: 12px;
  color: var(--text2);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.content {
  padding: 28px;
  flex: 1;
}

/* ── STATS ── */
.stats-grid {
  display: grid;
  grid-template-columns:
    repeat(auto-fit, minmax(200px,1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color .2s,
    transform .2s;
}

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

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: .06;
  transform: translate(20px, -20px);
}

.stat-card.purple::before {
  background: var(--accent); }
.stat-card.green::before {
  background: var(--green); }
.stat-card.blue::before {
  background: var(--blue); }
.stat-card.yellow::before {
  background: var(--yellow); }
.stat-card.red::before {
  background: var(--red); }

.stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 16px;
}

.purple .stat-icon {
  background: rgba(99,102,241,.15); }
.green .stat-icon {
  background: rgba(16,185,129,.15); }
.blue .stat-icon {
  background: rgba(59,130,246,.15); }
.yellow .stat-icon {
  background: rgba(245,158,11,.15); }
.red .stat-icon {
  background: rgba(239,68,68,.15); }

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 6px;
}

.purple .stat-value { color: var(--accent2); }
.green .stat-value  { color: var(--green); }
.blue .stat-value   { color: var(--blue); }
.yellow .stat-value { color: var(--yellow); }
.red .stat-value    { color: var(--red); }

.stat-sub {
  font-size: 12px;
  color: var(--text3);
}

/* ── CARD ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.card-header .count {
  font-size: 13px;
  color: var(--text2);
  font-weight: 400;
}

.card-body { padding: 20px; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

thead tr {
  border-bottom: 1px solid var(--border);
}

th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text3);
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text2);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: background .1s;
}

tbody tr:hover td {
  background: rgba(255,255,255,.02);
  color: var(--text);
}

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-nursing {
  background: rgba(59,130,246,.15);
  color: #93c5fd;
}
.badge-medicine {
  background: rgba(245,158,11,.15);
  color: #fcd34d;
}
.badge-pharmacy {
  background: rgba(16,185,129,.15);
  color: #6ee7b7;
}
.badge-dentistry {
  background: rgba(168,85,247,.15);
  color: #d8b4fe;
}
.badge-physiotherapy {
  background: rgba(239,68,68,.15);
  color: #fca5a5;
}
.badge-general {
  background: rgba(255,255,255,.08);
  color: var(--text2);
}
.badge-active {
  background: rgba(16,185,129,.15);
  color: var(--green);
}
.badge-inactive {
  background: rgba(255,255,255,.05);
  color: var(--text3);
}
.badge-pro {
  background: rgba(99,102,241,.15);
  color: var(--accent2);
}

/* ── TABS ── */
.tab-nav {
  display: flex;
  gap: 2px;
  background: var(--surface2);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.tab-btn {
  flex: 1;
  padding: 8px 12px;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text2);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,.04);
}

.tab-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  border: 1px solid var(--border);
}

/* ── SEARCH ── */
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-input-wrap input {
  width: 100%;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 14px 9px 36px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
}

.search-input-wrap input:focus {
  border-color: var(--accent);
}

.search-input-wrap input::placeholder {
  color: var(--text3);
}

.search-input-wrap .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  font-size: 14px;
  pointer-events: none;
}

.filter-select {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  min-width: 160px;
}

.filter-select:focus {
  border-color: var(--accent);
}

/* ── MODAL ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 640px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  animation: modalIn .2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(.96)
    translateY(10px); }
  to   { opacity: 1; transform: scale(1)
    translateY(0); }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  width: 32px; height: 32px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text2);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}

.modal-close:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.modal-body { padding: 24px; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  position: sticky;
  bottom: 0;
  background: var(--surface);
}

/* ── FORM ── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s,
    box-shadow .2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px
    rgba(99,102,241,.12);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text3);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.form-group select option {
  background: var(--surface2);
}

.form-hint {
  font-size: 11px;
  color: var(--text3);
  margin-top: 5px;
}

/* ── PROGRESS BAR ── */
.progress-bar {
  height: 6px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(
    90deg, var(--accent), var(--purple));
  border-radius: 3px;
  transition: width .3s ease;
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text3);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: .4;
}

.empty-state h3 {
  font-size: 16px;
  color: var(--text2);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 13px;
  max-width: 280px;
  margin: 0 auto;
}

/* ── SKILL PILLS ── */
.skill-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.skill-listening {
  background: rgba(59,130,246,.15);
  color: #93c5fd;
}
.skill-reading {
  background: rgba(16,185,129,.15);
  color: #6ee7b7;
}
.skill-writing {
  background: rgba(245,158,11,.15);
  color: #fcd34d;
}
.skill-speaking {
  background: rgba(168,85,247,.15);
  color: #d8b4fe;
}

/* ── GRID ── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .sidebar { width: 200px; }
  .main { margin-left: 200px; }
  .form-row { grid-template-columns: 1fr; }
}

/* ── MISC ── */
.mono {
  font-family: 'SF Mono', 'Fira Code',
    monospace;
  font-size: 11px;
  color: var(--text3);
}

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

.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}
.dot-green { background: var(--green); }
.dot-red { background: var(--red); }
.dot-yellow { background: var(--yellow); }

.tooltip {
  position: relative;
}
.tooltip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
}
.tooltip:hover::after { opacity: 1; }