/* NetSuite shared styles · used by all NS module pages built after netsuite-customer-so.html */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --ns-blue: #003c64;
  --ns-blue-light: #e6f0f7;
  --ns-blue-mid: #0078b4;
  --ns-bg: #f5f5f0;
  --ns-card: #ffffff;
  --ns-border: #c8c8c0;
  --ns-border-strong: #969690;
  --ns-text: #333333;
  --ns-text-muted: #666660;
  --ns-success: #1f7a3a;
  --ns-warning: #b8650b;
  --ns-error: #b91c1c;
  --ns-link: #0066b3;
}
body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 12.5px; color: var(--ns-text); background: var(--ns-bg);
  -webkit-font-smoothing: antialiased;
}

/* Top bar + nav */
.ns-top { background: var(--ns-blue); color: white; padding: 0; height: 40px; display: flex; align-items: center; gap: 0; font-size: 12px; }
.ns-logo { background: white; color: var(--ns-blue); padding: 0 18px; height: 100%; display: flex; align-items: center; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.ns-logo span { font-weight: 300; font-size: 13px; opacity: 0.7; margin-left: 6px; }
.ns-menu { display: flex; height: 100%; }
.ns-menu a { padding: 0 16px; height: 100%; display: flex; align-items: center; color: white; text-decoration: none; font-weight: 500; border-right: 1px solid rgba(255,255,255,0.1); cursor: pointer; }
.ns-menu a:hover { background: rgba(255,255,255,0.08); }
.ns-menu a.active { background: rgba(255,255,255,0.15); }
.ns-right { margin-left: auto; padding: 0 18px; display: flex; align-items: center; gap: 14px; font-size: 11.5px; }

/* Breadcrumbs */
.ns-sub { background: linear-gradient(180deg, #ecece4 0%, #d6d6c8 100%); border-bottom: 1px solid var(--ns-border); padding: 6px 18px; display: flex; align-items: center; gap: 14px; font-size: 11px; color: var(--ns-text-muted); }
.ns-sub .crumb a { color: var(--ns-link); text-decoration: none; cursor: pointer; }
.ns-sub .crumb a:hover { text-decoration: underline; }

/* Title bar */
.ns-titlebar { background: var(--ns-card); border-bottom: 1px solid var(--ns-border); padding: 14px 22px 12px; }
.ns-titlebar h1 { font-size: 22px; font-weight: 600; color: var(--ns-blue); letter-spacing: -0.005em; }
.ns-titlebar .meta { font-size: 11.5px; color: var(--ns-text-muted); margin-top: 2px; }
.ns-titlebar .actions { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.ns-btn { padding: 4px 12px; border: 1px solid var(--ns-border-strong); background: linear-gradient(180deg, #fcfcf8 0%, #e8e8e0 100%); border-radius: 2px; font-size: 11.5px; cursor: pointer; font-family: inherit; color: var(--ns-text); }
.ns-btn:hover { background: linear-gradient(180deg, #ffffff 0%, #ececdc 100%); }
.ns-btn.primary { background: linear-gradient(180deg, #4a90c2 0%, #003c64 100%); color: white; border-color: var(--ns-blue); }
.ns-btn.primary:hover { background: linear-gradient(180deg, #5aa0d2 0%, #00497a 100%); }

/* Tabs */
.ns-tabs { background: linear-gradient(180deg, #ececdc 0%, #d6d6c8 100%); border-bottom: 1px solid var(--ns-border-strong); padding: 0 22px; display: flex; gap: 0; flex-wrap: wrap; }
.ns-tab { padding: 8px 18px; font-size: 11.5px; font-weight: 600; color: var(--ns-text-muted); cursor: pointer; border: 1px solid transparent; border-bottom: none; border-top-left-radius: 4px; border-top-right-radius: 4px; background: rgba(0,0,0,0.04); margin-right: 2px; margin-top: 4px; }
.ns-tab:hover { background: rgba(0,0,0,0.07); }
.ns-tab.active { background: var(--ns-card); color: var(--ns-blue); border-color: var(--ns-border-strong); border-bottom: 1px solid var(--ns-card); margin-bottom: -1px; }
.ns-tab .badge-num { background: rgba(0,60,100,0.15); padding: 1px 7px; border-radius: 8px; font-size: 10px; margin-left: 4px; }

/* Content panel */
.ns-content { padding: 16px 22px; background: var(--ns-card); border-top: 1px solid var(--ns-border); }

/* Form blocks */
.ns-form { background: #fdfdfa; border: 1px solid var(--ns-border); padding: 16px 18px; margin-bottom: 14px; }
.ns-form .legend { font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ns-blue); font-weight: 700; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--ns-border); display: flex; align-items: center; gap: 8px; }
.ns-form .row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.ns-form .row.cols-3 { grid-template-columns: repeat(3, 1fr); }
.ns-form .row.cols-2 { grid-template-columns: repeat(2, 1fr); }
.ns-form .field .label { font-size: 10.5px; color: var(--ns-text-muted); margin-bottom: 2px; font-weight: 500; }
.ns-form .field .value { font-size: 12.5px; color: var(--ns-text); font-weight: 500; }
.ns-form .field .value.formula { color: #075985; font-family: ui-monospace, monospace; font-size: 11.5px; }
.ns-form .field .value.link { color: var(--ns-link); cursor: pointer; }
.ns-form .field .value.link:hover { text-decoration: underline; }
.ns-form .badge { font-size: 9.5px; background: var(--ns-blue-light); color: var(--ns-blue); padding: 1px 6px; border-radius: 2px; margin-left: 4px; }
.ns-form .badge.calc { background: #fef3c7; color: #92400e; }
.ns-form .badge.cust { background: #ede9fe; color: #5b21b6; }
.ns-form .badge.std { background: #e0f2fe; color: #075985; }
.ns-form .badge.sf { background: #cef0ff; color: #003e6e; font-weight: 600; }
.ns-form .badge.arena { background: #d1fae5; color: #065f46; font-weight: 600; }

/* Sublists / tables */
.ns-sublist { background: var(--ns-card); border: 1px solid var(--ns-border); margin-bottom: 14px; }
.ns-sublist-head { background: linear-gradient(180deg, #f4f4ec 0%, #e8e8dc 100%); padding: 8px 14px; border-bottom: 1px solid var(--ns-border); display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 12px; }
.ns-sublist-head .count { color: var(--ns-text-muted); font-weight: 400; font-size: 11px; margin-left: 6px; }

table.sl { width: 100%; border-collapse: collapse; font-size: 11.5px; }
table.sl thead th { background: linear-gradient(180deg, #ecece4 0%, #d8d8d0 100%); padding: 6px 10px; text-align: left; font-size: 10.5px; font-weight: 600; color: var(--ns-text); border-bottom: 1px solid var(--ns-border-strong); white-space: nowrap; }
table.sl tbody td { padding: 5px 10px; border-bottom: 1px solid #e8e8e0; }
table.sl tbody tr:hover { background: #f4f8fb; }
table.sl tbody tr.odd { background: #fafaf5; }
table.sl tbody tr.totals { background: #f8f8f0; font-weight: 700; border-top: 2px solid var(--ns-border-strong); }
table.sl tbody tr.totals td { padding: 8px 10px; }

.clickable-link { color: var(--ns-link); text-decoration: none; cursor: pointer; }
.clickable-link:hover { text-decoration: underline; }

/* Pills */
.pill { display: inline-block; padding: 1px 7px; border-radius: 2px; font-size: 10px; font-weight: 600; letter-spacing: 0.02em; }
.pill.green { background: #d1fae5; color: #065f46; }
.pill.red { background: #fee2e2; color: #991b1b; }
.pill.amber { background: #fef3c7; color: #78350f; }
.pill.blue { background: var(--ns-blue-light); color: var(--ns-blue); }
.pill.gray { background: #e5e7eb; color: #4b5563; }
.pill.itar { background: #fef3c7; color: #92400e; border: 1px solid #d97706; }
.pill.purple { background: #ede9fe; color: #5b21b6; }

/* Money formatting */
.money { font-variant-numeric: tabular-nums; font-weight: 500; }
.money-total { font-weight: 700; color: var(--ns-blue); }
.money-pos { color: var(--ns-success); }
.money-neg { color: var(--ns-error); }

/* Source banner */
.source-banner {
  background: linear-gradient(90deg, #cef0ff 0%, #e6f0f7 100%);
  border: 1px solid #4ea8ff;
  padding: 10px 16px; margin-bottom: 14px; border-radius: 4px;
  display: flex; align-items: center; gap: 12px; font-size: 11.5px;
}
.source-banner.arena { background: linear-gradient(90deg, #d1fae5 0%, #ecfdf5 100%); border-color: #00a651; }
.source-banner.arena .icon { background: #00a651; }
.source-banner.arena .text { color: #065f46; }
.source-banner.arena .text strong { color: #064e3b; }
.source-banner .icon { width: 26px; height: 26px; border-radius: 50%; background: #0070d2; color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.source-banner .text { flex: 1; color: #003e6e; }
.source-banner .text strong { color: var(--ns-blue); }
.source-banner a { color: var(--ns-link); font-weight: 600; text-decoration: none; }
.source-banner a:hover { text-decoration: underline; }

/* Footer · anti-hallucination */
.footer-banner { margin: 14px 22px; padding: 12px 16px; background: #fff8e7; border-left: 4px solid #d97706; color: #78350f; font-size: 11px; line-height: 1.5; }
.footer-banner strong { color: #92400e; }

/* Cross-system links */
.sf-link { display: inline-flex; align-items: center; gap: 6px; background: white; color: #0070d2; padding: 5px 11px; border: 1px solid #0070d2; border-radius: 3px; font-weight: 600; font-size: 11px; cursor: pointer; text-decoration: none; }
.sf-link:hover { background: #0070d2; color: white; }
.arena-link { display: inline-flex; align-items: center; gap: 6px; background: white; color: #00803e; padding: 5px 11px; border: 1px solid #00803e; border-radius: 3px; font-weight: 600; font-size: 11px; cursor: pointer; text-decoration: none; }
.arena-link:hover { background: #00803e; color: white; }
.mrp-link { display: inline-flex; align-items: center; gap: 6px; background: var(--ns-blue); color: white; padding: 5px 11px; border: 1px solid var(--ns-blue); border-radius: 3px; font-weight: 600; font-size: 11px; cursor: pointer; text-decoration: none; }
.mrp-link:hover { background: #00497a; }
.mes-link { display: inline-flex; align-items: center; gap: 6px; background: white; color: #1a232c; padding: 5px 11px; border: 1px solid #1a232c; border-radius: 3px; font-weight: 600; font-size: 11px; cursor: pointer; text-decoration: none; }
.mes-link:hover { background: #1a232c; color: white; }
.ns-link { display: inline-flex; align-items: center; gap: 6px; background: white; color: var(--ns-blue); padding: 5px 11px; border: 1px solid var(--ns-blue); border-radius: 3px; font-weight: 600; font-size: 11px; cursor: pointer; text-decoration: none; }
.ns-link:hover { background: var(--ns-blue); color: white; }

/* Flow indicator */
.flow-indicator {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; background: #ecfdf5; border: 1px solid #4ea88a;
  border-radius: 3px; font-size: 11px; color: #065f46; font-weight: 600;
}
.flow-indicator.in { background: #fef3c7; border-color: #d97706; color: #92400e; }
.flow-indicator.out { background: #ecfdf5; border-color: #4ea88a; color: #065f46; }

/* KPI cards */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi-card { background: var(--ns-card); border: 1px solid var(--ns-border); padding: 12px 14px; border-radius: 4px; }
.kpi-card .label { font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ns-text-muted); font-weight: 600; }
.kpi-card .value { font-size: 22px; font-weight: 700; color: var(--ns-blue); margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi-card .delta { font-size: 11px; margin-top: 3px; font-weight: 600; }
.kpi-card .delta.up { color: var(--ns-success); }
.kpi-card .delta.down { color: var(--ns-error); }
.kpi-card .delta.flat { color: var(--ns-text-muted); }

/* Tree (item / WBS) */
.tree { font-size: 12px; line-height: 1.7; font-family: ui-monospace, monospace; }
.tree .lvl-0 { font-weight: 700; color: var(--ns-blue); }
.tree .lvl-1 { padding-left: 22px; }
.tree .lvl-2 { padding-left: 44px; color: var(--ns-text-muted); }
.tree .lvl-3 { padding-left: 66px; color: var(--ns-text-soft, #999); }
.tree a { color: var(--ns-link); text-decoration: none; }
.tree a:hover { text-decoration: underline; }

/* Inline progress bar */
.bar { display: inline-block; width: 100%; max-width: 220px; height: 14px; background: #e5e7eb; border-radius: 2px; position: relative; overflow: hidden; vertical-align: middle; }
.bar .fill { position: absolute; top: 0; left: 0; bottom: 0; background: linear-gradient(180deg, #4ea8ff 0%, var(--ns-blue) 100%); }
.bar .fill.green { background: linear-gradient(180deg, #34d399 0%, var(--ns-success) 100%); }
.bar .fill.amber { background: linear-gradient(180deg, #fbbf24 0%, var(--ns-warning) 100%); }
.bar .fill.red { background: linear-gradient(180deg, #f87171 0%, var(--ns-error) 100%); }
.bar .lbl { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: white; mix-blend-mode: difference; }

/* 2-column layout */
.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.split-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* "More Actions" confirmation modal · used by ns-actions.js */
.ns-actions-confirm-backdrop {
  position: fixed; inset: 0; background: rgba(15, 25, 40, 0.65);
  display: flex; align-items: center; justify-content: center;
  z-index: 1100; padding: 24px; backdrop-filter: blur(2px);
  animation: confIn 0.15s ease-out;
}
@keyframes confIn { from { opacity: 0; } to { opacity: 1; } }
.ns-actions-confirm {
  background: white; max-width: 520px; width: 100%;
  border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,0.45);
  animation: confSlide 0.2s ease-out;
}
@keyframes confSlide { from { transform: translateY(-12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.ns-actions-confirm-head {
  padding: 16px 22px 12px; display: flex; align-items: center; gap: 14px;
  border-bottom: 1px solid var(--ns-border);
}
.ns-actions-confirm-icon {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--ns-blue) 0%, #4ea8ff 100%);
  color: white; display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; flex-shrink: 0;
}
.ns-actions-confirm-head h3 {
  flex: 1; font-size: 16px; font-weight: 700; color: var(--ns-text);
}
.ns-actions-confirm-x {
  width: 30px; height: 30px; border-radius: 50%; border: none;
  background: #f1f5f9; cursor: pointer; font-size: 14px;
  color: var(--ns-text-muted); transition: background 0.12s;
}
.ns-actions-confirm-x:hover { background: #e2e8f0; }
.ns-actions-confirm-body {
  padding: 16px 22px;
  font-size: 13px;
}
.ns-actions-confirm-body p { color: var(--ns-text); line-height: 1.6; margin: 0; }
.ns-actions-confirm-result {
  margin-top: 14px; padding: 10px 14px;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-left: 3px solid var(--ns-success);
  border-radius: 0 4px 4px 0;
  font-family: ui-monospace, monospace;
  font-size: 11.5px; color: #065f46; font-weight: 600;
}
.ns-actions-confirm-foot {
  padding: 12px 22px 16px; display: flex; justify-content: flex-end; gap: 8px;
  border-top: 1px solid var(--ns-border); background: #f8fafc;
  border-radius: 0 0 8px 8px;
}
.ns-actions-confirm-ok {
  padding: 8px 20px; border-radius: 4px; border: 1px solid var(--ns-blue);
  background: linear-gradient(180deg, #4a90c2 0%, var(--ns-blue) 100%);
  color: white; font-weight: 700; cursor: pointer;
  font-family: inherit; font-size: 12.5px;
  transition: all 0.12s;
}
.ns-actions-confirm-ok:hover {
  background: linear-gradient(180deg, #5aa0d2 0%, #00497a 100%);
  box-shadow: 0 4px 12px rgba(0,60,100,0.25);
}

/* "More Actions" dropdown · used by ns-actions.js */
button.ns-btn[data-actions]::after { content: ' ▾'; font-size: 9px; opacity: 0.7; }
button.ns-btn[data-actions].actions-open {
  background: linear-gradient(180deg, #4a90c2 0%, #003c64 100%) !important;
  color: white !important; border-color: var(--ns-blue) !important;
}
.ns-actions-backdrop {
  position: fixed; inset: 0; z-index: 950; background: transparent;
  pointer-events: auto;
}
.ns-actions-dropdown {
  position: absolute; min-width: 280px; max-width: 360px;
  background: white; border: 1px solid var(--ns-border-strong);
  border-top: 3px solid var(--ns-blue);
  border-radius: 0 0 6px 6px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.18);
  padding: 4px 0;
  font-size: 12.5px;
  animation: actionsIn 0.12s ease-out;
}
@keyframes actionsIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.ns-actions-item {
  display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: center;
  padding: 8px 14px; cursor: pointer; color: var(--ns-text);
  text-decoration: none; transition: background 0.1s;
}
.ns-actions-item:hover { background: var(--ns-blue-light); color: var(--ns-blue); }
.ns-actions-item .actions-icon { font-size: 14px; text-align: center; }
.ns-actions-item .actions-label { font-weight: 500; }
.ns-actions-item .actions-shortcut {
  font-family: ui-monospace, monospace; font-size: 10.5px;
  color: var(--ns-text-muted); padding: 1px 6px;
  background: #f1f5f9; border: 1px solid var(--ns-border);
  border-radius: 3px;
}
.ns-actions-divider {
  height: 1px; background: var(--ns-border); margin: 4px 0;
}

/* PO / Bill detail modal · shared across procurement + financials */
.po-modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 28, 50, 0.72);
  display: none; align-items: flex-start; justify-content: center;
  z-index: 1000; padding: 32px 16px; overflow-y: auto;
  backdrop-filter: blur(2px);
}
.po-modal-backdrop.open { display: flex; }
.po-modal {
  background: white; width: 100%; max-width: 880px;
  border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,0.45);
  overflow: hidden; animation: poDetailIn 0.18s ease-out;
}
@keyframes poDetailIn { from { transform: translateY(-12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.po-modal .po-detail-head {
  padding: 16px 22px; border-bottom: 1px solid var(--ns-border);
  background: linear-gradient(135deg, #003c64 0%, #4ea8ff 100%);
  color: white; display: flex; align-items: center; gap: 14px;
}
.po-modal .po-detail-head.bill { background: linear-gradient(135deg, #b45309 0%, #f59e0b 100%); }
.po-modal .po-detail-head .po-icon {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,0.2); border: 2px solid rgba(255,255,255,0.45);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; flex-shrink: 0;
}
.po-modal .po-detail-head .titles { flex: 1; }
.po-modal .po-detail-head .eyebrow { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; font-weight: 600; }
.po-modal .po-detail-head h3 { font-size: 19px; font-weight: 700; margin-top: 2px; }
.po-modal .po-detail-head .subtitle { font-size: 12px; opacity: 0.92; margin-top: 3px; }
.po-modal .po-detail-head .close-x {
  width: 34px; height: 34px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.18); color: white; cursor: pointer;
  font-size: 17px; transition: background 0.12s;
}
.po-modal .po-detail-head .close-x:hover { background: rgba(255,255,255,0.32); }
.po-modal .po-detail-body { padding: 18px 22px; max-height: calc(100vh - 220px); overflow-y: auto; }
.po-modal .po-detail-body h4 {
  font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ns-text-muted); font-weight: 700; margin-bottom: 6px; margin-top: 16px;
}
.po-modal .po-detail-body h4:first-child { margin-top: 0; }
.po-modal .po-detail-body .grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.po-modal .po-detail-body .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.po-modal .po-detail-body .info-block {
  background: #f8fafc; border: 1px solid var(--ns-border); border-radius: 4px;
  padding: 8px 10px;
}
.po-modal .po-detail-body .info-block .label { font-size: 9.5px; color: var(--ns-text-muted); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; }
.po-modal .po-detail-body .info-block .val { font-size: 12.5px; font-weight: 700; color: var(--ns-text); margin-top: 3px; }
.po-modal .po-detail-body .info-block .val.mono { font-family: ui-monospace, monospace; font-size: 11.5px; color: var(--ns-blue); }
.po-modal .po-detail-body .info-block .val.money { color: var(--ns-success); }
.po-modal .po-detail-body table.po-lines {
  width: 100%; border-collapse: collapse; font-size: 11.5px;
  background: white; border: 1px solid var(--ns-border); border-radius: 4px; overflow: hidden;
}
.po-modal .po-detail-body table.po-lines th { background: #f1f5f9; padding: 6px 10px; text-align: left; font-size: 10px; font-weight: 700; color: var(--ns-text-muted); letter-spacing: 0.04em; text-transform: uppercase; border-bottom: 1px solid var(--ns-border); }
.po-modal .po-detail-body table.po-lines td { padding: 6px 10px; border-bottom: 1px solid #f0f4f8; }
.po-modal .po-detail-body table.po-lines tr:last-child td { border-bottom: none; }
.po-modal .po-detail-body .three-way {
  background: #ecfdf5; border: 2px solid #86efac; border-radius: 4px;
  padding: 12px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px;
}
.po-modal .po-detail-body .three-way .col {
  background: white; padding: 8px 10px; border-radius: 4px; border: 1px solid #d1fae5;
}
.po-modal .po-detail-body .three-way .col .label { font-size: 9.5px; color: var(--ns-text-muted); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; }
.po-modal .po-detail-body .three-way .col .val { font-size: 12px; font-weight: 700; margin-top: 3px; font-family: ui-monospace, monospace; color: var(--ns-blue); }
.po-modal .po-detail-foot {
  padding: 12px 22px; background: #f8fafc; border-top: 1px solid var(--ns-border);
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.po-modal .po-detail-foot a, .po-modal .po-detail-foot button {
  padding: 6px 14px; font-size: 12px; font-weight: 600; border-radius: 4px;
  text-decoration: none; cursor: pointer; border: 1px solid var(--ns-border-strong);
  background: white; color: var(--ns-link); font-family: inherit;
}
.po-modal .po-detail-foot a:hover, .po-modal .po-detail-foot button:hover { background: var(--ns-blue); color: white; border-color: var(--ns-blue); }
.po-modal .po-detail-foot button.primary { background: var(--ns-blue); color: white; border-color: var(--ns-blue); }
.po-modal .po-detail-foot button.primary:hover { background: #00497a; }

/* Edit Mode toggle · used by ns-editable.js */
#edit-mode-wrapper {
  position: fixed; bottom: 18px; right: 18px; z-index: 900;
  display: flex; align-items: center; gap: 8px;
  background: white; padding: 6px 8px; border: 1px solid #cbd5e1;
  border-radius: 999px; box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  font-size: 12px;
}
#edit-mode-toggle {
  background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
  border: 1px solid #94a3b8; color: #1e293b; cursor: pointer;
  padding: 5px 12px; border-radius: 999px; font-weight: 600; font-size: 11.5px;
  font-family: inherit; transition: all 0.15s;
}
#edit-mode-toggle:hover { background: linear-gradient(180deg, #e0f2fe 0%, #bae6fd 100%); border-color: #0284c7; }
#edit-mode-toggle .em-state { font-size: 10px; padding: 1px 6px; background: #cbd5e1; color: #1e293b; border-radius: 8px; margin-left: 4px; letter-spacing: 0.04em; }
body.edit-mode #edit-mode-toggle { background: linear-gradient(180deg, #34d399 0%, #059669 100%); border-color: #047857; color: white; }
body.edit-mode #edit-mode-toggle .em-state { background: rgba(255,255,255,0.25); color: white; }
#edit-mode-status { font-size: 11px; color: #64748b; padding: 0 4px; min-width: 0; }
#edit-mode-reset {
  background: white; border: 1px solid #cbd5e1; color: #64748b; cursor: pointer;
  padding: 5px 10px; border-radius: 999px; font-weight: 500; font-size: 11px;
  font-family: inherit; transition: all 0.15s;
}
#edit-mode-reset:hover { background: #fef2f2; border-color: #f87171; color: #b91c1c; }

/* Edit-mode active state · highlights all editable fields */
body.edit-mode [contenteditable="true"] {
  outline: 1px dashed #4ea8ff;
  outline-offset: 2px;
  background: rgba(78,168,255,0.04);
  cursor: text;
  transition: all 0.1s;
  min-width: 30px; display: inline-block; padding: 1px 3px;
  border-radius: 2px;
}
body.edit-mode [contenteditable="true"]:hover {
  outline-color: #2563eb; background: rgba(78,168,255,0.10);
}
body.edit-mode [contenteditable="true"]:focus {
  outline: 2px solid #2563eb; background: white;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
/* In edit mode · disable navigation on links so user can edit text inside them */
body.edit-mode a { pointer-events: none; }
body.edit-mode a [contenteditable="true"] { pointer-events: auto; }
body.edit-mode .ns-menu a { pointer-events: none; }

/* Always show the edited indicator (even outside edit mode) */
.field-edited {
  position: relative;
  background: rgba(212,167,103,0.10);
  border-bottom: 1px dotted #d4a867 !important;
}
.field-edited::after {
  content: '✎';
  position: absolute; top: -2px; right: -10px;
  font-size: 9px; color: #d4a867; font-weight: 700;
  pointer-events: none;
}

/* Top-nav dropdown menus · used by ns-menu.js */
.ns-menu a[data-menu] { position: relative; }
.ns-menu a[data-menu].menu-open {
  background: rgba(255,255,255,0.18) !important;
  box-shadow: inset 0 -2px 0 #4ea8ff;
}
.ns-menu a[data-menu]::after {
  content: '▾'; font-size: 8.5px; margin-left: 5px; opacity: 0.65;
}
.ns-menu-backdrop {
  position: fixed; inset: 0; z-index: 800;
  background: transparent;
  pointer-events: auto;
}
.ns-menu-dropdown {
  position: absolute;
  background: white; border: 1px solid var(--ns-border-strong);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  display: grid; gap: 0;
  padding: 14px 18px;
  font-size: 12px; color: var(--ns-text);
  min-width: 240px;
  max-width: calc(100vw - 40px);
  border-radius: 0 0 4px 4px;
  border-top: 3px solid var(--ns-blue);
  animation: menuIn 0.12s ease-out;
}
@keyframes menuIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.ns-menu-col { padding: 0 12px; border-right: 1px solid #f0f0e8; }
.ns-menu-col:last-child { border-right: none; padding-right: 0; }
.ns-menu-col:first-child { padding-left: 0; }
.ns-menu-heading {
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ns-text-muted); font-weight: 700;
  padding-bottom: 6px; margin-bottom: 6px;
  border-bottom: 1px solid var(--ns-border);
}
.ns-menu-item {
  display: block; padding: 5px 8px; margin: 1px 0;
  color: var(--ns-link); text-decoration: none;
  font-size: 12px; font-weight: 500;
  border-radius: 3px;
  white-space: nowrap;
}
.ns-menu-item:hover { background: var(--ns-blue-light); color: var(--ns-blue); }
.ns-menu-item.inert {
  color: #b0b0a8; cursor: default; font-weight: 400;
}
.ns-menu-item.inert::after {
  content: '·'; opacity: 0;
}
.ns-menu-item.inert:hover { background: transparent; color: #b0b0a8; }

/* Tab panels · used by ns-tabs.js */
.tab-panel { display: none; animation: tabIn 0.15s ease-out; }
.tab-panel.active { display: block; }
@keyframes tabIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

.ns-tab[data-tab] { user-select: none; }
.ns-tab[data-tab]:hover { background: rgba(0,0,0,0.07); }

/* Empty / placeholder tab panel · shown for tabs with no dedicated content yet */
.tab-empty {
  background: #fafafa; border: 1px dashed var(--ns-border-strong);
  padding: 30px 24px; text-align: center; border-radius: 6px;
  color: var(--ns-text-muted); font-size: 12.5px; line-height: 1.6;
}
.tab-empty h3 { color: var(--ns-blue); font-size: 16px; margin-bottom: 8px; font-weight: 600; }
.tab-empty .deeplinks { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }

/* Module nav strip · cross-link to other NS module pages */
.module-strip {
  display: flex; gap: 6px; padding: 8px 22px; background: #f8f8f0;
  border-bottom: 1px solid var(--ns-border); font-size: 11px; flex-wrap: wrap;
  align-items: center;
}
.module-strip .label { color: var(--ns-text-muted); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; font-size: 10px; }
.module-strip a {
  padding: 3px 10px; background: white; border: 1px solid var(--ns-border);
  color: var(--ns-link); text-decoration: none; border-radius: 3px; font-weight: 500;
}
.module-strip a:hover { background: var(--ns-blue); color: white; border-color: var(--ns-blue); }
.module-strip a.current { background: var(--ns-blue); color: white; border-color: var(--ns-blue); }
