:root{--bg:#f6f8f5;--surface:#fff;--border:#d8e2db;--text:#10221a;--muted:#5e7065;--primary:#007247;--primary-dark:#005d3a;--accent:#ef2326;--soft:#eef8f2;--soft-red:#fff1f1;--shadow:0 12px 35px rgba(16,34,26,.08)}
*{box-sizing:border-box}
body{background:linear-gradient(180deg,#f7faf8 0,#f3f7f4 100%);color:var(--text);font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
.app-nav{background:#07120d;box-shadow:0 8px 30px rgba(7,18,13,.28)}
.navbar-brand,.app-nav .nav-link{color:#fff!important}
.app-nav .nav-link{opacity:.88}
.app-nav .nav-link:hover{opacity:1}
.brand-logo{height:42px;width:auto;display:block}.brand-subtitle{font-size:10px;letter-spacing:.18em;color:#9fe0b9}.logout-link{background:rgba(255,255,255,.08);border-radius:999px;padding-left:14px!important;padding-right:14px!important}
.eyebrow{letter-spacing:.12em;text-transform:uppercase;color:#128855;font-size:12px;font-weight:800}
.hero-panel{background:linear-gradient(135deg,#062016,#007247 60%,#0d8e5a);color:#fff;border-radius:28px;padding:28px;box-shadow:var(--shadow);display:flex;justify-content:space-between;gap:20px;align-items:center;position:relative;overflow:hidden}
.hero-panel:after{content:"";position:absolute;right:-60px;bottom:-60px;width:180px;height:180px;border-radius:50%;background:rgba(239,35,38,.18)}
.hero-panel h1{font-size:34px;margin:4px 0;position:relative;z-index:1}.hero-panel p{max-width:850px;margin:0;color:rgba(255,255,255,.88);position:relative;z-index:1}
.hero-actions{display:flex;gap:10px;flex-wrap:wrap;position:relative;z-index:1}
.btn-primary{background:var(--primary);border-color:var(--primary)}.btn-primary:hover{background:var(--primary-dark);border-color:var(--primary-dark)}
.btn-primary-soft{background:#fff;color:var(--primary-dark);border:0}.btn-danger-soft{background:#ffe5e5;color:#b91c1c;border:0}
.btn-outline-primary{color:var(--primary);border-color:var(--primary)}.btn-outline-primary:hover{background:var(--primary);border-color:var(--primary)}
.control-panel,.data-panel,.app-card{background:var(--surface);border:1px solid var(--border);border-radius:22px;box-shadow:var(--shadow)}.control-panel{padding:20px}
.form-control,.form-select{border-radius:14px;border-color:#c7d5cb}.form-control:focus,.form-select:focus{border-color:#77c39b;box-shadow:0 0 0 .2rem rgba(0,114,71,.12)}
.filter-card{background:#f8fbf9;border:1px solid var(--border);border-radius:18px;padding:12px}.filter-row{align-items:end}.filter-card .f-field{min-width:150px}.filter-card .f-val,.filter-card .f-val2{min-width:180px}
.kpi-grid{display:grid;grid-template-columns:repeat(5,minmax(170px,1fr));gap:16px}.kpi-card{background:var(--surface);border:1px solid var(--border);border-radius:22px;padding:18px;box-shadow:var(--shadow);position:relative;overflow:hidden}.kpi-card:after{content:"";position:absolute;right:-24px;top:-24px;width:90px;height:90px;border-radius:50%;background:var(--soft)}.kpi-card:nth-child(odd):before{content:"";position:absolute;left:0;top:0;height:100%;width:5px;background:var(--primary)}.kpi-card:nth-child(even):before{content:"";position:absolute;left:0;top:0;height:100%;width:5px;background:var(--accent)}.kpi-card span{display:block;color:var(--muted);font-size:13px;font-weight:700}.kpi-card b{display:block;margin-top:8px;font-size:26px;letter-spacing:-.03em}
.chart-grid{display:grid;grid-template-columns:repeat(2,minmax(300px,1fr));gap:16px}.chart-card{background:var(--surface);border:1px solid var(--border);border-radius:22px;box-shadow:var(--shadow);padding:18px;min-height:320px}.chart-card h6{font-size:15px;font-weight:800;margin-bottom:12px}.chart-box{height:260px}
.data-panel{overflow:hidden}.data-panel-head,.data-panel-foot{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:18px 20px;border-bottom:1px solid var(--border)}.data-panel-foot{border-bottom:0;border-top:1px solid var(--border);justify-content:flex-end}.data-panel-head h5{margin:0;font-weight:800}.data-table-wrap{max-height:65vh}.table thead th{position:sticky;top:0;z-index:2;background:#062016;color:#fff;white-space:nowrap;font-size:12px;letter-spacing:.02em;cursor:pointer}.table td{white-space:nowrap;font-size:13px}.table tbody tr:hover{background:#f7fbf8}.column-picker{padding:14px 18px;border-bottom:1px solid var(--border);display:flex;flex-wrap:wrap;gap:10px}.column-chip{background:#f8fafc;border:1px solid var(--border);border-radius:999px;padding:8px 12px;font-size:13px}
.login-page{min-height:calc(100vh - 86px);display:grid;place-items:center}.login-card{width:min(480px,94vw);background:var(--surface);border:1px solid var(--border);border-radius:28px;padding:34px;box-shadow:var(--shadow);text-align:center}.login-card form{text-align:left}.login-logo{width:min(340px,90%);height:auto;display:block;margin:0 auto 16px}
.page-title-row{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:22px}.page-title-row h2{font-weight:850;margin:4px 0}.permission-toolbar{display:flex;gap:10px;flex-wrap:wrap}.permission-grid{display:grid;grid-template-columns:repeat(2,minmax(320px,1fr));gap:16px}.permission-card .card-header{background:#fff;border-bottom:1px solid var(--border);border-radius:22px 22px 0 0}.permission-card code{color:var(--primary-dark);background:#eaf7ef;padding:3px 7px;border-radius:8px}.badge{text-transform:uppercase;letter-spacing:.04em}
.forced-filter-box{border-radius:18px;border:1px solid #c4e6d0;background:#eef8f2;color:#175231}.forced-chip{display:inline-block;margin:4px 6px;padding:6px 10px;border-radius:999px;background:#ddefe4;color:#175231;font-weight:700;font-size:12px}
.chart-builder{overflow:hidden}.chart-builder-head{display:flex;justify-content:space-between;gap:14px;align-items:center;padding:18px}.chart-builder-head h5{margin:0;font-weight:850}.chart-card-title{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:12px}.chart-card-title h6{margin:0}
.permission-grid.wide{grid-template-columns:1fr}.forced-editor{display:grid;grid-template-columns:140px minmax(220px,1.3fr) minmax(220px,1.3fr);gap:8px;min-width:580px}.forced-editor input{min-width:220px}
.default-chart-remove{border:0;background:#fff3f3;color:#b91c1c;border-radius:999px;padding:6px 10px;font-size:12px;font-weight:700}.default-chart-remove:hover{background:#ffe3e3}
@media(max-width:1200px){.kpi-grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:900px){.hero-panel{display:block}.hero-actions{margin-top:18px}.chart-grid,.permission-grid{grid-template-columns:1fr}.kpi-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:700px){.chart-builder-head{display:block}.chart-builder-head .btn{margin-top:12px}.forced-editor{grid-template-columns:1fr;min-width:220px}.brand-logo{height:36px}}
@media(max-width:540px){main.container-fluid{padding-left:14px!important;padding-right:14px!important}.hero-panel{border-radius:20px;padding:22px}.hero-panel h1{font-size:26px}.kpi-grid{grid-template-columns:1fr}.data-panel-head{display:block}.column-tools{margin-top:12px}.permission-toolbar .ms-auto{margin-left:0!important;width:100%}}

.custom-kpi-card{position:relative}.custom-kpi-card .remove-card{position:absolute;right:10px;top:10px;border:0;background:#fff3f3;color:#b91c1c;border-radius:999px;font-size:12px;font-weight:800;padding:4px 8px}.builder-note{font-size:12px;color:var(--muted)}

/* TV Dashboard */
.tv-shell{min-height:calc(100vh - 110px);background:#07120d;color:#f3fff7;border-radius:28px;padding:28px;box-shadow:var(--shadow)}
.tv-header{display:flex;justify-content:space-between;gap:24px;align-items:center;background:linear-gradient(135deg,#0b2a1d,#007247 60%,#ef2326);border-radius:24px;padding:24px}
.tv-logo{height:76px;background:#fff;border-radius:16px;padding:8px}.tv-header h1{font-size:42px;font-weight:900;margin:0}.tv-header p{margin:4px 0 0;color:rgba(255,255,255,.86)}.tv-status{text-align:right}.tv-clock{font-size:42px;font-weight:900;line-height:1}.tv-updated{color:#d7f7e3;font-size:14px;margin-top:8px}.tv-filter-strip{background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.16);border-radius:18px;padding:14px}.tv-filter-strip span{display:inline-block;margin:4px 6px;padding:7px 12px;border-radius:999px;background:rgba(255,255,255,.12);font-size:13px}.tv-card-grid{display:grid;grid-template-columns:repeat(4,minmax(180px,1fr));gap:16px}.tv-card{background:#fff;color:#10221a;border-radius:24px;padding:22px;position:relative;overflow:hidden}.tv-card:before{content:"";position:absolute;left:0;top:0;width:7px;height:100%;background:var(--accent)}.tv-card:nth-child(odd):before{background:var(--primary)}.tv-card span{display:block;color:#5e7065;font-weight:800;font-size:15px}.tv-card b{display:block;font-size:34px;line-height:1.08;margin-top:8px;letter-spacing:-.04em}.tv-main-grid{display:grid;grid-template-columns:1.25fr .75fr;gap:16px}.tv-chart-panel,.tv-recent-panel{background:#fff;color:#10221a;border-radius:24px;padding:18px;min-height:420px}.tv-panel-title{font-size:18px;font-weight:900;margin-bottom:14px}.tv-chart-grid{display:grid;grid-template-columns:repeat(2,minmax(240px,1fr));gap:14px}.tv-chart-card{border:1px solid var(--border);border-radius:18px;padding:12px;background:#f8fbf9}.tv-chart-card h6{font-size:14px;font-weight:900}.tv-chart-box{height:230px}.tv-table thead th{background:#062016;color:#fff;position:sticky;top:0}.tv-table td,.tv-table th{font-size:14px;white-space:nowrap}
@media(max-width:1200px){.tv-card-grid{grid-template-columns:repeat(2,1fr)}.tv-main-grid{grid-template-columns:1fr}.tv-header{display:block}.tv-status{text-align:left;margin-top:16px}}

.tv-chart-panel-full{min-height:520px}
.tv-chart-grid-wide{grid-template-columns:repeat(auto-fit,minmax(380px,1fr))}
.tv-empty-widget{background:#f8fbf9;border:1px dashed var(--border);border-radius:18px;padding:34px;text-align:center;color:#5e7065;font-weight:800;grid-column:1/-1}
.tv-widget-picker{display:flex;flex-wrap:wrap;gap:10px}
@media(max-width:900px){.tv-chart-grid-wide{grid-template-columns:1fr}.tv-chart-panel-full{min-height:380px}}

.dashboard-action-bar{display:flex;gap:12px;flex-wrap:wrap;align-items:center;background:#fff;border:1px solid var(--border);border-radius:22px;padding:16px;box-shadow:var(--shadow)}
.date-strip{margin-top:-6px}.modern-modal{border:0;border-radius:28px;box-shadow:0 30px 90px rgba(16,34,26,.22);overflow:hidden}.modern-modal .modal-header{background:linear-gradient(135deg,#f8fbf9,#eef8f2);border-bottom:1px solid var(--border);padding:22px 24px}.modern-modal .modal-body{padding:24px}.modern-modal .modal-footer{border-top:1px solid var(--border);padding:18px 24px;background:#fbfdfb}.builder-launcher{overflow:hidden}.builder-launcher-head{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:18px}.builder-launcher-head h5{margin:0;font-weight:850}.builder-launcher-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}
@media(max-width:700px){.dashboard-action-bar .btn,.builder-launcher-actions .btn{width:100%}.builder-launcher-head{display:block}.builder-launcher-actions{margin-top:14px;justify-content:stretch}}

/* Sales target & customer drilldown */
.target-panel{overflow:hidden}.target-panel-head{display:flex;justify-content:space-between;gap:18px;align-items:flex-end;padding:20px 22px;border-bottom:1px solid var(--border)}.target-panel-head h5{font-weight:850}.target-controls{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}.target-controls .form-select{min-width:160px}.target-kpi-grid{padding:18px 22px;margin-bottom:0!important;grid-template-columns:repeat(4,1fr)}.target-table-wrap{max-height:500px;border-top:1px solid var(--border)}.target-table-wrap thead th{position:sticky;top:0;z-index:2;background:#f5faf7}.target-progress{height:8px;background:#e7ece9}.customer-tools{display:flex;gap:10px;align-items:center}.customer-tools .form-control{min-width:310px}.customer-click-row,.customer-date-row{cursor:pointer}.customer-click-row:hover,.customer-date-row:hover{background:#eef8f2!important}.drilldown-table-box{max-height:58vh;border:1px solid var(--border);border-radius:16px}.drilldown-table-box thead th{position:sticky;top:0;background:#f5faf7;z-index:1}.target-form-card{max-width:1180px;margin:0 auto}
@media(max-width:1000px){.target-panel-head{display:block}.target-controls{margin-top:14px;justify-content:flex-start}.target-kpi-grid{grid-template-columns:repeat(2,1fr)}.customer-tools{margin-top:12px}}
@media(max-width:600px){.target-controls .form-select,.target-controls .btn,.customer-tools,.customer-tools .form-control,.customer-tools .btn{width:100%;min-width:0}.customer-tools{display:block}.customer-tools .btn{margin-top:8px}.target-kpi-grid{grid-template-columns:1fr}}

.feature-permission-card{display:flex;gap:.75rem;align-items:flex-start;height:100%;padding:1rem;border:1px solid #dfe7e3;border-radius:14px;background:#fff;cursor:pointer;transition:.2s ease}.feature-permission-card:hover{border-color:#80b59a;box-shadow:0 8px 24px rgba(31,92,58,.08)}.feature-permission-card span{display:flex;flex-direction:column;gap:.25rem}.feature-permission-card small{color:#6c757d;line-height:1.35}

.target-scope-stack{display:grid;gap:1.5rem}.target-scope-section{border:1px solid #e1e9e5;border-radius:18px;overflow:hidden;background:#fff}.target-scope-title{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start;padding:1.1rem 1.25rem;border-bottom:1px solid #edf1ef;background:#f8fbf9}.target-scope-title h6{margin:0 0 .25rem;font-size:1.05rem}.target-scope-title p{margin:0;color:#6c757d;font-size:.85rem}.target-scope-section .target-kpi-grid{padding:1rem 1.25rem}.target-unconfigured-row{background:#fafafa}.customer-master-table{min-width:2200px}.customer-profile-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:.75rem}.customer-profile-item{padding:.8rem 1rem;border:1px solid #e4ebe7;border-radius:12px;background:#f9fbfa;display:flex;flex-direction:column;gap:.2rem}.customer-profile-item span{font-size:.75rem;color:#6c757d}.customer-profile-item strong{font-size:.9rem;word-break:break-word}.days-since-badge{display:inline-flex;padding:.25rem .55rem;border-radius:999px;font-size:.78rem;font-weight:700;background:#e8f5ed;color:#1d6b3b}.days-since-badge.is-warning{background:#fff3cd;color:#8a6200}.days-since-badge.is-old{background:#f8d7da;color:#9a2632}

/* Target per Departemen Sales + mini CRM customer */
.department-target-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(430px,1fr));gap:18px;padding:20px}.department-target-card{border:1px solid var(--border);border-radius:20px;background:#fff;overflow:hidden;box-shadow:0 8px 26px rgba(16,34,26,.06)}.department-target-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;padding:18px 20px;background:linear-gradient(135deg,#f8fbf9,#eef8f2);border-bottom:1px solid var(--border)}.department-target-head h5{margin:2px 0 4px;font-weight:850}.department-period-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;padding:16px}.department-period-box{border:1px solid #dfe9e3;border-radius:16px;padding:12px;background:#fff}.department-period-box.is-unconfigured{background:#fafafa;border-style:dashed}.department-period-box>strong{display:block;margin-top:8px;font-size:20px}.department-period-box small{font-size:10px;color:var(--muted)}.department-employee-toggle{padding:0 16px 14px}.employee-target-table thead th{background:#f5faf7;color:var(--text);cursor:default}.employee-period-cell{display:flex;flex-direction:column;min-width:130px;gap:2px}.employee-period-cell strong{font-size:13px}.employee-period-cell small,.employee-period-cell span{font-size:11px}.department-kpi-target{position:relative;z-index:1;display:grid;grid-template-columns:repeat(3,1fr);gap:5px;margin-top:14px;padding-top:12px;border-top:1px solid #e5ece8}.department-kpi-target>div{min-width:0}.department-kpi-target small,.department-kpi-target strong,.department-kpi-target em{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.department-kpi-target small{font-size:9px;color:var(--muted);text-transform:uppercase}.department-kpi-target strong{font-size:11px;margin-top:2px}.department-kpi-target em{font-size:10px;color:var(--primary);font-style:normal}.department-employee-multiselect{min-height:280px}
.customer-followup-section{padding:2px}.customer-followup-form{box-shadow:none;background:#f9fbfa}.customer-followup-timeline{position:relative;display:grid;gap:12px}.followup-timeline-item{position:relative;display:grid;grid-template-columns:22px 1fr;gap:10px}.followup-timeline-item:after{content:"";position:absolute;left:10px;top:22px;bottom:-14px;width:2px;background:#dbe7df}.followup-timeline-item:last-child:after{display:none}.followup-timeline-marker{width:20px;height:20px;border:5px solid #d8eee1;background:var(--primary);border-radius:50%;margin-top:18px;z-index:1}.followup-timeline-content{border:1px solid var(--border);border-radius:16px;padding:14px 16px;background:#fff}.followup-response{font-size:14px;line-height:1.5;white-space:pre-wrap}.followup-next-date{padding:8px 10px;border-radius:10px;background:#eef8f2;color:#245d3e;font-size:12px}.customer-followup-section .badge{text-transform:none;letter-spacing:0}
@media(max-width:900px){.department-target-grid{grid-template-columns:1fr}.department-period-grid{grid-template-columns:1fr}.department-target-head{display:block}.department-target-head>.badge{margin-top:8px}}
@media(max-width:540px){.department-target-grid{padding:12px}.department-target-card{border-radius:16px}.department-kpi-target{grid-template-columns:1fr}.department-kpi-target>div{display:flex;justify-content:space-between;gap:8px}.followup-timeline-item{grid-template-columns:16px 1fr}.followup-timeline-marker{width:14px;height:14px;border-width:3px}.followup-timeline-item:after{left:7px}}

/* V4 - Department target layout, tracker, and target authorization */
.department-target-grid{grid-template-columns:1fr!important;max-width:100%}
.department-target-card{min-width:0}
.department-target-card .table-responsive{max-width:100%}
.employee-target-table{min-width:980px}
.department-period-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.department-period-box{min-width:0}
.department-period-box>strong{overflow-wrap:anywhere;font-size:clamp(17px,1.6vw,24px)}
.employee-period-cell{min-width:155px}
.department-tracker-link,.sales-employee-tracker-link{border:0;background:transparent;padding:0;color:var(--primary);font-weight:800;text-align:left;text-decoration:underline;text-decoration-style:dotted;text-underline-offset:4px}
.department-tracker-link:hover,.sales-employee-tracker-link:hover{color:var(--primary-dark)}
.customer-tools-wide{display:grid;grid-template-columns:minmax(220px,300px) minmax(240px,1fr) auto;gap:10px;align-items:center;min-width:min(760px,70vw)}
.tracker-kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:12px}
.tracker-kpi{border:1px solid var(--border);border-radius:16px;padding:14px;background:#f8fbf9;min-width:0}
.tracker-kpi span{display:block;color:var(--muted);font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.04em}
.tracker-kpi strong{display:block;margin-top:6px;font-size:20px;overflow-wrap:anywhere}
.tracker-search{max-width:360px}
.tracker-table-box{max-height:62vh;border:1px solid var(--border);border-radius:16px;overflow:auto}
.tracker-table-box table{min-width:1180px}
.employee-customer-row{cursor:pointer}
.employee-customer-row:hover{background:#eef8f2!important}
.permission-department-table{min-width:820px}
.permission-department-table thead th{cursor:default}
.target-panel-head{align-items:flex-start;gap:18px;flex-wrap:wrap}
.target-controls{margin-left:auto;min-width:min(100%,390px)}

@media(max-width:1200px){
  .department-period-grid{grid-template-columns:1fr}
  .tracker-kpi-grid{grid-template-columns:repeat(2,minmax(150px,1fr))}
  .customer-tools-wide{min-width:100%;grid-template-columns:1fr 1fr auto}
}
@media(max-width:768px){
  .customer-tools-wide{grid-template-columns:1fr;min-width:100%}
  .tracker-kpi-grid{grid-template-columns:1fr}
  .tracker-search{max-width:none;width:100%}
}

.tracker-filter-tools{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.tracker-filter-tools .form-select{min-width:210px}.department-target-head .department-tracker-link{font-size:inherit}
@media(max-width:768px){.tracker-filter-tools,.tracker-filter-tools .form-select,.tracker-filter-tools .form-control{width:100%;max-width:none}}

.customer-scope-info{display:inline-flex;align-items:center;gap:4px;flex-wrap:wrap;padding:6px 10px;border-radius:999px;background:#eef8f2;color:#245d3e;font-size:12px}

.target-admin-table{min-width:980px}


/* V5 - History Customer, daily target per month, brand performance by department */
.department-brand-summary{margin:0 16px 16px;border:1px solid #dfe9e3;border-radius:16px;overflow:hidden;background:#fbfdfc}
.department-brand-title{display:flex;justify-content:space-between;align-items:center;padding:12px 14px;background:#f1f8f4;border-bottom:1px solid #dfe9e3}
.department-brand-title strong,.department-brand-title small{display:block}
.department-brand-title small{margin-top:2px;color:var(--muted);font-size:11px}
.department-brand-table{min-width:780px}
.department-brand-table thead th{position:static;background:#0b2a1e;color:#fff;cursor:default}
.department-brand-table tbody th{width:110px;background:#f7faf8;font-size:12px}
.brand-performance-cell{display:grid;grid-template-columns:minmax(130px,1fr) minmax(115px,.8fr) minmax(180px,1.15fr) minmax(120px,.8fr);gap:10px;align-items:center;min-width:560px}
.brand-performance-cell strong{font-size:13px}
.brand-performance-cell span,.brand-performance-cell em{font-size:11px;font-style:normal;color:var(--muted)}
.customer-master-table th:nth-child(3),.customer-master-table td:nth-child(3),.customer-master-table th:nth-child(4),.customer-master-table td:nth-child(4){background:#f2f8f4}
.customer-master-table thead th:nth-child(3),.customer-master-table thead th:nth-child(4){background:#0b2a1e;color:#fff}
@media(max-width:900px){.brand-performance-cell{grid-template-columns:1fr 1fr;min-width:420px}.department-brand-summary{margin:0 12px 14px}}

/* V6 - sortable + resizable tables */
.sortable-resizable-th{position:relative;user-select:none;white-space:nowrap}
.sortable-resizable-th .th-label{display:inline-flex;align-items:center;gap:4px}
.sort-indicator,.sort-indicator-local{font-size:10px;color:#6c757d}
.col-resizer{position:absolute;right:0;top:0;width:8px;height:100%;cursor:col-resize;z-index:5;touch-action:none}
.col-resizer::after{content:"";position:absolute;right:3px;top:20%;bottom:20%;width:1px;background:rgba(0,0,0,.18)}
.col-resizer:hover::after,.is-resizing-column .col-resizer::after{background:#1f5c3a;width:2px}
.is-resizing-column{cursor:col-resize!important;user-select:none!important}
#salesTable{min-width:1200px}
#salesTable th,#salesTable td{overflow:hidden;text-overflow:ellipsis}
.local-interactive-table th{cursor:pointer;position:relative;user-select:none}
.local-interactive-table td,.local-interactive-table th{vertical-align:middle}

/* Active follow-up dashboard */
.active-followup-table-box{max-height:520px}
.active-followup-table-box table{min-width:1280px}
.active-followup-click-row{cursor:pointer}
.active-followup-click-row:hover{background:#eef8f2!important}
.active-followup-response{max-width:340px;white-space:normal;line-height:1.4;font-size:12px;color:#495057}

/* V7 - total department achievement and employee brand targets */
.total-achievement-card{border:2px solid #a9d6bb;background:linear-gradient(180deg,#fff,#f7fcf9);box-shadow:0 14px 36px rgba(16,88,52,.12)}
.total-achievement-head{background:linear-gradient(135deg,#e9f8ef,#dff2e7)}
.total-achievement-head h5{font-size:1.25rem}
.total-achievement-periods .department-period-box{border-color:#c9e6d5;background:#fff}
.total-brand-summary{border-color:#b9ddc7}
.aggregate-brand-cell{display:grid;grid-template-columns:minmax(145px,1fr) minmax(145px,1fr) minmax(120px,.8fr) minmax(110px,.7fr);gap:10px;align-items:center;min-width:560px}
.aggregate-brand-cell strong{font-size:14px}.aggregate-brand-cell span,.aggregate-brand-cell em,.aggregate-brand-cell small{font-size:11px;font-style:normal;color:var(--muted)}
.employee-target-table{min-width:1480px}
.employee-brand-cell{display:grid;gap:7px;min-width:235px}
.employee-brand-cell>div{display:grid;grid-template-columns:20px minmax(88px,1fr);grid-template-areas:"label actual" "label target" "label achievement";column-gap:7px;padding:7px 8px;border:1px solid #e1ebe5;border-radius:10px;background:#fbfdfc}
.employee-brand-cell span{grid-area:label;align-self:center;font-size:10px;font-weight:850;color:var(--primary)}
.employee-brand-cell strong{grid-area:actual;font-size:12px}.employee-brand-cell small{grid-area:target;font-size:10px;color:var(--muted)}.employee-brand-cell em{grid-area:achievement;font-size:10px;font-style:normal}
@media(max-width:900px){.aggregate-brand-cell{grid-template-columns:1fr 1fr;min-width:420px}}


/* V6.3 - employee brand percentage only and lighter target table */
.employee-target-table{min-width:1180px}
.employee-brand-cell.employee-brand-percent-only{min-width:135px;gap:5px}
.employee-brand-cell.employee-brand-percent-only>div{display:grid;grid-template-columns:24px minmax(85px,1fr);grid-template-areas:"label achievement";align-items:center;column-gap:7px;padding:7px 8px}
.employee-brand-cell.employee-brand-percent-only span{grid-area:label}
.employee-brand-cell.employee-brand-percent-only em{grid-area:achievement;font-size:12px;font-weight:800;white-space:nowrap}


/* V6.4 - Sales Employee active/inactive status */
.employee-name-status{display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:180px}
.employee-name-status .badge{font-size:10px;white-space:nowrap}
.employee-inactive-row>td{background:#f8f9fa!important;color:#6c757d}
.employee-inactive-row .sales-employee-tracker-link{color:#6c757d}
.employee-inactive-row .employee-period-cell,.employee-inactive-row .employee-brand-cell{opacity:.72}

/* V6.6 - Employee Home Brand/Other adalah breakdown actual achievement, bukan target brand. */
.employee-brand-cell.employee-brand-achievement-split{min-width:205px;gap:5px}
.employee-brand-cell.employee-brand-achievement-split>div{display:grid;grid-template-columns:24px minmax(105px,1fr) auto;grid-template-areas:"label actual share";align-items:center;column-gap:7px;padding:7px 8px}
.employee-brand-cell.employee-brand-achievement-split span{grid-area:label}
.employee-brand-cell.employee-brand-achievement-split strong{grid-area:actual;font-size:11px;white-space:nowrap}
.employee-brand-cell.employee-brand-achievement-split em{grid-area:share;font-size:11px;font-weight:800;font-style:normal;white-space:nowrap;color:var(--primary)}
.employee-target-table thead th small{font-size:9px;font-weight:600;color:var(--muted)}

/* V6.8.1 - Employee target: Sales/Home Brand/Other grouped inside Daily/Monthly/Yearly. */
.employee-period-brand-stack{display:grid;gap:.55rem;min-width:180px}
.employee-metric-block{padding-bottom:.5rem;border-bottom:1px solid rgba(0,0,0,.08)}
.employee-metric-block:last-child{padding-bottom:0;border-bottom:0}
.employee-metric-block .employee-metric-title{font-size:.68rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:#6c757d;margin-bottom:.1rem}
.employee-metric-block strong,.employee-metric-block small,.employee-metric-block span{display:block}
.employee-metric-block small{color:#6c757d;margin-top:.08rem}
.employee-metric-block span{font-size:.78rem;font-weight:600;margin-top:.12rem}
.employee-metric-block.is-composition span{color:#6c757d}


/* V6.8.5 - Sales Employee Achievers: single-column departments + Sales/Home Brand/Other */
.sales-achiever-panel{border-top:1px solid var(--border);background:#fbfdfc}
.sales-achiever-head{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;padding:20px 22px;border-bottom:1px solid var(--border)}
.sales-achiever-head h5{font-weight:850}
.sales-achiever-controls{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap;min-width:420px}.sales-achiever-filter-field{min-width:150px;flex:1 1 150px}.sales-achiever-refresh{height:38px;white-space:nowrap}
/* Satu departemen per baris; jangan membagi panel menjadi 2/3 kolom. */
.sales-achiever-departments{display:grid;grid-template-columns:1fr;gap:16px;padding:20px}
.sales-achiever-summary{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:12px 14px;border:1px solid #cfe5d7;border-radius:14px;background:#eef8f2}
.sales-achiever-summary span{font-size:12px;font-weight:800;text-transform:uppercase;color:var(--primary)}
.sales-achiever-summary strong{font-size:14px}.sales-achiever-summary small{margin-left:auto;color:var(--muted)}
.sales-achiever-department{min-width:0;width:100%;border:1px solid var(--border);border-radius:16px;overflow:hidden;background:#fff}
.sales-achiever-department-head{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px 16px;background:#f6faf8;border-bottom:1px solid var(--border)}
.sales-achiever-department-head h6{margin:0;font-weight:850}.sales-achiever-department-head small{color:var(--muted)}
.sales-achiever-employees{display:grid;grid-template-columns:1fr}
.sales-achiever-employee{display:grid;grid-template-columns:minmax(180px,240px) minmax(0,1fr);gap:16px;align-items:stretch;padding:14px 16px;border-bottom:1px solid var(--border)}
.sales-achiever-employee:last-child{border-bottom:0}
.sales-achiever-employee-name{display:flex;align-items:center;gap:10px;min-width:0}
.sales-achiever-employee-name>div{min-width:0}.sales-achiever-employee-name strong{display:block;font-size:14px;overflow-wrap:anywhere}.sales-achiever-employee-name small{display:block;color:var(--muted);margin-top:2px}
.sales-achiever-rank{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;flex:0 0 30px;border-radius:50%;background:#eef8f2;color:var(--primary);font-size:12px;font-weight:850}
.sales-achiever-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.sales-achiever-metric{min-width:0;padding:10px 12px;border:1px solid #e0e8e3;border-radius:12px;background:#fbfdfc}
.sales-achiever-metric-primary{border-color:#b9ddc7;background:#f1faf4}
.sales-achiever-metric-title{font-size:11px;font-weight:850;text-transform:uppercase;letter-spacing:.035em;color:#59645d;margin-bottom:7px}
.sales-achiever-metric-values{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.sales-achiever-metric-values>div{min-width:0}.sales-achiever-metric-values small{display:block;font-size:10px;color:var(--muted);margin-bottom:1px}.sales-achiever-metric-values strong{display:block;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sales-achiever-empty{padding:22px 16px;text-align:center;color:var(--muted);font-size:13px}
@media(max-width:1050px){.sales-achiever-employee{grid-template-columns:1fr}.sales-achiever-metrics{grid-template-columns:1fr 1fr 1fr}}
@media(max-width:760px){.sales-achiever-head{align-items:flex-start;flex-direction:column}.sales-achiever-controls{width:100%;min-width:0}.sales-achiever-filter-field{min-width:0;flex:1 1 100%}.sales-achiever-refresh{width:100%}.sales-achiever-departments{padding:12px;gap:12px}.sales-achiever-summary{display:grid;gap:3px}.sales-achiever-summary small{margin-left:0}.sales-achiever-department{border-radius:13px}.sales-achiever-employee{padding:13px 12px}.sales-achiever-metrics{grid-template-columns:1fr}.sales-achiever-metric-values{grid-template-columns:repeat(3,1fr)}.sales-achiever-head{padding:16px}}
@media(max-width:420px){.sales-achiever-metric-values{grid-template-columns:1fr}.sales-achiever-metric-values strong{white-space:normal}.sales-achiever-employee-name{align-items:flex-start}}


/* V6.8.8 Customer management + inline dashboard */
.customer-settings-shell{max-width:1480px;margin:0 auto}.customer-settings-header{display:flex;align-items:center;justify-content:space-between;gap:18px}.customer-settings-header h1{font-size:clamp(26px,3vw,36px);font-weight:850;letter-spacing:-.04em;margin:6px 0}.customer-settings-card{padding:28px}.customer-section-title{margin-bottom:18px}.customer-section-title h5{font-size:19px;font-weight:850;margin:6px 0}.customer-section-title p{margin:0;color:var(--muted);font-size:13px}.customer-section-title-between{display:flex;justify-content:space-between;gap:12px;align-items:center}.customer-switch-grid{display:grid;grid-template-columns:repeat(3,minmax(220px,1fr));gap:14px}.customer-toggle{display:flex;align-items:center;gap:14px;border:1px solid var(--border);background:#f9fcfa;border-radius:16px;padding:18px;cursor:pointer;min-width:0}.customer-toggle:hover{border-color:#86c7a4}.customer-toggle-icon{border-radius:12px;flex:0 0 44px;height:44px;background:#e6f5ec;color:#007247;display:grid;place-items:center;font-size:24px;font-weight:800}.customer-toggle-text{flex:1;min-width:0}.customer-toggle-text strong{display:block;font-size:14px}.customer-toggle-text small{display:block;color:var(--muted);font-size:12px;margin-top:4px}.customer-toggle .form-check-input{float:none!important;flex:0 0 2.2em;width:2.2em;height:1.2em;margin:0;cursor:pointer}.customer-toggle-inline{width:100%;max-width:690px;justify-content:space-between}.customer-actions{border-top:1px solid var(--border);padding-top:20px;margin-top:24px;display:flex;justify-content:space-between;align-items:center;gap:12px}.customer-selected-count{background:#e3f5e9;color:#00633f;border-radius:999px;padding:10px 16px;font-size:13px;font-weight:800}.customer-search-bar{display:flex;gap:10px;max-width:780px}.customer-selection-table{border:1px solid var(--border);border-radius:15px;overflow:auto}.customer-selection-table th{padding:15px!important}.customer-selection-table td{padding:13px!important}.customer-selection-table code{font-size:12px;color:#056342;background:#edf8f1;padding:5px 8px;border-radius:7px}.customer-name-cell{font-weight:700;white-space:normal!important;min-width:210px}.customer-status-selected,.customer-status-default{font-size:12px;padding:6px 10px;border-radius:999px;font-weight:700}.customer-status-selected{background:#dff5e7;color:#006a3d}.customer-status-default{background:#f0f3f1;color:#5e7065}.customer-priority-star{color:#b07800;font-weight:800}.customer-table-actions{display:flex;align-items:center;justify-content:flex-end;gap:12px}.customer-embedded-panel{border-top:1px solid var(--border);padding:24px 24px 10px;background:#fbfdfb}.customer-embedded-heading{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:15px;margin-bottom:16px}.customer-embedded-content{background:#fff;border:1px solid var(--border);border-radius:16px;padding:18px}.customer-embedded-content #customerDashboardContent>h2,.customer-embedded-content #customerDashboardContent>p:first-of-type{display:none}.customer-inline-section{margin:22px 24px}.customer-dashboard-inline .card{border:1px solid var(--border);border-radius:15px;overflow:hidden}.customer-dashboard-inline .card .table-responsive{padding:0!important}.customer-dashboard-inline .table th{padding:12px}.customer-dashboard-inline .table td{padding:12px}.customer-dashboard-inline h2{font-weight:800}
@media(max-width:920px){.customer-switch-grid{grid-template-columns:1fr}.customer-settings-header{align-items:flex-start;flex-direction:column}.customer-settings-card{padding:18px}.customer-embedded-panel{padding:16px}.customer-inline-section{margin:16px}}@media(max-width:600px){.customer-search-bar,.customer-actions{flex-direction:column;align-items:stretch}.customer-section-title-between{flex-direction:column;align-items:flex-start}.customer-toggle{padding:12px}}

/* V6.9.0: dedicated canvassing view; shared KPI/filter DOM preserved for JS API compatibility. */
.dashboard-shell.canvassing-dedicated > :not(.canvassing-standalone-header):not(#canvassingPerformancePanel):not(.modal) { display:none!important; }
.dashboard-shell.canvassing-dedicated #canvassingPerformancePanel { display:block!important; }
.dashboard-shell.canvassing-dedicated .canvassing-standalone-header { display:flex; }
.dashboard-shell.canvassing-dedicated #canvassingPerformancePanel .data-panel-head { gap:16px; }

/* V6.9.1 Customer Dashboard = Project-based monitoring */
.project-dashboard-shell,.customer-config-shell{max-width:1480px;margin:0 auto}.project-dashboard-title h2,.customer-config-shell h2{font-weight:850;letter-spacing:-.03em}.project-dashboard-list{display:grid;gap:24px}.project-dashboard-card{overflow:hidden}.project-card-header{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:24px 26px;border-bottom:1px solid var(--border);background:linear-gradient(180deg,#fff,#fbfdfc)}.project-card-header h3{font-size:24px;font-weight:850;margin:5px 0 7px}.project-period{font-size:13px;color:var(--muted);font-weight:650}.project-period span{color:var(--primary);font-size:10px;margin-right:5px}.project-customer-count{min-width:95px;text-align:center;border:1px solid #cfe5d7;background:#f0f8f3;border-radius:14px;padding:10px 14px}.project-customer-count strong{display:block;font-size:22px;color:var(--primary)}.project-customer-count span{display:block;font-size:11px;color:var(--muted);text-transform:uppercase;font-weight:800}.project-kpi-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;padding:20px 24px;background:#f8fbf9;border-bottom:1px solid var(--border)}.project-kpi{border:1px solid #dce8e0;border-radius:14px;padding:16px;background:#fff}.project-kpi-primary{background:#eef8f2;border-color:#b9ddc7}.project-kpi span{display:block;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;color:#627067}.project-kpi strong{display:block;font-size:20px;margin-top:5px}.project-kpi small{display:block;color:var(--muted);margin-top:4px}.project-customer-table th{font-size:11px;text-transform:uppercase;letter-spacing:.035em;color:#66736b;background:#fbfdfc}.project-customer-table th,.project-customer-table td{padding:13px 16px}.project-customer-table code{color:#056342;background:#edf8f1;padding:4px 7px;border-radius:6px}.project-sales-total{font-weight:800;color:#174d35}.project-customer-table tfoot th{background:#eef8f2;border-top:2px solid #cfe5d7;color:#174d35}.project-empty-state{text-align:center;padding:64px 24px}.project-empty-icon{width:62px;height:62px;margin:0 auto 16px;border-radius:18px;display:grid;place-items:center;background:#e8f5ed;color:var(--primary);font-size:30px}.project-empty-state h4{font-weight:850}
.config-panel{padding:24px}.config-panel-head{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;margin-bottom:20px;padding-bottom:18px;border-bottom:1px solid var(--border)}.config-panel-head.compact{align-items:center}.config-panel-head h4{font-weight:850;margin:5px 0}.config-panel-head p{margin:0;color:var(--muted);font-size:13px}.config-switch-list{display:grid;gap:10px}.config-switch-row{display:flex;justify-content:space-between;align-items:center;gap:18px;border:1px solid var(--border);border-radius:13px;padding:14px 16px;background:#fbfdfc}.config-switch-row strong,.config-switch-row small{display:block}.config-switch-row small{color:var(--muted);margin-top:3px}.config-switch-row .form-check-input{width:2.3em;height:1.25em;flex:0 0 auto}.project-editor-card{position:sticky;top:18px}.project-customer-picker{border-top:1px solid var(--border);padding-top:18px}.selected-customer-counter,.project-count-badge{font-size:12px;font-weight:800;color:#056342;background:#e7f5ec;border-radius:999px;padding:7px 11px;white-space:nowrap}.customer-filter-box{position:relative}.customer-filter-box span{position:absolute;left:12px;top:8px;color:var(--muted);z-index:2}.customer-filter-box input{padding-left:35px}.project-customer-options{border:1px solid var(--border);border-radius:12px;margin-top:10px;max-height:330px;overflow:auto;background:#fff}.project-customer-option{display:flex;align-items:center;gap:11px;padding:10px 12px;border-bottom:1px solid #edf1ee;cursor:pointer}.project-customer-option:last-child{border-bottom:0}.project-customer-option:hover{background:#f6fbf8}.project-customer-option span{min-width:0}.project-customer-option strong,.project-customer-option small{display:block}.project-customer-option strong{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.project-customer-option small{font-size:11px;color:var(--muted);margin-top:2px}.config-save-row{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:20px;padding-top:18px;border-top:1px solid var(--border)}.project-config-list{display:grid;gap:11px}.project-config-item{display:flex;justify-content:space-between;align-items:center;gap:16px;border:1px solid var(--border);border-radius:14px;padding:16px;background:#fff}.project-config-item.is-inactive{opacity:.66;background:#f7f8f7}.project-config-main h5{font-size:16px;font-weight:850;margin:4px 0 7px}.project-config-status{font-size:9px;font-weight:900;letter-spacing:.08em;color:#087248}.is-inactive .project-config-status{color:#6c757d}.project-config-meta{display:flex;gap:7px;flex-wrap:wrap;font-size:12px;color:var(--muted)}.project-config-actions{display:flex;gap:7px;align-items:center;flex:0 0 auto}.project-list-empty{display:grid;gap:4px;text-align:center;color:var(--muted);padding:45px 16px;border:1px dashed var(--border);border-radius:14px}.project-list-empty strong{color:#33473a}
@media(max-width:991px){.project-editor-card{position:static}.project-kpi-grid{grid-template-columns:1fr}.project-card-header{align-items:flex-start}.config-panel-head{flex-direction:column}.config-panel-head.compact{align-items:flex-start}}@media(max-width:700px){.project-card-header,.project-config-item,.config-save-row{flex-direction:column;align-items:stretch}.project-customer-count{align-self:flex-start}.project-config-actions{justify-content:flex-start}.config-panel{padding:17px}}
