/* ─── RetainIQ ─── */
:root {
  --bg-primary: #FAF9F6;
  --bg-secondary: #F0EDE8;
  --bg-card: #FFFFFF;
  --bg-dark: #1E1D1B;
  --bg-dark-mid: #2A2926;
  --bg-dark-light: #353330;
  --text-primary: #1A1A1A;
  --text-secondary: #6B6560;
  --text-muted: #9B9590;
  --text-light: #F5F0EB;
  --text-light-muted: #B8AFA6;
  --accent: #D4714E;
  --accent-hover: #C0613F;
  --accent-light: #F5E6DE;
  --accent-glow: rgba(212, 113, 78, 0.15);
  --border: #E8E2DB;
  --border-light: #F0EDE8;
  --risk-high: #D94F4F;
  --risk-high-bg: #FDEAEA;
  --risk-medium: #D4943E;
  --risk-medium-bg: #FDF3E0;
  --risk-low: #4A9E4A;
  --risk-low-bg: #E8F5E8;
  --risk-none: #7E8FA0;
  --risk-none-bg: #EEF1F5;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.07);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --fs-xs: 0.68rem;
  --fs-sm: 0.78rem;
  --fs-base: 0.88rem;
  --fs-md: 0.95rem;
  --fs-lg: 1.05rem;
  --fs-xl: 1.3rem;
  --row-height: 48px;
  --header-height: 38px;
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg-primary); color: var(--text-primary); min-height: 100vh; -webkit-font-smoothing: antialiased; }

.screen { display: none !important; }
.screen.active { display: block !important; }
#login-screen.active { display: flex !important; }

/* ─── Login ─── */
#login-screen { position: relative; min-height: 100vh; align-items: center; justify-content: center; background: var(--bg-dark); overflow: hidden; }
#login-bg-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; }
.login-container { position: relative; z-index: 2; width: 400px; max-width: 92vw; background: rgba(255,255,255,0.04); backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px); border: 1px solid rgba(255,255,255,0.08); border-radius: 20px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,0.4); }
.login-header { text-align: center; padding: 40px 32px 28px; }
.logo-mark { display: inline-flex; margin-bottom: 18px; animation: logoPulse 3s ease-in-out infinite; }
@keyframes logoPulse { 0%,100% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(212,113,78,0.2)); } 50% { transform: scale(1.05); filter: drop-shadow(0 0 20px rgba(212,113,78,0.4)); } }
.login-title { color: var(--text-light); font-size: 1.5rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.25; }
.login-subtitle { color: var(--text-light-muted); font-size: 0.85rem; margin-top: 8px; }
.login-form { padding: 8px 32px 36px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.78rem; font-weight: 500; color: var(--text-light-muted); margin-bottom: 6px; }
.form-group input { width: 100%; padding: 12px 16px; border: 1.5px solid rgba(255,255,255,0.1); border-radius: 10px; font-size: 0.92rem; font-family: var(--font); background: rgba(255,255,255,0.06); color: var(--text-light); transition: all var(--transition); }
.form-group input::placeholder { color: rgba(255,255,255,0.25); }
.form-group input:focus { outline: none; border-color: var(--accent); background: rgba(255,255,255,0.1); box-shadow: 0 0 0 3px var(--accent-glow); }
.btn-primary { width: 100%; padding: 12px; background: var(--accent); color: #fff; border: none; border-radius: 10px; font-size: 0.95rem; font-weight: 600; font-family: var(--font); cursor: pointer; transition: all var(--transition); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(212,113,78,0.35); }
.error-msg { color: #F07070; font-size: 0.82rem; margin-top: 14px; text-align: center; min-height: 20px; }

/* ─── Header ─── */
.app-header { display: flex; align-items: center; justify-content: space-between; padding: 0 24px; height: 56px; background: var(--bg-dark); position: sticky; top: 0; z-index: 100; }
.header-left { display: flex; align-items: center; gap: 10px; }
.app-title { font-size: 1rem; font-weight: 700; color: var(--text-light); letter-spacing: 0.08em; }
.header-right { display: flex; align-items: center; gap: 16px; }
.user-info { font-size: 0.82rem; color: var(--text-light-muted); }
.btn-logout { padding: 6px 16px; background: rgba(255,255,255,0.07); color: var(--text-light); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-sm); font-size: 0.8rem; font-family: var(--font); cursor: pointer; transition: all var(--transition); font-weight: 500; }
.btn-logout:hover { background: rgba(255,255,255,0.14); }

/* ─── Banner ─── */
.live-banner { position: relative; height: 160px; background: linear-gradient(160deg, var(--bg-dark) 0%, var(--bg-dark-mid) 50%, var(--bg-dark-light) 100%); overflow: hidden; }
.live-banner canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.banner-overlay { position: relative; z-index: 2; height: 100%; display: flex; align-items: center; justify-content: center; padding: 0 24px; }
.stats-row { display: flex; gap: 20px; }
.stat-card { text-align: center; padding: 14px 28px; background: rgba(255,255,255,0.05); border-radius: var(--radius); backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,0.06); min-width: 110px; transition: all var(--transition); }
.stat-card:hover { background: rgba(255,255,255,0.09); transform: translateY(-2px); }
.stat-number { font-size: 1.8rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.stat-label { font-size: 0.66rem; color: var(--text-light-muted); margin-top: 5px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500; }
.stat-high .stat-number { color: #F07070; }
.stat-medium .stat-number { color: #F0C060; }
.stat-low .stat-number { color: #70D070; }
.stat-none .stat-number { color: #90A8C0; }
.stat-total .stat-number { color: var(--text-light); }

/* ─── Toolbar ─── */
.main-content { padding: var(--spacing-lg); max-width: 1400px; margin: 0 auto; }
.toolbar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.toolbar input, .toolbar select { padding: 9px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 0.85rem; font-family: var(--font); background: var(--bg-card); color: var(--text-primary); transition: all var(--transition); appearance: none; -webkit-appearance: none; }
.toolbar input { flex: 1; min-width: 200px; appearance: auto; }
.toolbar select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%239B9590' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; cursor: pointer; min-width: 140px; }
.toolbar input:focus, .toolbar select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

/* ─── Section Headers ─── */
.section-header { font-size: var(--fs-sm); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); padding: var(--spacing-md) 0 var(--spacing-sm); border-bottom: 2px solid var(--accent); margin-bottom: var(--spacing-md); display: flex; align-items: center; gap: var(--spacing-sm); }

/* ─── Tabs ─── */
.tab-bar { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 16px; }
.tab { padding: 10px 22px; background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px; font-size: 0.85rem; font-weight: 600; font-family: var(--font); color: var(--text-muted); cursor: pointer; transition: all var(--transition); }
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ─── Employee Table ─── */
.emp-table { margin-bottom: var(--spacing-lg); }
.data-table-header { display: flex; align-items: center; padding: 0 var(--spacing-lg); height: var(--header-height); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); border-bottom: 2px solid var(--border); background: var(--bg-secondary); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.emp-row { display: flex; align-items: center; padding: var(--spacing-sm) var(--spacing-lg); min-height: var(--row-height); border-bottom: 1px solid var(--border-light); background: var(--bg-card); transition: all var(--transition); }
.emp-row:hover { background: var(--bg-secondary); }
.col-name { flex: 1; min-width: 180px; padding-right: 12px; }
.col-level { width: 55px; text-align: center; flex-shrink: 0; }
.col-system { width: 90px; text-align: center; flex-shrink: 0; }
.col-retention { width: 120px; text-align: center; flex-shrink: 0; }
.col-actions { width: 40px; text-align: center; flex-shrink: 0; }
.col-buttons { width: 150px; display: flex; gap: 6px; justify-content: flex-end; flex-shrink: 0; }
.col-name .name { font-weight: 600; font-size: var(--fs-md); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-name .subtitle { font-size: var(--fs-sm); color: var(--text-secondary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emp-row-level { font-size: var(--fs-sm); font-weight: 600; color: var(--accent); background: var(--accent-light); padding: 3px 10px; border-radius: 12px; white-space: nowrap; }

/* Flag Dots */
.flag-dots { display: flex; gap: 4px; align-items: center; justify-content: center; }
.flag-dot { width: 10px; height: 10px; border-radius: 50%; position: relative; cursor: default; }
.flag-dot::after { content: attr(data-tip); position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--bg-dark); color: var(--text-light); font-size: 0.65rem; padding: 3px 8px; border-radius: 4px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.15s; z-index: 10; }
.flag-dot:hover::after { opacity: 1; }

/* Retention Risk Badges */
.retention-risk-value { font-size: 0.76rem; font-weight: 700; padding: 3px 12px; border-radius: 12px; white-space: nowrap; display: inline-block; }
.rr-high { background: var(--risk-high-bg); color: var(--risk-high); }
.rr-medium { background: var(--risk-medium-bg); color: var(--risk-medium); }
.rr-low { background: var(--risk-low-bg); color: var(--risk-low); }
.rr-not-assessed { background: #F0EDE8; color: var(--text-muted); }

/* Action Count Badge */
.action-count-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; border-radius: 11px; background: var(--accent); color: #fff; font-size: 0.68rem; font-weight: 700; padding: 0 6px; }
.action-count-none { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; color: var(--text-muted); font-size: 0.75rem; }

.btn-view { padding: 6px 12px; background: none; color: var(--text-muted); border: 1px solid var(--border); border-radius: 6px; font-size: 0.72rem; font-weight: 500; font-family: var(--font); cursor: pointer; transition: all var(--transition); white-space: nowrap; }
.btn-view:hover { border-color: var(--text-secondary); color: var(--text-secondary); }

/* ─── Clear Filters ─── */
.btn-clear-filters { padding: 9px 14px; background: none; color: var(--risk-high); border: 1px solid var(--risk-high-bg); border-radius: var(--radius-sm); font-size: 0.78rem; font-weight: 600; font-family: var(--font); cursor: pointer; transition: all var(--transition); white-space: nowrap; }
.btn-clear-filters:hover { background: var(--risk-high-bg); }

/* ─── Upload Zone ─── */
.upload-zone { border: 2px dashed var(--border); border-radius: var(--radius-lg); padding: 60px 40px; text-align: center; cursor: pointer; transition: all var(--transition); background: var(--bg-card); }
.upload-zone:hover, .upload-zone.dragover { border-color: var(--accent); background: var(--accent-light); }
.upload-zone.dragover { transform: scale(1.01); }
.upload-icon { color: var(--text-muted); margin-bottom: var(--spacing-md); }
.upload-zone:hover .upload-icon, .upload-zone.dragover .upload-icon { color: var(--accent); }
.upload-text { font-size: var(--fs-md); font-weight: 600; color: var(--text-primary); margin-bottom: var(--spacing-xs); }
.upload-subtext { font-size: var(--fs-sm); color: var(--text-muted); }

.upload-progress { margin-top: var(--spacing-lg); padding: var(--spacing-lg); background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius); }
.upload-progress-bar { height: 8px; background: var(--bg-secondary); border-radius: 4px; overflow: hidden; margin-bottom: var(--spacing-sm); }
.upload-progress-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.3s ease; width: 0%; }
.upload-progress-text { font-size: var(--fs-sm); color: var(--text-secondary); font-weight: 500; }

.upload-result { margin-top: var(--spacing-lg); padding: var(--spacing-lg); border-radius: var(--radius); font-size: var(--fs-base); }
.upload-result.success { background: var(--risk-low-bg); border: 1px solid var(--risk-low); color: var(--risk-low); }
.upload-result.error { background: var(--risk-high-bg); border: 1px solid var(--risk-high); color: var(--risk-high); }
.upload-result .result-title { font-weight: 700; font-size: var(--fs-md); margin-bottom: var(--spacing-sm); }
.upload-result .result-stats { display: flex; gap: var(--spacing-lg); flex-wrap: wrap; margin-top: var(--spacing-sm); }
.upload-result .result-stat { display: flex; flex-direction: column; align-items: center; }
.upload-result .result-stat .num { font-size: var(--fs-xl); font-weight: 800; }
.upload-result .result-stat .lbl { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; }

/* ─── Loading Spinner ─── */
.loading-overlay { display: flex; align-items: center; justify-content: center; padding: 60px; color: var(--text-muted); font-size: 0.9rem; gap: 10px; }
.spinner { width: 20px; height: 20px; border: 2.5px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Toast ─── */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px); background: var(--bg-dark); color: var(--text-light); padding: 12px 24px; border-radius: var(--radius-sm); font-size: 0.88rem; font-weight: 500; box-shadow: var(--shadow-lg); z-index: 400; opacity: 0; transition: all 0.3s cubic-bezier(0.16,1,0.3,1); pointer-events: none; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── Accessibility ─── */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip-link { position: absolute; top: -40px; left: 0; background: var(--accent); color: #fff; padding: 8px 16px; z-index: 1000; font-size: var(--fs-sm); border-radius: 0 0 var(--radius-sm) 0; }
.skip-link:focus { top: 0; }

/* ─── Modal (Detail View) ─── */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); z-index: 200; overflow-y: auto; padding: 40px 20px; }
.modal.active { display: flex; justify-content: center; align-items: flex-start; }
.modal-content { background: var(--bg-card); border-radius: var(--radius-lg); width: 100%; max-width: 820px; box-shadow: var(--shadow-xl); position: relative; animation: modalIn 0.3s cubic-bezier(0.16,1,0.3,1); }
@keyframes modalIn { from { opacity: 0; transform: translateY(30px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-close { position: absolute; top: 16px; right: 20px; background: var(--bg-secondary); border: none; font-size: 1.3rem; color: var(--text-muted); cursor: pointer; z-index: 10; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: all var(--transition); }
.modal-close:hover { background: var(--border); color: var(--text-primary); }
.detail-header { padding: 28px 28px 22px; border-bottom: 1px solid var(--border-light); display: flex; gap: 18px; align-items: flex-start; }
.detail-avatar { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.15rem; color: #fff; flex-shrink: 0; }
.detail-name { font-size: 1.2rem; font-weight: 700; }
.detail-subtitle { font-size: 0.85rem; color: var(--text-secondary); margin-top: 3px; }
.detail-badges { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.detail-section { padding: var(--spacing-lg) var(--spacing-xl); border-bottom: 1px solid var(--border-light); }
.detail-section:last-child { border-bottom: none; }
.section-title { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: var(--spacing-md); display: flex; align-items: center; gap: var(--spacing-sm); }
.section-title::before { content: ''; width: 3px; height: 14px; background: var(--accent); border-radius: 2px; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.detail-field { padding: 7px 11px; background: var(--bg-primary); border-radius: var(--radius-sm); }
.detail-field label { display: block; font-size: 0.64rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.detail-field span { font-size: 0.86rem; font-weight: 500; color: var(--text-primary); display: block; }
.flag-active { color: var(--risk-high) !important; font-weight: 700 !important; }
.flag-inactive { color: var(--risk-low) !important; }
.emp-badge { font-size: 0.68rem; padding: 2px 9px; border-radius: 20px; font-weight: 600; }
.badge-high { background: var(--risk-high-bg); color: var(--risk-high); }
.badge-medium { background: var(--risk-medium-bg); color: var(--risk-medium); }
.badge-low { background: var(--risk-low-bg); color: var(--risk-low); }
.badge-none, .badge-norisk { background: var(--risk-none-bg); color: var(--risk-none); }
.badge-level { background: var(--accent-light); color: var(--accent); }
.badge-vhp { background: #E8F0FE; color: #1A73E8; }
.hierarchy-chain { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.hierarchy-chain .chain-node { font-size: 0.78rem; padding: 3px 10px; background: var(--bg-secondary); border-radius: 20px; color: var(--text-secondary); font-weight: 500; }
.hierarchy-chain .chain-arrow { color: var(--text-muted); font-size: 0.7rem; }

/* ─── Stat Overdue/Attrited ─── */
.stat-overdue .stat-number { color: #F07070; }
.stat-attrited .stat-number { color: #999; }

/* ─── Responsive ─── */
@media (max-width: 640px) {
  .stats-row { gap: 8px; flex-wrap: wrap; justify-content: center; }
  .stat-card { min-width: 80px; padding: 10px 14px; }
  .emp-row { flex-wrap: wrap; gap: 8px; }
  .toolbar { flex-direction: column; }
  .data-table-header { display: none; }
  .upload-zone { padding: 40px 20px; }
}

/* ─── Two-file Upload Zones ─── */
.upload-zone-small { padding: 30px 20px; }
.upload-zone-small .upload-icon { margin-bottom: var(--spacing-sm); }
.upload-zone-small .upload-text { font-size: var(--fs-sm); }
.upload-zone-small.has-file { border-color: var(--risk-low); background: var(--risk-low-bg); }
.upload-zone-small.has-file .upload-icon { color: var(--risk-low); }
.upload-zone-small.has-file .upload-text { color: var(--risk-low); font-weight: 600; }

/* ─── Action Panel (slide-in from right) ─── */
.action-panel { position: fixed; top: 0; right: -520px; width: 500px; max-width: 95vw; height: 100vh; background: var(--bg-card); box-shadow: -8px 0 30px rgba(0,0,0,0.12); z-index: 250; transition: right 0.3s cubic-bezier(0.16,1,0.3,1); overflow-y: auto; }
.action-panel.open { right: 0; }
.action-panel-content { padding: 24px; }
.action-panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--border-light); }
.action-panel-header h3 { font-size: 1rem; font-weight: 700; }
.action-panel-close { background: var(--bg-secondary); border: none; width: 32px; height: 32px; border-radius: 50%; font-size: 1.2rem; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all var(--transition); }
.action-panel-close:hover { background: var(--border); color: var(--text-primary); }
.action-panel-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.3); z-index: 240; display: none; }
.action-panel-overlay.open { display: block; }

/* Action form */
.panel-form-group { margin-bottom: 14px; }
.panel-form-group label { display: block; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 5px; }
.panel-form-group select, .panel-form-group textarea { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 0.86rem; font-family: var(--font); background: var(--bg-primary); color: var(--text-primary); transition: all var(--transition); }
.panel-form-group select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%239B9590' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; cursor: pointer; }
.panel-form-group textarea { min-height: 80px; resize: vertical; line-height: 1.5; }
.panel-form-group select:focus, .panel-form-group textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.btn-submit-action { width: 100%; padding: 11px; background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm); font-size: 0.88rem; font-weight: 600; font-family: var(--font); cursor: pointer; transition: all var(--transition); margin-bottom: 20px; }
.btn-submit-action:hover { background: var(--accent-hover); }

/* Action log entries */
.panel-section-title { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 10px; padding-top: 8px; border-top: 1px solid var(--border-light); }
.action-entry { position: relative; padding: 12px 14px 12px 30px; background: var(--bg-primary); border: 1px solid var(--border-light); border-radius: var(--radius-sm); margin-bottom: 8px; }
.action-entry::before { content: ''; position: absolute; left: 12px; top: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.action-entry-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.action-lever-name { font-weight: 600; color: var(--accent); font-size: 0.84rem; }
.action-by { font-size: 0.7rem; color: var(--text-muted); background: var(--bg-secondary); padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.action-notes { color: var(--text-secondary); margin-top: 4px; font-size: 0.82rem; line-height: 1.5; }
.action-edit-btn { background: none; border: 1px solid var(--border); border-radius: 5px; padding: 3px 10px; font-size: 0.7rem; color: var(--text-secondary); cursor: pointer; font-family: var(--font); transition: all var(--transition); }
.action-edit-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

/* Follow-up badges */
.followup-badge { font-size: 0.72rem; font-weight: 600; padding: 2px 10px; border-radius: 10px; display: inline-block; }
.followup-active { background: #E8F5E8; color: var(--risk-low); }
.followup-overdue { background: var(--risk-high-bg); color: var(--risk-high); }

/* Mark Done button */
.btn-mark-done { background: none; border: 1px solid var(--risk-low); border-radius: 5px; padding: 3px 10px; font-size: 0.7rem; color: var(--risk-low); cursor: pointer; font-family: var(--font); font-weight: 600; transition: all var(--transition); }
.btn-mark-done:hover { background: var(--risk-low-bg); }

/* Act button */
.btn-act { padding: 6px 16px; background: var(--accent); color: #fff; border: none; border-radius: 6px; font-size: 0.76rem; font-weight: 700; font-family: var(--font); cursor: pointer; transition: all var(--transition); white-space: nowrap; letter-spacing: 0.02em; }
.btn-act:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 3px 10px rgba(212,113,78,0.35); }

/* Edit overlay */
.edit-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.45); backdrop-filter: blur(3px); z-index: 300; display: flex; align-items: center; justify-content: center; animation: fadeIn 0.15s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.edit-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 28px; width: 480px; max-width: 92vw; box-shadow: var(--shadow-xl); }
.edit-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 18px; }
.edit-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.btn-cancel { padding: 9px 20px; background: var(--bg-secondary); color: var(--text-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.86rem; font-family: var(--font); cursor: pointer; }
.btn-save { padding: 9px 24px; background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm); font-size: 0.86rem; font-weight: 600; font-family: var(--font); cursor: pointer; }
.btn-save:hover { background: var(--accent-hover); }

/* ─── Retention Risk Popup ─── */
.rr-popup { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); backdrop-filter: blur(3px); z-index: 300; display: flex; align-items: center; justify-content: center; animation: fadeIn 0.15s ease; }
.rr-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 24px; width: 400px; max-width: 92vw; box-shadow: var(--shadow-xl); }
.rr-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 16px; }
.rr-card .form-group { margin-bottom: 12px; }
.rr-card .form-group label { display: block; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 5px; }
.rr-card select, .rr-card textarea { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 0.86rem; font-family: var(--font); background: var(--bg-primary); }
.rr-card select:focus, .rr-card textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.rr-card textarea { min-height: 60px; resize: vertical; }
.rr-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

/* ─── Scorecard ─── */
.scorecard-row { display: flex; align-items: center; padding: var(--spacing-sm) var(--spacing-lg); min-height: var(--row-height); border-bottom: 1px solid var(--border-light); background: var(--bg-card); transition: all var(--transition); }
.scorecard-row:hover { background: var(--bg-secondary); }
.scorecard-name { flex: 1; font-weight: 600; font-size: var(--fs-md); min-width: 0; }
.scorecard-stat { text-align: center; width: 80px; flex-shrink: 0; }
.scorecard-stat .num { font-weight: 700; font-size: var(--fs-lg); }
.scorecard-stat .lbl { font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.scorecard-stat .num.warn { color: var(--risk-high); }
.scorecard-stat .num.good { color: var(--risk-low); }
.scorecard-bar { width: 100px; height: 6px; background: var(--bg-secondary); border-radius: 3px; overflow: hidden; flex-shrink: 0; }
.scorecard-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.4s ease; }

/* ─── Progress Bar ─── */
.progress-bar { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius); padding: 16px 20px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.progress-item { display: flex; align-items: center; gap: 10px; }
.progress-label { font-size: 0.78rem; color: var(--text-secondary); font-weight: 500; }
.progress-track { width: 120px; height: 8px; background: var(--bg-secondary); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.progress-fill-high { background: linear-gradient(90deg, var(--risk-high), #E87070); }
.progress-fill-all { background: linear-gradient(90deg, var(--accent), #E8956E); }
.progress-text { font-size: 0.78rem; font-weight: 700; color: var(--text-primary); }

/* ─── Comp Risk Dot ─── */
.col-comp { width: 50px; text-align: center; flex-shrink: 0; }
.comp-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.comp-dot.comp-high { background: var(--risk-high); box-shadow: 0 0 0 2px rgba(217,79,79,0.2); }
.comp-dot.comp-medium { background: var(--risk-medium); box-shadow: 0 0 0 2px rgba(212,148,62,0.2); }
.comp-dot.comp-low { background: var(--risk-low); box-shadow: 0 0 0 2px rgba(74,158,74,0.2); }

/* ─── Guide Button ─── */
.btn-guide { padding: 6px 14px; background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm); font-size: 0.8rem; font-family: var(--font); font-weight: 600; cursor: pointer; transition: all var(--transition); display: inline-flex; align-items: center; gap: 4px; }
.btn-guide:hover { background: var(--accent-hover); color: #fff; }

/* ─── OL5 Summary Dashboard ─── */
.ol5-summary { margin-bottom: 20px; }
.ol5-row { display: flex; align-items: center; padding: var(--spacing-sm) var(--spacing-lg); min-height: var(--row-height); border-bottom: 1px solid var(--border-light); background: var(--bg-card); cursor: pointer; transition: all var(--transition); }
.ol5-row:hover { background: var(--bg-secondary); }
.ol5-risk-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; width: 100%; min-width: 80px; }
.ol5-risk-bar .seg-high { background: var(--risk-high); }
.ol5-risk-bar .seg-med { background: var(--risk-medium); }
.ol5-risk-bar .seg-low { background: var(--risk-low); }
.ol5-risk-bar .seg-na { background: #D5D0CA; }
.ol5-coverage-bar { flex: 1; height: 6px; background: var(--bg-secondary); border-radius: 3px; overflow: hidden; }
.ol5-coverage-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.4s ease; }
.ol5-arrow { flex-shrink: 0; opacity: 0.25; margin-left: 4px; }

/* ─── Admin Layout ─── */
.admin-search-bar { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; }
.admin-search-bar input { flex: 1; padding: 10px 16px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 0.88rem; font-family: var(--font); background: var(--bg-card); }
.admin-search-bar input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.admin-l2-header { display: flex; align-items: center; gap: var(--spacing-md); margin-bottom: var(--spacing-lg); }
.admin-l2-title { font-size: var(--fs-lg); font-weight: 700; color: var(--text-primary); }
.admin-back-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; background: var(--bg-secondary); color: var(--text-secondary); border: 1px solid var(--border); border-radius: 6px; font-size: 0.82rem; font-weight: 500; font-family: var(--font); cursor: pointer; transition: all var(--transition); }
.admin-back-btn:hover { border-color: var(--accent); color: var(--accent); }
#admin-level2 { animation: slideIn 0.3s cubic-bezier(0.16,1,0.3,1); }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }

/* ─── VHP Badge ─── */
.vhp-badge { display: inline-block; font-size: 0.62rem; font-weight: 800; color: #fff; background: var(--risk-high); padding: 1px 6px; border-radius: 4px; letter-spacing: 0.04em; vertical-align: middle; margin-left: 6px; }

/* ─── Terminated Badge ─── */
.term-badge { display: inline-block; font-size: 0.58rem; font-weight: 800; color: #fff; background: var(--text-muted); padding: 1px 6px; border-radius: 4px; letter-spacing: 0.04em; vertical-align: middle; margin-left: 6px; }

/* ─── Retention Risk Age ─── */
.retention-risk-age { font-size: 0.56rem; color: var(--text-muted); display: block; margin-top: 1px; text-align: center; }

/* ─── Detail Modal Tabs ─── */
.detail-tabs { display: flex; border-bottom: 2px solid var(--border); padding: 0 var(--spacing-xl); }
.detail-tab { padding: var(--spacing-sm) var(--spacing-md); font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all var(--transition); font-family: var(--font); background: none; border-top: none; border-left: none; border-right: none; }
.detail-tab:hover { color: var(--text-primary); }
.detail-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.detail-tab-content { display: none; }
.detail-tab-content.active { display: block; }

/* ─── Export Button (header) ─── */
.btn-export { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; background: rgba(255,255,255,0.07); color: var(--text-light); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-sm); font-size: 0.8rem; font-weight: 500; font-family: var(--font); cursor: pointer; transition: all var(--transition); white-space: nowrap; }
.btn-export:hover { background: rgba(255,255,255,0.14); }
.btn-export svg { opacity: 0.7; }
.btn-download { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; background: var(--bg-secondary); color: var(--accent); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.72rem; font-weight: 600; font-family: var(--font); cursor: pointer; transition: all var(--transition); white-space: nowrap; }
.btn-download:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-download svg { opacity: 0.8; }

/* ─── User Management Toggle Buttons ─── */
.btn-um-toggle { padding: 3px 12px; border-radius: 10px; font-size: 0.68rem; font-weight: 700; font-family: var(--font); cursor: pointer; transition: all var(--transition); border: 1px solid; min-width: 42px; }
.btn-um-on { background: var(--risk-low-bg); color: var(--risk-low); border-color: var(--risk-low); }
.btn-um-on:hover { background: var(--risk-low); color: #fff; }
.btn-um-off { background: var(--bg-secondary); color: var(--text-muted); border-color: var(--border); }
.btn-um-off:hover { background: var(--border); color: var(--text-secondary); }
