:root{
    --ink:#161A1F;
    --ink-soft:#3A4048;
    --muted:#6B7280;
    --muted-2:#9CA3AF;
    --line:#E5E7EB;
    --line-soft:#EEF0F2;
    --bg:#F3F4F6;
    --card:#FFFFFF;
    --sidebar:linear-gradient(160deg, #014B76 0%, #02638E 100%);
    --sidebar-hover:rgba(255,255,255,0.08);
    --sidebar-text:#B7BEC7;
    --sidebar-text-dim:#6B7280;
    --brand:#0FA98C;
    --brand-dark:#0C8570;
    --brand-tint:#D9F5F0;
    --blue:#2563EB; --blue-tint:#DCE7FD;
    --purple:#7C3AED; --purple-tint:#E9DEFC;
    --amber:#D97706; --amber-tint:#FBEACB;
    --pink:#DB2777; --pink-tint:#FBDCEB;
    --green:#16A34A; --green-tint:#DBF3E3;
    --teal:#0D9488; --teal-tint:#D7F2EF;
    --red:#DC2626; --red-tint:#FBDBDB;
    --slate:#6B7280; --slate-tint:#E7E9EC;
    --radius:10px;
    --radius-sm:6px;
    --shadow-sm: 0 1px 2px rgba(20,23,28,0.06);
    --shadow-md: 0 4px 16px rgba(20,23,28,0.08);
    --shadow-lg: 0 12px 32px rgba(20,23,28,0.16);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  }
  *{box-sizing:border-box;}
  html,body{height:100%;}
  body{
    margin:0; font-family:var(--font); color:var(--ink); background:var(--bg);
    font-size:14px; -webkit-font-smoothing:antialiased;
  }
  button, input, select, textarea{ font-family:inherit; font-size:inherit; color:inherit; }
  a{ color:inherit; text-decoration:none; }
  ::selection{ background:var(--brand-tint); }

  /* ---------- App shell ---------- */
  #app{ display:flex; height:100vh; overflow:hidden; background:var(--bg); }

  /* ---------- Impersonation banner ("Login As") ---------- */
  #impersonation-banner{
    display:none; position:fixed; top:0; left:0; right:0; z-index:500; height:40px;
    align-items:center; justify-content:center; gap:14px;
    background:var(--amber); color:#fff; font-size:13px; font-weight:600;
  }
  #impersonation-banner.show{ display:flex; }
  #impersonation-banner b{ font-weight:700; }
  #impersonation-banner button{
    background:rgba(255,255,255,0.18); color:#fff; border:1px solid rgba(255,255,255,0.4);
    border-radius:var(--radius-sm); padding:4px 10px; font-size:12px; font-weight:600; cursor:pointer;
  }
  #impersonation-banner button:hover{ background:rgba(255,255,255,0.28); }
  body.impersonating #app{ height:calc(100vh - 40px); margin-top:40px; }

  /* ---------- Sidebar ---------- */
  /* Floating card: a visible gap on every side rather than a flush full-height panel —
     margin creates the gap (body's --bg shows through), border-radius/shadow give it
     the "card sitting on the page" look. */
  #sidebar{
    width:230px; flex:0 0 230px; background:var(--sidebar); color:var(--sidebar-text);
    display:flex; flex-direction:column; padding:16px 12px; height:calc(100% - 24px); margin:12px;
    border-radius:16px; box-shadow:0 8px 28px rgba(4,20,34,0.28); position:relative; z-index:5;
    transition:width .15s ease, flex-basis .15s ease, padding .15s ease;
  }
  #sidebar.collapsed{ width:72px; flex:0 0 72px; padding:16px 10px; }
  #sidebar.collapsed .brand{ justify-content:center; }
  #sidebar.collapsed .nav-item{ justify-content:center; gap:0; }
  #sidebar.collapsed .nav-item span.label{ display:none; }
  #sidebar.collapsed .nav-item .count{ display:none; }
  #sidebar.collapsed .profile-card{ justify-content:center; padding:10px; }
  #sidebar.collapsed .profile-card .rep-pill-text{ display:none; }
  #sidebar.collapsed .sidebar-search-wrap{ display:none; }
  #sidebar.collapsed #nav-sidebar-toggle svg{ transform:scaleX(-1); }
  .brand{ display:flex; align-items:center; padding:6px 8px 8px 8px; }
  .brand-logo-full{ width:100%; height:auto; display:block; object-fit:contain; border-radius:10px; }
  .brand-logo-icon{ display:none; width:100%; height:auto; object-fit:contain; border-radius:8px; }
  #sidebar.collapsed .brand-logo-full{ display:none; }
  #sidebar.collapsed .brand-logo-icon{ display:block; }

  nav.navgroup{ margin-top:0; }
  .nav-item{
    display:flex; align-items:center; gap:10px; padding:9px 10px; border-radius:8px;
    cursor:pointer; margin-bottom:2px; position:relative; color:var(--sidebar-text);
    transition:background .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
  }
  .nav-icon-wrap{ position:relative; display:inline-flex; flex:0 0 auto; }
  .nav-item svg{ width:17px; height:17px; flex:0 0 auto; opacity:.85; transition:opacity .18s ease, color .18s ease; }
  .nav-item span.label{ font-size:13.5px; font-weight:500; flex:1; }
  .nav-item .count{ font-size:11px; color:rgba(255,255,255,0.8); background:rgba(255,255,255,0.1); padding:1px 7px; border-radius:20px; transition:background .18s ease, color .18s ease; }
  /* Count and alert are independent (Part Exchange only) — the count pill itself always
     stays neutral; a small red dot sits next to it when something's unread (see
     pxOpenForMe/pxHasUnreadForMe). Never conflate "how many" with "anything new". */
  .nav-item .count{ display:inline-flex; align-items:center; gap:5px; }
  .nav-alert-dot{ display:inline-block; width:7px; height:7px; border-radius:50%; background:var(--red); flex:0 0 auto; }
  /* Collapsed sidebar: the count moves onto a small overlay badge pinned to the icon's
     corner (like a notification dot) instead of flowing inline — that way it never shifts
     the icon's own position, so every icon lines up in one fixed column regardless of
     whether it happens to have a count next to it. */
  .count-dot{ display:none; }
  #sidebar.collapsed .count-dot{
    display:flex; align-items:center; justify-content:center; position:absolute; top:-6px; right:-9px;
    min-width:15px; height:15px; padding:0 3px; border-radius:20px; background:#4B5A6E; color:#fff;
    font-size:9px; font-weight:700; line-height:1; box-shadow:0 0 0 2px #0C2A44;
  }
  #sidebar.collapsed .count-dot.count-dot-alert{ background:var(--red); }
  .nav-item:hover{ background:rgba(255,255,255,0.08); color:#fff; transform:translateX(1px); }
  .nav-item.active{
    background:rgba(255,255,255,0.14); color:#fff;
    box-shadow:0 2px 10px rgba(0,0,0,0.18), inset 0 0 0 1px rgba(255,255,255,0.06);
  }
  .nav-item.active::before{
    content:""; position:absolute; left:-12px; top:6px; bottom:6px; width:3px; background:var(--brand); border-radius:0 3px 3px 0;
    box-shadow:0 0 8px var(--brand);
  }
  .nav-item.active svg{ opacity:1; color:var(--brand); }
  .nav-item.active .count{ background:rgba(255,255,255,0.14); color:#fff; }
  .nav-item.coming-soon{ opacity:.55; cursor:default; }
  .nav-item.coming-soon:hover{ background:rgba(255,255,255,0.05); transform:none; }
  .nav-item .soon-tag{ font-size:9.5px; font-weight:700; letter-spacing:.03em; text-transform:uppercase; color:rgba(255,255,255,0.6); background:rgba(255,255,255,0.08); padding:2px 6px; border-radius:20px; }
  #sidebar.collapsed .nav-item .soon-tag{ display:none; }

  .sidebar-bottom{ margin-top:auto; padding-top:12px; border-top:1px solid rgba(255,255,255,0.08); }
  .rep-pill{ display:flex; align-items:center; gap:10px; padding:9px 10px; border-radius:9px; cursor:pointer; transition:background .18s ease; }
  .rep-pill:hover{ background:rgba(255,255,255,0.08); }
  .avatar{
    position:relative; width:28px; height:28px; border-radius:50%; background:var(--brand); color:#fff; font-size:11.5px; font-weight:700;
    display:flex; align-items:center; justify-content:center; flex:0 0 auto;
  }
  .rep-pill .avatar::after{
    content:""; position:absolute; right:-1px; bottom:-1px; width:8px; height:8px; border-radius:50%;
    background:var(--green); border:2px solid #0C2A44;
  }
  .rep-pill .who{ font-size:12.5px; font-weight:600; color:#fff; letter-spacing:-0.01em; }
  .rep-pill .role{ font-size:10.5px; color:var(--sidebar-text-dim); margin-top:1px; letter-spacing:.01em; }

  /* Profile card, moved to the top of the sidebar below the logo — same .rep-pill content,
     just framed as its own card rather than a plain bottom-of-sidebar row. */
  .profile-card{
    background:rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.08);
    border-radius:12px; margin-bottom:8px; cursor:default;
  }
  .profile-card:hover{ background:rgba(255,255,255,0.06); }

  .sidebar-search-wrap{ position:relative; margin-bottom:8px; }
  /* Dims just the input box when unfocused — deliberately NOT on .sidebar-search-wrap
     itself, since the results dropdown lives inside that wrapper too. A parent's opacity
     composites its whole subtree as one semi-transparent layer first, so a child can never
     opt back out with opacity:1 — that previously left the results dropdown see-through
     whenever the input lost focus while results were still open (e.g. a stray click inside
     the dropdown that wasn't exactly a result row). */
  #sidebar-search{
    width:100%; padding:8px 10px; border-radius:8px; border:1px solid rgba(255,255,255,0.3);
    background:rgba(255,255,255,0.1); color:#fff; font-size:12.5px; outline:none;
    opacity:.5; transition:opacity .15s ease;
  }
  .sidebar-search-wrap:focus-within #sidebar-search{ opacity:1; }
  .sidebar-search-wrap input::placeholder{ color:rgba(255,255,255,0.75); }

  /* ---------- Main column ---------- */
  #main{ flex:1; display:flex; flex-direction:column; min-width:0; height:100%; }

  #topbar{
    height:60px; flex:0 0 60px; background:var(--card);
    display:flex; align-items:center; gap:14px; padding:0 20px;
    margin:12px 12px 12px 0; border-radius:16px; box-shadow:0 2px 8px rgba(20,23,28,0.04);
  }
  .view-title{ font-size:17px; font-weight:700; letter-spacing:-0.01em; white-space:nowrap; }
  .search-wrap{ position:relative; flex:1; max-width:560px; margin-left:12px; }
  .search-wrap input{
    width:100%; padding:8px 12px; border:1px solid var(--line); border-radius:8px; background:var(--bg);
    outline:none; transition:border-color .12s, background .12s;
  }
  .search-wrap input:focus{ border-color:var(--brand); background:#fff; }
  .gs-results{
    display:none; position:absolute; top:calc(100% + 6px); left:0; width:620px; max-width:calc(100vw - 40px); background:#fff;
    border:1px solid var(--line); border-radius:10px; box-shadow:var(--shadow-lg); max-height:380px;
    overflow-y:auto; z-index:60;
  }
  .gs-results.show{ display:block; }
  .gs-item{ display:flex; flex-direction:column; gap:3px; padding:8px 12px; cursor:pointer; }
  .gs-item:hover{ background:var(--bg); }
  .gs-item + .gs-item{ border-top:1px solid var(--line-soft); }
  .gs-item-top{ display:flex; align-items:center; gap:9px; }
  .gs-item-meta{ display:flex; align-items:center; flex-wrap:wrap; gap:4px 10px; }
  .gs-type{ font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.02em; flex:0 0 auto; color:var(--muted); }
  .gs-item-name{ font-size:13px; font-weight:600; color:var(--ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex:1; min-width:0; }
  .gs-item-company{ font-size:11.5px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:100%; }
  .gs-empty{ padding:16px; font-size:12.5px; color:var(--muted); text-align:center; }
  .topbar-spacer{ flex:1; }

  .notif-badge{
    position:absolute; top:-3px; right:-3px; min-width:16px; height:16px; padding:0 4px; border-radius:8px;
    background:var(--red); color:#fff; font-size:10px; font-weight:700; line-height:16px; text-align:center;
  }
  .notif-item{ display:block; padding:10px 12px; cursor:pointer; }
  .notif-item:hover{ background:var(--bg); }
  .notif-item + .notif-item{ border-top:1px solid var(--line-soft); }
  .notif-item.unread{ background:var(--brand-tint); }
  .notif-item.unread:hover{ background:var(--brand-tint); filter:brightness(0.97); }
  .notif-item-title{ font-size:12.5px; color:var(--ink); line-height:1.4; }
  .notif-item-time{ font-size:11px; color:var(--muted); margin-top:3px; }

  .btn{
    display:inline-flex; align-items:center; gap:6px; padding:8px 14px; border-radius:8px; border:1px solid var(--line);
    background:#fff; cursor:pointer; font-weight:600; font-size:13px; color:var(--ink-soft); white-space:nowrap;
    transition:background .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
  }
  .btn:hover{ background:var(--line-soft); transform:translateY(-1px); box-shadow:var(--shadow-sm); }
  .btn:active{ transform:scale(0.98) translateY(0); }
  .btn svg{ width:15px; height:15px; }
  .btn-primary{ background:var(--brand); border-color:var(--brand); color:#fff; }
  .btn-primary:hover{ background:var(--brand-dark); border-color:var(--brand-dark); box-shadow:0 4px 12px rgba(15,169,140,0.28); }
  .btn-danger{ color:var(--red); }
  .btn-danger:hover{ background:var(--red-tint); }
  .btn-sm{ padding:5px 10px; font-size:12px; }
  .icon-btn{
    width:34px; height:34px; border-radius:8px; border:1px solid var(--line); background:#fff; cursor:pointer;
    display:flex; align-items:center; justify-content:center; color:var(--ink-soft);
    transition:background .15s ease, color .15s ease, transform .15s ease;
  }
  .icon-btn:hover{ background:var(--line-soft); transform:translateY(-1px); }
  .icon-btn:active{ transform:scale(0.94); }
  .icon-btn svg{ width:16px; height:16px; }

  #view-container{ flex:1; overflow-y:auto; padding:0 12px 60px 0; display:flex; flex-direction:column; }
  @keyframes viewFadeIn{ from{ opacity:0; transform:translateY(4px); } to{ opacity:1; transform:translateY(0); } }
  #view-container.view-fade{ animation:viewFadeIn .2s ease; }
  .panel-fill{ flex:1; min-height:0; display:flex; flex-direction:column; }
  .report-body-wrap{ flex:1; min-height:0; display:flex; flex-direction:column; margin-top:18px; border-top:1px solid var(--line-soft); padding-top:14px; }
  .report-body-wrap .table-wrap{ flex:1; min-height:0; max-height:none; }

  /* ---------- Briefing bar ---------- */
  .briefing-bar{
    background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:14px 18px;
    box-shadow:var(--shadow-sm); margin-bottom:14px; display:flex; align-items:flex-start; gap:14px;
  }
  .briefing-greet-icon{ width:32px; height:32px; border-radius:9px; background:var(--brand-tint); color:var(--brand-dark); display:flex; align-items:center; justify-content:center; flex:0 0 auto; margin-top:1px; }
  .briefing-greet-icon svg{ width:17px; height:17px; }
  .briefing-text{ font-size:13.5px; color:var(--ink-soft); line-height:1.6; }
  .briefing-text b{ color:var(--ink); font-weight:700; }
  .briefing-co-link{ color:inherit; cursor:pointer; text-decoration:underline; text-decoration-color:var(--line); text-underline-offset:2px; }
  .briefing-co-link:hover{ text-decoration-color:var(--ink-soft); }

  /* ---------- Stat cards ---------- */
  .stat-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:20px; }
  .stat-grid-5{ grid-template-columns:repeat(5,1fr); }
  .stat-card{
    position:relative; overflow:hidden; background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:16px 18px;
    box-shadow:0 1px 3px rgba(20,23,28,0.05), 0 1px 2px rgba(20,23,28,0.04);
    cursor:pointer; transition:box-shadow .2s ease, transform .2s ease, border-color .2s ease;
  }
  .stat-card::before{
    content:""; position:absolute; top:0; left:0; right:0; height:3px; background:var(--accent, var(--brand));
  }
  .stat-card:hover{
    box-shadow:var(--shadow-md); transform:translateY(-3px);
  }
  .stat-card.static{ cursor:default; }
  .stat-card.static:hover{ box-shadow:0 1px 3px rgba(20,23,28,0.05), 0 1px 2px rgba(20,23,28,0.04); transform:none; }
  .stat-top{ display:flex; align-items:center; justify-content:space-between; }
  .stat-label{ font-size:12px; color:var(--muted); font-weight:600; text-transform:uppercase; letter-spacing:.03em; }
  .stat-icon{ width:30px; height:30px; border-radius:8px; display:flex; align-items:center; justify-content:center; }
  .stat-icon svg{ width:16px; height:16px; }
  .stat-value{ font-size:26px; font-weight:800; letter-spacing:-0.02em; margin-top:10px; transition:opacity .15s ease; }
  .stat-foot{ font-size:12px; color:var(--muted); margin-top:4px; }
  .stat-foot.up{ color:var(--green); }
  .stat-foot.down{ color:var(--red); }

  .dash-grid{ display:grid; grid-template-columns:1.3fr 1fr; gap:14px; align-items:start; }
  /* Reorderable dashboard panels — drag the grip, not the whole panel, so links and
     checkboxes inside stay clickable. Order persists per-user in dashboardOrder. */
  .dash-widgets{ display:flex; flex-wrap:wrap; gap:14px; align-items:flex-start; }
  .dash-widget{ flex:1 1 100%; min-width:0; }
  .dash-widget.half{ flex:1 1 calc(50% - 7px); }
  .dash-widget .panel{ height:100%; }
  .dash-widget.dragging{ opacity:.45; }
  .dash-widget.dragging .panel{ box-shadow:var(--shadow-lg); }
  @media (max-width:900px){ .dash-widget.half{ flex:1 1 100%; } }
  .dash-widget-handle{ display:flex; align-items:center; color:var(--muted-2); cursor:grab; flex:0 0 auto; }
  .dash-widget-handle:active{ cursor:grabbing; }
  .dash-widget-handle svg{ width:15px; height:15px; }
  .settings-col-1{ display:flex; flex-direction:column; gap:16px; }
  .settings-col-1 .panel{ margin-top:0; }
  .settings-section-title{
    font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.04em; color:var(--muted);
    margin:28px 0 12px;
  }
  .settings-section-title:first-child{ margin-top:0; }
  .panel{ background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:18px 20px; box-shadow:var(--shadow-sm); }
  .panel + .panel{ margin-top:14px; }
  .panel-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
  .panel-title{ font-size:14.5px; font-weight:700; }
  .panel-link{ font-size:12.5px; color:var(--brand); font-weight:600; cursor:pointer; }

  .bar-row{ display:flex; align-items:center; gap:12px; margin-bottom:15px; }
  .bar-row:last-child{ margin-bottom:0; }
  .bar-label{ width:96px; font-size:12.5px; color:var(--ink-soft); font-weight:600; flex:0 0 auto; }
  .bar-track{ flex:1; height:6px; background:var(--line-soft); border-radius:999px; overflow:hidden; }
  .bar-fill{ height:100%; border-radius:999px; transition:width .6s cubic-bezier(.22,.9,.32,1); }
  .bar-value{ width:64px; text-align:right; font-size:12.5px; font-weight:700; color:var(--ink-soft); flex:0 0 auto; }

  .report-priority-grid{ display:grid; grid-template-columns:repeat(2,1fr); gap:20px 24px; }
  .report-priority-grid .task-row{ margin-bottom:6px; }

  .week-chart{ display:flex; align-items:flex-end; gap:8px; height:120px; padding-top:8px; }
  .week-chart-col{ flex:1; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; height:100%; }
  .week-chart-count{ font-size:11px; font-weight:700; color:var(--ink-soft); margin-bottom:4px; }
  .week-chart-bar{ width:100%; max-width:26px; border-radius:4px 4px 0 0; background:var(--brand); min-height:4px; }
  .week-chart-label{ font-size:10.5px; color:var(--muted); margin-top:6px; }

  .activity-item{ display:flex; gap:10px; padding:9px 0; border-bottom:1px solid var(--line-soft); }
  .activity-item:last-child{ border-bottom:none; }
  .activity-dot{ width:7px; height:7px; border-radius:50%; margin-top:6px; flex:0 0 auto; }
  .activity-text{ font-size:12.8px; line-height:1.45; color:var(--ink-soft); }
  .activity-text b{ color:var(--ink); }
  .activity-time{ font-size:11px; color:var(--muted-2); margin-top:2px; }

  .task-row{ display:flex; align-items:flex-start; gap:10px; padding:9px 0; border-bottom:1px solid var(--line-soft); }
  .task-row:last-child{ border-bottom:none; }
  .task-check{
    width:18px; height:18px; border-radius:5px; border:1.6px solid var(--line); margin-top:1px; flex:0 0 auto; cursor:pointer;
    display:flex; align-items:center; justify-content:center; background:#fff;
  }
  .task-check.done{ background:var(--green); border-color:var(--green); }
  .task-check svg{ width:11px; height:11px; color:#fff; display:none; }
  .task-check.done svg{ display:block; }
  .task-check-col{ display:flex; flex-direction:column; align-items:center; gap:4px; flex:0 0 auto; }
  .task-log-btn{
    width:18px; height:18px; border-radius:5px; border:1.6px solid var(--line); flex:0 0 auto; cursor:pointer;
    display:flex; align-items:center; justify-content:center; background:#fff;
    font-size:10px; font-weight:800; color:var(--muted); line-height:1;
  }
  .task-log-btn:hover{ background:var(--blue-tint); border-color:var(--blue); color:var(--blue); }
  .task-info{ flex:1; min-width:0; }
  .task-title{ font-size:13px; font-weight:600; }
  .task-title.done{ text-decoration:line-through; color:var(--muted-2); }
  .task-meta{ font-size:11.5px; color:var(--muted); margin-top:2px; }
  .task-due{ font-size:11px; font-weight:700; padding:2px 8px; border-radius:20px; flex:0 0 auto; white-space:nowrap; }

  /* ---------- Kanban ---------- */
  /* Fixed height so every column is fully visible at once (each scrolls its own
     cards internally) and the horizontal scrollbar sits at a constant position
     instead of wherever the tallest column happens to end. */
  .kanban-wrap{ display:flex; gap:14px; overflow-x:auto; padding-bottom:10px; align-items:flex-start; height:100%; }
  .kanban-col{
    flex:0 0 268px; background:#EEF0F3; border-radius:var(--radius); display:flex; flex-direction:column; height:100%;
    position:relative;
  }
  .kanban-col.drag-over{ background:#E4E9F4; outline:2px dashed var(--brand); outline-offset:-2px; }
  .kanban-col-head{ padding:12px 12px 8px; display:flex; align-items:center; gap:8px; }
  .kanban-col-dot{ width:9px; height:9px; border-radius:50%; flex:0 0 auto; }
  .kanban-col-title{ font-size:12.5px; font-weight:700; flex:1; }
  .kanban-col-count{ font-size:11px; color:var(--muted); background:#fff; border-radius:20px; padding:1px 8px; }
  .kanban-col-sum{ font-size:11px; color:var(--muted); padding:0 12px 10px; font-weight:600; }
  .kanban-cards{ padding:0 8px 8px; flex:1; overflow-y:auto; min-height:60px; }
  .kanban-card{
    background:#fff; border-radius:8px; padding:11px 12px; margin-bottom:8px; cursor:grab; box-shadow:var(--shadow-sm);
    border-left:3px solid var(--slate); transition:box-shadow .2s ease, transform .2s ease;
  }
  .kanban-card:hover{ box-shadow:var(--shadow-md); transform:translateY(-3px); }
  .kanban-card:active{ cursor:grabbing; }
  .kanban-card.dragging{ opacity:.4; }
  .kc-title{ font-size:13px; font-weight:700; margin-bottom:4px; line-height:1.3; }
  .kc-sub{ font-size:11.5px; color:var(--muted); margin-bottom:8px; }
  .kc-foot{ display:flex; align-items:center; justify-content:space-between; }
  .kc-owner{ width:22px; height:22px; border-radius:var(--radius-sm); background:var(--brand-tint); color:var(--brand-dark); font-size:10px; font-weight:700; display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto; }
  .sp-chip{ display:inline-flex; align-items:center; gap:6px; padding:4px 6px 4px 4px; border:1px solid var(--line); border-radius:var(--radius-sm); font-size:12px; font-weight:600; background:#fff; }
  .sp-chip-x{ border:none; background:transparent; color:var(--muted); cursor:pointer; font-size:15px; line-height:1; padding:0 2px; }
  .sp-chip-x:hover{ color:var(--red); }
  .drawer-link-chip{
    display:inline-flex; align-items:center; padding:4px 11px; border-radius:var(--radius-sm);
    background:var(--brand-tint); color:var(--brand-dark); font-size:12.5px; font-weight:600;
    cursor:pointer; transition:background .15s ease, color .15s ease, transform .15s ease;
  }
  .drawer-link-chip:hover{ background:var(--brand); color:#fff; transform:translateY(-1px); }
  .check-list{ display:flex; flex-direction:column; gap:2px; max-height:190px; overflow-y:auto; border:1px solid var(--line); border-radius:8px; padding:8px 10px; }
  .check-row{ display:flex; align-items:center; gap:8px; font-size:13px; padding:4px 0; cursor:pointer; }
  .check-row input{ width:auto; margin:0; }
  .col-menu-btn{
    background:none; border:none; padding:2px 5px; border-radius:4px; cursor:pointer; color:var(--muted);
    font-size:15px; line-height:1; vertical-align:middle;
  }
  .col-menu-btn:hover{ background:var(--line-soft); color:var(--ink-soft); }
  .colmgr-list{ display:flex; flex-direction:column; gap:2px; max-height:360px; overflow-y:auto; border:1px solid var(--line); border-radius:8px; padding:6px 10px; }
  .colmgr-row{ display:flex; align-items:center; gap:6px; padding:4px 0; border-bottom:1px solid var(--line-soft); }
  .colmgr-row:last-child{ border-bottom:none; }
  .colmgr-row.colmgr-dragging{ opacity:.4; }
  .colmgr-drag{ flex:0 0 auto; cursor:grab; color:var(--muted); font-size:16px; line-height:1; padding:2px 6px; }
  .colmgr-drag:active{ cursor:grabbing; }
  .colmgr-drag-ghost{
    position:fixed; top:-9999px; left:-9999px; background:#fff; border:2px solid var(--brand);
    border-radius:8px; box-shadow:var(--shadow-lg); padding:6px 10px;
  }
  .kanban-add{ margin:0 8px 10px; padding:8px; border-radius:8px; border:1px dashed #C7CCD3; background:transparent; color:var(--muted); font-weight:600; font-size:12px; cursor:pointer; text-align:center; }
  .kanban-add:hover{ background:#fff; color:var(--ink-soft); }

  /* ---------- Map ---------- */
  .map-toolbar{ display:flex; align-items:center; gap:16px; flex-wrap:wrap; margin-bottom:14px; }
  .map-toolbar-info{ font-size:12.5px; color:var(--muted); font-weight:600; display:flex; align-items:center; gap:10px; }
  .map-progress{ color:var(--brand-dark); }
  .map-legend{ display:flex; gap:14px; margin-left:auto; font-size:12px; color:var(--ink-soft); font-weight:600; }
  .map-legend-item{ display:flex; align-items:center; gap:6px; }
  .map-legend-item .dot{ width:9px; height:9px; }
  /* isolation:isolate traps Leaflet's own internal z-index values (its tile/marker panes go
     up to 400, its zoom controls to 1000) inside this element's own stacking context — without
     it, those values compare directly against unrelated siblings like the sidebar search
     dropdown (z-index:60) and win, since neither the map container nor its ancestors up to the
     root otherwise establish a stacking context of their own. */
  .map-canvas{ height:calc(100vh - 220px); min-height:420px; border-radius:var(--radius); border:1px solid var(--line); box-shadow:var(--shadow-sm); background:var(--card); isolation:isolate; }
  .leaflet-tooltip{ font-family:var(--font); font-size:12px; }

  /* ---------- Calendar ---------- */
  .cal-grid-head{ display:grid; grid-template-columns:repeat(7, 1fr); gap:8px; margin-bottom:6px; font-size:11.5px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; padding:0 2px; }
  .cal-grid{ display:grid; grid-template-columns:repeat(7, 1fr); grid-auto-rows:112px; gap:8px; }
  .cal-cell{ background:var(--card); border:1px solid var(--line); border-radius:10px; padding:7px 8px; overflow:hidden; cursor:pointer; transition:box-shadow .15s ease, border-color .15s ease; }
  .cal-cell:hover{ box-shadow:var(--shadow-md); border-color:var(--brand); }
  .cal-cell-muted{ background:var(--line-soft); }
  .cal-cell-muted .cal-cell-date{ color:var(--muted); }
  .cal-cell-today{ border-color:var(--brand); box-shadow:0 0 0 2px var(--brand-tint); }
  .cal-cell-date{ font-size:12.5px; font-weight:700; color:var(--ink); margin-bottom:4px; }
  .cal-cell-events{ display:flex; flex-direction:column; gap:3px; }
  .cal-chip{ font-size:10.5px; padding:2px 6px; border-radius:5px; background:var(--blue-tint); color:var(--blue); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .cal-chip-deal{ background:var(--brand-tint); color:var(--brand-dark); }
  .cal-chip-done{ opacity:.55; text-decoration:line-through; }
  .cal-more{ font-size:10.5px; color:var(--muted); font-weight:600; padding:1px 6px; }

  .cal-week-grid{ display:grid; grid-template-columns:repeat(7, 1fr); gap:8px; align-items:start; }
  .cal-week-col{ background:var(--card); border:1px solid var(--line); border-radius:10px; padding:10px; min-height:320px; cursor:pointer; transition:box-shadow .15s ease, border-color .15s ease; }
  .cal-week-col:hover{ box-shadow:var(--shadow-md); border-color:var(--brand); }
  .cal-week-col-head{ font-size:12.5px; font-weight:700; color:var(--ink); margin-bottom:8px; display:flex; align-items:baseline; gap:5px; }
  .cal-week-col-head span{ color:var(--muted); font-weight:600; }
  .cal-week-col-events{ display:flex; flex-direction:column; gap:5px; }
  .cal-empty-note{ color:var(--line); font-size:12px; }

  .cal-year-grid{ display:grid; grid-template-columns:repeat(4, 1fr); gap:16px; }
  @media (max-width:1100px){ .cal-year-grid{ grid-template-columns:repeat(3, 1fr); } }
  .cal-mini-month{ background:var(--card); border:1px solid var(--line); border-radius:10px; padding:12px; }
  .cal-mini-month-title{ font-size:12.5px; font-weight:700; margin-bottom:8px; cursor:pointer; }
  .cal-mini-month-title:hover{ color:var(--brand); }
  .cal-mini-grid{ display:grid; grid-template-columns:repeat(7, 1fr); gap:2px; }
  .cal-mini-cell{ aspect-ratio:1; display:flex; align-items:center; justify-content:center; font-size:10px; color:var(--ink-soft); border-radius:4px; cursor:pointer; }
  .cal-mini-cell:hover{ background:var(--line-soft); }
  .cal-mini-empty{ cursor:default; }
  .cal-mini-empty:hover{ background:none; }
  .cal-mini-has-events{ background:var(--brand-tint); color:var(--brand-dark); font-weight:700; }
  .cal-mini-today{ box-shadow:inset 0 0 0 1.5px var(--brand); }

  .cal-agenda-row{ display:flex; align-items:center; gap:10px; padding:7px 0; cursor:pointer; border-bottom:1px solid var(--line-soft); }
  .cal-agenda-row:last-child{ border-bottom:none; }
  .cal-agenda-row:hover .cal-agenda-label{ color:var(--brand); }
  .cal-agenda-label{ font-size:13px; font-weight:600; color:var(--ink); flex:1; }
  .cal-agenda-time{ font-size:12px; color:var(--muted); font-weight:600; }

  /* ---------- Tables ---------- */
  .table-wrap{ background:var(--card); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow-sm); max-height:60vh; overflow:auto; }
  table{ width:100%; border-collapse:collapse; }
  .table-wrap thead tr:first-child th:first-child{ border-top-left-radius:var(--radius); }
  .table-wrap thead tr:first-child th:last-child{ border-top-right-radius:var(--radius); }
  .table-wrap tbody tr:last-child td:first-child{ border-bottom-left-radius:var(--radius); }
  .table-wrap tbody tr:last-child td:last-child{ border-bottom-right-radius:var(--radius); }
  thead th{
    text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted);
    padding:11px 16px; border-bottom:1px solid var(--line); background:#FAFAFB; font-weight:700; white-space:nowrap; cursor:pointer;
    user-select:none; position:sticky; top:0; z-index:1;
  }
  .company-contacts-table thead th{ position:static; }
  thead th:hover{ color:var(--ink-soft); }
  thead th.sorted::after{ content:" \2193"; }
  thead th.sorted-asc::after{ content:" \2191"; }
  tbody td{ padding:12px 16px; border-bottom:1px solid var(--line-soft); font-size:13px; vertical-align:middle; }
  tbody tr{ cursor:pointer; transition:background .1s; }
  tbody tr:hover{ background:#FAFAFB; }
  tbody tr:last-child td{ border-bottom:none; }
  .cell-name{ font-weight:700; color:var(--ink); }
  .cell-sub{ font-size:11.5px; color:var(--muted); margin-top:1px; }
  .row-actions{ display:flex; gap:6px; opacity:0; transition:opacity .1s; }
  tbody tr:hover .row-actions{ opacity:1; }
  .company-contacts-row td{ background:var(--bg); padding:10px 16px 14px 46px; }
  .company-contacts-table{ width:100%; border-collapse:collapse; background:#fff; border:1px solid var(--line); border-radius:8px; overflow:hidden; }
  .company-contacts-table thead th{
    text-align:left; font-size:10.5px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted);
    padding:8px 14px; border-bottom:1px solid var(--line); font-weight:700;
  }
  .company-contacts-table tbody td{ padding:9px 14px; border-bottom:1px solid var(--line-soft); background:#fff; }
  .company-contacts-table tbody tr:last-child td{ border-bottom:none; }
  .company-contacts-table tbody tr:hover td{ background:var(--brand-tint); }
  .pagination{ display:flex; align-items:center; gap:12px; padding:12px 4px 0; }

  .badge{ display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:700; padding:3px 9px; border-radius:var(--radius-sm); white-space:nowrap; }
  .dot{ width:6px; height:6px; border-radius:50%; }

  .report-filter-row{ display:flex; gap:8px; align-items:center; }
  .report-filter-row select, .report-filter-row input{ width:auto; flex:1; min-width:0; }
  /* Page-level tabs, e.g. Reception/Messages sharing one nav item. */
  .view-tabs{ display:flex; gap:4px; border-bottom:1px solid var(--line); }
  .view-tab{ padding:10px 16px; font-size:13.5px; font-weight:600; color:var(--muted); cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-1px; }
  .view-tab:hover{ color:var(--ink-soft); }
  .view-tab.active{ color:var(--brand-dark); border-bottom-color:var(--brand); }
  .toolbar{ display:flex; align-items:center; gap:10px; margin-bottom:16px; flex-wrap:wrap; }
  .chip-filter{
    display:flex; align-items:center; gap:6px; padding:6px 12px; border-radius:var(--radius-sm); border:1px solid var(--line); background:#fff;
    font-size:12.5px; font-weight:600; color:var(--ink-soft); cursor:pointer;
  }
  .chip-filter.active{ background:var(--green-tint); border-color:var(--green-tint); color:var(--green); }

  /* Per-user rows on the Team view. */
  .team-rep-block{ padding:8px 0; border-bottom:1px solid var(--line-soft); }
  .team-rep-block:last-child{ border-bottom:none; }

  .empty-state{ text-align:center; padding:60px 20px; color:var(--muted); }
  .empty-state svg{ width:40px; height:40px; color:var(--muted-2); margin-bottom:12px; }
  .empty-state h3{ font-size:15px; color:var(--ink-soft); margin:0 0 4px; }
  .empty-state p{ font-size:13px; margin:0; }

  /* ---------- Modal ---------- */
  .overlay{
    position:fixed; inset:0; background:rgba(20,23,28,0.45); display:flex; align-items:center; justify-content:center;
    z-index:1200; opacity:0; pointer-events:none; transition:opacity .15s;
  }
  .overlay.show{ opacity:1; pointer-events:auto; }
  .modal{
    background:#fff; border-radius:14px; width:520px; max-width:92vw; max-height:88vh; overflow-y:auto;
    box-shadow:var(--shadow-lg); transform:translateY(8px) scale(.98); transition:transform .15s;
  }
  .modal.modal-wide{ width:860px; }
  .modal-section-title{ font-size:11px; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); font-weight:700; margin:18px 0 10px; }
  .modal-section-title:first-child{ margin-top:0; }
  .option-row{ display:grid; grid-template-columns:2fr 1.3fr 1fr 1fr 1fr 1fr auto auto; gap:8px; align-items:center; margin-bottom:8px; }
  .option-row input[type="text"], .option-row input[type="number"]{ padding:7px 8px; font-size:12.5px; }
  .option-row-head{ display:grid; grid-template-columns:2fr 1.3fr 1fr 1fr 1fr 1fr auto auto; gap:8px; font-size:11px; color:var(--muted); margin-bottom:6px; }
  .overlay.show .modal{ transform:translateY(0) scale(1); }
  .modal-head{ display:flex; align-items:center; justify-content:space-between; padding:18px 22px; border-bottom:1px solid var(--line); position:sticky; top:0; background:#fff; }
  .modal-title{ font-size:15.5px; font-weight:700; }
  .modal-body{ padding:20px 22px; }
  .modal-foot{ display:flex; justify-content:space-between; align-items:center; padding:16px 22px; border-top:1px solid var(--line); }

  .field{ margin-bottom:14px; }
  .field label{ display:block; font-size:12px; font-weight:700; color:var(--ink-soft); margin-bottom:5px; }
  .field-row{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
  input[type=text], input[type=password], input[type=number], input[type=date], input[type=email], input[type=tel], select, textarea{
    width:100%; padding:9px 11px; border:1px solid var(--line); border-radius:8px; background:#fff; outline:none;
    transition:border-color .12s;
  }
  input:focus, select:focus, textarea:focus{ border-color:var(--brand); }
  textarea{ resize:vertical; min-height:70px; }

  /* searchable company picker */
  .search-select{ position:relative; }
  .ss-input{ width:100%; }
  .ss-list{ position:absolute; z-index:20; left:0; right:0; top:calc(100% + 4px); background:#fff; border:1px solid var(--line); border-radius:8px; box-shadow:var(--shadow-lg); max-height:220px; overflow-y:auto; padding:4px; }
  .ss-item{ padding:8px 10px; border-radius:6px; font-size:13px; cursor:pointer; }
  .ss-item:hover{ background:var(--brand-tint); color:var(--brand-dark); }
  .ss-create{ color:var(--brand-dark); font-weight:600; border-top:1px solid var(--line-soft); margin-top:4px; }

  /* duplicate-company warning */
  .dup-warning{ margin:-6px 0 14px; padding:10px 12px; border:1px solid var(--amber); border-left-width:3px; background:var(--amber-tint); border-radius:8px; }
  .dup-title{ font-size:12px; font-weight:800; color:var(--ink); margin-bottom:6px; }
  .dup-item{ font-size:12.5px; padding:4px 0; cursor:pointer; color:var(--ink-soft); }
  .dup-item:hover{ color:var(--brand-dark); text-decoration:underline; }
  .dup-reason{ color:var(--muted); font-size:11px; }

  /* ---------- Detail slide-over ---------- */
  .drawer-overlay{
    position:fixed; inset:0; background:rgba(20,23,28,0.35); z-index:1100; opacity:0; pointer-events:none; transition:opacity .15s;
  }
  .drawer-overlay.show{ opacity:1; pointer-events:auto; }
  .drawer{
    position:fixed; top:0; right:0; bottom:0; width:640px; max-width:92vw; background:#fff; z-index:1101;
    box-shadow:-8px 0 32px rgba(20,23,28,0.18); transform:translateX(100%); transition:transform .18s ease; overflow-y:auto;
  }
  .drawer.show{ transform:translateX(0); }
  .drawer-head{ padding:22px 22px 16px; border-bottom:1px solid var(--line); }
  .drawer-avatar{ width:48px; height:48px; border-radius:12px; background:var(--brand); color:#fff; font-weight:800; font-size:17px; display:flex; align-items:center; justify-content:center; margin-bottom:12px; }
  .drawer-name{ font-size:18px; font-weight:800; }
  .drawer-sub{ font-size:12.5px; color:var(--muted); margin-top:2px; }
  .drawer-actions{ display:flex; gap:8px; margin-top:14px; }
  /* Tabs split a long drawer (info + activity + notes all at once) into scannable
     chunks instead of one long scroll. */
  .drawer-tabs{ display:flex; gap:4px; padding:0 22px; border-bottom:1px solid var(--line); position:sticky; top:0; background:#fff; z-index:2; }
  .drawer-tab{ padding:12px 14px; font-size:13px; font-weight:600; color:var(--muted); cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-1px; }
  .drawer-tab:hover{ color:var(--ink-soft); }
  .drawer-tab.active{ color:var(--brand-dark); border-bottom-color:var(--brand); }
  .drawer-section{ padding:16px 22px; border-bottom:1px solid var(--line-soft); }
  .drawer-section-title{ font-size:11px; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); font-weight:700; margin-bottom:10px; }
  .kv-row{ display:flex; justify-content:space-between; padding:6px 0; font-size:13px; }
  .kv-row .k{ color:var(--muted); }
  .kv-row .v{ font-weight:600; text-align:right; }
  .mini-deal{ padding:10px 12px; border:1px solid var(--line); border-radius:8px; margin-bottom:8px; cursor:pointer; }
  .mini-deal:hover{ border-color:var(--brand); }
  .mini-deal:last-child{ margin-bottom:0; }
  .mini-deal-title{ font-size:12.5px; font-weight:700; }
  .mini-deal-meta{ font-size:11px; color:var(--muted); margin-top:3px; display:flex; justify-content:space-between; }
  .note-text{ font-size:13px; line-height:1.55; color:var(--ink-soft); white-space:pre-wrap; }

  /* ---------- Toast ---------- */
  #toast-wrap{ position:fixed; bottom:22px; right:22px; z-index:1300; display:flex; flex-direction:column; gap:8px; }
  .toast{
    background:var(--ink); color:#fff; padding:11px 16px; border-radius:9px; font-size:13px; font-weight:600;
    box-shadow:var(--shadow-lg); display:flex; align-items:center; gap:9px; animation:toast-in .18s ease;
  }
  .toast svg{ width:15px; height:15px; color:var(--green); flex:0 0 auto; }
  .toast.danger svg{ color:var(--red); }
  .toast-action{
    border:none; background:none; color:var(--brand); font-weight:700; font-size:13px; cursor:pointer;
    text-decoration:underline; padding:0; margin-left:4px; flex:0 0 auto;
  }
  .toast-action:hover{ color:#fff; }
  @keyframes toast-in{ from{ opacity:0; transform:translateY(8px);} to{opacity:1; transform:translateY(0);} }

  ::-webkit-scrollbar{ width:9px; height:9px; }
  ::-webkit-scrollbar-thumb{ background:#D3D6DB; border-radius:8px; }
  ::-webkit-scrollbar-track{ background:transparent; }

  /* ---------- Login ---------- */
  #login-screen{ position:fixed; inset:0; z-index:1400; display:flex; align-items:center; justify-content:center; background:var(--bg); padding:20px; }
  .login-card{ width:100%; max-width:400px; background:#fff; border:1px solid var(--line); border-radius:16px; box-shadow:var(--shadow-lg); padding:28px; }
  .login-brand{ margin-bottom:22px; }
  .login-logo{ width:100%; height:auto; display:block; border-radius:10px; }
  .login-title{ font-size:20px; font-weight:800; color:var(--ink); }
  .login-sub{ font-size:13px; color:var(--muted); margin:2px 0 18px; }

  @media (max-width: 980px){
    .stat-grid{ grid-template-columns:repeat(2,1fr); }
    .dash-grid{ grid-template-columns:1fr; }
    .report-priority-grid{ grid-template-columns:1fr; }
  }

  /* ---------- Field Sales (mobile) ---------- */
  #field-sales-screen{
    position:fixed; inset:0; z-index:200; flex-direction:column; background:var(--bg);
  }
  .field-header{
    flex:0 0 auto; display:flex; align-items:center; gap:10px;
    padding:calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px; background:var(--sidebar); color:#fff;
  }
  .field-header-logo{ width:28px; height:28px; object-fit:contain; }
  .field-header-title{ flex:1; min-width:0; font-size:15px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .field-header-actions{ display:flex; gap:8px; }
  .field-header-btn{
    background:rgba(255,255,255,0.14); color:#fff; border:1px solid rgba(255,255,255,0.35);
    border-radius:var(--radius-sm); padding:7px 12px; font-size:12.5px; font-weight:600; cursor:pointer;
  }
  .field-header-btn:hover{ background:rgba(255,255,255,0.24); }
  .field-location-banner{
    flex:0 0 auto; padding:9px 16px; background:var(--amber-tint); color:var(--amber);
    font-size:12.5px; font-weight:600; text-align:center;
  }
  .field-empty-banner{ background:var(--blue-tint); color:var(--blue); }
  .field-map-wrap{ position:relative; flex:1; width:100%; }
  .field-map{ position:absolute; inset:0; }

  /* Tap-to-select info panel — updates in place as different markers are tapped, instead of
     jumping straight into the full drawer for every tap (labels-beside-every-marker was ruled
     out as too cluttered; hover-for-name isn't available on touch). */
  .field-info-panel{
    position:absolute; left:10px; right:10px; bottom:calc(env(safe-area-inset-bottom, 0px) + 14px);
    z-index:450; background:#fff; border-radius:14px; box-shadow:var(--shadow-lg);
    display:none; flex-direction:column; overflow:hidden;
  }
  .field-info-main{ display:flex; align-items:center; gap:12px; padding:14px 16px; cursor:pointer; }
  .field-info-avatar{
    flex:0 0 auto; width:38px; height:38px; border-radius:var(--radius); background:var(--ink); color:#fff;
    display:flex; align-items:center; justify-content:center;
  }
  .field-info-avatar svg{ width:18px; height:18px; }
  .field-info-text{ flex:1; min-width:0; }
  .field-info-name{ font-size:15px; font-weight:700; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .field-info-sub{ font-size:12.5px; color:var(--muted); margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .field-info-meta{ display:flex; align-items:center; flex-wrap:wrap; gap:6px; margin-top:6px; }
  .field-info-meta .badge{ font-size:11px; padding:2px 7px; }
  .field-info-team{ font-size:11.5px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .field-info-chevron{ flex:0 0 auto; font-size:24px; line-height:1; color:var(--muted-2); }
  .field-info-actions{ display:grid; grid-template-columns:1fr 1fr 1fr; border-top:1px solid var(--line-soft); }
  .field-info-action-btn{
    display:flex; align-items:center; justify-content:center; gap:6px; padding:12px; min-height:44px;
    border:none; border-right:1px solid var(--line-soft); background:#fff; font-size:13px; font-weight:700;
    color:var(--ink); cursor:pointer;
  }
  .field-info-action-btn:last-child{ border-right:none; }
  .field-info-action-btn svg{ width:16px; height:16px; }
  .field-info-action-btn:hover:not(:disabled){ background:var(--brand-tint); color:var(--brand-dark); }
  .field-info-action-btn:disabled{ opacity:.4; cursor:not-allowed; }

  /* Permanent marker name label (medium+ zoom) — overrides Leaflet's default tooltip chrome,
     !important because leaflet.css loads after this file and would otherwise win the cascade. */
  .field-marker-label{
    background:#fff !important; border:none !important; border-radius:var(--radius-sm) !important;
    padding:2px 8px !important; font-size:11.5px !important; font-weight:700 !important;
    color:var(--ink) !important; box-shadow:0 1px 3px rgba(0,0,0,.25) !important;
  }
  .field-marker-label::before{ display:none !important; }

  .field-drawer-head{ position:relative; padding-top:8px; }
  .field-drawer-close{
    position:absolute; top:10px; right:14px; width:34px; height:34px; border-radius:var(--radius-sm); border:none;
    background:var(--line-soft); color:var(--ink-soft); display:flex; align-items:center; justify-content:center;
    cursor:pointer;
  }
  .field-drawer-close svg{ width:16px; height:16px; }
  .field-drawer-close:hover{ background:var(--line); }
  .field-drawer-actions{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:10px; padding:16px 22px 4px; }
  .field-action-btn{
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; min-height:64px;
    border:1px solid var(--line); border-radius:var(--radius); background:#fff; cursor:pointer;
    font-size:13px; font-weight:700; color:var(--ink);
  }
  .field-action-btn svg{ width:20px; height:20px; }
  .field-action-btn:hover:not(:disabled){ background:var(--brand-tint); border-color:var(--brand); color:var(--brand-dark); }
  .field-action-btn:disabled{ opacity:.4; cursor:not-allowed; }

  .field-contact-team{ font-size:10.5px; color:var(--muted); margin-top:4px; }

  .field-summary-grid{ display:grid; grid-template-columns:repeat(4, 1fr); gap:8px; }
  .field-summary-stat{ text-align:center; padding:10px 4px; background:var(--line-soft); border-radius:var(--radius-sm); }
  .field-summary-num{ font-size:18px; font-weight:800; color:var(--ink); }
  .field-summary-label{ font-size:10px; color:var(--muted); margin-top:2px; text-transform:uppercase; letter-spacing:.02em; }

  .field-picker-overlay{
    position:fixed; inset:0; z-index:1150; background:rgba(20,23,28,0.45);
    display:flex; align-items:flex-end; justify-content:center;
  }
  .field-picker-card{
    width:100%; max-width:420px; background:#fff; border-radius:16px 16px 0 0;
    padding:10px 6px calc(env(safe-area-inset-bottom, 0px) + 10px); box-shadow:var(--shadow-lg);
  }
  .field-picker-title{ font-size:13px; font-weight:700; color:var(--muted); text-align:center; padding:10px 16px; }
  .field-picker-item{ padding:12px 16px; min-height:44px; border-top:1px solid var(--line-soft); cursor:pointer; }
  .field-picker-item:hover{ background:var(--line-soft); }
  .field-picker-name{ font-size:14.5px; font-weight:600; color:var(--ink); }
  .field-picker-sub{ font-size:12.5px; color:var(--muted); margin-top:2px; }
  .field-picker-team{ font-size:10.5px; color:var(--muted); margin-top:3px; }
  .field-picker-cancel{
    text-align:center; padding:14px; margin-top:6px; font-size:14px; font-weight:700;
    color:var(--red); cursor:pointer; border-top:1px solid var(--line-soft);
  }
