/* =========================================================
1. DESIGN TOKENS: PURE BLACK OLED DARK + CRISP LIGHT MODE
   ========================================================= */
:root {
  color-scheme: dark;
  --bg: #000000;
  --sidebar: #050505;
  --panel: #0c0c0c;
  --panel-hover: #141414;
  --panel-elevated: #18181b;
  --input: #080808;
  --text: #f4f4f5;
  --text-secondary: #d4d4d8;
  --muted: #8a8a93;
  --line: #1f1f23;
  --line-strong: #2e2e34;

  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.14);
  --accent-glow: 0 4px 16px rgba(59, 130, 246, 0.35);

  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.14);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.14);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.14);
  --purple-soft: rgba(168, 85, 247, 0.14);
  --teal: #14b8a6;
  --teal-soft: rgba(20, 184, 166, 0.14);

  --radius-md: 10px;
  --radius-lg: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.75);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.85);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.95);
}

body.light {
  color-scheme: light;
  --bg: #f4f6fa;
  --sidebar: #ffffff;
  --panel: #ffffff;
  --panel-hover: #f1f5f9;
  --panel-elevated: #f8fafc;
  --input: #f8fafc;
  --text: #0f172a;
  --text-secondary: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;

  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.10);
  --accent-glow: 0 4px 14px rgba(37, 99, 235, 0.25);

  --green: #059669;
  --green-soft: rgba(16, 185, 129, 0.12);
  --amber: #d97706;
  --amber-soft: rgba(245, 158, 11, 0.12);
  --red: #dc2626;
  --red-soft: rgba(239, 68, 68, 0.12);
  --purple-soft: rgba(147, 51, 234, 0.10);
  --teal: #0d9488;
  --teal-soft: rgba(20, 184, 166, 0.12);

  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 24px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 18px 38px rgba(15, 23, 42, 0.10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Plus Jakarta Sans', Inter, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, a, input, select, textarea { font: inherit; }
button { cursor: pointer; border: none; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* =========================================================
2. SMOOTH COLOR TRANSITIONS & MONOCHROME SPECULAR GLOW
   ========================================================= */
body, .sidebar, .main, .topbar, .module, .solver-panel, .solver-open-link,
.icon-btn, .nav-item, .module-btn, input, select, textarea, .example-box,
.toast, .cso-overview, .cso-download-center, .analytics-card, .analytics-filter-panel,
.overtime-card, .split-csat-info, .survey-agent-result, .sidebar-api-card {
  transition:
    background-color 0.4s var(--ease),
    border-color 0.4s var(--ease),
    color 0.3s ease,
    box-shadow 0.4s var(--ease),
    transform 0.25s var(--ease);
}

.main {
  position: relative;
  overflow-x: hidden;
  flex: 1;
  min-width: 0;
  padding: 0 36px 56px;
  max-width: 1520px;
  margin: 0 auto;
}

.main::before {
  content: "";
  position: fixed;
  top: -220px;
  left: 50%;
  transform: translateX(-50%);
  width: 920px;
  height: 380px;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.04) 0%, transparent 70%);
  filter: blur(42px);
  pointer-events: none;
  z-index: 0;
}

body.light .main::before {
  background: radial-gradient(ellipse at center, rgba(37, 99, 235, 0.07) 0%, transparent 70%);
}

.main > * {
  position: relative;
  z-index: 1;
}

.module, .analytics-card, .cso-overview, .cso-download-center {
  position: relative;
  overflow: hidden;
}

.module::after, .analytics-card::after, .cso-overview::after, .cso-download-center::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    400px circle at var(--mx, -500px) var(--my, -500px),
    rgba(255, 255, 255, 0.05),
    transparent 45%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 2;
}

body.light .module::after,
body.light .analytics-card::after,
body.light .cso-overview::after,
body.light .cso-download-center::after {
  background: radial-gradient(
    400px circle at var(--mx, -500px) var(--my, -500px),
    rgba(37, 99, 235, 0.06),
    transparent 45%
  );
}

.module:hover::after,
.analytics-card:hover::after,
.cso-overview:hover::after,
.cso-download-center:hover::after {
  opacity: 1;
}

.brand-logo, .solver-generate, .overtime-primary-btn, .analytics-apply {
  background: linear-gradient(120deg, #2563eb, #3b82f6, #0ea5e9, #3b82f6);
  background-size: 240% 240%;
  animation: gradientShift 6s ease infinite;
}

.solver-generate:hover, .overtime-primary-btn:hover, .analytics-apply:hover {
  animation-duration: 2.5s;
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.status-dot.online {
  position: relative;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.status-dot.online::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--green);
  animation: statusPulse 2.2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes statusPulse {
  0%   { transform: scale(0.8); opacity: 0.9; }
  100% { transform: scale(2.1); opacity: 0; }
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.4s;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  .brand-logo, .solver-generate, .overtime-primary-btn, .analytics-apply, .status-dot.online::after {
    animation: none !important;
  }
}

/* =========================================================
3. EXCEL PROGRESS BAR & SKELETON LOADING
   ========================================================= */
.excel-progress-box {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--input);
  animation: panelReveal 0.25s var(--ease);
}

.excel-progress-box[hidden] { display: none !important; }

.excel-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
}

.excel-stage-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 600;
}

.mini-spinner {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(59, 130, 246, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spinLoader 0.75s linear infinite;
  flex-shrink: 0;
}

@keyframes spinLoader {
  to { transform: rotate(360deg); }
}

.excel-percent {
  color: var(--accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.excel-progress-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: #18181b;
  overflow: hidden;
  position: relative;
}

body.light .excel-progress-track { background: #e2e8f0; }

.excel-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #38bdf8, #3b82f6);
  background-size: 200% 100%;
  transition: width 0.35s var(--ease), background 0.3s ease;
  animation: progressShimmer 1.8s linear infinite;
}

.excel-progress-fill.done {
  background: var(--green);
  animation: none;
}

.excel-progress-fill.error {
  background: var(--red);
  animation: none;
}

@keyframes progressShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.excel-file-meta {
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.excel-file-meta span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skeleton-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.skeleton-stack[hidden] { display: none !important; }

.skeleton-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--input);
}

.skeleton-box {
  position: relative;
  overflow: hidden;
  background: #18181b;
  border-radius: 8px;
}

body.light .skeleton-box { background: #e2e8f0; }

.skeleton-box::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.08),
    transparent
  );
  animation: skeletonSweep 1.35s infinite;
}

body.light .skeleton-box::after {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.65),
    transparent
  );
}

@keyframes skeletonSweep {
  100% { transform: translateX(100%); }
}

.sk-icon  { width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; }
.sk-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.sk-title { width: 52%; height: 13px; }
.sk-sub   { width: 78%; height: 10px; }
.sk-grid  { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.sk-stat  { height: 54px; border-radius: 10px; }

/* =========================================================
4. LAYOUT SHELL & SIDEBAR
   ========================================================= */
.app { display: flex; min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  width: 260px;
  height: 100vh;
  flex: 0 0 260px;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 10px 20px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.brand-logo {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 11px;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  box-shadow: var(--accent-glow);
}

.brand-name { font-size: 15px; font-weight: 800; letter-spacing: -0.3px; }
.brand-caption { color: var(--muted); font-size: 11px; font-weight: 500; margin-top: 1px; }

.nav-label {
  margin: 0 12px 8px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.nav-group { display: flex; flex-direction: column; gap: 3px; margin-bottom: 24px; }

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
}

.nav-item:hover { color: var(--text); background: var(--panel-hover); }
.nav-item.active {
  color: var(--accent);
  background: var(--accent-soft);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 22%;
  bottom: 22%;
  width: 3.5px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
}

.nav-icon {
  width: 20px;
  text-align: center;
  font-size: 15px;
  opacity: 0.9;
}

.sidebar-api-card {
  margin-top: auto;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.sidebar-api-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
}

.sidebar-api-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  flex-shrink: 0;
}
.status-dot.offline { background: var(--red); box-shadow: 0 0 8px var(--red); }

.sidebar-api-message {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
}

.sidebar-api-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}

#refreshBtn {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--panel-elevated);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
}
#refreshBtn:hover { border-color: var(--accent); color: var(--accent); }

/* =========================================================
5. TOPBAR
   ========================================================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  margin-bottom: 28px;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

body.light .topbar {
  background: rgba(244, 246, 250, 0.85);
}

.breadcrumb { font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: 4px; }
.breadcrumb span { color: var(--accent); font-weight: 600; }
h1 { margin: 0; font-size: clamp(22px, 2.2vw, 28px); font-weight: 800; letter-spacing: -0.6px; }
.subtitle { margin-top: 4px; color: var(--muted); font-size: 13.5px; }

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.icon-btn:hover { border-color: var(--accent); background: var(--panel-hover); }

/* =========================================================
6. SECTION HEADERS & MODULE CARDS GRID
   ========================================================= */
.section { margin-bottom: 36px; }
.section-header-modern {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.section-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.section-title-main { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -0.3px; }
.section-desc-main { margin: 4px 0 0; font-size: 13px; color: var(--muted); }

.modules {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
  align-items: start;
}

.module {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.module:hover {
  border-color: var(--line-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.module.expanded {
  grid-column: 1 / -1;
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.14), var(--shadow-lg);
  transform: none;
}

.module-top { display: flex; align-items: center; justify-content: space-between; }

.module-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  font-size: 20px;
}
.module-icon.purple { background: var(--purple-soft); }
.module-icon.orange { background: var(--amber-soft); }
.module-icon.teal { background: var(--teal-soft); }

.module-tag {
  color: var(--muted);
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 9px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
}

.module h3 { margin: 18px 0 8px; font-size: 17px; font-weight: 700; letter-spacing: -0.2px; }
.module > p {
  min-height: 42px;
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.module-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.module-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.state-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

.module-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
}

.module-btn.primary { background: var(--accent-soft); color: var(--accent); }
.module-btn.primary:hover { background: var(--accent); color: #fff; }
.module-btn.is-open { background: var(--panel-hover); color: var(--text); border: 1px solid var(--line); }
.module-btn.is-open:hover { border-color: var(--red); color: var(--red); }

/* =========================================================
7. EXPANDED MODULE PANELS
   ========================================================= */
.solver-panel {
  margin-top: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg);
  animation: panelReveal 0.28s var(--ease);
}
.solver-panel[hidden] { display: none !important; }

@keyframes panelReveal {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.solver-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.solver-panel-head h4 { margin: 0; font-size: 15.5px; font-weight: 700; }
.solver-panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }

.solver-panel-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 16px;
}

.solver-panel-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
}

.solver-left, .solver-right { display: flex; flex-direction: column; }

.solver-input-label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
}

.solver-input-label input,
.survey-agent-field input,
.overtime-control,
.analytics-filter select,
.analytics-filter input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
}

.solver-input-label input:focus,
.survey-agent-field input:focus,
.overtime-control:focus,
.analytics-filter select:focus,
.analytics-filter input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}

.solver-input-label small { color: var(--muted); font-size: 11.5px; font-weight: 400; }

.example-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px dashed var(--line-strong);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}
.example-box:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }

.solver-actions { display: flex; gap: 10px; margin-top: 16px; }

.solver-generate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 20px;
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.solver-generate:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45); }
.solver-generate:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.solver-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  background: var(--panel-elevated);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
}
.solver-copy:hover:not(:disabled) { border-color: var(--accent); background: var(--panel-hover); }
.solver-copy:disabled { opacity: 0.45; cursor: not-allowed; }

.solver-message {
  margin: 12px 0 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}

.solver-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 140px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.solver-empty-icon { font-size: 24px; margin-bottom: 8px; opacity: 0.7; }
.solver-empty-state p { margin: 0; font-size: 12.5px; line-height: 1.55; }

.solver-results { display: flex; flex-direction: column; gap: 10px; }
.solver-results[hidden], .solver-empty-state[hidden] { display: none !important; }
.solver-result-heading { font-size: 10.5px; font-weight: 700; letter-spacing: 1px; color: var(--muted); margin-bottom: 2px; text-transform: uppercase; }

.solver-open-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.solver-open-link:hover { border-color: var(--accent); background: var(--panel-hover); transform: translateX(3px); }
.solver-result-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 16px;
  font-weight: 700;
}
.solver-result-text { display: flex; flex: 1; flex-direction: column; gap: 2px; }
.solver-result-text strong { font-size: 13.5px; font-weight: 700; }
.solver-result-text small { font-size: 12px; color: var(--muted); }
.solver-result-arrow { color: var(--muted); font-size: 16px; }
.solver-open-link:hover .solver-result-arrow { color: var(--accent); }

/* =========================================================
8. SPLIT CSAT & SURVEY AGENT
   ========================================================= */
.split-csat-body, .survey-agent-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.split-csat-dropzone, .survey-agent-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 20px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--panel);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.25s ease, background-color 0.25s ease, transform 0.2s ease;
}

.split-csat-dropzone:hover,
.split-csat-dropzone.dragover,
.survey-agent-drop:hover,
.survey-agent-drop.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.split-csat-dropzone.has-file,
.survey-agent-drop.has-file {
  border-style: solid;
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.06);
}

.split-csat-upload-icon, .survey-agent-file-icon { font-size: 28px; }
.split-csat-dropzone strong, .survey-agent-drop strong { font-size: 14px; font-weight: 700; }
.split-csat-dropzone small, .survey-agent-drop small { font-size: 12px; color: var(--muted); }
.split-csat-browse {
  margin-top: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--panel-elevated);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
}

.split-csat-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

.split-csat-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 22px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.split-csat-info[hidden], .survey-agent-result[hidden] { display: none !important; }
.split-csat-info-icon { font-size: 24px; margin-bottom: 10px; }
.split-csat-info strong { font-size: 14.5px; }
.split-csat-info p { margin: 6px 0 16px; font-size: 12.5px; color: var(--muted); }

.split-csat-result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.split-csat-result-stats > div {
  padding: 12px;
  border-radius: 10px;
  background: var(--input);
  border: 1px solid var(--line);
}
.split-csat-result-stats small { display: block; font-size: 11px; color: var(--muted); }
.split-csat-result-stats strong { display: block; margin-top: 4px; font-size: 16px; font-weight: 800; }

.survey-agent-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.survey-agent-field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.survey-agent-actions { margin-top: 16px; }

.survey-agent-status {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}
.survey-agent-status.success { border-color: rgba(16, 185, 129, 0.35); color: var(--green); background: var(--green-soft); }
.survey-agent-status.warning { border-color: rgba(245, 158, 11, 0.35); color: var(--amber); background: var(--amber-soft); }
.survey-agent-status.error { border-color: rgba(239, 68, 68, 0.35); color: var(--red); background: var(--red-soft); }

.survey-agent-processing { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.survey-agent-spinner {
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.survey-agent-result {
  padding: 20px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.survey-agent-result-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.survey-agent-result-head h4 { margin: 0; font-size: 14px; font-weight: 700; }
.survey-agent-result-badge {
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  background: var(--input);
  color: var(--muted);
}

.survey-agent-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.survey-agent-stats > div {
  padding: 10px;
  border-radius: 10px;
  background: var(--input);
  border: 1px solid var(--line);
}
.survey-agent-stats small { display: block; font-size: 10.5px; color: var(--muted); }
.survey-agent-stats strong { display: block; margin-top: 3px; font-size: 15px; font-weight: 800; }
.survey-agent-stats .stat-success strong { color: var(--green); }

.survey-agent-gsheet {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--input);
  border: 1px solid var(--line);
  margin-bottom: 14px;
}
.survey-agent-gsheet-head { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 700; }
.survey-agent-gsheet-badge { padding: 2px 8px; border-radius: 6px; font-size: 11px; background: var(--panel); color: var(--muted); }
.survey-agent-gsheet-badge.success { background: var(--green-soft); color: var(--green); }
.survey-agent-gsheet-badge.warning { background: var(--amber-soft); color: var(--amber); }
.survey-agent-gsheet-stats { display: flex; gap: 20px; margin-top: 8px; font-size: 12px; }
.survey-agent-gsheet-stats small { color: var(--muted); margin-right: 6px; }
.survey-agent-gsheet-detail { margin-top: 6px; font-size: 11.5px; color: var(--muted); }

.survey-agent-downloads { display: flex; gap: 10px; margin-bottom: 14px; }
.survey-agent-downloads button { flex: 1; }

.survey-agent-report-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.survey-agent-report-head h4 { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--text-secondary); }
.survey-agent-report {
  width: 100%;
  min-height: 92px;
  padding: 12px;
  border-radius: 10px;
  background: var(--input);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
  resize: vertical;
}

/* =========================================================
9. OVERTIME CALCULATOR
   ========================================================= */
.overtime-panel-body {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 20px;
  align-items: start;
}

.overtime-card {
  padding: 20px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.overtime-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.overtime-section-heading h4 { margin: 0; font-size: 14.5px; font-weight: 700; }
.overtime-section-heading small { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); }

.overtime-field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.overtime-gapok { margin-bottom: 16px; }

.overtime-entry-heading {
  display: grid;
  grid-template-columns: 1.3fr 1.2fr 0.8fr 36px;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.overtime-rows { display: flex; flex-direction: column; gap: 10px; }
.overtime-entry {
  display: grid;
  grid-template-columns: 1.3fr 1.2fr 0.8fr 36px;
  gap: 10px;
  align-items: center;
}
.overtime-entry .overtime-field span { display: none; }

.overtime-remove-btn {
  width: 36px; height: 42px;
  border-radius: 10px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 18px;
  font-weight: 700;
}
.overtime-remove-btn:hover { background: var(--red); color: #fff; }

.overtime-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.overtime-secondary-btn {
  height: 40px; padding: 0 14px; border-radius: 10px;
  background: var(--panel-elevated); border: 1px solid var(--line);
  color: var(--text); font-size: 12.5px; font-weight: 600;
}
.overtime-secondary-btn:hover { border-color: var(--accent); }

.overtime-primary-btn, .overtime-save-btn {
  height: 40px; padding: 0 18px; border-radius: 10px;
  color: #fff; font-size: 12.5px; font-weight: 700;
}
.overtime-save-btn { background: linear-gradient(135deg, #10b981, #059669); }
.overtime-save-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.overtime-message { margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.overtime-status { padding: 4px 10px; border-radius: 99px; font-size: 11px; font-weight: 700; background: var(--amber-soft); color: var(--amber); }
.overtime-status.saved { background: var(--green-soft); color: var(--green); }

.overtime-result-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.overtime-result-stats > div {
  padding: 12px;
  border-radius: 10px;
  background: var(--input);
  border: 1px solid var(--line);
}
.overtime-result-stats small { display: block; font-size: 11px; color: var(--muted); }
.overtime-result-stats strong { display: block; margin-top: 4px; font-size: 15px; font-weight: 800; }

.overtime-table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--line); }
.overtime-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.overtime-table th { text-align: left; padding: 10px 12px; background: var(--input); color: var(--muted); font-size: 11px; border-bottom: 1px solid var(--line); }
.overtime-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.overtime-table tr:last-child td { border-bottom: 0; }

.overtime-history-filter { display: flex; align-items: end; gap: 10px; margin-bottom: 14px; }
.overtime-history-filter .overtime-field { flex: 1; }
.overtime-history-actions { display: flex; gap: 10px; margin-top: 14px; }
.overtime-delete-row-btn, .overtime-delete-month-btn {
  padding: 6px 10px; border-radius: 8px; background: var(--red-soft); color: var(--red); font-size: 11.5px; font-weight: 600;
}
.overtime-delete-month-btn { height: 40px; padding: 0 14px; font-size: 12.5px; }

/* =========================================================
10. NOTIFICATION POPOVER
   ========================================================= */
#csoNotification { position: relative; }
.cso-notif-trigger {
  position: relative;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: var(--radius-md);
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 16px;
  box-shadow: var(--shadow-sm);
}
.cso-notif-trigger:hover { border-color: var(--accent); }
.cso-notif-count {
  position: absolute; top: -5px; right: -5px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 99px; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 800; display: grid; place-items: center;
}
.cso-notif-count[hidden] { display: none !important; }

.cso-notif-panel {
  position: absolute; right: 0; top: 48px; width: 340px;
  border-radius: var(--radius-lg); background: var(--panel);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  z-index: 60; overflow: hidden;
}
.cso-notif-panel[hidden] { display: none !important; }
.cso-notif-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cso-notif-title { font-size: 13.5px; font-weight: 700; }
.cso-notif-subtitle { font-size: 11px; color: var(--muted); }
.cso-notif-clear { background: transparent; color: var(--accent); font-size: 11.5px; font-weight: 600; }
.cso-notif-list { max-height: 300px; overflow-y: auto; }
.cso-notif-item { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.cso-notif-item.unread { background: var(--accent-soft); }
.cso-notif-icon { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: 11px; flex-shrink: 0; }
.cso-notif-icon.success { background: var(--green-soft); color: var(--green); }
.cso-notif-icon.error { background: var(--red-soft); color: var(--red); }
.cso-notif-icon.warning { background: var(--amber-soft); color: var(--amber); }
.cso-notif-icon.info { background: var(--accent-soft); color: var(--accent); }
.cso-notif-message { font-size: 12.5px; line-height: 1.4; }
.cso-notif-time { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.cso-notif-empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 12px; }

/* =========================================================
11. WORKSPACE META GRID (OVERVIEW & DOWNLOAD CENTER)
   ========================================================= */
.workspace-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 36px;
}

.cso-overview, .cso-download-center {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.cso-overview-header, .cso-dc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.cso-overview-heading, .cso-dc-title { font-size: 16px; font-weight: 700; }
.cso-overview-caption, .cso-dc-caption { font-size: 12px; color: var(--muted); margin-top: 2px; }

.cso-overview-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  background: var(--green-soft);
  color: var(--green);
}

.cso-overview-stats, .cso-dc-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.cso-overview-stat, .cso-dc-stat {
  padding: 13px;
  border-radius: 12px;
  background: var(--input);
  border: 1px solid var(--line);
}

.cso-overview-stat-label, .cso-dc-stat-label { font-size: 11px; font-weight: 600; color: var(--muted); }
.cso-overview-stat-value, .cso-dc-stat-value { margin-top: 4px; font-size: 22px; font-weight: 800; }
.cso-overview-stat-note { margin-top: 2px; font-size: 10.5px; color: var(--muted); }

.cso-overview-lower {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: auto;
}

.cso-overview-section-title { font-size: 12.5px; font-weight: 700; margin-bottom: 10px; color: var(--text-secondary); }
.cso-module-list, .cso-activity-list, .cso-dc-list { display: flex; flex-direction: column; gap: 8px; }

.cso-module-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--input);
  border: 1px solid var(--line);
  font-size: 12px;
}

.cso-module-name { font-weight: 600; }
.cso-module-status { font-size: 11px; font-weight: 700; color: var(--green); }
.cso-module-status.pending { color: var(--amber); }

.cso-activity-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cso-activity-item:last-child { border-bottom: 0; }
.cso-activity-symbol { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: 11px; flex-shrink: 0; }
.cso-activity-symbol.success { background: var(--green-soft); color: var(--green); }
.cso-activity-symbol.error { background: var(--red-soft); color: var(--red); }
.cso-activity-symbol.warning { background: var(--amber-soft); color: var(--amber); }
.cso-activity-symbol.info { background: var(--accent-soft); color: var(--accent); }
.cso-activity-text { font-size: 12px; line-height: 1.4; }
.cso-activity-time { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.cso-overview-empty, .cso-dc-empty { padding: 24px 12px; text-align: center; color: var(--muted); font-size: 12px; }

.cso-dc-heading { display: flex; align-items: center; gap: 12px; }
.cso-dc-heading-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); font-size: 18px; }
.cso-dc-action-btn { height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-elevated); color: var(--muted); font-size: 12px; font-weight: 600; }
.cso-dc-action-btn:hover { color: var(--red); border-color: var(--red); }

.cso-dc-item { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 11px; background: var(--input); border: 1px solid var(--line); }
.cso-dc-file-icon { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); font-size: 16px; flex-shrink: 0; }
.cso-dc-file-info { flex: 1; min-width: 0; }
.cso-dc-file-name { font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.cso-dc-file-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 11px; color: var(--muted); margin-top: 2px; }
.cso-dc-file-module { color: var(--accent); font-weight: 600; }
.cso-dc-download-btn { height: 34px; padding: 0 13px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; }
.cso-dc-download-btn:hover { background: var(--accent); color: #fff; }
.cso-dc-footer { margin-top: auto; padding-top: 14px; font-size: 11px; color: var(--muted); }

/* =========================================================
12. SURVEY ANALYTICS & DYNAMIC VARIABLES
   ========================================================= */
.analytics-page {
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.analytics-heading { margin-bottom: 20px; }
.analytics-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 1.4px; color: var(--accent); margin-bottom: 4px; }
.analytics-heading h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.4px; }
.analytics-heading p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }

.analytics-filter-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1px solid var(--line);
  margin-bottom: 16px;
}

.analytics-filter { display: flex; flex-direction: column; gap: 6px; min-width: 150px; flex: 1; }
.analytics-filter label { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: 0.5px; }

.analytics-apply {
  height: 44px; padding: 0 22px; border-radius: 10px;
  color: #fff; font-size: 13px; font-weight: 700;
}

.analytics-reset {
  height: 44px; padding: 0 16px; border-radius: 10px;
  background: var(--panel-elevated); border: 1px solid var(--line);
  color: var(--muted); font-size: 13px; font-weight: 600;
}

.analytics-period { font-size: 12.5px; color: var(--muted); margin-bottom: 16px; }
.analytics-loading { padding: 36px; text-align: center; color: var(--muted); font-size: 13px; }

.analytics-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.analytics-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.analytics-kpi::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--kpi-accent, var(--accent));
}
.analytics-kpi-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; }
.analytics-kpi-value { margin-top: 10px; font-size: 28px; font-weight: 800; letter-spacing: -0.8px; }
.analytics-kpi-foot { margin-top: 6px; font-size: 12px; color: var(--muted); }
.analytics-up { color: var(--green) !important; }
.analytics-down { color: var(--amber) !important; }

.analytics-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.analytics-wide { margin-bottom: 18px; }
.analytics-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.analytics-card-title { font-size: 15px; font-weight: 700; }
.analytics-card-subtitle { font-size: 12px; color: var(--muted); margin-top: 3px; }

.analytics-history-limit-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 12px;
}

.analytics-history-limit {
  min-width: 105px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.analytics-donut-wrap { display: flex; align-items: center; justify-content: center; min-height: 150px; }

.analytics-chart-switcher {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--input); border: 1px solid var(--line); border-radius: 10px;
}
.analytics-chart-switcher button {
  padding: 6px 11px; border-radius: 7px; background: transparent;
  color: var(--muted); font-size: 11.5px; font-weight: 700;
}
.analytics-chart-switcher button.active {
  background: var(--accent); color: #fff;
}

.analytics-comparison { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.analytics-compare-item { padding: 14px; border-radius: 12px; background: var(--input); border: 1px solid var(--line); }
.analytics-compare-label { font-size: 11px; font-weight: 700; color: var(--muted); }
.analytics-compare-current { display: block; margin-top: 6px; font-size: 20px; font-weight: 800; }
.analytics-compare-diff { display: flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 12px; font-weight: 700; }
.analytics-compare-previous { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }

.analytics-data-status { padding: 18px; border-radius: 12px; background: var(--input); border: 1px solid var(--line); }
.analytics-data-status-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; }
.analytics-data-status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); }
.analytics-data-status-text { margin-top: 8px; font-size: 12.5px; color: var(--muted); line-height: 1.55; }

.repeat-contact-summary { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 18px; }
.repeat-contact-stat { padding: 14px; border-radius: 12px; background: var(--input); border: 1px solid var(--line); }
.repeat-contact-stat-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.repeat-contact-stat-value { margin-top: 6px; font-size: 20px; font-weight: 800; }
.repeat-contact-chart { width: 100%; min-height: 250px; overflow-x: auto; }
.repeat-contact-chart svg { display: block; width: 100%; min-width: 700px; height: 250px; }

.analytics-chart-scroll { overflow-x: auto; }
.analytics-svg { width: 100%; height: auto; }
.analytics-table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); }
.analytics-table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.analytics-table th { text-align: left; padding: 12px 14px; background: var(--input); color: var(--muted); font-size: 11px; font-weight: 700; border-bottom: 1px solid var(--line); }
.analytics-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.analytics-table tr:last-child td { border-bottom: 0; }
.analytics-status { display: inline-flex; padding: 4px 10px; border-radius: 99px; font-size: 11px; font-weight: 700; }
.analytics-status.ok { background: var(--green-soft); color: var(--green); }
.analytics-status.fail { background: var(--amber-soft); color: var(--amber); }

/* DYNAMIC VARIABLES & TUNE-UP (SEARCH, SORT, CROSS-FILTER, EXPORT) */
.analytics-vars-panel {
  margin-bottom: 20px;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}
.analytics-vars-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.analytics-vars-title { font-size: 15px; font-weight: 700; margin: 0; }
.analytics-vars-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.analytics-vars-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.analytics-vars-btn, .analytics-vars-select {
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.analytics-vars-btn:hover { border-color: var(--accent); color: var(--accent); }
.analytics-vars-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.analytics-var-search {
  flex: 1;
  min-width: 210px;
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--text);
  font-size: 12px;
}
.analytics-var-search:focus {
  border-color: var(--accent);
  outline: none;
}
.analytics-crossfilter-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  font-size: 12px;
}
.analytics-crossfilter-banner[hidden] {
  display: none !important;
}
.analytics-crossfilter-clear {
  padding: 4px 10px;
  border-radius: 7px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
}
.analytics-var-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.analytics-var-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.18s ease;
}
.analytics-var-pill:hover { border-color: var(--accent); color: var(--text); }
.analytics-var-pill.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.analytics-var-pill-badge {
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.15);
  font-size: 10px;
  font-weight: 700;
}
.analytics-var-pill.active .analytics-var-pill-badge {
  background: var(--accent);
  color: #ffffff;
}
.analytics-vars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 18px;
}
.analytics-var-card {
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
}
.analytics-var-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.analytics-var-card-title { font-size: 14px; font-weight: 700; }
.analytics-var-card-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.analytics-var-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.analytics-var-mini-select {
  height: 26px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
}
.analytics-var-mini-btn, .analytics-var-mode-btn {
  height: 26px;
  padding: 0 9px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  transition: all 0.18s ease;
}
.analytics-var-mini-btn:hover, .analytics-var-mode-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.analytics-clickable { cursor: pointer; }
.analytics-dimmed { opacity: 0.35; }

/* FOOTER & TOAST */
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(400px, calc(100vw - 32px));
  padding: 13px 18px;
  border-radius: 13px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { border-color: rgba(16, 185, 129, 0.45); }
.toast.warning { border-color: rgba(245, 158, 11, 0.45); }
.toast.error { border-color: rgba(239, 68, 68, 0.45); }

/* =========================================================
13. RESPONSIVE BREAKPOINTS & MICRO-ANIMATIONS
   ========================================================= */
@media (max-width: 1150px) {
  .workspace-meta-grid, .overtime-panel-body { grid-template-columns: 1fr; }
  .analytics-kpis { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .solver-panel-body, .split-csat-body, .survey-agent-body, .analytics-layout { grid-template-columns: 1fr; }
  .repeat-contact-summary { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .app { flex-direction: column; }
  .sidebar {
    position: relative; width: 100%; height: auto; flex-basis: auto;
    padding: 16px; border-right: 0; border-bottom: 1px solid var(--line);
  }
  .brand { margin-bottom: 14px; padding-bottom: 14px; }
  .nav-group { flex-direction: row; overflow-x: auto; margin-bottom: 0; padding-bottom: 4px; }
  .nav-label, .sidebar-api-card { display: none; }
  .nav-item { flex-shrink: 0; }
  .main { padding: 0 18px 48px; }
  .topbar { margin: 0 -18px 24px; padding: 18px; }
  .modules { grid-template-columns: 1fr; }
  .survey-agent-fields, .survey-agent-stats, .analytics-comparison { grid-template-columns: 1fr 1fr; }
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.status-dot.online,
.state-dot.online {
  animation: pulseGlow 2s infinite;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  flex-shrink: 0;
}

.solver-panel:not([hidden]),
.solver-results:not([hidden]) {
  animation: panelReveal 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.example-box,
.solver-copy {
  transition: transform 0.15s ease, background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.example-box:active,
.solver-copy:active {
  transform: scale(0.97);
}

.example-box.copied,
.solver-copy.copied,
button.copied {
  background: var(--green-soft) !important;
  border: 1px solid var(--green) !important;
  color: var(--green) !important;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15) !important;
  transform: scale(0.97);
}

.example-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease;
}

.example-box.copied .example-icon {
  color: var(--green);
  transform: scale(1.08);
}

/* =========================================================
   MODULE CARDS - COMPACT HORIZONTAL
   ========================================================= */

.modules {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.module {
  min-width: 0;
  padding: 18px 18px 14px;
  cursor: pointer;
  transition:
    transform .18s ease,
    border-color .18s ease,
    background .18s ease,
    box-shadow .18s ease;
}

.module:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .20);
}

.module.expanded {
  cursor: default;
  transform: none;
}

.module-top {
  align-items: center;
}

.module-icon {
  width: 38px;
  height: 38px;
  min-width: 38px;
}

.module h3 {
  margin: 12px 0 6px;
  font-size: 15px;
}

.module > p {
  margin-bottom: 12px;
  font-size: 11px;
  line-height: 1.5;
  min-height: 34px;
}

.module-footer {
  margin-top: 10px;
  padding-top: 10px;
}

.module-btn {
  display: none !important;
}

/* Saat modul dibuka, panel kerja tetap normal */
.module.expanded .module-btn {
  display: none !important;
}

/* Tablet */
@media (max-width: 1200px) {
  .modules {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Mobile */
@media (max-width: 760px) {
  .modules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .modules {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   MODULE PANEL HOST
   Panel aktif selalu berada di bawah 5 kartu modul.
   ========================================================= */

.modules {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.module.expanded {
  grid-column: auto !important;
  transform: none;
  box-shadow: var(--shadow-sm);
}

.module-panel-host {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
}

.module-panel-host .solver-panel {
  margin-top: 0;
  width: 100%;
}

/* Saat panel dipindahkan ke host, jangan ikut aturan
   flex/grid dari card asal. */
.module-panel-host > .solver-panel {
  display: block;
}

@media (max-width: 1200px) {
  .modules {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .module-panel-host {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .modules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .module-panel-host {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .modules {
    grid-template-columns: 1fr;
  }

  .module-panel-host {
    grid-column: 1;
  }
}


/* =========================================================
   ACTIVE MODULE STATE
   ========================================================= */

.module {
  position: relative;
  transition:
    transform .2s ease,
    border-color .2s ease,
    background .2s ease,
    box-shadow .2s ease;
}

/* Modul yang sedang aktif */
.module.expanded {
  border-color: rgba(59, 130, 246, .9) !important;
  background: var(--panel-hover);
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, .18),
    0 8px 26px rgba(0, 0, 0, .22);
}

/* Garis indikator di bagian atas */
.module.expanded::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 18px;
  right: 18px;
  height: 2px;
  border-radius: 0 0 4px 4px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(59, 130, 246, .55);
}

/* Judul modul aktif */
.module.expanded h3 {
  font-weight: 800;
  color: var(--text);
}

/* Deskripsi sedikit lebih jelas */
.module.expanded > p {
  color: var(--text);
}

/* Icon modul aktif */
.module.expanded .module-icon {
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, .22),
    0 0 16px rgba(59, 130, 246, .16);
  transform: scale(1.04);
}

/* Status aktif */
.module.expanded .module-state {
  color: var(--accent);
  font-weight: 700;
}

.module.expanded .state-dot {
  box-shadow: 0 0 8px rgba(34, 197, 94, .65);
}

/* Hover modul aktif */
.module.expanded:hover {
  transform: none;
  border-color: rgba(59, 130, 246, 1) !important;
}

/* Dark/light mode tetap smooth */
body.light .module.expanded {
  background: var(--panel-hover);
  border-color: rgba(37, 99, 235, .7) !important;
  box-shadow:
    0 0 0 1px rgba(37, 99, 235, .12),
    0 8px 24px rgba(15, 23, 42, .10);
}


/* =========================================================
   COMMAND CENTER
   ========================================================= */

.command-center {
  margin-bottom: 28px;
}

.cc-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.cc-eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-bottom: 5px;
}

.cc-heading h1 {
  margin: 0;
  font-size: 23px;
  line-height: 1.15;
  font-weight: 850;
  letter-spacing: -0.5px;
}

.cc-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.cc-period {
  flex-shrink: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.cc-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.cc-kpi,
.cc-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.cc-kpi {
  padding: 16px;
  min-width: 0;
}

.cc-kpi::after,
.cc-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,.035),
    transparent 38%
  );
}

.cc-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cc-kpi-label {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .55px;
}

.cc-kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  border-radius: 8px;
  background: var(--input);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.cc-kpi-value {
  margin-top: 13px;
  font-size: 27px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: -0.8px;
}

.cc-kpi-foot {
  margin-top: 8px;
  min-height: 16px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.4;
}

.cc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, .8fr);
  gap: 16px;
  margin-bottom: 16px;
}

.cc-grid-bottom {
  grid-template-columns: 1fr 1fr;
}

.cc-card {
  padding: 18px;
  min-width: 0;
}

.cc-card-head {
  position: relative;
  z-index: 1;
  margin-bottom: 16px;
}

.cc-card-title {
  font-size: 14px;
  font-weight: 750;
}

.cc-card-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.cc-chart {
  min-height: 245px;
}

.cc-chart-scroll {
  overflow-x: auto;
}

.cc-svg {
  display: block;
  width: 100%;
  height: auto;
  min-width: 520px;
}

.cc-comparison {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.cc-compare-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--input);
}

.cc-compare-row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.cc-compare-row strong {
  font-size: 18px;
  font-weight: 850;
}

.cc-compare-row small {
  grid-column: 1 / -1;
  font-size: 10.5px;
  font-weight: 700;
}

.cc-down {
  color: var(--amber);
}

.cc-up {
  color: var(--green);
}

.cc-status-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.cc-status-item {
  padding: 13px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--input);
}

.cc-status-item span {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
}

.cc-status-item strong {
  display: block;
  margin-top: 7px;
  font-size: 19px;
  font-weight: 850;
}

.cc-availability {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--input);
}

.cc-availability-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}

.cc-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 9px rgba(34,197,94,.45);
}

.cc-availability p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

@media (max-width: 1200px) {
  .cc-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cc-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .cc-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .cc-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cc-grid-bottom {
    grid-template-columns: 1fr;
  }

  .cc-status-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .cc-kpis {
    grid-template-columns: 1fr;
  }

  .cc-card {
    padding: 14px;
  }

  .cc-status-grid {
    grid-template-columns: 1fr 1fr;
  }
}


/* =========================================================
   COMMAND CENTER V2
   ========================================================= */

.command-center {
  position: relative;
}

.cc-kpi {
  position: relative;
  overflow: hidden;
}

.cc-kpi::after {
  content: "";
  position: absolute;
  inset: auto -30px -45px auto;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .035;
  pointer-events: none;
}

.cc-card {
  position: relative;
  overflow: hidden;
}

.cc-card > h3 {
  letter-spacing: -.01em;
}

.cc-chart {
  min-height: 360px;
}

.cc-trend-wrap {
  width: 100%;
  min-width: 0;
}

.cc-trend-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 6px;
}

.cc-trend-caption {
  font-size: 12px;
  font-weight: 750;
  color: var(--text);
}

.cc-trend-subcaption {
  margin-top: 4px;
  font-size: 10px;
  color: var(--muted);
}

.cc-trend-latest {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.cc-trend-latest-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.cc-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 7px;
}

.cc-dot-ticket {
  background: #6366f1;
  box-shadow: 0 0 8px rgba(99, 102, 241, .35);
}

.cc-dot-contact {
  background: #14b8a6;
  box-shadow: 0 0 8px rgba(20, 184, 166, .35);
}

.cc-trend-svg {
  display: block;
  width: 100%;
  height: 285px;
  overflow: visible;
  margin-top: 2px;
}

.cc-grid-line {
  stroke: var(--border);
  stroke-width: 1;
  opacity: .55;
}

.cc-axis-label {
  fill: var(--muted);
  font-size: 9px;
  font-weight: 550;
}

.cc-line-ticket,
.cc-line-contact {
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.cc-line-ticket {
  stroke: #6366f1;
}

.cc-line-contact {
  stroke: #14b8a6;
}

.cc-point-ticket,
.cc-point-contact {
  stroke: var(--panel);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.cc-point-ticket {
  fill: #6366f1;
}

.cc-point-contact {
  fill: #14b8a6;
}

.cc-value-label {
  font-size: 10px;
  font-weight: 800;
}

.cc-value-ticket {
  fill: #6366f1;
}

.cc-value-contact {
  fill: #14b8a6;
}

.cc-trend-legend {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: -2px;
  padding-left: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.cc-trend-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.cc-status-grid {
  gap: 10px;
}

.cc-status-grid > div {
  position: relative;
  overflow: hidden;
  transition:
    transform .18s ease,
    border-color .18s ease,
    background .18s ease;
}

.cc-status-grid > div:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: var(--panel-hover);
}

.cc-status-grid > div::after {
  content: "";
  position: absolute;
  right: -22px;
  bottom: -28px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .025;
  pointer-events: none;
}

.cc-availability {
  min-height: 92px;
}

.cc-availability strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.cc-availability strong::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 9px rgba(34, 197, 94, .65);
}

.cc-availability p {
  max-width: 760px;
  line-height: 1.55;
}

@media (max-width: 900px) {
  .cc-trend-head {
    flex-direction: column;
    gap: 8px;
  }

  .cc-trend-latest {
    width: 100%;
  }

  .cc-chart {
    min-height: 340px;
  }
}

@media (max-width: 560px) {
  .cc-trend-svg {
    height: 250px;
  }

  .cc-trend-latest {
    gap: 10px;
  }

  .cc-trend-latest-item {
    font-size: 9px;
  }

  .cc-value-label {
    display: none;
  }

  .cc-trend-legend {
    gap: 12px;
  }
}

body.light .cc-grid-line {
  opacity: .7;
}


/* ============================================================
   PROCESSING HISTORY
   ============================================================ */

.processing-history {
  margin-top: 28px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.ph-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.ph-eyebrow {
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.ph-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  line-height: 1.2;
}

.ph-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.ph-refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 96px;
  height: 38px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform .18s ease,
    border-color .18s ease,
    background .18s ease;
}

.ph-refresh-btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: var(--panel);
}

.ph-refresh-btn:disabled {
  opacity: .55;
  cursor: wait;
  transform: none;
}

.ph-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px 160px;
  gap: 10px;
  margin-bottom: 14px;
}

.ph-limit-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.ph-limit-wrap .ph-filter {
  flex: 1;
  min-width: 0;
}

.ph-search {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel-2);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.ph-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.ph-search > span {
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
}

.ph-search input {
  width: 100%;
  height: 40px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

.ph-search input::placeholder {
  color: var(--muted);
}

.ph-filter {
  width: 100%;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: 0;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.ph-filter:focus {
  border-color: var(--accent);
}

.ph-summary {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.ph-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ph-item {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-2);
  transition:
    border-color .18s ease,
    transform .18s ease,
    box-shadow .18s ease;
}

.ph-item:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  box-shadow: 0 8px 24px rgba(0, 0, 0, .06);
}

.ph-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ph-item-main {
  min-width: 0;
}

.ph-date {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.ph-time {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.ph-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .02em;
}

.ph-status.success {
  color: #15803d;
  background: rgba(34, 197, 94, .11);
}

.ph-status.warning {
  color: #b45309;
  background: rgba(245, 158, 11, .12);
}

.ph-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.ph-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.ph-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
  color: var(--muted);
  font-size: 10px;
}

.ph-stat strong {
  color: var(--text);
  font-weight: 800;
}

.ph-gsheet {
  margin-top: 11px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.ph-gsheet strong {
  color: var(--text);
}

.ph-file {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px;
}

.ph-file-icon {
  flex: 0 0 auto;
  font-size: 13px;
}

.ph-file-name {
  overflow: hidden;
  color: var(--text);
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ph-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 13px;
}

.ph-action-btn {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
  transition:
    border-color .18s ease,
    background .18s ease,
    transform .18s ease;
}

.ph-action-btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: var(--panel-2);
}

.ph-action-btn.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.ph-action-btn.primary:hover {
  filter: brightness(.96);
}

.ph-action-btn:disabled {
  opacity: .5;
  cursor: wait;
  transform: none;
}

.ph-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

.ph-empty-icon {
  margin-bottom: 9px;
  color: var(--accent);
  font-size: 24px;
}

.ph-empty strong {
  color: var(--text);
  font-size: 12px;
}

.ph-empty span {
  margin-top: 4px;
  font-size: 10px;
}

.ph-loading {
  opacity: .7;
  pointer-events: none;
}

@media (max-width: 760px) {
  .processing-history {
    padding: 17px;
    border-radius: 16px;
  }

  .ph-heading {
    flex-direction: column;
  }

  .ph-refresh-btn {
    width: 100%;
  }

  .ph-toolbar {
    grid-template-columns: 1fr;
  }

  .ph-item-top {
    flex-direction: column;
    gap: 9px;
  }

  .ph-status {
    align-self: flex-start;
  }

  .ph-actions {
    justify-content: stretch;
  }

  .ph-action-btn {
    flex: 1;
  }
}
.period-refresh-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.period-refresh-wrap input {
  flex: 1;
  min-width: 0;
}

.period-refresh-btn {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  transition:
    transform .18s ease,
    background .18s ease,
    border-color .18s ease;
}

.period-refresh-btn:hover {
  background: var(--panel-2);
  border-color: var(--accent);
}

.period-refresh-btn:active {
  transform: scale(.94);
}

.period-refresh-btn.is-refreshing {
  animation: periodRefreshSpin .45s ease;
}

@keyframes periodRefreshSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Refresh jam cutoff - Link Generator Solver & Agent */
.period-refresh-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.period-refresh-wrap input {
  flex: 1;
  min-width: 0;
}

.period-refresh-btn {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition:
    transform .18s ease,
    background .18s ease,
    border-color .18s ease,
    color .18s ease;
}

.period-refresh-btn:hover {
  background: var(--panel-hover);
  border-color: var(--accent);
  color: var(--accent);
}

.period-refresh-btn:active {
  transform: scale(.94);
}

.period-refresh-btn.is-refreshing {
  animation: periodRefreshSpin .45s ease;
}

@keyframes periodRefreshSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}


/* Fix ukuran input periode setelah refresh button */
.period-refresh-wrap {
  width: 100%;
}

.period-refresh-wrap input {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
}

.period-refresh-btn {
  flex: 0 0 42px;
}


/* Survey Agent - refresh cutoff */
.survey-agent-cutoff-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.survey-agent-cutoff-row .survey-agent-fields {
  flex: 1 1 auto;
  min-width: 0;
  margin-top: 0;
}

.survey-agent-refresh-btn {
  flex: 0 0 42px;
  margin-bottom: 0;
}

@media (max-width: 700px) {
  .survey-agent-cutoff-row {
    align-items: stretch;
  }

  .survey-agent-cutoff-row .survey-agent-fields {
    grid-template-columns: 1fr;
  }

  .survey-agent-refresh-btn {
    align-self: flex-end;
  }
}


/* ==========================================================================
   UI/UX MODERN ENHANCEMENTS FOR 5 OPERATIONAL MODULES
   ========================================================================== */

/* 1. Global Module Card Enhancements */
.module {
  position: relative;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.28s ease,
              background-color 0.28s ease;
}

.module:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.module.expanded {
  border-color: rgba(59, 130, 246, 0.6) !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2), 0 16px 36px -12px rgba(0, 0, 0, 0.6) !important;
  background: linear-gradient(180deg, var(--panel-hover) 0%, var(--panel) 100%);
}

.module-icon {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.module:hover .module-icon {
  transform: scale(1.08) rotate(2deg);
}

.module-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.state-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulseGreenDot 2s infinite ease-in-out;
}

@keyframes pulseGreenDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}

/* 2. Expanded Panel Container */
.module-panel-host .solver-panel {
  border: 1px solid rgba(59, 130, 246, 0.3);
  box-shadow: 0 14px 40px -12px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(59, 130, 246, 0.15);
  border-radius: 18px;
  background: radial-gradient(120% 120% at 50% 0%, rgba(59, 130, 246, 0.04) 0%, var(--bg) 60%);
  padding: 28px;
  margin-top: 24px;
}

.solver-panel-head {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-strong);
}

.solver-panel-head h4 {
  font-size: 16.5px;
  letter-spacing: -0.01em;
}

/* 3. Link Solver & Link Agent Inputs & Example Pills */
.period-refresh-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.period-refresh-wrap input {
  font-family: inherit;
  font-feature-settings: "tnum";
  letter-spacing: 0.02em;
}

.period-refresh-btn, .survey-agent-refresh-btn {
  background: var(--panel-elevated);
  border: 1px solid var(--line);
  color: var(--text-secondary);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.period-refresh-btn:hover, .survey-agent-refresh-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
  transform: rotate(45deg);
}

.example-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 12px 16px;
  transition: all 0.2s ease;
}

.example-box:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  border-style: solid;
  transform: translateY(-1px);
}

.example-icon {
  font-size: 15px;
  opacity: 0.7;
}

.solver-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  border: 1.5px dashed var(--line);
  border-radius: 14px;
  padding: 30px;
  background: rgba(255, 255, 255, 0.01);
  text-align: center;
}

.solver-open-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  margin-bottom: 12px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.solver-open-link:hover {
  background: var(--panel-hover);
  border-color: var(--accent);
  transform: translateX(4px);
  box-shadow: 0 4px 16px -4px rgba(59, 130, 246, 0.25);
}

.solver-result-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 18px;
}

.solver-result-arrow {
  margin-left: auto;
  font-weight: 700;
  opacity: 0.4;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.solver-open-link:hover .solver-result-arrow {
  opacity: 1;
  transform: translateX(3px);
  color: var(--accent);
}

/* 4. Split CSAT & Survey Agent File Upload Dropzones */
.split-csat-dropzone, .survey-agent-drop {
  border: 2px dashed rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 36px 24px;
  background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.03) 0%, var(--panel) 100%);
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.split-csat-dropzone:hover, .survey-agent-drop:hover,
.split-csat-dropzone.dragover, .survey-agent-drop.dragover {
  border-color: var(--accent);
  background: radial-gradient(circle at 50% 0%, var(--accent-soft) 0%, var(--panel) 100%);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -8px rgba(59, 130, 246, 0.3);
}

.split-csat-upload-icon, .survey-agent-file-icon {
  font-size: 36px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3));
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.split-csat-dropzone:hover .split-csat-upload-icon,
.survey-agent-drop:hover .survey-agent-file-icon {
  transform: scale(1.15) translateY(-3px);
}

.split-csat-browse {
  margin-top: 10px;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--panel-elevated);
  border: 1px solid var(--line-strong);
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  transition: all 0.2s ease;
}

.split-csat-dropzone:hover .split-csat-browse,
.survey-agent-drop:hover .split-csat-browse {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.split-csat-dropzone.has-file, .survey-agent-drop.has-file {
  border-style: solid;
  border-color: rgba(16, 185, 129, 0.5) !important;
  background: radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.1) 0%, var(--panel) 100%) !important;
}

/* Results & Stat Badges */
.split-csat-info, .survey-agent-result {
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  box-shadow: 0 8px 24px -8px rgba(0,0,0,0.4);
}

.split-csat-result-stats > div, .survey-agent-stats > div {
  background: var(--panel-elevated);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.split-csat-result-stats > div:hover, .survey-agent-stats > div:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

/* 5. Perhitungan Lembur Interactive Experience */
.overtime-panel-body {
  gap: 24px;
}

.overtime-card {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 24px;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,0.35);
}

.overtime-card.overtime-history {
  background: linear-gradient(180deg, var(--panel) 0%, rgba(20, 20, 24, 0.6) 100%);
}

.overtime-entry {
  transition: background-color 0.2s ease, transform 0.2s ease;
  padding: 4px;
  border-radius: 10px;
}

.overtime-entry:hover {
  background: rgba(255, 255, 255, 0.02);
}

.overtime-remove-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.overtime-remove-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.overtime-secondary-btn, .overtime-primary-btn, .overtime-save-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.overtime-primary-btn:hover, .overtime-save-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px -4px rgba(59, 130, 246, 0.4);
}

.overtime-save-btn:not(:disabled) {
  animation: readyPulse 2.5s infinite;
}

@keyframes readyPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

.overtime-result-stats > div {
  border-radius: 12px;
  background: var(--panel-elevated);
  border: 1px solid var(--line);
  padding: 12px 16px;
  transition: all 0.2s ease;
}

.overtime-result-stats > div:hover {
  border-color: var(--amber);
  transform: translateY(-2px);
}

.overtime-table {
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.overtime-table th {
  background: var(--panel-elevated);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 12px 14px;
}

.overtime-table td {
  padding: 11px 14px;
  border-top: 1px solid var(--line);
}

.overtime-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}


/* ==========================================================================
   COMPREHENSIVE DASHBOARD UI/UX REFINEMENT
   (Colors, Typography, Sidebar, Topbar, KPI Badges, Tables & Glassmorphism)
   ========================================================================== */

/* 1. Global Refined Color Tokens & Contrast */
:root {
  --bg: #000000;
  --sidebar: #050505;
  --panel: #0a0a0a;
  --panel-hover: #121212;
  --panel-elevated: #161616;
  --input: #050505;
  --text: #f4f4f5;
  --text-secondary: #d4d4d8;
  --muted: #8a8a93;
  --line: #1f1f23;
  --line-strong: #2e2e34;

  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.14);
  --accent-glow: 0 4px 16px rgba(59, 130, 246, 0.35);
}

body.light {
  --bg: #f8fafc;
  --sidebar: #ffffff;
  --panel: #ffffff;
  --panel-hover: #f1f5f9;
  --panel-elevated: #f8fafc;
  --input: #ffffff;
  --text: #0f172a;
  --text-secondary: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.12);
}

/* 2. Typography & Smooth Font Rendering */
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  color: var(--text);
  background-color: var(--bg);
}

h1, h2, h3, h4 {
  color: var(--text);
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(24px, 2.4vw, 30px);
  font-weight: 800;
  line-height: 1.2;
}

.subtitle {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
  max-width: 800px;
}

/* 3. Topbar Glassmorphism & Aesthetics */
.topbar {
  padding: 18px 0;
  margin-bottom: 24px;
  background: rgba(0, 0, 0, 0.85) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--line);
}

body.light .topbar {
  background: rgba(248, 250, 252, 0.85) !important;
}

.breadcrumb {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Theme Toggle Button */
#themeBtn {
  background: var(--panel-elevated);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#themeBtn:hover {
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--accent-soft);
}

/* 4. Sidebar Polish */
.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
}

.brand {
  padding-bottom: 22px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.brand-logo {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

.nav-item {
  font-weight: 600;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 10px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  transform: translateX(3px);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent) !important;
  font-weight: 750;
  border-left: 3px solid var(--accent);
  border-radius: 4px 10px 10px 4px;
}

/* Sidebar API Status Card */
.sidebar-api-card {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel) 0%, rgba(0, 0, 0, 0.8) 100%);
  padding: 14px 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sidebar-api-heading {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.sidebar-api-bottom button {
  background: var(--panel-elevated);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.sidebar-api-bottom button:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: rotate(90deg);
}

/* 5. Command Center & Survey Analytics KPI Polish */
.cc-kpis, .analytics-kpis {
  gap: 16px;
}

.cc-kpi, .analytics-kpi {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, var(--panel) 0%, rgba(0, 0, 0, 0.75) 100%);
  padding: 18px 20px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.cc-kpi:hover, .analytics-kpi:hover {
  transform: translateY(-3px);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 10px 24px -6px rgba(0, 0, 0, 0.5);
}

.cc-kpi-value, .analytics-kpi-value {
  font-size: 30px;
  font-weight: 850;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-top: 8px;
}

.cc-card, .analytics-card {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 8px 30px -10px rgba(0, 0, 0, 0.4);
}

/* Filter Panels */
.analytics-filter-panel, .cso-filter-row {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 18px 22px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.analytics-apply, .cso-filter-apply {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border: none;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  cursor: pointer;
  transition: all 0.2s ease;
}

.analytics-apply:hover, .cso-filter-apply:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

/* 6. High Density Responsive Tables */
.cso-table-wrap, .analytics-table-wrap {
  border-radius: 14px;
  border: 1px solid var(--line);
  overflow: hidden;
}

table {
  width: 100%;
}

th {
  background: var(--panel-elevated) !important;
  color: var(--muted) !important;
  font-weight: 700 !important;
  font-size: 11px !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
  padding: 14px 16px !important;
  border-bottom: 1px solid var(--line-strong) !important;
}

td {
  padding: 13px 16px !important;
  font-size: 13px !important;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--line);
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02) !important;
  color: var(--text) !important;
}

/* 7. Scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}


/* ==========================================================================
   UX ENHANCEMENT LAYER
   Toast v2, Empty/Loading States, Dropzone UX, Sidebar Collapse,
   Keyboard Shortcut Hints, Progress Feedback
   ========================================================================== */

/* ── 1. TOAST NOTIFICATION v2 ── */
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(440px, calc(100vw - 48px));
  padding: 14px 20px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  box-shadow: 0 20px 50px -14px rgba(0, 0, 0, 0.7);
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.toast .toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}

.toast.success .toast-icon { background: var(--green-soft); color: var(--green); }
.toast.warning .toast-icon { background: var(--amber-soft); color: var(--amber); }
.toast.error .toast-icon   { background: var(--red-soft); color: var(--red); }
.toast.info .toast-icon    { background: var(--accent-soft); color: var(--accent); }

.toast.success { border-color: rgba(16, 185, 129, 0.35); }
.toast.warning { border-color: rgba(245, 158, 11, 0.35); }
.toast.error   { border-color: rgba(239, 68, 68, 0.35); }
.toast.info    { border-color: rgba(59, 130, 246, 0.35); }

.toast .toast-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.toast .toast-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
}

.toast .toast-msg {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.4;
}

.toast .toast-progress {
  position: absolute;
  bottom: 0;
  left: 14px;
  right: 14px;
  height: 2px;
  border-radius: 999px;
  overflow: hidden;
}

.toast .toast-progress-bar {
  height: 100%;
  border-radius: 999px;
  animation: toastCountdown var(--toast-duration, 3s) linear forwards;
}

.toast.success .toast-progress-bar { background: var(--green); }
.toast.warning .toast-progress-bar { background: var(--amber); }
.toast.error   .toast-progress-bar { background: var(--red); }
.toast.info    .toast-progress-bar { background: var(--accent); }

@keyframes toastCountdown {
  from { width: 100%; }
  to   { width: 0%; }
}

.toast .toast-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
  margin-left: auto;
}

.toast .toast-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

/* ── 2. ENHANCED EMPTY STATES ── */
.solver-empty-state,
.cso-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: 36px 28px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 16px;
  background: radial-gradient(circle at 50% 30%, rgba(255,255,255,0.02) 0%, transparent 70%);
  text-align: center;
  animation: emptyFadeIn 0.5s ease;
}

@keyframes emptyFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

.solver-empty-icon,
.cso-empty-icon {
  font-size: 42px;
  margin-bottom: 14px;
  opacity: 0.6;
  animation: emptyFloat 3s ease-in-out infinite;
}

@keyframes emptyFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.solver-empty-state p,
.cso-empty-state p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 280px;
}

.cso-empty-state .cso-empty-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 700;
  border: 1px solid rgba(59, 130, 246, 0.25);
  cursor: pointer;
  transition: all 0.2s ease;
}

.cso-empty-state .cso-empty-cta:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}

/* ── 3. ENHANCED PROGRESS / LOADING ── */
.excel-progress-box {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  background: var(--panel);
  margin-top: 16px;
  animation: panelReveal 0.3s ease;
}

.excel-progress-track {
  height: 6px;
  border-radius: 999px;
  background: var(--panel-elevated);
  overflow: hidden;
  margin: 10px 0;
}

.excel-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #818cf8);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.excel-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: progressShimmer 1.5s infinite;
}

@keyframes progressShimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

.excel-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.excel-stage-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.excel-percent {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent);
  font-feature-settings: "tnum";
}

.excel-file-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--muted);
}

.mini-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* Skeleton shimmer upgrade */
.skeleton-box {
  background: var(--panel-elevated) !important;
  border-radius: 8px;
}

.skeleton-box::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.06) 50%,
    transparent 100%
  ) !important;
}

/* ── 4. DROPZONE ENHANCED FEEDBACK ── */
.split-csat-dropzone,
.survey-agent-drop {
  position: relative;
  overflow: hidden;
}

.split-csat-dropzone::before,
.survey-agent-drop::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 50%, transparent 30%, rgba(59, 130, 246, 0.08) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.split-csat-dropzone.dragover::before,
.survey-agent-drop.dragover::before {
  opacity: 1;
  animation: dropzoneRipple 1.2s ease-in-out infinite;
}

@keyframes dropzoneRipple {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50%      { transform: scale(1.02); opacity: 1; }
}

/* File selected success state */
.split-csat-dropzone.has-file .split-csat-upload-icon,
.survey-agent-drop.has-file .survey-agent-file-icon {
  animation: fileSelectedBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fileSelectedBounce {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.3); }
  70%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}

/* ── 5. FORM INPUT POLISH ── */
.solver-input-label input,
.survey-agent-field input,
.overtime-control,
.analytics-filter select,
.analytics-filter input {
  transition: border-color 0.2s ease,
              box-shadow 0.2s ease,
              background-color 0.2s ease;
}

.solver-input-label input:focus,
.survey-agent-field input:focus,
.overtime-control:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-soft), 0 4px 12px rgba(59, 130, 246, 0.15) !important;
  background: var(--panel-hover);
}

/* Input validation states */
input:invalid:not(:placeholder-shown) {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px var(--red-soft) !important;
}

/* ── 6. SIDEBAR COLLAPSE ── */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 60;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.sidebar-toggle:hover {
  background: var(--panel-hover);
  border-color: var(--accent);
}

@media (max-width: 1024px) {
  .sidebar-toggle { display: flex; }

  .sidebar {
    position: fixed !important;
    left: 0;
    top: 0;
    height: 100vh !important;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.5);
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }

  .sidebar-backdrop.show {
    display: block;
    animation: fadeIn 0.25s ease;
  }

  .main {
    padding-left: 24px !important;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── 7. KEYBOARD SHORTCUT HINTS ── */
.kbd-hint-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.kbd-hint-overlay.show { display: flex; }

.kbd-hint-card {
  width: 480px;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.7);
  animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.kbd-hint-card h3 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 800;
}

.kbd-hint-card .kbd-subtitle {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 20px;
}

.kbd-section {
  margin-bottom: 18px;
}

.kbd-section-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.kbd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.kbd-row:last-child { border-bottom: none; }

.kbd-row .kbd-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.kbd-keys {
  display: flex;
  gap: 4px;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 26px;
  padding: 0 8px;
  border-radius: 7px;
  background: var(--panel-elevated);
  border: 1px solid var(--line-strong);
  box-shadow: 0 1px 2px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

/* ── 8. GLOBAL ACTION BUTTON REFINEMENT ── */
.solver-generate,
.overtime-primary-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
  border: none !important;
  color: #fff !important;
  font-weight: 700 !important;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  position: relative;
  overflow: hidden;
}

.solver-generate::before,
.overtime-primary-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
  pointer-events: none;
}

.solver-generate:hover,
.overtime-primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.5) !important;
}

.solver-generate:active,
.overtime-primary-btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3) !important;
}

.solver-copy {
  background: var(--panel-elevated) !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: 10px;
  color: var(--text) !important;
  font-weight: 600;
  transition: all 0.2s ease;
}

.solver-copy:hover {
  border-color: var(--accent) !important;
  background: var(--accent-soft) !important;
  color: var(--accent) !important;
}

/* ── 9. SOLVER MESSAGE STATUS FEEDBACK ── */
.solver-message,
.overtime-message {
  font-size: 12.5px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  margin-top: 12px;
  line-height: 1.5;
  transition: all 0.25s ease;
}

/* ── 10. SECTION EYEBROW POLISH ── */
.section-eyebrow,
.cc-eyebrow,
.analytics-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.section-eyebrow::before,
.cc-eyebrow::before,
.analytics-eyebrow::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
}


/* ==========================================================================
   SURVEY AGENT UI/UX ENHANCEMENTS & REVISION
   ========================================================================== */

/* 1. Header & Result Badge Styling */
.survey-agent-result-badge {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  border: 1px solid var(--line);
  transition: all 0.25s ease;
}

.survey-agent-result-badge.success {
  background: var(--green-soft) !important;
  color: var(--green) !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.survey-agent-result-badge.processing {
  background: var(--accent-soft) !important;
  color: var(--accent) !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
  animation: badgePulse 1.8s infinite;
}

@keyframes badgePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* 2. Survey Agent Stats Grid */
.survey-agent-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.survey-agent-stats > div {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--panel-elevated);
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.2s ease;
}

.survey-agent-stats > div:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.4);
}

.survey-agent-stats small {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.survey-agent-stats strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -0.02em;
  color: var(--text);
  font-feature-settings: "tnum";
}

.survey-agent-stats .stat-success {
  border-color: rgba(16, 185, 129, 0.25);
  background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.08) 0%, var(--panel-elevated) 100%);
}

.survey-agent-stats .stat-success strong {
  color: var(--green);
}

/* 3. Google Sheets Integration Card */
.survey-agent-gsheet {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--panel-elevated);
  border: 1px solid var(--line);
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.survey-agent-gsheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.survey-agent-gsheet-title {
  font-size: 12.5px;
  font-weight: 750;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.survey-agent-gsheet-badge {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--muted);
}

.survey-agent-gsheet-badge.success {
  background: var(--green-soft);
  color: var(--green);
  border-color: rgba(16, 185, 129, 0.3);
}

.survey-agent-gsheet-badge.warning {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: rgba(245, 158, 11, 0.3);
}

.survey-agent-gsheet-stats {
  display: flex;
  gap: 20px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.survey-agent-gsheet-stats > div {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.survey-agent-gsheet-stats small {
  color: var(--muted);
}

.survey-agent-gsheet-stats strong {
  color: var(--text);
  font-weight: 750;
}

.survey-agent-gsheet-detail {
  margin-top: 8px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
}

/* 4. Action Buttons & Download Row */
.survey-agent-downloads {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.survey-agent-downloads button {
  height: 42px;
  font-size: 12.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.survey-agent-downloads button:not(:disabled) {
  border-color: rgba(59, 130, 246, 0.4);
  background: var(--panel-elevated);
  color: var(--text);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  animation: downloadBtnReady 2.2s infinite ease-in-out;
}

@keyframes downloadBtnReady {
  0%, 100% { border-color: rgba(59, 130, 246, 0.3); }
  50% { border-color: var(--accent); box-shadow: 0 4px 16px var(--accent-soft); }
}

.survey-agent-downloads button:not(:disabled):hover {
  background: var(--accent-soft);
  color: var(--accent);
  transform: translateY(-2px);
}

/* 5. WA Report Area */
.survey-agent-report-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--panel-elevated);
}

.survey-agent-report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.survey-agent-report-head h4 {
  margin: 0;
  font-size: 12.5px;
  font-weight: 750;
  color: var(--text);
}

.survey-agent-report {
  width: 100%;
  min-height: 120px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text-secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.55;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.survey-agent-report:focus {
  border-color: var(--accent);
  color: var(--text);
  outline: none;
}



/* =========================================================
   RESUME FEEDBACK CSAT SOLVER
   ========================================================= */
.resume-feedback-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 4px;
}

.resume-feedback-upload {
  min-width: 0;
}

.resume-feedback-upload .split-csat-dropzone {
  min-height: 178px;
  height: 100%;
  box-sizing: border-box;
}

.resume-feedback-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.resume-feedback-actions button {
  min-width: 230px;
}

.resume-feedback-actions button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.resume-feedback-info {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.resume-feedback-info-icon {
  font-size: 25px;
}

.resume-feedback-info strong {
  font-size: 13.5px;
}

.resume-feedback-info p {
  margin: 5px 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.resume-feedback-result {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(16, 185, 129, .35);
  border-radius: 12px;
  background: var(--green-soft);
  color: var(--text);
}

.resume-feedback-result > strong {
  color: var(--green);
  font-size: 13px;
}

.resume-feedback-result > small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}

.resume-feedback-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.resume-feedback-stats > div {
  padding: 10px;
  border-radius: 9px;
  background: var(--panel);
}

.resume-feedback-stats small,
.resume-feedback-stats b {
  display: block;
}

.resume-feedback-stats small {
  color: var(--muted);
  font-size: 10.5px;
}

.resume-feedback-stats b {
  margin-top: 4px;
  font-size: 18px;
}

@media (max-width: 700px) {
  .resume-feedback-body {
    grid-template-columns: 1fr;
  }

  .resume-feedback-stats {
    grid-template-columns: 1fr 1fr;
  }

  .resume-feedback-actions button {
    width: 100%;
  }
}

/* =========================================================
   FIX SIMETRI GRID MODUL - 3 kolom x 2 baris
   Ditaruh paling bawah supaya menang atas aturan lama
   yang masih repeat(5, ...) di tengah file.
   Penyebab asimetri: .modules di-override jadi 5 kolom,
   jadi 5 kartu di baris 1 dan Perhitungan Lembur sendirian
   di baris 2. align-items:start + footer margin-top:10px
   juga bikin tinggi kartu beda-beda.
   ========================================================= */

.modules {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.module {
  height: 100%;
}

/* Judul 2 baris (Resume Feedback CSAT Solver) tidak bikin kartu lebih tinggi */
.module h3 {
  min-height: 2.4em;
  line-height: 1.25;
}

.module > p {
  flex: 1;
  min-height: 48px;
}

.module-footer {
  margin-top: auto !important;
  padding-top: 14px;
}

/* Panel yang dibuka tetap selebar grid */
.module-panel-host {
  grid-column: 1 / -1;
}

@media (max-width: 1200px) {
  .modules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .modules {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* =========================================================
   UI/UX - ANIMASI GRAFIK + PALETTE CHART
   Palet: Tiket INC #818cf8 (indigo lembut), Kontak Survey
   #2dd4bf (teal), biru #60a5fa, kuning #fbbf24, pink #f472b6.
   Warna-warna ini sama dengan ANALYTICS_VAR_COLORS di app.js,
   jadi legenda dan grafik tidak nabrak. Global --accent tidak
   diubah supaya tema terang/gelap tetap aman.
   ========================================================= */

:root {
  --chart-ticket: #818cf8;
  --chart-contact: #2dd4bf;
  --chart-blue: #60a5fa;
  --chart-amber: #fbbf24;
  --chart-pink: #f472b6;
}

/* --- Warna trend Command Center diselaraskan dengan app.js --- */
.cc-dot-ticket { background: var(--chart-ticket); box-shadow: 0 0 8px rgba(129, 140, 248, .35); }
.cc-dot-contact { background: var(--chart-contact); box-shadow: 0 0 8px rgba(45, 212, 191, .35); }
.cc-line-ticket { stroke: var(--chart-ticket); }
.cc-line-contact { stroke: var(--chart-contact); }
.cc-point-ticket { fill: var(--chart-ticket); }
.cc-point-contact { fill: var(--chart-contact); }
.cc-value-ticket { fill: var(--chart-ticket); }
.cc-value-contact { fill: var(--chart-contact); }

/* --- Keyframes --- */
@keyframes csoBarGrow {
  from { transform: scaleY(0); opacity: .35; }
  to { transform: scaleY(1); opacity: 1; }
}
@keyframes csoBarGrowX {
  from { transform: scaleX(0); opacity: .35; }
  to { transform: scaleX(1); opacity: 1; }
}
@keyframes csoLineDraw {
  from { stroke-dashoffset: 100; }
  to { stroke-dashoffset: 0; }
}
@keyframes csoPointPop {
  0% { transform: scale(0); opacity: 0; }
  70% { transform: scale(1.45); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes csoFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes csoFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- Bar: tumbuh dari bawah, berurutan (delay dari app.js) --- */
.cso-bar {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: csoBarGrow .8s cubic-bezier(.22, 1, .36, 1) both;
  transition: opacity .18s ease, filter .18s ease;
}
.cso-bar:hover { filter: brightness(1.18); opacity: 1; }

/* --- Bar horizontal (variabel analytics): tumbuh dari kiri ke kanan --- */
.cso-hbar {
  transform-box: fill-box;
  transform-origin: 0% 50%;
  animation: csoBarGrowX .8s cubic-bezier(.22, 1, .36, 1) both;
  transition: opacity .18s ease, filter .18s ease;
}
.cso-hbar:hover { filter: brightness(1.18); opacity: 1; }
.analytics-var-card g:hover .cso-bar { filter: brightness(1.12); }

/* --- Line: ke-draw dari kiri ke kanan (pathLength=100 di app.js).
       stroke-dashoffset default 0 (garis kelihatan): animasi tetap
       mulai dari 100 lewat keyframes, tapi kalau animasi dimatikan
       (prefers-reduced-motion) garisnya tidak hilang — itu yang
       bikin chart cuma titik-titik doang. --- */
.cso-line,
.cc-line-ticket,
.cc-line-contact {
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
  animation: csoLineDraw 1.25s ease-out .15s both;
}

/* --- Titik: muncul belakangan, setelah garis --- */
.cso-point,
.cc-point-ticket,
.cc-point-contact {
  transform-box: fill-box;
  transform-origin: center;
  animation: csoPointPop .55s ease-out both;
}

/* --- Donut: fade-in saja (dasharray-nya sudah dipakai untuk % slice,
       jadi jangan dianimasikan, nanti persennya rusak) --- */
.cso-donut-arc { animation: csoFadeIn .95s ease-out both; }

/* --- Area di bawah line + container grafik: fade-in halus --- */
.analytics-svg polygon { animation: csoFadeIn 1.05s ease-out both; }
.analytics-svg,
.cc-trend-svg,
#repeatContactChart svg,
.analytics-var-card svg {
  animation: csoFadeUp .6s ease-out both;
}
.analytics-var-card { animation: csoFadeUp .55s ease-out both; }

/* --- Transisi umum: kartu, KPI, panel --- */
.module,
.analytics-card,
.analytics-var-card,
.cc-kpi,
.cc-card {
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease, background-color .22s ease;
}
.cc-kpi:hover,
.analytics-kpi:hover {
  transform: translateY(-2px);
  border-color: rgba(129, 140, 248, .35);
}
.analytics-kpi-value,
.cc-kpi-value {
  font-variant-numeric: tabular-nums;
}

/* --- Hormati pengguna yang matikan animasi di OS/browser --- */
@media (prefers-reduced-motion: reduce) {
  .cso-bar, .cso-hbar, .cso-line, .cc-line-ticket, .cc-line-contact,
  .cso-point, .cc-point-ticket, .cc-point-contact,
  .cso-donut-arc, .analytics-svg, .cc-trend-svg,
  #repeatContactChart svg, .analytics-var-card svg, .analytics-var-card {
    animation: none !important;
  }
  /* Garis harus tetap kelihatan tanpa animasi (jangan kembali ke
     dashoffset 100 yang menyembunyikan garis sepenuhnya). */
  .cso-line, .cc-line-ticket, .cc-line-contact {
    stroke-dashoffset: 0 !important;
  }
  .module, .analytics-card, .analytics-var-card, .cc-kpi, .cc-card,
  .cc-kpi:hover, .analytics-kpi:hover {
    transition: none !important;
    transform: none !important;
  }
}

/* =========================================================
   HIGHLIGHT POPUP (ganti banner di atas)
   Banner .analytics-crossfilter-banner dimatikan: saat klik
   kategori, popup muncul di dekat kursor + kategori itu
   di-bold di tempat (bar / slice / legend).
   ========================================================= */

.analytics-crossfilter-banner { display: none !important; }

#analyticsHighlightPopup {
  position: fixed;
  z-index: 9999;
  width: 280px;
  padding: 14px 16px 16px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
  animation: csoFadeIn .25s ease-out both;
}
#analyticsHighlightPopup[hidden] { display: none !important; }

.cso-highlight-close {
  position: absolute;
  top: 6px;
  right: 10px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}
.cso-highlight-close:hover { color: var(--text); }

.cso-highlight-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--muted);
}
.cso-highlight-title {
  margin: 2px 0 4px;
  padding-right: 20px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.3px;
  word-break: break-word;
}
.cso-highlight-meta {
  font-size: 13px;
  font-weight: 700;
  color: var(--chart-contact);
}
.cso-highlight-hint {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.cso-highlight-clear {
  width: 100%;
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.cso-highlight-clear:hover { border-color: var(--red); color: var(--red); }

/* --- Kategori yang di-highlight: bold di tempat, yang lain redup --- */
.analytics-var-card g.analytics-highlighted text {
  font-weight: 800 !important;
  fill: var(--text) !important;
}
.analytics-var-card g.analytics-highlighted rect:nth-of-type(2) {
  stroke: var(--text);
  stroke-width: 1.5;
  filter: brightness(1.12);
}
.analytics-var-card .analytics-highlighted {
  font-weight: 800;
  color: var(--text);
}
.analytics-var-card circle.analytics-highlighted {
  filter: brightness(1.15);
}

/* =========================================================
   DARK MODE LEBIH HITAM (OLED)
   Token hitam di atas sempat ditimpa blok "refinement" dengan
   navy keabuan (#090a0f / #111420). Blok ini menegaskan lagi
   hitam pekat di paling bawah file supaya menang.
   Light mode tidak ikut berubah: body.light spesifikasinya
   lebih tinggi dari :root, jadi token terang tetap menang.
   ========================================================= */

:root {
  --bg: #000000;
  --sidebar: #050505;
  --panel: #0a0a0a;
  --panel-hover: #121212;
  --panel-elevated: #161616;
  --input: #050505;
  --line: #1f1f23;
  --line-strong: #2e2e34;
}

/* =========================================================
   LOGO SIDEBAR = FAVICON
   Logo "C" biru di sidebar diganti gambar favicon (C gradient
   teal-indigo di atas hitam). Cukup CSS saja, tanpa ubah
   index.html: huruf C di dalam div dibuat transparan dan
   favicon jadi background-nya. Ukuran tetap 38x38 seperti
   .brand-logo lama, jadi layout sidebar tidak bergeser.
   Alternatif (lebih semantik): ganti <div class="brand-logo">C</div>
   di index.html jadi <img class="brand-logo-img"
   src="/static/favicon.png" alt="CSO Workspace"> — CSS-nya
   sudah disiapkan di bawah.
   ========================================================= */

.brand-logo {
  background: url("/static/favicon.png") center / cover no-repeat #000000;
  color: transparent;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .5);
}

.brand-logo-img {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 11px;
  object-fit: cover;
  display: block;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .5);
}

/* =========================================================
   ACCESS CODE GATE
   html.cso-auth-pending menyembunyikan dashboard sampai
   sesi terverifikasi (fail closed di sisi tampilan).
   ========================================================= */

html.cso-auth-pending .app { display: none !important; }

.cso-auth-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #000000;
}

.cso-auth-card {
  width: 100%;
  max-width: 360px;
  padding: 32px 28px 28px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow-lg);
  animation: csoFadeUp .45s ease-out both;
}

.cso-auth-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: cover;
  margin-bottom: 16px;
}

.cso-auth-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.3px;
}

.cso-auth-sub {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.cso-auth-field {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.cso-auth-field input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: var(--input);
  color: var(--text);
  font-size: 15px;
  letter-spacing: .5px;
}

.cso-auth-field input:focus {
  border-color: var(--chart-contact);
  outline: none;
}

.cso-auth-field button {
  flex-shrink: 0;
  height: 46px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--panel-hover);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.cso-auth-error {
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
}

.cso-auth-submit {
  width: 100%;
  height: 46px;
  margin-top: 14px;
  border-radius: 11px;
  border: 0;
  background: linear-gradient(135deg, #2dd4bf, #818cf8);
  color: #050505;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.cso-auth-submit:disabled { opacity: .6; cursor: wait; }

.cso-auth-note {
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--muted);
}

@keyframes csoAuthShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
.cso-auth-shake { animation: csoAuthShake .4s ease-out; }

/* =========================================================
   REVISI 27 Nov 14:10 WIB — kartu modul tanpa deskripsi,
   header judul dashboard dihapus (tombol aksi tetap ada)
   ========================================================= */
/* Header "WORKSPACE / COMMAND CENTER + Dashboard Operasional +
   subtitle" disembunyikan. .top-actions (lonceng, Terang, Keluar)
   tidak ikut disembunyikan. */
.topbar .breadcrumb,
.topbar h1,
.topbar .subtitle { display: none !important; }
.topbar { padding: 12px 0; margin-bottom: 18px; }

/* Deskripsi di 6 kartu modul disembunyikan — tinggal judul saja. */
.module > p { display: none !important; }
.module h3 { margin-bottom: 0; }

/* =========================================================
   REVISI 27 Nov 14:13 WIB — judul modul ke paling atas,
   tombol tema jadi ikon saja
   ========================================================= */
/* 1. "WORKSPACE TOOLS / Modul Operasional CSO / Klik kartu..."
   SEJAJAR satu baris dengan tombol (judul kiri, tombol kanan,
   rata tengah vertikal). Caranya: .main jadi flex-wrap row,
   bungkus section #tools dilepas (display:contents) supaya
   header-nya dan topbar duduk di baris yang sama. Grid kartu
   dan section lain tetap satu baris penuh di bawahnya. */
.main { display: flex; flex-wrap: wrap; align-items: center; }
#tools { display: contents; }
#tools > .section-header-modern { flex: 1 1 auto; min-width: 0; margin-bottom: 0; order: 1; }
.topbar {
  flex: 0 0 auto;
  order: 2;
  position: static;
  padding: 0;
  margin: 0;
  background: transparent;
  border-bottom: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
#tools > .modules { flex: 1 1 100%; margin-top: 20px; margin-bottom: 36px; order: 3; }
.main > section { flex: 1 1 100%; order: 4; }
.main > div { flex: 1 1 100%; order: 4; }
.main > footer { flex: 1 1 100%; order: 5; }

/* 2. Tombol tema gelap/terang: teks "Terang"/"Gelap" disembunyikan,
   tinggal ikon matahari/bulan saja, tombol jadi bulat. */
#themeLabel { display: none !important; }
#themeBtn { width: 40px; height: 40px; padding: 0; justify-content: center; }
#themeIcon { font-size: 16px; }

/* ── Solver message: sembunyikan box status saat kosong ──
   #solverMessage di index.html kosong sebelum Generate Link ditekan,
   tapi blok "9. SOLVER MESSAGE STATUS FEEDBACK" memberi padding +
   border + background, jadi tampil sebagai box kosong. :empty
   menyembunyikannya; begitu JS mengisi textContent (⏳/✅/❌),
   box muncul lagi dengan sendirinya. */
.solver-message:empty { display: none; }

/* =========================================================
   REVISI 30 Nov — sidebar kiri bisa hide/unhide (desktop)
   ========================================================= */
/* Sebelumnya tombol ☰ cuma muncul di layar <=1024px (mode
   off-canvas HP/tablet); di desktop sidebar selalu nempel.
   Sekarang di desktop: klik tombol "‹" di tepi kanan sidebar
   untuk menyembunyikan (sidebar geser keluar, konten melebar),
   klik tombol ☰ yang mengambang di kiri atas untuk memunculkan
   lagi. Pilihan tersimpan di localStorage. */
@media (min-width: 1025px) {
  .sidebar { transition: margin-left .3s cubic-bezier(.16, 1, .3, 1); }
  body.sidebar-collapsed .sidebar { margin-left: -260px; }
  body.sidebar-collapsed .sidebar-toggle { display: flex; }
  /* Ruang buat tombol ☰ yang mengambang di kiri atas. */
  body.sidebar-collapsed #tools > .section-header-modern { padding-left: 56px; }
}

/* Tombol "‹" di tepi kanan sidebar (desktop saja). */
.sidebar-collapse-btn {
  position: absolute;
  top: 20px;
  right: -13px;
  z-index: 45;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
  transition: all .2s ease;
}
.sidebar-collapse-btn:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--panel-hover);
}
@media (max-width: 1024px) {
  .sidebar-collapse-btn { display: none; }
}

/* =========================================================
   REVISI 30 Nov — desain kalem v2 + efek grafik + efek scroll
   ========================================================= */
/* Desain kalem (disetujui Dera 30 Nov, ganti sample warna-warni):
   kartu modul seragam, satu aksen teal, warna muncul halus pas hover. */

/* --- Kartu modul: garis teal tipis di atas, muncul pas hover --- */
.module { position: relative; }
.module::before {
  content: "";
  position: absolute;
  top: 0; left: 22px; right: 22px; height: 2px;
  background: #2dd4bf; border-radius: 2px;
  opacity: 0; transform: scaleX(.4);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}
.module:hover { border-color: rgba(255,255,255,.14); }
.module:hover::before { opacity: 1; transform: scaleX(1); }

/* Ikon modul netral; baru bernuansa teal pas kartu di-hover. */
.module-icon,
.module-icon.purple,
.module-icon.orange,
.module-icon.teal {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  color: var(--muted);
  transition: background .25s ease, border-color .25s ease, color .25s ease;
}
.module:hover .module-icon {
  background: rgba(45,212,191,.10);
  border-color: rgba(45,212,191,.35);
  color: #2dd4bf;
}
/* Light mode: aksen teal digelapkan, netral pakai hitam transparan. */
body.light .module:hover { border-color: rgba(0,0,0,.18); }
body.light .module::before { background: #0d9488; }
body.light .module-icon,
body.light .module-icon.purple,
body.light .module-icon.orange,
body.light .module-icon.teal {
  background: rgba(0,0,0,.04);
  border-color: rgba(0,0,0,.08);
}
body.light .module:hover .module-icon {
  background: rgba(13,148,136,.10);
  border-color: rgba(13,148,136,.35);
  color: #0d9488;
}

/* --- Grafik: glow halus di garis --- */
.cc-line-ticket { filter: drop-shadow(0 2px 5px rgba(129,140,248,.35)); }
.cc-line-contact { filter: drop-shadow(0 2px 5px rgba(45,212,191,.35)); }
.cso-line { filter: drop-shadow(0 2px 4px rgba(129,140,248,.22)); }

/* --- Area gradient di bawah garis trend: fade-in halus --- */
.cc-area-ticket, .cc-area-contact { animation: csoFadeIn 1.05s ease-out both; }

/* --- Titik trend: nilai muncul + titik membesar pas di-hover --- */
.cc-point-wrap { cursor: pointer; }
.cc-point-wrap .cc-point-value {
  opacity: 0; transition: opacity .2s ease; pointer-events: none;
  font-size: 10.5px; font-weight: 700;
}
.cc-point-wrap:hover .cc-point-value { opacity: 1; }
.cc-point-ticket, .cc-point-contact { transition: r .18s ease; }
.cc-point-wrap:hover .cc-point-ticket,
.cc-point-wrap:hover .cc-point-contact { r: 6; }

/* --- Denyut di titik terakhir trend --- */
.cc-pulse {
  transform-box: fill-box; transform-origin: center;
  animation: csoPulse 2.2s ease-out infinite;
  pointer-events: none;
}
.cc-pulse-ticket { fill: #818cf8; }
.cc-pulse-contact { fill: #2dd4bf; }
@keyframes csoPulse {
  0% { transform: scale(1); opacity: .45; }
  70% { opacity: .12; }
  100% { transform: scale(2.8); opacity: 0; }
}

/* --- Reveal-on-scroll: muncul halus saat masuk viewport.
       Pakai properti `translate` (bukan `transform`) supaya tidak
       bentrok dengan transform hover di kartu. Kelas cso-reveal
       ditambahkan dari JS, jadi tanpa JS konten tetap kelihatan. --- */
.cso-reveal {
  transition: opacity .6s ease, translate .6s cubic-bezier(.22, 1, .36, 1),
    transform .22s ease, border-color .22s ease, box-shadow .22s ease, background-color .22s ease;
}
.cso-reveal:not(.in-view) { opacity: 0; translate: 0 14px; }
.cso-reveal.in-view { opacity: 1; translate: 0 0; }

/* --- Progress bar scroll di atas layar --- */
#csoScrollProgress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, #2dd4bf, #818cf8);
  z-index: 120; pointer-events: none;
  transition: width .1s linear;
}

@media (prefers-reduced-motion: reduce) {
  .cso-reveal:not(.in-view) { opacity: 1; translate: none; }
  .cc-pulse { animation: none; opacity: 0; }
  .cc-line-ticket, .cc-line-contact, .cso-line { filter: none; }
}

/* =========================================================
   REVISI 30 Nov — jam WIB + cuaca Bandung di topbar
   ========================================================= */
/* Dua pill di sebelah kiri lonceng: jam live (WIB) dan cuaca
   Bandung. Di layar kecil, tanggal disembunyikan dulu, lalu
   pill cuaca ikut disembunyikan supaya tidak sesak. */
.cso-topbar-info {
  display: flex; align-items: center; gap: 8px;
  margin-right: 2px;
}
.cso-topbar-pill {
  display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 12px;
  border-radius: var(--radius-md);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
/* [hidden] kalah lawan display:flex dari author stylesheet,
   jadi paksa sembunyi di sini. */
.cso-topbar-pill[hidden] { display: none; }
.cso-topbar-icon { font-size: 15px; color: var(--muted); }
.cso-topbar-text { display: flex; flex-direction: column; line-height: 1.25; }
.cso-topbar-text strong {
  font-size: 12.5px; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.cso-topbar-text small { font-size: 10.5px; color: var(--muted); }
@media (max-width: 760px) {
  .cso-topbar-text small { display: none; }
  .cso-topbar-pill { height: 36px; padding: 0 10px; }
}
@media (max-width: 560px) {
  #csoWeatherPill { display: none; }
}

/* =========================================================
   REVISI 2 Des — panel detail cuaca + jam dunia di topbar
   ========================================================= */
/* Pill bisa diklik -> panel dropdown (mirip panel notifikasi). */
.cso-topbar-pill { position: relative; cursor: pointer; }
.cso-topbar-panel {
  position: absolute; top: 48px; right: 0; width: 340px;
  max-width: calc(100vw - 24px);
  border-radius: var(--radius-lg); background: var(--panel);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  z-index: 60; overflow: hidden; text-align: left;
  white-space: normal; cursor: default;
  max-height: calc(100vh - 80px); overflow-y: auto;
}
.cso-topbar-panel[hidden] { display: none !important; }
.cso-topbar-panel-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 14px 16px 10px; border-bottom: 1px solid var(--line);
}
.cso-topbar-panel-title { font-size: 13.5px; font-weight: 700; }
.cso-topbar-panel-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.cso-topbar-panel-close {
  background: transparent; border: none; color: var(--muted);
  font-size: 13px; cursor: pointer; padding: 2px 6px;
}
.cso-topbar-panel-close:hover { color: var(--text); }
.cso-topbar-panel-sec {
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted); padding: 12px 16px 6px;
}
/* --- Isi panel cuaca --- */
.cso-weather-now { display: flex; align-items: baseline; gap: 10px; padding: 12px 16px 4px; }
.cso-weather-now-temp { font-size: 30px; font-weight: 800; }
.cso-weather-now-cond { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.cso-weather-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 10px 16px 4px; }
.cso-weather-grid span { display: block; font-size: 10.5px; color: var(--muted); }
.cso-weather-grid strong { font-size: 12.5px; }
.cso-weather-hourly { display: flex; gap: 4px; padding: 4px 12px 10px; overflow-x: auto; }
.cso-weather-hour { flex: 1 0 44px; text-align: center; padding: 8px 2px; border-radius: 8px; background: rgba(255,255,255,.03); }
.cso-weather-hour small { display: block; font-size: 10.5px; color: var(--muted); }
.cso-weather-hour .h-icon { font-size: 15px; margin: 2px 0; }
.cso-weather-hour strong { display: block; font-size: 12px; }
.cso-weather-daily { padding: 0 8px 12px; }
.cso-weather-day { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; font-size: 12.5px; }
.cso-weather-day:nth-child(odd) { background: rgba(255,255,255,.02); }
.cso-weather-day .d-name { flex: 1; }
.cso-weather-day .d-name small { color: var(--muted); font-size: 11px; }
.cso-weather-day .d-icon { width: 20px; text-align: center; }
.cso-weather-day .d-rain { color: var(--muted); font-size: 11.5px; width: 36px; text-align: right; }
.cso-weather-day .d-temp { font-weight: 700; white-space: nowrap; }
/* --- Isi panel jam dunia --- */
.cso-world-list { padding: 6px 8px 10px; }
.cso-world-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px; border-radius: 8px; }
.cso-world-row:nth-child(odd) { background: rgba(255,255,255,.02); }
.cso-world-row.local { background: rgba(45,212,191,.08); }
.cso-world-city { font-size: 12.5px; font-weight: 600; }
.cso-world-city small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 400; }
.cso-world-time-wrap { text-align: right; }
.cso-world-time { font-size: 13px; font-variant-numeric: tabular-nums; }
.cso-world-date { display: block; font-size: 10.5px; color: var(--muted); }
@media (max-width: 560px) {
  .cso-topbar-panel { width: 300px; }
}

/* =========================================================
   REVISI 2 Des — hover pill jam/cuaca + modal konfirmasi keluar
   ========================================================= */
/* Hover di pill jam & cuaca: border teal, tint lembut, naik 1px,
   ikon ikut jadi teal — selaras dengan hover kartu modul. */
.cso-topbar-pill {
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.cso-topbar-pill:hover {
  border-color: rgba(45,212,191,.45);
  background: rgba(45,212,191,.06);
  transform: translateY(-1px);
}
.cso-topbar-pill:hover .cso-topbar-icon { color: #2dd4bf; }
body.light .cso-topbar-pill:hover {
  border-color: rgba(13,148,136,.5);
  background: rgba(13,148,136,.06);
}
body.light .cso-topbar-pill:hover .cso-topbar-icon { color: #0d9488; }

/* Modal konfirmasi keluar (dipakai tombol Keluar di topbar). */
.cso-confirm-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.6);
  display: grid; place-items: center; padding: 16px;
}
.cso-confirm-overlay[hidden] { display: none !important; }
.cso-confirm-card {
  width: 100%; max-width: 380px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 20px;
}
.cso-confirm-title { font-size: 15px; font-weight: 700; }
.cso-confirm-sub { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.cso-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.cso-confirm-btn {
  border: 1px solid var(--line); background: var(--panel);
  color: var(--text); border-radius: var(--radius-md);
  padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.cso-confirm-btn:hover { border-color: var(--accent); }
.cso-confirm-btn.danger { background: var(--red); border-color: transparent; color: #fff; }
.cso-confirm-btn.danger:hover { filter: brightness(1.1); }

/* ================= PETA WITEL (SURVEY ANALYTICS) ================= */
.analytics-map {
  height: 340px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #0e1420;
  z-index: 0;
}
.analytics-map .leaflet-container { font-family: inherit; background: #0e1420; }
/* Tile OSM yang terang digelapkan supaya nyambung sama tema gelap.
   Marker (circle) tidak ikut terbalik karena ada di pane terpisah. */
.analytics-map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.92); }
body.light .analytics-map .leaflet-tile-pane { filter: none; }
body.light .analytics-map { background: #e5e7eb; }
body.light .analytics-map .leaflet-container { background: #e5e7eb; }
.analytics-map .leaflet-popup-content-wrapper {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.analytics-map .leaflet-popup-content { font-size: 12px; line-height: 1.5; margin: 10px 14px; }
.analytics-map .leaflet-popup-tip { background: var(--panel); border: 1px solid var(--line); }
.analytics-map .leaflet-popup-content a { color: var(--accent); }
.analytics-map .leaflet-bar a {
  background: var(--panel);
  color: var(--text);
  border-bottom: 1px solid var(--line);
}
.analytics-map .leaflet-bar a:hover { background: var(--panel); color: var(--accent); }
.analytics-map .leaflet-control-attribution {
  background: rgba(10, 10, 10, 0.75);
  color: var(--muted);
  font-size: 10px;
}
.analytics-map .leaflet-control-attribution a { color: var(--accent); }
body.light .analytics-map .leaflet-control-attribution { background: rgba(255, 255, 255, 0.8); }
.analytics-map-unmapped {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}
