/* ═══════════════════════════════════════════════════════════
   12NC Reference — Main Stylesheet
   ═══════════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --blue:        #0050A0;
  --blue-dark:   #003578;
  --blue-mid:    #0076C6;
  --blue-light:  #E8F2FB;
  --blue-xlight: #F0F6FD;
  --green:       #1d9e75;
  --green-dark:  #0a3d2e;
  --yellow-dark: #B8860B;
  --orange-dark: #D2691E;
  --red-dark:    #8B0000;
  --purple-dark: #4B0082;
  --sidebar-w:   230px;
  --header-h:    52px;
  --footer-h:    48px;
  --radius:      6px;
  --shadow-sm:   0 1px 4px rgba(0,0,0,.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,.12);
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: system-ui, sans-serif;
  background: #f4f3ef;
  color: #1a1a1a;
  font-size: 14px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--blue-mid); }
button { cursor: pointer; font-family: inherit; font-size: 13px; }
code {
  font-family: monospace;
  background: #f0efe8;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: .85em;
}

/* ── Top bar ─────────────────────────────────────────────── */
#topbar {
  background: var(--blue);
  color: #fff;
  height: var(--header-h);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,42,.18);
  flex-shrink: 0;
}
#topbar h1 { font-size: 1rem; font-weight: 600; letter-spacing: -.2px; }
.topbar-subtitle { opacity: .45; font-weight: 400; font-size: .88rem; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

#user-info { display: none; align-items: center; gap: 8px; }
.user-pill {
  display: flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.12);
  border-radius: 20px;
  padding: 3px 11px 3px 5px;
  font-size: .8rem;
}
.avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--blue-mid);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .65rem; color: #fff; flex-shrink: 0;
}
.role-badge     { padding: 1px 7px; border-radius: 10px; font-size: .68rem; font-weight: 600; }
.role-user      { background: rgba(255,255,255,.15); color: #fff; }
.role-moderator { background: #ffd85c; color: #3a2800; }
.role-admin     { background: #ff6b6b; color: #fff; }
.trust-badge    { background: rgba(255,255,255,.2); color: #fff; border-radius: 10px; padding: 1px 7px; font-size: .72rem; font-weight: 600; }

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,.35);
  color: #fff;
  border-radius: var(--radius);
  padding: 4px 12px;
  font-size: .8rem;
}
.btn-ghost:hover { background: rgba(255,255,255,.12); }

/* ── App shell ───────────────────────────────────────────── */
.app-shell { display: flex; flex: 1; overflow: hidden; }

/* ── Sidebar ─────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-h) - var(--footer-h));
  position: sticky;
  top: var(--header-h);
  overflow-y: auto;
  flex-shrink: 0;
}
.sidebar-brand {
  padding: 1.1rem 1rem .9rem;
  border-bottom: 1px solid #eee;
  display: flex; align-items: center; gap: .6rem;
}
.sidebar-brand img { height: 28px; width: auto; }
.brand-title { font-size: .88rem; font-weight: 600; color: var(--blue); }
.brand-text  { font-size: .78rem; color: #666; line-height: 1.3; }

.sidebar-nav { list-style: none; padding: .5rem 0; flex: 1; }
.sidebar-nav li {
  display: flex; align-items: center; gap: .6rem;
  padding: .62rem 1.1rem;
  cursor: pointer;
  font-size: .88rem;
  color: #444;
  border-left: 3px solid transparent;
  transition: background .12s;
  user-select: none;
}
.sidebar-nav li:hover  { background: var(--blue-xlight); color: var(--blue); }
.sidebar-nav li.active { background: var(--blue-light); color: var(--blue); border-left-color: var(--blue); font-weight: 600; }
.nav-icon { font-size: 1rem; opacity: .7; width: 18px; text-align: center; }
.sidebar-footer { padding: .75rem 1rem; border-top: 1px solid #eee; font-size: .75rem; color: #aaa; }

/* ── Main content ────────────────────────────────────────── */
.main-content {
  flex: 1;
  overflow-y: auto;
  height: calc(100vh - var(--header-h) - var(--footer-h));
}
.section     { display: none; min-height: 100%; }
.section.active { display: block; }
.loading     { text-align: center; padding: 3rem; color: #aaa; }
.load-error  { padding: 2rem; color: #a32d2d; text-align: center; }

/* ── Database toolbar ────────────────────────────────────── */
.db-toolbar {
  background: #fff;
  border-bottom: 1px solid #ddd;
  padding: .65rem 1.25rem;
  display: flex; gap: .65rem; align-items: center; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 10;
}
.db-toolbar input[type=search] {
  flex: 1; min-width: 160px;
  padding: .45rem .8rem;
  border: 1px solid #ccc;
  border-radius: var(--radius);
  font-size: .9rem; outline: none;
}
.db-toolbar input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,80,160,.1);
}
.db-toolbar select {
  padding: .43rem .6rem;
  border: 1px solid #ccc;
  border-radius: var(--radius);
  background: #fff; outline: none;
}
.btn-primary { background: var(--blue); color: #fff; border: none; border-radius: var(--radius); padding: .45rem 1rem; font-weight: 500; }
.btn-primary:hover { background: var(--blue-dark); }
.rec-count { font-size: .8rem; color: #777; white-space: nowrap; }

/* ── Database table ──────────────────────────────────────── */
.db-body { padding: 1.25rem 1.25rem 2rem; }
.table-wrap {
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fff;
  overflow: hidden; overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; font-size: .82rem; min-width: 1120px; }
thead { background: #f0efe8; }
th {
  padding: .6rem .75rem;
  text-align: left;
  font-weight: 600; font-size: .72rem;
  text-transform: uppercase; letter-spacing: .04em;
  color: #555;
  border-bottom: 1px solid #ddd;
  white-space: nowrap; cursor: pointer; user-select: none;
}
th:hover { color: var(--blue); }
td {
  padding: .55rem .75rem;
  border-bottom: .5px solid #eee;
  vertical-align: middle;
  max-width: 150px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f5f8fc; cursor: pointer; }

/* ── Confidence & chips ──────────────────────────────────── */
.conf { display: inline-flex; align-items: center; font-size: .72rem; font-weight: 600; border-radius: 12px; padding: 2px 8px; }
.conf-unverified { background: #f1efe8; color: #5f5e5a; }
.conf-low        { background: #faece7; color: #993c1d; }
.conf-medium     { background: #faeeda; color: #633806; }
.conf-high       { background: #eaf3de; color: #27500a; }
.conf-confirmed  { background: #e1f5ee; color: #085041; }
.vchips          { display: flex; gap: 3px; flex-wrap: wrap; }
.vchip           { font-size: .68rem; padding: 2px 6px; border-radius: 10px; border: 1px solid; }
.vchip-ok        { background: #e1f5ee; color: #085041; border-color: #9fe1cb; }
.vchip-disp      { background: #fcebeb; color: #791f1f; border-color: #f7c1c1; }
.vchip-pend      { background: #f1efe8; color: #444;    border-color: #d3d1c7; }
.vchip-method    { background: #eeedfe; color: #3c3489; border-color: #afa9ec; }

/* ── Detail modal (centered) ─────────────────────────────── */
.detail-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.58);
  z-index: 400;
  align-items: center; justify-content: center;
  padding: 1rem;
}
.detail-overlay.open { display: flex; }
.detail-modal {
  background: #fff; border-radius: 12px;
  width: 100%; max-width: 860px; max-height: 88vh;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  overflow: hidden;
}
.dm-head {
  background: var(--blue); color: #fff;
  padding: .9rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.dm-head-left   { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.dm-nc          { font-family: monospace; font-size: 1rem; font-weight: 700; background: rgba(255,255,255,.18); padding: 3px 10px; border-radius: 5px; letter-spacing: .04em; white-space: nowrap; }
.dm-desc        { font-size: .88rem; opacity: .82; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-close       { background: none; border: none; color: #fff; font-size: 1.3rem; opacity: .75; cursor: pointer; flex-shrink: 0; line-height: 1; padding: 0 2px; }
.dm-close:hover { opacity: 1; }
.dm-tabs        { display: flex; background: #f9f8f5; border-bottom: 1px solid #ddd; flex-shrink: 0; overflow-x: auto; }
.dm-tab         { padding: .65rem 1.1rem; font-size: .83rem; font-weight: 500; color: #666; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; user-select: none; }
.dm-tab:hover   { color: var(--blue); background: var(--blue-xlight); }
.dm-tab.active  { color: var(--blue); border-bottom-color: var(--blue); background: #fff; }
.tab-badge      { background: var(--blue); color: #fff; border-radius: 10px; padding: 1px 6px; font-size: .65rem; margin-left: 4px; font-weight: 700; vertical-align: middle; }
.dm-body        { flex: 1; overflow-y: auto; }
.dm-panel       { display: none; padding: 1.25rem; }
.dm-panel.active{ display: block; }
.dm-actions     { padding: .75rem 1.25rem; border-top: 1px solid #eee; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; flex-shrink: 0; background: #f9f8f5; }

/* Detail grid */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem 2rem; }
.span2       { grid-column: 1 / -1; }
.dfield-label { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: #888; margin-bottom: 3px; }
.dfield-val   { font-size: .88rem; color: #1a1a1a; word-break: break-word; }
.dfield-val a { color: var(--blue-mid); word-break: break-all; }

/* Attachments */
.att-grid { display: flex; flex-wrap: wrap; gap: .65rem; margin-bottom: 1rem; }
.att-item  { position: relative; border-radius: 7px; border: 1px solid #ddd; overflow: hidden; background: #f9f8f5; cursor: pointer; transition: box-shadow .15s; }
.att-item:hover { box-shadow: var(--shadow-md); }
.att-img   { width: 100px; height: 80px; object-fit: cover; display: block; }
.att-pdf   { width: 100px; height: 80px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.pdf-icon  { font-size: 1.8rem; }
.pdf-name  { font-size: .65rem; color: #555; text-align: center; padding: 0 4px; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-del   { position: absolute; top: 3px; right: 3px; background: rgba(0,0,0,.55); color: #fff; border: none; border-radius: 50%; width: 18px; height: 18px; font-size: .6rem; display: none; align-items: center; justify-content: center; cursor: pointer; }
.att-item:hover .att-del { display: flex; }
.upload-zone { border: 2px dashed #ccc; border-radius: 8px; padding: 1.1rem; text-align: center; color: #999; font-size: .83rem; }
.upload-zone input[type=file] { display: none; }
.upload-zone label { cursor: pointer; color: var(--blue-mid); font-weight: 500; }
.upload-zone label:hover { text-decoration: underline; }
.upload-progress { font-size: .78rem; color: #666; margin-top: .4rem; min-height: 1rem; }

/* Verification panel */
.verif-form   { background: var(--blue-xlight); border-radius: 8px; padding: 1rem; margin-bottom: 1rem; }
.verif-form h4{ font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--blue); margin-bottom: .65rem; }
.verif-entry  { background: #f9f8f5; border-radius: 6px; padding: .6rem .85rem; margin-bottom: .5rem; display: flex; gap: 10px; align-items: flex-start; }
.verif-meta   { font-size: .75rem; color: #888; margin-top: 2px; }
.verif-tag    { font-size: .68rem; font-weight: 600; padding: 1px 6px; border-radius: 8px; margin-left: 4px; }
.tag-confirm  { background: #e1f5ee; color: #085041; }
.tag-dispute  { background: #fcebeb; color: #791f1f; }
.tag-method   { background: #eeedfe; color: #3c3489; }
select.method-sel { padding: .38rem .6rem; border: 1px solid #ccc; border-radius: 5px; font-size: .82rem; background: #fff; outline: none; flex: 1; }
input.comment-in  { padding: .38rem .7rem; border: 1px solid #ccc; border-radius: 5px; font-size: .82rem; width: 100%; outline: none; margin-bottom: .5rem; }
input.comment-in:focus { border-color: var(--blue); }
.btn-confirm  { background: var(--green-dark); color: #fff; border: none; border-radius: 5px; padding: .4rem .85rem; font-weight: 500; }
.btn-confirm:hover { background: var(--green); }
.btn-dispute  { background: #fff; color: #a32d2d; border: 1px solid #f09595; border-radius: 5px; padding: .4rem .85rem; }
.btn-dispute:hover { background: #fcebeb; }
.btn-edit     { background: var(--blue-xlight); color: var(--blue); border: 1px solid #b8d4ef; border-radius: 5px; padding: .38rem .85rem; font-size: .82rem; }
.btn-edit:hover    { background: var(--blue-light); }
.btn-softdel  { background: #fff; color: #a32d2d; border: 1px solid #f09595; border-radius: 5px; padding: .38rem .85rem; font-size: .82rem; }
.btn-softdel:hover { background: #fcebeb; }

/* Comments */
.cmt-compose   { border: 1px solid #ddd; border-radius: 8px; padding: .75rem; margin-bottom: 1rem; background: #fff; }
.cmt-compose textarea { width: 100%; border: 1px solid #ddd; border-radius: 5px; padding: .5rem .7rem; font-family: inherit; font-size: .85rem; resize: vertical; min-height: 62px; outline: none; }
.cmt-compose textarea:focus { border-color: var(--blue); }
.cmt-compose-foot { display: flex; justify-content: flex-end; margin-top: .5rem; }
.cmt-thread    { display: flex; flex-direction: column; gap: .55rem; }
.cmt-card      { background: #f9f8f5; border-radius: 8px; padding: .7rem .9rem; border: 1px solid #eee; }
.cmt-card.reply{ margin-left: 2rem; background: #fff; border-left: 3px solid var(--blue-light); }
.cmt-header    { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .3rem; }
.cmt-user      { font-weight: 600; font-size: .82rem; }
.cmt-time      { font-size: .72rem; color: #bbb; }
.cmt-edited    { font-size: .67rem; background: #f0efe8; color: #999; padding: 1px 5px; border-radius: 4px; }
.cmt-body      { font-size: .85rem; line-height: 1.55; word-break: break-word; }
.cmt-actions   { display: flex; gap: .6rem; margin-top: .4rem; }
.cmt-btn       { background: none; border: none; color: #aaa; font-size: .75rem; padding: 0; cursor: pointer; }
.cmt-btn:hover { color: var(--blue); }
.cmt-btn.del:hover { color: #a32d2d; }
.reply-box, .edit-box { display: none; margin-top: .55rem; }
.reply-box textarea, .edit-box textarea { width: 100%; border: 1px solid #ddd; border-radius: 5px; padding: .4rem .65rem; font-family: inherit; font-size: .83rem; resize: vertical; min-height: 50px; outline: none; }
.edit-box textarea { border-color: var(--blue-light); background: var(--blue-xlight); }
.reply-box textarea:focus, .edit-box textarea:focus { border-color: var(--blue); }
.sub-foot      { display: flex; gap: .4rem; justify-content: flex-end; margin-top: .35rem; }
.btn-sm        { padding: .3rem .75rem; border-radius: 4px; font-size: .78rem; border: none; cursor: pointer; }
.btn-sm-primary{ background: var(--blue); color: #fff; }
.btn-sm-primary:hover { background: var(--blue-dark); }
.btn-sm-cancel { background: #fff; color: #666; border: 1px solid #ccc !important; }
.no-cmt        { text-align: center; color: #bbb; font-size: .85rem; padding: 2rem; }
.cmt-replies   { margin-top: .45rem; display: flex; flex-direction: column; gap: .4rem; }

/* ── Shared modals ───────────────────────────────────────── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 500; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: #fff; border-radius: 10px; width: 500px; max-width: 95vw; max-height: 90vh; overflow-y: auto; box-shadow: 0 8px 40px rgba(0,0,0,.2); }
.modal-head   { padding: 1rem 1.25rem; border-bottom: 1px solid #eee; display: flex; align-items: center; justify-content: space-between; background: var(--blue-xlight); }
.modal-head h2{ font-size: .95rem; font-weight: 600; color: var(--blue); }
.close-btn    { background: none; border: none; font-size: 1.2rem; color: #888; cursor: pointer; }
.close-btn:hover { color: #333; }
.modal-body   { padding: 1.25rem; display: flex; flex-direction: column; gap: .85rem; }
.modal-body label { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #666; display: block; margin-bottom: 3px; }
.modal-body input,
.modal-body select,
.modal-body textarea { width: 100%; padding: .48rem .75rem; border: 1px solid #ccc; border-radius: 5px; font-size: .88rem; font-family: inherit; outline: none; }
.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus { border-color: var(--blue); }
.modal-foot      { padding: .85rem 1.25rem; border-top: 1px solid #eee; display: flex; gap: .5rem; justify-content: flex-end; }
.modal-foot--col { flex-direction: column; }
.btn-cancel   { background: #fff; border: 1px solid #ccc; border-radius: 5px; padding: .45rem .9rem; color: #555; }
.btn-submit   { background: var(--blue); color: #fff; border: none; border-radius: 5px; padding: .45rem 1rem; font-weight: 500; }
.btn-submit:hover { background: var(--blue-dark); }
.btn-full     { width: 100%; }
.auth-err     { color: #a32d2d; font-size: .83rem; display: none; padding: .4rem .75rem; background: #fcebeb; border-radius: 5px; margin-top: .25rem; }
.auth-switch  { background: none; border: none; color: var(--blue-mid); font-size: .83rem; cursor: pointer; text-align: center; width: 100%; padding: .3rem; }
.field-msg    { font-size: .75rem; margin-top: 3px; min-height: 1rem; }
.field-ok     { color: var(--green); }
.field-err    { color: #a32d2d; }
.btn-link     { background: none; border: none; color: var(--blue-mid); font-size: .75rem; cursor: pointer; padding: 0; text-decoration: underline; }
.btn-link:hover { color: var(--blue-dark); }
.lbl-hint     { font-weight: 400; font-size: .78rem; color: #aaa; }
.char-counter { font-size: .72rem; color: #aaa; text-align: right; margin-top: 2px; }
.modal-note   { font-size: .8rem; color: #888; background: #f9f8f5; padding: .6rem .75rem; border-radius: 5px; }

/* ── Password show/hide toggle ─────────────────────────── */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 2.4rem !important; }
.pw-toggle {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 2.2rem;
  background: none; border: none;
  color: #aaa; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: 0 5px 5px 0;
  padding: 0;
  user-select: none; -webkit-user-select: none;
}
.pw-toggle:hover { color: var(--blue); }
.pw-eye { width: 16px; height: 16px; display: block; pointer-events: none; }

/* ── Footer ──────────────────────────────────────────────── */
#footer {
  background: var(--blue); color: rgba(255,255,255,.8);
  height: var(--footer-h); padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  font-size: .78rem; flex-shrink: 0;
}
.footer-center { opacity: .65; }
.footer-right  { opacity: .5; }

/* ── Lightbox ────────────────────────────────────────────── */
#lightbox { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.88); z-index: 700; align-items: center; justify-content: center; cursor: zoom-out; }
#lightbox.open { display: flex; }
#lightbox img  { max-width: 90vw; max-height: 90vh; border-radius: 6px; }

/* ── Toast ───────────────────────────────────────────────── */
.toast { position: fixed; bottom: 1.5rem; right: 1.5rem; background: #1a1a2e; color: #fff; padding: .65rem 1.1rem; border-radius: 7px; font-size: .85rem; z-index: 800; opacity: 0; transform: translateY(6px); transition: all .2s; pointer-events: none; max-width: 320px; line-height: 1.4; }
.toast.show { opacity: 1; transform: translateY(0); }

/* ════════════════════════════════════════════════════════════
   HISTORY MODULE  (content/history.html)
   ════════════════════════════════════════════════════════════ */
.hist-hero {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 60%, var(--blue-mid) 100%);
  color: #fff;
  padding: 3.5rem 2rem;
  text-align: center;
}
.hist-hero h2   { font-size: 1.9rem; font-weight: 700; margin-bottom: .5rem; letter-spacing: -.5px; }
.hist-hero p    { opacity: .82; font-size: 1rem; max-width: 580px; margin: .5rem auto 0; line-height: 1.6; }
.hist-hero-meta { display: flex; justify-content: center; gap: 1.5rem; margin-top: 1.5rem; flex-wrap: wrap; }
.hist-hero-stat { text-align: center; }
.hist-hero-stat strong { display: block; font-size: 1.6rem; font-weight: 700; }
.hist-hero-stat span   { font-size: .78rem; opacity: .7; text-transform: uppercase; letter-spacing: .06em; }

.hist-body    { max-width: 820px; margin: 0 auto; padding: 0 1.5rem 3rem; }
.hist-section { padding-top: 2rem; }
.hist-section h3 {
  font-size: 1.05rem; font-weight: 700; color: var(--blue);
  border-bottom: 2px solid var(--blue-light);
  padding-bottom: .4rem; margin-bottom: 1rem;
  display: flex; align-items: center; gap: .5rem;
}
.hist-section p  { font-size: .9rem; line-height: 1.75; color: #333; margin-bottom: .85rem; }
.hist-section ul { font-size: .9rem; line-height: 1.75; color: #333; padding-left: 1.25rem; margin-bottom: .85rem; }
.hist-section li { margin-bottom: .3rem; }

/* 12NC structure breakdown bar */
.nc-breakdown  { display: flex; border-radius: 8px; overflow: hidden; margin: 1.25rem 0; font-family: monospace; box-shadow: var(--shadow-sm); background: #f4f3ef; gap: 2px; }
.nc-seg        { padding: .85rem .75rem; text-align: center; flex: 1; }
.nc-group-sep  { width: 10px; flex-shrink: 0; }
.nc-seg-a      { background: var(--blue-dark);   color: #fff; }
.nc-seg-b      { background: var(--blue);         color: #fff; }
.nc-seg-c      { background: var(--green-dark);   color: #fff; }
.nc-seg-d      { background: var(--yellow-dark);  color: #fff; }
.nc-seg-e      { background: var(--orange-dark);  color: #fff; }
.nc-seg-f      { background: var(--red-dark);     color: #fff; }
.nc-seg-g      { background: var(--purple-dark);  color: #fff; }
.nc-seg-top   { font-size: .65rem; text-transform: uppercase; letter-spacing: .06em; opacity: .75; display: block; margin-bottom: 4px; }
.nc-seg-val   { font-size: 1.15rem; font-weight: 700; letter-spacing: .1em; display: block; }
.nc-seg-sub   { font-size: .68rem; opacity: .8; margin-top: 3px; display: block; }

/* Example table */
.hist-table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .85rem; border-radius: 8px; overflow: hidden; border: 1px solid #ddd; }
.hist-table th { background: var(--blue-xlight); color: var(--blue); padding: .55rem .9rem; text-align: left; font-weight: 600; font-size: .78rem; border-bottom: 2px solid var(--blue-light); }
.hist-table td { padding: .5rem .9rem; border-bottom: .5px solid #eee; }
.hist-table tr:last-child td { border-bottom: none; }
.hist-table tr:hover td { background: var(--blue-xlight); }

/* Entity badges used in history */
.hist-badge { display: inline-block; background: var(--blue-light); color: var(--blue); border-radius: 4px; padding: 2px 8px; font-size: .78rem; font-weight: 600; margin: 2px; }

/* Product Group section */
.pg-title { margin-top: 1.5rem; margin-bottom: 0.8rem; color: #0050A0; font-weight: 600; font-size: 0.95rem; }
.pg-loading td { text-align: center; padding: 1rem; color: #aaa; }

/* ── History reference-table modals ─────────────────────────── */
.ref-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 450;
  align-items: center; justify-content: center;
  padding: 1rem;
}
.ref-overlay.open { display: flex; }
.ref-modal {
  background: #fff; border-radius: 12px;
  width: 100%; max-width: min(96vw, 560px); max-height: 84vh;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  overflow: hidden;
  animation: refModalIn .18s ease;
}
.ref-modal--wide { max-width: min(96vw, 900px); }
@keyframes refModalIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ref-modal-head {
  padding: .85rem 1.25rem;
  border-bottom: 1px solid #ddd;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--blue-xlight);
  flex-shrink: 0;
}
.ref-modal-head h2 { font-size: .95rem; font-weight: 600; color: var(--blue); }
.ref-modal-body { flex: 1; overflow-y: auto; overflow-x: hidden; }
.ref-table { width: 100%; border-collapse: collapse; font-size: .83rem; table-layout: auto; }
.ref-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--blue-xlight); color: var(--blue);
  padding: .5rem .75rem; text-align: left;
  font-weight: 600; font-size: .75rem;
  border-bottom: 2px solid var(--blue-light);
  white-space: nowrap;
}
/* Code column: shrink-wrap to content */
.ref-table th:first-child,
.ref-table td:first-child {
  width: 1%;
  white-space: nowrap;
  padding-left: .75rem;
  padding-right: .75rem;
}
.ref-table tbody tr:nth-child(even) td { background: #f7f6f2; }
.ref-table td { padding: .45rem .75rem; border-bottom: .5px solid #eee; }
/* Description / Notes columns: fill width and wrap */
.ref-table td:not(:first-child) { word-break: break-word; overflow-wrap: break-word; }
.ref-table tr:last-child td { border-bottom: none; }
.ref-table tr:hover td { background: var(--blue-xlight); }

/* Inline clickable ref-link button */
.ref-link {
  background: none; border: none;
  color: var(--blue-mid); font-weight: 600;
  font-size: inherit; font-family: inherit;
  cursor: pointer; padding: 0;
  text-decoration: underline; text-decoration-style: dotted;
}
.ref-link:hover { color: var(--blue-dark); text-decoration-style: solid; }

/* TODO placeholder */
.hist-todo {
  border: 2px dashed #c5d9f0;
  background: var(--blue-xlight);
  border-radius: 10px;
  padding: 2rem;
  text-align: center;
  color: #6a90b8;
  margin: 1.5rem 0;
}
.hist-todo .todo-icon { font-size: 2rem; display: block; margin-bottom: .5rem; }
.hist-todo h4 { font-size: .95rem; font-weight: 600; color: var(--blue); margin-bottom: .35rem; }
.hist-todo p  { font-size: .84rem; max-width: 400px; margin: 0 auto; }

/* ════════════════════════════════════════════════════════════
   ABOUT MODULE  (content/about.html)
   ════════════════════════════════════════════════════════════ */
.about-header {
  background: var(--blue);
  color: #fff;
  padding: 2rem 2rem 1.75rem;
  border-bottom: 1px solid rgba(0,0,0,.08);
}
.about-header h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: .25rem; letter-spacing: -.3px; }
.about-header p  { opacity: .65; font-size: .88rem; }

.about-divider {
  border: none;
  border-top: 1px solid #e8e6de;
  margin: .5rem 0 0;
}

/* LinkedIn card link */
.li-card {
  display: inline-flex; align-items: center; gap: .85rem;
  margin-top: .65rem;
  padding: .75rem 1rem .75rem .75rem;
  background: #fff;
  border: 1px solid #dde3ec;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  transition: border-color .18s, box-shadow .18s, transform .18s;
  max-width: 360px;
}
.li-card:hover {
  border-color: #0A66C2;
  box-shadow: 0 4px 14px rgba(10,102,194,.15);
  transform: translateY(-2px);
}
.li-logo-wrap {
  width: 38px; height: 38px; flex-shrink: 0;
  background: #0A66C2;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.li-logo { width: 22px; height: 22px; fill: #fff; display: block; }
.li-text { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.li-name   { font-size: .88rem; font-weight: 600; color: #1a1a1a; }
.li-handle { font-size: .75rem; color: #0A66C2; }
.li-arrow  { font-size: 1rem; color: #aaa; flex-shrink: 0; transition: color .18s; line-height: 1; }
.li-card:hover .li-arrow { color: #0A66C2; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 680px) {
  #sidebar { display: none; }
  .detail-modal { max-height: 96vh; border-radius: 8px; }
  .detail-grid  { grid-template-columns: 1fr; }
  .span2 { grid-column: 1; }
  .hist-hero h2 { font-size: 1.4rem; }
  .nc-breakdown { flex-direction: column; }
  .nc-seg { flex: 1 !important; }
  .nc-group-sep { width: 100%; height: 6px; }
}
