/* ── InternHub CSS ──────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

:root {
  --bg:          #0f1117;
  --surface:     #181b24;
  --surface-2:   #1e2130;
  --border:      #2a2f42;
  --border-soft: #232740;
  --text:        #e8eaf0;
  --text-muted:  #8891aa;
  --text-dim:    #5a6180;
  --accent:      #6c8ef5;
  --accent-soft: rgba(108,142,245,.12);
  --accent-glow: rgba(108,142,245,.25);
  --green:       #3dd68c;
  --red:         #f56565;
  --orange:      #f6ad55;
  --yellow:      #ecc94b;
  --purple:      #b794f4;
  --cyan:        #63b3ed;
  --radius:      10px;
  --radius-sm:   6px;
  --shadow:      0 1px 3px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.25);
  --shadow-md:   0 4px 24px rgba(0,0,0,.5);
}

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

html { font-size: 15px; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
}

/* ── Layout ─────────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; width: 100%; }

.sidebar {
  width: 230px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 100;
}

.main-content {
  flex: 1;
  margin-left: 230px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-body {
  flex: 1;
  padding: 32px 36px;
  max-width: 1400px;
  width: 100%;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar-brand {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  width: 34px; height: 34px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}

.logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.3px;
}

.sidebar-nav { padding: 16px 12px; flex: 1; }

.nav-section-label {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 8px 8px 6px;
  margin-top: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 450;
  transition: all .15s;
  margin-bottom: 2px;
}

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

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
  font-size: .78rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ── Topbar ──────────────────────────────────────────────────── */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 36px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

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

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
  line-height: 1;
}

.btn svg { width: 14px; height: 14px; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: #5a7ee8; border-color: #5a7ee8; }

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-outline:hover { background: var(--surface-2); color: var(--text); }

.btn-danger {
  background: transparent;
  color: var(--red);
  border-color: rgba(245,101,101,.3);
}
.btn-danger:hover { background: rgba(245,101,101,.1); }

.btn-success {
  background: var(--green);
  color: #0f1117;
  border-color: var(--green);
}

.btn-sm { padding: 5px 11px; font-size: .82rem; }
.btn-xs { padding: 3px 8px; font-size: .78rem; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

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

.card-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
}

.card-body { padding: 22px; }

/* ── Stat Cards ──────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent-color, var(--accent));
}

.stat-label {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  font-family: 'DM Mono', monospace;
  color: var(--text);
  line-height: 1;
}

.stat-icon {
  position: absolute;
  right: 16px;
  top: 16px;
  font-size: 1.4rem;
  opacity: .2;
}

/* ── Badges / Status ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .02em;
}

.badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.badge-pending     { background: rgba(246,173,85,.12); color: var(--orange); }
.badge-scheduled   { background: rgba(99,179,237,.12); color: var(--cyan); }
.badge-interviewed { background: rgba(183,148,244,.12); color: var(--purple); }
.badge-approved    { background: rgba(61,214,140,.12); color: var(--green); }
.badge-rejected    { background: rgba(245,101,101,.12); color: var(--red); }
.badge-closed      { background: rgba(90,97,128,.15); color: var(--text-dim); }

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

thead th {
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 600;
  font-size: .75rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border-soft);
  transition: background .1s;
}

tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child { border-bottom: none; }

tbody td {
  padding: 13px 16px;
  color: var(--text);
  vertical-align: middle;
}

.td-name { font-weight: 600; }
.td-email { color: var(--text-muted); font-size: .84rem; }
.td-actions { white-space: nowrap; display: flex; gap: 6px; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-group.span-2 { grid-column: span 2; }
.form-group.span-3 { grid-column: span 3; }

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

label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .02em;
}

input[type=text],
input[type=email],
input[type=tel],
input[type=url],
input[type=date],
input[type=time],
input[type=datetime-local],
input[type=file],
select,
textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: .9rem;
  padding: 9px 13px;
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  appearance: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

input[type=file] { cursor: pointer; }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238891aa'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

textarea { resize: vertical; min-height: 90px; }

.form-help { font-size: .78rem; color: var(--text-dim); }

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

/* ── Alerts / Flash ──────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  margin-bottom: 18px;
  border: 1px solid;
}

.alert-success { background: rgba(61,214,140,.08); border-color: rgba(61,214,140,.25); color: var(--green); }
.alert-error   { background: rgba(245,101,101,.08); border-color: rgba(245,101,101,.25); color: var(--red); }
.alert-info    { background: var(--accent-soft); border-color: var(--accent-glow); color: var(--accent); }

/* ── Search & Filters ────────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 20px;
}

.filter-bar input,
.filter-bar select {
  width: auto;
  min-width: 160px;
}

.search-input { min-width: 260px !important; }

/* ── Pagination ──────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  justify-content: space-between;
}

.pagination-info { font-size: .82rem; color: var(--text-muted); }

.page-links { display: flex; gap: 4px; }

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  font-size: .84rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: all .15s;
}

.page-link:hover { background: var(--surface-2); color: var(--text); }
.page-link.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-link.disabled { opacity: .3; pointer-events: none; }

/* ── Profile / Detail view ───────────────────────────────────── */
.profile-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 28px;
}

.profile-avatar {
  width: 56px; height: 56px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-glow);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.profile-name { font-size: 1.3rem; font-weight: 700; margin-bottom: 4px; }
.profile-sub  { font-size: .875rem; color: var(--text-muted); display: flex; gap: 16px; flex-wrap: wrap; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.detail-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-soft);
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px;
  align-items: start;
}

.detail-item:last-child { border-bottom: none; }

.detail-key {
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-dim);
  padding-top: 2px;
}

.detail-val { font-size: .9rem; color: var(--text); word-break: break-word; }

/* ── Page header ─────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

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

.empty-state .icon { font-size: 2.5rem; margin-bottom: 14px; opacity: .4; }
.empty-state p { font-size: .9rem; }

/* ── Import progress ─────────────────────────────────────────── */
.import-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}

.step-row { display: flex; gap: 12px; align-items: flex-start; }
.step-content { flex: 1; }
.step-title { font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.step-desc  { font-size: .82rem; color: var(--text-muted); }

/* ── Misc ────────────────────────────────────────────────────── */
.text-muted  { color: var(--text-muted); }
.text-small  { font-size: .82rem; }
.mono        { font-family: 'DM Mono', monospace; }
.divider     { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.gap-8       { display: flex; gap: 8px; flex-wrap: wrap; }
.mt-20       { margin-top: 20px; }

.section-title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-dim);
  margin-bottom: 14px;
}

/* ── Confirm dialog ──────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 380px;
  width: 90%;
  box-shadow: var(--shadow-md);
}

.modal-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 10px; }
.modal-body  { font-size: .9rem; color: var(--text-muted); margin-bottom: 22px; }
.modal-actions { display: flex; gap: 10px; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group.span-2, .form-group.span-3 { grid-column: span 1; }
  .page-body { padding: 20px 16px; }
  .topbar { padding: 0 16px; }
  .detail-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar input, .filter-bar select { width: 100%; min-width: 0; }
}

/* ── Hamburger ───────────────────────────────────────────────── */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  padding: 4px;
}
@media (max-width: 900px) { .hamburger { display: flex; } }
