/*
  Sacco Master - Estex Systems theme overlay
  Estex Systems UI Standard v1.1 (9 Nov 2026), applied to the legacy Innova/NOVA WAR without touching
  its own stylesheets. Linked LAST, immediately before </head> in sys/views/header.jsp, so it wins the
  cascade by document order rather than by weight; !important appears only where the shipped pages carry
  inline styles (header.jsp writes `background-color:#5ca5cc` into .modal-header itself).

  Deviation recorded under section 12 (needs product-owner sign-off): the standard names Poppins for
  headings. Poppins is not present in the Estex asset library and must not be loaded from a CDN, so the
  bundled Plus Jakarta Sans stands in; the declared stack still prefers Poppins if a client machine has
  it installed locally. Body is Inter, as specified.
*/

:root {
  --navy-900: #0B1F3A;
  --navy-700: #13325C;
  --gold-500: #C9A24B;
  --gold-700: #8A6A1F;
  --gold-200: #E8D3A0;
  --bg: #F8F5EE;
  --surface: #FFFFFF;
  --border: #E3DCCB;
  --text: #1D2733;
  --text-muted: #5B6673;
  --ok-bg: #E3F1E6; --ok-fg: #1E6B3A;
  --warn-bg: #FBEFD2; --warn-fg: #7A5A00;
  --err-bg: #FADBD8; --err-fg: #9B2C22;
  --radius-control: 8px;
  --radius-card: 10px;
  --shadow-1: 0 2px 4px rgba(11, 31, 58, 0.05);
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-head: "Poppins", "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
}

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-var.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../fonts/plus-jakarta-sans-latin-var.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

/* ---- base ---- */
html, body {
  background: var(--bg) !important;
  color: var(--text);
  /* The shipped header sets font-size:75% (12px), below the 14px minimum. */
  font-size: 87.5%;
  font-family: var(--font-body) !important;
}
h1, h2, h3, h4, h5, .title, .systitle { font-family: var(--font-head); color: var(--navy-900); }
a { color: var(--gold-700); }
a:hover, a:focus { color: var(--navy-700); }
hr.hrseparator { border-color: var(--border); }
td, th, label, input, select, textarea, button { font-family: var(--font-body); }
label.colred, .coldarkred { color: var(--err-fg); }

/* ---- product identity bar (injected by scripts/brand-estex.sh) ---- */
.estex-topbar {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 8px 16px;
  background: var(--navy-900); color: var(--gold-200);
  border-bottom: 3px solid var(--gold-500);
}
.estex-topbar .estex-name {
  font-family: var(--font-head); font-weight: 700; font-size: 19px;
  color: #FFFFFF; letter-spacing: .2px;
}
.estex-topbar .estex-motto { font-size: 12px; color: var(--gold-200); }
.estex-topbar .estex-spacer { flex: 1 1 auto; }
.estex-topbar .estex-who { font-size: 12px; color: var(--gold-200); }
.estex-topbar svg { display: block; }

/* ---- login lockup (sys/views/login.jsp replaces the vendor logo image with this) ---- */
.estex-login-brand { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; }
.estex-login-brand img { width: 56px; height: 56px; }
.estex-login-name {
  font-family: var(--font-head); font-size: 26px; font-weight: 700;
  color: var(--navy-900); letter-spacing: .3px; line-height: 1.15;
}
.estex-login-motto { font-size: 13px; color: var(--gold-700); }

/* ---- sidebar / navigation: navy with gold-200 text ---- */
#cssmenu, #cssmenu ul, .sidebar, #leftsidebar { background: var(--navy-900) !important; }
#cssmenu > ul > li > a, #cssmenu li a {
  color: var(--gold-200) !important;
  font-family: var(--font-body); font-size: 14px;
  min-height: 44px; display: flex; align-items: center;
  border-bottom: 1px solid rgba(232, 211, 160, 0.12);
}
#cssmenu li a:hover, #cssmenu li.active > a, #cssmenu li.current > a {
  background: var(--navy-700) !important; color: #FFFFFF !important;
}
#cssmenu .holder, #cssmenu ul ul { background: #0d2545 !important; }
#cssmenu ul ul a { color: #cfd8e6 !important; font-size: 13px; }

/* ---- content surfaces ---- */
.container { background: transparent; }
.panel, .box, .widget, .portlet, .content, .well, .panel-body, .box-content {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-card) !important;
  box-shadow: var(--shadow-1);
}
.panel-heading, .box-header, .portlet-header {
  background: var(--navy-700) !important; color: #FFFFFF !important;
  border-radius: var(--radius-card) var(--radius-card) 0 0 !important;
  font-family: var(--font-head);
}
.modal-content { border-radius: var(--radius-card); border: 1px solid var(--border); }
.modal-header { background: var(--navy-900) !important; color: #FFFFFF !important; border-radius: 8px 8px 0 0; }
.modal-header h4, .modal-header .close { color: #FFFFFF !important; background: transparent !important; }

/* ---- controls: 44px, one gold primary, navy outline for everything else ---- */
.btn, button, input[type=submit], input[type=button], a.btn {
  min-height: 44px; border-radius: var(--radius-control);
  font-size: 14px; font-weight: 600; padding: 8px 16px;
}
.btn:focus, button:focus, a:focus { outline: 2px solid var(--gold-500); outline-offset: 2px; }
.btn-primary, input[type=submit] {
  background: var(--gold-500) !important; border-color: var(--gold-700) !important;
  color: var(--navy-900) !important;
}
.btn-primary:hover, input[type=submit]:hover { background: #b8913c !important; }
.btn-default, .btn-info, .btn-success {
  background: var(--surface) !important; color: var(--navy-700) !important;
  border-color: var(--navy-700) !important;
}
.btn-danger { background: var(--surface) !important; color: var(--err-fg) !important; border-color: var(--err-fg) !important; }
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  min-height: 44px; border: 1px solid var(--border) !important; border-radius: var(--radius-control);
  background: var(--surface); color: var(--text); font-size: 14px; padding: 6px 10px;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold-700) !important; }
.form-control { height: 44px; border-radius: var(--radius-control); }

/* ---- tables: navy header, gold-200 labels, hairline rows, own scroll box ---- */
table, .ui-jqgrid, .ui-jqgrid-btable, .ui-jqgrid-htable { font-size: 13.5px; }
table th, .ui-jqgrid .ui-jqgrid-htable th {
  background: var(--navy-900) !important; color: var(--gold-200) !important;
  border: 1px solid var(--navy-700) !important; font-weight: 600;
}
table td, .ui-jqgrid .ui-jqgrid-btable td { border-bottom: 1px solid var(--border); }
table tr:nth-child(even) td { background: #FCFAF5; }
.ui-state-default, .ui-widget-content .ui-state-default { border-color: var(--border) !important; }
/* Amounts: tabular digits, right aligned (currency stays in the column heading). */
.amount, .money, td[align=right] { font-variant-numeric: tabular-nums; text-align: right; }

/* ---- status chips (labels carry the meaning, colour is secondary) ---- */
.chip, .label, .badge, .status {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600;
  background: var(--bg); color: var(--text-muted); border: 1px solid var(--border);
}
.chip-ok, .label-success, .badge-success { background: var(--ok-bg); color: var(--ok-fg); border-color: transparent; }
.chip-warn, .label-warning, .badge-warning { background: var(--warn-bg); color: var(--warn-fg); border-color: transparent; }
.chip-err, .label-danger, .badge-danger { background: var(--err-bg); color: var(--err-fg); border-color: transparent; }

/* ---- footer brand block ---- */
.footertb td { color: var(--text-muted); font-size: 12px; }
.estex-footer {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 16px 24px 24px; margin-top: 16px;
  border-top: 1px solid var(--border); color: var(--text-muted); text-align: center;
}
.estex-footer .estex-sign { display: inline-flex; align-items: center; gap: 8px; color: var(--gold-700); font-weight: 600; }
.estex-footer .estex-copy { font-size: 12px; }
.estex-footer .estex-tag { font-size: 11px; }
.copyright { color: var(--text-muted); font-size: 12px; }

/* ---- the silent denial (docs/02 item 10): make the refusal legible ---- */
#notallowedtoviewpage:empty::after {
  content: "You do not have permission to view this screen. Ask your administrator for the privilege, "
           "then reload this page.";
  display: block; margin: 16px 0; padding: 12px 16px;
  background: var(--warn-bg); color: var(--warn-fg);
  border: 1px solid var(--gold-200); border-radius: var(--radius-card); font-size: 14px;
}

/* ---- mobile: section 11 rules for a desktop-only legacy layout ---- */
@media (max-width: 599px) {
  .container { padding-left: 8px; padding-right: 8px; width: 100%; }
  /* Grids squash instead of scrolling; give them their own horizontal box. */
  .ui-jqgrid, .ui-jqgrid-view, table { max-width: 100%; overflow-x: auto; }
  input, select, textarea { font-size: 16px; }        /* stops iOS zoom on focus */
  .ui-jqgrid .ui-jqgrid-pager, .ui-pg-table { width: 100%; }
  .estex-topbar { min-height: 48px; padding: 6px 10px; }
  .estex-topbar .estex-name { font-size: 16px; }
  .estex-topbar .estex-who { display: none; }
}
@media (min-width: 600px) and (max-width: 1023px) {
  .container { width: 100%; }
}
