@import url("./tokens.css");

*{box-sizing:border-box;margin:0;padding:0;}
html,body{height:100%;overflow:hidden;}
body{background:var(--bg);color:var(--text);font-family:"Segoe UI",system-ui,Arial,sans-serif;display:flex;flex-direction:column;font-size:13px;}

/* ── HEADER ─────────────────────────────────────────────── */
header{height:60px;background:var(--white);flex-shrink:0;border-bottom:2.5px solid var(--gold-l);display:flex;align-items:center;padding:0 16px;gap:12px;box-shadow:0 2px 12px var(--shadow2);z-index:2000;}
.logo-img{height:46px;width:auto;object-fit:contain;flex-shrink:0;filter:drop-shadow(0 1px 3px rgba(0,0,0,0.12));}
.hdr-info{flex:1;min-width:0;}
.hdr-title{font-size:15px;font-weight:800;color:var(--gold-dd);letter-spacing:.05px;white-space:nowrap;}
.hdr-sub{font-size:10.5px;color:var(--text3);margin-top:1px;white-space:nowrap;}
.hdr-btns{display:flex;gap:6px;}
.btn{background:var(--white);border:1.5px solid var(--border2);color:var(--text2);padding:5px 12px;border-radius:8px;cursor:pointer;font-size:11.5px;font-weight:500;transition:all .15s;white-space:nowrap;display:flex;align-items:center;gap:5px;}
.btn:hover{border-color:var(--gold);color:var(--gold-d);background:var(--gold-bg);}
.btn.active{background:var(--gold-bg2);border-color:var(--gold);color:var(--gold-d);font-weight:700;}
.btn svg{flex-shrink:0;}

/* ── LAYOUT ─────────────────────────────────────────────── */
.layout{display:flex;flex:1;overflow:hidden;}

/* ── SIDEBAR ─────────────────────────────────────────────── */
.sidebar{width:275px;flex-shrink:0;background:var(--bg);border-right:1px solid var(--border);display:flex;flex-direction:column;overflow:hidden;box-shadow:3px 0 14px var(--shadow);}
.sidebar-scroll{flex:0 0 auto;max-height:48%;overflow-y:auto;display:flex;flex-direction:column;}
.sec{background:var(--white);border-bottom:1px solid var(--border);padding:11px 13px;}
.sec-title{font-size:10px;font-weight:800;color:var(--text3);text-transform:uppercase;letter-spacing:.9px;margin-bottom:8px;display:flex;align-items:center;gap:5px;}
.sec-title::before{content:'';display:block;width:3px;height:12px;background:var(--gold-l);border-radius:2px;flex-shrink:0;}

/* Stats cards */
.stats-row{display:flex;gap:6px;}
.stat-card{flex:1;background:linear-gradient(135deg,var(--gold-bg) 0%,rgba(255,242,204,0.6) 100%);border:1px solid rgba(184,134,11,.2);border-radius:9px;padding:9px 6px;text-align:center;}
.stat-val{font-size:22px;font-weight:900;color:var(--gold-d);line-height:1;}
.stat-lbl{font-size:9px;color:var(--text3);margin-top:2px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;}

/* Inputs */
.inp-wrap{position:relative;}
.inp-ico{position:absolute;left:9px;top:50%;transform:translateY(-50%);opacity:.4;pointer-events:none;}
input[type=text],select{width:100%;background:var(--bg);border:1.5px solid var(--border);color:var(--text);padding:7px 10px 7px 32px;border-radius:8px;font-size:12px;outline:none;transition:border .15s;-webkit-appearance:none;appearance:none;}
input[type=text]::placeholder{color:var(--text3);}
input[type=text]:focus,select:focus{border-color:var(--gold-l);background:var(--white);box-shadow:0 0 0 3px rgba(184,134,11,.1);}
select{padding-left:10px;cursor:pointer;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239A8E7A'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center;}

/* Group filter buttons */
.grp-btns{display:flex;flex-wrap:wrap;gap:5px;}
.grp-btn{background:var(--bg);border:1.5px solid var(--border);color:var(--text2);padding:4px 10px;border-radius:14px;cursor:pointer;font-size:11px;font-weight:500;transition:all .15s;white-space:nowrap;display:flex;align-items:center;gap:5px;}
.grp-btn::before{content:'';display:block;width:7px;height:7px;border-radius:50%;background:var(--dot-clr,#9A8E7A);flex-shrink:0;}
.grp-btn:hover{border-color:var(--gold-l);color:var(--gold-d);}
.grp-btn.on{background:var(--gold-bg2);border-color:var(--gold);color:var(--gold-d);font-weight:700;}

/* Legend */
.leg-bar{height:12px;border-radius:6px;background:linear-gradient(to right,rgba(200,190,175,.25),rgba(201,168,76,.45),rgba(184,134,11,.63),rgba(139,101,8,.77),rgba(101,69,5,.89));border:1px solid var(--border);margin-bottom:5px;}
.leg-labels{display:flex;justify-content:space-between;font-size:9.5px;color:var(--text3);}

/* Province stats */
.prov-stat-row{display:flex;align-items:center;gap:7px;padding:4px 0;border-bottom:1px solid rgba(221,213,196,.5);cursor:pointer;border-radius:4px;transition:background .1s;}
.prov-stat-row:hover{background:var(--gold-bg);}
.prov-stat-row:last-child{border-bottom:none;}
.pst-name{font-size:11px;font-weight:600;color:var(--text2);min-width:100px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.pst-bar-wrap{flex:1;background:var(--border);border-radius:3px;height:5px;overflow:hidden;}
.pst-bar{height:100%;background:var(--gold-l);border-radius:3px;transition:width .3s;}
.pst-cnt{font-size:11px;font-weight:800;color:var(--gold-d);min-width:28px;text-align:right;}

/* Customer list */
.kh-sort-row{display:flex;gap:5px;margin-bottom:7px;}
.kh-sort-btn{background:var(--bg);border:1.5px solid var(--border);color:var(--text3);padding:3px 8px;border-radius:14px;cursor:pointer;font-size:10px;font-weight:600;transition:all .12s;}
.kh-sort-btn.on{background:var(--gold-bg2);border-color:var(--gold-l);color:var(--gold-d);}
.kh-list{overflow-y:auto;flex:1;}
.kh-prov-hdr{display:flex;align-items:center;justify-content:space-between;padding:5px 6px 4px;background:var(--gold-bg);border-bottom:1px solid rgba(184,134,11,.2);margin-top:4px;border-radius:5px 5px 0 0;position:sticky;top:0;z-index:1;}
.kh-prov-hdr:first-child{margin-top:0;}
.kh-prov-name{font-size:10.5px;font-weight:800;color:var(--gold-d);}
.kh-prov-ct{background:var(--gold);color:white;font-size:9px;font-weight:800;padding:1px 6px;border-radius:10px;}
.kh-item{padding:6px 7px;display:flex;gap:7px;align-items:flex-start;border-bottom:1px solid rgba(221,213,196,.6);transition:background .1s;}
.kh-item:hover{background:rgba(255,249,238,.8);}
.kh-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0;margin-top:4px;border:1.5px solid transparent;}
.kh-body{flex:1;min-width:0;}
.kh-name{font-size:11.5px;font-weight:600;color:var(--text);line-height:1.35;word-break:break-word;}
.kh-name mark{background:#FFE87A;border-radius:2px;padding:0 1px;}
.kh-meta-row{display:flex;align-items:center;gap:5px;margin-top:2px;flex-wrap:wrap;}
.kh-badge{display:inline-block;font-size:9.5px;font-weight:600;padding:1px 6px;border-radius:10px;border:1px solid currentColor;white-space:nowrap;}
.kh-empty{color:var(--text3);font-size:11px;text-align:center;padding:18px 0;line-height:1.6;}
.kh-more{color:var(--gold);font-size:10.5px;text-align:center;padding:5px;border-top:1px solid var(--border);cursor:pointer;font-weight:600;}
.kh-more:hover{background:var(--gold-bg);}

/* MAP */
#map-wrap{flex:1;position:relative;overflow:hidden;}
#map{width:100%;height:100%;}
.leaflet-container{background:#b6d0e2 !important;font-family:"Segoe UI",Arial,sans-serif;}

/* Loader */
#loader{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;background:rgba(245,242,236,.93);z-index:9999;gap:12px;}
.spin{width:40px;height:40px;border:3px solid var(--border);border-top-color:var(--gold);border-radius:50%;animation:_sp 1s linear infinite;}
@keyframes _sp{to{transform:rotate(360deg);}}
#loader-msg{color:var(--text3);font-size:12px;text-align:center;max-width:220px;line-height:1.6;}

/* Tooltip */
.prov-tip{background:var(--white) !important;border:1.5px solid var(--gold-l) !important;border-radius:10px !important;padding:10px 14px !important;box-shadow:0 6px 20px rgba(0,0,0,.14) !important;font-size:12px !important;max-width:240px;pointer-events:none;}
.prov-tip::before{display:none !important;}
.tip-title{font-size:13.5px;font-weight:800;color:var(--gold-dd);margin-bottom:5px;}
.tip-cnt{color:var(--gold);font-weight:700;font-size:13px;margin-bottom:4px;}
.tip-row{color:var(--text2);font-size:11px;display:flex;justify-content:space-between;gap:8px;padding:2px 0;border-bottom:1px solid var(--border);}
.tip-row:last-child{border-bottom:none;}

/* Province labels */
.prov-lbl{background:rgba(255,255,255,.85);border:1px solid rgba(184,134,11,.45);border-radius:4px;padding:2px 6px;font-size:9.5px;font-weight:700;color:#5a3c00;white-space:nowrap;pointer-events:none;box-shadow:0 1px 4px rgba(0,0,0,.1);}
.island-lbl{background:none;border:none;pointer-events:none;}
.island-lbl-inner{font-size:11px;font-weight:700;color:#5a3c00;white-space:nowrap;text-shadow:0 0 3px #fff,0 0 3px #fff;}

/* Count badges */
.cnt-wrap{background:none !important;border:none !important;box-shadow:none !important;}
.cnt-badge{display:inline-flex;align-items:center;justify-content:center;background:rgba(255,255,255,.93);border:2px solid #B8860B;border-radius:12px;padding:0 7px;min-width:26px;height:22px;font-size:11.5px;font-weight:900;color:#6A4400;box-shadow:0 2px 8px rgba(0,0,0,.2);white-space:nowrap;transition:transform .15s;}
.cnt-badge.sel{background:#FFF2D2;border-color:#7A4800;color:#5A3000;transform:scale(1.18);box-shadow:0 3px 12px rgba(184,134,11,.4);}

/* COMPARE */
.cmp-panel{width:295px;flex-shrink:0;display:none;flex-direction:column;gap:8px;background:var(--white);border-left:1px solid var(--border);padding:12px;overflow-y:auto;box-shadow:-3px 0 14px var(--shadow);}
.cmp-hdr{display:flex;justify-content:space-between;align-items:center;font-size:10px;font-weight:800;color:var(--text3);text-transform:uppercase;letter-spacing:.9px;}
.cmp-card{background:var(--bg);border:1.5px solid var(--border);border-radius:10px;padding:12px;min-height:85px;}
.cmp-card.sel{border-color:var(--gold);background:var(--gold-bg);}
.cmp-hint{color:var(--text3);font-size:11px;text-align:center;padding:18px 0;line-height:1.7;}
.cmp-vs{text-align:center;font-size:11px;font-weight:800;color:var(--text3);}
.cmp-prov{font-size:14px;font-weight:800;color:var(--gold-d);margin-bottom:5px;}
.cmp-cnt{font-size:30px;font-weight:900;color:var(--gold-d);line-height:1;}
.cmp-unit{font-size:11px;color:var(--text3);}
.cmp-row{display:flex;justify-content:space-between;align-items:center;padding:3px 0;border-bottom:1px solid var(--border);font-size:11px;}
.cmp-bar{height:3px;border-radius:2px;transition:width .4s;}
.cmp-bwrap{background:var(--border);border-radius:2px;height:3px;overflow:hidden;margin-bottom:5px;}

::-webkit-scrollbar{width:4px;}
::-webkit-scrollbar-thumb{background:var(--border2);border-radius:2px;}
::-webkit-scrollbar-thumb:hover{background:var(--gold-l);}
.leaflet-control-attribution{font-size:9px !important;opacity:.7;}
/* ── COLLAPSIBLE SECTIONS ──────────────────────────────── */
.sec-toggle{cursor:pointer;user-select:none;justify-content:space-between;}
.sec-toggle:hover{color:var(--gold-d);}
.sec-chev{font-size:13px;color:var(--gold-l);transition:transform .22s;flex-shrink:0;margin-left:auto;padding-left:6px;line-height:1;}
.sec-toggle.closed .sec-chev{transform:rotate(-90deg);}
.sec-body{overflow:hidden;transition:max-height .28s cubic-bezier(.4,0,.2,1),opacity .22s;max-height:500px;opacity:1;}
.sec-body.shut{max-height:0;opacity:0;pointer-events:none;}
.sec.collapsible{padding-bottom:0;}
.sec.collapsible .sec-toggle{margin-bottom:0;padding-bottom:10px;}
.sec.collapsible .sec-body{padding-bottom:11px;}

/* ── RESPONSIVE ─────────────────────────────────────────── */
.btn-menu{display:none;background:none;border:1.5px solid var(--border2);border-radius:8px;cursor:pointer;padding:5px 9px;color:var(--text2);align-items:center;justify-content:center;flex-shrink:0;transition:all .15s;}
.btn-menu:hover{border-color:var(--gold);color:var(--gold);background:var(--gold-bg);}
.sidebar-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.38);z-index:1490;-webkit-tap-highlight-color:transparent;}
.sidebar-overlay.on{display:block;}
.sidebar-close-row{display:none;align-items:center;justify-content:space-between;padding:10px 13px 9px;background:var(--white);border-bottom:2px solid var(--gold-l);flex-shrink:0;}
.sidebar-close-btn{background:none;border:none;cursor:pointer;font-size:18px;color:var(--text3);line-height:1;padding:2px 6px;border-radius:6px;transition:all .1s;}
.sidebar-close-btn:hover{background:var(--gold-bg);color:var(--gold);}
/* Tablet */
@media(max-width:1024px){
  .sidebar{width:248px;}
  .btn-txt{display:none;}
  .hdr-btns .btn{padding:5px 9px;}
}
/* Mobile */
@media(max-width:768px){
  header{height:52px;padding:0 10px;gap:8px;}
  .logo-img{height:36px;}
  .hdr-title{font-size:13px;}
  .hdr-sub{display:none;}
  .btn-menu{display:flex;}
  .hdr-btns{gap:4px;}
  .hdr-btns .btn{padding:5px 9px;}
  .sidebar{
    position:fixed;left:0;top:0;bottom:0;height:100%;width:285px;
    z-index:1500;transform:translateX(-100%);
    transition:transform .28s cubic-bezier(.4,0,.2,1);
    border-right:none;box-shadow:4px 0 28px rgba(0,0,0,.22);
  }
  .sidebar.mob-open{transform:translateX(0);}
  .sidebar-close-row{display:flex;}
  .cmp-panel{
    position:fixed !important;right:0 !important;top:52px;bottom:0;
    height:calc(100vh - 52px) !important;width:285px !important;
    z-index:1500;border-left:none;
    box-shadow:-4px 0 28px rgba(0,0,0,.22);
    transform:translateX(110%);
    transition:transform .28s cubic-bezier(.4,0,.2,1);
  }
  .cmp-panel.mob-open{transform:translateX(0);}
  html,body{overflow:hidden;}
}
/* Small mobile */
@media(max-width:480px){
  .hdr-title{font-size:12px;}
  .logo-img{height:30px;}
  .hdr-btns .btn:not(#btnReset):not(#btnHome){display:none;}
  .sidebar{width:100vw;}
  .cmp-panel{width:100vw !important;}
}


/* ── SIDEBAR FIXED HEADER + SCROLL FIX ─────────────────── */
.sidebar-close-row{flex-shrink:0;}
.sidebar-footer{display:none;flex-shrink:0;padding:10px 13px;background:var(--white);border-top:1.5px solid var(--gold-l);}
.sidebar-footer-btn{width:100%;background:var(--gold);color:white;border:none;border-radius:10px;padding:11px;font-size:13px;font-weight:700;cursor:pointer;letter-spacing:.3px;transition:background .15s;}
.sidebar-footer-btn:hover{background:var(--gold-d);}
@media(max-width:768px){
  .sidebar-footer{display:block;}
  .sidebar{height:100dvh;}
}

.logo-img{transition:opacity .15s,transform .15s;}
a:has(.logo-img):hover .logo-img{opacity:.85;transform:scale(1.04);}

/* Home btn luôn hiện mọi breakpoint */
#btnHome,a:has(#btnHome){display:flex !important;align-items:center;}

/* ── KH SECTION (pinned, always visible) ───────────────── */
.kh-sec{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden;
  background:var(--white);border-top:2px solid var(--gold-l);}
.kh-sec-hdr{display:flex;align-items:center;justify-content:space-between;
  padding:8px 13px 6px;gap:8px;flex-shrink:0;flex-wrap:wrap;}
.kh-sec-hdr .sec-title{margin-bottom:0 !important;flex:1;}
.kh-sec .kh-sort-row{margin-bottom:0;flex-shrink:0;}
.kh-sec .kh-list{flex:1;min-height:0;overflow-y:auto;}
/* Compact filters */
.sec{padding:8px 11px;}
.sec-title{margin-bottom:6px;}
.sec.collapsible .sec-toggle{padding-bottom:8px;}
.sec.collapsible .sec-body{padding-bottom:8px;}
.stat-val{font-size:19px;}
.stat-lbl{font-size:8.5px;}
.stat-card{padding:7px 4px;}
.grp-btn{padding:3px 8px;font-size:10.5px;}
.kh-item{padding:5px 7px;}
.kh-name{font-size:11px;}

/* ── Hải đảo nhỏ ── */
.si-wrap{background:none!important;border:none!important;overflow:visible;}
.si-dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:#1A6BA0;border:1.5px solid #fff;box-shadow:0 0 4px rgba(0,0,0,.55);vertical-align:middle;flex-shrink:0;}
.si-lbl{position:absolute;left:11px;top:-4px;font-size:10px;font-weight:700;color:#1A6BA0;white-space:nowrap;text-shadow:0 0 3px #fff,0 0 3px #fff,0 0 3px #fff;pointer-events:none;font-family:inherit;}

.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

.active-filters{
  position:absolute;
  top:12px;
  left:50px;
  right:12px;
  z-index:700;
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  pointer-events:none;
}

.filter-chip{
  pointer-events:auto;
  min-height:32px;
  border:1px solid rgba(184,134,11,.35);
  background:rgba(255,255,255,.94);
  color:var(--gold-dd);
  border-radius:16px;
  padding:5px 10px;
  font-size:11px;
  font-weight:700;
  box-shadow:0 2px 10px rgba(0,0,0,.10);
}

.filter-chip.clear{
  background:var(--gold);
  color:#fff;
}

.modal-backdrop{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:rgba(0,0,0,.38);
  z-index:3000;
}

.modal-backdrop.on{display:flex;}
.detail-modal{
  width:min(440px,100%);
  background:var(--white);
  border:1px solid var(--border);
  border-radius:10px;
  box-shadow:0 18px 48px rgba(0,0,0,.22);
}
.detail-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  border-bottom:1px solid var(--border);
}
.detail-title{font-size:15px;font-weight:800;color:var(--gold-dd);line-height:1.35;}
.detail-close{border:0;background:transparent;font-size:22px;line-height:1;cursor:pointer;color:var(--text3);}
.detail-body{padding:14px 16px;display:grid;gap:10px;}
.detail-row{display:grid;gap:3px;}
.detail-label{font-size:10px;text-transform:uppercase;letter-spacing:.7px;color:var(--text3);font-weight:800;}
.detail-value{font-size:13px;color:var(--text);}

.kh-item{
  width:100%;
  border-left:0;
  border-right:0;
  border-top:0;
  background:transparent;
  text-align:left;
  cursor:pointer;
}

.stats-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:6px;
}

.export-row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:6px;
  margin-top:8px;
}

.map-error{
  color:var(--text2);
  font-size:12px;
  text-align:center;
  max-width:280px;
  line-height:1.6;
}

.btn{text-decoration:none;}
button{font-family:inherit;}
.sec-toggle{width:100%;border:0;background:transparent;text-align:left;}
.prov-stat-row{width:100%;border-left:0;border-right:0;border-top:0;background:transparent;text-align:left;font-family:inherit;}
.prov-stat-row[aria-current="true"]{background:var(--gold-bg2);}

/* Refined two-panel dashboard layout */
body{
  font-size:14px;
  background:#f4f0e8;
}
header{
  height:64px;
  padding:0 18px;
  gap:14px;
  border-bottom:3px solid var(--gold-l);
}
.hdr-title{font-size:16px;letter-spacing:0;}
.hdr-sub{font-size:12px;color:#6d6250;}
.btn{
  min-height:36px;
  padding:7px 12px;
  border-radius:7px;
  font-size:12px;
  font-weight:700;
}
.app-shell{
  display:grid;
  grid-template-columns:minmax(280px,320px) minmax(380px,1fr) minmax(340px,390px);
  min-height:0;
}
.control-panel{
  width:auto;
  min-width:0;
  background:#f7f3eb;
  border-right:1px solid #d6cbb8;
  box-shadow:2px 0 14px rgba(69,48,10,.08);
}
.control-scroll{
  max-height:none;
  flex:1 1 auto;
  gap:12px;
  padding:14px;
  overflow-y:auto;
}
.panel-section,
.sec.panel-section{
  background:#fff;
  border:1px solid #ded4c2;
  border-radius:8px;
  padding:14px;
  box-shadow:0 1px 8px rgba(55,41,12,.05);
}
.sec{
  border-bottom:0;
}
.sec-title,
.right-title,
.preview-title{
  letter-spacing:0;
}
.sec-title{
  margin-bottom:12px;
  font-size:12px;
  color:#75664f;
}
.sec-title::before{
  height:16px;
  width:4px;
}
.readable-stats{
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.stat-card{
  border-radius:8px;
  padding:12px 10px;
  background:#fffaf0;
}
.stat-val{
  font-size:28px;
  line-height:1.05;
}
.stat-lbl{
  font-size:10px;
  line-height:1.25;
  letter-spacing:.2px;
  margin-top:5px;
}
.field-label{
  display:block;
  margin:12px 0 6px;
  font-size:11px;
  font-weight:800;
  color:#75664f;
  text-transform:uppercase;
  letter-spacing:.35px;
}
.inp-wrap{display:block;}
.inp-ico{
  left:10px;
  font-size:0;
}
.inp-ico::before{
  content:'⌕';
  font-size:14px;
}
input[type=text],select{
  min-height:42px;
  font-size:13px;
  border-radius:7px;
  background:#fbf8f1;
}
.group-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:7px;
}
.grp-btn{
  width:100%;
  min-width:0;
  min-height:38px;
  justify-content:flex-start;
  border-radius:7px;
  padding:8px 10px;
  font-size:12px;
  line-height:1.2;
  text-align:left;
  white-space:normal;
  overflow-wrap:anywhere;
  background:#fbf8f1;
}
.export-row{
  grid-template-columns:1fr;
  gap:8px;
  margin-top:12px;
}
.province-list{
  display:grid;
  gap:4px;
  margin-top:10px;
}
.prov-stat-row{
  min-height:34px;
  padding:7px 6px;
  border-radius:6px;
}
.pst-name{font-size:12px;min-width:118px;}
.pst-cnt{font-size:12px;}
.map-stage{
  min-width:0;
  border-right:1px solid #d6cbb8;
}
.customer-panel{
  min-width:0;
  background:#f7f3eb;
  border-left:1px solid #d6cbb8;
  display:grid;
  grid-template-rows:minmax(0,1fr);
  gap:12px;
  padding:14px;
  overflow:hidden;
}
.customer-browser{
  min-height:0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.right-panel-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.right-title{
  margin:0;
  font-size:18px;
  font-weight:850;
  color:var(--gold-dd);
}
.right-subtitle{
  margin-top:4px;
  color:#7c705d;
  font-size:12px;
  line-height:1.35;
}
.segmented-control{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:4px;
  padding:4px;
  margin-bottom:12px;
  border:1px solid #d9ceb9;
  border-radius:8px;
  background:#f5efe3;
}
.kh-sort-btn{
  min-height:36px;
  border:0;
  border-radius:6px;
  padding:7px 8px;
  font-size:12px;
  color:#635744;
  background:transparent;
}
.kh-sort-btn.on{
  color:var(--gold-dd);
  background:#fff;
  border-color:transparent;
  box-shadow:0 1px 5px rgba(54,39,7,.12);
}
.customer-list{
  min-height:0;
  overflow-y:auto;
  padding-right:4px;
}
.kh-prov-hdr{
  padding:8px 10px;
  margin:8px 0 2px;
  border-radius:7px;
  position:sticky;
  top:0;
}
.kh-prov-name{font-size:12px;}
.kh-prov-ct{font-size:10px;padding:2px 7px;}
.kh-item{
  min-height:56px;
  padding:10px;
  gap:10px;
  border:1px solid transparent;
  border-bottom-color:rgba(221,213,196,.72);
  border-radius:7px;
}
.kh-item:hover,
.kh-item:focus-visible{
  background:#fffaf0;
  border-color:#d8c58d;
}
.kh-item.selected{
  background:#fff3d1;
  border-color:#b8860b;
  box-shadow:inset 3px 0 0 #b8860b;
}
.kh-dot{
  width:10px;
  height:10px;
  margin-top:5px;
}
.kh-name{
  font-size:13px;
  line-height:1.42;
}
.kh-badge{
  font-size:10.5px;
  padding:2px 7px;
}
.detail-preview{
  display:none;
  min-height:0;
  overflow:hidden;
  border-top:3px solid var(--gold-l);
}
.customer-panel.has-customer-selection{
  grid-template-rows:minmax(0,1fr) auto;
}
.customer-panel.has-customer-selection .detail-preview{display:block;}
.preview-summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:52px;
  cursor:pointer;
  list-style:none;
}
.preview-summary::-webkit-details-marker{display:none;}
.preview-summary-copy{min-width:0;}
.preview-kicker{
  display:block;
  color:#8b7a5c;
  font-size:10px;
  font-weight:850;
  text-transform:uppercase;
  letter-spacing:.5px;
  margin-bottom:3px;
}
.preview-title{
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
  color:var(--gold-dd);
  font-size:13px;
  line-height:1.3;
}
.preview-action{
  flex-shrink:0;
  border:1px solid var(--border2);
  border-radius:6px;
  padding:7px 9px;
  color:var(--gold-dd);
  background:var(--gold-bg);
  font-size:11px;
  font-weight:800;
}
.preview-summary:focus-visible{outline:3px solid rgba(184,134,11,.45);outline-offset:2px;}
.preview-summary:hover .preview-action{background:var(--gold-bg2);}
.detail-preview details[open] .preview-action{background:var(--gold-bg2);}
.preview-action-close,.detail-preview details[open] .preview-action-open{display:none;}
.detail-preview details[open] .preview-action-close{display:inline;}
.preview-body{
  display:grid;
  gap:4px;
  max-height:min(230px,32dvh);
  overflow:auto;
  margin-top:10px;
  padding-top:4px;
  border-top:1px solid var(--border);
}
.preview-empty{
  color:#7c705d;
  line-height:1.55;
  font-size:13px;
}
.detail-row{
  padding:9px 0;
  border-top:1px solid #eee4d2;
}
.detail-row:first-child{border-top:0;}
.detail-label{
  font-size:10.5px;
  letter-spacing:.35px;
}
.detail-value{
  font-size:13.5px;
  line-height:1.45;
}
.active-filters{
  top:14px;
  left:58px;
  right:16px;
  gap:8px;
}
.filter-chip{
  min-height:34px;
  border-radius:17px;
  font-size:12px;
  padding:6px 11px;
}
.btn-menu{
  min-height:38px;
  padding:7px 10px;
  font-size:12px;
  font-weight:800;
}
.sidebar-footer{display:none;}
.modal-backdrop{display:none !important;}
.modal-backdrop.on{display:none !important;}
