/* ============================================================
   Kevaro — Design System
   Design system
   ============================================================ */

/* Self-hosted instead of Google's CDN — loading fonts.googleapis.com
   sends every visitor's IP to Google before they've agreed to anything,
   which several EU data protection authorities have found to be a GDPR
   violation without a legal basis for that transfer. One variable-font
   file covers every weight this portal uses (400-800). */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('assets/fonts/inter.woff2') format('woff2');
}

/* Kevaro's brand typeface — same self-hosting reasoning as Inter above.
   Manrope's own variable font covers the full 200-800 weight range in
   one file, same shape as Inter's. */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('assets/fonts/manrope.woff2') format('woff2');
}

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

:root {
  /* Brand — Kevaro's indigo, from the brand guide (#6366F1) */
  --primary-900: #1e1b4b;
  --primary-800: #312e81;
  --primary-700: #3730a3;
  --primary-600: #4338ca;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --accent: #6366f1;
  --accent-light: #eef2ff;
  --accent-light-hover: #e0e7ff;

  /* Semantic */
  --success: #157a52;
  --success-bg: #eafbf3;
  --success-border: #b9ecd4;
  --warning: #b45a09;
  --warning-bg: #fef3e6;
  --warning-border: #f8d9ae;
  /* Teal — Kevaro's secondary brand colour (#14B8A6), used for the AI
     feature family specifically so it stays visually distinct from the
     indigo primary, same reasoning as when this was called --violet. */
  --teal: #14b8a6;
  --teal-bg: #e6f7f5;
  --danger: #c5303e;
  --danger-bg: #fdedee;
  --danger-border: #f6c4c9;
  --info: #2563a8;
  --info-bg: #eaf3fc;

  /* Neutrals — Kevaro's ink (#0B1020) and light bg (#F1F5F9) */
  --ink: #0b1020;
  --text-dark: #1b1e30;
  --text-mid: #565b78;
  --text-light: #8388a3;
  --text-faint: #aeb2c6;
  --border: #e5e7f2;
  --border-soft: #eef0f8;
  --bg: #f1f5f9;
  --bg-sunk: #e9eef3;
  --white: #ffffff;

  /* Scale */
  --radius-sm: 7px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --shadow-sm: 0 1px 2px rgba(11, 16, 32, 0.05);
  --shadow: 0 2px 10px rgba(11, 16, 32, 0.06);
  --shadow-md: 0 8px 24px rgba(11, 16, 32, 0.08);
  --shadow-lg: 0 20px 48px rgba(11, 16, 32, 0.16);
  --sidebar-w: 248px;
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-dark);
  line-height: 1.5;
  font-size: 14px;
}

.hidden { display: none !important; }
.visible { display: block; }

a { color: var(--accent); }

/* ============================== Buttons ============================== */

button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 18px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13.5px;
  font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 2px rgba(20, 23, 43, 0.08);
}

button:hover { background: var(--primary-hover); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.55; cursor: not-allowed; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-block { width: 100%; }

.btn-secondary {
  background: var(--white); color: var(--text-mid);
  border: 1px solid var(--border); box-shadow: none;
}
.btn-secondary:hover { background: var(--bg-sunk); color: var(--text-dark); border-color: #d3d6e6; }

.btn-small { padding: 6px 13px; font-size: 12px; }

.btn-danger-outline {
  background: var(--white); color: var(--danger);
  border: 1px solid var(--danger-border); box-shadow: none;
}
.btn-danger-outline:hover { background: var(--danger-bg); }

.add-btn { padding: 10px 20px !important; font-size: 13px !important; }

/* ============================== Forms ============================== */

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

label { display: block; margin-bottom: 7px; font-weight: 600; color: var(--text-mid); font-size: 12.5px; }

input[type="email"], input[type="password"], input[type="text"], input[type="tel"],
input[type="url"], input[type="number"], input[type="date"], input[type="time"], input[type="file"],
textarea, select {
  width: 100%; padding: 10px 13px;
  border: 1.5px solid var(--border);
  background: var(--white); border-radius: var(--radius-sm);
  font-size: 13.5px; color: var(--text-dark); font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="file"] { padding: 8px 10px; cursor: pointer; }

/* Every <select> was rendering the browser's own native dropdown arrow —
   a different shape/weight on every OS/browser and the one part of an
   otherwise fully custom-styled form that never matched the rest of the
   design system. One custom chevron, applied everywhere. */
select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238388a3' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 11px;
  padding-right: 34px;
  cursor: pointer;
}
select:disabled { cursor: not-allowed; }

/* Currency fields (job salary, placement fee) are a typeable
   <input list="currencyDatalist">, not a real <select> — same chevron
   cue anyway, so they still read as "pick from a list" rather than a
   stray plain text box next to properly-styled selects/inputs. */
#jf_salaryCurrency, #pm_feeCurrency {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238388a3' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 11px;
  padding-right: 34px;
}

input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3.5px var(--accent-light);
}

input:disabled, textarea:disabled, select:disabled {
  /* background-color, not the background shorthand — select's own rule
     sets a background-image (the custom chevron), which the shorthand
     would silently reset to none on every disabled select otherwise. */
  background-color: var(--bg-sunk); color: var(--text-light); cursor: not-allowed;
}

textarea { resize: vertical; min-height: 84px; }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
small { color: var(--text-light); font-size: 11.5px; display: block; margin-top: 5px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

label:has(input[type="checkbox"]) { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--text-mid); cursor: pointer; }

input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; margin: 0; flex-shrink: 0;
  width: 19px; height: 19px; border: 1.5px solid var(--border); border-radius: 6px;
  background: var(--white); cursor: pointer; position: relative;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
input[type="checkbox"]:hover { border-color: var(--accent); }
input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
input[type="checkbox"]:checked::after {
  content: ''; position: absolute; left: 6px; top: 2px;
  width: 5px; height: 9px; border: solid white; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
input[type="checkbox"]:checked:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.filter-checkbox-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-mid); cursor: pointer;
}
.filter-checkbox-row:hover { background: var(--bg-sunk); }

/* ============================== App shell ============================== */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--primary-900);
  color: #cdd1f0;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}

.sidebar-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 22px 20px 18px;
}

.brand-mark {
  width: 36px; height: 36px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }

.sidebar-brand h1 { font-size: 14.5px; font-weight: 700; color: white; letter-spacing: -0.2px; }
.sidebar-brand .subtitle { font-size: 11px; color: #8b90c0; font-weight: 500; margin-top: 1px; }

.sidebar-nav { flex: 1; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }

.nav-link {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: #b7bbdc; font-size: 13.5px; font-weight: 600;
  background: transparent; border: none; text-align: left; width: 100%;
  cursor: pointer; box-shadow: none; transition: background 0.15s ease, color 0.15s ease;
}
.nav-link:hover { background: rgba(255,255,255,0.06); color: white; }
.nav-link.active { background: rgba(79, 95, 224, 0.28); color: white; }
.nav-link svg { flex-shrink: 0; opacity: 0.9; }
.nav-link .nav-count {
  margin-left: auto; font-size: 11px; font-weight: 700;
  background: rgba(255,255,255,0.1); color: #d7d9f2;
  padding: 1px 8px; border-radius: 20px;
}

.sidebar-footer {
  padding: 14px; border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; flex-direction: column; gap: 8px;
}

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

.user-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), #7d8cf5); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.avatar-editable { cursor: pointer; position: relative; transition: filter 0.15s ease; }
.avatar-editable:hover { filter: brightness(0.85); }

.sidebar-user-info { min-width: 0; flex: 1; }
.sidebar-user-info span#userEmail {
  display: block; font-size: 12.5px; font-weight: 600; color: white;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#userRoleBadge { display: inline-block; margin-top: 2px; }

.sidebar-actions { display: flex; gap: 6px; }

.settings-icon-btn, .logout-btn {
  background: rgba(255,255,255,0.06); color: #cdd1f0;
  border: 1px solid rgba(255,255,255,0.08); box-shadow: none;
  font-weight: 600; font-size: 12.5px;
}
.settings-icon-btn { width: 34px; height: 34px; padding: 0; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.settings-icon-btn:hover, .logout-btn:hover { background: rgba(255,255,255,0.12); color: white; }
.logout-btn { flex: 1; }

.main-area { flex: 1; min-width: 0; }

.container { max-width: 1120px; margin: 0 auto; padding: 40px 36px 60px; }

/* ============================== Page bits ============================== */

.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; gap: 16px; flex-wrap: wrap; }
.section-title { font-size: 23px; color: var(--text-dark); font-weight: 800; letter-spacing: -0.4px; }
.section-subtitle { font-size: 13px; color: var(--text-light); margin-top: 4px; }

.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 30px; }

.stat-card {
  background: var(--white); border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
  padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.stat-card .stat-value { font-size: 27px; font-weight: 800; color: var(--text-dark); letter-spacing: -0.5px; }
.stat-card .stat-label { font-size: 11.5px; color: var(--text-light); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============================== Tables ============================== */

.overview-table {
  width: 100%; background: var(--white); border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg); border-collapse: separate; border-spacing: 0;
  overflow: hidden; margin-top: 10px; box-shadow: var(--shadow-sm);
}

.overview-table th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-light); background: var(--bg-sunk); padding: 12px 18px; border-bottom: 1px solid var(--border-soft);
}

.overview-table td { padding: 14px 18px; font-size: 13.5px; color: var(--text-mid); border-bottom: 1px solid var(--border-soft); }
.overview-table tr:last-child td { border-bottom: none; }
.overview-table tr:hover td { background: var(--bg-sunk); }
.overview-table .adviser-name-cell { font-weight: 700; color: var(--text-dark); }
.overview-table tr.adviser-row-clickable { cursor: pointer; }

.breakdown-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.breakdown-item {
  display: flex; align-items: center; gap: 9px; background: var(--bg-sunk);
  border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 8px 14px;
  cursor: pointer; box-shadow: none; transition: background 0.15s ease, border-color 0.15s ease;
}
.breakdown-item:hover { background: var(--accent-light); border-color: var(--accent); }
.breakdown-count { font-weight: 800; font-size: 14px; color: var(--text-dark); }

/* ===== STATISTICS & PLACEMENTS ===== */
/* Shared by every "filter dropdown(s) above a list/chart" toolbar in the
   app (Statistics, Placements, Calendar) — was previously duplicated ad
   hoc per-select as inline width/margin styles that didn't quite agree
   with each other (160px here, 200px there, one with its own
   margin-bottom instead of the toolbar spacing everyone else got). */
.filter-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.filter-select { width: auto; min-width: 160px; }

.stats-charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; }
.chart-card {
  background: var(--white); border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
  padding: 20px 22px; box-shadow: var(--shadow-sm);
}
.chart-wrap { position: relative; height: 260px; }
.chart-empty-note { color: var(--text-light); font-size: 12.5px; text-align: center; padding: 40px 10px; }

.status-badge.at-risk { background: var(--warning-bg); color: var(--warning); }
.status-badge.complete { background: var(--success-bg); color: var(--success); }
.status-badge.clawback { background: var(--danger-bg); color: var(--danger); }
.status-badge.left-safe { background: var(--bg-sunk); color: var(--text-mid); }

.placement-card-meta-row { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 12.5px; color: var(--text-mid); }
.placement-card-meta-row strong { color: var(--text-dark); }
.placement-fee { font-weight: 800; color: var(--text-dark); }

/* ============================== Cards ============================== */

.card {
  background: var(--white); border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
  padding: 20px 22px; margin-bottom: 12px; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { border-color: #d7d9ec; box-shadow: var(--shadow); }

/* ============================== Marketing page ============================== */

.nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, 0.88); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-soft);
}
.nav-inner {
  max-width: 1100px; margin: 0 auto; padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; color: var(--ink); text-decoration: none; }
.nav-mark {
  width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 14px;
}
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { color: var(--text-mid); text-decoration: none; font-weight: 600; font-size: 13.5px; }
.nav-links a:hover { color: var(--ink); }
.nav-cta { display: flex; align-items: center; gap: 18px; }
.nav-login { font-weight: 600; font-size: 13.5px; color: var(--text-mid); text-decoration: none; }
.nav-login:hover { color: var(--ink); }
.nav-cta button { padding: 9px 18px; font-size: 13px; }

.hero { max-width: 760px; margin: 0 auto; padding: 92px 24px 60px; text-align: center; }
.hero-eyebrow {
  display: inline-block; padding: 6px 14px; border-radius: 100px;
  background: var(--accent-light); color: var(--primary); font-weight: 700;
  font-size: 12px; letter-spacing: 0.3px; margin-bottom: 24px;
}
.hero h1 { font-size: 46px; line-height: 1.14; letter-spacing: -0.7px; color: var(--ink); margin-bottom: 18px; text-wrap: balance; }
.hero h1 .accent-word {
  background: linear-gradient(135deg, var(--primary), var(--teal));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero > p { font-size: 17px; color: var(--text-mid); line-height: 1.6; margin: 0 auto 34px; max-width: 540px; }
.hero-ctas { display: flex; align-items: center; justify-content: center; gap: 14px; }
.hero-ctas button { padding: 13px 26px; font-size: 14.5px; }
.hero-ctas .btn-secondary { padding: 13px 26px; font-size: 14.5px; }

.landing-section { padding: 76px 24px; }
.section-inner { max-width: 1100px; margin: 0 auto; }
.section-head { text-align: center; max-width: 560px; margin: 0 auto 46px; }
.section-eyebrow { color: var(--primary); font-weight: 700; font-size: 12px; letter-spacing: 0.6px; text-transform: uppercase; margin-bottom: 10px; }
.section-head h2 { font-size: 30px; color: var(--ink); margin-bottom: 12px; letter-spacing: -0.4px; text-wrap: balance; }
.section-head p { color: var(--text-mid); font-size: 15px; line-height: 1.6; }

.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card {
  background: var(--white); border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
  padding: 26px 24px;
}
.feature-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--accent-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; margin-bottom: 18px;
}
.feature-card.is-ai .feature-icon { background: var(--teal-bg); color: var(--teal); }
.feature-card h3 { font-size: 15.5px; margin-bottom: 8px; color: var(--ink); }
.feature-card p { font-size: 13.5px; color: var(--text-mid); line-height: 1.65; }

.trust-band {
  background: var(--ink); color: #fff; border-radius: var(--radius-xl);
  padding: 46px 44px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px;
}
.trust-item h4 { font-size: 14.5px; margin-bottom: 7px; display: flex; align-items: center; gap: 8px; }
.trust-item p { font-size: 13px; color: rgba(255, 255, 255, 0.62); line-height: 1.65; }

#pricing { background: var(--bg-sunk); }
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; max-width: 900px; margin: 0 auto; }
.pricing-card { position: relative; padding: 28px 26px; }
.pricing-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff; font-size: 11px; font-weight: 700;
  padding: 4px 13px; border-radius: 100px; letter-spacing: 0.3px; white-space: nowrap;
}
.pricing-price { font-size: 34px; font-weight: 800; color: var(--ink); margin: 10px 0 2px; letter-spacing: -0.5px; }
.pricing-price span { font-size: 13px; font-weight: 600; color: var(--text-light); }

.landing-footer { border-top: 1px solid var(--border-soft); padding: 36px 24px; text-align: center; }
.landing-footer p { font-size: 12.5px; color: var(--text-light); }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .hero h1 { font-size: 32px; }
  .features-grid, .pricing-grid { grid-template-columns: 1fr; }
  .trust-band { grid-template-columns: 1fr; }
}

.card-header { display: flex; justify-content: space-between; align-items: start; cursor: pointer; gap: 14px; }
.card-title-row { display: flex; align-items: center; gap: 12px; }

.chevron {
  width: 22px; height: 22px; flex-shrink: 0; border-radius: 6px; background: var(--bg-sunk);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-light); transition: transform 0.2s ease; font-size: 11px;
}
.chevron.open { transform: rotate(90deg); color: var(--accent); background: var(--accent-light); }

.card-title { font-size: 15.5px; font-weight: 700; color: var(--text-dark); }
.card-meta { font-size: 12.5px; color: var(--text-light); margin-top: 3px; }

.card-body { display: none; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.card-body.open { display: block; }

.card-content { color: var(--text-mid); line-height: 1.7; font-size: 13.5px; }
.card-content p { margin-bottom: 4px; }
.card-content strong { color: var(--text-dark); font-weight: 600; }

.card-notes {
  margin-top: 12px; padding: 12px 14px; background: var(--bg-sunk);
  border-radius: var(--radius); border-left: 3px solid var(--accent);
  font-size: 13px; color: var(--text-mid);
}

.card-linked-jobs { margin-top: 16px; }
.card-linked-jobs h4 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-light); margin-bottom: 9px; font-weight: 700;
}

.comment-item {
  background: var(--bg-sunk); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 10px 12px; margin-bottom: 8px;
}
.comment-meta {
  font-size: 11.5px; color: var(--text-light); margin-bottom: 4px;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.comment-meta strong { color: var(--text-dark); }
.comment-text { font-size: 13px; color: var(--text-mid); white-space: pre-wrap; }

.comment-delete-btn {
  background: none; border: none; color: var(--text-light); cursor: pointer;
  font-size: 11px; padding: 0; text-decoration: underline; box-shadow: none;
}
.comment-delete-btn:hover { color: var(--danger); background: none; }

.comment-input-row { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.comment-input-row textarea {
  width: 100%; padding: 9px 11px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px; font-family: inherit; resize: vertical;
}

.linked-job-pill, .removable-pill, .tag-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-light); color: var(--accent);
  padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;
  margin: 0 6px 6px 0;
}
.removable-pill, .tag-pill { padding: 5px 6px 5px 12px; }

.removable-pill:has(.pill-link) { padding-left: 4px; transition: background 0.15s ease, box-shadow 0.15s ease; }

.pill-link {
  display: inline-flex; align-items: center; gap: 5px;
  color: inherit; text-decoration: none; cursor: pointer;
  padding: 3px 4px 3px 8px; margin: -3px 0; border-radius: 16px;
  transition: background 0.15s ease, color 0.15s ease;
}
.pill-link::after {
  content: '›'; font-weight: 700; font-size: 13px; line-height: 1;
  color: var(--accent); opacity: 0; transform: translateX(-3px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.pill-link:hover {
  background: var(--white); color: var(--primary-hover);
  box-shadow: 0 1px 4px rgba(20, 23, 43, 0.12);
}
.pill-link:hover::after { opacity: 1; transform: translateX(0); }
.pill-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.removable-pill button, .tag-pill button {
  background: none; border: none; color: var(--accent); cursor: pointer;
  padding: 0 4px; font-size: 14px; line-height: 1; box-shadow: none;
  border-radius: 50%; transition: background 0.15s ease, color 0.15s ease;
}
.removable-pill button:hover, .tag-pill button:hover { color: var(--danger); background: rgba(197, 48, 62, 0.1); }

.cv-box {
  margin-top: 16px; display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; background: var(--bg-sunk); border-radius: var(--radius);
  border: 1px solid var(--border-soft);
}
.cv-box a { color: var(--accent); font-weight: 600; font-size: 13px; text-decoration: none; }
.cv-box a:hover { text-decoration: underline; }
.cv-box .cv-icon { font-size: 15px; }

.badge {
  display: inline-block; padding: 4px 12px; border-radius: 20px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px;
}
.badge-open, .badge-new { background: var(--success-bg); color: var(--success); }
.badge-closed, .badge-rejected { background: var(--danger-bg); color: var(--danger); }
.badge-reviewed, .badge-shortlisted { background: var(--warning-bg); color: var(--warning); }
.badge-hired { background: var(--accent-light); color: var(--accent); }

.alert { padding: 13px 17px; margin-bottom: 16px; border-radius: var(--radius); font-size: 13.5px; border-left: 4px solid; }
.alert-success { background: var(--success-bg); border-left-color: var(--success); color: #0d5c3d; }
.alert-error { background: var(--danger-bg); border-left-color: var(--danger); color: #8f2029; }

.temp-credential-box {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 14px; font-weight: 600; color: var(--text-dark);
  background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 10px 14px; user-select: all; word-break: break-all;
}

.empty-state {
  text-align: center; padding: 64px 20px; background: var(--white);
  border: 1.5px dashed var(--border); border-radius: var(--radius-lg); color: var(--text-light);
}
.empty-state .empty-icon { font-size: 30px; margin-bottom: 12px; opacity: 0.6; }
.empty-state p { font-size: 13.5px; }

/* ============================== Modals ============================== */

.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(19, 22, 46, 0.55); backdrop-filter: blur(2px);
  z-index: 1000; align-items: center; justify-content: center; padding: 20px;
  overflow-y: auto;
}
.modal-overlay.active { display: flex; }

.modal-box {
  background: var(--white); border-radius: var(--radius-xl); width: 100%; max-width: 540px;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 26px; border-bottom: 1px solid var(--border-soft);
  position: sticky; top: 0; background: var(--white); z-index: 1;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.modal-header h3 { font-size: 17px; font-weight: 700; color: var(--text-dark); }

.modal-close {
  background: transparent; color: var(--text-light); border: none; box-shadow: none;
  font-size: 19px; cursor: pointer; padding: 4px 9px; line-height: 1; border-radius: var(--radius-sm);
}
.modal-close:hover { color: var(--text-dark); background: var(--bg-sunk); }

.modal-body { padding: 24px 26px; }

.modal-footer {
  padding: 18px 26px; border-top: 1px solid var(--border-soft);
  display: flex; justify-content: flex-end; gap: 10px;
  position: sticky; bottom: 0; background: var(--white);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.tags-input-wrap {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--white);
  min-height: 46px; align-items: center; cursor: text;
}
.tags-input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3.5px var(--accent-light); }
.tags-input-wrap input { border: none; outline: none; flex: 1; min-width: 120px; padding: 4px; font-size: 13px; width: auto; }

/* ============================== Stage pills ============================== */

.stage-pill {
  display: inline-block; padding: 4px 12px; border-radius: 20px;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
}

.status-badge {
  display: inline-block; padding: 4px 12px; border-radius: 20px;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
}
.status-badge.active { background: var(--success-bg); color: var(--success); }
.status-badge.inactive { background: var(--danger-bg); color: var(--danger); }
.status-badge.due-soon { background: var(--warning-bg); color: var(--warning); }
.stage-new { background: var(--info-bg); color: var(--info); }
.stage-contacted { background: var(--warning-bg); color: var(--warning); }
.stage-meeting_booked { background: #fde8d6; color: #b5560f; }
.stage-proposal_sent { background: var(--teal-bg); color: var(--teal); }
.stage-contract_signed { background: var(--success-bg); color: var(--success); }
.stage-active { background: var(--success-bg); color: var(--success); }
.stage-inactive { background: var(--bg-sunk); color: var(--text-light); }
.stage-screening { background: var(--warning-bg); color: var(--warning); }
.stage-submitted { background: #fde8d6; color: #b5560f; }
.stage-interviewing { background: var(--teal-bg); color: var(--teal); }
.stage-offered { background: #dbeafe; color: #1d5ba6; }
.stage-placed { background: var(--success-bg); color: var(--success); }
.stage-rejected { background: var(--danger-bg); color: var(--danger); }

.pipeline-board {
  display: flex; gap: 8px; align-items: flex-start; width: 100%;
}

.pipeline-column {
  flex: 1 1 0; min-width: 0; background: var(--bg-sunk); border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg); display: flex; flex-direction: column;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.pipeline-column.drag-over { background: var(--accent-light); border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }

.pipeline-column-header {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 10px; border-bottom: 1px solid var(--border-soft); flex-shrink: 0;
}
.pipeline-column-header .stage-pill { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pipeline-column-count {
  flex-shrink: 0; font-size: 11px; font-weight: 700; color: var(--text-light);
  background: var(--white); border-radius: 20px; padding: 2px 8px;
}

.pipeline-column-cards {
  flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 60px;
}

.pipeline-card {
  background: var(--white); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 8px 9px; cursor: grab; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center;
  transition: box-shadow 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}
.pipeline-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.pipeline-card:active { cursor: grabbing; }
.pipeline-card.dragging { opacity: 0.4; transform: scale(0.97); }
.pipeline-card-info { min-width: 0; width: 100%; text-align: center; }
.pipeline-card-name, .pipeline-card-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pipeline-card-name { font-size: 12.5px; font-weight: 700; color: var(--text-dark); }
.pipeline-card-meta { font-size: 11px; color: var(--text-light); margin-top: 2px; }
.pipeline-column-empty { font-size: 11.5px; color: var(--text-light); text-align: center; padding: 14px 4px; }

.link-trigger-btn { margin-top: 12px; }

.link-picker-list { margin-top: 14px; max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }

.link-picker-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; text-align: left; padding: 10px 13px;
  background: var(--white); border: 1px solid var(--border-soft); border-radius: var(--radius);
  cursor: pointer; box-shadow: none; transition: background 0.15s ease, border-color 0.15s ease;
}
.link-picker-item:hover { background: var(--accent-light); border-color: var(--accent); }
.link-picker-name { font-size: 13.5px; font-weight: 700; color: var(--text-dark); }
.link-picker-meta { font-size: 12px; color: var(--text-light); }

/* ============================== File upload dropzone ============================== */

.file-drop {
  position: relative; display: flex; align-items: center; justify-content: center;
  min-height: 92px; padding: 16px; cursor: pointer;
  border: 1.5px dashed var(--border); border-radius: var(--radius);
  background: var(--bg-sunk); transition: border-color 0.15s ease, background 0.15s ease;
}
.file-drop:hover { border-color: var(--accent); background: var(--accent-light); }
.file-drop.dragover { border-color: var(--accent); background: var(--accent-light); box-shadow: 0 0 0 3.5px var(--accent-light); }

.file-drop-input {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.file-drop-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-light); text-align: center; }
.file-drop-empty svg { opacity: 0.7; }
.file-drop-text { font-size: 13px; color: var(--text-mid); line-height: 1.5; }
.file-drop-text strong { color: var(--accent); font-weight: 700; }
.file-drop-text span { font-size: 11.5px; color: var(--text-light); }

.file-drop-selected {
  display: flex; align-items: center; gap: 10px; width: 100%;
  color: var(--accent);
}
.file-drop-selected svg { flex-shrink: 0; }
.file-drop-filename {
  flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; color: var(--text-dark);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left;
}
.file-drop-remove {
  flex-shrink: 0; background: none; border: none; color: var(--text-light); cursor: pointer;
  box-shadow: none; width: 26px; height: 26px; border-radius: 50%; padding: 0;
  font-size: 16px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.file-drop-remove:hover { background: var(--danger-bg); color: var(--danger); }

.search-bar-wrap { margin-bottom: 18px; position: relative; }
.search-bar-wrap::before {
  content: ''; position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; pointer-events: none;
  background: var(--text-faint);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4'><circle cx='11' cy='11' r='7'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>") center/contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4'><circle cx='11' cy='11' r='7'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>") center/contain no-repeat;
}
.search-bar-wrap input { width: 100%; max-width: 480px; padding: 11px 16px 11px 38px; font-size: 13.5px; }

.view-toggle {
  display: inline-flex; background: var(--bg-sunk); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 3px; margin-bottom: 18px;
}
.view-toggle-btn {
  background: transparent; color: var(--text-mid); border: none; box-shadow: none;
  padding: 7px 16px; border-radius: 7px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.view-toggle-btn:hover { background: transparent; color: var(--text-dark); }
.view-toggle-btn.active { background: var(--white); color: var(--accent); box-shadow: var(--shadow-sm); }
.view-toggle-btn .nav-count {
  margin-left: 6px; font-size: 11px; font-weight: 700;
  background: var(--accent); color: white;
  padding: 1px 7px; border-radius: 20px;
}

.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.card-tag { background: var(--bg-sunk); color: var(--text-mid); padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; border: 1px solid var(--border-soft); }

.added-by { font-size: 12px; color: var(--text-light); margin-top: 10px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.shared-badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 10.5px; font-weight: 700; background: var(--warning-bg); color: var(--warning);
  margin-left: 8px;
}

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.info-item { background: var(--bg-sunk); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 10px 14px; }
.info-item .info-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-light); margin-bottom: 4px; }
.info-item .info-value { font-size: 13.5px; font-weight: 600; color: var(--text-dark); word-break: break-word; }

.card-footer-actions {
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-soft);
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
}

/* ============================== Auth pages ============================== */

.auth-shell { min-height: 100vh; display: flex; }

.auth-brand-panel {
  flex: 1.1; display: flex; flex-direction: column; justify-content: center;
  padding: 60px 72px; color: white; position: relative; overflow: hidden;
  background: radial-gradient(circle at 15% 15%, var(--primary-700), var(--primary-900) 60%);
}
.auth-brand-panel::after {
  content: ''; position: absolute; inset: 0; opacity: 0.5; pointer-events: none;
  background: radial-gradient(circle at 85% 85%, rgba(125, 140, 245, 0.35), transparent 55%);
}
.auth-brand-panel > * { position: relative; }

.auth-brand-mark {
  width: 56px; height: 56px; margin-bottom: 28px;
  display: flex; align-items: center; justify-content: center;
}
.auth-brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.auth-brand-panel h2 { font-size: 30px; font-weight: 800; letter-spacing: -0.6px; max-width: 420px; line-height: 1.25; }
.auth-brand-panel p.auth-tagline { margin-top: 14px; font-size: 14.5px; color: #b9bee6; max-width: 380px; line-height: 1.6; }

.auth-form-panel { flex: 1; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 40px 24px; }

.login-container { max-width: 380px; width: 100%; }

.login-logo { display: none; width: 44px; height: 44px; margin-bottom: 20px; }
.login-logo img { width: 100%; height: 100%; object-fit: contain; }

.login-container h2 { margin-bottom: 6px; color: var(--text-dark); font-size: 22px; font-weight: 800; letter-spacing: -0.4px; }
.login-subtitle { color: var(--text-light); font-size: 13px; margin-bottom: 28px; }

/* ============================== Messages ============================== */

.messages-shell {
  display: flex; height: 600px; max-height: calc(100vh - 260px); min-height: 420px;
  background: var(--white); border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); overflow: hidden;
}

.messages-list-panel {
  width: 280px; flex-shrink: 0; display: flex; flex-direction: column;
  border-right: 1px solid var(--border-soft); background: var(--bg-sunk); min-height: 0;
}

.messages-list-search { padding: 10px 12px; border-bottom: 1px solid var(--border-soft); flex-shrink: 0; }
.messages-list-search input { width: 100%; padding: 8px 12px; font-size: 12.5px; background: var(--white); }

.messages-list { flex: 1; overflow-y: auto; }

.messages-list-item {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 12px 16px; background: transparent; border: none; box-shadow: none;
  cursor: pointer; border-bottom: 1px solid var(--border-soft);
  border-radius: 0; transition: background 0.15s ease;
}
.messages-list-item:hover { background: var(--white); }
.messages-list-item.active { background: var(--white); box-shadow: inset 3px 0 0 var(--accent); }

.messages-list-item .user-avatar { width: 34px; height: 34px; font-size: 13px; }

.messages-list-item-body { flex: 1; min-width: 0; }
.messages-list-item-name { font-size: 13.5px; font-weight: 700; color: var(--text-dark); display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.messages-list-item-preview {
  font-size: 12px; color: var(--text-light); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.messages-list-item.has-unread .messages-list-item-preview { color: var(--text-dark); font-weight: 600; }

.messages-list-item-time { font-size: 10.5px; color: var(--text-faint); font-weight: 600; flex-shrink: 0; }

.messages-unread-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0;
}

.presence-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); flex-shrink: 0; display: inline-block;
}
.presence-dot.online { background: var(--success); }

.messages-thread { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.messages-thread-header {
  padding: 14px 20px; border-bottom: 1px solid var(--border-soft);
  font-size: 14px; font-weight: 700; color: var(--text-dark);
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.messages-thread-placeholder { color: var(--text-light); font-weight: 500; font-size: 13.5px; }

.messages-log { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }

.message-bubble-row { display: flex; }
.message-bubble-row.own { justify-content: flex-end; }

.message-bubble {
  max-width: 72%; padding: 9px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.5;
  background: var(--bg-sunk); color: var(--text-dark);
}
.message-bubble-row.own .message-bubble { background: var(--primary); color: white; }
.message-bubble p { white-space: pre-wrap; word-break: break-word; }
.message-bubble-time { font-size: 10px; margin-top: 4px; opacity: 0.6; }

.message-bubble-file {
  display: flex; align-items: center; gap: 8px; margin-top: 6px;
  padding: 7px 10px; border-radius: 9px; background: rgba(255,255,255,0.15);
  cursor: pointer; text-decoration: none; color: inherit; font-size: 12.5px; font-weight: 600;
}
.message-bubble-row:not(.own) .message-bubble-file { background: var(--white); border: 1px solid var(--border-soft); }
.message-bubble-file:hover { text-decoration: underline; }

.message-mention {
  color: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  background: rgba(255,255,255,0.22); padding: 1px 6px; border-radius: 6px; white-space: nowrap;
}
.message-bubble-row:not(.own) .message-mention { background: var(--accent-light); color: var(--accent); }
.message-mention:hover { text-decoration: underline; }

.messages-composer { border-top: 1px solid var(--border-soft); padding: 12px 16px; flex-shrink: 0; }

#messagesMentionDropdown {
  position: absolute; bottom: 100%; left: 16px; right: 16px; margin-bottom: 6px;
  background: var(--white); border: 1px solid var(--border-soft); border-radius: var(--radius);
  box-shadow: var(--shadow-md); max-height: 220px; overflow-y: auto; padding: 4px; z-index: 20;
}
.mention-dropdown-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  width: 100%; text-align: left; padding: 7px 10px; border-radius: 7px;
  background: none; border: none; box-shadow: none; font-size: 13px; cursor: pointer;
  color: var(--text-dark); font-weight: 600;
}
.mention-dropdown-item:hover, .mention-dropdown-item.active { background: var(--bg-sunk); }
.mention-dropdown-meta { font-size: 11.5px; color: var(--text-light); font-weight: 400; }

.messages-attachment-chip {
  display: inline-flex; align-items: center; gap: 7px; margin-bottom: 8px;
  padding: 5px 6px 5px 10px; background: var(--accent-light); color: var(--accent);
  border-radius: 20px; font-size: 12px; font-weight: 600;
}
.messages-attachment-chip button {
  background: none; border: none; color: var(--accent); cursor: pointer; box-shadow: none;
  padding: 0 4px; font-size: 14px; line-height: 1; border-radius: 50%;
}
.messages-attachment-chip button:hover { color: var(--danger); background: rgba(197, 48, 62, 0.1); }

.messages-composer-row { display: flex; align-items: flex-end; gap: 8px; }

.messages-attach-btn {
  flex-shrink: 0; width: 38px; height: 38px; padding: 0; display: flex; align-items: center; justify-content: center;
  background: var(--bg-sunk); color: var(--text-mid); border: 1px solid var(--border); box-shadow: none;
}
.messages-attach-btn:hover { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }

.messages-composer-input { flex: 1; min-height: 38px; max-height: 120px; padding: 9px 13px; resize: none; }

/* ============================== Message toast ============================== */

.message-toast {
  position: fixed; bottom: 22px; right: 22px; width: 320px; z-index: 1100;
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-soft); overflow: hidden;
  animation: toast-in 0.25s ease;
}
@keyframes toast-in { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.message-toast-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 14px 14px 10px; }
.message-toast-sender { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.message-toast-sender-text { min-width: 0; }
.message-toast-name { font-size: 13.5px; font-weight: 700; color: var(--text-dark); }
.message-toast-preview {
  font-size: 12.5px; color: var(--text-mid); margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.message-toast-header .modal-close { flex-shrink: 0; font-size: 16px; padding: 2px 6px; }

.message-toast-reply-row { display: flex; gap: 6px; padding: 0 14px 12px; }
.message-toast-reply-row input { flex: 1; padding: 8px 11px; font-size: 12.5px; }
.message-toast-reply-row button { flex-shrink: 0; padding: 8px 14px; font-size: 12.5px; }

.message-toast-view-btn {
  display: block; width: 100%; background: var(--bg-sunk); color: var(--text-mid);
  border: none; border-top: 1px solid var(--border-soft); box-shadow: none;
  padding: 9px; font-size: 12px; font-weight: 600; border-radius: 0; text-align: center;
}
.message-toast-view-btn:hover { background: var(--accent-light); color: var(--accent); }

/* ============================== Calendar ============================== */

.calendar-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.calendar-nav { display: flex; align-items: center; gap: 10px; }
.calendar-nav-btn { width: 34px; height: 34px; padding: 0; display: flex; align-items: center; justify-content: center; font-size: 17px; }
.calendar-month-label { font-size: 15.5px; font-weight: 700; color: var(--text-dark); min-width: 150px; text-align: center; }

.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  background: var(--white); border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-sm);
}

.calendar-day-header {
  padding: 10px; text-align: center; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-light); background: var(--bg-sunk); border-bottom: 1px solid var(--border-soft);
}

.calendar-cell {
  min-height: 108px; padding: 8px; border-right: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft);
  cursor: pointer; transition: background 0.15s ease; display: flex; flex-direction: column; gap: 5px;
}
.calendar-cell:hover { background: var(--bg-sunk); }
.calendar-cell:nth-child(7n) { border-right: none; }
.calendar-cell.outside { background: var(--bg-sunk); }
.calendar-cell.outside .calendar-cell-date { color: var(--text-faint); }
.calendar-cell.today .calendar-cell-date {
  background: var(--primary); color: white; width: 21px; height: 21px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.calendar-cell-date { font-size: 12px; font-weight: 700; color: var(--text-dark); }
.calendar-cell-events { display: flex; flex-direction: column; gap: 3px; overflow: hidden; }

.calendar-event-chip {
  font-size: 10.5px; font-weight: 600; padding: 2px 6px; border-radius: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.calendar-more { font-size: 10px; color: var(--text-light); font-weight: 700; padding-left: 6px; }

/* Week view — same 7-column grid, taller cells, no "+N more" truncation */
.calendar-week-cell { min-height: 340px; align-items: stretch; gap: 4px; }
.calendar-week-cell .calendar-event-chip { padding: 5px 7px; font-size: 11px; }
.calendar-day-header-date { display: block; font-size: 15px; font-weight: 800; color: var(--text-dark); margin-top: 2px; }
.calendar-empty-hint { color: var(--text-faint); font-size: 11px; text-align: center; margin-top: 24px; }

/* Day view — single-column agenda list */
.calendar-grid.calendar-view-day { display: block; background: transparent; border: none; box-shadow: none; }
.calendar-day-agenda { display: flex; flex-direction: column; gap: 10px; }
.calendar-agenda-item {
  display: flex; gap: 18px; align-items: flex-start; padding: 14px 18px;
  border-radius: var(--radius-lg); border-left: 4px solid; background: var(--bg-sunk);
  cursor: pointer; transition: background 0.15s ease; box-shadow: var(--shadow-sm);
}
.calendar-agenda-item:hover { filter: brightness(0.98); }
.calendar-agenda-time { font-weight: 700; font-size: 13px; color: var(--text-dark); min-width: 110px; flex-shrink: 0; }
.calendar-agenda-body { flex: 1; min-width: 0; }
.calendar-agenda-title { font-size: 14.5px; font-weight: 700; color: var(--text-dark); }
.calendar-agenda-meta { font-size: 12px; color: var(--text-light); margin-top: 5px; }
.calendar-agenda-meta .badge { vertical-align: middle; }

.event-type-call { background: var(--info-bg); color: var(--info); border-left-color: var(--info); }
.event-type-meeting { background: var(--teal-bg); color: var(--teal); border-left-color: var(--teal); }
.event-type-interview { background: var(--warning-bg); color: var(--warning); border-left-color: var(--warning); }
.event-type-other { background: var(--bg-sunk); color: var(--text-mid); border-left-color: var(--text-light); }

.calendar-candidate-event {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 8px 12px; margin-bottom: 6px; border-radius: var(--radius); border-left: 3px solid;
  font-size: 12.5px; cursor: pointer; background: var(--bg-sunk); transition: background 0.15s ease;
}
.calendar-candidate-event:hover { filter: brightness(0.97); }
.calendar-candidate-event-date { font-weight: 700; color: var(--text-dark); flex-shrink: 0; }
.calendar-candidate-event-title {
  color: var(--text-mid); flex: 1; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; text-align: right;
}

/* ============================== Responsive ============================== */

@media (max-width: 980px) {
  .auth-brand-panel { display: none; }
  .login-logo { display: block; }
}

@media (max-width: 768px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; padding: 0; }
  .sidebar-brand { padding: 14px 16px; }
  .sidebar-nav {
    flex-direction: row; overflow-x: auto; padding: 8px 12px;
    border-top: 1px solid rgba(255,255,255,0.08); border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .nav-link { flex-shrink: 0; }
  .sidebar-footer { flex-direction: row; align-items: center; border-top: none; }
  .sidebar-user-info { display: block; }
  .container { padding: 22px 16px; }
  .card { padding: 17px; }
  .page-header { flex-direction: column; align-items: start; gap: 12px; }
  .form-row { grid-template-columns: 1fr; }
  .auth-form-panel { padding: 24px 16px; }
  .messages-shell { flex-direction: column; height: auto; max-height: none; }
  .messages-list-panel { width: 100%; max-height: 220px; border-right: none; border-bottom: 1px solid var(--border-soft); }
  .messages-thread { min-height: 440px; }
  .message-toast { left: 16px; right: 16px; width: auto; bottom: 16px; }
  .calendar-cell { min-height: 70px; padding: 5px; gap: 3px; }
  .calendar-day-header { font-size: 9px; padding: 6px 2px; }
  .calendar-event-chip { font-size: 9px; padding: 1px 4px; }
  .calendar-month-label { min-width: 0; font-size: 14px; }
}
