/* CID/IP design system: warm, calm surfaces with a confident green accent. */
:root{
  color-scheme: light;
  --bg: #fcfaf5;
  --surface: #ffffff;
  --surface-2: #f4f8f1;
  --surface-3: #eaf5e8;
  --line: #d9e4d5;
  --line-strong: #9aad9b;
  --text: #1e2920;
  --muted: #58665c;
  --primary: #6acc6f;
  --primary-hover: #59bd60;
  --primary-active: #49aa52;
  --primary-soft: #eaf7e8;
  --primary-ink: #18311c;
  --primary-text: #287a35;
  --focus: #236d2f;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --success: #166534;
  --success-soft: #edf7ef;
  --warning: #8a4b08;
  --warning-soft: #fff7ed;
  --primary-light: #8cdd91;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(32,57,36,.05), 0 14px 38px rgba(32,57,36,.08);
  --shadow-raised: 0 16px 42px rgba(32,57,36,.14);
  --page-gutter: clamp(10px, 2.4vw, 36px);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
.hidden{ display:none !important; }
.visually-hidden{
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  padding:0 !important;
  margin:-1px !important;
  overflow:hidden !important;
  clip:rect(0, 0, 0, 0) !important;
  white-space:nowrap !important;
  border:0 !important;
}
.skip-link{
  position:fixed;
  top:10px;
  left:10px;
  z-index:1000;
  transform:translateY(-160%);
  padding:10px 14px;
  border-radius:10px;
  color:var(--primary-ink);
  background:var(--primary);
  font-weight:800;
}
.skip-link:focus{ transform:translateY(0); }
body{
  margin: 0;
  background:
    radial-gradient(900px 520px at 2% -10%, rgba(106,204,111,.16), transparent 64%),
    radial-gradient(760px 460px at 102% 8%, rgba(106,204,111,.10), transparent 68%),
    var(--bg);
  color: var(--text);
  font: 16px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

.container{
  width:100%; max-width:1440px; margin:0 auto;
  padding:var(--page-gutter);
}
.container.insights-container{
  max-width:clamp(1440px, 84vw, 1680px);
}
.container.container-wide{
  max-width:clamp(1780px, 92vw, 2080px);
}

.appbar{
  display:flex; align-items:center; justify-content:space-between;
  gap:16px;
  margin:0 0 clamp(18px, 2.2vw, 30px);
  padding:10px 12px;
  border:1px solid rgba(94,126,98,.16);
  border-radius:18px;
  background:rgba(255,255,255,.78);
  box-shadow:0 1px 2px rgba(32,57,36,.04);
  backdrop-filter:blur(12px);
}
.actions{ display:flex; flex-wrap: wrap; gap:10px; }
.actions > *, .actions form{ min-width:0; }
.actions form{ margin:0; }

.brand{
  display:flex; align-items:center; gap:10px; font-weight:800; letter-spacing:.1px;
}
.brand .mark{
  width: 12px; height: 12px; border-radius: 50%;
  background:radial-gradient(circle at 30% 30%, var(--primary-light), var(--primary));
  box-shadow: 0 0 0 5px rgba(106,204,111,.16);
}
.brand span{ color: var(--text); }
.brand strong{ color: var(--primary-text); }

.btn{
  appearance:none; border:1px solid #86a088;
  color: var(--primary-text);
  background: rgba(255,255,255,.94);
  padding: 10px 16px; border-radius: 12px;
  text-decoration:none; font-weight:750; letter-spacing:.05px;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
  display:inline-flex; align-items:center; justify-content:center;
  min-height:44px; font:inherit; cursor:pointer;
}
.btn.primary{
  background: var(--primary);
  color: var(--primary-ink);
  border-color: #58b960;
  box-shadow: 0 8px 20px rgba(59,133,65,.18);
}
.btn.export-btn,
.btn.primary.export-btn{
  color: var(--primary-ink);
}
.btn.is-loading{
  opacity: .6;
  cursor: wait;
}
.btn:disabled{ opacity:.55; cursor:not-allowed; transform:none; }
@media (hover:hover){
  .btn:hover{
    color:var(--primary-ink);
    border-color:var(--primary-text);
    background:var(--primary-soft);
    box-shadow:0 7px 18px rgba(32,86,39,.12);
    transform:translateY(-1px);
  }
  .btn.primary:hover{
    background:var(--primary-hover);
    border-color:#409f49;
    box-shadow:0 10px 24px rgba(49,121,56,.22);
  }
}
.btn:active{ transform:translateY(0); }
.btn.primary:active{ background:var(--primary-active); }
.btn:focus-visible,
.page-link:focus-visible,
.tab-chip:focus-visible,
.page-control:focus-visible,
.page-number:focus-visible,
.sort-link:focus-visible,
.download-pill:focus-visible{
  outline:3px solid var(--focus);
  outline-offset:3px;
}

.card{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width:0;
}
.card.padded{ padding:clamp(16px, 2vw, 24px); }

.grid{ display:grid; gap:clamp(14px, 1.6vw, 22px); }
.grid > *, .metric > *, .section-heading > *, .appbar > *{ min-width:0; }
.grid.cols-3{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* Tablet: 2 columns; Phone: 1 column */
@media (max-width: 1200px){ .grid.cols-3{ grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px){ .grid.cols-3{ grid-template-columns: 1fr; } }

/* Only span across 2 columns on large screens (prevents implicit extra columns on mobile) */
.span-2-lg { grid-column: auto; }
@media (min-width: 1200px){ .span-2-lg { grid-column: span 2; } }

.metric{ display:flex; align-items:center; gap:14px; }
.metric .dot{ width:10px; height:10px; border-radius:50%; background:var(--primary); box-shadow:0 0 0 6px rgba(106,204,111,.17); }
.metric .label{ color: var(--muted); font-size: 13px; }
.metric .value{ font-size:clamp(22px, 2.4vw, 30px); font-weight:800; letter-spacing:-.025em; font-variant-numeric:tabular-nums; }
.kpi-grid .metric{ position:relative; overflow:hidden; }
.kpi-grid .metric::after{
  content:""; position:absolute; width:94px; height:94px; right:-34px; bottom:-46px;
  border-radius:50%; background:rgba(106,204,111,.10); pointer-events:none;
}

.table{ width:100%; border-collapse:collapse; table-layout:auto; }
.table th, .table td{
  text-align:left; padding:12px; border-bottom:1px solid var(--line);
  vertical-align: top;
}
/* Let long tokens (e.g., computer_id hashes) wrap instead of pushing the layout wide */
.table th, .table td{ overflow-wrap: anywhere; word-break: break-word; }
.table th{
  color:#405248; font-weight:750; text-transform:uppercase; font-size:12px; letter-spacing:.055em;
  background:var(--surface-2);
}
@media (hover:hover){ .table tbody tr:hover td{ background-color:var(--primary-soft); } }

.filter-card{ margin-top:24px; }
.filters-grid{
  display:grid;
  gap:14px;
  grid-template-columns:repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  margin-top:16px;
}
.filter-field label{ font-size:13px; color:#405248; display:block; margin-bottom:6px; font-weight:700; }
.filter-actions{ margin-top:8px; }
.filter-hint{ margin-top:14px; font-size:13px; }
.filter-inline{
  margin-top:12px;
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}
.filter-inline label{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.45px;
  color: var(--muted);
}
.filter-inline select{
  width:auto;
  min-width:130px;
}
.active-filters{
  margin:18px 0 0;
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
}
.active-filters-label{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.4px;
  color: var(--muted);
}
.filter-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 12px;
  border-radius:999px;
  border:1px solid #a7c9a5;
  background:var(--primary-soft);
  font-size:13px;
  color: var(--text);
}
.filter-chip strong{
  color:var(--primary-text);
  font-weight:600;
  letter-spacing:.2px;
}

.prop-dashboard-card{ margin-top:24px; }
.prop-dashboard-scroll{
  overflow-x:auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom:12px;
  cursor: grab;
  touch-action: pan-x pan-y;
  overscroll-behavior-inline:contain;
}
.prop-dashboard-scroll.is-grabbing{ cursor: grabbing; }
.prop-table{
  width:100%;
  min-width:1240px;
  border-collapse:separate;
  border-spacing:0 12px;
  table-layout:auto;
}
.prop-table thead th{
  background:#edf3ea;
  padding:14px 18px;
  border-bottom:none;
  position:sticky;
  top:0;
  z-index:2;
}
.prop-table tbody tr{
  background:var(--surface);
  outline:1px solid var(--line);
  transition: box-shadow .18s ease, transform .18s ease;
}
.prop-table tbody tr:nth-child(even){ background:#fbfdf9; }
@media (hover:hover){
  .prop-table tbody tr:hover{
    background:var(--primary-soft);
    box-shadow:0 14px 28px rgba(41,91,46,.11);
    transform:translateY(-1px);
  }
}
.prop-table tbody tr:hover td{ background: none; }
.prop-table tbody td{
  padding:16px 18px;
  border-bottom:none;
}
.prop-table tbody td:first-child{
  border-top-left-radius:14px;
  border-bottom-left-radius:14px;
}
.prop-table tbody td:last-child{
  border-top-right-radius:14px;
  border-bottom-right-radius:14px;
}
.prop-table .badge{ align-self:flex-start; }
.no-rows{
  text-align:center;
  padding:28px 0;
  background:var(--surface-2);
  border-radius:12px;
}
.prop-stack{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.prop-stack .muted{ font-size:13px; color: var(--muted); }
.prop-meta{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.45px;
  color: var(--muted);
}
.prop-tag-group{ display:flex; flex-direction:column; gap:6px; }
.prop-tag-row{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.prop-stats{ gap:8px; }
.prop-stat{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:14px;
}
.prop-stat span{
  color: var(--muted);
  text-transform:uppercase;
  letter-spacing:.4px;
  font-size:12px;
  white-space:nowrap;
}
.prop-stat strong{
  font-size:16px;
  font-weight:700;
  color: var(--text);
  white-space:nowrap;
}
.mono{
  font-family: "SFMono-Regular",Consolas,"Liberation Mono",Menlo,monospace;
  letter-spacing:.4px;
}
.sort-link{
  display:inline-flex;
  align-items:center;
  gap:6px;
  color: var(--muted);
  text-decoration:none;
  font-weight:600;
  letter-spacing:.6px;
  font-size:12px;
}
.sort-link .sort-indicator{ font-size:12px; opacity:.6; }
.sort-link:hover{ color:var(--primary-text); }
.sort-link.active{ color:var(--primary-text); }
.sort-link.active .sort-indicator{ opacity:1; }
.prop-table-footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-top:18px;
}
.pagination-meta{ min-width:180px; }
.pagination-controls{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.page-control{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:7px 14px;
  border-radius:999px;
  border:1px solid var(--line-strong);
  background:var(--surface);
  color: var(--muted);
  font-size:12px;
  letter-spacing:.5px;
  text-decoration:none;
  transition:color .18s ease, border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.page-control:hover{
  color:var(--primary-text);
  border-color:var(--primary-text);
  background:var(--primary-soft);
}
.page-control.disabled{
  opacity:0.35;
  pointer-events:none;
  cursor:default;
}
.page-number-group{
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
  max-width:100%;
}
.page-number{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:44px;
  height:44px;
  padding:0 10px;
  border-radius:10px;
  border:1px solid transparent;
  background:var(--surface-2);
  color: var(--muted);
  font-size:13px;
  text-decoration:none;
  transition:color .16s ease, border-color .16s ease, background-color .16s ease;
}
a.page-number:hover{
  color:var(--primary-text);
  border-color:#94bd94;
  background:var(--primary-soft);
}
.page-number.active{
  background:var(--primary);
  color:var(--primary-ink);
  border-color:#4fac56;
  font-weight:700;
}
.page-number.ellipsis{
  border:none;
  background:transparent;
  color: var(--muted);
  min-width:auto;
  padding:0 4px;
}

.copy-row{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.copy-row .muted{
  display:inline-flex;
  align-items:center;
  gap:6px;
}
.copy-value{
  font-family:inherit;
  color:inherit;
}
.copy-btn{
  appearance:none;
  border:1px solid var(--line-strong);
  background:var(--surface);
  color:var(--primary-text);
  font:inherit;
  font-size:12px;
  min-height:40px;
  padding:6px 12px;
  border-radius:999px;
  cursor:pointer;
  transition:color .16s ease, border-color .16s ease, background-color .16s ease;
}
.copy-btn:hover,
.copy-btn:focus-visible{
  color:var(--primary-ink);
  border-color:var(--primary-text);
  background:var(--primary-soft);
}
.copy-btn:focus-visible,
.map-control-btn:focus-visible,
.table-scroll:focus-visible{
  outline:3px solid var(--focus);
  outline-offset:3px;
}
.copy-btn.copied{
  color:var(--success);
  border-color:#79ad80;
  background:var(--success-soft);
  font-weight:600;
}

.export-card{
  margin: 20px 0;
  border:1px solid #b5d7b2;
  background:linear-gradient(135deg, var(--surface), #f5fbf3);
}
.export-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
}
.export-header-actions{
  display:flex;
  flex-direction:column;
  gap:8px;
  align-items:flex-end;
}
.eyebrow{
  font-size:11px;
  letter-spacing:.6px;
  text-transform:uppercase;
  color: var(--muted);
}
.small{ font-size:13px; }
.export-status, .export-downloads{ margin-top:14px; }
.status-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.status-label{ font-weight:700; letter-spacing:.2px; }
.status-value{
  font-weight:700;
  color:var(--primary-text);
}
.progress-bar{
  position:relative;
  width:100%;
  height:12px;
  background:#e3ebe0;
  border-radius:999px;
  overflow:hidden;
  margin:8px 0;
  border:1px solid #b4c8b2;
}
.progress-fill{
  position:absolute;
  top:0; left:0; bottom:0;
  width:0%;
  background:linear-gradient(90deg, var(--primary-active), var(--primary));
  box-shadow:0 0 14px rgba(67,159,75,.28);
}
.status-meta{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  font-size:13px;
  color: var(--muted);
}
.download-list{
  display:grid;
  gap:10px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top:10px;
}
.download-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--surface-2);
}
.download-pill{
  text-decoration:none;
  color:var(--primary-text);
  font-weight:700;
  letter-spacing:.2px;
}

@media (max-width: 900px){
  .prop-table{ min-width:1240px; }
}

/* Forms - fluid fields */
form.form-vertical { display:grid; gap:12px; max-width: 520px; }
.form-field{ display:grid; gap:6px; }
.message-list{ display:grid; gap:8px; margin:0 0 14px; }
.message{
  margin:0;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--surface-2);
}
.message.error{
  color:var(--danger);
  border-color:#e9a9a3;
  background:var(--danger-soft);
}
.message.success{
  color:var(--success);
  border-color:#a8cfad;
  background:var(--success-soft);
}
.form-errors, .errorlist{
  margin:0;
  padding:0;
  list-style:none;
  color:var(--danger);
  font-size:13px;
}
input[type="text"], input[type="password"], input[type="number"],
input, select, textarea{
  width: 100%;
  padding: .65rem .7rem;
  border:1px solid #839687;
  border-radius:12px;
  background:var(--surface);
  color: var(--text);
  min-height:44px;
  font:inherit;
}
input:focus, select:focus, textarea:focus{
  outline: none;
  border-color:var(--focus);
  box-shadow:0 0 0 3px rgba(35,109,47,.15);
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus{
  -webkit-text-fill-color:var(--text);
  caret-color:var(--text);
  box-shadow:0 0 0 1000px var(--surface) inset;
  transition:background-color 9999s ease-out 0s;
}

.kbd{
  display:inline-block; padding:2px 6px; border-radius:6px;
  border:1px solid #b4c1b3; color:#405248; font-size:12px;
  background:var(--surface-2);
}

.badge{
  display:inline-block; padding:3px 8px; border-radius:999px;
  border:1px solid var(--line-strong); font-size:12px; letter-spacing:.3px;
  white-space:nowrap;
}
.badge.gold,
.badge.accent{ color:var(--primary-text); border-color:#9ec69d; background:var(--primary-soft); }
.badge.neutral{ color:#405248; border-color:#b7c3b5; background:var(--surface-2); }
.badge.success{ color:var(--success); border-color:#acd0b0; background:var(--success-soft); }
.badge.warning{ color:var(--warning); border-color:#ebbd80; background:var(--warning-soft); }

.muted{ color: var(--muted); }
.section-title{ margin:12px 0; font-weight:800; letter-spacing:-.02em; line-height:1.22; }
h1.section-title{ font-size:clamp(1.5rem, 6vw, 2rem); line-height:1.2; }
.page-heading{ display:grid; gap:6px; margin:2px 0 18px; }
.page-heading .section-title{ margin:0; }
.page-heading p{ margin:0; max-width:720px; }

.footer{
  margin-top:clamp(28px, 5vw, 64px); padding:20px 18px; text-align:center; color:var(--muted);
  border-top: 1px solid var(--line);
  font-size: 13px;
}

/* Small-screen tuning */
@media (max-width: 720px){
  body { font-size:16px; }
  .container{ padding:var(--page-gutter); }
  .card.padded{ padding:14px; }
  .appbar{ align-items:flex-start; flex-wrap:wrap; gap:12px; }
  .actions{ width:100%; display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); }
  .actions .btn{
    width:100%;
    min-width:0;
    padding-inline:clamp(8px, 3vw, 14px);
    font-size:clamp(14px, 3.8vw, 16px);
    line-height:1.25;
    text-align:center;
    white-space:nowrap;
  }
  .actions form .btn{ height:100%; }
  .summary-analytics{ grid-template-columns:minmax(0, 1fr); }
  .detail-controls{ align-items:stretch; }
  .tab-switcher{ display:flex; width:100%; }
  .tab-chip{ flex:1; text-align:center; }
  .range-chip{ width:100%; }
  .range-chip strong{ overflow-wrap:anywhere; }
  .pagination{ justify-content:center; flex-wrap:wrap; }
  .prop-table-footer, .pagination-controls{ justify-content:center; }
  .pagination-meta{ min-width:0; width:100%; text-align:center; }
  .export-header-actions{ align-items:stretch; width:100%; }
  .export-header-actions .btn{ width:100%; }
  .download-list{ grid-template-columns:minmax(0, 1fr); }
  .download-item{ align-items:flex-start; flex-wrap:wrap; }
  .filter-chip, .download-pill{ overflow-wrap:anywhere; }
  .table th, .table td { padding: 10px; font-size: 14px; }
  .metric .value{ font-size: 20px; }
}
@media (max-width: 300px){
  .actions{ grid-template-columns:minmax(0, 1fr); }
}
@media (max-width: 420px){
  .table th, .table td { padding: 8px; font-size: 13px; }
}

/* --- logo in header --- */
.brand img.logo{
  box-sizing:content-box;
  height:30px;
  width: auto;
  display: block;
  padding:3px 5px;
  border-radius:10px;
  background:#173b20;
  box-shadow:0 5px 14px rgba(25,62,31,.16);
}
.brand .brand-name{ margin-left: 8px; }

/* small screen tweak */
@media (max-width: 720px){ .brand img.logo{ height:27px; padding:2px 4px; } }

/* optional: login card logo */
.logo-hero{
  display:block; height:40px; width:auto; margin: 4px 0 6px 0;
}
@media (max-width: 720px){ .logo-hero{ height:34px; } }

/* --- pagination --- */
.pagination{
  display:flex; align-items:center; justify-content:flex-end;
  gap:10px; margin-top:10px;
}
.page-link{
  display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:8px 12px; border-radius:10px;
  border:1px solid var(--line-strong);
  text-decoration:none; font-weight:600; letter-spacing:.2px;
  color:var(--primary-text);
  background:var(--surface);
}
.page-link:hover{ border-color:var(--primary-text); background:var(--primary-soft); box-shadow:0 4px 14px rgba(41,91,46,.12); }
.page-info{ color: var(--muted); font-size: 13px; }

.detail-controls{
  display:flex; align-items:center; justify-content:space-between;
  flex-wrap:wrap; gap:12px; margin: 12px 0 24px 0;
}
.tab-switcher{
  display:inline-flex; gap:6px;
  padding:4px; border-radius:999px;
  background:var(--surface-2);
  border:1px solid var(--line);
}
.tab-chip{
  display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:8px 18px; border-radius:999px;
  text-decoration:none; font-weight:600; letter-spacing:.3px;
  color: var(--muted);
  transition:color .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.tab-chip:hover{ color:var(--primary-text); }
.tab-chip.active{
  color:var(--primary-ink);
  background:var(--primary);
  box-shadow:0 7px 16px rgba(48,119,54,.18);
}
.range-chip{
  display:flex; flex-direction:column; align-items:flex-start;
  padding:8px 14px; border-radius:10px;
  border:1px solid var(--line);
  background:var(--surface);
  font-size:13px; line-height:1.2;
}
.range-chip strong{ font-size:15px; margin-top:4px; letter-spacing:.3px; }

.section-heading{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; flex-wrap:wrap;
}
.section-heading .muted{ font-size:13px; }

.summary-analytics{
  grid-template-columns:repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  align-items:stretch;
}
.summary-data{
  grid-template-columns:minmax(0, 1fr);
  align-items:start;
}
.summary-data > .span-2-lg{ grid-column:auto; }
.summary-analytics > .span-2-lg{ grid-column:auto; }
.summary-records-layout{ display:contents; }

.shared-alerts-card{
  margin: 16px 0 20px;
  position: relative;
  border:1px solid #edc58b;
  background:
    radial-gradient(600px 120px at 20% -20%, rgba(240,171,72,.18), transparent 60%),
    linear-gradient(180deg, var(--surface), var(--warning-soft));
}
.shared-alerts-table th:nth-child(2){ width: 46%; }
.shared-list{
  display:grid;
  gap:6px;
}
.shared-pill{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:10px;
  border:1px solid #e7d2b1;
  background:rgba(255,255,255,.72);
  font-size:12px;
}
.shared-login{
  color:var(--warning);
  font-weight:700;
  letter-spacing:.2px;
}
.shared-email{ color: var(--text); }
.shared-more{
  color: var(--muted);
  font-size:12px;
}
.table-scroll{
  overflow-x:auto;
  max-width:100%;
  touch-action:pan-x pan-y;
  overscroll-behavior-inline:contain;
  margin:0 -2px;
  padding:2px 2px 10px;
  scrollbar-color:#91ad93 #edf2ea;
}
.table-scroll > .table:not(.prop-table){ min-width:560px; }
.table-scroll > table.table.ip-table{ min-width:500px; }
.table-scroll > .shared-alerts-table{ min-width:760px; }
.table-scroll > table.table.detail-table{ min-width:860px; }
.table-scroll > .cid-table{ min-width:620px; }
.table-scroll > .activity-table{ min-width:760px; }
.table-scroll::-webkit-scrollbar{ height:10px; }
.table-scroll::-webkit-scrollbar-thumb{
  background:#91ad93;
  border-radius:999px;
}
.table.compact th, .table.compact td{ padding:10px; }
.text-right{ text-align:right; }
.footnote{ margin-top:12px; font-size:13px; }

.activity-card{ margin-top:16px; }

.country-stack{
  list-style:none; padding:0; margin:0; display:grid; gap:10px;
}
.country-stack li{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; font-size:14px;
}
.country-stack .name{ flex:1; color: var(--text); }
.country-stack .count{ color:var(--primary-text); font-weight:700; }

.country-chip{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:42px; padding:4px 10px; border-radius:999px;
  border:1px solid #9fc99f;
  background:var(--primary-soft);
  font-size:12px; letter-spacing:.6px; font-weight:700;
  color:var(--primary-text);
}

.detail-analytics{
  grid-template-columns:minmax(0, 1fr);
  align-items:flex-start;
  margin-top:16px;
}
.detail-analytics > .span-2-lg{ grid-column:auto; }
.globe-card{
  position:relative;
  overflow:hidden;
}
.globe-wrapper{
  position:relative;
  border-radius:16px;
  border:1px solid #c8ddc6;
  background:
    radial-gradient(circle at 20% 15%, rgba(106,204,111,.18), transparent 55%),
    radial-gradient(circle at 85% 85%, rgba(102,166,112,.13), transparent 70%),
    linear-gradient(160deg, #f5faf3 0%, #edf5ec 65%, #e6f0e5 100%);
  padding:12px;
  margin:16px 0;
  min-height:320px;
}
#login-map{
  width:100%;
  height:100%;
  display:block;
  filter:drop-shadow(0 8px 20px rgba(39,83,44,.12));
  touch-action:pan-y;
  user-select:none;
}
.map-controls{
  position:absolute;
  top:16px;
  right:16px;
  display:flex;
  flex-direction:column;
  gap:8px;
  z-index:2;
}
.map-control-btn{
  width:42px;
  height:42px;
  border-radius:12px;
  border:1px solid #9cb39e;
  background:rgba(255,255,255,.94);
  color:var(--text);
  font-size:18px;
  font-weight:700;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 8px 20px rgba(39,75,43,.13);
  transition:background 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}
.map-control-btn:hover,
.map-control-btn:focus-visible{
  background:var(--primary-soft);
  border-color:var(--primary-text);
  color:var(--primary-text);
}
.map-control-btn:active{
  transform:translateY(1px) scale(0.98);
  background:#dff1dd;
}
.map-control-btn[data-globe-zoom="reset"]{
  font-size:13px;
  letter-spacing:0.6px;
}
.map-tooltip{
  position:absolute;
  top:0; left:0;
  padding:6px 10px;
  border-radius:8px;
  background:rgba(24,49,28,.96);
  border:1px solid rgba(140,221,145,.5);
  color:#ffffff;
  font-size:12px;
  pointer-events:none;
  white-space:nowrap;
  box-shadow:0 12px 30px rgba(25,61,30,.28);
  transform: translate(-9999px, -9999px);
  transition: opacity .12s ease, transform .12s ease;
}
.map-tooltip strong{
  display:block;
  color:#a9e6ac;
  font-weight:700;
  margin-bottom:2px;
}
.map-tooltip span{
  color:#d7e5d8;
  font-size:12px;
}
.globe-meta{
  display:flex; justify-content:space-between; gap:24px; flex-wrap:wrap;
  font-size:13px;
}
.globe-meta .value{
  font-size:28px; font-weight:800; color:var(--primary-text);
}
.globe-top ul{
  margin:6px 0 0 0; padding:0; list-style:none; display:grid; gap:6px;
}
.globe-top li{
  display:flex; align-items:center; gap:10px;
  color: var(--text); font-size:13px;
}
.globe-top .count{ margin-left:auto; color:var(--primary-text); font-weight:700; }

.country-cell{
  display:flex; align-items:center; gap:8px; flex-wrap:wrap;
}
.country-cell .name{ color: var(--text); font-weight:600; }
.country-cell .city{ font-size:12px; }

.detail-table th{ white-space:nowrap; }
.detail-table td{ font-size:14px; }
.detail-table td .city{ color: var(--muted); }

#logins{ scroll-margin-top: 80px; }

html { scroll-behavior: smooth; }

/* Keep anchored cards comfortably below the top padding */
#ip, #cid { scroll-margin-top: 80px; }
@media (max-width: 720px){
  #ip, #cid { scroll-margin-top: 64px; }
  .detail-controls{ align-items:stretch; }
  .tab-switcher{ display:flex; width:100%; }
  .tab-chip{ flex:1; text-align:center; }
  .pagination{ justify-content:center; flex-wrap:wrap; }
  .summary-analytics{ grid-template-columns:minmax(0, 1fr); }
  .map-controls{
    top:auto;
    bottom:16px;
    right:12px;
    flex-direction:row;
    background:rgba(255,255,255,.9);
    padding:6px 10px;
    border-radius:999px;
    border:1px solid var(--line);
    box-shadow:0 10px 24px rgba(36,76,40,.14);
  }
  .map-control-btn{
    width:38px;
    height:38px;
    background:transparent;
    border:1px solid transparent;
    box-shadow:none;
  }
  .map-control-btn[data-globe-zoom="reset"]{
    padding:0 10px;
    width:auto;
  }
}
.map-status{
  margin:10px 0 0;
  padding:10px 12px;
  border:1px solid #e9a9a3;
  border-radius:10px;
  color:var(--danger);
  background:var(--danger-soft);
}

/* --- polished page patterns --- */
main{ min-width:0; }
.full-width{ width:100%; }
.flush-title{ margin:0; }
.dashboard-metrics{ margin-bottom:24px; }
.results-heading{ margin-bottom:12px; }
#orders, #export-panel{ scroll-margin-top:18px; }

.login-shell{
  display:grid;
  grid-template-columns:minmax(0, 1.65fr) minmax(280px, .85fr);
  gap:clamp(16px, 2.4vw, 28px);
  align-items:stretch;
  max-width:1120px;
  margin:clamp(18px, 5vh, 64px) auto;
}
.login-card{
  position:relative;
  overflow:hidden;
  padding:clamp(24px, 4vw, 48px) !important;
}
.login-card::after{
  content:"";
  position:absolute;
  width:220px;
  height:220px;
  right:-110px;
  top:-120px;
  border-radius:50%;
  background:rgba(106,204,111,.12);
  pointer-events:none;
}
.login-card .section-title{ font-size:clamp(1.8rem, 4vw, 2.6rem); margin:8px 0; }
.login-lead{ max-width:560px; margin:0 0 24px; font-size:1.05rem; }
.login-card .form-vertical{ max-width:620px; }
.login-help{
  display:flex;
  flex-direction:column;
  justify-content:center;
  background:linear-gradient(145deg, #eff9ed, #e4f4e3);
  border-color:#bfdbbc;
}
.help-icon{
  display:grid;
  place-items:center;
  width:42px;
  height:42px;
  border-radius:13px;
  color:var(--primary-ink);
  background:var(--primary);
  font-weight:850;
  box-shadow:0 8px 18px rgba(55,126,61,.16);
}
.trust-list{ list-style:none; display:grid; gap:10px; padding:0; margin:18px 0 0; }
.trust-list li{ position:relative; padding-left:28px; color:#405248; font-size:14px; }
.trust-list li::before{
  content:"✓";
  position:absolute;
  left:0;
  top:0;
  display:grid;
  place-items:center;
  width:20px;
  height:20px;
  border-radius:50%;
  color:var(--success);
  background:rgba(106,204,111,.2);
  font-size:12px;
  font-weight:900;
}
.password-control{ position:relative; }
.password-control input{ padding-right:72px; }
.password-toggle{
  position:absolute;
  inset:0 4px 0 auto;
  min-width:64px;
  border:0;
  border-radius:10px;
  color:var(--primary-text);
  background:transparent;
  font:inherit;
  font-size:13px;
  font-weight:750;
  cursor:pointer;
}
.password-toggle:hover{ background:var(--primary-soft); }
.password-toggle:focus-visible{ outline:3px solid var(--focus); outline-offset:1px; }

.form-error-summary{
  display:flex;
  flex-wrap:wrap;
  gap:6px 12px;
  margin:16px 0 0;
  padding:12px 14px;
  border:1px solid #e9a9a3;
  border-radius:12px;
  color:var(--danger);
  background:var(--danger-soft);
}
.filter-field .errorlist{ margin-top:5px; }
.filter-field:has(.errorlist) input,
.filter-field:has(.errorlist) select{ border-color:var(--danger); }
.advanced-filters{
  margin-top:16px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--surface-2);
}
.advanced-filters summary{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:48px;
  padding:10px 54px 10px 14px;
  color:#405248;
  font-weight:750;
  cursor:pointer;
}
.advanced-filters summary::marker{ color:var(--primary-text); }
.advanced-filters summary::after{
  content:"+";
  position:absolute;
  right:12px;
  top:50%;
  display:grid;
  place-items:center;
  width:30px;
  height:30px;
  border-radius:9px;
  color:var(--primary-ink);
  background:rgba(106,204,111,.28);
  transform:translateY(-50%);
  font-size:20px;
  line-height:1;
}
.advanced-filters[open] summary::after{ content:"−"; }
.advanced-filters summary:focus-visible{ outline:3px solid var(--focus); outline-offset:3px; }
.advanced-filters summary span{ color:var(--muted); font-size:13px; font-weight:500; }
.advanced-filters[open] summary{ border-bottom:1px solid var(--line); }
.advanced-filters-grid{ padding:14px; margin-top:0; }
.filter-actions{ align-items:center; }

.table-scroll-hint{
  display:none;
  margin:0 0 8px;
  color:var(--muted);
  font-size:12px;
}
.page-control{ min-height:44px; }
.sort-link{ min-height:44px; }

@media (min-width: 760px){
  .kpi-grid,
  .metric-grid{ grid-template-columns:repeat(3, minmax(0, 1fr)) !important; }
}
@media (min-width: 920px){
  .summary-analytics{ grid-template-columns:minmax(0, 2fr) minmax(260px, 1fr); }
}
@media (min-width: 1220px){
  .summary-data{ grid-template-columns:minmax(0, .9fr) minmax(0, 1.1fr); }
}
@media (min-width: 1800px){
  .container.insights-container{
    max-width:min(94vw, 3000px);
  }
  .container.container-wide{
    max-width:min(96vw, 3200px);
  }
  .summary-records-layout{
    display:grid;
    grid-template-columns:minmax(620px, .82fr) minmax(780px, 1.18fr);
    gap:clamp(18px, 1.5vw, 28px);
    align-items:start;
  }
  .summary-records-layout > *{ min-width:0; }
  .summary-records-layout .summary-data{
    grid-template-columns:minmax(0, 1fr);
  }
  .summary-records-layout .activity-card{
    margin-top:0;
  }
}

@media (hover:hover){
  .metric{ transition:border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
  .metric:hover{ border-color:#b5d6b2; box-shadow:var(--shadow-raised); transform:translateY(-2px); }
}
@keyframes surface-enter{
  from{ opacity:0; transform:translateY(8px); }
  to{ opacity:1; transform:translateY(0); }
}
main .card{ animation:surface-enter .34s ease-out both; }

@media (max-width: 720px){
  .login-shell{ grid-template-columns:minmax(0, 1fr); margin:10px auto 0; }
  .login-card{ padding:22px 18px !important; }
  .login-help{ padding:20px !important; }
  .advanced-filters summary{ align-items:flex-start; flex-direction:column; gap:2px; }
  .table-scroll-hint{ display:block; }
  .table-scroll{
    border-right:2px solid rgba(40,122,53,.24);
    border-radius:0 10px 10px 0;
  }
  .copy-btn{ min-height:44px; }
  .prop-table thead th:first-child{
    position:sticky;
    left:0;
    z-index:4;
    box-shadow:8px 0 14px rgba(35,75,39,.08);
  }
  .prop-table tbody td:first-child{
    position:sticky;
    left:0;
    z-index:1;
    background:var(--surface);
    box-shadow:8px 0 14px rgba(35,75,39,.08);
  }
  .prop-table tbody tr:nth-child(even) td:first-child{ background:#fbfdf9; }
}
@media (min-width: 721px) and (max-width: 900px){
  .table-scroll-hint{ display:block; }
}
@media (max-width: 420px){
  .globe-wrapper{ min-height:0; padding:10px; }
  .map-controls{
    position:static;
    justify-content:center;
    margin-top:8px;
    padding:6px;
    background:rgba(255,255,255,.9);
  }
  .map-control-btn{ width:44px; height:44px; }
  .map-control-btn[data-globe-zoom="reset"]{ min-width:74px; }
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  *, *::before, *::after{
    scroll-behavior:auto !important;
    transition-duration:.01ms !important;
    animation-duration:.01ms !important;
    animation-iteration-count:1 !important;
  }
}
