/* ============================================================
   LENS Confluence — Statewide API Data Connection Platform
   Design system (Clever-inspired shell, FocalPoint brand)
   ============================================================ */
:root {
  --brand:        #33455f;   /* neutral slate */
  --brand-dark:   #26354a;
  --brand-2:      #4a5d78;
  --topbar-a:     #ffffff;
  --topbar-b:     #ffffff;
  --ink:          #16213a;
  --ink-2:        #45516b;
  --muted:        #79839b;
  --line:         #e6e9f0;
  --line-2:       #eef1f6;
  --bg:           #ffffff;
  --surface:      #ffffff;
  --sidebar:      #ffffff;

  --green:        #12a150;  --green-bg: #e5f6ec;
  --amber:        #c77700;  --amber-bg: #fdf0d9;
  --red:          #d1382c;  --red-bg:   #fbe7e5;
  --purple:       #7c3aed;  --purple-bg:#efe7fd;
  --teal:         #0e9aa7;  --teal-bg:  #e2f5f6;

  /* assessment brand chips */
  --ilearn: #45516b;  --ilearn-bg:#eef1f6;
  --iread:  #45516b;  --iread-bg: #eef1f6;
  --iam:    #45516b;  --iam-bg:   #eef1f6;

  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(20,33,58,.06), 0 1px 3px rgba(20,33,58,.05);
  --shadow-md: 0 4px 16px rgba(20,33,58,.10);
  --sidebar-w: 232px;
  --topbar-h: 56px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", "Cascadia Code", "JetBrains Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h);
  background: #fff;
  color: var(--ink); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px;
  padding: 0 18px; z-index: 40; box-shadow: 0 1px 3px rgba(20,33,58,.06);
}
.topbar .brand-lockup { display: flex; align-items: center; gap: 10px; }
.topbar .logo-mark {
  width: 30px; height: 30px; border-radius: 8px; background: #fff;
  display: grid; place-items: center; color: var(--brand); font-weight: 800;
  font-size: 15px; letter-spacing: -.5px;
}
.topbar .logo-word { font-weight: 800; font-size: 18px; letter-spacing: -.3px; }
.topbar .logo-word span { font-weight: 400; opacity: .85; }
.topbar .org {
  display: flex; align-items: center; gap: 7px; padding-left: 14px; margin-left: 4px;
  border-left: 1px solid var(--line); font-weight: 600; font-size: 14px; color: var(--ink-2);
}
.topbar .org .flag { font-size: 15px; }
.topbar .spacer { flex: 1; }
.topbar .search {
  background: #f4f6fb; border: 1px solid var(--line);
  border-radius: 8px; height: 34px; width: 300px; display: flex; align-items: center;
  padding: 0 12px; gap: 8px; color: var(--ink-2);
}
.topbar .search input {
  background: transparent; border: none; outline: none; color: var(--ink);
  font-size: 13px; width: 100%;
}
.topbar .search input::placeholder { color: var(--muted); }
.topbar .tb-icon {
  width: 32px; height: 32px; border-radius: 50%; background: #f0f2f7; color: var(--ink-2);
  display: grid; place-items: center; cursor: pointer; font-size: 15px;
}
.topbar .user { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; cursor: pointer; }
.topbar .user .avatar {
  width: 28px; height: 28px; border-radius: 50%; background: #eef1f6; color: var(--ink-2);
  display: grid; place-items: center; font-weight: 700; font-size: 12px;
}
.env-pill {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  background: #eef1f6; border: 1px solid var(--line); color: var(--ink-2);
  padding: 2px 8px; border-radius: 20px;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; top: var(--topbar-h); bottom: 0; left: 0; width: var(--sidebar-w);
  background: var(--sidebar); border-right: 1px solid var(--line);
  overflow-y: auto; padding: 10px 0 40px; z-index: 30;
}
.nav-section-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted); padding: 16px 20px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 18px; margin: 1px 8px;
  border-radius: 8px; color: var(--ink-2); font-weight: 600; font-size: 13.5px;
  cursor: pointer; position: relative; user-select: none;
}
.nav-item .ico { width: 20px; text-align: center; font-size: 15px; opacity: .9; }
.nav-item .badge-count {
  margin-left: auto; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px; display: grid; place-items: center;
}
.nav-item .tag-new {
  margin-left: auto; background: var(--purple-bg); color: var(--purple);
  font-size: 9.5px; font-weight: 800; padding: 2px 6px; border-radius: 10px; text-transform: uppercase;
}
.nav-item:hover { background: #f2f5fc; color: var(--ink); }
.nav-item.active { background: #eef1f6; color: var(--brand); }
.nav-item.active::before {
  content: ""; position: absolute; left: -8px; top: 6px; bottom: 6px; width: 3px;
  background: var(--brand); border-radius: 3px;
}
.nav-divider { height: 1px; background: var(--line-2); margin: 8px 16px; }

/* ---------- Layout ---------- */
.main {
  margin-left: var(--sidebar-w); margin-top: var(--topbar-h);
  padding: 26px 34px 60px; max-width: 1360px;
}
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.page-head .titles { flex: 1; }
.page-title { font-size: 26px; font-weight: 800; letter-spacing: -.5px; margin: 0 0 3px; }
.page-sub { color: var(--muted); font-size: 13.5px; margin: 0; }
.page-head .actions { display: flex; gap: 10px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 16px;
  border-radius: 8px; font-weight: 700; font-size: 13px; cursor: pointer; border: 1px solid transparent;
  background: var(--brand); color: #fff; white-space: nowrap;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn.ghost { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn.ghost:hover { background: #f6f8fc; color: var(--ink); }
.btn.sm { height: 30px; padding: 0 12px; font-size: 12px; }
.btn.danger { background: var(--red); }
.btn.danger:hover { background: #b02a20; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card.pad { padding: 20px 22px; }
.card-head {
  display: flex; align-items: center; gap: 10px; padding: 15px 20px; border-bottom: 1px solid var(--line-2);
}
.card-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.card-head .sub { color: var(--muted); font-size: 12px; }
.card-head .spacer { flex: 1; }
.card-body { padding: 18px 20px; }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px){ .g-4{grid-template-columns:repeat(2,1fr)} .g-3{grid-template-columns:repeat(2,1fr)} }

/* ---------- Stat tiles ---------- */
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); position: relative;
}
.stat .k { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.stat .k .dot { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font-size: 14px; }
.stat .v { font-size: 30px; font-weight: 800; letter-spacing: -1px; margin-top: 8px; color: var(--ink); }
.stat .d { font-size: 12px; margin-top: 3px; font-weight: 600; }
.stat .d.up { color: var(--green); }
.stat .d.down { color: var(--red); }
.stat .d.flat { color: var(--muted); }

/* ---------- Badges / pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700;
  padding: 3px 9px; border-radius: 20px; line-height: 1.4; white-space: nowrap;
}
.badge .bdot { width: 6px; height: 6px; border-radius: 50%; }
.b-green  { background: var(--green-bg);  color: var(--green); }
.b-amber  { background: var(--amber-bg);  color: var(--amber); }
.b-red    { background: var(--red-bg);    color: var(--red); }
.b-purple { background: var(--purple-bg); color: var(--purple); }
.b-teal   { background: var(--teal-bg);   color: var(--teal); }
.b-gray   { background: #eef1f6; color: var(--ink-2); }
.b-blue   { background: var(--ilearn-bg); color: var(--ilearn); }
.chip-ilearn { background: var(--ilearn-bg); color: var(--ilearn); }
.chip-iread  { background: var(--iread-bg);  color: var(--iread); }
.chip-iam    { background: var(--iam-bg);    color: var(--iam); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data thead th {
  text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data tbody td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.data tbody tr:hover { background: #f8faff; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .linkish { color: var(--brand); font-weight: 600; cursor: pointer; }
.cell-strong { font-weight: 700; color: var(--ink); }
.cell-sub { color: var(--muted); font-size: 12px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tab {
  padding: 10px 14px; font-weight: 700; font-size: 13.5px; color: var(--ink-2); cursor: pointer;
  border-bottom: 2.5px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
/* Data Browser domain-grouped tab bar */
.db-tabbar { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; border-bottom: 1px solid var(--line); margin-bottom: 0; }
.db-tabgroup { display: flex; flex-direction: column; gap: 4px; }
.db-tabgroup.db-results { padding-left: 14px; border-left: 1px dashed var(--line); }
.db-grouplabel { font-size: 10.5px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 6px; padding-left: 4px; }
.db-domainbar { display: flex; align-items: center; gap: 10px; padding: 10px 2px 0; margin-bottom: 16px; }
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; }
.subtab {
  padding: 6px 12px; font-weight: 600; font-size: 12.5px; color: var(--ink-2); cursor: pointer;
  border: 1px solid var(--line); border-radius: 20px; background: #fff;
}
.subtab.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- Filters bar ---------- */
.filters {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.field select, .field input {
  height: 34px; border: 1px solid var(--line); border-radius: 7px; padding: 0 10px; font-size: 13px;
  background: #fff; color: var(--ink); min-width: 150px; font-family: var(--font);
}
.field.grow { flex: 1; min-width: 200px; }
.field.grow input { min-width: 100%; }

/* ---------- Alert banner ---------- */
.banner {
  display: flex; align-items: center; gap: 14px; background: var(--amber-bg);
  border: 1px solid #f3dca6; border-radius: var(--radius); padding: 16px 18px; margin-bottom: 20px;
}
.banner .ico { font-size: 20px; }
.banner .txt { flex: 1; }
.banner .txt b { display: block; font-size: 14px; margin-bottom: 2px; }
.banner .txt span { color: var(--ink-2); font-size: 13px; }
.banner.blue { background: var(--ilearn-bg); border-color: #c8d6fb; }

/* ---------- Misc ---------- */
.kv { display: flex; flex-direction: column; gap: 2px; }
.kv .k { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; }
.kv .v { font-size: 14px; font-weight: 600; }
.hstack { display: flex; align-items: center; gap: 10px; }
.vstack { display: flex; flex-direction: column; gap: 10px; }
.pill-toggle { display: inline-flex; background: #eef1f6; border-radius: 20px; padding: 3px; gap: 2px; }
.pill-toggle button {
  border: none; background: transparent; padding: 5px 12px; border-radius: 20px; font-weight: 700;
  font-size: 12px; cursor: pointer; color: var(--ink-2);
}
.pill-toggle button.active { background: #fff; color: var(--brand); box-shadow: var(--shadow); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; }
.legend .li { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 600; }
.legend .sw { width: 11px; height: 11px; border-radius: 3px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.code {
  background: #0f172a; color: #e2e8f0; border-radius: var(--radius); padding: 16px 18px; overflow-x: auto;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6; white-space: pre; tab-size: 2;
}
.code .k { color: #7dd3fc; } .code .s { color: #86efac; } .code .n { color: #fca5a5; } .code .c { color: #64748b; }
.vendor-logo {
  width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center;
  font-weight: 800; font-size: 15px; color: #fff; flex-shrink: 0;
}
.avatar-sq { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color:#fff; }
.progress { height: 7px; background: #eef1f6; border-radius: 6px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--brand); border-radius: 6px; }
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; }
.dl dt { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.dl dd { margin: 0; font-weight: 600; }
.meter-row { display: flex; align-items: center; gap: 10px; margin: 9px 0; }
.meter-row .lbl { width: 190px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.meter-row .bar { flex: 1; }
.meter-row .val { width: 54px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.timeline { position: relative; padding-left: 22px; }
.timeline .ev { position: relative; padding: 0 0 18px 14px; border-left: 2px solid var(--line); }
.timeline .ev:last-child { border-left-color: transparent; }
.timeline .ev .node { position: absolute; left: -7px; top: 2px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; }
.timeline .ev .t { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.timeline .ev .m { font-size: 13px; margin-top: 1px; }

/* ---------- Modal ---------- */
.modal-scrim {
  position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 60;
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.modal-scrim.open { display: flex; }
.modal {
  background: #fff; border-radius: 14px; width: 640px; max-width: 100%; max-height: 90vh;
  overflow-y: auto; box-shadow: var(--shadow-md);
}
.modal-head { padding: 20px 24px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; }
.modal-head h3 { margin: 0; font-size: 18px; font-weight: 800; }
.modal-head .x { margin-left: auto; cursor: pointer; font-size: 22px; color: var(--muted); line-height: 1; }
.modal-body { padding: 22px 24px; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--line-2); display: flex; gap: 10px; justify-content: flex-end; }
.wizard-steps { display: flex; gap: 8px; margin-bottom: 20px; }
.wizard-steps .ws { flex: 1; text-align: center; font-size: 11.5px; font-weight: 700; color: var(--muted); padding-bottom: 8px; border-bottom: 3px solid var(--line); }
.wizard-steps .ws.active { color: var(--brand); border-bottom-color: var(--brand); }
.wizard-steps .ws.done { color: var(--green); border-bottom-color: var(--green); }
.check-list { display: flex; flex-direction: column; gap: 8px; }
.check-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.check-item:hover { background: #f8faff; }
.check-item input { width: 16px; height: 16px; }
.scope-tag { display:inline-flex; align-items:center; gap:5px; background:#eef1f6; border-radius:6px; padding:3px 8px; font-size:12px; font-weight:600; margin:2px; }

/* footer note */
.foot-note { color: var(--muted); font-size: 12px; margin-top: 26px; text-align: center; }
.section-gap { height: 22px; }
.split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
@media (max-width: 1000px){ .split{grid-template-columns:1fr} }
