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

:root {
  --bg:       #f0f2f7;
  --surface:  #ffffff;
  --border:   #e4e8f0;
  --text:     #1a1d2e;
  --muted:    #64748b;
  --blue:     #3b82f6;
  --blue-d:   #2563eb;
  --green:    #10b981;
  --green-d:  #059669;
  --purple:   #8b5cf6;
  --amber:    #f59e0b;
  --red:      #ef4444;
  --radius:   12px;
  --shadow:   0 2px 12px rgba(0,0,0,.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
}

.container { max-width: 1180px; margin: 0 auto; padding: 24px 20px; }

/* ── Header ── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo svg { color: var(--blue); }
.logo h1 { font-size: 22px; font-weight: 700; }
.header-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ── User nav ── */
.user-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}
.user-nav a { color: var(--blue-d); text-decoration: none; font-weight: 600; }
.user-nav a:hover { text-decoration: underline; }
.user-nav .user-email { color: var(--text); font-weight: 600; }

/* ── Setup banner ── */
.setup-banner {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.7;
}
.setup-banner ol { margin-left: 20px; margin-top: 8px; }
.setup-banner code {
  background: #fef3c7;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: monospace;
}

/* ── Stats ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px 14px;
  text-align: center;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.stat-card .n { font-size: 30px; font-weight: 700; }
.stat-card .l { font-size: 12px; color: var(--muted); font-weight: 500; }
#s-total   .n { color: var(--text); }
.pending   .n { color: var(--amber); }
.applied   .n { color: var(--blue); }
.interview .n { color: var(--purple); }
.offer     .n { color: var(--green); }
.rejected  .n { color: var(--red); }

/* ── Card ── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.card h2 { font-size: 16px; font-weight: 600; }

/* ── Find Jobs ── */
.find-card h2 { margin-bottom: 14px; }
.find-row { display: flex; gap: 10px; }
.find-row input:first-child { flex: 2; }
.find-row input:last-of-type { flex: 1; max-width: 200px; }
.find-row select { flex: 1; max-width: 160px; }
.find-external-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.find-external-label { font-size: 12px; color: var(--muted); }
.find-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}
.find-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: background .15s;
}
.find-item:hover { background: #f8fafc; }
.find-item-main { min-width: 0; }
.find-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.find-item-acts { display: flex; gap: 8px; flex-shrink: 0; }

.find-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}
.find-pagination .pg-label { font-size: 12px; color: var(--muted); min-width: 90px; text-align: center; }

/* ── Add form ── */
.add-card h2 { margin-bottom: 14px; }
.add-row { display: flex; gap: 10px; }
.add-row input { flex: 1; }
.manual-fields { display: flex; gap: 10px; margin-top: 10px; }
.manual-fields input { flex: 1; }
.add-msg { margin-top: 8px; font-size: 13px; min-height: 18px; }
.add-msg.ok  { color: var(--green); }
.add-msg.err { color: var(--red); }
.add-msg.spin{ color: var(--blue); }

/* ── Inputs ── */
input[type=text], input[type=url], input[type=email], input[type=password], input[type=date], select, textarea {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background .15s, opacity .15s;
}
.btn-primary  { background: var(--blue); color: #fff; }
.btn-primary:hover  { background: var(--blue-d); }
.btn-outline  { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-outline:hover  { background: var(--bg); }
.btn-ghost-danger { background: #fee2e2; color: var(--red); border: none; }
.btn-ghost-danger:hover { background: #fecaca; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ── Green Apply button ── */
.btn-apply {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  background: var(--green);
  color: #fff;
  transition: background .15s;
}
.btn-apply:hover { background: var(--green-d); }

/* ── JD button ── */
.btn-jd {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--blue);
  background: #eff6ff;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s;
}
.btn-jd:hover { background: #dbeafe; }
.btn-jd.disabled {
  border-color: var(--border);
  color: var(--muted);
  background: var(--bg);
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Connections button ── */
.btn-conn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid #0a66c2;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #0a66c2;
  background: #e8f0fe;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s;
}
.btn-conn:hover { background: #c7d9f9; }
.btn-conn.disabled {
  border-color: var(--border);
  color: var(--muted);
  background: var(--bg);
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Table top ── */
.table-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.filters { display: flex; gap: 8px; }
.filters select, .filters input { width: auto; }

/* ── Table ── */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 2px solid var(--bg);
}
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--bg);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }

.co  { font-weight: 600; }
.ttl { color: var(--muted); font-size: 13px; }

/* ── Badges ── */
.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.pill-pending   { background: #fef3c7; color: #92400e; }
.pill-applied   { background: #dbeafe; color: #1e40af; }
.pill-interview { background: #ede9fe; color: #5b21b6; }
.pill-offer     { background: #d1fae5; color: #065f46; }
.pill-rejected  { background: #fee2e2; color: #991b1b; }

.board {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.board-linkedin { background: #0a66c2; }
.board-indeed   { background: #003a9b; }
.board-naukri   { background: #4a90d9; }
.board-other    { background: var(--muted); }

.badge-gmail {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.gmail-on  { background: #d1fae5; color: #065f46; }
.gmail-off { background: #fee2e2; color: #991b1b; }

/* ── Actions cell ── */
.acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ── Deadline alert banner ── */
.deadline-alert {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-left: 4px solid #f59e0b;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 18px;
}
.deadline-alert-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 13px;
  color: #92400e;
  margin-bottom: 10px;
}
.deadline-alert-body { display: flex; flex-wrap: wrap; gap: 8px; }
.dl-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
}
.dl-overdue { background: #fee2e2; color: #991b1b; }
.dl-soon    { background: #fef3c7; color: #92400e; }
.dl-week    { background: #fefce8; color: #713f12; }
.dl-label   { font-style: italic; opacity: .85; }
.dl-dismiss {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  color: #92400e;
  padding: 0 2px;
  opacity: .7;
}
.dl-dismiss:hover { opacity: 1; }

/* ── Deadline cell ── */
.deadline-cell {
  font-size: 12px;
  white-space: nowrap;
  cursor: text;
  min-width: 90px;
}
.deadline-cell:hover { background: #f1f5f9; }
.deadline-cell.editing { padding: 6px 8px; }
.deadline-inline-edit {
  width: 130px;
  font-size: 12px;
  font-family: inherit;
  padding: 3px 6px;
  border: 1.5px solid var(--blue);
  border-radius: 4px;
  color: var(--text);
  background: #fff;
  outline: none;
}

/* ── Notes cell ── */
.notes-cell {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--muted);
  cursor: text;
}
.notes-cell:hover { background: #f1f5f9; }
.notes-cell.editing {
  white-space: normal;
  overflow: visible;
  max-width: 220px;
  padding: 6px 8px;
}
.notes-placeholder { color: #cbd5e1; font-style: italic; }
.notes-inline-edit {
  width: 100%;
  min-width: 160px;
  font-size: 12px;
  font-family: inherit;
  padding: 4px 6px;
  border: 1.5px solid var(--blue);
  border-radius: 4px;
  resize: vertical;
  color: var(--text);
  background: #fff;
  outline: none;
}

/* ── Empty ── */
.empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--muted);
}
.empty svg { margin-bottom: 12px; opacity: .35; }
.empty p { font-size: 15px; }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.modal-box {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
  width: 460px;
  max-width: 92vw;
}
.modal-box h3 { font-size: 17px; font-weight: 700; margin-bottom: 20px; }
.fg { margin-bottom: 14px; }
.fg label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.fg input, .fg select, .fg textarea { width: 100%; }
.modal-actions { display: flex; gap: 10px; margin-top: 22px; }

/* ── Last check ── */
.last-check { text-align: center; font-size: 12px; color: var(--muted); padding: 8px 0; }

/* ── Responsive ── */
@media (max-width: 860px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  header { flex-wrap: wrap; gap: 12px; }
  .table-top { flex-direction: column; align-items: flex-start; gap: 10px; }
}
@media (max-width: 560px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .add-row { flex-direction: column; }
  .find-row { flex-direction: column; }
  .find-row input:last-of-type { max-width: none; }
  .find-item { flex-direction: column; align-items: flex-start; }
}

/* ── Auth pages (login/register) ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  width: 380px;
  max-width: 100%;
}
.auth-card .logo { justify-content: center; margin-bottom: 22px; }
.auth-card h2 { font-size: 18px; font-weight: 700; margin-bottom: 18px; text-align: center; }
.auth-error {
  background: #fee2e2;
  color: var(--red);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}
.auth-footer { text-align: center; font-size: 13px; color: var(--muted); margin-top: 18px; }
.auth-footer a { color: var(--blue-d); font-weight: 600; text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }
.auth-card .btn { width: 100%; justify-content: center; }
.auth-divider {
  text-align: center; font-size: 11px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .05em; margin: 16px 0; position: relative;
}
.auth-divider::before, .auth-divider::after {
  content: ""; position: absolute; top: 50%; width: 40%; height: 1px; background: var(--border);
}
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

/* ── Admin pages ── */
.admin-nav { display: flex; gap: 16px; margin-bottom: 20px; }
.admin-nav a {
  font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none;
  padding: 6px 0; border-bottom: 2px solid transparent;
}
.admin-nav a.active, .admin-nav a:hover { color: var(--blue-d); border-color: var(--blue-d); }
.admin-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .03em;
  color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border);
}
.admin-table td { padding: 10px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
.admin-table code {
  background: var(--bg); padding: 2px 7px; border-radius: 6px; font-family: monospace; font-size: 12px;
}
.admin-inline-form { display: inline; }
.admin-create-row { display: flex; gap: 10px; margin-bottom: 20px; max-width: 460px; }
.admin-section-title { margin: 28px 0 10px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* ── Institution-assigned tracker row ── */
tr.institution-row td { background: #ecfdf5; }
tr.institution-row:hover td { background: #d1fae5; }

/* ── Landing page ── */
.landing-page { min-height: 100vh; }
.landing-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 32px; max-width: 1180px; margin: 0 auto;
}
.landing-hero {
  max-width: 720px; margin: 8vh auto 0; padding: 0 24px; text-align: center;
}
.landing-hero h2 { font-size: 32px; font-weight: 800; margin-bottom: 14px; line-height: 1.25; }
.landing-hero p { font-size: 16px; color: var(--muted); line-height: 1.7; }
.landing-hero .hero-icon { margin: 0 auto 22px; color: var(--blue); }

.nav-menus { display: flex; align-items: center; gap: 10px; position: relative; }
.nav-dropdown { position: relative; }
.nav-dropdown-trigger {
  background: transparent; border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 16px; font-size: 13px; font-weight: 600; color: var(--text);
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.nav-dropdown-trigger:hover { background: var(--bg); }
.nav-dropdown-menu {
  display: none; position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--surface); border-radius: 10px; box-shadow: var(--shadow);
  border: 1px solid var(--border); min-width: 160px; overflow: hidden; z-index: 20;
}
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
  display: block; padding: 11px 16px; font-size: 13px; font-weight: 600;
  color: var(--text); text-decoration: none;
}
.nav-dropdown-menu a:hover { background: var(--bg); }
.nav-dropdown-menu a + a { border-top: 1px solid var(--border); }

/* ── Wide forms (institution/student registration) ── */
.form-card { max-width: 640px; margin: 40px auto; padding: 32px; }
.form-card h2 { font-size: 20px; font-weight: 700; margin-bottom: 6px; text-align: center; }
.form-card .form-sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.amount-preview {
  background: var(--bg); border-radius: 8px; padding: 12px 14px; font-size: 13px;
  color: var(--text); margin-top: -4px; margin-bottom: 16px;
}
.amount-preview strong { font-size: 16px; }
.radio-group { display: flex; gap: 18px; margin-bottom: 4px; }
.radio-group label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; }
.radio-group input { width: auto; }
.sample-csv-link { font-size: 12px; margin-top: 6px; display: inline-block; }

/* ── Payment page ── */
.payment-amount { text-align: center; margin: 10px 0 24px; }
.payment-amount .amt { font-size: 40px; font-weight: 800; }
.payment-amount .purpose { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ── Pending approval page ── */
.pending-icon { color: var(--amber); margin: 0 auto 18px; display: block; }

@media (max-width: 640px) {
  .form-row-2 { grid-template-columns: 1fr; }
  .landing-header { flex-wrap: wrap; gap: 12px; }
}
