:root {
  color-scheme: light dark;
  --finance-sidebar-col: 56px;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #dbe5f2;
  --primary: #1d4ed8;
  --input-bg: #ffffff;
  --nav-link: #1e40af;
  --nav-active-bg: #dbeafe;
  --nav-active-border: #93c5fd;
  --btn-secondary-bg: #e2e8f0;
  --btn-secondary-text: #0f172a;
  --table-header-bg: #f8fafc;
  --gj-table-header-bg: #f1f5f9;
  --prefs-submenu-hover-bg: #eff6ff;
  --prefs-submenu-hover-border: #93c5fd;
  --auth-chip-bg: #e2e8f0;
  --tensor-banner-from: #065f46;
  --tensor-banner-to: #10b981;
  --tensor-banner-shadow: rgba(6, 95, 70, 0.28);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1222;
    --surface: #151d2e;
    --text: #e8edf5;
    --muted: #94a3b8;
    --border: #2a3548;
    --primary: #3b82f6;
    --input-bg: #1a2438;
    --nav-link: #93c5fd;
    --nav-active-bg: rgba(59, 130, 246, 0.22);
    --nav-active-border: #3b82f6;
    --btn-secondary-bg: #334155;
    --btn-secondary-text: #f1f5f9;
    --table-header-bg: #1e293b;
    --gj-table-header-bg: #243048;
    --prefs-submenu-hover-bg: rgba(59, 130, 246, 0.18);
    --prefs-submenu-hover-border: #60a5fa;
    --auth-chip-bg: #334155;
    --tensor-banner-from: #047857;
    --tensor-banner-to: #0d9488;
    --tensor-banner-shadow: rgba(0, 0, 0, 0.42);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* App shell: left sidebar nav | main (aligned with tensorMaintenancePro layout) */
.finance-layout {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0 auto;
  max-width: 1280px;
  min-height: 100vh;
  padding: 20px;
}

.finance-body {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: var(--finance-sidebar-col, 168px) minmax(0, 1fr);
}

.finance-sidebar {
  align-self: start;
  min-width: 0;
  position: sticky;
  top: 16px;
  width: 100%;
}

.nav.finance-sidebar-nav {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 5px;
  margin: 0;
  padding: 8px;
}

.nav.finance-sidebar-nav a {
  border-radius: 8px;
  box-sizing: border-box;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  padding: 7px 9px;
  text-align: left;
  text-decoration: none;
  width: 100%;
}

.nav.finance-sidebar-nav a.tf-nav-main-icon {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 42px;
  padding: 8px 6px;
  position: relative;
  text-align: center;
  width: 100%;
}

.nav.finance-sidebar-nav a.tf-nav-main-icon::before {
  background-color: currentColor;
  content: "";
  display: block;
  flex-shrink: 0;
  height: 22px;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
  opacity: 0.92;
  width: 22px;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
}

.nav.finance-sidebar-nav a[data-page="dashboard"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 13h8V3H3v10zm0 8h8v-6H3v6zm10 0h8V11h-8v10zm0-18v6h8V3h-8z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 13h8V3H3v10zm0 8h8v-6H3v6zm10 0h8V11h-8v10zm0-18v6h8V3h-8z'/%3E%3C/svg%3E");
}

.nav.finance-sidebar-nav a[data-page="company"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 3L2 9h3v11h6v-7h2v7h6V9h3L12 3zm0 2.2L17 9h-2v9h-2v-7H9v7H7V9H5l7-3.8z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 3L2 9h3v11h6v-7h2v7h6V9h3L12 3zm0 2.2L17 9h-2v9h-2v-7H9v7H7V9H5l7-3.8z'/%3E%3C/svg%3E");
}

.nav.finance-sidebar-nav a[data-page="general-ledger"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M6 2h9l5 5v15a1 1 0 0 1-1 1H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm8 1.5V8h4.5L14 3.5zM7 12h10v1H7v-1zm0 3h10v1H7v-1zm0 3h7v1H7v-1z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M6 2h9l5 5v15a1 1 0 0 1-1 1H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm8 1.5V8h4.5L14 3.5zM7 12h10v1H7v-1zm0 3h10v1H7v-1zm0 3h7v1H7v-1z'/%3E%3C/svg%3E");
}

.nav.finance-sidebar-nav a[data-page="cash-bank"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 6h18v12H3V6zm2 2v8h14V8H5zm2 10h10v2H7v-2zm1-6h2v2H8v-2zm4 0h2v2h-2v-2zm4 0h2v2h-2v-2z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 6h18v12H3V6zm2 2v8h14V8H5zm2 10h10v2H7v-2zm1-6h2v2H8v-2zm4 0h2v2h-2v-2zm4 0h2v2h-2v-2z'/%3E%3C/svg%3E");
}

.nav.finance-sidebar-nav a[data-page="sales"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 18c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zM1 2v2h2l3.6 7.59-1.35 2.45c-.15.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.14 0-.25-.11-.25-.25l.03-.12L8.1 13h7.45c.75 0 1.41-.41 1.75-1.03L21.7 4H5.21l-.94-2H1zm16 16c-1.1 0-2 .9-2 2h2v-2zm0-6v2h4v-2h-4z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 18c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zM1 2v2h2l3.6 7.59-1.35 2.45c-.15.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.14 0-.25-.11-.25-.25l.03-.12L8.1 13h7.45c.75 0 1.41-.41 1.75-1.03L21.7 4H5.21l-.94-2H1zm16 16c-1.1 0-2 .9-2 2h2v-2zm0-6v2h4v-2h-4z'/%3E%3C/svg%3E");
}

.nav.finance-sidebar-nav a[data-page="purchase"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M18 6h-2V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v2H4c-1.1 0-2 .9-2 2v11c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zM10 4h4v2h-4V4zm8 15H6v-2h12v2zm0-5H6V9h12v5z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M18 6h-2V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v2H4c-1.1 0-2 .9-2 2v11c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zM10 4h4v2h-4V4zm8 15H6v-2h12v2zm0-5H6V9h12v5z'/%3E%3C/svg%3E");
}

.nav.finance-sidebar-nav a[data-page="inventory"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2L4 6v12l8 4 8-4V6l-8-4zm0 2.2L17.5 7 12 9.8 6.5 7 12 4.2zM6 8.6l5 2.5v9.1l-5-2.5V8.6zm12 9.1l-5 2.5v-9.1l5-2.5v9.1z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2L4 6v12l8 4 8-4V6l-8-4zm0 2.2L17.5 7 12 9.8 6.5 7 12 4.2zM6 8.6l5 2.5v9.1l-5-2.5V8.6zm12 9.1l-5 2.5v-9.1l5-2.5v9.1z'/%3E%3C/svg%3E");
}

.nav.finance-sidebar-nav a[data-page="fixed-assets"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M22 9V7h-2V5c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-2h2v-2h-2v-2h2v-2h-2V9h2zm-4 10H4V5h14v14zm-1-6h-4v4h-2v-4H7v-2h4V7h2v4h4v2z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M22 9V7h-2V5c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-2h2v-2h-2v-2h2v-2h-2V9h2zm-4 10H4V5h14v14zm-1-6h-4v4h-2v-4H7v-2h4V7h2v4h4v2z'/%3E%3C/svg%3E");
}

.nav.finance-sidebar-nav a[data-page="report"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM7 10h2v7H7v-7zm4-3h2v10h-2V7zm4 5h2v5h-2v-5z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM7 10h2v7H7v-7zm4-3h2v10h-2V7zm4 5h2v5h-2v-5z'/%3E%3C/svg%3E");
}

.preferences-submenu-list li {
  min-width: 0;
}

.finance-main {
  min-width: 0;
  position: relative;
  width: 100%;
}

.finance-main .shell {
  margin: 0;
  max-width: none;
  padding: 0;
}

/* In-page procurement submenu (Sales shortcuts → Purchase anchors; Purchase local jumps) */
.finance-workflow-layout {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(152px, 184px) minmax(0, 1fr);
}

body[data-page="report"] .finance-workflow-layout {
  grid-template-columns: minmax(152px, 184px) minmax(0, 1fr);
}

.finance-page-submenu {
  position: sticky;
  top: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}

.finance-page-submenu a {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-sizing: border-box;
  color: var(--text);
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  padding: 7px 9px;
  text-decoration: none;
}

.finance-page-submenu a:hover {
  background: var(--prefs-submenu-hover-bg);
  border-color: var(--prefs-submenu-hover-border);
}

.finance-page-submenu a.active {
  background: var(--nav-active-bg);
  border-color: var(--nav-active-border);
}

.finance-workflow-panels {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.report-submenu-layout {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(152px, 184px) minmax(0, 1fr);
}

.report-submenu-list {
  position: static;
  top: auto;
}

.report-submenu-panels {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.report-submenu-section[hidden] {
  display: none !important;
}

.report-submenu-section > h4 {
  font-size: 1rem;
  margin: 0 0 12px;
}

.report-tile-help {
  margin: 0 0 14px;
}

.report-tile-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.report-tile {
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  justify-content: flex-start;
  line-height: 1.35;
  min-height: 88px;
  padding: 14px 16px;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.report-tile:hover {
  background: var(--prefs-submenu-hover-bg);
  border-color: var(--prefs-submenu-hover-border);
  transform: translateY(-1px);
}

.report-tile:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.report-tile-status {
  margin: 12px 0 0;
  min-height: 1.2em;
}

.finance-submenu-section[hidden] {
  display: none !important;
}

.finance-submenu-section {
  scroll-margin-top: 24px;
}

.finance-submenu-section > h3 {
  font-size: 1.05rem;
  margin: 0 0 12px;
}

.finance-submenu-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 10px;
}

.finance-submenu-card-title--table {
  margin-top: 16px;
}

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.header {
  align-items: flex-start;
  background: linear-gradient(135deg, var(--tensor-banner-from), var(--tensor-banner-to));
  border-radius: 18px;
  box-shadow: 0 12px 28px var(--tensor-banner-shadow);
  color: #fff;
  margin-bottom: 16px;
  padding: 22px 26px;
}

.finance-layout > .header {
  margin-bottom: 0;
}

.header h1 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.15;
}

.header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
}

.finance-layout > .header.app-header--with-shortcuts {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.top-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 0;
  flex-wrap: wrap;
}

/* Top/grid nav (login or legacy): falls back when not using .finance-sidebar-nav */
.nav:not(.finance-sidebar-nav) {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  margin-bottom: 14px;
}

.nav:not(.finance-sidebar-nav) a {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--nav-link);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  padding: 7px 9px;
  text-align: center;
  text-decoration: none;
}

.nav:not(.finance-sidebar-nav) a.active {
  background: var(--nav-active-bg);
  border-color: var(--nav-active-border);
}

.nav.finance-sidebar-nav a {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--nav-link);
}

.nav.finance-sidebar-nav a.active {
  background: var(--nav-active-bg);
  border-color: var(--nav-active-border);
}

.nav.finance-sidebar-nav a.tf-nav-main-icon:focus-visible {
  outline: 2px solid var(--nav-active-border);
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .finance-body {
    gap: 14px;
    grid-template-columns: 1fr;
  }

  .finance-sidebar {
    position: static;
  }

  .finance-workflow-layout {
    grid-template-columns: 1fr;
  }

  .finance-page-submenu {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .finance-page-submenu a {
    flex: 0 0 auto;
    min-width: 44px;
    text-align: center;
  }

  .nav.finance-sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav.finance-sidebar-nav a.tf-nav-main-icon {
    width: auto;
    min-width: 44px;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.kpi {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 6px 0 0;
}

.muted { color: var(--muted); }

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

th, td {
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 9px 6px;
  font-size: 0.94rem;
}

button {
  border: 0;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 600;
  cursor: pointer;
}

button.secondary {
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  background: var(--input-bg);
  color: var(--text);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.full { grid-column: 1 / -1; }

.hidden { display: none; }

.finance-layout > .header.app-header--with-shortcuts .crm-header-shortcuts {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.finance-layout > .header.app-header--with-shortcuts .crm-prefs-shortcut,
.finance-layout > .header.app-header--with-shortcuts .tensor-banner-logout,
.finance-layout > .header.app-header--with-shortcuts a.tensor-erp-launcher {
  order: 1;
}

.finance-layout > .header.app-header--with-shortcuts .crm-prefs-shortcut {
  align-items: center;
  background: rgba(15, 23, 42, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 10px;
  box-sizing: border-box;
  color: rgba(255, 255, 255, 0.95);
  display: inline-flex;
  height: 2.35rem;
  justify-content: center;
  text-decoration: none;
  transition: background 0.15s ease;
  width: 2.35rem;
}

.finance-layout > .header.app-header--with-shortcuts .crm-prefs-shortcut:hover {
  background: rgba(15, 23, 42, 0.38);
  color: #fff;
}

.finance-layout > .header.app-header--with-shortcuts .crm-prefs-shortcut:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.finance-layout > .header.app-header--with-shortcuts .tensor-banner-session {
  color: rgba(255, 255, 255, 0.92);
  flex-basis: 100%;
  font-size: 13px;
  font-weight: 700;
  margin-top: 2px;
  max-width: none;
  order: 2;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-layout > .header.app-header--with-shortcuts .tensor-banner-logout {
  background: rgba(15, 23, 42, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.96);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
}

.finance-layout > .header.app-header--with-shortcuts .tensor-banner-logout:hover {
  background: rgba(15, 23, 42, 0.38);
  color: #fff;
}

.finance-layout > .header.app-header--with-shortcuts a.tensor-erp-launcher {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.96);
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 10px;
}

.finance-layout > .header.app-header--with-shortcuts a.tensor-erp-launcher:hover {
  background: rgba(255, 255, 255, 0.28);
}

.finance-layout > .header.app-header--with-shortcuts .app-header-brand {
  flex: 1;
  min-width: 0;
}

.finance-banner-brand-row {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  min-width: 0;
}

.finance-banner-logo-wrap {
  flex-shrink: 0;
}

.finance-layout > .header .finance-banner-logo {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 12px;
  box-sizing: border-box;
  display: block;
  height: 52px;
  max-width: 148px;
  object-fit: contain;
  padding: 5px;
  width: auto;
}

.finance-layout > .header .finance-banner-titles {
  flex: 1;
  min-width: 0;
}

.auth-chip {
  background: var(--auth-chip-bg);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 0.86rem;
}

.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Preferences — subsection sidebar + stacked panels */
.preferences-layout {
  display: grid;
  grid-template-columns: minmax(152px, 184px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.preferences-submenu {
  position: sticky;
  top: 14px;
}

.preferences-submenu-title {
  margin: 0 0 6px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.preferences-submenu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.preferences-submenu-list a {
  display: block;
  padding: 7px 9px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.8125rem;
  line-height: 1.25;
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--surface);
}

.preferences-submenu-list a:hover {
  border-color: var(--prefs-submenu-hover-border);
  background: var(--prefs-submenu-hover-bg);
}

.preferences-submenu-list a.active {
  background: var(--nav-active-bg);
  border-color: var(--nav-active-border);
}

.preferences-panels {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.prefs-section[hidden] {
  display: none !important;
}

.prefs-section {
  scroll-margin-top: 18px;
}

.prefs-section h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
}

@media (max-width: 720px) {
  .preferences-layout {
    grid-template-columns: 1fr;
  }

  .preferences-submenu {
    position: static;
  }

  .preferences-submenu-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .preferences-submenu-list li {
    flex: 0 0 auto;
    min-width: 44px;
  }

  .preferences-submenu-list a {
    text-align: center;
    padding: 8px 6px;
    font-size: inherit;
  }
}

.prefs-fieldset {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 0 0 14px;
  padding: 12px 14px;
}

.prefs-fieldset legend {
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0 6px;
}

.finance-company-prefs-form label > span {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.prefs-form-actions {
  margin-top: 6px;
}

.finance-logo-preview {
  border: 1px solid var(--border);
  border-radius: 8px;
  display: block;
  margin-top: 10px;
  max-height: 120px;
  max-width: 240px;
  object-fit: contain;
}

.form-message {
  margin-top: 12px;
  min-height: 1.2em;
}

.account-list-actions .actions {
  gap: 10px;
}

.plain-table {
  border-collapse: collapse;
  font-size: 0.94rem;
  margin-top: 8px;
  width: 100%;
}

.plain-table th,
.plain-table td {
  border-bottom: 1px solid var(--border);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.plain-table thead th {
  background: var(--table-header-bg);
  font-weight: 700;
}

/* Row actions: Edit + Remove on one line to save vertical space */
.plain-table td.tf-table-actions {
  align-items: center;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 6px;
  vertical-align: middle;
}

.plain-table td.tf-table-actions > button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.gj-lines-table {
  border-collapse: collapse;
  margin-top: 10px;
  width: 100%;
}

.gj-lines-table th,
.gj-lines-table td {
  border: 1px solid var(--border);
  padding: 8px;
  vertical-align: middle;
}

.gj-lines-table thead th {
  background: var(--gj-table-header-bg);
  font-size: 0.85rem;
}

.gj-lines-table input,
.gj-lines-table select {
  margin: 0;
}

.gj-view-table {
  margin-top: 8px;
}

/* Inventory — Goods Request line picker */
.tf-gr-lines-table {
  border-collapse: collapse;
  margin-top: 10px;
  width: 100%;
}

.tf-gr-lines-table th,
.tf-gr-lines-table td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: middle;
}

.tf-gr-lines-table thead th {
  background: var(--table-header-bg);
  font-size: 0.88rem;
  font-weight: 700;
}

.tf-gr-lines-table tbody tr {
  cursor: pointer;
}

.tf-gr-lines-table tbody tr:hover {
  background: var(--prefs-submenu-hover-bg);
}

.tf-gr-dialog {
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: min(440px, 92vw);
  padding: 0;
}

.tf-gr-dialog::backdrop {
  background: rgba(15, 23, 42, 0.38);
}

.tf-gr-dialog-panel {
  padding: 1.25rem;
}

.tf-gr-dialog.tf-po-dialog {
  max-width: min(560px, 94vw);
}

.tf-po-lines-table {
  font-size: 0.88rem;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

/* —— Mobile: burger hides sidebar until opened —— */
.finance-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0 10px 0 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.18);
  cursor: pointer;
  flex-shrink: 0;
}

.finance-nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: #fff;
}

.finance-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 180;
  background: rgba(15, 23, 42, 0.45);
}

.finance-nav-overlay.is-visible {
  display: block;
}

@media (max-width: 768px) {
  .finance-layout {
    padding: 12px;
  }

  .finance-body {
    grid-template-columns: 1fr;
  }

  .finance-nav-toggle {
    display: inline-flex;
  }

  .finance-layout > .header {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
  }

  .finance-layout > .header .app-header-brand,
  .finance-layout > .header .finance-banner-brand-row {
    flex: 1 1 auto;
    min-width: 0;
  }

  .finance-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(12rem, 86vw);
    z-index: 200;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: 8px 0 32px rgba(15, 23, 42, 0.18);
    overflow-y: auto;
    padding-top: 12px;
    background: var(--surface);
  }

  body.tensor-nav-open .finance-sidebar {
    transform: translateX(0);
  }

  .finance-main {
    width: 100%;
  }

  .finance-layout > .header.app-header--with-shortcuts {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 16px 18px;
  }

  .finance-layout > .header .finance-banner-brand-row {
    flex-wrap: wrap;
  }

  .finance-layout > .header.app-header--with-shortcuts .crm-header-shortcuts {
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
  }

  .finance-layout > .header.app-header--with-shortcuts .tensor-banner-session {
    flex-basis: auto;
    width: 100%;
    max-width: 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    text-align: left;
    word-break: break-word;
  }
}

.tf-bootstrap-shield {
  align-items: center;
  background: rgba(15, 23, 42, 0.22);
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  pointer-events: auto;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 80;
}

.tf-bootstrap-shield--hidden {
  display: none !important;
  pointer-events: none;
}

.tf-bootstrap-shield__panel {
  background: var(--surface, #fff);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.12);
  padding: 14px 22px;
}

.tf-bootstrap-shield__text {
  color: var(--muted, #64748b);
  font-size: 0.95rem;
}
