/* ── Intesa ATS Portal Stylesheet ── */

/* Bulk-select row highlight */
tr.row-selected { background: #eff6ff !important; }
tr.row-selected:hover { background: #dbeafe !important; }


:root {
  --navy:        #1a2a4a;
  --navy-dark:   #111e36;
  --navy-light:  #243660;
  --gold:        #c9a84c;
  --gold-light:  #e8c97a;
  --gold-pale:   #fdf6e3;
  --white:       #ffffff;
  --bg:          #f0f2f5;
  --card:        #ffffff;
  --border:      #e2e8f0;
  --text:        #1a202c;
  --text-mid:    #4a5568;
  --text-light:  #718096;
  --sidebar-w:   240px;

  --status-review:    #744210; --status-review-bg:    #fefce8;
  --status-outreach:  #1e40af; --status-outreach-bg:  #eff6ff;
  --status-pending:   #92400e; --status-pending-bg:   #fff7ed;
  --status-screening: #5b21b6; --status-screening-bg: #f5f3ff;
  --status-interview: #1e3a5f; --status-interview-bg: #e0f2fe;
  --status-offer:     #065f46; --status-offer-bg:     #ecfdf5;
  --status-hired:     #14532d; --status-hired-bg:     #dcfce7;
  --status-declined:  #7f1d1d; --status-declined-bg:  #fef2f2;
  --status-withdrawn: #374151; --status-withdrawn-bg: #f9fafb;
  --status-jdmatch:   #78350f; --status-jdmatch-bg:   #fffbeb;
  --status-triage:    #b45309; --status-triage-bg:    #fef3c7;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }

/* ── Layout ── */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: var(--sidebar-w); background: var(--navy); color: var(--white);
  display: flex; flex-direction: column; flex-shrink: 0;
  overflow-y: auto;
}
.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
/* The real logo on a white chip. The artwork has a white background and the
   sidebar is navy, so the chip is what lets it be used exactly as supplied —
   no knockout, no recolouring, no cropped-down variant. */
.sidebar-brand .brand-logo {
  display: block; width: 100%; max-width: 168px; height: auto;
  background: #ffffff; border-radius: 6px; padding: 7px 9px;
}
.sidebar-brand .brand-name {
  font-size: 17px; font-weight: 700; color: var(--gold);
  letter-spacing: 0.3px; line-height: 1.2;
}
.sidebar-brand .brand-sub {
  font-size: 11px; color: rgba(255,255,255,0.5); margin-top: 10px;
  text-transform: uppercase; letter-spacing: 1px;
}

.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-section-label {
  font-size: 10px; font-weight: 600; letter-spacing: 1.2px;
  text-transform: uppercase; color: rgba(255,255,255,0.35);
  padding: 12px 20px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; cursor: pointer; border-radius: 0;
  color: rgba(255,255,255,0.75); text-decoration: none;
  font-size: 13.5px; transition: all 0.15s;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,0.07); color: var(--white); }
.nav-item.active {
  background: rgba(201,168,76,0.15); color: var(--gold);
  border-left-color: var(--gold); font-weight: 600;
}
.nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 14px 20px; border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 12px;
}
.sidebar-user-name { font-weight: 600; color: var(--white); }
.sidebar-user-role { color: rgba(255,255,255,0.45); font-size: 11px; margin-top: 2px; }
.btn-logout {
  display: inline-block; margin-top: 8px; font-size: 12px;
  color: rgba(255,255,255,0.5); cursor: pointer; background: none;
  border: none; padding: 0; text-decoration: underline;
}
.btn-logout:hover { color: #ff8b8b; }

.main-content { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }

.page-header {
  background: var(--white); border-bottom: 1px solid var(--border);
  padding: 16px 28px; display: flex; align-items: center;
  justify-content: space-between; flex-shrink: 0;
}
.page-title { font-size: 20px; font-weight: 700; color: var(--navy); }
.page-sub { font-size: 13px; color: var(--text-light); margin-top: 2px; }

.page-body { padding: 24px 28px; flex: 1; }

/* ── Cards ── */
.card {
  background: var(--card); border-radius: 10px;
  border: 1px solid var(--border); padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.card-title { font-size: 13px; font-weight: 600; color: var(--text-mid); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }

/* ── Stat Cards ── */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--card); border-radius: 10px; border: 1px solid var(--border);
  padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--gold);
}
.stat-label { font-size: 11px; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.8px; }
.stat-value { font-size: 34px; font-weight: 700; color: var(--navy); margin: 6px 0 4px; line-height: 1; }
.stat-sub { font-size: 12px; color: var(--text-light); }

/* ── Grid helpers ── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── Status badges ── */
.badge {
  display: inline-flex; align-items: center; padding: 3px 9px;
  border-radius: 20px; font-size: 11.5px; font-weight: 600;
  white-space: nowrap;
}
.badge-under-review    { color: var(--status-review);    background: var(--status-review-bg); }
.badge-outreach-sent   { color: var(--status-outreach);  background: var(--status-outreach-bg); }
.badge-pending-human-review { color: var(--status-pending); background: var(--status-pending-bg); }
.badge-screening-scheduled  { color: var(--status-screening); background: var(--status-screening-bg); }
.badge-interview       { color: var(--status-interview); background: var(--status-interview-bg); }
.badge-offer           { color: var(--status-offer);     background: var(--status-offer-bg); }
.badge-hired           { color: var(--status-hired);     background: var(--status-hired-bg); }
.badge-declined        { color: var(--status-declined);  background: var(--status-declined-bg); }
.badge-withdrawn       { color: var(--status-withdrawn); background: var(--status-withdrawn-bg); }
.badge-needs-jd-match  { color: var(--status-jdmatch);   background: var(--status-jdmatch-bg); }
.badge-needs-triage    { color: var(--status-triage);    background: var(--status-triage-bg); }

/* ── Stage-age pills (SLA at-a-glance) ── */
.age-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; padding: 2px 8px; margin-left: 6px;
  border-radius: 10px; font-size: 11px; font-weight: 700;
  white-space: nowrap;
}
.age-fresh  { color: #14532d; background: #dcfce7; }
.age-aging  { color: #92400e; background: #fef3c7; }
.age-stale  { color: #7f1d1d; background: #fee2e2; }
.age-none   { color: #9ca3af; background: #f3f4f6; }

/* ── Star / hot-list icon ── */
.star-toggle {
  display: inline-block; font-size: 18px; line-height: 1; cursor: pointer;
  user-select: none; transition: color 0.15s, transform 0.1s;
  margin-right: 6px;
}
.star-toggle:hover { transform: scale(1.2); }
.star-on  { color: #f59e0b; }
.star-off { color: #cbd5e1; }
.star-off:hover { color: #f59e0b; }

.qnotes-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 6px;
  background: #f3f4f6; color: #4a5568; cursor: pointer;
  border: 1px solid #e2e8f0; font-size: 14px; margin-right: 4px;
}
.qnotes-btn:hover { background: #e5e7eb; color: #1a2a4a; }

/* ── Score badges ── */
.score-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 28px; border-radius: 6px;
  font-size: 13px; font-weight: 700;
}
.score-high   { background: #dcfce7; color: #14532d; }
.score-mid    { background: #fff7ed; color: #92400e; }
.score-low    { background: #fef2f2; color: #7f1d1d; }
.score-none   { background: #f9fafb; color: #9ca3af; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left; padding: 10px 14px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--text-light);
  border-bottom: 2px solid var(--border);
  background: #f8fafc; white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; }
tbody tr:hover { background: #f8fafc; cursor: pointer; }
tbody td { padding: 11px 14px; color: var(--text); }
.td-name { font-weight: 600; }
.td-email { color: var(--text-light); font-size: 12.5px; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-mid); margin-bottom: 5px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 7px; font-size: 13.5px; color: var(--text);
  background: var(--white); transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,168,76,0.15);
}
.form-textarea { resize: vertical; min-height: 90px; font-family: inherit; }
.form-hint { font-size: 11.5px; color: var(--text-light); margin-top: 4px; }
.form-error { font-size: 12px; color: #dc2626; margin-top: 4px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 7px; font-size: 13.5px;
  font-weight: 600; cursor: pointer; border: none;
  transition: all 0.15s; text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-dark); }
.btn-gold { background: var(--gold); color: var(--white); }
.btn-gold:hover { background: var(--gold-light); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text-mid); }
.btn-outline:hover { border-color: var(--navy); color: var(--navy); background: #f8fafc; }
.btn-danger { background: #fee2e2; color: #dc2626; }
.btn-danger:hover { background: #fecaca; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── Filters bar ── */
.filter-bar {
  display: flex; gap: 10px; align-items: center;
  flex-wrap: wrap; margin-bottom: 16px;
}
.search-input {
  padding: 8px 12px 8px 36px; border: 1px solid var(--border);
  border-radius: 7px; font-size: 13.5px; width: 240px;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%23718096' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.099zm-5.44 1.097A5.5 5.5 0 1 1 8.5 3.5a5.5 5.5 0 0 1-2.198 8.94z'/%3E%3C/svg%3E") no-repeat 10px center;
  outline: none; transition: border-color 0.15s;
}
.search-input:focus { border-color: var(--gold); }
.filter-select {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 7px;
  font-size: 13px; background: var(--white); outline: none; cursor: pointer;
}
.filter-select:focus { border-color: var(--gold); }
.filter-count { margin-left: auto; font-size: 12.5px; color: var(--text-light); }

/* ── Candidate detail layout ── */
.detail-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; }
.detail-left { display: flex; flex-direction: column; gap: 20px; }
.detail-right { display: flex; flex-direction: column; gap: 16px; }

.info-row { display: flex; gap: 6px; margin-bottom: 8px; font-size: 13.5px; }
.info-label { font-weight: 600; color: var(--text-mid); min-width: 70px; }
.info-value { color: var(--text); }

/* ── Score gauge ── */
.score-display {
  display: flex; align-items: center; gap: 20px; padding: 16px 0;
  border-bottom: 1px solid var(--border); margin-bottom: 16px;
}
.score-circle {
  width: 72px; height: 72px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; font-weight: 800; flex-shrink: 0;
  border: 4px solid;
}
.score-circle.high  { border-color: #16a34a; color: #14532d; background: #f0fdf4; }
.score-circle.mid   { border-color: #d97706; color: #92400e; background: #fffbeb; }
.score-circle.low   { border-color: #dc2626; color: #7f1d1d; background: #fff5f5; }
.score-circle.none  { border-color: #d1d5db; color: #9ca3af; background: #f9fafb; }
.score-circle .score-num { font-size: 22px; line-height: 1; }
.score-circle .score-den { font-size: 11px; color: inherit; opacity: 0.7; }
.score-meta h3 { font-size: 15px; font-weight: 700; color: var(--navy); }
.score-meta p { font-size: 13px; color: var(--text-mid); margin-top: 3px; }

/* ── Category score bars ── */
.cat-bars { display: flex; flex-direction: column; gap: 10px; }
.cat-row { }
.cat-header { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 12.5px; }
.cat-name { font-weight: 600; color: var(--text-mid); }
.cat-score { font-weight: 700; color: var(--navy); }
.cat-bar-bg { height: 7px; background: #e5e7eb; border-radius: 4px; overflow: hidden; }
.cat-bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.cat-bar-high { background: #16a34a; }
.cat-bar-mid  { background: #d97706; }
.cat-bar-low  { background: #dc2626; }

/* ── Timeline ── */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: flex; gap: 14px; padding-bottom: 16px; position: relative; }
.timeline-item:not(:last-child)::before {
  content: ''; position: absolute; left: 7px; top: 18px; bottom: 0;
  width: 2px; background: var(--border);
}
.timeline-dot {
  width: 16px; height: 16px; border-radius: 50%; background: var(--gold);
  border: 2px solid var(--white); box-shadow: 0 0 0 2px var(--gold);
  flex-shrink: 0; margin-top: 2px;
}
.timeline-content { flex: 1; }
.timeline-action { font-size: 13px; font-weight: 600; color: var(--text); }
.timeline-meta { font-size: 12px; color: var(--text-light); margin-top: 2px; }

/* ── Tabs ── */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab-btn {
  padding: 10px 18px; font-size: 13.5px; font-weight: 600;
  color: var(--text-light); cursor: pointer; background: none; border: none;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all 0.15s;
}
.tab-btn:hover { color: var(--navy); }
.tab-btn.active { color: var(--navy); border-bottom-color: var(--navy); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Alert / notice ── */
.alert {
  padding: 12px 16px; border-radius: 8px; font-size: 13.5px;
  border: 1px solid; margin-bottom: 16px;
}
.alert-warning { background: #fff7ed; color: #92400e; border-color: #fed7aa; }
.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert-error   { background: #fef2f2; color: #7f1d1d; border-color: #fecaca; }
.alert-info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

/* ── Modal ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); z-index: 1000;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white); border-radius: 12px; width: 480px;
  max-width: 95vw; max-height: 90vh; overflow-y: auto;
  padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-title { font-size: 17px; font-weight: 700; color: var(--navy); }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-light); padding: 0; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-light); }
.empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text-mid); margin-bottom: 6px; }
.empty-sub { font-size: 13.5px; }

/* ── Breadcrumb ── */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-light); margin-bottom: 16px; }
.breadcrumb a { color: var(--text-light); text-decoration: none; }
.breadcrumb a:hover { color: var(--navy); text-decoration: underline; }
.breadcrumb-sep { color: var(--border); }
.breadcrumb-current { color: var(--text); font-weight: 600; }

/* ── Login page ── */
.login-page {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; background: var(--navy);
}
.login-card {
  background: var(--white); border-radius: 14px; padding: 40px;
  width: 380px; max-width: 95vw; box-shadow: 0 24px 80px rgba(0,0,0,0.3);
}
.login-brand { text-align: center; margin-bottom: 28px; }
/* The full lockup, tagline included: the login card is white and wide enough
   to carry it at a legible size. width/height are set on the element too, so
   the card does not reflow as the image loads. */
.login-brand-logo { width: 240px; max-width: 100%; height: auto; display: block; margin: 0 auto; }
.login-brand-name { font-size: 22px; font-weight: 800; color: var(--navy); }
.login-brand-sub { font-size: 13px; color: var(--text-light); margin-top: 10px; }
.login-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 20px; text-align: center; }
.login-error { background: #fef2f2; color: #7f1d1d; border: 1px solid #fecaca; border-radius: 7px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; display: none; }

/* ── Pipeline status bar ── */
.status-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.status-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 20px;
  font-size: 12.5px; cursor: pointer; transition: all 0.15s;
  border: 1.5px solid transparent;
}
.status-chip.selected { border-color: currentColor; font-weight: 700; }
.status-chip-count { font-weight: 700; }

/* ── Misc ── */
.text-gold { color: var(--gold); }
.text-navy { color: var(--navy); }
.text-light { color: var(--text-light); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.ml-auto { margin-left: auto; }
.w-full { width: 100%; }

/* ── Pagination ── */
.pagination { display: flex; align-items: center; gap: 6px; margin-top: 16px; justify-content: flex-end; }
.page-btn {
  padding: 5px 10px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--white); cursor: pointer; font-size: 13px; color: var(--text-mid);
  transition: all 0.1s;
}
.page-btn:hover { border-color: var(--navy); color: var(--navy); }
.page-btn.active { background: var(--navy); color: var(--white); border-color: var(--navy); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-info { font-size: 12.5px; color: var(--text-light); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a0aec0; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .sidebar { display: none; }
  .stat-grid { grid-template-columns: 1fr; }
  .page-body { padding: 16px; }
}
