/* ── QMaps Țigări – Dark Theme ────────────────── */
:root {
  --bg: #1a1a2e;
  --bg2: #16213e;
  --bg3: #0f3460;
  --card: #1e2a4a;
  --card2: #233150;
  --border: #2a3a5c;
  --text: #e8e8f0;
  --text2: #c4cbdf;
  --accent: #e94560;
  --accent2: #ff6b6b;
  --green: #00d2a0;
  --green2: #00b894;
  --blue: #5f9df7;
  --yellow: #ffd166;
  --orange: #f5a623;
  --purple: #a855f7;
  --radius: 10px;
  --shadow: 0 4px 20px rgba(0,0,0,0.4);
}

* { margin:0; padding:0; box-sizing:border-box; }
html { overflow:hidden; width:100%; height:100%; }
body { font-family:'Inter',system-ui,sans-serif; background:var(--bg); color:var(--text); overflow:hidden; height:100vh; width:100vw; max-width:100vw; overflow-x:hidden; }

/* ── HOME GRID MENU ── */
.home-grid{position:absolute;top:0;left:0;right:0;bottom:0;background:var(--bg);z-index:800;overflow-y:auto;display:flex;flex-direction:column}
.home-grid-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;background:var(--bg2);border-bottom:1px solid var(--border);position:sticky;top:0;z-index:1}
.home-grid-title{font-size:1.3rem;font-weight:700;color:var(--accent)}
.home-user-label{font-size:.82rem;color:var(--text2)}
.home-grid-scroll{padding:12px 16px 32px;flex:1}
.home-grid-section-label{font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:1.5px;color:var(--text2);margin:18px 0 10px 4px}
.home-grid-section-label:first-child{margin-top:6px}
.home-grid-items{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.grid-icon-card{display:flex;flex-direction:column;align-items:center;gap:8px;padding:16px 6px 12px;background:var(--card);border:1px solid var(--border);border-radius:14px;cursor:pointer;transition:all .2s;-webkit-tap-highlight-color:transparent}
.grid-icon-card:hover{transform:translateY(-2px);box-shadow:0 4px 16px rgba(0,0,0,.4);border-color:var(--accent)}
.grid-icon-card:active{transform:scale(.96)}
.grid-icon-circle{width:52px;height:52px;border-radius:14px;background:var(--icon-bg,linear-gradient(135deg,#e94560,#c2185b));display:flex;align-items:center;justify-content:center;box-shadow:0 3px 12px rgba(0,0,0,.3)}
.grid-icon-circle svg{width:26px;height:26px;color:#fff;stroke-width:2}
.grid-icon-card span{font-size:.76rem;font-weight:600;text-align:center;color:var(--text);line-height:1.2;max-width:90px;overflow:hidden;text-overflow:ellipsis}
.back-to-menu-btn{background:var(--accent)!important;color:#fff!important;border:none!important;padding:6px 14px!important;border-radius:8px!important;font-size:.85rem!important;font-weight:700!important;cursor:pointer;line-height:1;margin-right:4px;letter-spacing:.3px;white-space:nowrap;animation:pulseBack 2s ease-in-out 3}
.back-to-menu-btn:hover{opacity:.85;transform:scale(1.05)}
@keyframes pulseBack{0%,100%{box-shadow:0 0 0 0 rgba(233,69,96,.5)}50%{box-shadow:0 0 0 8px rgba(233,69,96,0)}}

@media(min-width:600px){
  .home-grid-items{grid-template-columns:repeat(4,1fr);gap:14px}
  .grid-icon-circle{width:58px;height:58px;border-radius:16px}
  .grid-icon-circle svg{width:28px;height:28px}
  .grid-icon-card span{font-size:.82rem}
  .home-grid-scroll{padding:16px 24px 40px;max-width:700px;margin:0 auto}
}
@media(min-width:1024px){
  .home-grid-items{grid-template-columns:repeat(5,1fr);gap:16px}
  .home-grid-scroll{max-width:900px}
}

/* ── LOGIN ── */
.login-page {
  display:flex; align-items:center; justify-content:center; height:100vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}
.login-card {
  background:var(--card); padding:40px; border-radius:16px; width:380px;
  box-shadow:var(--shadow); text-align:center; border:1px solid var(--border);
}
.login-logo { font-size:48px; margin-bottom:12px; position:relative; display:inline-block; }

/* ── SMOKE ANIMATION ── */
.smoke-wrap {
  position:absolute; top:-10px; left:50%; transform:translateX(-50%);
  width:40px; height:80px; pointer-events:none; z-index:1;
}
.smoke-particle {
  position:absolute; bottom:40px; left:50%; width:8px; height:8px;
  border-radius:50%;
  background:radial-gradient(circle, rgba(200,210,230,0.5) 0%, rgba(200,210,230,0) 70%);
  animation: smoke-rise 3s ease-out infinite;
  opacity:0;
}
.smoke-particle.s1 { animation-delay:0s; left:45%; }
.smoke-particle.s2 { animation-delay:0.6s; left:55%; width:10px; height:10px; }
.smoke-particle.s3 { animation-delay:1.2s; left:48%; width:6px; height:6px; }
.smoke-particle.s4 { animation-delay:1.8s; left:52%; width:9px; height:9px; }
.smoke-particle.s5 { animation-delay:2.4s; left:50%; width:7px; height:7px; }

@keyframes smoke-rise {
  0% { transform:translateY(0) translateX(0) scale(1); opacity:0; }
  10% { opacity:0.6; }
  40% { opacity:0.4; }
  100% { transform:translateY(-70px) translateX(var(--drift, 8px)) scale(3.5); opacity:0; }
}
.smoke-particle.s1 { --drift: -10px; }
.smoke-particle.s2 { --drift: 12px; }
.smoke-particle.s3 { --drift: -6px; }
.smoke-particle.s4 { --drift: 15px; }
.smoke-particle.s5 { --drift: -3px; }
.login-card h1 { font-size:24px; margin-bottom:4px; }
.login-sub { color:var(--text2); margin-bottom:24px; font-size:15px; }
.login-card input {
  width:100%; padding:12px 16px; border-radius:8px; border:1px solid var(--border);
  background:var(--bg2); color:var(--text); margin-bottom:12px; font-size:14px; outline:none;
}
.login-card input:focus { border-color:var(--accent); }
.login-card button {
  width:100%; padding:12px; border-radius:8px; border:none; background:var(--accent);
  color:#fff; font-weight:600; font-size:15px; cursor:pointer; margin-top:4px;
  transition:background .2s;
}
.login-card button:hover { background:var(--accent2); }
.login-error { color:var(--accent); margin-top:12px; font-size:14px; }

/* ── HEADER ── */
/* ── TOPBAR (BB-style) ── */
.topbar{background:#010409;color:#e6edf3;padding:.6rem 1rem;display:flex;align-items:center;gap:.8rem;position:sticky;top:0;z-index:1100;border-bottom:1px solid var(--border)}
.topbar h1{font-size:1.1rem;white-space:nowrap;color:var(--accent)}
.topbar .user{font-size:.8rem;opacity:.8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:200px}
.topbar button{background:rgba(255,255,255,.08);color:#e6edf3;border:1px solid var(--border);padding:.4rem .8rem;border-radius:6px;cursor:pointer;font-size:.8rem;touch-action:manipulation;-webkit-tap-highlight-color:transparent;position:relative;z-index:1}
.topbar button:hover{background:rgba(255,255,255,.15)}

/* ── Tab dropdown ── */
.tab-dropdown-wrap{position:relative;flex:1;display:flex;justify-content:center}
.tab-dropdown-btn{background:var(--accent)!important;color:#fff!important;border:none!important;padding:.45rem 1.4rem!important;border-radius:6px;cursor:pointer;font-size:.88rem;font-weight:700;letter-spacing:.5px;min-width:140px;text-align:center}
.tab-dropdown-btn:active{opacity:.85}
.tab-dropdown-menu{display:none;position:absolute;top:100%;left:50%;transform:translateX(-50%);margin-top:4px;background:var(--card);border:1px solid var(--border);border-radius:8px;box-shadow:0 8px 24px rgba(0,0,0,.6);z-index:2000;min-width:200px;overflow:hidden;max-height:70vh;overflow-y:auto}
.tab-dropdown-menu.open{display:block}
.tab-menu-item{display:block;width:100%;background:none;border:none;color:var(--text);padding:.65rem 1rem;font-size:.88rem;font-weight:600;text-align:left;cursor:pointer;letter-spacing:.3px}
.tab-menu-item:hover{background:var(--bg2)}
.tab-menu-item.active{color:var(--accent);background:var(--bg)}

/* ── Tab Groups ── */
.tab-group-header{padding:8px 12px;font-size:.78rem;font-weight:700;color:var(--text2);cursor:pointer;display:flex;justify-content:space-between;align-items:center;border-radius:6px;transition:all .15s;text-transform:uppercase;letter-spacing:.5px;user-select:none}
.tab-group-header:hover{background:rgba(255,255,255,.05);color:var(--text)}
.tab-group-header .tg-arrow{font-size:.7rem;transition:transform .2s;color:var(--text2)}
.tab-group.open .tab-group-header{color:var(--accent)}
.tab-group.open .tab-group-header .tg-arrow{transform:rotate(90deg);color:var(--accent)}
.tab-group-items{max-height:0;overflow:hidden;transition:max-height .25s ease;padding-left:8px}
.tab-group.open .tab-group-items{max-height:500px}
.tab-group-items .tab-menu-item{font-size:.82rem;padding:6px 12px;border-left:2px solid transparent;margin:1px 0}
.tab-group-items .tab-menu-item:hover{border-left-color:var(--accent);padding-left:14px}
.tab-group-items .tab-menu-item.active{border-left-color:var(--accent);color:var(--accent);font-weight:600}

/* Back to Menu button */
.back-to-menu-btn{background:var(--accent)!important;color:#fff!important;border:none!important;padding:.45rem 1rem!important;border-radius:8px!important;font-size:.85rem!important;font-weight:700!important;cursor:pointer;line-height:1;letter-spacing:.3px;white-space:nowrap}
.back-to-menu-btn:hover{opacity:.85;transform:scale(1.05)}

/* ── APP BODY ── */
.app-body { display:flex; height:calc(100vh - 44px); }

/* Map toggle */
.app-body.map-hidden #map{display:none}
.app-body.map-hidden .sidebar{width:100%;min-width:100%;flex:1;border-right:none}
#btnToggleMap{transition:all .15s}
.map-hidden-active{background:var(--accent)!important;color:#fff!important}

/* ── SIDEBAR ── */
.sidebar {
  width:380px; min-width:380px; background:var(--bg2); border-right:1px solid var(--border);
  overflow-y:auto; overflow-x:hidden;
}
.tab-panel { display:none; padding:16px; }
.tab-panel.active { display:block; }
.panel-section { margin-bottom:16px; }
.panel-section h3 { font-size:15px; margin-bottom:8px; color:var(--text); }

.filter-input {
  width:100%; padding:8px 12px; border-radius:6px; border:1px solid var(--border);
  background:var(--card); color:var(--text); font-size:14px; outline:none; margin-bottom:8px;
}
.filter-input:focus { border-color:var(--blue); }
.filter-label { display:block; font-size:13px; color:var(--text2); margin:8px 0 4px; font-weight:600; text-transform:uppercase; letter-spacing:.3px; }
.filter-select, .filter-select-single {
  width:100%; padding:6px 8px; border-radius:6px; border:1px solid var(--border);
  background:var(--card); color:var(--text); font-size:13px; margin-bottom:4px;
}
.filter-select { height:70px; }
.filter-checkbox-group {
  max-height:160px; overflow-y:auto; background:var(--card); border:1px solid var(--border);
  border-radius:6px; padding:4px 0; margin-bottom:4px;
}
.filter-checkbox-group .fcb-item {
  display:flex; align-items:center; gap:6px; padding:4px 10px; cursor:pointer;
  font-size:14px; color:var(--text); transition:background .15s;
}
.filter-checkbox-group .fcb-item:hover { background:var(--card2); }
.filter-checkbox-group .fcb-item input[type="checkbox"] {
  width:16px; height:16px; accent-color:var(--accent); cursor:pointer; flex-shrink:0;
}
.filter-checkbox-group .fcb-item label { cursor:pointer; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.filter-checkbox-group .fcb-item .fcb-count { font-size:12px; color:var(--text2); margin-left:auto; flex-shrink:0; background:var(--bg); padding:0 6px; border-radius:8px; }
.filter-split { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.filter-split section { min-width:0; }
.filter-search-mini { width:100%; padding:6px 10px; border-radius:6px; border:1px solid var(--border); background:var(--card); color:var(--text); font-size:13px; margin-bottom:4px; }
.filter-checklist { max-height:180px; }
/* Census Clienți Iași UAT cascading items */
.cu-uat-item label { display:flex; align-items:center; gap:6px; cursor:pointer; font-size:14px !important; padding:4px 6px !important; }
.cu-uat-item label input[type="checkbox"] { width:16px; height:16px; accent-color:var(--accent); cursor:pointer; flex-shrink:0; }
.cu-uat-item .cu-uat-count { font-size:12px !important; color:var(--text2); background:var(--bg); padding:0 6px; border-radius:8px; margin-left:auto; }
.cu-loc-list { padding-left:22px; }
.cu-loc-list label { font-size:13px !important; padding:3px 4px !important; }
.filter-actions { display:flex; gap:8px; margin-top:10px; flex-wrap:wrap; }

/* ── BUTTONS ── */
.btn {
  padding:8px 16px; border:none; border-radius:6px; font-size:14px; font-weight:500;
  cursor:pointer; transition:all .2s;
}
.btn-primary { background:var(--accent); color:#fff; }
.btn-primary:hover { background:var(--accent2); }
.btn-secondary { background:var(--card); color:var(--text); border:1px solid var(--border); }
.btn-secondary:hover { background:var(--card2); }
.btn-sm { padding:4px 10px; font-size:12px; }
.btn-accent { background:var(--green); color:#fff; }
.btn-accent:hover { background:var(--green2); }
.btn-accent.active { background:var(--accent); animation:pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.7} }

/* ── CLIENT LIST ── */
.list-header { display:flex; justify-content:space-between; align-items:center; }
.client-list { max-height:calc(100vh - 380px); overflow-y:auto; }
.client-card {
  background:var(--card); border:1px solid var(--border); border-radius:8px;
  padding:10px 12px; margin-bottom:6px; cursor:pointer; transition:all .2s;
}
.client-card:hover { border-color:var(--blue); transform:translateX(2px); }
.client-card.inactive { opacity:0.5; }
.cc-name { font-weight:600; font-size:15px; margin-bottom:2px; }
.cc-detail { font-size:13px; color:var(--text2); }
.cc-detail span { margin-right:8px; }
.cc-actions { display:flex; gap:4px; margin-top:6px; flex-wrap:wrap; }
.cc-actions button {
  padding:4px 10px; border:1px solid var(--border); border-radius:4px; background:var(--card2);
  color:var(--text2); font-size:12px; cursor:pointer; transition:all .2s;
}
.cc-actions button:hover { border-color:var(--blue); color:var(--text); }

/* ── MAP ── */
.map-container { flex:1; position:relative; }
#map { width:100%; height:100%; }
.leaflet-popup-content-wrapper { background:var(--card)!important; color:var(--text)!important; border-radius:10px!important; border:1px solid var(--border)!important; }
.leaflet-popup-tip { background:var(--card)!important; }
.leaflet-popup-content { font-size:14px; line-height:1.5; }
.leaflet-tooltip { background:var(--card)!important; color:var(--text)!important; border:1px solid var(--border)!important; border-radius:8px!important; font-size:13px; line-height:1.4; padding:6px 10px!important; box-shadow:var(--shadow)!important; }
.leaflet-tooltip-top:before { border-top-color:var(--border)!important; }

/* ── ROUTE BAR ── */
.route-bar {
  position:absolute; bottom:10px; left:10px; right:10px;
  background:var(--card); border:1px solid var(--border); border-radius:12px;
  padding:10px 16px; z-index:1000; box-shadow:var(--shadow);
  display:flex; align-items:center; gap:12px; flex-wrap:wrap;
}
.route-bar-left { display:flex; align-items:center; gap:8px; font-size:13px; white-space:nowrap; }
.route-bar-icon { font-size:18px; }
.route-list { flex:1; display:flex; flex-wrap:wrap; gap:4px; min-width:100px; max-height:60px; overflow-y:auto; }
.route-chip {
  display:inline-flex; align-items:center; gap:4px; background:var(--blue); color:#fff;
  padding:3px 8px; border-radius:12px; font-size:11px; white-space:nowrap;
}
.route-chip-x {
  background:none; border:none; color:rgba(255,255,255,0.7); cursor:pointer; font-size:12px; padding:0 2px;
}
.route-chip-x:hover { color:#fff; }
.route-bar-actions { display:flex; gap:6px; align-items:center; }
.btn-close-route { background:none; border:none; color:var(--text2); font-size:18px; cursor:pointer; }
.route-card { display:none; }

/* ── ROUTE SELECTED MARKER ── */
.route-selected { filter:drop-shadow(0 0 8px #e94560) drop-shadow(0 0 16px #e94560) !important; }

/* ── POPUP DETAIL ── */
.popup-detail { min-width:220px; }
.popup-table { width:100%; border-collapse:collapse; font-size:13px; margin-top:4px; }
.popup-table td { padding:3px 6px 3px 0; vertical-align:top; }
.popup-table td:first-child { color:var(--text2); white-space:nowrap; font-size:12px; }
.popup-btn {
  display:inline-flex; align-items:center; gap:4px; padding:4px 10px; border-radius:6px;
  background:var(--blue); color:#fff; font-size:13px; border:none; cursor:pointer;
  text-decoration:none; white-space:nowrap;
}
.popup-btn:hover { opacity:0.85; }

/* ── PURCHASE BADGES ── */
.badge-ok {
  display:inline-block; background:rgba(0,210,160,0.15); color:#00d2a0; font-size:12px;
  padding:2px 7px; border-radius:8px; font-weight:600; vertical-align:middle; margin-left:4px;
}
.badge-no {
  display:inline-block; background:rgba(233,69,96,0.15); color:#e94560; font-size:12px;
  padding:1px 6px; border-radius:8px; font-weight:600; vertical-align:middle; margin-left:4px;
}

/* ── DATA TABLES ── */
.data-table-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; }
.data-table {
  width:100%; border-collapse:collapse; font-size:12px; table-layout:fixed;
}
.data-table th {
  background:var(--bg3); color:var(--text); padding:5px 4px; text-align:left;
  position:sticky; top:0; font-weight:600; font-size:11px; overflow:hidden; text-overflow:ellipsis;
}
.data-table td {
  padding:4px 4px; border-bottom:1px solid var(--border); overflow:hidden; text-overflow:ellipsis;
}
.data-table th:first-child, .data-table td:first-child { white-space:normal; word-break:break-word; }
.data-table tr:hover td { background:var(--card2); }
.data-table .num { text-align:right; white-space:nowrap; }
.data-table .good { color:var(--green); font-weight:600; }
.data-table .bad { color:var(--accent); font-weight:600; }
.data-table .total-row td { background:var(--bg3); font-weight:700; }

/* Report buttons */
.report-nav { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:8px; }
.btn-report {
  padding:8px 18px; border:1px solid var(--border); border-radius:8px;
  background:var(--card); color:var(--text2); font-size:13px; cursor:pointer;
  font-weight:500; transition: all 0.2s;
}
.btn-report:hover { background:var(--card2); border-color:var(--blue); }
.btn-report.active { background:var(--blue); color:#fff; border-color:var(--blue); font-weight:600; }

/* Report KPI cards */
.report-kpi-row { display:flex; gap:10px; margin-bottom:16px; flex-wrap:wrap; }
.report-kpi {
  flex:1; min-width:100px; background:var(--card); border:1px solid var(--border);
  border-radius:10px; padding:12px 14px; text-align:center; position:relative; overflow:hidden;
}
.report-kpi.highlight { border-color:var(--blue); background:linear-gradient(135deg, var(--card), rgba(0,123,255,0.06)); }
.report-kpi-label { font-size:10px; text-transform:uppercase; letter-spacing:0.5px; color:var(--text2); margin-bottom:4px; font-weight:600; }
.report-kpi-value { font-size:22px; font-weight:800; color:var(--text); line-height:1.2; }
.report-kpi-sub { font-size:10px; color:var(--text2); margin-top:2px; }
.report-kpi-value.green { color:var(--green); }
.report-kpi-value.accent { color:var(--accent); }
.report-kpi-value.blue { color:var(--blue); }

/* Report section title */
.report-section-title {
  font-size:14px; font-weight:700; color:var(--text); margin:16px 0 8px;
  padding-bottom:6px; border-bottom:2px solid var(--blue); display:inline-block;
}

/* Professional data table overrides for reports */
/* Scrollable table container with sticky header */
.report-table-scroll { max-height:55vh; overflow-y:auto; border:1px solid var(--border); border-radius:8px; }
.report-table { width:100%; border-collapse:separate; border-spacing:0; font-size:12px; table-layout:fixed; }
.report-table th {
  background:var(--bg3); color:var(--text); padding:8px 6px; text-align:left;
  font-weight:700; font-size:11px; text-transform:uppercase; letter-spacing:0.3px;
  border-bottom:2px solid var(--blue);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  position:sticky; top:0; z-index:2;
}
.report-table th.num { text-align:right; }
.report-table td {
  padding:7px 6px; border-bottom:1px solid var(--border); transition: background 0.15s;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.report-table td.num { text-align:right; font-variant-numeric:tabular-nums; font-weight:500; }
.report-table tbody tr:hover td { background:rgba(0,123,255,0.04); }
.report-table .total-row td {
  background:var(--bg3); font-weight:800; border-top:2px solid var(--border);
  border-bottom:none; font-size:12px;
}
.report-table .agent-name { max-width:160px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* Auto-layout table — no fixed widths, columns size to content */
.report-table-auto { table-layout:auto; }
.report-table-auto th { white-space:nowrap; overflow:visible; text-overflow:clip; padding:8px 5px; font-size:10px; }
.report-table-auto td { white-space:nowrap; overflow:visible; text-overflow:clip; padding:6px 5px; }
.report-table-auto td.num { padding:6px 4px; }
.report-table-auto .agent-name { max-width:110px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* Progress bar for target */
.target-bar { height:10px; background:var(--border); border-radius:5px; overflow:hidden; min-width:60px; }
.target-bar-fill { height:100%; border-radius:5px; transition:width 0.3s; }
.target-pct { font-size:12px; font-weight:700; min-width:44px; text-align:right; }
/* Realizare badge in KPI */
.realizare-badge { display:inline-block; padding:2px 8px; border-radius:12px; font-size:11px; font-weight:700; }
.realizare-badge.high { background:rgba(0,200,83,0.15); color:var(--green); }
.realizare-badge.mid { background:rgba(0,123,255,0.12); color:var(--blue); }
.realizare-badge.low { background:rgba(255,82,82,0.12); color:var(--accent); }
.som-desc { font-size:13px; color:var(--text2); }

/* Sales data info bar — shows data source metadata in every sales/objectives panel */
.sales-info-bar {
  display:flex; flex-wrap:wrap; gap:12px; align-items:center;
  padding:6px 12px; margin:0;
  background:rgba(0,180,255,0.06); border-bottom:1px solid rgba(0,180,255,0.15);
  font-size:11.5px; color:var(--text2); line-height:1.5;
}
.sales-info-bar:empty { display:none; }
.sales-info-bar .sib-item { display:inline-flex; align-items:center; gap:4px; }
.sales-info-bar .sib-label { opacity:0.7; }
.sales-info-bar .sib-value { font-weight:600; color:var(--text); }

/* SOM bar */
.som-bar { display:flex; height:20px; border-radius:4px; overflow:hidden; width:100%; min-width:120px; }
.som-bar .jti { background:var(--green); }
.som-bar .comp { background:var(--accent); }
.som-pct { font-size:13px; font-weight:600; }

/* ── DIALOGS ── */
.dialog-overlay {
  position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.6);
  display:flex; align-items:center; justify-content:center; z-index:2000;
}
.dialog {
  background:var(--card); border:1px solid var(--border); border-radius:14px;
  width:420px; max-height:85vh; overflow-y:auto; box-shadow:var(--shadow);
}
.dialog-wide { width:700px; }
.dialog-photo { width:600px; }
.dialog-header {
  display:flex; justify-content:space-between; align-items:center;
  padding:16px 20px; border-bottom:1px solid var(--border);
}
.dialog-header h3 { font-size:16px; }
.dialog-close { background:none; border:none; color:var(--text2); font-size:20px; cursor:pointer; }
.dialog-body { padding:16px 20px; }
.dialog-body label { display:block; font-size:13px; color:var(--text2); margin:8px 0 4px; font-weight:500; }
.dialog-input {
  width:100%; padding:10px 12px; border-radius:6px; border:1px solid var(--border);
  background:var(--bg); color:#fff; font-size:14px; margin-bottom:4px;
  transition: border-color .2s, box-shadow .2s;
}
.dialog-input:focus { border-color:var(--blue); outline:none; box-shadow:0 0 0 2px rgba(95,157,247,0.15); }
.dialog-input::placeholder { color:rgba(196,203,223,0.45); }
.dialog-footer { display:flex; justify-content:flex-end; gap:8px; padding:12px 20px; border-top:1px solid var(--border); }
.checkbox-label { display:flex; align-items:center; gap:8px; font-size:14px; margin:8px 0; cursor:pointer; }

/* ── FAB ── */
.admin-fab-group { position:fixed; bottom:20px; right:20px; display:flex; flex-direction:column; gap:10px; z-index:1500; }
.fab {
  width:48px; height:48px; border-radius:50%; border:none; background:var(--blue);
  color:#fff; font-size:20px; cursor:pointer; box-shadow:var(--shadow); transition:all .2s;
}
.fab:hover { transform:scale(1.1); }

/* ── TOAST ── */
.toast {
  position:fixed; bottom:30px; left:50%; transform:translateX(-50%);
  background:var(--green); color:#fff; padding:14px 28px; border-radius:10px;
  font-size:16px; font-weight:600; z-index:3000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  animation:toastIn .3s ease;
  max-width:90vw; text-align:center; white-space:pre-line;
}
@keyframes toastIn { from { opacity:0; transform:translateX(-50%) translateY(20px); } }

/* ── NOTIFICATIONS ── */
.notif-wrapper { position:static; }
.btn-notif {
  background:none; border:none; font-size:20px; cursor:pointer;
  padding:4px 8px; position:relative; filter:grayscale(0);
}
.btn-notif:hover { transform:scale(1.1); }
.notif-badge {
  position:absolute; top:-2px; right:0; background:#ef4444; color:#fff;
  font-size:11px; font-weight:700; min-width:18px; height:18px;
  border-radius:9px; display:flex; align-items:center; justify-content:center;
  padding:0 4px; line-height:1;
}
.notif-panel {
  position:fixed; top:56px; right:8px; left:8px;
  max-width:400px; margin-left:auto;
  max-height:calc(100vh - 70px);
  background:var(--bg2); border:1px solid var(--border); border-radius:12px;
  box-shadow:0 8px 32px rgba(0,0,0,0.5); z-index:4000; overflow:hidden;
}
.notif-panel-header {
  display:flex; justify-content:space-between; align-items:center;
  padding:12px 16px; border-bottom:1px solid var(--border);
  color:var(--text); font-size:15px;
}
.notif-mark-all {
  background:none; border:none; color:var(--green); cursor:pointer;
  font-size:12px; font-weight:500; white-space:nowrap;
}
.notif-mark-all:hover { text-decoration:underline; }
.notif-list { overflow-y:auto; max-height:calc(100vh - 130px); -webkit-overflow-scrolling:touch; }
.notif-item {
  padding:12px 16px; border-bottom:1px solid var(--border);
  cursor:pointer; transition:background .15s; word-wrap:break-word; overflow-wrap:break-word;
}
.notif-item:hover { background:rgba(255,255,255,0.05); }
.notif-item.unread { background:rgba(34,197,94,0.08); }
.notif-item .notif-title { font-size:14px; font-weight:600; color:var(--text); margin-bottom:4px; word-wrap:break-word; }
.notif-item .notif-msg { font-size:13px; color:var(--text2); line-height:1.5; word-wrap:break-word; }
.notif-item .notif-time { font-size:11px; color:var(--text2); margin-top:6px; opacity:0.7; }
.notif-empty { padding:32px; text-align:center; color:var(--text2); font-size:14px; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width:6px; height:6px; }
::-webkit-scrollbar-track { background:var(--bg2); }
::-webkit-scrollbar-thumb { background:var(--border); border-radius:3px; }
::-webkit-scrollbar-thumb:hover { background:var(--text2); }

/* ── ROUTE NUMBER MARKERS ── */
.route-number-icon {
  background: #e94560; color: #fff; border-radius: 50%; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
  border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

/* ── MARKER COLORS ── */
.marker-census { filter: hue-rotate(120deg); }   /* green */
.marker-sisq { filter: hue-rotate(200deg); }     /* blue */
.marker-sisc { filter: hue-rotate(0deg); }       /* red/default */

/* ── CLUSTER STYLES (QMaps BB) ── */
.marker-cluster { background: none !important; }
.marker-cluster div {
  background: rgb(26, 140, 255) !important;
  color: #fff !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  border-radius: 50% !important;
  border: 3px solid #fff !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.6), 0 0 0 2px rgba(26,140,255,0.5) !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.marker-cluster-small { background: none !important; }
.marker-cluster-small div {
  background: rgb(0, 184, 148) !important;
  border-color: #fff !important;
  width: 36px !important;
  height: 36px !important;
}
.marker-cluster-medium { background: none !important; }
.marker-cluster-medium div {
  background: rgb(253, 203, 110) !important;
  color: #000 !important;
  border-color: #fff !important;
  width: 44px !important;
  height: 44px !important;
}
.marker-cluster-large { background: none !important; }
.marker-cluster-large div {
  background: rgb(225, 112, 85) !important;
  border-color: #fff !important;
  width: 52px !important;
  height: 52px !important;
}

/* ── VISIT / CHECK-IN SYSTEM ── */
.visit-form {
  background:var(--card); border:1px solid var(--border); border-radius:10px;
  padding:14px; margin-bottom:12px;
}
.visit-form label { display:block; font-size:12px; color:var(--text2); margin:8px 0 4px; }
.visit-form .btn-primary { width:100%; margin-top:10px; }

.visit-card {
  background:var(--card); border:1px solid var(--border); border-radius:8px;
  padding:10px 12px; margin-bottom:6px; display:flex; gap:10px; align-items:flex-start;
}
.visit-card:hover { border-color:var(--blue); }
.visit-thumb {
  width:56px; height:56px; border-radius:6px; object-fit:cover; flex-shrink:0;
  border:1px solid var(--border); background:var(--bg2);
}
.visit-header { flex:1; min-width:0; }
.visit-time { font-size:12px; color:var(--blue); font-weight:600; }
.visit-client { font-size:14px; font-weight:600; margin:2px 0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.visit-detail { font-size:13px; color:var(--text2); }
.visit-notes { font-size:13px; color:var(--text2); margin-top:4px; font-style:italic; }

/* Route/days analysis */
.route-day {
  background:var(--card); border:1px solid var(--border); border-radius:8px;
  margin-bottom:8px; overflow:hidden;
}
.route-day-header {
  display:flex; justify-content:space-between; align-items:center;
  padding:10px 14px; background:var(--card2); cursor:pointer;
}
.route-day-header:hover { background:var(--bg3); }
.route-day-name { font-weight:600; font-size:15px; }
.route-day-stats { font-size:13px; color:var(--text2); }
.route-day-clients { padding:6px 10px; }
.route-day-client {
  display:flex; align-items:center; gap:8px; padding:5px 6px;
  border-bottom:1px solid var(--border); font-size:13px;
}
.route-day-client:last-child { border-bottom:none; }
.route-idx {
  width:22px; height:22px; border-radius:50%; background:var(--blue); color:#fff;
  font-size:10px; font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.route-client-name { font-weight:500; }
.route-client-loc { color:var(--text2); font-size:12px; }
.route-visit-count { margin-left:auto; font-size:12px; color:var(--green); font-weight:600; }

/* ── MOBILE SIDEBAR CLOSE ── */
.mobile-sidebar-close { display:none; padding:10px 16px 6px; }

/* ── MOBILE TOGGLE BUTTON ── */
.btn-toggle-sidebar {
  display:none; background:none; border:1px solid var(--border); color:var(--text);
  font-size:18px; padding:4px 8px; border-radius:6px; cursor:pointer; line-height:1;
}
.btn-toggle-sidebar:hover { border-color:var(--accent); color:var(--accent); }

/* ── RESPONSIVE MOBILE ── */
@media (max-width: 768px) {
  /* Toggle button & close button visible */
  .btn-toggle-sidebar { display:block; }
  .mobile-sidebar-close { display:block; }

  /* Prevent horizontal scroll on mobile */
  html, body { overflow-x:hidden !important; max-width:100vw !important; }
  .app-body { overflow-x:hidden; }

  /* Topbar: compact */
  .topbar{flex-wrap:wrap;padding:.4rem .6rem;gap:.4rem}
  .topbar h1{font-size:1rem}
  .topbar .user{font-size:.82rem;max-width:140px}
  .topbar button{padding:.35rem .6rem;font-size:.85rem}

  /* App body: column-reverse like BB */
  .app-body { flex-direction:column-reverse; height:calc(100vh - 44px); position:relative; }

  /* Sidebar: overlay drawer */
  .sidebar {
    width:100%; min-width:100%; height:50vh;
    border-right:none; border-top:1px solid var(--border);
    overflow-y:auto; overflow-x:hidden;
  }

  /* Map: top half */
  .map-container { width:100%; height:50vh; min-height:50vh; }
  .app-body.map-hidden .sidebar{height:100%;border-top:none}
  .app-body.map-hidden .map-container{display:none}

  /* Route bar: mobile friendly */
  .route-bar { bottom:6px; left:6px; right:6px; padding:8px 12px; gap:8px; flex-direction:column; align-items:stretch; }
  .route-bar-left { font-size:12px; }
  .route-list { max-height:50px; }
  .route-bar-actions { justify-content:center; }

  /* Dialogs: full width on mobile */
  .dialog { width:95vw !important; max-width:420px; }
  .dialog-wide { max-width:95vw !important; }
  .dialog-photo { max-width:95vw !important; }

  /* Login: smaller */
  .login-card { width:90vw; max-width:360px; padding:28px 24px; }

  /* FABs: lower position */
  .admin-fab-group { bottom:12px; right:12px; }
  .fab { width:42px; height:42px; font-size:18px; }

  /* Client list: more space */
  .client-list { max-height:calc(100vh - 280px); }

  /* Filter groups: taller for mobile to show more items */
  .filter-checkbox-group { max-height:160px; }
  .filter-checklist { max-height:200px; }
  .filter-select { height:55px; }

  /* Report tables: compact on mobile */
  .report-table { font-size:11px; }
  .report-table th { padding:6px 3px; font-size:9px; letter-spacing:0; }
  .report-table td { padding:5px 3px; }
  .report-table .agent-name { max-width:80px; font-size:11px; }
  .report-table-auto th { font-size:9px; padding:6px 3px; }
  .report-table-auto td { font-size:11px; padding:5px 3px; }
  .report-table-auto .agent-name { max-width:90px; }
  .target-pct { font-size:11px; min-width:36px; }
  .realizare-badge { padding:1px 5px; font-size:10px; }
  .target-bar { min-width:40px; }
}

/* Desktop: hide dropdown trigger */
.tab-dropdown-trigger { display:none; }

/* ── AUDIT TAB ── */
.audit-client-card {
  background:var(--card); border:1px solid var(--border); border-radius:8px;
  padding:12px; margin-bottom:8px;
}
.audit-client-card:hover { border-color:var(--blue); }
.audit-client-name { font-weight:600; font-size:15px; margin-bottom:4px; }
.audit-client-agent { font-size:13px; color:var(--text2); margin-bottom:8px; }
.audit-sku-list { display:flex; flex-direction:column; gap:6px; }
.audit-sku-item {
  display:flex; align-items:center; gap:8px; padding:6px 10px; background:var(--card2);
  border-radius:6px; font-size:13px;
}
.audit-sku-item input[type="checkbox"] { width:16px; height:16px; accent-color:var(--green); cursor:pointer; flex-shrink:0; }
.audit-sku-name { flex:1; }
.audit-sku-delivered { font-size:12px; font-weight:600; padding:2px 8px; border-radius:10px; }
.audit-sku-delivered.yes { background:rgba(0,210,160,0.15); color:var(--green); }
.audit-sku-delivered.no { background:rgba(233,69,96,0.15); color:var(--accent); }
.audit-photo-section { margin-bottom:10px; }
.audit-photo-section label { font-size:13px; color:var(--text2); margin-bottom:4px; display:block; }
.audit-btn-save {
  width:100%; padding:10px; border:none; border-radius:8px; background:var(--green);
  color:#fff; font-weight:600; font-size:14px; cursor:pointer; margin-top:10px;
}
.audit-btn-save:hover { background:var(--green2); }
.audit-btn-save:disabled { opacity:0.5; cursor:not-allowed; }
.audit-completed {
  display:inline-block; background:rgba(0,210,160,0.15); color:var(--green); font-size:10px;
  padding:2px 8px; border-radius:10px; font-weight:600; margin-left:6px;
}
.audit-pending {
  display:inline-block; background:rgba(245,166,35,0.15); color:var(--orange); font-size:10px;
  padding:2px 8px; border-radius:10px; font-weight:600; margin-left:6px;
}
.audit-overwritten {
  display:inline-block; background:rgba(52,152,219,0.15); color:#3498db; font-size:10px;
  padding:2px 8px; border-radius:10px; font-weight:600; margin-left:4px;
}

/* ── Audit Weekly Progress ── */
.audit-weekly-progress { margin-bottom:10px; }
.audit-progress-bar-wrap { margin-bottom:6px; }
.audit-progress-label { font-size:11px; color:var(--text2); margin-bottom:4px; }
.audit-progress-bar {
  height:8px; background:var(--bg2); border-radius:4px; overflow:hidden;
}
.audit-progress-fill {
  height:100%; border-radius:4px; transition:width 0.5s ease;
}
.audit-weeks-row {
  display:flex; gap:4px; flex-wrap:wrap;
}
.audit-week-chip {
  font-size:10px; padding:3px 8px; border-radius:12px; display:flex; align-items:center; gap:3px;
  border:1px solid var(--border);
}
.audit-week-chip small { opacity:0.7; }
.audit-week-chip.week-done { background:rgba(0,210,160,0.15); color:var(--green); border-color:var(--green); }
.audit-week-chip.week-current { background:rgba(26,140,255,0.15); color:var(--blue); border-color:var(--blue); }
.audit-week-chip.week-pending { background:var(--bg2); color:var(--text2); }

/* ── Zeturi badges ── */
.zeturi-badge {
  display:inline-block; font-size:10px; padding:2px 6px; border-radius:10px; font-weight:600; margin-left:4px;
}
.zeturi-ok { background:rgba(0,210,160,0.15); color:var(--green); }
.zeturi-restante { background:rgba(231,76,60,0.15); color:#e74c3c; }
.incasari-row-alert {
  background:rgba(231,76,60,0.08); border-left:3px solid #e74c3c;
}

/* ── MULTI-SELECT ── */
.select-bar {
  display:flex; align-items:center; gap:8px; padding:6px 10px; margin-bottom:6px;
  background:var(--card2); border:1px solid var(--border); border-radius:8px; font-size:13px;
  flex-wrap:wrap;
}
.select-bar .select-count { font-weight:600; color:var(--blue); }
.select-bar button { padding:4px 10px; border:1px solid var(--border); border-radius:4px; background:var(--card); color:var(--text2); font-size:13px; cursor:pointer; }
.select-bar button:hover { border-color:var(--blue); color:var(--text); }
.client-card { position:relative; }
.client-card .cc-check-wrap {
  position:absolute; left:0; top:0; bottom:0; width:36px;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; z-index:10;
}
.client-card .cc-check-wrap input {
  width:20px; height:20px; accent-color:var(--accent); cursor:pointer;
  pointer-events:none;
}
.client-card.has-check { padding-left:38px; }
.client-card.selected { border-color:var(--blue); background:var(--card2); }
.select-all-row { margin-bottom:6px; padding:4px 8px; }
.select-all-row label { font-size:14px; cursor:pointer; color:var(--text2); display:flex; align-items:center; gap:6px; }
.select-all-row input { width:18px; height:18px; accent-color:var(--accent); cursor:pointer; }

/* ── ÎNCASĂRI ── */
.incasari-summary {
  display:flex; gap:8px; flex-wrap:wrap; margin-bottom:8px;
}
.incasari-stat {
  flex:1; min-width:120px; padding:10px; border-radius:8px; background:var(--card2);
  border:1px solid var(--border); text-align:center;
}
.incasari-stat .stat-label { font-size:11px; color:var(--text2); text-transform:uppercase; letter-spacing:0.5px; }
.incasari-stat .stat-value { font-size:18px; font-weight:700; color:var(--text); margin-top:2px; }
.incasari-stat.distrib .stat-value { color:var(--blue); }
.incasari-stat.sis .stat-value { color:#5f9df7; }
.incasari-stat.total .stat-value { color:var(--accent); }

.incasari-list { display:flex; flex-direction:column; gap:4px; }
.incasari-row {
  display:flex; align-items:center; gap:8px; padding:8px 10px;
  background:var(--card); border:1px solid var(--border); border-radius:8px;
  font-size:13px; transition:border-color 0.2s;
}
.incasari-row:hover { border-color:var(--blue); }
.incasari-row .inc-client { flex:1; font-weight:500; color:var(--text); }
.incasari-row .inc-suma { font-weight:700; color:var(--accent); white-space:nowrap; }
.incasari-row .inc-notes { font-size:11px; color:var(--text2); max-width:120px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.incasari-row .inc-actions { display:flex; gap:4px; }
.incasari-row .inc-actions button {
  padding:3px 6px; border:1px solid var(--border); border-radius:4px;
  background:var(--card2); color:var(--text2); font-size:11px; cursor:pointer;
}
.incasari-row .inc-actions button:hover { border-color:var(--blue); color:var(--text); }
.incasari-empty { text-align:center; color:var(--text2); font-size:13px; padding:16px; }

.incasari-total-row {
  display:flex; justify-content:space-between; padding:8px 10px;
  background:var(--card2); border:1px solid var(--border); border-radius:8px;
  font-weight:600; font-size:14px; margin-top:4px;
}
.incasari-total-row .inc-total-label { color:var(--text2); }
.incasari-total-row .inc-total-value { color:var(--accent); }

/* ── CENSUS UNALLOCATED ── */
.client-card.unallocated { border-left:3px solid var(--orange); background:rgba(245,166,35,0.06); }
.badge-unallocated { display:inline-block; background:rgba(245,166,35,0.18); color:var(--orange); font-size:10px; padding:1px 7px; border-radius:10px; font-weight:600; margin-left:4px; }
.census-separator { font-size:11px; color:var(--orange); padding:6px 8px 2px; font-weight:600; border-top:1px dashed var(--border); margin-top:4px; }

/* ═══════ NEW MODULES ═══════ */
.module-card { background:var(--card); border-radius:10px; margin:6px 0; padding:10px 12px; border-left:3px solid var(--accent); }
.module-card.mc-resolved { opacity:0.6; border-left-color:var(--green); }
.mc-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:4px; }
.mc-header strong { font-size:13px; color:var(--text); }
.mc-body { font-size:12px; color:var(--text2); line-height:1.4; margin-bottom:6px; }
.mc-footer { display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.mc-footer button { font-size:11px; padding:3px 10px; border-radius:6px; border:none; cursor:pointer; font-weight:500; }
.mc-footer .btn-ok { background:var(--green); color:#fff; }
.mc-footer .btn-warn { background:var(--orange); color:#fff; }
.mc-footer .btn-bad { background:var(--red); color:#fff; }
.mc-footer .btn-info { background:var(--accent); color:#fff; }
.mc-badge { display:inline-block; font-size:10px; padding:1px 8px; border-radius:10px; font-weight:600; }
.badge-ok { background:rgba(80,200,120,0.18); color:var(--green); }
.badge-warn { background:rgba(245,166,35,0.18); color:var(--orange); }
.badge-bad { background:rgba(231,76,60,0.18); color:var(--red); }
.badge-info { background:rgba(100,150,255,0.18); color:var(--accent); }
.mc-meta { font-size:10px; color:var(--text2); margin-top:4px; }
.mc-photo { max-width:100%; max-height:150px; border-radius:6px; margin-top:6px; }
.empty-state { text-align:center; padding:30px 12px; color:var(--text2); font-size:13px; }
.module-form { background:var(--card2); border-radius:10px; padding:12px; margin:6px 0; }
.module-form label { display:block; font-size:11px; color:var(--text2); margin:8px 0 2px; }
.module-form input, .module-form select, .module-form textarea { width:100%; padding:7px 10px; border-radius:6px; border:1px solid var(--border); background:var(--bg2); color:var(--text); font-size:13px; box-sizing:border-box; }
.module-form textarea { min-height:60px; resize:vertical; }
.module-form .form-actions { display:flex; gap:8px; margin-top:10px; }
.module-form .form-actions button { flex:1; padding:8px; border:none; border-radius:6px; font-weight:600; cursor:pointer; font-size:13px; }
.mc-rank { font-size:18px; font-weight:700; color:var(--accent); min-width:30px; text-align:center; }
.mc-rank.gold { color:#FFD700; }
.mc-rank.silver { color:#C0C0C0; }
.mc-rank.bronze { color:#CD7F32; }

/* ═══════ HELP BUTTON & OVERLAY ═══════ */
.panel-header-actions { display:flex; gap:6px; align-items:center; }
.btn-help { background:none; border:1px solid var(--border); color:var(--text2); font-size:14px; width:28px; height:28px; border-radius:50%; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:all 0.2s; flex-shrink:0; }
.btn-help:hover { background:var(--accent); color:#fff; border-color:var(--accent); }
.help-overlay { position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.6); z-index:9999; display:flex; align-items:center; justify-content:center; padding:20px; }
.help-box { background:var(--card); border-radius:12px; max-width:560px; width:100%; max-height:85vh; overflow-y:auto; box-shadow:0 8px 32px rgba(0,0,0,0.4); }
.help-box-header { display:flex; justify-content:space-between; align-items:center; padding:14px 18px; border-bottom:1px solid var(--border); }
.help-box-header h3 { margin:0; font-size:15px; color:var(--text); }
.btn-help-close { background:none; border:none; color:var(--text2); font-size:22px; cursor:pointer; padding:0 4px; line-height:1; }
.btn-help-close:hover { color:var(--red); }
.help-box-body { padding:14px 18px; font-size:13px; color:var(--text2); line-height:1.6; }
.help-box-body p { margin:0 0 10px; }
.help-box-body ul { margin:4px 0 10px 18px; padding:0; }
.help-box-body li { margin-bottom:4px; }
.help-box-body strong { color:var(--text); }

/* ═══════ CLIENT NOU B2B MODAL ═══════ */
.cnb2b-overlay { position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.7); z-index:10000; display:flex; align-items:flex-end; justify-content:center; }
.cnb2b-modal { background:var(--bg); width:100%; max-width:520px; max-height:92vh; border-radius:16px 16px 0 0; display:flex; flex-direction:column; overflow:hidden; animation:cnSlideUp 0.3s ease; }
@keyframes cnSlideUp { from { transform:translateY(100%); } to { transform:translateY(0); } }
.cnb2b-header { display:flex; justify-content:space-between; align-items:center; padding:14px 18px; border-bottom:1px solid var(--border); }
.cnb2b-header h3 { margin:0; font-size:16px; color:var(--text); }
.cnb2b-close { background:none; border:none; color:var(--text2); font-size:24px; cursor:pointer; padding:0 4px; line-height:1; }
.cnb2b-close:hover { color:var(--red); }
.cnb2b-steps { display:flex; gap:4px; padding:10px 18px; border-bottom:1px solid var(--border); overflow-x:auto; }
.cnb2b-step { font-size:11px; padding:4px 10px; border-radius:12px; background:var(--card); color:var(--text2); white-space:nowrap; transition:all 0.2s; }
.cnb2b-step.active { background:var(--accent); color:#fff; font-weight:600; }
.cnb2b-step.done { background:var(--green); color:#fff; }
.cnb2b-body { flex:1; overflow-y:auto; padding:16px 18px; }
.cnb2b-panel { display:none; }
.cnb2b-panel.active { display:block; }
.cnb2b-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.cnb2b-field { display:flex; flex-direction:column; }
.cnb2b-field label { font-size:11px; color:var(--text2); margin-bottom:2px; font-weight:600; }
.cnb2b-field input { padding:8px 10px; border:1px solid var(--border); border-radius:8px; background:var(--card); color:var(--text); font-size:13px; }
.cnb2b-field input:focus { border-color:var(--accent); outline:none; }
@media (max-width:400px) { .cnb2b-form-grid { grid-template-columns:1fr; } }

/* ═══════════════ OBIECTIVE SMART ══════════════════════ */
.smart-header { text-align:center; margin:16px 0 20px; }
.smart-header h2 { color:#4fc3f7; margin:0; font-size:1.3em; }
.smart-subtitle { color:#aaa; font-size:0.9em; margin-top:4px; }

.smart-kpi-row { display:flex; gap:12px; flex-wrap:wrap; justify-content:center; margin:16px 0; }
.smart-kpi-card { background:#1a1a2e; border-radius:10px; padding:16px; min-width:140px; flex:1; max-width:200px; text-align:center; border:1px solid #2a2a4a; }
.smart-kpi-icon { font-size:1.5em; margin-bottom:4px; }
.smart-kpi-label { color:#aaa; font-size:0.75em; text-transform:uppercase; letter-spacing:0.5px; margin-bottom:8px; }
.smart-kpi-value { color:#fff; font-size:1.6em; font-weight:bold; line-height:1.1; }
.smart-kpi-target { color:#777; font-size:0.8em; margin:4px 0 8px; }
.smart-kpi-pct { font-size:0.9em; font-weight:bold; margin-top:4px; }

.smart-progress-wrap { background:#333; border-radius:4px; height:6px; overflow:hidden; width:100%; }
.smart-progress-bar { height:100%; border-radius:4px; transition:width 0.5s ease; }
.smart-pct { font-size:0.8em; color:#aaa; }

.smart-table-section { margin:20px 0; }
.smart-table-section h3 { color:#4fc3f7; margin:0 0 10px; font-size:1.1em; }
.smart-table { width:100%; border-collapse:collapse; font-size:0.85em; }
.smart-table th { background:#1a1a2e; color:#4fc3f7; padding:8px 6px; text-align:center; border-bottom:2px solid #333; font-size:0.8em; }
.smart-table td { padding:8px 6px; text-align:center; border-bottom:1px solid #222; }
.smart-table tr:hover { background:#1a1a2e; }
.smart-agent-row:hover { background:#1e293b !important; }
.smart-input { background:#1a1a2e; color:#fff; border:1px solid #4fc3f7; border-radius:4px; padding:4px 6px; font-size:13px; text-align:center; }
.smart-input:focus { outline:none; border-color:#ff9800; box-shadow:0 0 6px rgba(255,152,0,0.3); }
.smart-edit-cell { font-size:12px; }

.smart-agent-section { margin:20px 0; padding:16px; background:#111827; border-radius:10px; border:1px solid #1e293b; }
.smart-agent-detail { padding:12px; }

.smart-chart-section { margin:16px 0; }
.smart-chart-section h4 { color:#aaa; font-size:0.9em; margin:0 0 10px; }
.smart-bar-chart { display:flex; gap:8px; align-items:flex-end; height:120px; padding:0 8px; }
.smart-bar-col { flex:1; display:flex; flex-direction:column; align-items:center; height:100%; justify-content:flex-end; }
.smart-bar-val { color:#aaa; font-size:0.7em; margin-bottom:4px; }
.smart-bar { width:100%; max-width:40px; border-radius:4px 4px 0 0; min-height:2px; transition:height 0.3s; }
.smart-bar-label { color:#777; font-size:0.7em; margin-top:4px; }

.smart-details-section { margin:16px 0; }
.smart-details-section h4 { color:#aaa; font-size:0.9em; margin:0 0 8px; }

.smart-actions-section { margin:20px 0; padding:16px; background:#1a1a2e; border-radius:10px; border:1px solid #2a2a4a; }
.smart-actions-section h3 { color:#4fc3f7; margin:0 0 10px; font-size:1.1em; }
.smart-actions-section ul { color:#ccc; margin:0; padding-left:20px; }
.smart-actions-section li { margin:6px 0; line-height:1.5; }

.smart-metodologie-section { margin:16px 0; }
.smart-upload-section { transition: all 0.3s ease; }
.smart-upload-section:hover { border-color: #66bb6a; background: linear-gradient(135deg,#1e3a1e,#0e1e0e); }

@media (max-width: 600px) {
  .smart-kpi-row { gap:8px; }
  .smart-kpi-card { min-width:100px; padding:10px; }
  .smart-kpi-value { font-size:1.3em; }
  .smart-table { font-size:0.75em; }
  .smart-table th, .smart-table td { padding:4px 3px; }
}

/* ═══ ACTIVITATE ZILNICĂ ═══ */
.az-filters { display:flex; gap:12px; flex-wrap:wrap; margin-bottom:16px; align-items:center; }
.az-filters select { background:#1a1a2e; color:#e0e0e0; border:1px solid #444; border-radius:8px; padding:10px 16px; font-size:16px; font-weight:500; }
.az-filters label { color:#aaa; font-size:15px; font-weight:500; }
.az-kpi-row { display:flex; gap:14px; flex-wrap:wrap; margin-bottom:18px; }
.az-kpi-card { background:linear-gradient(135deg,#1a1a2e,#0d1b2a); border:1px solid #2a2a4a; border-radius:12px; padding:16px 20px; min-width:140px; flex:1; text-align:center; }
.az-kpi-value { font-size:2.2em; font-weight:700; }
.az-kpi-label { font-size:15px; color:#999; margin-top:4px; }
.az-category-row { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:18px; }
.az-cat-badge { padding:10px 18px; border-radius:20px; font-size:15px; font-weight:600; cursor:pointer; border:2px solid transparent; transition:all 0.2s; }
.az-cat-badge:hover { opacity:0.85; transform:scale(1.05); }
.az-cat-badge.active { border-color:#fff; box-shadow:0 0 8px rgba(255,255,255,0.3); }

/* Desktop table */
.az-table-wrap { display:block; overflow-x:auto; max-height:65vh; overflow-y:auto; border-radius:10px; border:1px solid #2a2a4a; }
.az-table { width:100%; border-collapse:collapse; font-size:15px; white-space:nowrap; }
.az-table thead th { position:sticky; top:0; z-index:2; background:#1a1a2e; color:#4fc3f7; padding:12px 10px; border-bottom:2px solid #4fc3f7; cursor:pointer; user-select:none; text-align:center; font-weight:700; font-size:14px; letter-spacing:0.3px; }
.az-table thead th:hover { background:#222244; }
.az-table tbody tr { border-bottom:1px solid #1e1e3a; transition:background 0.15s; }
.az-table tbody tr:hover { background:rgba(79,195,247,0.08); }
.az-table tbody td { padding:10px 8px; text-align:center; color:#e0e0e0; font-size:15px; }
.az-table .az-row-gold { border-left:4px solid #ffd700; }
.az-table .az-row-silver { border-left:4px solid #c0c0c0; }
.az-table .az-row-bronze { border-left:4px solid #cd7f32; }
.az-detail-row { background:#0d1b2a !important; }
.az-detail-row td { padding:14px 18px; text-align:left; white-space:normal; font-size:14px; }
.az-detail-content { display:flex; flex-wrap:wrap; gap:14px; }
.az-detail-block { background:#1a1a2e; border-radius:10px; padding:14px; flex:1; min-width:220px; border:1px solid #2a2a4a; }
.az-detail-block h4 { color:#4fc3f7; margin:0 0 8px; font-size:15px; font-weight:600; }
.az-detail-block .highlight { color:#66bb6a; font-size:14px; }
.az-detail-block .warning { color:#ff7043; font-size:14px; }

/* Legend / explicații */
.az-legend { background:#0d1b2a; border:1px solid #2a2a4a; border-radius:12px; padding:18px 22px; margin-bottom:18px; }
.az-legend-toggle { color:#4fc3f7; cursor:pointer; font-size:16px; font-weight:600; display:flex; align-items:center; gap:8px; }
.az-legend-toggle:hover { text-decoration:underline; }
.az-legend-content { display:none; margin-top:14px; }
.az-legend-content.open { display:block; }
.az-legend-section { margin-bottom:18px; }
.az-legend-section h4 { color:#4fc3f7; font-size:16px; margin:0 0 8px; font-weight:600; }
.az-legend-section p, .az-legend-section li { color:#ccc; font-size:14px; line-height:1.7; margin:3px 0; }
.az-legend-section ul { padding-left:20px; margin:6px 0; }
.az-legend-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px 20px; }
.az-legend-item { display:flex; align-items:center; gap:8px; font-size:14px; color:#ccc; }
.az-legend-item .dot { width:12px; height:12px; border-radius:50%; flex-shrink:0; }
.az-legend-medal { display:inline-flex; align-items:center; gap:5px; font-size:14px; color:#ccc; margin-right:16px; }

/* Mobile cards */
.az-cards-wrap { display:none; }
.az-card { background:linear-gradient(135deg,#1a1a2e,#0d1b2a); border:1px solid #2a2a4a; border-radius:12px; padding:16px; margin-bottom:12px; }
.az-card-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; }
.az-card-agent { font-weight:700; color:#4fc3f7; font-size:17px; }
.az-card-score { font-size:22px; font-weight:700; }
.az-card-metrics { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.az-card-metric { display:flex; justify-content:space-between; padding:5px 0; font-size:15px; color:#bbb; border-bottom:1px solid #1e1e3a; }
.az-card-metric span:last-child { font-weight:600; color:#e0e0e0; }
.az-card-detail { margin-top:12px; padding-top:12px; border-top:1px solid #2a2a4a; font-size:14px; }
.az-card-toggle { color:#4fc3f7; font-size:14px; cursor:pointer; text-align:center; margin-top:10px; font-weight:500; }

/* Responsive: show table on desktop, cards on mobile */
@media (max-width: 768px) {
  .az-table-wrap { display:none !important; }
  .az-cards-wrap { display:block !important; }
  .az-kpi-row { gap:8px; }
  .az-kpi-card { min-width:90px; padding:10px 12px; }
  .az-kpi-value { font-size:1.5em; }
  .az-kpi-label { font-size:12px; }
  .az-category-row { gap:6px; }
  .az-cat-badge { padding:6px 12px; font-size:13px; }
  .az-filters select { font-size:14px; padding:8px 12px; }
  .az-card-agent { font-size:15px; }
  .az-card-score { font-size:18px; }
  .az-card-metric { font-size:13px; }
}

/* ── GPS Tracking Leaflet Tooltip ── */
.gps-label {
  background: rgba(0,0,0,0.7) !important;
  border: none !important;
  color: #fff !important;
  font-size: 11px !important;
  font-weight: bold !important;
  padding: 2px 6px !important;
  border-radius: 3px !important;
}
.gps-label::before {
  border: none !important;
}
