/* NOVEL ERP P7.2 — one visual system across completed modules.
 * This file is intentionally loaded LAST. It standardizes the shared shell and
 * controls while leaving module-specific information architecture/flows intact. */
:root {
  --nu-primary:#0B6BD3;
  --nu-primary-hover:#085CB8;
  --nu-action:#0AAF6B;
  --nu-action-hover:#08945B;
  --nu-danger:#D94A52;
  --nu-danger-hover:#BE353D;
  --nu-bg:#E8EEF4;
  --nu-panel:#FFFFFF;
  --nu-panel-soft:#F7F9FC;
  --nu-border:#D5DFEA;
  --nu-border-strong:#C4D0DD;
  --nu-text:#27354D;
  --nu-muted:#66758D;
  --nu-sidebar:#F7F9FC;
  --nu-sidebar-text:#30477F;
  --nu-topbar:#0756C9;
  --nu-topbar-text:#FFFFFF;
  --nu-control-h:38px;
  --nu-radius:2px;
  --nu-shadow:0 1px 2px rgba(31,48,70,.05);
  --nu-focus:0 0 0 3px rgba(11,107,211,.16);
}

html, body { font-family:Arial,Tahoma,"Segoe UI",sans-serif; }
body.gl-shell-v1.novel-system-ui {
  --bg:var(--nu-bg); --panel:var(--nu-panel); --panel-alt:var(--nu-panel-soft);
  --line:var(--nu-border); --text:var(--nu-text); --muted:var(--nu-muted);
  --link:var(--nu-primary); --accent:var(--nu-primary); --secondary:var(--nu-action);
  --secondary-foreground:#fff; --accent-foreground:#fff;
  --topbar-color:var(--nu-topbar); --topbar-foreground:var(--nu-topbar-text);
  --sidebar-color:var(--nu-sidebar); --sidebar-foreground:var(--nu-sidebar-text);
  --theme-nav-text:var(--nu-sidebar-text); --theme-btn-text:#fff;
  --gl-shell-accent:var(--nu-primary); --gl-shell-topbar:var(--nu-topbar);
  --gl-shell-topbar-text:var(--nu-topbar-text); --gl-shell-bg:var(--nu-bg);
  --gl-shell-panel:var(--nu-panel); --gl-shell-text:var(--nu-text);
  --gl-shell-muted:var(--nu-muted); --gl-shell-nav-bg:var(--nu-sidebar);
  --gl-shell-nav-text:var(--nu-sidebar-text); --gl-border:var(--nu-border);
  color-scheme:light!important;background:var(--nu-bg)!important;color:var(--nu-text)!important;
  font-size:13px;
}
body.gl-shell-v1.novel-system-ui.theme-dark { color-scheme:light!important; }

/* Shared application chrome */
body.gl-shell-v1.novel-system-ui :is(.gl-topbar,.topbar) {
  background:var(--nu-topbar)!important;color:var(--nu-topbar-text)!important;
  border-color:transparent!important;box-shadow:none!important;
}
body.gl-shell-v1.novel-system-ui :is(.gl-navigation,.sidebar,.main-navigation,.settings-links) {
  background:var(--nu-sidebar)!important;color:var(--nu-sidebar-text)!important;
  border-color:var(--nu-border)!important;
}
body.gl-shell-v1.novel-system-ui :is(.gl-sidebar-brand,.sidebar-brand) {
  background:var(--nu-panel)!important;color:var(--nu-text)!important;border-color:var(--nu-border)!important;
}
body.gl-shell-v1.novel-system-ui :is(.gl-nav-group,.workspace-group,.gl-nav-link,.gl-nav-heading,.nav-item,.main-nav-item) {
  border-color:#E5EBF2!important;color:var(--nu-sidebar-text)!important;
}
body.gl-shell-v1.novel-system-ui :is(.gl-nav-link:hover,.gl-nav-heading:hover,.gl-nav-link[aria-current="page"],.nav-item:hover,.nav-item.active,.main-nav-item:hover) {
  background:#EDF4FC!important;color:var(--nu-primary)!important;
}
body.gl-shell-v1.novel-system-ui :is(.page-toolbar,.gl-page-spacer) {
  background:var(--nu-panel)!important;color:var(--nu-text)!important;border-color:var(--nu-border)!important;
  box-shadow:none!important;
}
body.gl-shell-v1.novel-system-ui :is(.content,.accounting-content,.gl-hub-main) {
  background:var(--nu-bg)!important;color:var(--nu-text)!important;
}

/* Forms: one geometry and one state model */
body.gl-shell-v1.novel-system-ui :is(input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]),select,.select,.input) {
  height:var(--nu-control-h)!important;min-height:var(--nu-control-h)!important;
  border:1px solid var(--nu-border)!important;border-radius:var(--nu-radius)!important;
  background:var(--nu-panel)!important;color:var(--nu-text)!important;
  padding:7px 10px!important;font:inherit!important;box-shadow:none!important;
}
body.gl-shell-v1.novel-system-ui textarea,
body.gl-shell-v1.novel-system-ui textarea.input {
  min-height:84px!important;border:1px solid var(--nu-border)!important;border-radius:var(--nu-radius)!important;
  background:var(--nu-panel)!important;color:var(--nu-text)!important;padding:8px 10px!important;font:inherit!important;
}
body.gl-shell-v1.novel-system-ui :is(input,select,textarea,.nui-select-trigger):focus,
body.gl-shell-v1.novel-system-ui :is(input,select,textarea,.nui-select-trigger):focus-visible {
  border-color:var(--nu-primary)!important;outline:0!important;box-shadow:var(--nu-focus)!important;
}
body.gl-shell-v1.novel-system-ui :is(input,textarea)::placeholder { color:#8A98AA!important;opacity:1; }
body.gl-shell-v1.novel-system-ui :is(input,select,textarea):disabled,
body.gl-shell-v1.novel-system-ui :is(input,select,textarea)[readonly] {
  background:#F2F5F8!important;color:#758397!important;opacity:1!important;
}
body.gl-shell-v1.novel-system-ui :is(input[type=checkbox],input[type=radio]) { accent-color:var(--nu-primary)!important; }
body.gl-shell-v1.novel-system-ui .nui-select-trigger {
  min-height:var(--nu-control-h)!important;border:1px solid var(--nu-border)!important;border-radius:var(--nu-radius)!important;
  background:var(--nu-panel)!important;color:var(--nu-text)!important;box-shadow:none!important;font:inherit!important;
}
body.gl-shell-v1.novel-system-ui .nui-select-popup {
  border:1px solid var(--nu-border-strong)!important;border-radius:var(--nu-radius)!important;background:#fff!important;
  color:var(--nu-text)!important;box-shadow:0 8px 24px rgba(31,48,70,.14)!important;
}
body.gl-shell-v1.novel-system-ui .nui-select-popup :is(button,[role=option]):is(:hover,.is-focused,[aria-selected=true]) {
  background:#EDF4FC!important;color:var(--nu-primary)!important;
}

/* All ordinary action buttons use the same height, corners and typography. */
body.gl-shell-v1.novel-system-ui :is(.btn,.fv-btn,.ft-btn,.fc-button,.ch-btn) {
  min-height:36px!important;height:auto!important;border-radius:var(--nu-radius)!important;
  padding:7px 13px!important;font:600 12px/1.5 Arial,Tahoma,"Segoe UI",sans-serif!important;
  box-shadow:none!important;text-decoration:none!important;transition:background-color .12s,border-color .12s,color .12s!important;
}
body.gl-shell-v1.novel-system-ui :is(.btn-primary,.fv-btn-primary,.fv-primary,.ft-btn-primary,.ft-primary,.ft-blue,.ft-green,.fc-button:not(.fc-light):not(.fc-danger),.fc-button.fc-green,.ch-btn-green,.ch-btn:not(.ch-btn-outline):not(.ch-btn-danger):not(.ch-btn-orange)) {
  background:var(--nu-action)!important;border-color:var(--nu-action)!important;color:#fff!important;
}
body.gl-shell-v1.novel-system-ui :is(.btn-primary,.fv-btn-primary,.fv-primary,.ft-btn-primary,.ft-primary,.ft-blue,.ft-green,.fc-button:not(.fc-light):not(.fc-danger),.fc-button.fc-green,.ch-btn-green,.ch-btn:not(.ch-btn-outline):not(.ch-btn-danger):not(.ch-btn-orange)):hover {
  background:var(--nu-action-hover)!important;border-color:var(--nu-action-hover)!important;
}
body.gl-shell-v1.novel-system-ui :is(.btn-secondary,.fv-btn-secondary,.ft-btn-secondary) {
  background:var(--nu-primary)!important;border-color:var(--nu-primary)!important;color:#fff!important;
}
body.gl-shell-v1.novel-system-ui :is(.btn-outline,.fv-btn-light,.fv-light,.ft-btn-light,.ft-light,.fc-light,.ch-btn-outline) {
  background:#fff!important;border-color:var(--nu-border-strong)!important;color:#42566F!important;
}
body.gl-shell-v1.novel-system-ui :is(.btn-danger,.fv-btn-danger,.fv-danger,.ft-btn-danger,.ft-danger,.fc-danger,.ch-btn-danger) {
  background:#fff!important;border-color:#E3A3A7!important;color:#B4232B!important;
}
body.gl-shell-v1.novel-system-ui :is(.btn-danger,.fv-btn-danger,.fv-danger,.ft-btn-danger,.ft-danger,.fc-danger,.ch-btn-danger):hover {
  background:#FFF1F2!important;border-color:var(--nu-danger)!important;color:#A31D25!important;
}
body.gl-shell-v1.novel-system-ui :is(.btn,.fv-btn,.ft-btn,.fc-button,.ch-btn):focus-visible {
  outline:0!important;box-shadow:var(--nu-focus)!important;
}
body.gl-shell-v1.novel-system-ui :is(.btn,.fv-btn,.ft-btn,.fc-button,.ch-btn):disabled { opacity:.5!important;cursor:not-allowed!important; }

/* Preserve compact contextual action bars, but use the same palette. */
body.gl-shell-v1.novel-system-ui .ch-reference-actionbar .ch-btn {
  min-height:30px!important;padding:4px 9px!important;font-weight:500!important;
  background:#fff!important;border-color:var(--nu-border)!important;color:#506782!important;
}
body.gl-shell-v1.novel-system-ui .ch-filter-actions .ch-btn {
  min-height:32px!important;background:#E8F1FA!important;border-color:#D4E2F0!important;color:#355B7E!important;
}

/* Panels/cards */
body.gl-shell-v1.novel-system-ui :is(.card,.settings-card,.settings-panel,.page-panel,.p2-panel,.p3-panel,.fv-wrapper,.fv-form-wrapper,.ft-panel,.ft-card,.fc-panel,.ch-card,.ch-reference-grid,.ch-book-reference-grid,.ch-record-tabs,dialog) {
  background:var(--nu-panel)!important;color:var(--nu-text)!important;border-color:var(--nu-border)!important;
  border-radius:var(--nu-radius)!important;box-shadow:var(--nu-shadow)!important;
}
body.gl-shell-v1.novel-system-ui :is(.help,.muted,.p2-help,.p2-intro,.fv-help,.ft-help,.fc-muted,.ch-muted) { color:var(--nu-muted)!important; }

/* Tables: same header, spacing, lines and hover everywhere. */
body.gl-shell-v1.novel-system-ui :is(.table,.data-table,.p2-table,.p3-panel table,.fv-table,.ft-table,.fc-table,.ch-table,table) {
  width:100%;border-collapse:collapse!important;background:#fff;color:var(--nu-text)!important;border-color:var(--nu-border)!important;
}
body.gl-shell-v1.novel-system-ui :is(table thead,.table thead,.data-table thead,.fv-table thead,.ft-table thead,.fc-table thead,.ch-table thead) {
  background:#EDF3F8!important;color:#53677F!important;
}
body.gl-shell-v1.novel-system-ui :is(table th,table td,.table th,.table td,.data-table th,.data-table td) {
  border-color:var(--nu-border)!important;padding:9px 11px!important;vertical-align:middle;color:inherit;
}
body.gl-shell-v1.novel-system-ui :is(table th,.table th,.data-table th) { font-size:12px;font-weight:500!important;color:#60748C!important; }
body.gl-shell-v1.novel-system-ui :is(table tbody tr:hover,.table tbody tr:hover,.data-table tbody tr:hover) { background:#F7FAFD!important; }

/* Notices and statuses use semantic colors, not module-specific palettes. */
body.gl-shell-v1.novel-system-ui .flash { background:#ECFDF3!important;border-color:#A7E7C2!important;color:#176B45!important; }
body.gl-shell-v1.novel-system-ui .error-list { background:#FFF1F2!important;border-color:#F1B6BA!important;color:#9F2630!important; }
body.gl-shell-v1.novel-system-ui :is(.notice,.readonly-notice) { background:#F7F9FC!important;border-color:var(--nu-border)!important;color:#596B80!important; }
body.gl-shell-v1.novel-system-ui :is(.switch input:checked + .slider,.p2-toggle-control input:checked + .p2-toggle-track) { background:var(--nu-action)!important; }

/* Settings reference CSS keeps its measured geometry only. */
body.gl-shell-v1.novel-system-ui.reference-settings-original {
  color-scheme:light!important;
}
body.gl-shell-v1.novel-system-ui.reference-settings-original .secondary-nav {
  background:#fff!important;border-color:var(--nu-border)!important;
}
body.gl-shell-v1.novel-system-ui.reference-settings-original .settings-tab {
  color:var(--nu-muted)!important;border-color:#E4EAF1!important;
}
body.gl-shell-v1.novel-system-ui.reference-settings-original .settings-tab.active {
  background:#EDF4FC!important;color:var(--nu-primary)!important;box-shadow:inset 3px 0 var(--nu-primary)!important;
}

/* Auth retains its dedicated composition but shares product typography/control language. */
body.auth-body.novel-system-ui { background:var(--nu-bg);color:var(--nu-text);font-family:Arial,Tahoma,"Segoe UI",sans-serif; }
body.auth-body.novel-system-ui :is(input,select,textarea) { border-radius:var(--nu-radius)!important;border-color:var(--nu-border)!important; }
body.auth-body.novel-system-ui :is(button,.button,.btn) { border-radius:var(--nu-radius)!important; }

@media (max-width:800px) {
  body.gl-shell-v1.novel-system-ui :is(input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]),select,.select,.input,.nui-select-trigger) { min-height:40px!important;height:40px!important; }
  body.gl-shell-v1.novel-system-ui :is(.btn,.fv-btn,.ft-btn,.fc-button,.ch-btn) { min-height:38px!important;padding:7px 10px!important; }
}
