/* =============================================
   KIT JOB PORTAL — DESIGN SYSTEM
   Refined Academic/Institutional Aesthetic
   ============================================= */

:root {
  --navy: #0a1628;
  --navy-mid: #162040;
  --navy-light: #1e2d52;
  --gold: #c9952a;
  --gold-light: #e8b84b;
  --gold-pale: #fdf6e7;
  --slate: #64748b;
  --slate-light: #94a3b8;
  --surface: #f8fafc;
  --surface-card: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --green: #16a34a;
  --green-bg: #dcfce7;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --amber: #d97706;
  --amber-bg: #fef3c7;
  --blue: #2563eb;
  --blue-bg: #dbeafe;
  --purple: #7c3aed;
  --purple-bg: #ede9fe;

  --sidebar-w: 256px;
  --topbar-h: 64px;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow: 0 4px 16px rgba(0,0,0,.1);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.14);
  --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body { font-family: 'DM Sans', sans-serif; font-size: 16px; color: var(--text-primary); background: var(--surface); line-height: 1.6; overflow-x: hidden; }

h1,h2,h3,h4 { font-family: 'Playfair Display', serif; font-weight: 700; line-height: 1.3; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }

a { color: var(--navy); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold); }

/* ---- AUTH LAYOUT ---- */
.auth-body { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 60%, #2a3a6a 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.auth-body::before { content: ''; position: fixed; inset: 0; background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9952a' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); pointer-events: none; }

.auth-card { background: #fff; border-radius: var(--radius-lg); padding: 48px 40px; width: 100%; max-width: 440px; box-shadow: var(--shadow-lg); position: relative; }
.auth-header { text-align: center; margin-bottom: 32px; }
.auth-logo { display: inline-flex; align-items: center; justify-content: center; width: 80px; height: 80px; background: transparent; border-radius: var(--radius); margin-bottom: 16px; }
.auth-title { font-size: 1.8rem; color: var(--navy); margin-bottom: 6px; }
.auth-sub { color: var(--text-secondary); font-size: 15px; }

/* ---- APP LAYOUT ---- */
.app-body { background: var(--surface); }
.app-wrapper { display: flex; min-height: 100vh; }
.app-content { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; min-width: 0; max-width: 100%; }
.main-content { flex: 1; padding: 28px 32px; max-width: 1280px; width: 100%; box-sizing: border-box; }

/* ---- SIDEBAR ---- */
.sidebar { position: fixed; top: 0; left: 0; width: var(--sidebar-w); height: 100vh; background: var(--navy); display: flex; flex-direction: column; overflow-y: auto; z-index: 100; transition: transform var(--transition); }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-logo { width: 40px; height: 40px; background: var(--gold); color: var(--navy); display: flex; align-items: center; justify-content: center; font-family: 'Playfair Display', serif; font-weight: 700; font-size: 14px; border-radius: var(--radius-sm); flex-shrink: 0; }
.brand-name { font-weight: 600; font-size: 15px; color: #fff; }
.brand-sub { font-size: 12px; color: var(--slate-light); }

.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,.06); }
.user-avatar { width: 36px; height: 36px; background: var(--navy-light); border: 2px solid var(--gold); color: var(--gold); display: flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 700; font-size: 14px; flex-shrink: 0; text-transform: uppercase; }
.user-name { font-size: 14px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.user-role { font-size: 11px; font-weight: 500; padding: 2px 7px; border-radius: 20px; text-transform: uppercase; letter-spacing: .5px; display: inline-block; margin-top: 2px; }
.badge-role-applicant { background: rgba(37,99,235,.25); color: #93c5fd; }
.badge-role-hr_admin { background: rgba(201,149,42,.25); color: #fcd34d; }
.badge-role-expert { background: rgba(124,58,237,.25); color: #c4b5fd; }
.badge-role-board { background: rgba(22,163,74,.25); color: #86efac; }
.badge-role-superadmin { background: rgba(220,38,38,.25); color: #fca5a5; }

.sidebar-nav { flex: 1; padding: 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 11px 14px; color: rgba(255,255,255,.65); border-radius: var(--radius-sm); transition: all var(--transition); font-size: 15px; font-weight: 500; cursor: pointer; }
.nav-item:hover, .nav-item.active { background: rgba(201,149,42,.15); color: var(--gold-light); }
.nav-item svg { flex-shrink: 0; opacity: .85; }
.nav-logout { color: rgba(255,100,100,.7) !important; }
.nav-logout:hover { background: rgba(220,38,38,.15) !important; color: #fca5a5 !important; }
.sidebar-footer { padding: 12px; border-top: 1px solid rgba(255,255,255,.06); }

/* ---- TOPBAR ---- */
.topbar { position: sticky; top: 0; z-index: 50; height: var(--topbar-h); background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 32px; gap: 16px; box-shadow: var(--shadow-sm); }
.sidebar-toggle { background: none; border: none; cursor: pointer; color: var(--slate); display: none; padding: 6px; border-radius: var(--radius-sm); transition: background var(--transition); }
.sidebar-toggle:hover { background: var(--surface); color: var(--navy); }
.topbar-title { font-size: 15px; font-weight: 600; color: var(--navy); flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-user { font-size: 15px; font-weight: 500; color: var(--text-secondary); }

/* ---- CARDS ---- */
.card { background: var(--surface-card); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.card-header { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 1.1rem; font-family: 'Playfair Display', serif; font-weight: 700; color: var(--navy); }
.card-body { padding: 22px; }
.card-footer { padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface); }

/* ---- STAT CARDS ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 28px; }
.stat-card { background: #fff; border-radius: var(--radius); border: 1px solid var(--border); padding: 22px; position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.stat-card.navy::before { background: var(--navy); }
.stat-card.gold::before { background: var(--gold); }
.stat-card.green::before { background: var(--green); }
.stat-card.blue::before { background: var(--blue); }
.stat-card.purple::before { background: var(--purple); }
.stat-value { font-size: 2.2rem; font-family: 'Playfair Display', serif; font-weight: 700; color: var(--navy); line-height: 1; }
.stat-label { font-size: 13px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; margin-top: 4px; }
.stat-icon { position: absolute; right: 18px; top: 18px; opacity: .1; font-size: 40px; }

/* ---- TABLES ---- */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--navy); }
thead th { padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; color: rgba(255,255,255,.75); white-space: nowrap; }
tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }
tbody td { padding: 14px 16px; font-size: 15px; color: var(--text-secondary); vertical-align: middle; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 7px; }
input, select, textarea { width: 100%; padding: 11px 14px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 16px; font-family: 'DM Sans', sans-serif; color: var(--text-primary); background: #fff; transition: border-color var(--transition), box-shadow var(--transition); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(10,22,40,.08); }
textarea { resize: vertical; min-height: 100px; }
input[type="file"] { padding: 8px 12px; background: var(--surface); border-style: dashed; }
input[type="range"] { padding: 0; height: 6px; accent-color: var(--navy); }

/* ---- BUTTONS ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 11px 22px; border-radius: var(--radius-sm); font-size: 15px; font-weight: 600; font-family: 'DM Sans', sans-serif; cursor: pointer; border: none; transition: all var(--transition); text-decoration: none; white-space: nowrap; line-height: 1; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-light); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(10,22,40,.25); }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: var(--gold-light); color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #15803d; color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-warning { background: var(--amber); color: #fff; }
.btn-warning:hover { background: #b45309; color: #fff; }
.btn-outline { background: transparent; border: 1.5px solid var(--border-strong); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--navy); color: var(--navy); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-xs { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 8px; }
.btn-primary-sm { background: var(--navy); color: #fff; padding: 8px 18px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; }
.btn-outline-sm { background: transparent; border: 1.5px solid rgba(255,255,255,.5); color: rgba(255,255,255,.85); padding: 7px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; }
.btn-ghost-sm { background: transparent; color: var(--text-secondary); padding: 7px 14px; border-radius: var(--radius-sm); font-size: 13px; }
.btn-ghost-sm:hover { background: var(--surface); color: var(--text-primary); }

/* ---- BADGES ---- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.badge-pending { background: var(--amber-bg); color: var(--amber); }
.badge-shortlisted { background: var(--blue-bg); color: var(--blue); }
.badge-expert { background: var(--purple-bg); color: var(--purple); }
.badge-board { background: #fce7f3; color: #db2777; }
.badge-selected { background: var(--green-bg); color: var(--green); }
.badge-rejected { background: var(--red-bg); color: var(--red); }
.badge-hold { background: var(--amber-bg); color: #92400e; }
.badge-active { background: var(--green-bg); color: var(--green); }
.badge-closed { background: var(--red-bg); color: var(--red); }
.badge-draft { background: var(--surface); color: var(--slate); border: 1px solid var(--border); }

/* ---- ALERTS ---- */
.alert { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 15px; font-weight: 500; display: flex; align-items: center; gap: 10px; }
.alert-success { background: var(--green-bg); color: #15803d; border-left: 4px solid var(--green); }
.alert-error { background: var(--red-bg); color: #b91c1c; border-left: 4px solid var(--red); }
.alert-info { background: var(--blue-bg); color: var(--blue); border-left: 4px solid var(--blue); }

/* ---- PAGE HEADER ---- */
.page-header { margin-bottom: 28px; }
.page-header-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.page-title { font-size: 1.8rem; color: var(--navy); }
.page-subtitle { color: var(--text-muted); font-size: 15px; margin-top: 4px; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.breadcrumb a { color: var(--gold); }

/* ---- JOB CARDS ---- */
.jobs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.job-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; transition: all var(--transition); position: relative; overflow: hidden; }
.job-card::before { content: ''; position: absolute; top: 0; left: 0; bottom: 0; width: 3px; background: var(--gold); opacity: 0; transition: opacity var(--transition); }
.job-card:hover { border-color: var(--gold); box-shadow: var(--shadow); transform: translateY(-2px); }
.job-card:hover::before { opacity: 1; }
.job-card-title { font-family: 'Playfair Display', serif; font-size: 1.05rem; color: var(--navy); margin-bottom: 6px; }
.job-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.job-meta-item { display: flex; align-items: center; gap: 4px; font-size: 14px; color: var(--text-muted); }
.job-deadline { font-size: 14px; color: var(--amber); font-weight: 600; }
.job-dept { font-size: 14px; color: var(--blue); font-weight: 500; background: var(--blue-bg); padding: 3px 9px; border-radius: 20px; }

/* ---- SCORE WIDGET ---- */
.score-ring { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.score-ring svg { transform: rotate(-90deg); }
.score-value { position: absolute; font-family: 'Playfair Display', serif; font-size: 1.4rem; font-weight: 700; }
.score-bar { background: var(--border); border-radius: 4px; height: 8px; overflow: hidden; }
.score-bar-fill { height: 100%; border-radius: 4px; transition: width 0.8s ease; }

/* ---- PIPELINE STAGES ---- */
.pipeline { display: flex; align-items: center; gap: 0; margin: 20px 0; overflow-x: auto; padding-bottom: 4px; }
.pipe-stage { display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 100px; position: relative; }
.pipe-stage::after { content: ''; position: absolute; right: 0; top: 16px; width: 100%; height: 2px; background: var(--border); z-index: 0; }
.pipe-stage:last-child::after { display: none; }
.pipe-dot { width: 32px; height: 32px; border-radius: 50%; background: var(--border); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; position: relative; z-index: 1; border: 3px solid #fff; }
.pipe-dot.done { background: var(--green); color: #fff; }
.pipe-dot.active { background: var(--gold); color: #fff; box-shadow: 0 0 0 4px rgba(201,149,42,.2); }
.pipe-dot.pending { background: #fff; border-color: var(--border-strong); color: var(--text-muted); }
.pipe-label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-align: center; margin-top: 6px; text-transform: uppercase; letter-spacing: .4px; }

/* ---- FILTER BAR ---- */
.filter-bar { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 20px; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; }
.filter-group { display: flex; flex-direction: column; gap: 5px; }
.filter-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }
.filter-input { padding: 8px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; min-width: 160px; outline: none; }
.filter-input:focus { border-color: var(--navy); }

/* ---- PUBLIC HOME ---- */
.pub-nav { background: var(--navy); position: sticky; top: 0; z-index: 100; }
.pub-nav-inner { max-width: 1200px; margin: auto; padding: 0 32px; height: 70px; display: flex; align-items: center; justify-content: space-between; }
.nav-brand { display: flex; align-items: center; gap: 12px; }
.nav-logo { background: var(--gold); color: var(--navy); font-family: 'Playfair Display', serif; font-weight: 700; font-size: 16px; padding: 6px 10px; border-radius: 6px; }
.nav-title { font-size: 14px; font-weight: 600; color: #fff; }
.nav-sub { font-size: 11px; color: rgba(255,255,255,.5); }
.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-link { color: rgba(255,255,255,.7); font-size: 13px; font-weight: 500; }
.nav-link:hover { color: var(--gold-light); }

.hero { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%); padding: 40px 32px; text-align: center; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, transparent, transparent 40px, rgba(201,149,42,.03) 40px, rgba(201,149,42,.03) 80px); }
.hero-badge { display: inline-block; background: rgba(201,149,42,.15); color: var(--gold-light); border: 1px solid rgba(201,149,42,.3); padding: 6px 16px; border-radius: 20px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
.hero h1 { font-size: 2.2rem; color: #fff; max-width: 700px; margin: 0 auto 12px; line-height: 1.2; }
.hero h1 span { color: var(--gold-light); }
.hero-sub { color: rgba(255,255,255,.65); font-size: 14px; max-width: 520px; margin: 0 auto 20px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; }
.hero-stats { display: flex; gap: 40px; justify-content: center; margin-top: 24px; }
.hero-stat { text-align: center; }
.hero-stat-num { font-family: 'Playfair Display', serif; font-size: 2rem; font-weight: 700; color: var(--gold-light); }
.hero-stat-label { font-size: 12px; color: rgba(255,255,255,.5); margin-top: 2px; }

.section { padding: 60px 32px; }
.section-inner { max-width: 1200px; margin: auto; }
.section-header { margin-bottom: 36px; }
.section-title { font-size: 1.8rem; color: var(--navy); margin-bottom: 8px; }
.section-sub { color: var(--text-muted); font-size: 14px; }

.pub-footer { background: var(--navy); padding: 28px 32px; margin-top: auto; }
.footer-inner { max-width: 1200px; margin: auto; display: flex; align-items: center; justify-content: space-between; }
.footer-brand { font-family: 'Playfair Display', serif; font-weight: 700; color: var(--gold); font-size: 1.1rem; }
.footer-text { color: rgba(255,255,255,.4); font-size: 12px; }

/* ---- APPLICATION DETAIL ---- */
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
.detail-section { margin-bottom: 24px; }
.detail-section-title { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid var(--gold); display: inline-block; }
.detail-row { display: flex; gap: 8px; margin-bottom: 12px; }
.detail-label { font-size: 12px; font-weight: 600; color: var(--text-muted); min-width: 140px; text-transform: uppercase; letter-spacing: .4px; }
.detail-value { font-size: 13px; color: var(--text-primary); flex: 1; }

/* ---- SCORING ---- */
.score-criterion { margin-bottom: 20px; }
.score-crit-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.score-crit-label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.score-crit-val { font-size: 20px; font-family: 'Playfair Display', serif; font-weight: 700; color: var(--navy); min-width: 44px; text-align: right; }
.score-slider { width: 100%; height: 6px; appearance: none; background: linear-gradient(to right, var(--navy) var(--val, 0%), var(--border) var(--val, 0%)); border-radius: 3px; cursor: pointer; outline: none; }
.score-slider::-webkit-slider-thumb { appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--navy); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); cursor: pointer; }
.overall-score-display { text-align: center; padding: 24px; background: var(--navy); border-radius: var(--radius); color: #fff; }
.overall-num { font-family: 'Playfair Display', serif; font-size: 3rem; font-weight: 700; color: var(--gold-light); }
.overall-label { font-size: 12px; color: rgba(255,255,255,.6); text-transform: uppercase; letter-spacing: 1px; }

/* ---- UTIL ---- */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-muted { color: var(--text-muted); font-size: 12px; }
.text-sm { font-size: 12px; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.empty-state { text-align: center; padding: 48px; color: var(--text-muted); }
.empty-state-icon { font-size: 48px; opacity: .3; margin-bottom: 12px; }
.empty-state h3 { font-size: 1rem; color: var(--text-secondary); margin-bottom: 6px; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; font-size: 12px; color: var(--text-secondary); }
.section-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.tag-position { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.tag-Professor { background: #1e2d52; color: #c9952a; }
.tag-Associate { background: #162040; color: #e8b84b; }
.tag-Assistant { background: #1a2a3a; color: #93c5fd; }
.tag-Lecturer { background: #1a2a1a; color: #86efac; }
.tag-Support { background: #2a1a2a; color: #d8b4fe; }

/* =============================================
   RESPONSIVE — TABLET (≤ 1024px)
   ============================================= */
@media (max-width: 1024px) {
  .main-content { padding: 20px 20px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .jobs-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .detail-grid { grid-template-columns: 1fr; }
  .pub-nav-inner { padding: 0 20px; }
  .section { padding: 40px 20px; }
}

/* =============================================
   RESPONSIVE — SMALL TABLET / LARGE PHONE (≤ 900px)
   ============================================= */
@media (max-width: 900px) {
  /* Sidebar — slide off screen */
  .app-content { margin-left: 0 !important; width: 100% !important; max-width: 100vw !important; overflow-x: hidden; }
  .sidebar { transform: translateX(-100%); box-shadow: none; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-toggle { display: flex; }

  /* Topbar */
  .topbar { padding: 0 16px; }
  .topbar-title { font-size: 12px; }

  /* Main content */
  .main-content { padding: 16px; width: 100%; max-width: 100%; box-sizing: border-box; overflow-x: hidden; }

  /* Page header */
  .page-header-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-header-inner .btn, .page-header-inner .section-actions { align-self: flex-start; }

  /* Grids */
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .jobs-grid { grid-template-columns: 1fr; }

  /* Filter bar */
  .filter-bar { flex-direction: column; }
  .filter-group { width: 100%; }
  .filter-input { min-width: 100%; width: 100%; }

  /* Auth */
  .auth-card { padding: 32px 20px; margin: 16px; max-width: 100%; }

  /* Public nav */
  .pub-nav-inner { padding: 0 16px; height: 60px; }
  .nav-title { font-size: 12px; }
  .nav-sub { display: none; }
  .nav-links { gap: 10px; }
  .nav-link { display: none; }

  /* Hero */
  .hero { padding: 36px 16px; }
  .hero h1 { font-size: 1.7rem; }
  .hero-sub { font-size: 13px; margin-bottom: 16px; }
  .hero-stats { gap: 20px; flex-wrap: wrap; justify-content: center; }
  .hero-stat-num { font-size: 1.5rem; }

  /* Section */
  .section { padding: 32px 16px; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 12px; }

  /* CV viewer */
  .cv-embed-wrap { height: 500px; }
  .cv-panel-header { flex-wrap: wrap; gap: 8px; }
  .cv-panel-title { font-size: 12px; }

  /* Pipeline */
  .pipeline { gap: 0; }
  .pipe-label { font-size: 9px; }

  /* Scoring */
  .overall-score-display { padding: 16px; }
  .overall-num { font-size: 2.2rem; }

  /* Score form grid */
  [style*="grid-template-columns:1fr 1.3fr"],
  [style*="grid-template-columns: 1fr 1.3fr"] { grid-template-columns: 1fr !important; }
  [style*="grid-template-columns:2fr 1fr"],
  [style*="grid-template-columns: 2fr 1fr"] { grid-template-columns: 1fr !important; }
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; }
  [style*="grid-template-columns:2fr 1.3fr"],
  [style*="grid-template-columns: 2fr 1.3fr"] { grid-template-columns: 1fr !important; }

  /* Topbar title hide */
  .topbar-title { display: none; }

  /* Footer */
  .footer-inner { flex-direction: column; gap: 8px; text-align: center; }
}

/* =============================================
   RESPONSIVE — MOBILE (≤ 480px)
   ============================================= */
@media (max-width: 480px) {
  /* Layout */
  .main-content { padding: 12px; width: 100%; max-width: 100vw; box-sizing: border-box; overflow-x: hidden; }

  /* Typography */
  h1, .page-title { font-size: 1.3rem !important; }
  h2, .section-title { font-size: 1.2rem; }
  .auth-title { font-size: 1.3rem; }

  /* Stats */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 1.8rem; }
  .stat-label { font-size: 10px; }

  /* Buttons */
  .btn { padding: 9px 14px; font-size: 12px; }
  .btn-sm { padding: 6px 10px; font-size: 11px; }

  /* Cards */
  .card-body { padding: 14px; }
  .card-header { padding: 12px 14px; }
  .card-footer { padding: 10px 14px; }

  /* Auth card */
  .auth-card { padding: 24px 16px; margin: 12px; border-radius: 12px; }
  .auth-logo img { width: 52px; height: 52px; }

  /* Hero */
  .hero { padding: 28px 12px; }
  .hero h1 { font-size: 1.4rem; }
  .hero-badge { font-size: 10px; padding: 4px 10px; }
  .hero-stats { gap: 16px; }
  .hero-stat-num { font-size: 1.3rem; }
  .hero-stat-label { font-size: 10px; }

  /* Nav */
  .pub-nav-inner { padding: 0 12px; }
  .nav-brand { gap: 8px; }
  .nav-logo-img { width: 36px; height: 36px; }
  .nav-title { font-size: 11px; }
  .btn-primary-sm, .btn-outline-sm { padding: 6px 10px; font-size: 11px; }

  /* Topbar */
  .topbar { padding: 0 12px; height: 54px; }
  .topbar-user { display: none; }

  /* Sidebar brand */
  .brand-name { font-size: 11px; }
  .brand-sub { display: none; }
  .sidebar-brand { padding: 14px 14px 12px; gap: 8px; }

  /* Tables — tighter */
  table { min-width: 480px; }
  thead th { padding: 10px 10px; font-size: 10px; }
  tbody td { padding: 10px 10px; font-size: 12px; }

  /* Job cards */
  .job-card { padding: 14px; }
  .job-card-title { font-size: 0.95rem; }

  /* Detail rows */
  .detail-row { flex-direction: column; gap: 2px; }
  .detail-label { min-width: unset; }

  /* Breadcrumb */
  .breadcrumb { font-size: 11px; flex-wrap: wrap; }

  /* Pipeline — very compact */
  .pipe-dot { width: 24px; height: 24px; font-size: 9px; }
  .pipe-label { font-size: 8px; }
  .pipe-stage { min-width: 60px; }

  /* Score form */
  .score-crit-label { font-size: 12px; }
  .score-crit-val { font-size: 16px; }
  .overall-num { font-size: 1.8rem; }

  /* CV panel */
  .cv-embed-wrap { height: 400px; }
  .cv-panel-header { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }

  /* Empty state */
  .empty-state { padding: 28px 16px; }
  .empty-state-icon { font-size: 36px; }

  /* Section actions */
  .section-actions { flex-direction: column; }
  .section-actions .btn { width: 100%; justify-content: center; }

  /* Interview form two-column → one */
  [style*="grid-template-columns:2fr 1fr"] { display: block !important; }
  [style*="grid-template-columns:1fr 1fr"] { display: block !important; }
  [style*="grid-template-columns:1fr 1.3fr"] { display: block !important; }
  [style*="display:grid"][style*="grid-template-columns"] { display: block !important; }

  /* Scoring weight table */
  .score-criterion { margin-bottom: 16px; }

  /* Alert */
  .alert { font-size: 13px; padding: 10px 12px; }

  /* Filter bar */
  .filter-bar { padding: 12px; gap: 10px; }

  /* Page subtitle */
  .page-subtitle { font-size: 12px; }

  /* Chip */
  .chip { font-size: 11px; }

  /* Sticky column on mobile — unstick */
  [style*="position:sticky"], [style*="position: sticky"] { position: relative !important; top: unset !important; }
}

/* =============================================
   RESPONSIVE — VERY SMALL (≤ 360px)
   ============================================= */
@media (max-width: 360px) {
  .stats-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.2rem; }
  .auth-card { margin: 6px; padding: 18px 10px; }
  .main-content { padding: 8px; }
}

/* ---- DASHBOARD GRID ---- */
.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }
.cv-panel { background: #fff; border: 2px solid var(--gold); border-radius: var(--radius); margin-bottom: 28px; overflow: hidden; box-shadow: var(--shadow); }
.cv-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; background: var(--navy); }
.cv-panel-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: var(--gold-light); font-family: 'Playfair Display', serif; }
.cv-embed-wrap { width: 100%; height: 820px; background: #525659; transition: height 0.35s ease; overflow: hidden; }
.cv-embed-wrap.collapsed { height: 0; }
.cv-iframe { width: 100%; height: 100%; border: none; display: block; }
.btn-outline-light { background: transparent; border: 1.5px solid rgba(255,255,255,.5); color: rgba(255,255,255,.9); }
.btn-outline-light:hover { background: rgba(255,255,255,.1); border-color: #fff; color: #fff; }


/* =============================================
   RESPONSIVE TABLES — horizontal scroll on mobile
   ============================================= */

/* All screens — scrollable wrapper */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  position: relative;
}

/* Rich content from Quill editor */
.rich-content h2 { font-size:1.1rem;font-weight:700;color:var(--navy);margin:12px 0 6px; }
.rich-content h3 { font-size:1rem;font-weight:700;color:var(--navy);margin:10px 0 4px; }
.rich-content ul, .rich-content ol { padding-left:20px;margin:6px 0; }
.rich-content li { margin-bottom:4px; }
.rich-content strong { color:var(--navy); }
.rich-content p { margin-bottom:6px; }
.table-wrapper::-webkit-scrollbar        { height: 10px; }
.table-wrapper::-webkit-scrollbar-track  { background: #e2e8f0; border-radius: 5px; margin: 0 4px; }
.table-wrapper::-webkit-scrollbar-thumb  { background: var(--gold); border-radius: 5px; border: 2px solid #e2e8f0; }
.table-wrapper::-webkit-scrollbar-thumb:hover { background: var(--navy); }

/* Firefox */
.table-wrapper { scrollbar-width: thin; scrollbar-color: var(--gold) #e2e8f0; }

/* Scroll hint */
.scroll-hint {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
  padding: 4px 12px 0;
  display: none;
}
@media (max-width: 1200px) {
  .scroll-hint { display: block; }
}

/* Keep table wide enough to show all columns */
.data-table { min-width: 620px; width: 100%; }
