/*
  Sacco Master - Estex Systems theme overlay ("Graphite & Gold"), UI Standard v1.1.
  Linked LAST in sys/views/header.jsp and login.jsp, so it wins the cascade by document order.
  !important appears only where the shipped pages carry inline styles (h5.title colour, #live-clock)
  or where vendor stylesheets set backgrounds with !important (custom.css .left-sidebar).

  Palette: graphite chrome, warm ivory paper, one gold accent. No blue anywhere - the shipped
  .nav-bar/.left-sidebar blue and the navy table headers were what made it read as Innova.
*/

:root {
  --ink-950: #141311;
  --ink-900: #1B1A17;
  --ink-800: #26241F;
  --ink-700: #35322B;
  --gold-500: #C9A24B;
  --gold-600: #B8913C;
  --gold-700: #8A6A1F;
  --gold-200: #E9D9B0;
  --paper: #F6F3EC;
  --surface: #FFFFFF;
  --surface-2: #FBFAF6;
  --border: #E3DCCB;
  --border-strong: #CFC7B4;
  --text: #23201A;
  --text-muted: #6B655A;
  --ok-bg: #E3F1E6; --ok-fg: #1E6B3A;
  --warn-bg: #FBEFD2; --warn-fg: #7A5A00;
  --err-bg: #FADBD8; --err-fg: #9B2C22;
  --radius-control: 8px;
  --radius-card: 12px;
  --shadow-1: 0 2px 6px rgba(27, 26, 23, 0.06);
  --shadow-pop: 0 10px 28px rgba(27, 26, 23, 0.16);
  --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(--paper) !important;
  color: var(--text);
  font-size: 87.5%;
  font-family: var(--font-body) !important;
  /* Room for the fixed status bar; nothing overlaps and nothing is hidden under it. */
  padding-bottom: 40px;
}
h1, h2, h3, h4, h5, .title, .systitle { font-family: var(--font-head) !important; color: var(--ink-900) !important; }
a { color: var(--gold-700); }
a:hover, a:focus { color: var(--ink-800); }
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); }

/* The legacy shell caps the canvas at 1170-1370px; the app now uses the whole viewport. */
.container { width: 100% !important; max-width: none !important; padding: 0 18px !important; }

/* ---------------------------------------------------------------- identity bar */
.estex-topbar {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 8px 18px;
  background: var(--ink-900); color: var(--gold-200);
  border-bottom: 2px solid var(--gold-500);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}
.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; }
.estex-topbar .estex-user {
  font-size: 12.5px; font-weight: 600; color: var(--gold-200);
  padding: 5px 10px; border: 1px solid rgba(233, 217, 176, 0.28);
  border-radius: 999px; white-space: nowrap;
}
.estex-topbar .estex-user:empty { display: none; }
.estex-topbar .estex-clock { display: inline-flex; align-items: center; }
/* The shipped clock is inline-styled red monospace inside the toolbar; it is physically moved here. */
#live-clock {
  font-family: var(--font-body) !important;
  font-size: 14px !important; font-weight: 600 !important;
  color: var(--gold-200) !important; top: 0 !important;
  font-variant-numeric: tabular-nums;
  min-width: 8ch; letter-spacing: .3px;
}
.estex-nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; min-height: 0; padding: 0;
  background: transparent; color: var(--gold-200);
  border: 1px solid rgba(233, 217, 176, 0.28); border-radius: 8px;
  font-size: 16px; line-height: 1; cursor: pointer;
}
.estex-nav-toggle:hover, .estex-nav-toggle:focus { background: var(--ink-700); color: #fff; }

/* ---------------------------------------------------------------- top menu (was bright blue) */
.nav-bar {
  background: var(--ink-800) !important;
  background-image: none !important;
  height: 44px !important;
  box-shadow: none !important;
  border-bottom: 1px solid #3A362D;
  max-width: none !important;
}
.main-nav a {
  line-height: 44px !important;
  padding: 0 11px !important;
  color: #EFE7D6 !important;
  font-family: var(--font-body) !important;
  font-size: 13px !important;
  font-weight: 500;
}
.main-nav a:hover, .main-nav li:hover > a {
  color: var(--gold-200) !important;
  background: var(--ink-700);
  opacity: 1 !important;
}
.main-nav a i.fa { color: var(--gold-500); margin-right: 6px; }
.main-nav ul ul {
  background: var(--ink-800) !important;
  background-image: none !important;
  box-shadow: var(--shadow-pop) !important;
  border: 1px solid #3A362D; border-top: 2px solid var(--gold-500);
  border-radius: 0 0 10px 10px;
  padding: 6px 0 !important;
  left: 0 !important;
}
.main-nav ul ul a {
  width: 280px !important;
  line-height: 34px !important;
  padding: 0 15px !important;
  font-size: 13px !important;
  color: #EFE7D6 !important;
}
.main-nav ul ul a:hover {
  color: var(--ink-900) !important;
  background: var(--gold-500) !important;
  opacity: 1 !important;
}
.toggle_button_large { background: var(--ink-900) !important; }

/* ---------------------------------------------------------------- icon toolbar */
.toolbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 6px 10px;
  margin: 10px 0 14px;
  box-shadow: var(--shadow-1);
}
.toolbar ul li a {
  display: block; padding: 6px; border-radius: 8px;
  border: 1px solid transparent;
}
.toolbar ul li a:hover { background: var(--paper); border-color: var(--border); }
.toolbar ul li.right_separator { border-right-color: var(--border) !important; }
.toolbar ul li img { border-radius: 4px; }
.toolbar-to-right { color: var(--text-muted); }
.toolbar .sys-notifications, .toolbar .notifications-pane { color: var(--text); }

/* ---------------------------------------------------------------- sidebar (graphite, gold active rail) */
.left-sidebar {
  background: var(--ink-900) !important;
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  min-height: 0 !important;
  padding: 0 !important;
  overflow: hidden;
}
#cssmenu, #cssmenu ul, .sidebar, #leftsidebar { background: transparent !important; }
#cssmenu > ul > li > a, #cssmenu li a {
  color: #E7DFCC !important;
  font-family: var(--font-body); font-size: 12.5px;
  min-height: 40px; display: flex; align-items: center;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(233, 217, 176, 0.10);
}
#cssmenu > ul > li > a {
  color: var(--gold-200) !important; font-weight: 600; letter-spacing: .4px;
  text-transform: uppercase; font-size: 12px;
}
#cssmenu li a i.fa { color: var(--gold-500); width: 18px; text-align: center; margin-right: 8px; }
#cssmenu li a:hover, #cssmenu li.active > a, #cssmenu li.current > a {
  background: var(--ink-700) !important; color: #FFFFFF !important;
}
#cssmenu > ul > li.active > a, #cssmenu > ul > li.current > a {
  box-shadow: inset 3px 0 0 var(--gold-500);
}
#cssmenu .holder, #cssmenu ul ul { background: var(--ink-950) !important; }
#cssmenu ul ul a { color: #D9D2C0 !important; font-size: 12.5px; padding-left: 24px; }

/* Navigation rail: the topbar toggle hides the sidebar and lets content take the full row. */
body.sb-rail .left-sidebar { display: none !important; }
body.sb-rail .central-view, body.sb-rail .center-view { width: 100% !important; float: none !important; }

/* ---------------------------------------------------------------- content: no nested frames */
.central-view, .center-view, .right-sidebar {
  background: transparent !important;
  background-image: none !important;
  min-height: 0 !important;
}
.overray {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 2px 2px 8px !important;
}
.overray h5.title, h5.title {
  color: var(--ink-900) !important;
  font-size: 17px !important; font-weight: 700;
  margin: 6px 0 4px !important;
}
.overray h5.title u { text-decoration: none; }
.overray .header-bg { background: transparent !important; }
hr.clearpadmargins { border-color: var(--border) !important; margin: 6px 0 12px !important; }

.container .panel, .box, .widget, .portlet, .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(--ink-800) !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(--ink-900) !important; color: #FFFFFF !important; border-radius: 10px 10px 0 0; }
.modal-header h4, .modal-header .close { color: #FFFFFF !important; background: transparent !important; }

/* ---------------------------------------------------------------- buttons: one gold primary, the rest quiet outlines */
.btn, button, input[type=submit], input[type=button], a.btn {
  min-height: 40px; border-radius: var(--radius-control);
  font-family: var(--font-body) !important;
  font-size: 13.5px; font-weight: 600; padding: 7px 15px;
  box-shadow: none !important;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.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: 1px solid var(--gold-600) !important;
  color: var(--ink-900) !important;
}
.btn-primary:hover, .btn-primary:focus, input[type=submit]:hover {
  background: var(--gold-600) !important; color: var(--ink-900) !important;
}
.btn-default, .btn-info, .btn-success {
  background: var(--surface) !important; color: var(--ink-800) !important;
  border: 1px solid var(--border-strong) !important;
}
.btn-default:hover, .btn-info:hover, .btn-success:hover {
  background: var(--paper) !important; border-color: var(--ink-700) !important; color: var(--ink-900) !important;
}
.btn-danger {
  background: var(--surface) !important; color: var(--err-fg) !important;
  border: 1px solid #E2B7AF !important;
}
.btn-danger:hover { background: var(--err-bg) !important; }

/* Module command strips: New is the single primary; everything else is an outlined utility. */
.overray-buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.overray-buttons .btn { min-height: 40px; display: inline-flex; align-items: center; gap: 7px; }
.overray-buttons .btn span.fa { margin: 0; }
.overray-buttons .btn-primary,
.overray-buttons .btn-info,
.overray-buttons .btn-danger {
  background: var(--surface) !important; color: var(--ink-800) !important;
  border: 1px solid var(--border-strong) !important;
}
.overray-buttons .btn-primary:hover,
.overray-buttons .btn-info:hover,
.overray-buttons .btn-danger:hover {
  background: var(--paper) !important; border-color: var(--ink-700) !important; color: var(--ink-900) !important;
}
.overray-buttons .btn-default {
  background: var(--gold-500) !important; color: var(--ink-900) !important;
  border: 1px solid var(--gold-600) !important;
}
.overray-buttons .btn-default:hover { background: var(--gold-600) !important; }

/* Quiet buttons injected by sys/js/estex-app.js (column chooser). */
.estex-gridbar { display: flex; justify-content: flex-end; gap: 8px; margin: 0 0 8px; }
.estex-btn-quiet {
  min-height: 32px !important; padding: 4px 12px !important;
  font-size: 12.5px !important; font-weight: 600;
  background: var(--surface) !important; color: var(--ink-700) !important;
  border: 1px solid var(--border) !important; border-radius: 8px !important;
}
.estex-btn-quiet:hover { border-color: var(--ink-700) !important; background: var(--paper) !important; }

/* ---------------------------------------------------------------- inputs */
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  min-height: 40px; border: 1px solid var(--border) !important; border-radius: var(--radius-control);
  background: var(--surface); color: var(--text); font-size: 13.5px; padding: 6px 10px;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold-600) !important; box-shadow: 0 0 0 3px rgba(201, 162, 75, .18); }
.form-control { height: 40px; border-radius: var(--radius-control); }

/* ---------------------------------------------------------------- jqGrid */
.ui-jqgrid {
  font-family: var(--font-body) !important;
  font-size: 13px; border: 0 !important; background: transparent !important;
}
.ui-jqgrid .ui-jqgrid-view {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
}
/* The page title already names the screen; the grid's own caption bar is a second frame. */
.ui-jqgrid .ui-jqgrid-titlebar { display: none !important; }
.ui-jqgrid .ui-jqgrid-htable th {
  background: var(--ink-800) !important; color: var(--gold-200) !important;
  border: 0 !important; border-bottom: 1px solid var(--ink-950) !important;
  font-family: var(--font-body) !important;
  font-size: 12px; font-weight: 600; letter-spacing: .2px;
  padding: 10px !important; height: 38px;
}
.ui-jqgrid .ui-jqgrid-htable th div { height: auto !important; color: inherit; }
.ui-jqgrid .ui-jqgrid-htable th span.ui-jqgrid-resize { height: 38px !important; }
.ui-jqgrid .ui-jqgrid-btable td {
  padding: 9px 10px !important;
  border: 0 !important; border-bottom: 1px solid #F0EBDF !important;
  font-size: 13px; color: var(--text); background-color: transparent;
  height: 40px;
}
.ui-jqgrid .ui-jqgrid-btable tr.jqgrow:nth-child(even) td { background-color: var(--surface-2); }
.ui-jqgrid .ui-jqgrid-btable tr.jqgrow:hover td,
.ui-jqgrid .ui-jqgrid-btable tr.jqgrow.ui-state-hover td { background-color: #F6EFDD !important; }
.ui-jqgrid .ui-jqgrid-btable tr.ui-state-highlight td,
.ui-jqgrid .ui-jqgrid-btable tr.ui-state-highlight:hover td {
  background-color: #F1E6C9 !important; color: var(--ink-900) !important;
}
.ui-jqgrid .ui-jqgrid-bdiv { background: var(--surface); }
.ui-jqgrid .ui-jqgrid-pager {
  background: var(--surface) !important; border: 0 !important;
  border-top: 1px solid var(--border) !important;
  min-height: 46px; padding: 6px 10px !important; font-size: 12.5px;
  border-radius: 0 0 var(--radius-card) var(--radius-card);
}
.ui-jqgrid .ui-pg-table td { font-family: var(--font-body) !important; color: var(--text-muted); }
.ui-jqgrid .ui-pg-button { border-radius: 6px; }
.ui-jqgrid .ui-pg-button:hover { background: var(--paper); }
.ui-jqgrid .ui-state-default, .ui-widget-content .ui-state-default { border-color: var(--border) !important; }
.ui-jqgrid .ui-jqgrid-sdiv, .ui-jqgrid .footrow td { background: var(--paper) !important; color: var(--ink-800) !important; }
.ui-jqgrid .loading { background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: 10px; }

/* Amounts: tabular digits, right aligned (currency stays in the column heading). */
.amount, .money, td[align=right] { font-variant-numeric: tabular-nums; text-align: right; }

/* Column chooser (jQuery UI dialog) follows the same chrome. */
.ui-dialog .ui-dialog-titlebar { background: var(--ink-900) !important; color: #fff !important; border: 0; border-radius: 10px 10px 0 0; }
.ui-dialog .ui-dialog-titlebar-close { color: #fff; background: transparent; }
.ui-dialog { border-radius: var(--radius-card); box-shadow: var(--shadow-pop); }
.ui-multiselect-header .ui-icon { filter: invert(1); }

/* ---------------------------------------------------------------- status chips */
.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(--paper); 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: one slim fixed bar */
table.footertb { display: none !important; }
.estex-footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040;
  display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 6px 16px; margin: 0; padding: 9px 18px;
  background: var(--ink-900); color: var(--gold-200);
  border-top: 2px solid var(--gold-500);
  font-size: 11.5px; text-align: center;
}
.estex-footer .estex-sign { display: inline-flex; align-items: center; gap: 7px; color: var(--gold-200); font-weight: 600; }
.estex-footer .estex-sign svg { width: 14px; height: 14px; }
.estex-footer .estex-copy { font-size: 11.5px; color: #CFC7B4; }
.estex-footer .estex-tag { font-size: 11px; color: #A69F8D; }
.copyright { color: var(--text-muted); font-size: 12px; }

/* ---------------------------------------------------------------- login */
.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(--ink-900); letter-spacing: .3px; line-height: 1.15;
}
.estex-login-motto { font-size: 13px; color: var(--gold-700); }

/* ---------------------------------------------------------------- the silent denial: make it 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;
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 599px) {
  .container { padding-left: 8px !important; padding-right: 8px !important; width: 100%; }
  .ui-jqgrid, .ui-jqgrid-view, table { max-width: 100%; overflow-x: auto; }
  input, select, textarea { font-size: 16px; }
  .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-clock { display: none; }
  .estex-footer .estex-tag { display: none; }
  .main-nav a { font-size: 12px !important; padding: 0 8px !important; }
}
@media (min-width: 600px) and (max-width: 1023px) {
  .container { width: 100% !important; }
}
