/* Shared palette and sticky shell. Journal v3 layout and controls stay intact. */
:root, html[data-theme] {
  color-scheme: light;
  --primary:#ad1525; --secondary:#8e1625; --accent:#fff;
  --body-bg:#fff; --body-fg:#30292b; --body-quiet-color:#66565a; --body-loud-color:#30292b;
  --header-bg:#fff; --header-color:#30292b; --header-branding-color:#ad1525; --header-link-color:#8e1625;
  --link-fg:#a51829; --link-hover-color:#74101d; --link-selected-fg:#74101d;
  --breadcrumbs-bg:#fbe4e6; --breadcrumbs-fg:#62464c; --breadcrumbs-link-fg:#8e1625;
  --button-bg:#b7192b; --button-hover-bg:#941021; --default-button-bg:#b7192b; --default-button-hover-bg:#941021;
  --darkened-bg:#fff1f2; --selected-bg:#fbe4e6; --selected-row:#fce8eb; --hairline-color:#edd9dd; --border-color:#dfc5cb;
  --noticode-shell-height:180px; scroll-padding-top:calc(var(--noticode-shell-height) + 16px);
}
body {background:#fff5f5} #container {overflow:visible;height:auto;min-height:100vh}
.noticode-fixed-shell {position:sticky;top:0;z-index:100;flex:0 0 auto;background:white;box-shadow:0 3px 12px #5c172218}
#header {gap:10px;padding:12px 24px 0;border-bottom:2px solid #d71920;background:white;color:#30292b}
#header .noticode-brand {display:flex;align-items:center;gap:12px;color:#a51829;text-decoration:none}
#header #site-name a:link,#header #site-name a:visited {color:#a51829}
.noticode-brand img {object-fit:contain;flex:0 0 auto}
.noticode-tagline {color:#66565a;font-size:12px}
#user-tools {color:#66565a}
#header #user-tools a,#header #user-tools button {color:#8e1625;border-color:#dfc5cb}
#header .noticode-workspace {padding:10px 0;border-top-color:#edd9dd}
#header a.noticode-console {padding:9px 14px;border-color:#d8a6af;color:#8e1625;background:#fff5f5}
#header a.noticode-console:hover {background:#fbe4e6}
.noticode-context {color:#30292b;gap:4px 12px}
.noticode-context-label {color:#66565a}
#header a:focus-visible,#header button:focus-visible,.noticode-table-scroll:focus-visible {outline:3px solid #ad1525;outline-offset:3px}
div.breadcrumbs {padding:9px 24px}
.module,.inline-group,#changelist .results,.submit-row {background:white}
.module h2,.module caption,.inline-group h2 {background:#fbe4e6;color:#652431}
.module caption a,.module caption a:link,.module caption a:visited {color:#8e1625}
.fiscal button {background:#b7192b}
.statements .context {border-left-color:#d71920}
.noticode-invoice-toolbar {background:#fff1f2;border-color:#edd9dd}
.noticode-table-scroll {overflow:auto;max-height:max(160px,calc(100dvh - var(--noticode-shell-height) - 64px));background:white;border:1px solid #edd9dd;border-radius:6px;margin:12px 0}
.noticode-table-scroll table {margin:0!important;width:100%}
.noticode-table-scroll thead {position:sticky;top:var(--noticode-head-offset,0px);z-index:2}
.noticode-table-scroll thead th {background:#fbe4e6!important;color:#652431;box-shadow:inset 0 -1px #d8a6af}
.noticode-table-scroll thead a {color:#8e1625!important}
.noticode-table-scroll tbody tr:hover {background:#fff5f5}
.noticode-table-scroll tbody tr.selected {background:#fce8eb}
body.noticode-dashboard {--ink:#30292b;--muted:#66565a;--line:#edd9dd;--blue:#a51829;background:#fff5f5}
.noticode-dashboard header {background:white;color:#30292b;border-bottom:2px solid #d71920}
.noticode-dashboard .top {padding:12px 28px}
.noticode-dashboard .top small {color:#66565a}
.noticode-dashboard .top a {color:#8e1625;border-color:#d8a6af}
.noticode-dashboard .top .brand {display:flex;align-items:center;gap:16px;border:0;padding:0}
.noticode-dashboard .brand img {width:240px;max-width:45vw;height:84px;object-fit:contain}
.noticode-dashboard .header-context {max-width:1224px;margin:auto;padding:10px 28px;background:#fff5f5;border-top:1px solid #edd9dd;display:flex;gap:16px;flex-wrap:wrap}
.noticode-dashboard .badge:not(.pending) {background:#fbe4e6;color:#8e1625}
.noticode-dashboard .new-company {display:inline-block;background:#b7192b;color:white;padding:8px 12px;border-radius:5px;text-decoration:none}
.noticode-dashboard .new-company {margin:4px 8px 4px 0}
.noticode-dashboard .new-company[hidden] {display:none}
.noticode-dashboard .new-company:hover {background:#941021}
@media(max-width:767px) {
 #header {padding:8px 14px 0} #site-name {font-size:17px}
 .noticode-brand img {width:32px;height:40px} #user-tools {gap:8px;font-size:10px}
 #header .noticode-workspace {gap:8px;padding:8px 0}
 .noticode-context-label,.noticode-tagline {display:none} div.breadcrumbs {padding:8px 14px}
 .noticode-dashboard .brand img {width:180px;height:60px}
 .noticode-dashboard .brand span {font-size:14px}
 .noticode-dashboard .header-context {padding:8px 16px;gap:4px 12px;font-size:13px}
}
/* Cabecera común: marca, contexto y accesos en una sola franja. */
#header {display:flex;align-items:center;justify-content:flex-start;flex-wrap:wrap;gap:16px;padding:10px 18px}
#header #branding {flex:0 0 auto;float:none}
#header #site-name {margin:0;font-size:21px;font-weight:750;letter-spacing:1px}
#header .noticode-tagline {display:block;font-size:12px;font-weight:400;letter-spacing:0}
#header .noticode-workspace {flex:1 1 700px;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px 18px;padding:0;border:0}
#header .noticode-context {display:flex;flex-direction:column;align-items:flex-start;gap:2px;font-size:13px;line-height:1.3;color:#30292b}
#header .noticode-context-label {flex:auto;font-size:11px;color:#66565a}
#header .noticode-shortcuts {display:flex;flex-wrap:wrap;gap:6px;align-items:center}
#header .noticode-shortcuts a,#header .noticode-shortcuts button {box-sizing:border-box;display:inline-block;margin:0;padding:8px 10px;border:1px solid #d8a6af;border-radius:5px;background:#fff5f5;color:#8e1625;font:600 12px/1.3 "Segoe UI",Arial,sans-serif;text-decoration:none;white-space:nowrap;cursor:pointer}
#header .noticode-shortcuts a:hover,#header .noticode-shortcuts button:hover {background:#fbe4e6}
.noticode-dashboard .configuration-logout {background:none;border:0;color:#a51829;padding:8px 0;font-weight:600;cursor:pointer}
@media(max-width:767px) {#header {gap:8px;padding:8px 12px} #header #site-name {font-size:17px} #header .noticode-workspace {flex-basis:100%} #header .noticode-context-label {display:none}}
@media print {
 .noticode-fixed-shell {display:none!important}
 .noticode-table-scroll {max-height:none!important;overflow:visible!important;border:0;margin:0}
 .noticode-table-scroll thead {position:static;display:table-header-group}
 .noticode-table-scroll thead th {background:#eee!important;color:black;box-shadow:none}
 body {background:white}
}

/* Pendientes junto al contexto, accesos auxiliares a la derecha. */
#header .noticode-workspace {justify-content:flex-start;gap:10px 14px}
#header .noticode-pending {display:flex;align-items:center;flex-wrap:wrap;gap:8px}
#header .noticode-pending a {display:inline-flex;align-items:center;gap:9px;padding:10px 12px;border:1px solid #c96c79;border-radius:5px;background:#fbe4e6;color:#8e1625;font:600 14px/1.3 "Segoe UI",Arial,sans-serif;text-decoration:none}
#header .noticode-pending strong {background:#b7192b;color:white;border-radius:4px;padding:3px 7px;font-size:15px}
#header .noticode-pending a:hover {background:#f7d1d6}
#header .noticode-shortcuts {margin-left:auto}

@media (min-width:1200px) and (max-width:1500px) {
 #header {gap:10px;padding-left:10px;padding-right:10px}
 #header .noticode-workspace {gap:8px}
 #header .noticode-pending {gap:5px;flex-wrap:nowrap}
 #header .noticode-pending a {gap:5px;padding:10px 7px;white-space:nowrap}
 #header .noticode-shortcuts {gap:4px}
 #header .noticode-shortcuts a,#header .noticode-shortcuts button {padding-left:6px;padding-right:6px}
}
