/* ON2 ERP theme for the Operations module (on2erp.com/ops) - matches the ERP home page v1.6.
 * Loaded ONLY in the ERP build (tools/build-erp-ops.js adds the <link> after css/app.css).
 * Design: dark teal -> blue backdrop with soft glows, glass top bar + tab bar, and the content on a light rounded
 * "sheet" so tables, forms and texts keep their readable dark-on-light colours. */
html, body { background: #05434c; }
body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  background:
    radial-gradient(1000px 600px at 0% 0%, rgba(20,184,166,.30) 0%, transparent 60%),
    radial-gradient(900px 600px at 100% 100%, rgba(14,165,233,.28) 0%, transparent 60%),
    linear-gradient(135deg, #05434c 0%, #065669 45%, #0f3d74 100%) fixed;
}

/* glass bars (mostly opaque: light content scrolls underneath them) */
header {
  background: rgba(3,36,48,.90);
  backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 6px 24px rgba(0,10,25,.30);
}
.logo-icon { background: linear-gradient(135deg, #2dd4bf, #38bdf8); color: #05343c; border-radius: 11px; box-shadow: inset 0 1px 0 rgba(255,255,255,.5); }
nav {
  background: rgba(3,36,48,.82);
  backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid rgba(94,234,212,.25);
}
.tab-btn { border-radius: 10px 10px 0 0; }
/* fit the page - no left/right scrolling (Victor): the 12 tabs needed 1639px, so they wrap onto a second row.
 * The tab bar then scrolls away with the page and each tab's section header (title, search, filters) pins right
 * under the top bar (64px) instead of under a one-row tab bar (104px in app.css). */
nav { position: relative; top: auto; flex-wrap: wrap; row-gap: 2px; justify-content: center; }
.section-header { top: 64px; }
.tab-btn.active { color: #5eead4; border-bottom-color: #5eead4; }

/* the light content sheet */
main {
  background: rgba(241,245,249,.97);
  margin: 14px 14px 22px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.55);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 18px 48px rgba(0,10,25,.35);
  min-height: calc(100vh - 140px);
}
.section-header { background: rgba(241,245,249,.97); }

/* rounder, softer cards inside the sheet (like the home page) */
.kpi-card { border-radius: 16px; box-shadow: 0 1px 2px rgba(15,27,45,.05), 0 8px 22px rgba(15,27,45,.07); }
.table-wrap { border-radius: 0 0 16px 16px; }
thead tr, thead th, thead .col-actions-sticky { background: #06424c; }
.filter-chip:hover, .filter-chip.active { background: #0d9488; }
.search-input:focus { border-color: #0d9488; box-shadow: 0 0 0 3px rgba(13,148,136,.15); }

@media (max-width: 640px) {
  main { margin: 8px 6px 16px; border-radius: 16px; }
}
/* phones (Victor's screenshot: the top bar was wider than the screen and pushed the bell off the edge):
 * a compact top bar that wraps onto two rows and scrolls away; section headers then pin at the very top;
 * two-column overview blocks stack; R&D sub-tabs wrap. Checked all 12 tabs at 375px: nothing scrolls sideways. */
@media (max-width: 760px) {
  header { height: auto; min-height: 56px; flex-wrap: wrap; padding: 8px 12px; gap: 6px 10px; position: relative; }
  .logo-text { font-size: 17px; }
  .logo-sub { display: none; }
  .logo-icon { width: 34px; height: 34px; font-size: 15px; }
  .header-right { flex-wrap: wrap; gap: 6px 10px; justify-content: flex-end; flex: 1 1 auto; min-width: 0; }
  #hdr-date { display: none; }
  .section-header { top: 0; }
  .tab-panel > div[style*='grid-template-columns'] { grid-template-columns: 1fr !important; }
  .tab-panel > .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }   /* number cards: two per row */
  .rnd-tabs { flex-wrap: wrap; }
}
@media print {
  html, body { background: #fff !important; }
  main { background: none; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
}
