/* ── 3xDNA — EnsuranceDNA look and feel (navy #1a1f6b · gold #b88e42 · emerald DNA) ── */
:root {
  --navy: #1a1f6b; --navy-700: #141857; --navy-800: #0f1244; --navy-500: #3a4596;
  --navy-50: #eef0fa; --navy-100: #dde1f4;
  --gold: #b88e42; --gold-50: #fbf6ec; --gold-100: #f5ead3; --gold-soft: #d4b475;
  --dna: #6ee7b7; --dna-dark: #059669;
  --crumb: #d6e2f3;
  --bg: #f8fafc; --panel: #ffffff; --ink: #0f172a; --ink-2: #334155; --ink-soft: #64748b;
  --line: #e2e8f0; --line-2: #cbd5e1;
  --ok: #047857; --err: #b91c1c;
  --font: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Cascadia Code', Consolas, monospace;
  --side-w: 228px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14.5px; }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }

/* ── Ribbon ── */
.ribbon { height: 56px; background: var(--navy); display: flex; align-items: center; gap: 22px;
  padding: 0 20px; position: sticky; top: 0; z-index: 50; }
.rb-brand { display: flex; align-items: center; gap: 10px; text-decoration: none !important; }
.rb-mark { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(145deg,#2a3290,#12154a);
  border: 1px solid #3a4596; color: var(--dna); font-weight: 800; font-size: 14px;
  display: flex; align-items: center; justify-content: center; }
.rb-word { font-size: 19px; font-weight: 800; letter-spacing: -.2px; }
.rb-apps { display: flex; gap: 4px; }
.rb-apps a { color: #fff; font-weight: 600; font-size: 14px; padding: 7px 12px; border-radius: 8px;
  display: flex; align-items: center; gap: 7px; text-decoration: none; }
.rb-apps a i { color: #c7cdee; }
.rb-apps a:hover { background: rgba(255,255,255,.08); }
.rb-apps a.on { background: rgba(255,255,255,.12); outline: 1px solid rgba(255,255,255,.18); }
.rb-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.rb-env { background: #dc2626; color: #fff; font-size: 12px; font-weight: 700; padding: 4px 10px;
  border-radius: 7px; display: flex; align-items: center; gap: 6px; }
.rb-env i { font-size: 7px; }
.rb-link { color: #fff; font-weight: 600; font-size: 14px; background: none; border: none; cursor: pointer;
  display: flex; align-items: center; gap: 5px; text-decoration: none !important; }
.rb-link i { color: #c7cdee; }
.rb-ask { background: var(--gold); color: #fff; font-weight: 600; font-size: 13px; padding: 5px 12px;
  border-radius: 999px; display: flex; gap: 6px; align-items: center; text-decoration: none !important; }
.rb-ask:hover { background: #9c7632; }
.rb-user { position: relative; }
.rb-menu { display: none; position: absolute; right: 0; top: 34px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 12px 30px rgba(15,18,68,.18); min-width: 180px; padding: 6px; z-index: 60; }
.rb-user.open .rb-menu { display: block; }
.rb-menu a { display: flex; gap: 8px; padding: 8px 10px; border-radius: 7px; color: var(--ink-2); font-size: 13.5px; }
.rb-menu a:hover { background: var(--navy-50); text-decoration: none; }

/* ── Breadcrumb bar ── */
.crumbbar { background: var(--crumb); height: 42px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; border-bottom: 1px solid #c6d4ea; position: sticky; top: 56px; z-index: 40; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--navy); }
.crumbs .sep { font-size: 9px; color: #7486a8; }
.crumbs .dim { color: #51607f; }
.crumbs strong { color: var(--ink); font-weight: 600; }
.crumb-search { position: relative; display: flex; align-items: center; }
.crumb-search i { position: absolute; left: 10px; color: #7486a8; font-size: 12px; }
.crumb-search input { width: 250px; padding: 5px 10px 5px 28px; border: 1px solid #b8c7df; border-radius: 7px;
  font-size: 13px; background: #fff; font-family: inherit; }
.ms-results { display: none; position: absolute; top: 34px; right: 0; width: 320px; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(15,18,68,.18);
  max-height: 360px; overflow: auto; padding: 6px; }
.ms-results.on { display: block; }
.ms-results a { display: flex; justify-content: space-between; padding: 7px 10px; border-radius: 7px;
  font-size: 13.5px; color: var(--ink-2); }
.ms-results a small { color: var(--ink-soft); }
.ms-results a.sel, .ms-results a:hover { background: var(--navy-50); text-decoration: none; }

/* ── Favorites bar ── */
.favbar { height: 38px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center;
  gap: 8px; padding: 0 22px; font-size: 13px; }
.fav-lbl { color: #92400e; font-weight: 600; display: flex; gap: 5px; align-items: center; }
.fav-lbl i { color: #b45309; }
.fav-chip { border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; color: var(--ink-2);
  background: #fff; margin-right: 4px; }
.fav-chip:hover { border-color: var(--navy); text-decoration: none; }
.fav-empty { color: var(--ink-soft); font-size: 12.5px; }

/* ── Shell + sidebar ── */
.shell { display: flex; min-height: calc(100vh - 136px); }
.side { width: var(--side-w); flex-shrink: 0; background: var(--navy); color: #fff; display: flex; flex-direction: column;
  position: sticky; top: 98px; height: calc(100vh - 98px); overflow-y: auto; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 14px 12px 16px; }
.side-word { font-size: 17px; font-weight: 800; }
.side-toggle { width: 26px; height: 26px; border-radius: 50%; border: 1px solid #3a4596; background: var(--navy-700);
  color: #fff; cursor: pointer; font-size: 11px; }
.side-find { padding: 0 12px 10px; }
.side-find input { width: 100%; padding: 8px 11px; border-radius: 7px; border: 1px solid #3a4596;
  background: var(--navy-700); color: #fff; font-size: 13px; font-family: inherit; }
.side-find input::placeholder { color: #9aa3d6; }
.side-gh { width: 100%; background: none; border: none; color: #aab2e2; font-size: 11.5px; font-weight: 700;
  letter-spacing: .8px; display: flex; justify-content: space-between; padding: 12px 16px 6px; cursor: pointer; }
.side-group.closed .side-items { display: none; }
.side-group.closed .side-gh i { transform: rotate(-90deg); }
.side-item { display: flex; align-items: center; }
.side-item a { flex: 1; display: flex; align-items: center; gap: 11px; padding: 8px 8px 8px 18px; color: #e3e6f7;
  font-size: 13.5px; font-weight: 500; text-decoration: none !important; }
.side-item a i, .side-item a .emo { width: 16px; color: #aab2e2; text-align: center; }
.side-item:hover { background: var(--navy-700); }
.side-item.on { background: var(--navy-800); box-shadow: inset 3px 0 0 var(--gold); }
.side-item.on a { color: #fff; font-weight: 600; }
.side-item .star { background: none; border: none; color: #7c86c4; cursor: pointer; padding: 0 12px; font-size: 12px; }
.side-item .star.on { color: var(--gold-soft); }
.side-item.hidden-by-find { display: none; }
.side-foot { margin-top: auto; padding: 12px 16px; font-size: 11px; color: #8f98d0; border-top: 1px solid #262c80; }
.side-reopen { display: none; position: fixed; left: 0; top: 110px; z-index: 30; width: 22px; height: 40px;
  background: var(--navy); color: #fff; border: none; border-radius: 0 8px 8px 0; cursor: pointer; }
html.side-closed .side { display: none; }
html.side-closed .side-reopen { display: block; }

/* ── Main + page head ── */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; padding: 22px 30px 6px; }
.kicker { font-size: 11.5px; font-weight: 700; letter-spacing: .8px; color: #7c3aed; text-transform: uppercase; margin-bottom: 4px; }
.page-head h1 { font-size: 23px; font-weight: 700; color: var(--ink); letter-spacing: -.3px; }
.page-desc { color: var(--ink-2); font-size: 14px; margin-top: 5px; max-width: 900px; }
.page-actions { display: flex; gap: 8px; }
.content { padding: 14px 30px 26px; flex: 1; }
.foot { padding: 12px 30px; color: var(--ink-soft); font-size: 12px; border-top: 1px solid var(--line); }

/* ── Panels / cards ── */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 20px; overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 15.5px; font-weight: 700; color: var(--ink); }
.form-narrow { max-width: 680px; }
.panel form { padding: 4px 18px 16px; }
.panel > form { padding-top: 14px; }

.stat-row { display: flex; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.stat { flex: 1; min-width: 150px; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; text-decoration: none !important; }
a.stat:hover { border-color: var(--navy); }
.stat-lbl { order: -1; font-size: 11px; font-weight: 700; letter-spacing: .5px; color: var(--ink-soft); text-transform: uppercase; }
.stat-num { font-size: 20px; font-weight: 700; color: var(--navy); }

/* ── Tables ── */
.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.grid th { text-align: left; padding: 11px 14px; background: #f8fafc; color: var(--ink-soft); font-weight: 700;
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid th a { color: var(--ink-soft); }
.grid td { padding: 10px 14px; border-bottom: 1px solid #eef2f7; vertical-align: middle; color: var(--ink-2); }
.grid tbody tr:hover { background: #f8fafc; }
.grid .num { text-align: right; font-variant-numeric: tabular-nums; }
.grid .act-col { width: 1%; white-space: nowrap; text-align: right; }
.grid td strong { color: var(--ink); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.empty { color: var(--ink-soft); text-align: center; padding: 28px !important; }
.grid-edit td.editable { cursor: text; }
.grid-edit td.editable:hover { box-shadow: inset 0 0 0 1px var(--gold); border-radius: 4px; }
.grid-edit td.editing { box-shadow: inset 0 0 0 2px var(--gold); background: #fffdf5; }
.grid-edit td.pk-cell { font-weight: 700; color: var(--navy); }
.cell-saved { animation: savedflash 1s; }
@keyframes savedflash { 0% { background: #d1fae5; } 100% { background: transparent; } }
.listbar-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 18px; }

/* ── Buttons / forms ── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px;
  border: 1px solid var(--line-2); background: #fff; color: var(--navy); font-size: 13.5px; font-weight: 600;
  cursor: pointer; text-decoration: none !important; }
.btn:hover { border-color: var(--navy); }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-700); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn-danger { color: var(--err); }
.btn-danger:hover { border-color: var(--err); }
.btn-sm { padding: 4px 10px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; }
.btn-row { display: flex; gap: 10px; margin: 14px 0 4px; flex-wrap: wrap; }
.btn[disabled] { opacity: .4; cursor: default; }

.fld { display: flex; flex-direction: column; gap: 5px; margin: 10px 0; }
.fld > span { font-size: 11.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--ink-soft); }
.fld input, .fld select, .fld textarea, .inline-form input, .inline-form select, select {
  padding: 8px 11px; border: 1px solid var(--line-2); border-radius: 8px; font-family: var(--font);
  font-size: 13.5px; background: #fff; color: var(--ink); }
.fld input:focus, .fld select:focus, .fld textarea:focus, .inline-form input:focus {
  outline: 2px solid var(--navy-100); border-color: var(--navy-500); }
.fld input.ro { background: #f1f5f9; color: var(--ink-soft); }
.fld-row { display: flex; gap: 16px; }
.fld-row .fld { flex: 1; }
.req { color: var(--err); }
.muted { color: var(--ink-soft); font-size: 13px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.src-editor { width: 100%; font-family: var(--mono); font-size: 13px; line-height: 1.5; background: #0f1244;
  color: #d5e0ff; border: none; border-radius: 10px; padding: 14px; white-space: pre; overflow-x: auto; }

/* ── Chips / tags / flash ── */
.lib-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { padding: 5px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line-2);
  font-size: 12.5px; color: var(--ink-2); text-decoration: none !important; }
.chip small { color: var(--ink-soft); margin-left: 4px; }
.chip:hover { border-color: var(--navy); }
.chip-on { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip-on small { color: var(--gold-soft); }
.tag { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 11.5px; font-weight: 600;
  background: var(--navy-50); color: var(--navy); }
.tag-ok { background: #d1fae5; color: var(--ok); }
.tag-off { background: #fee2e2; color: var(--err); }
.flash { padding: 11px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; border: 1px solid; }
.flash-success { background: #ecfdf5; color: var(--ok); border-color: #a7f3d0; }
.flash-error { background: #fef2f2; color: var(--err); border-color: #fecaca; }
.flash-info { background: #eef0fa; color: var(--navy); border-color: var(--navy-100); }

/* ── Pager ── */
.pager-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 18px; flex-wrap: wrap; }
.pager { display: flex; gap: 5px; flex-wrap: wrap; }
.pg { padding: 4px 10px; border: 1px solid var(--line-2); border-radius: 7px; font-size: 12.5px; }
.pg-on { background: var(--navy); color: #fff; border-color: var(--navy); }
.sel-col { width: 1%; }
sup { font-size: 9px; }

/* ── Help panel (floating, like EnsuranceDNA) ── */
.help-panel { display: none; position: fixed; right: 22px; top: 108px; width: 400px; max-height: calc(100vh - 130px);
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 50px rgba(15,18,68,.25);
  z-index: 70; flex-direction: column; }
.help-panel.on { display: flex; }
.hp-head { background: var(--navy); color: #fff; padding: 11px 14px; border-radius: 12px 12px 0 0;
  display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 14px; }
.hp-head button { background: none; border: none; color: #fff; cursor: pointer; }
.hp-body { padding: 14px 16px; overflow-y: auto; font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
.hp-body ol { margin: 10px 0 0 18px; display: flex; flex-direction: column; gap: 6px; }
.hp-foot { padding: 12px 14px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hp-link { font-size: 12.5px; color: var(--ink-soft); margin-left: auto; }

/* ── Busy overlay ── */
#x3busy { position: fixed; inset: 0; z-index: 9999; display: none; align-items: center; justify-content: center;
  flex-direction: column; gap: 16px; background: rgba(15,18,68,.78); backdrop-filter: blur(2px); }
#x3busy.on { display: flex; }
#x3busy .busy-msg { color: #fff; font-size: 17px; font-weight: 600; }
#x3busy .busy-sub { color: var(--gold-soft); font-size: 13px; }
#x3busy .busy-spin { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--gold-soft);
  border-top-color: transparent; animation: x3spin .9s linear infinite; }
@keyframes x3spin { to { transform: rotate(360deg); } }

/* ── 3xDNA main menu (dashboard) ── */
.sysmenu { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.sysmenu .panel { margin: 0; }
.mopt { display: flex; align-items: center; gap: 12px; padding: 9px 16px; color: var(--ink-2);
  border-bottom: 1px solid #f1f5f9; text-decoration: none !important; }
.mopt:last-child { border-bottom: none; }
.mopt:hover { background: var(--navy-50); }
.mopt .num { width: 30px; height: 26px; border-radius: 6px; background: var(--navy); color: var(--gold-soft);
  font-weight: 700; font-size: 12.5px; display: flex; align-items: center; justify-content: center; font-family: var(--mono); }
.mopt .txt { flex: 1; }
.mopt .txt b { color: var(--ink); font-weight: 600; display: block; font-size: 13.5px; }
.mopt .txt small { color: var(--ink-soft); font-size: 12px; }
.mopt .badge { font-size: 11.5px; color: var(--navy); background: var(--navy-50); border-radius: 999px; padding: 2px 9px; font-weight: 600; }
.cmdline { display: flex; align-items: center; gap: 10px; background: #0f1244; border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; }
.cmdline label { color: var(--gold-soft); font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.cmdline input { flex: 1; background: transparent; border: none; border-bottom: 1px solid #3a4596; color: #fff;
  font-family: var(--mono); font-size: 15px; padding: 4px 2px; outline: none; }
.cmdline small { color: #9aa3d6; font-size: 12px; }

/* ── Login ── */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: linear-gradient(135deg, var(--navy-800), var(--navy) 60%, var(--navy-500)); }
.login-card { background: #fff; border-radius: 14px; padding: 34px 38px; width: 380px; box-shadow: 0 18px 60px rgba(10,12,40,.45); }
.login-card .brand { display: flex; align-items: center; gap: 12px; }
.login-card .brand-mark { width: 44px; height: 44px; border-radius: 10px; background: var(--navy); color: var(--dna);
  font-weight: 800; font-size: 18px; display: flex; align-items: center; justify-content: center; }
.login-card .brand-name { font-size: 22px; font-weight: 800; }
.login-card .brand-tag { font-size: 12px; color: var(--gold); display: block; }
.login-foot { margin-top: 18px; text-align: center; color: var(--ink-soft); font-size: 12px; }

@media (max-width: 900px) {
  .rb-apps { display: none; }
  .side { display: none; }
  .fld-row { flex-direction: column; gap: 0; }
  .crumb-search input { width: 150px; }
}
@media print {
  .ribbon, .crumbbar, .favbar, .side, .side-reopen, .foot, .help-panel { display: none !important; }
}

/* ── Filter bar (always visible, EnsuranceDNA style) ── */
.filterbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 14px 18px !important;
  border-bottom: 1px solid var(--line); background: #fff; }
.fb-fld { display: flex; flex-direction: column; gap: 4px; min-width: 150px; }
.fb-fld > span { font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--ink-soft); }
.fb-search { flex: 1; min-width: 240px; }
.fb-fld input, .fb-fld select { padding: 8px 11px; border: 1px solid var(--line-2); border-radius: 8px; font-family: var(--font); font-size: 13.5px; }
.fb-btns { display: flex; gap: 8px; }
.advs { display: none; padding: 12px 18px; border-bottom: 1px solid var(--line); background: #f8fafc; }
.advs.open { display: block; }
.adv-row { display: flex; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.bulkbar { display: none; padding: 8px 18px; background: var(--gold-50); border-bottom: 1px solid var(--line); align-items: center; gap: 12px; }
.bulkbar.on { display: flex; }
.chip-x { border: none; background: none; color: var(--err); cursor: pointer; font-size: 13px; }
.sort-hint { color: #cbd5e1; font-size: 10px; }

/* Help panel — every topic, searchable */
.hp-all { border-top:1px solid var(--line); padding:8px 16px; }
.hp-all summary { cursor:pointer; font-weight:650; color:var(--navy); padding:4px 0; }
.hp-all-find { width:100%; margin:6px 0; padding:6px 9px; border:1px solid var(--line); border-radius:7px; font:inherit; font-size:13px; }
.hp-all ul { list-style:none; margin:0; padding:0; max-height:260px; overflow:auto; }
.hp-all li { padding:5px 0; border-bottom:1px solid #f1f3f8; display:flex; flex-direction:column; }
.hp-all li a { font-weight:600; font-size:13px; }
.hp-all li span { font-size:11.5px; color:var(--ink-soft); }
/* Help page contents */
.help-toc { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:8px; padding:14px 18px; }
.help-toc a { display:block; padding:9px 12px; border:1px solid var(--line); border-radius:8px; background:#fff; }
.help-toc a:hover { border-color:var(--navy); text-decoration:none; }
.help-toc b { display:block; color:var(--navy-deep); font-size:13.5px; }
.help-toc span { font-size:11.5px; color:var(--ink-soft); }
/* Status chips for the job queue */
.st-ACTIVE { background:#d1fae5 !important; color:#047857 !important; }
.st-SCHEDULED { background:#e0e7ff !important; color:#3730a3 !important; }
.st-HOLD { background:#fef3c7 !important; color:#92400e !important; }
.st-WAITING { background:#eef0fa !important; color:var(--navy) !important; }
.st-ERROR { background:#fee2e2 !important; color:#b91c1c !important; }

/* ── Header record + related-record subfiles (standard architecture) ── */
.sfl-panel { margin-top: 16px; }
.sfl-tabs { display:flex; flex-wrap:wrap; gap:4px; padding:10px 18px 0; border-bottom:1px solid var(--line); background:#f8f9fc; }
.sfl-tab { border:1px solid transparent; border-bottom:none; background:none; padding:8px 14px; border-radius:8px 8px 0 0;
  font:600 13.5px var(--font); color:var(--ink-soft); cursor:pointer; margin-bottom:-1px; }
.sfl-tab:hover { color:var(--navy); }
.sfl-tab.on { background:#fff; border-color:var(--line); color:var(--navy); }
.sfl-n { display:inline-block; min-width:20px; padding:1px 7px; margin-left:4px; border-radius:999px; background:var(--navy-50, #eef0fa); color:var(--navy); font-size:11.5px; }
.sfl-tab.on .sfl-n { background:var(--navy); color:#fff; }
.sfl-frame { display:block; width:100%; height:420px; border:0; }
body.embed { background:#fff; }
.embed-content { padding:0 !important; max-width:none !important; }
.embed-content > .panel { border:0; box-shadow:none; margin:0; border-radius:0; }

/* Wide tables: scroll inside the panel, never push the page wider than the window */
.grid-scroll { width:100%; max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }
.content, .panel { min-width:0; max-width:100%; }
.filterbar { flex-wrap:wrap; }

/* Columns menu: tables fit the window */
.cols-bar { position:relative; display:flex; justify-content:flex-end; padding:6px 14px 0; }
.cols-btn .cols-n { background:var(--gold); color:#fff; border-radius:999px; padding:0 7px; font-size:11px; margin-left:4px; }
.cols-menu { position:absolute; right:14px; top:38px; z-index:40; background:#fff; border:1px solid var(--line); border-radius:10px;
  box-shadow:0 12px 30px rgba(15,18,68,.18); padding:8px 12px; max-height:360px; overflow:auto; min-width:220px; display:flex; flex-direction:column; gap:4px; }
.cols-menu label { font-size:13px; display:flex; gap:8px; align-items:center; white-space:nowrap; cursor:pointer; }
.cols-menu .btn { margin-top:6px; }
.grid-scroll { scrollbar-width:thin; }

/* DNA at work — live ticket view */
.dna-live { border-left:4px solid var(--gold); }
.dna-pulse { display:inline-block; width:10px; height:10px; border-radius:50%; background:#22c55e; margin-right:6px; vertical-align:middle;
  box-shadow:0 0 0 0 rgba(34,197,94,.6); animation:dnaPulse 1.4s infinite; }
@keyframes dnaPulse { 0% { box-shadow:0 0 0 0 rgba(34,197,94,.6); } 70% { box-shadow:0 0 0 9px rgba(34,197,94,0); } 100% { box-shadow:0 0 0 0 rgba(34,197,94,0); } }
.dl-phase { font-weight:700; color:var(--navy-deep); margin-bottom:8px; }
.dl-label { font-size:11px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; color:var(--gold); margin:10px 0 4px; }
.dl-think { white-space:pre-wrap; max-height:160px; overflow:auto; font-size:12px; color:var(--ink-soft); background:#f8f9fc; border-radius:8px; padding:8px 10px; margin:6px 0 0; }
.dl-text { white-space:pre-wrap; min-height:120px; max-height:520px; overflow:auto; font-size:13px; background:#fff; border:1px solid var(--line); border-radius:8px; padding:10px 12px; margin:0; font-family:inherit; }
#dlThinkBox summary { cursor:pointer; color:var(--ink-soft); font-size:12.5px; }

/* Open tickets alert under the header ribbon */
.tk-alert { display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:6px 22px; background:#fff8e6; border-bottom:1px solid #f1d9a0; font-size:13px; color:#7a5a12; }
.tk-chip { display:inline-flex; align-items:center; gap:6px; border-radius:999px; padding:2px 11px; font-weight:700; text-decoration:none; }
.tk-chip.rv { background:var(--gold); color:#fff; }
.tk-chip.dna { background:#dcfce7; color:#166534; }
.tk-chip.op { background:#e8ecf7; color:var(--navy-deep); }
.tk-chip .dna-pulse { width:8px; height:8px; margin:0; }

/* ── EnsuranceDNA family look (2026-09-28) ── */
.rb-markimg { width: 30px; height: 30px; border-radius: 8px; display: block; }
.rb-launch { position: relative; margin-right: 4px; }
.rb-grid { font-size: 17px; padding: 6px 9px; }
.apps-menu { left: 0; right: auto; min-width: 330px; padding: 10px; }
.apps-head { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); padding: 2px 6px 8px; }
.apps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.apps-grid a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: 10px; color: var(--navy-deep); text-decoration: none; font-size: 12.5px; font-weight: 600; }
.apps-grid a:hover, .apps-grid a.on { background: #eef1fb; }
.apps-grid a img, .apps-grid a i { width: 34px; height: 34px; font-size: 26px; line-height: 34px; text-align: center; color: var(--navy); }
.apps-grid b { color: #059669; }
.rb-launch.open .rb-menu { display: block; }
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.foot b { color: #059669; }
.side-group[data-grp="MANAGE"] .sg-head, .side-group[data-grp="MANAGE"] > button, .side-group[data-grp="MANAGE"] > div:first-child { color: #d9b25f; }

/* ── AskDNA side panel ── */
.rb-ask { border: 0; cursor: pointer; font: inherit; }
.rb-ask b { color: #065f46; }
.ask-panel { position: fixed; top: 64px; right: 16px; bottom: 16px; width: min(420px, calc(100vw - 32px)); background: #fff;
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 50px rgba(20,26,80,.22); display: none; flex-direction: column; z-index: 80; }
.ask-panel.on { display: flex; }
.ap-head { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; background: var(--navy); color: #fff; border-radius: 14px 14px 0 0; font-weight: 700; }
.ap-head b { color: #34d399; } .ap-head small { font-weight: 400; opacity: .75; margin-left: 4px; }
.ap-head button, .ap-head a { background: none; border: 0; color: #fff; cursor: pointer; font-size: 15px; margin-left: 6px; opacity: .85; }
.ap-log { flex: 1; overflow: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.ap-hello { color: var(--ink-soft); display: flex; flex-direction: column; gap: 6px; }
.ap-sugg { text-align: left; background: #f3f5fb; border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; cursor: pointer; font: inherit; color: var(--navy-deep); }
.ap-sugg:hover { border-color: var(--gold); }
.ap-q { align-self: flex-end; background: var(--navy); color: #fff; padding: 8px 12px; border-radius: 12px 12px 2px 12px; max-width: 85%; white-space: pre-wrap; }
.ap-a { align-self: flex-start; background: #f3f5fb; padding: 9px 12px; border-radius: 12px 12px 12px 2px; max-width: 92%; white-space: pre-wrap; line-height: 1.45; }
.ap-a.err { background: #fef2f2; color: #991b1b; }
.ap-meta { font-size: 11.5px; color: var(--ink-soft); margin-top: 4px; }
.ap-meta button { background: none; border: 0; color: var(--navy); cursor: pointer; font-size: 11.5px; padding: 0 0 0 8px; }
.ap-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.ap-form textarea { flex: 1; resize: none; border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 10px; font: inherit; }
.ap-foot { font-size: 11.5px; color: var(--ink-soft); padding: 0 14px 10px; }
@media print { .ask-panel, .data-pill { display: none !important; } }

/* ── Getting data notice ── */
.data-pill { position: fixed; left: 50%; top: 74px; transform: translateX(-50%); background: var(--navy); color: #fff; font-size: 13px; font-weight: 600;
  padding: 7px 14px; border-radius: 999px; box-shadow: 0 8px 24px rgba(20,26,80,.25); display: none; align-items: center; gap: 8px; z-index: 90; }
.data-pill.on { display: flex; }
.dp-spin { width: 13px; height: 13px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: dpSpin .8s linear infinite; }
@keyframes dpSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .dp-spin { animation: none; } }

/* ── Phone and tablet ── */
.rb-menubtn { display: none; font-size: 20px; padding: 4px 8px; }
@media (max-width: 900px) {
  .rb-menubtn { display: inline-flex; }
  .side.drawer { display: flex; position: fixed; top: 0; left: 0; bottom: 0; z-index: 95; box-shadow: 8px 0 30px rgba(0,0,0,.3); overflow: auto; }
  .side-scrim { display: none; position: fixed; inset: 0; background: rgba(10,14,50,.45); z-index: 94; }
  .side-scrim.on { display: block; }
  .rb-word, .rb-env, .rb-right > a.rb-link { display: none; }
  .favbar { display: none; }
  .crumbbar { flex-wrap: wrap; gap: 6px; }
  .content { padding: 12px !important; }
  .panel-head { flex-wrap: wrap; gap: 8px; }
}
@media (max-width: 640px) {
  .ask-panel { top: auto; right: 0; left: 0; bottom: 0; width: 100%; height: 78vh; border-radius: 16px 16px 0 0; }
  .crumbs { display: none; }
  .crumb-search, .crumb-search input { width: 100%; }
}
