@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Bengali:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg: #F7F8FA;
  --surface: #FFFFFF;
  --fg: #1A1D23;
  --fg-muted: #6B7280;
  --border: #E5E7EB;
  --sky: #0369A1;
  --sky-light: #E0F2FE;
  --sky-dark: #075985;
  --accent: #0EA5E9;
  --success: #059669;
  --success-light: #D1FAE5;
  --warning: #D97706;
  --warning-light: #FEF3C7;
  --danger: #DC2626;
  --danger-light: #FEE2E2;
  --radius: 8px;
  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Noto Sans Bengali', 'Plus Jakarta Sans', sans-serif;
}

* { box-sizing: border-box; margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
}

/* Layout */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.main { flex: 1; min-width: 0; padding: 24px; overflow-x: hidden; }

.brand { padding: 0 20px 20px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.brand h1 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--sky);
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-icon {
  width: 32px; height: 32px; background: var(--sky);
  border-radius: 8px; display: flex; align-items: center;
  justify-content: center; color: white; font-size: 16px; flex-shrink: 0;
}
.brand small { display: block; color: var(--fg-muted); font-size: 11px; margin-top: 2px; }

.nav { list-style: none; padding: 0; flex: 1; }
.nav li {
  padding: 10px 20px; cursor: pointer; display: flex;
  align-items: center; gap: 10px; color: var(--fg-muted);
  font-weight: 500; font-size: 13px;
  transition: background .15s, color .15s;
  border-left: 3px solid transparent;
}
.nav li:hover { background: var(--sky-light); color: var(--fg); }
.nav li.active { background: var(--sky-light); color: var(--sky); border-left-color: var(--sky); font-weight: 600; }
.nav-icon { font-size: 18px; width: 24px; text-align: center; }
.nav-badge {
  margin-left: auto; background: var(--sky); color: white;
  font-size: 11px; padding: 1px 7px; border-radius: 10px; font-weight: 600;
}

.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.topbar h2 { font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius);
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--fg); cursor: pointer; transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--sky); color: var(--sky); }
.btn-primary { background: var(--sky); color: white; border-color: var(--sky); }
.btn-primary:hover { background: var(--sky-dark); border-color: var(--sky-dark); color: white; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-danger { color: var(--danger); border-color: var(--danger-light); }
.btn-danger:hover { background: var(--danger-light); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat-label { font-size: 12px; color: var(--fg-muted); font-weight: 500; margin-bottom: 4px; }
.stat-value { font-family: var(--font-display); font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }

.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 12px 16px; background: var(--bg); font-weight: 600; font-size: 11px; color: var(--fg-muted); letter-spacing: .03em; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--sky-light); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge-new { background: var(--sky-light); color: var(--sky); }
.badge-contacted { background: var(--warning-light); color: var(--warning); }
.badge-interested { background: #EDE9FE; color: #7C3AED; }
.badge-docs { background: #FFF7ED; color: #C2410C; }
.badge-applied { background: var(--success-light); color: var(--success); }
.badge-done { background: var(--success); color: white; }

.counselor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.counselor-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.counselor-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--sky-light); color: var(--sky); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.counselor-name { font-weight: 600; font-size: 15px; }
.counselor-meta { font-size: 12px; color: var(--fg-muted); display: flex; flex-direction: column; gap: 4px; }
.counselor-stat { display: flex; gap: 16px; font-size: 12px; }
.counselor-stat span { display: flex; align-items: center; gap: 4px; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal { background: var(--surface); border-radius: 12px; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; padding: 24px; }
.modal h3 { font-family: var(--font-display); font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--fg-muted); margin-bottom: 5px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); font-family: var(--font-body);
  font-size: 14px; background: var(--bg); color: var(--fg);
  outline: none; transition: border-color .15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--sky); box-shadow: 0 0 0 3px var(--sky-light); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

.public-form-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(135deg, var(--sky-dark) 0%, var(--sky) 100%); }
.public-form-card { background: var(--surface); border-radius: 16px; padding: 32px; width: 100%; max-width: 440px; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.public-form-card h2 { font-family: var(--font-display); font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 4px; color: var(--sky); }
.public-form-card p { text-align: center; color: var(--fg-muted); font-size: 13px; margin-bottom: 24px; }
.success-msg { text-align: center; padding: 32px 16px; }
.success-msg .check { width: 64px; height: 64px; background: var(--success-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; font-size: 32px; color: var(--success); }

.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px; width: 100%; max-width: 380px; }
.login-card h2 { font-family: var(--font-display); font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 4px; color: var(--sky); }
.login-card p { text-align: center; color: var(--fg-muted); font-size: 13px; margin-bottom: 24px; }
.login-tabs { display: flex; margin-bottom: 20px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.login-tab { flex: 1; padding: 10px; text-align: center; font-size: 13px; font-weight: 600; cursor: pointer; background: var(--bg); color: var(--fg-muted); border: none; font-family: var(--font-body); transition: all .15s; }
.login-tab.active { background: var(--sky); color: white; }
.login-error { background: var(--danger-light); color: var(--danger); padding: 8px 12px; border-radius: var(--radius); font-size: 12px; margin-bottom: 12px; text-align: center; }
.user-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--sky-light); color: var(--sky); padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }

.empty { text-align: center; padding: 48px 16px; color: var(--fg-muted); }
.empty-icon { font-size: 40px; margin-bottom: 12px; }

.search-box { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 12px; flex: 1; max-width: 320px; }
.search-box input { border: none; background: transparent; padding: 8px 0; font-family: var(--font-body); font-size: 13px; color: var(--fg); outline: none; width: 100%; }

.filter-tabs { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-tab { padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: var(--surface); color: var(--fg-muted); transition: all .15s; }
.filter-tab:hover { border-color: var(--sky); color: var(--sky); }
.filter-tab.active { background: var(--sky); color: white; border-color: var(--sky); }

.assign-select { padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; background: var(--bg); color: var(--fg); font-family: var(--font-body); cursor: pointer; max-width: 140px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 10px 20px; border-radius: 8px; font-size: 13px; font-weight: 500; z-index: 200; animation: toastIn .3s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

.export-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-top: 16px; }
.export-section h3 { font-family: var(--font-display); font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.export-filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.export-filters .form-group { margin-bottom: 0; min-width: 150px; }

.mobile-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--border); padding: 6px 0; z-index: 50; }
.mobile-nav ul { display: flex; list-style: none; padding: 0; justify-content: space-around; }
.mobile-nav li { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; font-weight: 600; color: var(--fg-muted); cursor: pointer; padding: 4px 8px; }
.mobile-nav li.active { color: var(--sky); }
.mobile-nav .nav-icon { font-size: 20px; }

.pagination { display: flex; justify-content: center; gap: 4px; margin-top: 16px; }
.pagination button { padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--fg); cursor: pointer; font-size: 12px; font-family: var(--font-body); }
.pagination button.active { background: var(--sky); color: white; border-color: var(--sky); }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }

@media (max-width: 768px) {
  .sidebar { display: none; }
  .mobile-nav { display: block; }
  .main { padding: 16px 16px 80px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .topbar { flex-direction: column; align-items: flex-start; }
  .topbar-actions { width: 100%; }
  .search-box { max-width: 100%; }
  .export-filters { flex-direction: column; }
}
