/* Full record pages: one reading surface, ordinary links and contextual return. */
:root {
  --sidebar-width: 224px;
  --bg: #f5f7f5;
  --surface: #fff;
  --ink: #21362e;
  --line: #dce4e0;
  --accent: #147d64;
  --accent-dark: #105d49;
  --radius: 8px;
}
html { scroll-padding-top: calc(var(--app-header-height, 0px) + 88px); }
.app-sidebar { background: #153d32; }
.app-header { background: #fff; backdrop-filter: none; }
.app-header .page-heading h1 { font-size: 28px; letter-spacing: -.5px; }
.app-header .page-heading > p:last-child { font-size: 13px; }
.app-main { max-width: 1600px; }
.app-main a[href^="#/"] { color: var(--accent-dark); text-underline-offset: 3px; }
.app-main a[href^="#/"]:hover { color: var(--accent); }
.app-sidebar a.nav-pill { text-decoration: none; }
.button, .inline-button { min-height: 42px; border-radius: 6px; font-size: 13px; }
.field input, .field select, .field textarea { min-height: 44px; border-radius: 6px; font-size: 14px; }
.field span { font-size: 13px; }
#assetDetailPanel, #vendorDetailPanel { border-radius: 6px; box-shadow: none; }
#assetDetailPanel .record-main, #vendorDetailPanel .record-main { gap: 22px; }
#assetDetailPanel .service-editor, #assetDetailPanel .document-editor,
#assetDetailPanel .asset-tab-panel, #assetDetailPanel .tab-grid { min-width: 0; }
#assetDetailPanel .service-editor, #assetDetailPanel .document-editor {
  padding: 0;
  border: 0;
  background: #fff;
  box-shadow: none;
}
#vendorDetailPanel > .record-detail-layout { display: flex; flex-direction: column; gap: 30px; }
#vendorDetailPanel > .record-detail-layout > .record-main { order: 0; width: 100%; }
#vendorDetailPanel > .record-detail-layout > .record-sidebar { order: 1; position: static; width: 100%; display: block; }
#vendorDetailPanel .record-main > .detail-header { display: none; }
#vendorDetailPanel .record-sidebar > .record-links-panel { padding: 0; border: 0; border-radius: 0; background: #fff; }
#vendorDetailPanel .record-links-panel > .compact-heading { display: none; }
#vendorUsageList { display: block; }
#vendorUsageList > section + section { margin-top: 28px; }
#vendorUsageList h3 { margin: 0 0 14px; font-size: 20px; }
#vendorUsageList .record-link-card { margin: 0; padding: 16px 0; border-width: 0 0 1px; border-radius: 0; background: #fff; }
#vendorUsageList .record-link-card strong { font-size: 15px; }
#vendorUsageList .record-link-card p { font-size: 13px; }
#assetBackBtn, #vendorBackBtn {
  justify-content: flex-start;
  min-height: 40px;
  border: 0;
  padding: 4px 0;
  background: transparent;
  color: var(--accent-dark);
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 14px;
}
#assetBackBtn:hover, #vendorBackBtn:hover { color: var(--accent); box-shadow: none; }
.detail-toolbar { align-items: center; }
#assetDetailContent .detail-toolbar, #vendorDetailPanel > .detail-toolbar {
  gap: 4px 18px;
  margin-bottom: 10px;
  padding-bottom: 8px;
}
.detail-toolbar-actions { min-width: 0; }
#assetPathText, #vendorPathText { font-size: 11px; letter-spacing: .025em; }
.record-page-nav .tab-bar { gap: 4px; }
.record-page-nav a.tab-pill { text-decoration: none; }
.record-page-nav .tab-pill { font-size: 13px; min-height: 44px; }
.record-page-nav { min-width: 0; max-width: 100%; margin-bottom: 18px; }
#assetTabBar { min-width: 0; max-width: 100%; }
#assetTabBar .tab-pill:focus-visible { outline: 3px solid #299478; outline-offset: -3px; }
.record-focused #assetDetailPanel .record-main,
.record-editing #assetDetailPanel .record-main { gap: 16px; }
.record-focused #assetDetailContent > .detail-header,
.record-editing #assetDetailContent > .detail-header { margin-bottom: 10px; }
.record-context { width: 100%; min-width: 0; color: var(--muted); }
.record-context > summary {
  width: fit-content;
  min-height: 40px;
  padding: 10px 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 550;
  color: var(--accent-dark);
}
.record-context[open] > summary { margin-bottom: 4px; }
body:not(.record-focused):not(.record-editing) .record-context > summary { display: none; }
.record-context .badge-row { gap: 6px; padding-bottom: 8px; }
.record-context > summary:focus-visible { outline: 3px solid #299478; outline-offset: 2px; }

/* Optional information stays in the record without dominating its first screen. */
.record-optional {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.record-optional + .record-optional { border-top: 0; }
.record-optional > summary {
  min-height: 48px;
  padding: 15px 0;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.record-optional[open] > summary { padding-bottom: 18px; }
.record-optional > .form-grid,
.record-optional > .subpanel,
.record-optional > .spare-stack { margin: 0 0 20px; }
.record-optional > .subpanel { padding: 0; border: 0; background: transparent; }
.record-form-section-title { margin: 0; font-size: 17px; line-height: 1.4; }
.record-form-guidance { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.record-required-marker { color: #a52b22; font-weight: 650; }
.record-field-hint { color: var(--muted); font-size: 12px; line-height: 1.5; font-weight: 400; }
#serviceForm > .subpanel { padding: 20px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
#serviceForm > .form-grid { gap: 18px 24px; }
#serviceForm > .subpanel .section-heading { margin-bottom: 14px; }
.record-table { width: 100%; border-collapse: collapse; table-layout: auto; background: #fff; }
.record-table caption { text-align: left; padding: 0 0 14px; font-size: 20px; font-weight: 650; }
.record-table th { padding: 13px 12px; background: #edf2ef; color: var(--ink); font-size: 13px; letter-spacing: 0; text-transform: none; font-weight: 600; text-align: left; white-space: normal; }
.record-table td { padding: 16px 12px; font-size: 14px; line-height: 1.5; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.record-table tbody tr:hover { background: #f6faf7; }
.record-table a { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; font-weight: 550; }
.record-table .record-table-amount { white-space: nowrap; }
.record-table td:first-child, .record-table th:first-child { padding-left: 12px; }
.record-table-wrap { min-width: 0; max-width: 100%; overflow-x: auto; }
.record-table-empty { color: var(--muted); padding: 16px 0; }
.record-return-link, .record-breadcrumb a { text-decoration: underline; text-underline-offset: 3px; }
.record-breadcrumb { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.record-feedback { padding: 12px 14px; border-left: 3px solid var(--accent); background: #edf5f0; }
.record-form-errors { padding: 14px 16px; border: 1px solid #c44732; border-radius: 6px; background: #fff6f4; color: #8d291d; }
.record-form-errors a { color: inherit; }
.record-field-error { margin: 0; color: #9b3023; font-size: 13px; }
[aria-invalid="true"] { border-color: #b83a28 !important; }
@media (max-width: 1000px) {
  .record-table th, .record-table td { padding: 12px 8px; }
  .app-header .page-heading h1 { font-size: 25px; }
}
@media (max-width: 760px) {
  .app-shell { margin-left: 0; }
  .app-sidebar { width: 260px; }
  .app-header .page-heading h1 { font-size: 22px; }
  .app-header .page-heading > p:last-child { font-size: 12px; }
  .app-main { padding: 16px 12px 30px; }
  #assetDetailPanel, #vendorDetailPanel { padding: 18px 16px; }
  .field input, .field select, .field textarea { font-size: 16px; }
  #vendorUsageList h3 { font-size: 18px; }
  .record-focused .app-header, .record-editing .app-header { padding-top: 12px; padding-bottom: 12px; }
  #assetTabBar {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: #93afa2 #edf2ef;
    scroll-padding-inline: 4px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  #assetTabBar .tab-pill { flex: 0 0 auto; white-space: nowrap; }
  #assetTabBar::-webkit-scrollbar { height: 4px; }
  #assetTabBar::-webkit-scrollbar-thumb { background: #93afa2; border-radius: 4px; }
  #assetTabBar::-webkit-scrollbar-track { background: #edf2ef; }
  .record-page-nav { margin-bottom: 16px; }
  #assetPathText, #vendorPathText { line-height: 1.5; overflow-wrap: anywhere; }
  #assetDetailContent .detail-toolbar, #vendorDetailPanel > .detail-toolbar { align-items: flex-start; gap: 2px; }
  .record-optional > summary { min-height: 48px; }
  #serviceForm > .form-grid { gap: 16px; }
}
@media (max-width: 600px) {
  /* Labelled mobile rows preserve every column instead of hiding information. */
  .record-table:has(td[data-label]) thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
  .record-table:has(td[data-label]), .record-table:has(td[data-label]) tbody { display: block; }
  .record-table:has(td[data-label]) tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .record-table:has(td[data-label]) td { display: grid; grid-template-columns: minmax(90px, .8fr) minmax(0, 1.4fr); gap: 12px; padding: 6px 0; border: 0; }
  .record-table td[data-label]::before { content: attr(data-label); color: var(--muted); font-weight: 500; font-size: 12px; }
  .record-table:has(td[data-label]) td:empty { display: none; }
  .record-table-wrap { overflow: visible; }
  .record-page-nav .tab-pill { padding: 10px 12px; }
  .record-actions .button { min-height: 44px; }
}
@media (max-height: 500px) {
  .app-header { position: static; }
  html { scroll-padding-top: 84px; }
}
@media print {
  #assetBackBtn, #vendorBackBtn, .record-page-nav { display: none; }
  .record-table th, .record-table td { color: #000; }
}
a.directory-entry { display:block; color:inherit !important; text-decoration:none; }
.provider-create { justify-self:start; min-height:36px; margin-top:4px; }
/* Compact vendor facts leave connected records close to the record heading. */
#vendorDetailPanel .record-values { gap: 0 28px; }
#vendorDetailPanel .record-value { display: grid; grid-template-columns: minmax(90px, 110px) minmax(0, 1fr); gap: 12px; padding: 9px 0; align-items: start; }
#vendorDetailPanel .record-value dt { margin: 0; font-size: 13px; line-height: 1.55; }
#vendorDetailPanel .record-value dd { font-size: 14px; }
#vendorDetailPanel .record-section-header { padding-bottom: 12px; }
#vendorDetailPanel > .record-detail-layout { gap: 24px; }
#vendorUsageList h2, #vendorUsageList h3 { font-size: 19px; margin: 0 0 12px; }
#vendorUsageList .record-connection-list { list-style: none; margin: 0; padding: 0; }
#vendorUsageList .record-connection-list > li { display: flex; justify-content: space-between; gap: 18px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
#vendorUsageList .record-connection-list > li > span { color: var(--muted); font-size: 13px; }
#vendorUsageList .record-connection-list p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
#workflowQueue { padding: 0; border: 0; border-radius: 0; background: #fff; }
#workflowQueue .workflow-row { border-radius: 0; box-shadow: none; }
@media (max-width: 600px) {
  #vendorDetailPanel .record-value { grid-template-columns: minmax(85px, .8fr) minmax(0, 1.4fr); }
  #vendorUsageList .record-connection-list > li { flex-wrap: wrap; gap: 6px; }
}
