@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ═══════════════════════════════════════════════════════════
   Resource Management Tool — App Stylesheet
   ═══════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sidebar-w: 260px;
  --bg-dark:   #f8fafc;
  --bg-darker: #f0f2f5;
  --bg-card:   #ffffff;
  --border:    #e2e8f0;
  --accent:    #2563eb;
  --accent2:   #1d4ed8;
  --text:      #0f172a;
  --text-muted:#64748b;
  --text-dim:  #94a3b8;
  --over-bg:   #fde8e8; --over-text:  #c0202a; --over-bar:  #e02030;
  --under-bg:  #fff8e1; --under-text: #92650a; --under-bar: #b87d0d;
  --norm-bg:   #e8faf4; --norm-text:  #0d7a4e; --norm-bar:  #0a9b5e;
  --ua-bg:     #f0f4f8; --ua-text:    #4a607a; --ua-bar:    #8899aa;
  --total-bg:  #e8f4fd; --total-text: #1a5276; --total-bar: #2980b9;
  --radius:    12px;
  --shadow:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --mono: 'JetBrains Mono', monospace;
  --sans: 'Plus Jakarta Sans', system-ui, sans-serif;
}

html, body { height: 100%; font-family: var(--sans); font-size: 14px; background: var(--bg-darker); color: var(--text); }

#app { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ──────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: #ffffff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 24px;
}

#sidebar::-webkit-scrollbar { width: 3px; }
#sidebar::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 2px; }

.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
  height: 52px; flex-shrink: 0;
  /* Extend over the sidebar border-right so there's no white gap next to the dark header */
  margin-right: -1px;
  position: relative; z-index: 2;
}
.brand-logo {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 800; font-family: var(--mono);
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-size: 15px; font-weight: 700; color: #ffffff; letter-spacing: -.3px; }
.brand-sub  { font-size: 9px; color: rgba(255,255,255,.5); text-transform: uppercase; letter-spacing: .08em; margin-top: -2px; }
.brand-user { font-size: 10px; color: rgba(255,255,255,.6); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-logout {
  margin-left: auto; flex-shrink: 0;
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.12); color: #fff; border: none;
}
.btn-logout:hover { background: rgba(255,255,255,.24); }

/* ── Login gate ─────────────────────────────────────────────── */
.login-screen {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 360px;
  background: #fff; border-radius: 16px; padding: 32px 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  display: flex; flex-direction: column;
}
.login-logo {
  width: 46px; height: 46px; border-radius: 12px; margin: 0 auto 14px;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; font-family: var(--mono);
}
.login-title { margin: 0; text-align: center; font-size: 1.15rem; font-weight: 700; color: #1e293b; }
.login-sub   { margin: 4px 0 22px; text-align: center; font-size: .82rem; color: #64748b; }
.login-label { font-size: .74rem; font-weight: 600; color: #475569; margin-bottom: 5px; text-transform: uppercase; letter-spacing: .03em; }
.login-input {
  padding: 10px 12px; margin-bottom: 16px; border-radius: 9px;
  border: 1px solid #d1d9e6; font-size: .88rem; outline: none;
  background: #f8fafc; color: #1a2332;
}
.login-input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.login-error { min-height: 18px; margin-bottom: 8px; color: #e02030; font-size: .78rem; text-align: center; }
.login-btn {
  padding: 11px; border: none; border-radius: 9px; cursor: pointer;
  background: var(--accent); color: #fff; font-weight: 700; font-size: .9rem;
}
.login-btn:hover:not(:disabled) { background: var(--accent2); }
.login-btn:disabled { opacity: .65; cursor: default; }

.sb-nav { flex: 1; padding: 4px 0; overflow-y: auto; }

.sidebar-section { padding: 6px 12px; }
.sidebar-divider  { height: 1px; background: var(--border); margin: 2px 14px; }
.sidebar-label {
  padding: 8px 4px 4px; font-size: 9.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; color: var(--text-dim);
  margin-bottom: 4px;
}

.btn-refresh {
  width: 100%; padding: 9px 16px; border-radius: 8px; border: none; cursor: pointer;
  background: var(--accent); color: #fff; font-size: 12.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all .15s; font-family: var(--sans);
}
.btn-refresh:hover  { background: var(--accent2); }
.btn-refresh:disabled { opacity: .6; cursor: not-allowed; }
.btn-refresh svg { flex-shrink: 0; }

.sync-status-line {
  margin-top: 6px; font-size: 10px; color: var(--text-dim);
  text-align: center; min-height: 14px; font-weight: 600;
  font-family: var(--mono);
}
.sync-status-line.sync-ok      { color: #16a34a; }
.sync-status-line.sync-running { color: #d97706; }

.sidebar-select {
  width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: #f8fafc; color: var(--text); font-size: .82rem; outline: none;
  appearance: none; cursor: pointer;
}
.sidebar-select:focus { border-color: var(--accent); }

/* Radio group */
.radio-group { display: flex; flex-direction: column; gap: 2px; }
.radio-item {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--text-muted); cursor: pointer;
  padding: 8px 12px; margin: 0 -4px; border-radius: 8px;
  font-weight: 500; transition: all .15s;
}
.radio-item:hover { background: #f8fafc; color: var(--text); }
.radio-item input[type="radio"] { accent-color: var(--accent); width: 15px; height: 15px; }
.radio-item:has(input:checked) { color: var(--accent); font-weight: 700; background: #eff6ff; }

/* Period inputs */
.period-inputs { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.period-inputs label { font-size: .72rem; color: var(--text-muted); margin-bottom: 2px; display: block; }
.period-inputs input[type="date"] {
  width: 100%; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--border);
  background: #f8fafc; color: var(--text); font-size: .78rem; outline: none;
}
.period-inputs input[type="date"]:focus { border-color: var(--accent); }
.period-inputs input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.8;
}
.period-inputs input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* Sliders */
.slider-group { margin-bottom: 12px; }
.slider-label { font-size: .75rem; color: var(--text); display: block; margin-bottom: 6px; }
.slider-row { display: flex; align-items: center; gap: 8px; }
.slider-row input[type="range"] { flex: 1; accent-color: var(--accent); cursor: pointer; }
.slider-val { font-size: .75rem; font-weight: 600; color: var(--accent); min-width: 36px; text-align: right; }

/* Alloc indicator */
/* .alloc-indicator moved into .period-card-alloc */

/* ── Main ─────────────────────────────────────────────────── */
#main {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 0; position: relative;
  background: var(--bg-darker);
}

/* Loading overlay */
.loading-overlay {
  position: fixed; inset: 0; background: rgba(240,242,245,.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; backdrop-filter: blur(4px);
}
.loading-overlay.hidden { display: none; }
.loading-card {
  background: #fff; border-radius: 16px; padding: 36px 44px; text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,.12); min-width: 300px;
}
.loading-spinner {
  width: 44px; height: 44px; border: 4px solid #e2e8f0; border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-title  { font-size: 1rem; font-weight: 700; color: #1a2332; margin-bottom: 6px; }
.loading-msg    { font-size: .82rem; color: #64748b; margin-bottom: 16px; }
.loading-bar-track { height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
.loading-bar-fill  { height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s; }

/* Header */
.dash-header {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
  border-radius: 0; padding: 0 24px;
  height: 52px;
  margin-bottom: 0; position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.dash-header-inner { display: flex; align-items: center; gap: 12px; position: absolute; left: 50%; transform: translateX(-50%); }
.dash-header-icon  { display: none; }
.dash-title        { font-size: 1.2rem; font-weight: 800; color: #ffffff; letter-spacing: -.02em; }
.dash-badge        { font-size: .68rem; background: rgba(255,255,255,.12); color: #e2e8f0; border: 1px solid rgba(255,255,255,.15); border-radius: 12px; padding: 2px 10px; margin-left: 10px; }
.dash-stats        { display: none; }
.dash-stat         { text-align: right; }
.dash-stat-val     { font-size: 1.4rem; font-weight: 800; color: #ffffff; line-height: 1; }
.dash-stat-lbl     { font-size: .65rem; color: rgba(255,255,255,.6); margin-top: 2px; }

/* Content padding — since #main has padding:0 for the flush header,
   everything after .dash-header gets horizontal padding via margins. */
.metric-row, .period-card, .tab-bar, .tab-panel { margin-left: 24px; margin-right: 24px; }

/* Period card */
.period-card {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  margin-bottom: 16px; padding: 14px 20px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-radius: var(--radius); box-shadow: 0 2px 12px rgba(0,0,0,.12);
}
.period-card.hidden { display: none; }
.period-card-inner { display: flex; align-items: center; gap: 12px; }
.period-card-icon {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px;
  background: rgba(37,99,235,.1); color: var(--accent);
}
.period-card-text { display: flex; flex-direction: column; gap: 2px; }
.period-card-label { font-size: .7rem; color: #64748b; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; }
.period-card-value { font-size: 1rem; color: #0f172a; font-weight: 700; }
.period-card-alloc {
  font-size: .75rem; color: #64748b; font-weight: 500;
  padding: 4px 12px; background: rgba(37,99,235,.06); border-radius: 6px;
}

/* Metric cards */
.metric-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 20px; margin-top: 20px; }
.metric-card {
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  border-top: 3px solid transparent;
  transition: transform .2s, box-shadow .2s;
}
.metric-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.metric-card.total      { background: var(--total-bg); border-top-color: var(--total-bar); }
.metric-card.normal     { background: var(--norm-bg);  border-top-color: var(--norm-bar); }
.metric-card.under      { background: var(--under-bg); border-top-color: var(--under-bar); }
.metric-card.over       { background: var(--over-bg);  border-top-color: var(--over-bar); }
.metric-card.unassigned { background: var(--ua-bg);    border-top-color: var(--ua-bar); }

.mc-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.metric-card .label { font-size: .7rem; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: .06em; }
.metric-card .value { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.metric-card.total      .value { color: var(--total-text); }
.metric-card.normal     .value { color: var(--norm-text); }
.metric-card.under      .value { color: var(--under-text); }
.metric-card.over       .value { color: var(--over-text); }
.metric-card.unassigned .value { color: var(--ua-text); }
.metric-card .sub      { font-size: .72rem; color: #64748b; margin-bottom: 10px; }
.mc-bar-wrap { height: 5px; background: rgba(0,0,0,.1); border-radius: 3px; overflow: hidden; }
.mc-bar-fill { height: 100%; border-radius: 3px; transition: width .5s; }
.metric-card.total      .mc-bar-fill { background: var(--total-bar); }
.metric-card.normal     .mc-bar-fill { background: var(--norm-bar); }
.metric-card.under      .mc-bar-fill { background: var(--under-bar); }
.metric-card.over       .mc-bar-fill { background: var(--over-bar); }
.metric-card.unassigned .mc-bar-fill { background: var(--ua-bar); }

/* Tabs */
.tab-bar {
  display: flex; gap: 4px; border-bottom: 2px solid #d1d9e6; margin-bottom: 16px;
}
.tab-btn {
  padding: 10px 20px; border: none; background: transparent; cursor: pointer;
  font-size: .84rem; font-weight: 600; color: #64748b; border-radius: 8px 8px 0 0;
  border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all .15s;
}
.tab-btn:hover  { background: #e2e8f0; color: #1a2332; }
.tab-btn.active { color: var(--accent2); border-bottom-color: var(--accent); background: #fff; }

.tab-panel        { }
.tab-panel.hidden { display: none; }

/* ── Summary Table ────────────────────────────────────────── */
.summary-table-wrap { overflow-x: auto; overflow-y: auto; max-height: 60vh; }
table.summary-table {
  width: 100%; border-collapse: collapse; background: #fff;
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
table.summary-table th {
  background: var(--bg-dark); color: var(--text-muted);
  font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  padding: 12px 16px; text-align: center; white-space: nowrap;
  position: sticky; top: 0; z-index: 2;
}
table.summary-table th:first-child { text-align: left; }
table.summary-table td {
  padding: 11px 16px; font-size: .82rem; border-bottom: 1px solid #e8edf5;
  vertical-align: middle; text-align: center;
}
table.summary-table td:first-child { text-align: left; }
table.summary-table tr:last-child td { border-bottom: none; }
table.summary-table tr.clickable:hover td { background: #f0f9ff; cursor: pointer; }

.resource-cell { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: .75rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.res-name  { font-weight: 600; font-size: .84rem; }
.util-bar-wrap { background: #e8edf5; border-radius: 4px; height: 8px; width: 120px; overflow: hidden; }
.util-bar-fill { height: 100%; border-radius: 4px; }

.status-badge {
  display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: .68rem; font-weight: 700;
}
.status-Over      { background: #fee2e2; color: #b91c1c; }
.status-Under     { background: #fef3c7; color: #92400e; }
.status-Normal    { background: #d1fae5; color: #065f46; }
.status-Unassigned{ background: #f0f4f8; color: #64748b; }


/* ── Raw Data Table ───────────────────────────────────────── */
.raw-filter-bar {
  display: flex; gap: 20px; flex-wrap: wrap;
  padding: 16px 20px 12px; border-bottom: 1px solid #f0f4f8;
}
.raw-filter-group { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 160px; }
.raw-filter-label { font-size: .72rem; font-weight: 600; color: #64748b; letter-spacing: .04em; }
.raw-filter-input {
  padding: 9px 12px; border-radius: 8px; border: 1px solid #d1d9e6;
  font-size: .83rem; outline: none; background: #fff; color: #1a2332; width: 100%;
}
.raw-filter-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.raw-row-count {
  font-size: .76rem; color: #64748b; padding: 8px 20px 4px;
  font-style: italic;
}
/* keep old classes in case referenced elsewhere */
.table-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.table-search {
  flex: 1; max-width: 360px; padding: 8px 12px; border-radius: 8px;
  border: 1px solid #d1d9e6; font-size: .82rem; outline: none; background: #fff;
}
.table-search:focus { border-color: var(--accent); }
.table-count { font-size: .78rem; color: #64748b; }

table.raw-table {
  width: 100%; border-collapse: collapse; background: #fff;
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
table.raw-table th {
  background: var(--bg-dark); color: var(--text-muted);
  font-size: .63rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  padding: 11px 14px; text-align: left; white-space: nowrap;
  position: sticky; top: 0; z-index: 2;
}
table.raw-table th.th-period { color: var(--accent); }
table.raw-table td {
  padding: 9px 14px; font-size: .8rem; border-bottom: 1px solid #e8edf5;
  vertical-align: middle;
  /* Fixed row height — required for virtual scrolling to compute offsets correctly. */
  height: 38px; max-height: 38px; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Spacer rows used by virtual scroller — collapse padding/border so only the
   inline height drives them. */
table.raw-table tr.virt-spacer td { padding: 0; border: 0; height: auto; max-height: none; }
table.raw-table tr:last-child td { border-bottom: none; }
table.raw-table tr.clickable { cursor: pointer; }
table.raw-table tr.clickable:hover td { background: #f0f9ff; }

.task-link { color: var(--accent2); font-weight: 500; text-decoration: underline dotted; cursor: pointer; }
.hrs-num   { font-weight: 700; font-family: var(--mono); }
.sheet-chip {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: .68rem; font-weight: 600; white-space: nowrap;
  background: #e0f2fe; color: #0369a1; border: 1px solid #7dd3fc;
}

/* ── Unassigned panel (avatar cards) ─────────────────────── */
.unassigned-panel { margin-top: 16px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.ua-panel-hdr {
  background: var(--bg-dark); color: var(--text); padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: .84rem; font-weight: 700; cursor: pointer; user-select: none;
}
.ua-panel-hdr:hover { background: #f0f2f5; }
.ua-toggle { font-size: .75rem; color: var(--text-muted); }
.ua-panel-body { padding: 16px 20px; max-height: 300px; overflow-y: auto; }
.ua-panel-body::-webkit-scrollbar { width: 6px; }
.ua-panel-body::-webkit-scrollbar-thumb { background: #c8d4e0; border-radius: 3px; }
.ua-panel-desc { font-size: .75rem; color: #94a3b8; margin-bottom: 14px; }
.ua-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.ua-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 8px; border-radius: 10px; border: 1px solid #e8edf5;
  background: #f8fafc; cursor: pointer; transition: all .15s; text-align: center;
}
.ua-card:hover { border-color: var(--accent); background: #eff6ff; transform: translateY(-1px); box-shadow: 0 2px 8px rgba(37,99,235,.15); }
.ua-avatar { width: 40px !important; height: 40px !important; font-size: .82rem !important; }
.ua-name { font-size: .75rem; font-weight: 600; color: #1a2332; line-height: 1.2; word-break: break-word; }
.ua-sub  { font-size: .62rem; color: #94a3b8; font-weight: 700; letter-spacing: .06em; }

/* ── Multi-sheet selector (sidebar) ──────────────────────── */
.sms-wrap { position: relative; }
.sms-trigger {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; color: var(--text); font-size: 12.5px; font-weight: 500;
  cursor: pointer; user-select: none; transition: border-color .15s, box-shadow .15s;
  font-family: var(--sans);
}
.sms-trigger:hover { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(37,99,235,.08); }
.sms-arrow { font-size: .65rem; color: var(--text-muted); flex-shrink: 0; }
.sms-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 300;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,.15);
}
#smsSheetItems {
  max-height: 180px; overflow-y: auto;
}
#smsSheetItems::-webkit-scrollbar { width: 4px; }
#smsSheetItems::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }
.sms-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 12px;
  font-size: .79rem; color: var(--text); cursor: pointer; user-select: none;
}
.sms-item:hover { background: #f8fafc; }
.sms-item input[type="checkbox"] { accent-color: var(--accent); width: 13px; height: 13px; flex-shrink: 0; cursor: pointer; }
.sms-all-item { font-weight: 600; color: var(--accent); }
.sms-divider  { height: 1px; background: var(--border); margin: 2px 0; }
.sms-apply-wrap {
  padding: 8px 10px; border-top: 1px solid var(--border);
  display: flex; gap: 6px; justify-content: flex-end;
}
.sms-apply-btn {
  padding: 6px 16px; border-radius: 6px; border: none; cursor: pointer;
  background: var(--accent); color: #fff; font-size: .75rem; font-weight: 700;
  letter-spacing: .03em; transition: background .15s, box-shadow .15s;
  box-shadow: 0 2px 6px rgba(37,99,235,.3);
}
.sms-apply-btn:hover { background: var(--accent2); box-shadow: 0 3px 10px rgba(37,99,235,.4); }
.sms-clear-btn {
  padding: 6px 14px; border-radius: 6px; border: 1px solid #d1d9e6; cursor: pointer;
  background: #fff; color: #475569; font-size: .75rem; font-weight: 600;
  letter-spacing: .03em; transition: background .15s, border-color .15s, color .15s;
}
.sms-clear-btn:hover { background: #f8fafc; border-color: #94a3b8; color: #1a2332; }

/* ── Multi-resource filter (raw data) ─────────────────────── */
.raw-res-filter-group { flex: 1.6; min-width: 200px; }
.raw-res-multi { position: relative; }
.raw-res-trigger {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-radius: 8px; border: 1px solid #d1d9e6;
  font-size: .83rem; background: #fff; color: #1a2332;
  cursor: pointer; user-select: none; transition: border-color .15s, box-shadow .15s;
}
.raw-res-trigger:hover { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.raw-res-arrow { font-size: .65rem; color: #94a3b8; flex-shrink: 0; }
.raw-res-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; width: 300px; z-index: 300;
  background: #fff; border: 1px solid #d1d9e6; border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,.13);
}
.raw-res-search-wrap { padding: 8px 10px; border-bottom: 1px solid #e8edf5; }
.raw-res-search {
  width: 100%; padding: 7px 10px; border: 1px solid #d1d9e6; border-radius: 7px;
  font-size: .8rem; outline: none; color: #1a2332; background: #f8fafc;
}
.raw-res-search:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.raw-res-items-wrap { max-height: 180px; overflow-y: auto; }
.raw-res-items-wrap::-webkit-scrollbar { width: 4px; }
.raw-res-items-wrap::-webkit-scrollbar-thumb { background: #c8d4e0; border-radius: 2px; }
.raw-res-apply-wrap {
  padding: 8px 10px; border-top: 1px solid #e8edf5;
  display: flex; gap: 6px; justify-content: flex-end;
}
.raw-res-apply-btn {
  padding: 6px 16px; border-radius: 6px; border: none; cursor: pointer;
  background: var(--accent); color: #fff; font-size: .75rem; font-weight: 700;
  letter-spacing: .03em; transition: background .15s, box-shadow .15s;
  box-shadow: 0 2px 6px rgba(37,99,235,.3);
}
.raw-res-apply-btn:hover { background: var(--accent2); box-shadow: 0 3px 10px rgba(37,99,235,.4); }
.raw-res-clear-btn {
  padding: 6px 14px; border-radius: 6px; border: 1px solid #d1d9e6; cursor: pointer;
  background: #fff; color: #475569; font-size: .75rem; font-weight: 600;
  letter-spacing: .03em; transition: background .15s, border-color .15s, color .15s;
}
.raw-res-clear-btn:hover { background: #f8fafc; border-color: #94a3b8; color: #1a2332; }
.raw-res-items-wrap::-webkit-scrollbar { width: 4px; }
.raw-res-items-wrap::-webkit-scrollbar-thumb { background: #c8d4e0; border-radius: 2px; }
.raw-res-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px;
  font-size: .8rem; color: #1a2332; cursor: pointer; user-select: none;
}
.raw-res-item:hover { background: #f0f9ff; }
.raw-res-item input[type="checkbox"] { accent-color: var(--accent); width: 13px; height: 13px; flex-shrink: 0; cursor: pointer; }
.raw-res-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.raw-res-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 7px 3px 9px; background: #e0f2fe; color: #0369a1;
  border: 1px solid #7dd3fc; border-radius: 12px; font-size: .73rem; font-weight: 600;
}
.raw-res-chip-x {
  background: none; border: none; cursor: pointer; color: #0369a1;
  font-size: .78rem; padding: 0 1px; line-height: 1; opacity: .65;
}
.raw-res-chip-x:hover { opacity: 1; }

/* ── Raw data collapsible section ─────────────────────────── */
.raw-section { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.raw-section-hdr {
  background: var(--bg-dark); color: var(--text); padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: .84rem; font-weight: 700; cursor: pointer; user-select: none;
}
.raw-section-hdr:hover { background: #f0f2f5; }

/* Export buttons */
.export-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; font-size: .72rem; font-weight: 700;
  color: #fff; background: var(--accent);
  border: none; border-radius: 7px; cursor: pointer;
  letter-spacing: .03em; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(37,99,235,.3);
  transition: background .15s, box-shadow .15s;
}
.export-btn:hover { background: var(--accent2); box-shadow: 0 3px 12px rgba(37,99,235,.5); }
.export-btn svg { opacity: .85; }
.export-btn:hover svg { opacity: 1; }

/* Report overlay — fullscreen view for loaded saved reports */
.report-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: #f8fafc;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.report-overlay.hidden { display: none; }
.report-overlay-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.report-overlay-title-row {
  display: flex; align-items: center; gap: 14px;
}
.report-overlay-icon {
  width: 42px; height: 42px; border-radius: 10px;
  background: rgba(37,99,235,.1); border: 1px solid rgba(37,99,235,.2);
  display: flex; align-items: center; justify-content: center;
}
/* svg stroke inside .report-overlay-icon should use var(--accent) or #2563eb in HTML */
.report-overlay-icon svg { stroke: #2563eb; }
.report-overlay-name {
  font-size: 1.05rem; font-weight: 700; color: var(--text);
}
.report-overlay-meta {
  font-size: .75rem; color: #64748b; margin-top: 2px;
}
.report-overlay-actions {
  display: flex; align-items: center; gap: 10px;
}
.report-overlay-close {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px; font-size: .78rem; font-weight: 600;
  background: #ffffff; border: 1px solid var(--border);
  color: var(--text); border-radius: 7px; cursor: pointer; transition: all .15s;
}
.report-overlay-close:hover { background: #f0f2f5; color: var(--text); }
/* Match export button size inside report overlay header */
.report-overlay-actions .export-btn {
  padding: 7px 14px; font-size: .78rem; border-radius: 7px;
}
.report-overlay-body {
  flex: 1; overflow: auto; padding: 24px 28px;
}
.report-overlay-body table {
  width: 100%; border-collapse: collapse; background: #fff;
  border-radius: 12px; overflow: hidden; box-shadow: 0 1px 6px rgba(0,0,0,.06);
}
.report-overlay-body th {
  background: #f8fafc; color: #64748b;
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  padding: 12px 16px; text-align: center; white-space: nowrap;
  position: sticky; top: 0; z-index: 2;
}
.report-overlay-body th:first-child { text-align: left; }
.report-overlay-body td {
  padding: 10px 16px; font-size: .82rem; border-bottom: 1px solid #e8edf5;
  text-align: center; color: #1e293b;
}
.report-overlay-body td:first-child { text-align: left; font-weight: 600; }
.report-overlay-body tr:last-child td { border-bottom: none; }
.report-overlay-body tr:hover td { background: #f0f9ff; }

/* Table action bar — sits above summary/raw tables */
.table-action-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; margin-bottom: 6px;
  background: #f8fafc; border-radius: 10px;
}
.table-action-title {
  font-size: .78rem; font-weight: 600; color: #64748b; letter-spacing: .03em;
}
.table-action-btns {
  display: flex; gap: 6px;
}
.raw-toggle-icon { font-size: .75rem; color: var(--text-muted); }
.raw-section-body { display: none; overflow: visible; }
#rawTableWrap { padding: 0 20px 16px; }

/* ── Heatmap ──────────────────────────────────────────────── */
#heatmapChart { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-height: 200px; }
#heatmapChart > div::-webkit-scrollbar { width: 6px; }
#heatmapChart > div::-webkit-scrollbar-thumb { background: #c8d4e0; border-radius: 3px; }

/* ── Gantt / Schedule & Capacity ──────────────────────────── */
.gantt-wrap { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }

.gantt-controls {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 12px 20px; background: #f8fafc; border-bottom: 1px solid #e8edf5;
  font-size: .78rem;
}
.gantt-ctrl-label { font-weight: 700; color: #64748b; letter-spacing: .06em; text-transform: uppercase; margin-right: 4px; }
.gantt-ctrl-pill {
  padding: 4px 14px; border-radius: 20px; border: 1.5px solid var(--accent);
  color: var(--accent); font-weight: 600; background: rgba(37,99,235,.07);
}
.gantt-ctrl-chip {
  padding: 4px 12px; border-radius: 20px; border: 1px solid #d1d9e6;
  color: #64748b; font-weight: 500; background: #fff;
}
.gantt-legend { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.gantt-legend-item { display: flex; align-items: center; gap: 5px; font-size: .73rem; color: #64748b; }
.gantt-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

.gantt-header-row {
  display: flex; background: var(--bg-dark); color: var(--text);
  min-height: 44px; align-items: center;
}
.gantt-res-col {
  width: 220px; min-width: 220px; padding: 0 16px;
  font-size: .72rem; font-weight: 700; color: var(--text-muted);
  letter-spacing: .07em; text-transform: uppercase;
  border-right: 1px solid var(--border); flex-shrink: 0;
}
.gantt-tl-col { flex: 1; padding: 0 16px; font-size: .84rem; font-weight: 600; color: var(--text); }

/* Horizontal + vertical scroll container */
.gantt-scroll { overflow-x: auto; overflow-y: hidden; }
.gantt-scroll::-webkit-scrollbar { height: 8px; }
.gantt-scroll::-webkit-scrollbar-thumb { background: #c8d4e0; border-radius: 4px; }
.gantt-scroll::-webkit-scrollbar-track { background: #f0f4f8; }

.gantt-body { overflow-y: auto; max-height: calc(100vh - 310px); min-width: 820px; }
.gantt-body::-webkit-scrollbar { width: 6px; }
.gantt-body::-webkit-scrollbar-thumb { background: #c8d4e0; border-radius: 3px; }

/* Header row must match min-width so it scrolls with body */
.gantt-header-row { min-width: 820px; }

/* One group per resource: resource label left, task rows right */
.gantt-res-group {
  display: flex; align-items: stretch;
  border-bottom: 2px solid #e2e8f0; min-width: 820px;
}
.gantt-res-group:hover { background: #f8fafc; }
.gantt-res-group:hover .gantt-res-cell { background: #f8fafc; }

.gantt-res-cell {
  width: 220px; min-width: 220px; padding: 0 12px;
  display: flex; align-items: center; gap: 8px;
  border-right: 1px solid #e8edf5; flex-shrink: 0;
  align-self: stretch;
  /* sticky so resource names stay visible while scrolling */
  position: sticky; left: 0; background: #fff; z-index: 2;
}
.gantt-res-name {
  font-size: .76rem; font-weight: 600; color: #1a2332;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Sticky header resource column */
.gantt-res-col {
  position: sticky; left: 0; background: var(--bg-dark); z-index: 3;
}

/* Column on the right holding one row per task */
.gantt-tasks-col { flex: 1; display: flex; flex-direction: column; min-width: 600px; }

.gantt-task-row {
  position: relative; min-height: 40px;
  border-bottom: 1px solid #f0f4f8; overflow: hidden;
}
.gantt-task-row:last-child { border-bottom: none; }

.gantt-bar {
  position: absolute; height: 26px; border-radius: 5px;
  top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; padding: 0 10px;
  font-size: .68rem; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer; transition: opacity .15s, box-shadow .15s;
  min-width: 6px; box-sizing: border-box;
}
.gantt-bar:hover { opacity: .82; box-shadow: 0 2px 10px rgba(0,0,0,.2); }
.gantt-no-tasks {
  font-size: .72rem; color: #94a3b8; font-style: italic;
  display: flex; align-items: center; padding-left: 14px; min-height: 40px;
}

/* ══════════════════════════════════════════════ MODALS ═════ */
dialog.modal {
  border: none; border-radius: 20px; padding: 0;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0,0,0,.18);
  max-width: 520px; width: 90vw;
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
}
dialog.modal::backdrop { background: rgba(15,23,42,.6); backdrop-filter: blur(6px); }
dialog#confirmModal,
dialog#saveReportModal {
  max-width: 400px;
  width: 85vw;
  z-index: 9999;
}
dialog#confirmModal::backdrop,
dialog#saveReportModal::backdrop {
  background: rgba(15,23,42,.75);
}
/* Modal text on white background */
dialog#confirmModal .modal-body,
dialog#saveReportModal .modal-body {
  background: #fff;
}
dialog#confirmModal #confirmTitle { color: #1e293b; }
dialog#confirmModal #confirmMsg { color: #64748b; }
.modal-body {
  border-radius: 20px; overflow: hidden;
  background: #ffffff;
}
.modal-close {
  position: absolute; top: 12px; right: 14px;
  background: rgba(100,116,139,.1); border: none;
  font-size: .85rem; cursor: pointer; color: #475569;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: background .15s, color .15s; line-height: 1;
  z-index: 1;
}
.modal-close:hover { background: #fee2e2; color: #e02030; }

/* Close button inside a light-gradient header */
.upload-modal-header .modal-close,
.skills-edit-header .modal-close,
.alt-modal-header .modal-close {
  background: rgba(0,0,0,.06); color: var(--text-muted);
  top: 10px; right: 12px;
}
.upload-modal-header .modal-close:hover,
.skills-edit-header .modal-close:hover,
.alt-modal-header .modal-close:hover {
  background: rgba(239,68,68,.8); color: #fff;
}

/* Allocation modal */
.alloc-modal-body { display: flex; flex-direction: column; }
.alloc-modal-header {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); padding: 28px 28px 24px; display: flex; flex-direction: column; gap: 10px;
}
.alloc-warning-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(246,166,35,.15); border: 1px solid rgba(246,166,35,.4);
  color: #f6a623; border-radius: 20px; font-size: .7rem; font-weight: 700; padding: 4px 12px;
  width: fit-content; letter-spacing: .06em;
}
.alloc-modal-title { font-size: 1.2rem; font-weight: 800; color: var(--text); }
.alloc-modal-desc  { font-size: .82rem; color: var(--text-muted); line-height: 1.6; }
.alloc-modal-desc strong { color: var(--accent); }
.alloc-count-box {
  display: flex; align-items: center; gap: 14px;
  background: rgba(37,99,235,.1); border: 1px solid rgba(37,99,235,.25);
  border-radius: 10px; padding: 12px 18px; margin-top: 4px;
}
.alloc-count-num   { font-size: 2rem; font-weight: 900; color: var(--accent); font-family: var(--mono); line-height: 1; }
.alloc-count-label { font-size: .78rem; color: var(--text-muted); line-height: 1.4; }
.alloc-count-label strong { color: var(--text); }

.alloc-modal-footer { background: #fff; padding: 24px 28px; display: flex; flex-direction: column; gap: 14px; }
.alloc-input-label  { font-size: .68rem; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .1em; }
.alloc-input-row { display: flex; align-items: center; gap: 0; border: 1.5px solid #d1d9e6; border-radius: 10px; overflow: hidden; }
.alloc-stepper {
  width: 44px; height: 44px; border: none; background: #f0f4f8; font-size: 1.2rem;
  cursor: pointer; color: #1a2332; flex-shrink: 0; transition: background .15s;
}
.alloc-stepper:hover { background: #e2e8f0; }
.alloc-number-input {
  flex: 1; border: none; text-align: center; font-size: 1.1rem; font-weight: 700;
  color: #1a2332; outline: none; padding: 8px 0; background: #fff;
}
.alloc-tip  { font-size: .75rem; color: #64748b; line-height: 1.5; }
.alloc-tip strong { color: #1a2332; }
.btn-apply {
  width: 100%; padding: 13px; border-radius: 10px; border: none; cursor: pointer;
  background: #e05252; color: #fff; font-size: .9rem; font-weight: 700;
  letter-spacing: .02em; transition: background .2s;
}
.btn-apply:hover { background: #c0202a; }

/* Gantt task detail modal */
#ganttTaskModal { max-width: 380px; }
.gantt-task-modal-body { background: #fff; border-radius: 20px; overflow: hidden; position: relative; }
.gtm-accent { height: 5px; background: var(--accent); }
.gtm-content { padding: 22px 24px 24px; }
.gtm-title {
  font-size: 1rem; font-weight: 700; color: #1a2332;
  line-height: 1.4; margin-bottom: 20px; padding-right: 24px;
}
.gtm-fields { display: flex; flex-direction: column; gap: 12px; }
.gtm-field { display: flex; align-items: center; gap: 12px; }
.gtm-field-label {
  font-size: .65rem; font-weight: 700; color: #94a3b8;
  letter-spacing: .1em; text-transform: uppercase; width: 68px; flex-shrink: 0;
}
.gtm-field-val { font-size: .88rem; color: #1a2332; font-weight: 500; }
.gtm-field-icon { font-size: .9rem; color: #94a3b8; flex-shrink: 0; }
.gtm-hrs { font-size: 1rem; font-weight: 700; color: var(--accent); }
.gtm-divider { height: 1px; background: #f0f4f8; margin: 4px 0; }

/* Hierarchy modal */
.hier-modal-body { background: #fff; padding: 28px; position: relative; }
.hier-modal-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.hier-modal-icon { font-size: 1.8rem; line-height: 1; flex-shrink: 0; margin-top: 2px; }
.hier-modal-title { font-size: 1rem; font-weight: 700; color: #1a2332; line-height: 1.4; }
.hier-task-id { font-size: .75rem; color: #64748b; margin-top: 4px; font-family: var(--mono); }
/* ── Sidebar team search input ─────────────────────────────── */
.sidebar-team-search {
  width: 100%; padding: 6px 10px; border-radius: 6px; font-size: .8rem; box-sizing: border-box;
  background: #f8fafc; color: var(--text); border: 1px solid var(--border); outline: none;
}
.sidebar-team-search:focus { border-color: var(--accent); }
.sms-items-scroll { max-height: 180px; overflow-y: auto; }
.sms-items-scroll::-webkit-scrollbar { width: 4px; }
.sms-items-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }
.sidebar-team-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; font-size: .82rem; color: var(--text);
  cursor: pointer; transition: background .1s;
}
.sidebar-team-item:hover { background: #f8fafc; }
.sidebar-team-item input[type=checkbox] { accent-color: var(--accent); }

/* ── Raw data team filter ─────────────────────────────────── */
.raw-team-filter-group { flex: 1.4; min-width: 180px; }
.raw-team-multi { position: relative; }
.raw-team-trigger {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-radius: 8px; border: 1px solid #d1d9e6;
  font-size: .83rem; background: #fff; color: #1a2332;
  cursor: pointer; user-select: none; transition: border-color .15s, box-shadow .15s;
}
.raw-team-trigger:hover { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.raw-team-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; width: 280px; z-index: 300;
  background: #fff; border: 1px solid #d1d9e6; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}

.hier-row-num { display: inline-flex; align-items: center; margin-top: 5px; padding: 2px 8px; background: #e0f2fe; color: #0369a1; border: 1px solid #7dd3fc; border-radius: 10px; font-size: .72rem; font-weight: 700; font-family: var(--mono); }
.hier-breadcrumb-wrap {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 16px;
}
.hier-crumb {
  background: #e0f2fe; color: #0369a1; border-radius: 8px;
  padding: 4px 12px; font-size: .78rem; font-weight: 500;
}
.hier-crumb-arrow { color: #94a3b8; font-size: .9rem; }
.hier-task-final {
  background: #eff6ff; color: var(--accent);
  border-radius: 8px; padding: 4px 12px; font-size: .78rem; font-weight: 700;
}
.hier-sheet-label { font-size: .72rem; color: #94a3b8; margin-top: 4px; }
.hier-no-path { font-size: .82rem; color: #94a3b8; font-style: italic; padding: 8px 0; }

/* Resource detail modal */
dialog#resourceModal { max-width: 460px; }
.res-modal-body { background: #fff; padding: 0; position: relative; border-radius: 20px; overflow: hidden; }
.res-modal-header {
  background: #ffffff; padding: 20px 24px; display: flex; align-items: center; gap: 14px; min-height: 72px;
  border-bottom: 2px solid var(--border);
  border-image: linear-gradient(90deg, var(--accent), #7c3aed) 1;
  border-image-slice: 0 0 1 0;
}
#resModalContent { padding: 18px 20px 24px; max-height: 72vh; overflow-y: auto; overflow-x: hidden; }

/* Stats grid */
.res-stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px;
}
.res-stat-card {
  background: #f8fafc; border-radius: 8px; padding: 10px 8px; text-align: center; border: 1px solid #e8edf5;
}
.rsc-lbl { font-size: .58rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 5px; }
.rsc-val { font-size: .95rem; font-weight: 800; color: #1a2332; }

/* Utilisation bar */
.res-util-section { margin-bottom: 12px; }
.res-util-top { display: flex; justify-content: space-between; font-size: .78rem; font-weight: 600; color: #1a2332; margin-bottom: 5px; }
.res-util-track { height: 10px; background: #e8edf5; border-radius: 5px; overflow: hidden; }
.res-util-fill  { height: 100%; border-radius: 5px; transition: width .4s; }

/* Status row */
.res-status-row {
  display: flex; align-items: center; gap: 7px; border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; font-size: .82rem;
}

/* Projects / Sheets */
.res-projects-section { border-top: 1px solid #e8edf5; padding-top: 14px; }
.res-projects-hdr { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.res-projects-lbl { font-size: .65rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .1em; }
.res-shared-badge { font-size: .7rem; color: #0369a1; background: #e0f2fe; border-radius: 10px; padding: 2px 8px; font-weight: 600; }

/* Sheet tabs */
.res-sheet-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.res-sheet-tab {
  padding: 5px 14px; border-radius: 20px; border: 1.5px solid #d1d9e6;
  background: #f8fafc; font-size: .76rem; font-weight: 600; color: #64748b; cursor: pointer; transition: all .15s;
}
.res-sheet-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.res-sheet-tab:hover:not(.active) { border-color: var(--accent); color: var(--accent2); }

/* Sheet detail card */
.sdc { background: #f8fafc; border: 1px solid #e8edf5; border-radius: 12px; padding: 14px 16px; }
.sdc-name { font-size: .88rem; font-weight: 700; color: #1a2332; }
.sdc-full { font-size: .7rem; color: #94a3b8; margin-bottom: 10px; }
.sdc-stats-row { display: flex; gap: 16px; margin-bottom: 10px; }
.sdc-stat { }
.sdc-lbl { font-size: .6rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 3px; }
.sdc-val { font-size: 1.1rem; font-weight: 800; }
.sdc-alloc-lbl { font-size: .7rem; color: #94a3b8; margin-bottom: 5px; }
.sdc-bar-wrap { height: 8px; background: #e8edf5; border-radius: 4px; overflow: hidden; }
.sdc-bar-fill  { height: 100%; border-radius: 4px; }

.res-task-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid #e8edf5;
}
.res-task-row:last-child { border-bottom: none; }
.res-task-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 5px; }
.res-task-name { font-weight: 600; font-size: .82rem; color: #1a2332; }
.res-task-dates { font-size: .72rem; color: #64748b; margin-top: 2px; }
.res-task-hrs { font-size: .72rem; font-weight: 700; color: var(--accent2); margin-top: 2px; }
.res-section-title { font-size: .72rem; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .08em; margin: 14px 0 8px; }

/* ── Resource Skills sidebar button ──────────────────────────────────────── */
.btn-skills-nav {
  width: 100%; padding: 9px 16px; border: 1px solid var(--border); border-radius: 8px;
  background: #fff;
  color: var(--text); font-size: 12.5px; font-weight: 600; cursor: pointer;
  letter-spacing: .01em; transition: all .15s; font-family: var(--sans);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-skills-nav:hover { background: #eff6ff; color: var(--accent); border-color: #bfdbfe; }
.btn-skills-nav svg { flex-shrink: 0; }

/* ── Saved Reports sidebar ─────────────────────────────────────────────── */
.sidebar-search {
  width: 100%; padding: 7px 10px; margin-bottom: 8px; box-sizing: border-box;
  background: #f8fafc; border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 12px; font-weight: 500; outline: none;
  font-family: var(--sans); transition: border-color .15s;
}
.sidebar-search:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(37,99,235,.08); }
.sidebar-search::placeholder { color: #94a3b8; }
.sidebar-search:focus { border-color: var(--accent); }
.saved-reports-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 228px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent;
}
.saved-reports-list::-webkit-scrollbar { width: 4px; }
.saved-reports-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }
.saved-report-item {
  padding: 8px 10px; border-radius: 8px; background: #f8fafc;
  border: 1px solid var(--border); cursor: pointer; transition: background .15s;
}
.saved-report-item:hover { background: #f0f2f5; }
.saved-report-name { font-size: .78rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saved-report-meta { font-size: .68rem; color: #64748b; margin-top: 2px; }
.saved-report-actions { display: flex; gap: 6px; margin-top: 6px; }
.saved-report-actions button {
  flex: 1; padding: 4px 0; border: 1px solid var(--border); background: transparent;
  color: #64748b; border-radius: 5px; font-size: .68rem; cursor: pointer; transition: all .15s;
}
.saved-report-actions button:hover { background: #eff6ff; color: var(--accent); border-color: var(--accent); }
.saved-report-actions .sr-del:hover { background: #fef2f2; color: #f87171; border-color: #f87171; }
.save-report-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; font-size: .75rem; font-weight: 600;
  color: var(--accent); background: rgba(37,99,235,.08); border: 1px solid rgba(37,99,235,.2);
  border-radius: 6px; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.save-report-btn:hover { background: rgba(37,99,235,.15); color: var(--accent2); }

/* ── Sync banner ──────────────────────────────────────────── */
.sync-banner {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 9999;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; border-radius: 10px;
  background: #ffffff; color: var(--text);
  border: 1px solid var(--border);
  font-size: .84rem; font-weight: 500;
  box-shadow: 0 8px 30px rgba(0,0,0,.1);
  animation: syncBannerIn .3s ease;
}
@keyframes syncBannerIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.sync-banner-btn {
  padding: 6px 16px; border-radius: 6px; border: none; cursor: pointer;
  background: var(--accent); color: #fff; font-size: .78rem; font-weight: 700;
  letter-spacing: .02em; white-space: nowrap;
  transition: background .15s;
}
.sync-banner-btn:hover { background: var(--accent2); }
.sync-banner-x {
  background: none; border: none; cursor: pointer;
  color: #94a3b8; font-size: 1.2rem; line-height: 1; padding: 0 2px;
}
.sync-banner-x:hover { color: var(--text); }

/* ══════════════════════════════════════════════════════════════════════════
   Skills Page
   ══════════════════════════════════════════════════════════════════════════ */
.skills-page { padding: 0 0 48px; background: #f8fafc; min-height: 100%; }

/* ── Page header ──────────────────────────────────────────────────────────── */
.skills-page-hdr {
  display: flex; align-items: center; gap: 16px; padding: 14px 24px;
  background: #ffffff; margin-bottom: 0;
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, var(--accent), #7c3aed) 1;
  border-image-slice: 0 0 1 0;
}
.btn-skills-back {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px;
  border: 1px solid var(--border); border-radius: 8px;
  background: transparent; color: var(--text-muted);
  font-size: .78rem; font-weight: 500; cursor: pointer; transition: all .15s;
}
.btn-skills-back:hover { color: var(--text); border-color: #cbd5e1; }
.skills-page-title-group { flex: 1; }
.skills-page-title   { font-size: .95rem; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.skills-page-subtitle { font-size: .68rem; color: #64748b; margin-top: 1px; }
.btn-skills-refresh {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px;
  border: 1px solid rgba(37,99,235,.3); border-radius: 8px;
  background: rgba(37,99,235,.08); color: var(--accent);
  font-size: .78rem; font-weight: 600; cursor: pointer; transition: all .15s;
}
.btn-skills-refresh:hover { background: rgba(37,99,235,.15); }
.btn-skills-scan {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px;
  border: 1px solid var(--border); border-radius: 8px;
  background: transparent; color: var(--text-muted);
  font-size: .78rem; font-weight: 500; cursor: pointer; transition: all .15s;
}
.btn-skills-scan:hover { color: var(--text); border-color: #cbd5e1; }
.btn-skills-scan:disabled { opacity: .4; cursor: not-allowed; }

/* ── Scan toast ───────────────────────────────────────────────────────────── */
.scan-toast {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06); margin: 16px 24px 0;
  overflow: hidden; animation: fadeInDown .2s ease;
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.scan-toast-hdr {
  display: flex; align-items: center; gap: 8px;
  background: #f8fafc; padding: 9px 14px;
  font-size: .78rem; font-weight: 600; color: #334155;
  border-bottom: 1px solid #e8edf5;
}
.scan-toast-hdr.warn { color: #92650a; background: #fffbeb; }
.scan-toast-close {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: #94a3b8; font-size: .8rem; padding: 2px 6px; border-radius: 4px;
}
.scan-toast-close:hover { color: #dc2626; background: #fee2e2; }
.scan-toast-row {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 7px 14px; font-size: .76rem; border-bottom: 1px solid #f4f7fb;
}
.scan-toast-row:last-child { border-bottom: none; }
.scan-toast-row.ok   { color: #065f46; }
.scan-toast-row.skip { color: #64748b; }
.scan-toast-row.err  { color: #b91c1c; }

/* ── Stats row ────────────────────────────────────────────────────────────── */
.skills-stats-row {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 12px;
  padding: 20px 24px 0;
}

/* ── Toolbar (filter bar) ─────────────────────────────────────────────────── */
.skills-filter-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 24px;
  border-bottom: 1px solid #f0f4f8;
  background: #fff; margin-bottom: 16px;
  position: sticky; top: 0; z-index: 10;
}
.skills-search-wrap { position: relative; flex: 1; }
.skills-search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.skills-search-input {
  width: 100%; padding: 8px 12px 8px 34px; border: 1px solid #e2e8f0; border-radius: 8px;
  font-size: .82rem; background: #f8fafc; color: #0f172a; outline: none;
  transition: border-color .15s, background .15s;
}
.skills-search-input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.skills-filter-select {
  padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 8px;
  font-size: .8rem; background: #f8fafc; color: #334155; cursor: pointer; outline: none;
  transition: border-color .15s;
}
.skills-filter-select:focus { border-color: var(--accent); }
.skills-count-label { font-size: .7rem; color: #94a3b8; white-space: nowrap; padding-left: 4px; }

/* ── Resource list ────────────────────────────────────────────────────────── */
.skills-resource-list { padding: 0 24px; display: flex; flex-direction: column; gap: 6px; }
.skills-empty-state {
  padding: 48px 24px; text-align: center; color: #94a3b8;
  font-size: .85rem; background: #fff; border-radius: 12px; border: 1px dashed #e2e8f0;
}
.skills-loading-state {
  padding: 56px 24px; text-align: center; color: #94a3b8; font-size: .85rem;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.skills-loading-spinner {
  width: 28px; height: 28px; border: 2.5px solid #e2e8f0; border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite;
}

/* ── Resource card ────────────────────────────────────────────────────────── */
.skills-res-card {
  background: #fff; border: 1px solid #e8edf3; border-radius: 12px; overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.skills-res-card:hover { border-color: #cbd5e1; box-shadow: 0 2px 12px rgba(0,0,0,.06); }

/* Left-edge status stripe */
.skills-res-card.status-over   { border-left: 3px solid #ef4444; }
.skills-res-card.status-normal { border-left: 3px solid #16a34a; }
.skills-res-card.status-under  { border-left: 3px solid #f59e0b; }
.skills-res-card.status-none   { border-left: 3px solid #e2e8f0; }

/* Card header */
.skills-res-card-hdr {
  display: flex; align-items: center; gap: 13px; padding: 13px 16px;
  cursor: pointer; user-select: none;
}
.skills-res-avatar {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700; color: #fff;
}
.skills-res-info { flex: 1; min-width: 0; }
.skills-res-name { font-weight: 600; font-size: .88rem; color: #0f172a; }
.skills-res-meta { font-size: .7rem; color: #94a3b8; margin-top: 2px; }
.skills-res-badges { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 5px; }

/* Status badge — text only, no pill */
.res-status-badge {
  font-size: .68rem; font-weight: 700; padding: 2px 8px;
  border-radius: 5px; border: 1px solid;
}
.res-skill-badge {
  font-size: .67rem; font-weight: 500; padding: 2px 8px;
  border-radius: 5px; border: 1px solid;
  color: #64748b; background: #f8fafc; border-color: #e2e8f0;
}
.skill-badge-filled { background: #f0fdf9; color: #0d7a6a; border-color: #99f6e4; }
.skill-badge-resume { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.skill-badge-empty  { background: #f8fafc; color: #94a3b8; border-color: #e2e8f0; }

/* Team badge — subtle */
.res-team-badge {
  font-size: .67rem; font-weight: 500; padding: 2px 8px;
  border-radius: 5px; border: 1px solid #e2e8f0;
  color: #64748b; background: #f8fafc;
}

/* Preview chips (collapsed) */
.skills-preview-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.preview-chip {
  padding: 2px 8px; border-radius: 5px; background: #f8fafc; color: #475569;
  font-size: .65rem; font-weight: 500; border: 1px solid #e8edf3;
}
.preview-chip-more { background: #f0fdf9; color: #0d7a6a; border-color: #99f6e4; }

/* Toggle chevron */
.skills-res-toggle {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #94a3b8; border: 1px solid #e8edf3; background: #f8fafc;
  transition: all .15s;
}
.skills-res-toggle svg { transition: transform .2s; }
.skills-res-toggle.open { background: #eff6ff; border-color: #bfdbfe; color: var(--accent); }
.skills-res-toggle.open svg { transform: rotate(180deg); }

/* ── Expanded card body ───────────────────────────────────────────────────── */
.skills-res-body {
  border-top: 1px solid #f4f7fb; padding: 16px 18px 18px;
}

/* Profile strip */
.sk-profile-strip {
  display: flex; flex-wrap: wrap; gap: 0; align-items: stretch;
  margin-bottom: 16px; border: 1px solid #f0f4f8; border-radius: 10px; overflow: hidden;
}
.sk-profile-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 16px; border-right: 1px solid #f0f4f8; min-width: 100px;
  background: #fafbfc;
}
.sk-profile-item:last-child { border-right: none; }
.sk-profile-lbl { font-size: .59rem; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: .08em; }
.sk-profile-val { font-size: .78rem; font-weight: 600; color: #1e293b; line-height: 1.3; }
.sk-profile-sub { font-size: .68rem; color: #64748b; }
.sk-profile-products { display: flex; flex-wrap: wrap; gap: 4px; }
.sk-profile-product-tag {
  padding: 2px 7px; border-radius: 4px;
  background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0;
  font-size: .66rem; font-weight: 600;
}

/* Skills + actions layout */
.skills-res-left  { margin-bottom: 14px; }
.skills-res-right { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.skills-section-title { font-size: .65rem; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: .09em; margin-bottom: 10px; }

/* ── Util inline block ────────────────────────────────────────────────────── */
.skills-util-card {
  flex: 1; min-width: 160px; border: 1px solid #f0f4f8; border-radius: 10px;
  padding: 12px 14px; background: #fafbfc;
}
.skills-util-empty { background: #fafbfc; }
.skills-util-lbl  { font-size: .59rem; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 6px; }
.skills-util-val  { font-size: 1.45rem; font-weight: 800; line-height: 1; color: #94a3b8; }
.skills-util-bar-wrap { background: #f0f4f8; border-radius: 3px; height: 5px; margin: 8px 0 6px; overflow: hidden; }
.skills-util-bar-fill { height: 100%; border-radius: 3px; }
.skills-util-detail { font-size: .67rem; color: #94a3b8; }

/* ── Action buttons ───────────────────────────────────────────────────────── */
.skills-right-btns { display: flex; flex-direction: column; gap: 6px; min-width: 140px; }
.btn-reextract, .btn-edit-skills {
  padding: 8px 14px; border-radius: 8px; font-size: .76rem; font-weight: 600;
  cursor: pointer; border: 1px solid; transition: all .15s; text-align: center; white-space: nowrap;
}
.btn-reextract   { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-edit-skills { background: #fff; color: #334155; border-color: #e2e8f0; }
.btn-reextract:hover   { background: var(--accent2); border-color: var(--accent2); }
.btn-edit-skills:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn-reextract:disabled { opacity: .5; cursor: not-allowed; }

/* ── Skill sections ───────────────────────────────────────────────────────── */
.sk-section { margin-bottom: 8px; }
.sk-section-hdr {
  display: flex; align-items: center; gap: 7px; padding: 6px 2px 6px 0;
  font-size: .65rem; font-weight: 600; color: #64748b;
  text-transform: uppercase; letter-spacing: .07em;
  border-bottom: 1px solid #f0f4f8; margin-bottom: 6px;
}
.sk-core-hdr { color: #92400e; border-bottom-color: #fde68a; }
.sk-section-icon { display: none; } /* removed — noise */
.sk-section-count {
  margin-left: auto; background: #f1f5f9; color: #64748b;
  border-radius: 4px; padding: 1px 6px; font-size: .62rem; font-weight: 700;
}

/* Core skill rows */
.sk-rows-grid { display: flex; flex-direction: column; gap: 1px; }
.sk-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 7px; cursor: default; transition: background .1s;
}
.sk-row:hover { background: #fafbfc; }
.sk-name {
  flex: 1; font-size: .78rem; font-weight: 500; color: #1e293b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sk-prof-badge {
  flex-shrink: 0; font-size: .62rem; font-weight: 600;
  padding: 2px 7px; border-radius: 4px; border: 1px solid; white-space: nowrap;
}
.sk-yrs { flex-shrink: 0; font-size: .64rem; color: #94a3b8; }

/* Non-core chips */
.sk-chip-wrap { display: flex; flex-wrap: wrap; gap: 4px; padding-bottom: 2px; }
.skill-chip2 {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 5px; border: 1px solid;
  font-size: .7rem; font-weight: 500; cursor: default;
}
.chip-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

/* Legacy chip */
.skill-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px;
  border-radius: 5px; border: 1px solid; font-size: .71rem; font-weight: 500;
  margin: 2px 2px 2px 0;
}

.rare-badge {
  font-size: .52rem; background: #fbbf24; color: #1a1a1a;
  border-radius: 3px; padding: 1px 4px; font-weight: 800; margin-left: 3px;
}

/* Empty states */
.sk-empty { color: #94a3b8; font-size: .78rem; padding: 6px 0; }
.sk-empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 24px 16px; color: #94a3b8; font-size: .8rem; text-align: center;
}
.sk-empty-icon { font-size: 1.6rem; }
.skills-no-resume-msg { color: #94a3b8; font-size: .8rem; margin-bottom: 10px; line-height: 1.5; }

.btn-reextract:disabled { opacity: .5; cursor: not-allowed; }
/* Inline button spinner */
.btn-spinner {
  display: inline-block; width: 11px; height: 11px;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: btn-spin .7s linear infinite;
  vertical-align: middle; margin-right: 4px;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ── Toast notifications ─────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  min-width: 280px; max-width: 380px;
  padding: 11px 14px; border-radius: 10px;
  font-size: .82rem; line-height: 1.45; font-weight: 500;
  box-shadow: 0 4px 24px rgba(0,0,0,.12);
  pointer-events: all;
  animation: toast-in .22s ease;
  background: #ffffff; color: var(--text);
  border: 1px solid var(--border);
}
.toast.info    { border-left: 3px solid #3b82f6; }
.toast.success { border-left: 3px solid var(--accent); }
.toast.warning { border-left: 3px solid #f59e0b; }
.toast.error   { border-left: 3px solid #ef4444; }
.toast-icon  { font-size: .95rem; flex-shrink: 0; margin-top: 1px; opacity: .9; }
.toast-msg   { flex: 1; color: var(--text); }
.toast-close { background: none; border: none; color: var(--text-muted); opacity: .7;
               cursor: pointer; font-size: .85rem; padding: 0; line-height: 1; flex-shrink: 0; }
.toast-close:hover { opacity: 1; color: var(--text); }
@keyframes toast-in  { from { opacity:0; transform: translateY(10px); } to { opacity:1; transform: none; } }
@keyframes toast-out { from { opacity:1; } to { opacity:0; transform: translateY(6px); } }

/* Alternatives button in summary table */
.alt-suggest-btn {
  margin-top: 3px; padding: 0; background: none; border: none;
  color: #6366f1; font-size: .6rem; font-weight: 500; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px; white-space: nowrap;
  transition: color .15s;
}
.alt-suggest-btn:hover { color: #4338ca; }

/* Upload Modal */
#uploadResumeModal { max-width: 400px; }
.upload-modal-body {
  background: #ffffff;
  display: flex; flex-direction: column;
}
.upload-modal-header {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  padding: 20px 24px 16px; border-radius: 20px 20px 0 0;
  position: relative; text-align: center;
}
.upload-modal-title {
  font-size: 1rem; font-weight: 800; color: #fff; margin-bottom: 3px;
  justify-content: center;
}
.upload-modal-name {
  font-size: .83rem; color: #c4b5fd; font-weight: 600;
}
.upload-modal-form { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 0; }
.upload-fields { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.upload-field-input {
  padding: 9px 12px; border: 1.5px solid #e2e8f0; border-radius: 9px;
  font-size: .82rem; color: #1a2332; outline: none; width: 100%; background: #f8fafc;
  transition: border-color .15s, background .15s;
}
.upload-field-input:focus { border-color: #6366f1; background: #fff; }
.upload-field-input::placeholder { color: #b0bac8; }
.upload-file-label {
  display: block; padding: 18px; border: 2px dashed #c7d2e0; border-radius: 12px;
  text-align: center; font-size: .82rem; color: #64748b; cursor: pointer;
  transition: all .15s; margin-bottom: 8px; background: #f8fafc;
}
.upload-file-label:hover { border-color: #6366f1; background: #eef2ff; color: #4f46e5; }
.upload-file-info { font-size: .73rem; color: #475569; margin-bottom: 8px; min-height: 16px; }
.upload-modal-msg  { font-size: .8rem; margin-bottom: 10px; min-height: 18px; }
.btn-extract {
  width: 100%; padding: 12px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff; font-size: .88rem; font-weight: 700; cursor: pointer; transition: opacity .15s, transform .1s;
  box-shadow: 0 4px 14px rgba(99,102,241,.35); letter-spacing: .02em;
}
.btn-extract:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.btn-extract:not(:disabled):hover { opacity: .9; transform: translateY(-1px); }
.btn-extract:not(:disabled):active { transform: translateY(0); }

/* Skills Edit Modal */
#skillsEditModal { max-width: 600px; }
.skills-edit-modal-body {
  background: #ffffff;
  max-height: 88vh; overflow-y: auto;
}
.skills-edit-header {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  padding: 20px 24px 16px; border-radius: 20px 20px 0 0;
  position: sticky; top: 0; z-index: 2;
  text-align: center;
}
.skills-edit-title {
  font-size: 1rem; font-weight: 800; color: var(--text); margin-bottom: 2px;
  padding: 0 32px;
}
.skills-edit-hint  { font-size: .75rem; color: #64748b; }
.skills-edit-form  { padding: 20px 24px 24px; }
.skills-edit-table-wrap {
  overflow-x: auto; margin-bottom: 14px;
  border: 1px solid #e8edf5; border-radius: 12px; overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.skills-edit-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.skills-edit-table th {
  padding: 10px 12px; background: #f1f5f9; color: #64748b; font-size: .67rem;
  text-transform: uppercase; letter-spacing: .07em; font-weight: 700;
  text-align: left; border-bottom: 1px solid #e2e8f0; white-space: nowrap;
}
.skills-edit-table td { padding: 7px 6px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.skills-edit-table tr:last-child td { border-bottom: none; }
.skills-edit-table tr:hover td { background: #fafbff; }
.skills-edit-table input[type=text],
.skills-edit-table input[type=number],
.skills-edit-table select {
  width: 100%; padding: 6px 9px; border: 1px solid #e2e8f0; border-radius: 7px;
  font-size: .78rem; outline: none; background: #fff; transition: border-color .15s;
}
.skills-edit-table input:focus, .skills-edit-table select:focus { border-color: #6366f1; }
.btn-del-row {
  padding: 4px 10px; background: #fef2f2; color: #c0202a;
  border: 1px solid #fca5a5; border-radius: 7px; font-size: .72rem; cursor: pointer;
  transition: background .15s;
}
.btn-del-row:hover { background: #fee2e2; }
.skills-edit-actions { display: flex; gap: 10px; align-items: center; }
.btn-add-row {
  padding: 8px 16px; background: #f0fdf4; color: #166534;
  border: 1.5px solid #bbf7d0; border-radius: 9px; font-size: .8rem; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.btn-add-row:hover { background: #dcfce7; }
.btn-save-skills {
  padding: 9px 22px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff; border: none; border-radius: 9px;
  font-size: .85rem; font-weight: 700; cursor: pointer;
  box-shadow: 0 3px 10px rgba(99,102,241,.3);
  transition: opacity .15s, transform .1s;
}
.btn-save-skills:hover { opacity: .9; transform: translateY(-1px); }
.skills-edit-msg { font-size: .78rem; margin-top: 10px; min-height: 18px; }

/* ══════════════════════════════════════════════════════════════════════════
   Alternatives Modal — clean professional design
   ══════════════════════════════════════════════════════════════════════════ */
#altModal { max-width: 540px; border-radius: 18px; }
.alt-modal-body { background: #fff; display: flex; flex-direction: column; max-height: 88vh; border-radius: 18px; overflow: hidden; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.alt-modal-header {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); padding: 20px 24px 18px;
  position: relative; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.alt-modal-header-top { display: flex; align-items: center; gap: 14px; }
.alt-modal-icon {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  background: rgba(37,99,235,.1); border: 1px solid rgba(37,99,235,.2);
  display: flex; align-items: center; justify-content: center; color: var(--accent);
}
.alt-modal-title { font-size: 1rem; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.alt-modal-for   { font-size: .73rem; color: var(--accent); font-weight: 500; margin-top: 3px; opacity: .9; }

/* ── Scrollable area ────────────────────────────────────────────────────── */
.alt-modal-scroll { flex: 1; overflow-y: auto; padding: 20px; background: #f8fafc; }
.alt-modal-scroll::-webkit-scrollbar { width: 4px; }
.alt-modal-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }

/* ── Workload Panel ─────────────────────────────────────────────────────── */
.alt-overload-panel {
  background: #fff; border-radius: 12px; padding: 16px 18px 14px;
  margin-bottom: 16px; border: 1px solid #e8edf3;
}
.alt-overload-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.alt-overload-name   { font-size: .82rem; font-weight: 700; color: #0f172a; }
.alt-overload-badge  {
  font-size: .7rem; font-weight: 700; padding: 3px 10px; border-radius: 6px;
  background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca;
}

/* Three stats */
.alt-over-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 0; margin-bottom: 14px; border: 1px solid #e8edf3; border-radius: 10px; overflow: hidden; }
.alt-over-stat  { padding: 10px 12px; background: #fafbfc; }
.alt-over-stat + .alt-over-stat { border-left: 1px solid #e8edf3; }
.alt-over-stat-val { font-size: .95rem; font-weight: 800; color: #0f172a; letter-spacing: -.02em; }
.alt-over-stat-val.danger { color: #dc2626; }
.alt-over-stat-lbl { font-size: .62rem; color: #94a3b8; font-weight: 500; margin-top: 2px; text-transform: uppercase; letter-spacing: .06em; }

/* Over bar */
.alt-over-bar-track { height: 6px; background: #f1f5f9; border-radius: 999px; overflow: hidden; margin-bottom: 14px; }
.alt-over-bar-fill  { height: 100%; border-radius: 999px; background: #ef4444; transition: width .4s ease; }

/* Tasks */
.alt-tasks-label { font-size: .65rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: #94a3b8; margin-bottom: 8px; }
.alt-task-list   { display: flex; flex-direction: column; gap: 1px; border-radius: 8px; overflow: hidden; border: 1px solid #f0f4f8; }
.alt-task-row    { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: #fff; }
.alt-task-row:not(:last-child) { border-bottom: 1px solid #f4f7fb; }
.alt-task-name {
  flex: 1; font-size: .73rem; font-weight: 500; color: #334155;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.alt-task-project {
  font-size: .62rem; color: #64748b; font-weight: 500;
  white-space: nowrap; flex-shrink: 0; max-width: 130px;
  overflow: hidden; text-overflow: ellipsis;
}
.alt-task-hrs { font-size: .71rem; font-weight: 700; color: #475569; white-space: nowrap; flex-shrink: 0; min-width: 30px; text-align: right; }
.alt-task-dot  { width: 6px; height: 6px; border-radius: 50%; background: #ef4444; flex-shrink: 0; opacity: .5; }
.alt-task-more-btn {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 8px;
  font-size: .68rem; font-weight: 600; color: #64748b; cursor: pointer;
  padding: 5px 10px; border-radius: 6px; background: #f8fafc; border: 1px solid #e2e8f0;
  transition: background .12s, color .12s;
}
.alt-task-more-btn:hover { background: #f1f5f9; color: #334155; }

/* ── Section divider ────────────────────────────────────────────────────── */
.alt-section-divider { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.alt-section-divider-line { flex: 1; height: 1px; background: #e2e8f0; }
.alt-section-divider-text {
  font-size: .62rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: #94a3b8;
}

/* ── Candidate Cards ────────────────────────────────────────────────────── */
.alt-candidate-card {
  background: #fff; border-radius: 12px; margin-bottom: 8px;
  border: 1px solid #e8edf3; transition: border-color .15s, box-shadow .15s;
}
.alt-candidate-card:hover { border-color: #cbd5e1; box-shadow: 0 4px 16px rgba(0,0,0,.07); }
.alt-card-strip      { display: none; } /* removed — rank shown via score number instead */
.alt-card-inner      { padding: 14px 16px; }

/* Card: person row */
.alt-cand-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.alt-cand-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; color: #fff; letter-spacing: .01em;
}
.alt-cand-info { flex: 1; min-width: 0; }
.alt-cand-name { font-weight: 700; font-size: .88rem; color: #0f172a; }
.alt-score-badge {
  flex-shrink: 0; font-size: .72rem; font-weight: 700;
  color: #0f172a; letter-spacing: -.01em;
}
.alt-score-badge::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 5px; vertical-align: middle; }
.alt-score-badge.mid::before { background: #f59e0b; }
.alt-score-badge.low::before { background: #cbd5e1; }

/* Card: availability inline row */
.alt-avail-row  { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.alt-avail-bar-track { flex: 1; height: 4px; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
.alt-avail-bar-fill  { height: 100%; border-radius: 999px; transition: width .4s ease; }
.alt-util-label  { font-size: .68rem; font-weight: 600; flex-shrink: 0; }
.alt-avail-badge {
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
  font-size: .67rem; font-weight: 600; padding: 2px 8px;
  border-radius: 99px; background: #f0fdf9; color: #0f766e; border: 1px solid #99f6e4;
}
.alt-avail-badge.warn { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.alt-avail-badge.low  { background: #fff1f2; color: #9f1239; border-color: #fecdd3; }
.alt-avail-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* Card: projects */
.alt-projects-section { margin-bottom: 10px; }
.alt-section-label { font-size: .6rem; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: #94a3b8; margin-bottom: 5px; }
.alt-projects-row { display: flex; flex-wrap: wrap; gap: 4px; }
.alt-project-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 5px;
  background: #f8fafc; color: #475569; border: 1px solid #e2e8f0;
  font-size: .64rem; font-weight: 500;
}

/* Card: reason */
.alt-cand-reason { font-size: .74rem; color: #64748b; line-height: 1.6; margin-bottom: 10px; }

/* Card: skills */
.alt-skills-divider { height: 1px; background: #f4f7fb; margin-bottom: 9px; }
.alt-cand-skills { display: flex; flex-wrap: wrap; gap: 4px; }
.alt-skill-pill {
  padding: 3px 9px; border-radius: 5px;
  background: #f0fdf9; color: #0f766e; border: 1px solid #ccfbf1;
  font-size: .64rem; font-weight: 500;
}

/* ── States ─────────────────────────────────────────────────────────────── */
.alt-msg {
  font-size: .82rem; color: #94a3b8; padding: 32px 20px; line-height: 1.7;
  text-align: center; background: #fff; border-radius: 12px; border: 1px solid #f1f5f9;
}
.alt-loading {
  text-align: center; padding: 48px 24px; color: #94a3b8; font-size: .83rem;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}

/* Skill chip transition for find alternatives */
.btn-danger-sm { padding: 6px 12px; background: #fde8e8; color: #c0202a; border: 1px solid #f07070; border-radius: 7px; font-size: .76rem; font-weight: 600; cursor: pointer; }

.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   Breakpoints:
     ≤1200px — narrow desktops (5-col metric grid → 3)
     ≤1024px — tablet landscape (shrink paddings, 3 metric cols, tabs scroll)
     ≤768px  — tablet portrait / large phones (sidebar → drawer, filters stack)
     ≤480px  — phones (1-col metrics, full-screen modals, compact header)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Hamburger button — hidden on desktop, visible ≤768px */
.sidebar-toggle {
  display: none;
  width: 36px; height: 36px; background: transparent; border: none;
  cursor: pointer; padding: 0; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  margin-right: 10px; flex-shrink: 0;
}
.sidebar-toggle span {
  display: block; width: 22px; height: 2px; background: #fff;
  border-radius: 2px; transition: transform .2s, opacity .2s;
}
body.sidebar-open .sidebar-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.sidebar-open .sidebar-toggle span:nth-child(2) { opacity: 0; }
body.sidebar-open .sidebar-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Backdrop shown behind the drawer on small screens */
.sidebar-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,.45); z-index: 998;
  opacity: 0; transition: opacity .2s;
}

/* ── ≤1200px: shrink 5-col metric grid → 3 cols ──────────────────────────── */
@media (max-width: 1200px) {
  .metric-row { grid-template-columns: repeat(3, 1fr); }
}

/* ── ≤1024px: tablet landscape ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --sidebar-w: 220px; }
  .metric-row, .period-card, .tab-bar, .tab-panel { margin-left: 16px; margin-right: 16px; }
  .dash-header { padding: 0 16px; }
  .metric-card { padding: 12px; }
  .metric-card .value { font-size: 1.35rem; }

  /* Tab bar scrolls horizontally when tabs overflow */
  .tab-bar { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .tab-bar::-webkit-scrollbar { height: 4px; }
  .tab-btn { flex-shrink: 0; padding: 10px 14px; font-size: .8rem; }

  /* Raw data filter bar shrinks gap */
  .raw-filter-bar { gap: 12px; padding: 12px 14px 10px; }
  .raw-filter-group { min-width: 140px; }

  /* Skills page filters stack */
  .skills-filter-bar { flex-wrap: wrap; gap: 10px; }

  /* Modals — give more breathing room */
  dialog.modal { max-width: 92vw; }
}

/* ── ≤768px: tablet portrait + large phones ──────────────────────────────── */
@media (max-width: 768px) {
  /* Sidebar becomes an off-canvas drawer */
  #app { position: relative; }
  #sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 999;
    width: 280px; min-width: 280px;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,.15);
  }
  body.sidebar-open #sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop {
    display: block; opacity: 1;
  }

  /* Show hamburger */
  .sidebar-toggle { display: flex; }

  /* Header — re-anchor the title so it doesn't collide with the hamburger */
  .dash-header { padding: 0 12px; }
  .dash-header-inner {
    position: static; transform: none;
    flex: 1; justify-content: flex-start;
  }
  .dash-title { font-size: 1rem; }

  /* Main takes full width */
  #main { width: 100%; }

  /* Metric cards — 2 per row */
  .metric-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px; margin-top: 14px; margin-bottom: 14px;
  }
  .metric-row, .period-card, .tab-bar, .tab-panel { margin-left: 12px; margin-right: 12px; }

  /* Period card stacks vertically */
  .period-card {
    flex-direction: column; align-items: flex-start; gap: 10px;
    padding: 12px 14px;
  }
  .period-card-alloc { align-self: stretch; text-align: center; }

  /* Filter bar in raw-data section — each group full width */
  .raw-filter-bar { flex-direction: column; gap: 10px; }
  .raw-filter-group { min-width: 0; width: 100%; }

  /* Tables — horizontal scroll, sticky first column */
  .summary-table-wrap,
  #rawTableWrap {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    border-radius: var(--radius); box-shadow: var(--shadow); background: #fff;
  }
  table.summary-table,
  table.raw-table { min-width: 640px; box-shadow: none; border-radius: 0; }
  table.summary-table th:first-child,
  table.summary-table td:first-child,
  table.raw-table th:first-child,
  table.raw-table td:first-child {
    position: sticky; left: 0; background: #fff; z-index: 1;
    box-shadow: 2px 0 4px rgba(0,0,0,.04);
  }
  table.summary-table th:first-child { background: var(--bg-dark); z-index: 3; }
  table.raw-table th:first-child { background: var(--bg-dark); z-index: 3; }

  /* Make table cells slightly tighter */
  table.summary-table th, table.summary-table td { padding: 10px 12px; }
  table.raw-table th, table.raw-table td { padding: 8px 10px; font-size: .76rem; }
  .util-bar-wrap { width: 80px; }

  /* Skills page — stats stack to 1 col, cards already block-stack */
  .skills-stats-row { grid-template-columns: 1fr !important; }
  .skills-page-hdr { flex-wrap: wrap; gap: 10px; }
  .skills-page-title { font-size: 1.1rem; }

  /* Modals shrink + re-position */
  dialog.modal,
  dialog#confirmModal,
  dialog#saveReportModal,
  dialog#resourceModal {
    max-width: 96vw !important; width: 96vw !important;
    max-height: 88vh !important;
  }

  /* Dropdowns (sheet/team/resource multi-select) fit screen */
  .sms-dropdown, .raw-res-dropdown, .raw-team-dropdown,
  #sidebarTeamDropdown {
    max-width: calc(100vw - 40px);
  }

  /* Sync banner — full-width bottom sheet (reset desktop transform that centers it) */
  .sync-banner {
    left: 12px !important; right: 12px !important; bottom: 12px !important;
    width: auto !important; max-width: none !important;
    transform: none !important;
    justify-content: space-between;
  }
  .sync-banner-btn { flex-shrink: 0; }

  /* Loading card */
  .loading-card { min-width: unset; padding: 24px; width: 86vw; }
}

/* ── ≤480px: phones ─────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .metric-row { grid-template-columns: 1fr; }
  .metric-card .value { font-size: 1.5rem; }

  .dash-header { height: 48px; }
  .dash-title { font-size: .9rem; }

  .metric-row, .period-card, .tab-bar, .tab-panel { margin-left: 8px; margin-right: 8px; }
  .tab-btn { padding: 9px 12px; font-size: .75rem; }

  /* Full-screen modals on phones */
  dialog.modal,
  dialog#confirmModal,
  dialog#saveReportModal,
  dialog#resourceModal {
    width: 100vw !important; max-width: 100vw !important;
    height: 100vh !important; max-height: 100vh !important;
    border-radius: 0 !important;
    top: 0 !important; left: 0 !important;
    transform: none !important;
  }
  dialog.modal .modal-body { border-radius: 0 !important; }

  /* Drawer takes most of the screen */
  #sidebar { width: 86vw; min-width: 86vw; }

  /* Period card text wraps nicely */
  .period-card-value { font-size: .88rem; }
  .period-card-label { font-size: .62rem; }

  /* Skills page header — vertical */
  .skills-page-hdr { flex-direction: column; align-items: stretch; }
  .btn-skills-back, .btn-skills-refresh { width: 100%; justify-content: center; }

  /* Raw row-count smaller */
  .raw-row-count { font-size: .7rem; padding: 6px 10px 2px; }

  /* Loading card tighter */
  .loading-card { padding: 20px; }
  .loading-title { font-size: .9rem; }
  .loading-msg { font-size: .74rem; }
}


/* ── Skill detail modal — minimal, professional ───────────────────────── */

.sk-row-clickable,
.skill-chip-clickable {
  cursor: pointer;
  transition: background-color .12s ease;
}
.sk-row-clickable:hover {
  background: #f8fafc;
}
.skill-chip-clickable:hover {
  filter: brightness(.97);
}

/* info button — sits next to the skill name, clear but not loud */
.sk-info-btn {
  width: 14px;
  height: 14px;
  margin-left: 8px;
  color: #94a3b8;
  flex-shrink: 0;
  vertical-align: -2px;
  transition: color .14s;
  display: inline-block;
}
.sk-row-clickable:hover .sk-info-btn { color: #6366f1; }

.chip-info-btn {
  width: 11px;
  height: 11px;
  margin-left: 4px;
  opacity: .55;
  transition: opacity .14s;
  vertical-align: -1px;
}
.skill-chip-clickable:hover .chip-info-btn { opacity: 1; }

/* overlay — subtle, not heavy */
.reason-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .35);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: reasonFadeIn .12s ease-out;
}
@keyframes reasonFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* modal — generous whitespace, clear hierarchy */
.reason-modal {
  position: relative;
  background: #fff;
  border-radius: 12px;
  width: min(440px, 100%);
  max-height: 80vh;
  overflow-y: auto;
  padding: 28px 28px 24px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, .12),
              0 4px 12px rgba(15, 23, 42, .06);
  animation: reasonSlide .14s ease-out;
}
@keyframes reasonSlide {
  from { transform: translateY(6px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

/* close — top-right, subtle */
.reason-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color .12s, color .12s;
}
.reason-close:hover { color: #475569; background: #f1f5f9; }

/* eyebrow — small label above title */
.reason-eyebrow {
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #94a3b8;
  margin-bottom: 6px;
}

/* skill name — the main thing */
.reason-skill-name {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  line-height: 1.25;
}

/* lead — one sentence explaining provenance, conversational */
.reason-lead {
  font-size: .9rem;
  color: #475569;
  line-height: 1.55;
  margin: 0 0 24px;
  padding: 0;
}
.reason-lead strong {
  color: #0f172a;
  font-weight: 600;
}

/* section — the task list */
.reason-section { margin: 0; }
.reason-section-title {
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: #64748b;
  margin: 0 0 10px;
}

.reason-task-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid #f1f5f9;
}
.reason-task-list li {
  font-size: .88rem;
  color: #1e293b;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  line-height: 1.45;
}
.reason-task-empty {
  color: #94a3b8;
  font-style: italic;
}


/* ── Strengths & Gaps — stacked, header above pills ───────────────── */
.alt-sg-block {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* All-skills section — clearly separated from strengths/gaps above */
.alt-allskills-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
}
.alt-allskills-label {
  margin-bottom: 8px;
}

.alt-sg-section {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* header row: dot + label + count */
.alt-sg-head {
  display: flex;
  align-items: center;
  gap: 7px;
}
.alt-sg-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.alt-sg-strengths .alt-sg-dot { background: #10b981; }
.alt-sg-gaps      .alt-sg-dot { background: #f59e0b; }

.alt-sg-name {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: #475569;
}
.alt-sg-count {
  font-size: .65rem;
  font-weight: 600;
  color: #94a3b8;
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 9px;
  line-height: 1.4;
}

/* pills row */
.alt-sg-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.alt-sg-pill {
  font-size: .72rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 4px;
  line-height: 1.35;
  white-space: normal;
}
.alt-sg-strengths .alt-sg-pill {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.alt-sg-gaps .alt-sg-pill {
  background: #fffbeb;
  color: #854d0e;
  border: 1px solid #fde68a;
}
