:root {
  --bg: #f4f6f7;
  --panel: #ffffff;
  --ink: #17212b;
  --muted: #657282;
  --line: #dde4ea;
  --brand: #020202;
  --brand-dark: #000000;
  --accent: #0b6f8f;
  --danger: #b42318;
  --ok: #15803d;
  --soft: #edf7f5;
  --shadow: 0 12px 30px rgba(24, 39, 75, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body:not(.logged-in) .app-shell {
  display: none;
}

body.logged-in .login-screen {
  display: none;
}

body.logged-in.initial-sql-loading .login-screen {
  display: flex;
}

body.logged-in.initial-sql-loading .app-shell {
  display: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  display: block;
  min-height: 100vh;
}

.login-screen {
  align-items: stretch;
  background: #000;
  display: flex;
  min-height: 100vh;
  justify-content: flex-start;
  padding: 0;
  position: relative;
}

.login-screen::after {
  background:
    linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.12) 12%, rgba(0, 0, 0, 0) 45%),
    url("./assets/login_page.gif") center center / contain no-repeat;
  content: "";
  inset: 0 0 0 460px;
  position: absolute;
}

.login-card {
  align-content: center;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 0;
  box-shadow: 18px 0 70px rgba(0, 0, 0, 0.35);
  display: grid;
  gap: 18px;
  max-width: 460px;
  min-height: 100vh;
  padding: 42px;
  position: relative;
  width: min(460px, 100%);
  z-index: 1;
}

.login-card h1 {
  font-size: 32px;
  line-height: 1.05;
  margin: 6px 0 0;
}

.login-card img {
  justify-self: center;
  background: #000;
  border-radius: 18px;
  height: 156px;
  object-fit: contain;
  padding: 28px;
  width: 156px;
}

.login-card > div:first-of-type {
  text-align: center;
}

.login-card .eyebrow {
  color: #07806f;
  font-weight: 800;
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form .btn {
  min-height: 42px;
}

.login-form .btn:disabled {
  cursor: wait;
  opacity: 0.82;
}

.login-loading-message {
  align-items: center;
  background: #eef8f6;
  border: 1px solid #b7ddd7;
  border-radius: 8px;
  color: #075e52;
  display: flex;
  font-size: 13px;
  font-weight: 900;
  gap: 8px;
  justify-content: center;
  min-height: 38px;
  padding: 8px 10px;
}

.login-loading-message::before {
  animation: login-spin 0.85s linear infinite;
  border: 2px solid #b7ddd7;
  border-top-color: #07806f;
  border-radius: 50%;
  content: "";
  height: 14px;
  width: 14px;
}

@keyframes login-spin {
  to {
    transform: rotate(360deg);
  }
}

.remember-login {
  align-items: center;
  color: #435261;
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  gap: 8px;
  user-select: none;
}

.remember-login input {
  accent-color: #07806f;
  height: 16px;
  width: 16px;
}

.test-credentials {
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #435261;
  display: grid;
  font-size: 13px;
  gap: 5px;
  padding: 12px;
}

.sidebar {
  background: #050505;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  padding: 22px 18px;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 76px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
  scrollbar-width: thin;
  transition: width 0.18s ease;
  z-index: 20;
}

.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.24);
  border-radius: 999px;
}

.sidebar:hover,
.sidebar:focus-within {
  width: 260px;
}

body.sidebar-force-collapsed .sidebar,
body.sidebar-force-collapsed .sidebar:hover,
body.sidebar-force-collapsed .sidebar:focus-within {
  width: 76px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  min-width: 224px;
}

.brand-logo {
  align-items: center;
  background: #000;
  border-radius: 8px;
  display: flex;
  flex: 0 0 42px;
  height: 42px;
  justify-content: center;
  max-width: 42px;
  min-width: 42px;
  object-fit: contain;
  object-position: center;
  padding: 7px;
  transition: padding 0.18s ease;
  width: 42px;
}

.sidebar:hover .brand-logo,
.sidebar:focus-within .brand-logo {
  padding: 7px;
}

body.sidebar-force-collapsed .sidebar .brand-logo,
body.sidebar-force-collapsed .sidebar:hover .brand-logo,
body.sidebar-force-collapsed .sidebar:focus-within .brand-logo {
  padding: 7px;
  width: 42px;
}

.brand span,
.user-box span,
.eyebrow {
  color: var(--muted);
  display: block;
  font-size: 12px;
}

.sidebar .brand span,
.sidebar .user-box span {
  color: #9bb0b5;
}

.nav {
  display: grid;
  gap: 6px;
  margin-top: 2px;
}

.nav-item {
  align-items: center;
  border: 0;
  border-radius: 8px;
  display: flex;
  gap: 12px;
  background: transparent;
  color: #d9e8e6;
  cursor: pointer;
  min-width: 224px;
  padding: 10px 11px;
  position: relative;
  text-align: left;
}

.nav-menu-toggle::after {
  color: #7f9297;
  content: "\203A";
  font-size: 17px;
  font-weight: 900;
  margin-left: auto;
  opacity: 0;
  transform: rotate(-90deg);
  transition: opacity 0.12s ease, transform 0.16s ease;
}

.sidebar:hover .nav-menu-toggle::after,
.sidebar:focus-within .nav-menu-toggle::after {
  opacity: 1;
}

.nav-menu-toggle.active::after {
  color: #fff;
  transform: rotate(0deg);
}

.nav-icon {
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  display: inline-flex;
  font-weight: 800;
  height: 32px;
  justify-content: center;
  position: relative;
  width: 32px;
}

.nav-icon::after {
  align-items: center;
  background: #e11919;
  border: 2px solid #050505;
  border-radius: 999px;
  color: #fff;
  content: attr(data-unread-count);
  display: none;
  font-size: 10px;
  font-weight: 900;
  height: 18px;
  justify-content: center;
  line-height: 1;
  min-width: 18px;
  padding: 0 4px;
  position: absolute;
  right: -8px;
  top: 20px;
  z-index: 2;
}

.nav-item.has-unread .nav-icon::after {
  display: inline-flex;
}

.nav-icon svg {
  fill: none;
  height: 19px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 19px;
}

.nav-icon svg rect,
.nav-icon svg path,
.nav-icon svg circle {
  vector-effect: non-scaling-stroke;
}

.nav-label,
.brand div,
.user-box strong,
.user-box span {
  opacity: 0;
  transition: opacity 0.12s ease;
}

.sidebar:hover .nav-label,
.sidebar:hover .brand div,
.sidebar:hover .user-box strong,
.sidebar:hover .user-box span,
.sidebar:focus-within .nav-label,
.sidebar:focus-within .brand div,
.sidebar:focus-within .user-box strong,
.sidebar:focus-within .user-box span {
  opacity: 1;
}

body.sidebar-force-collapsed .sidebar .nav-label,
body.sidebar-force-collapsed .sidebar .brand div,
body.sidebar-force-collapsed .sidebar .user-box strong,
body.sidebar-force-collapsed .sidebar .user-box span {
  opacity: 0;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.nav-item.active .nav-icon {
  background: #ffffff;
  color: #000000;
}

.nav-submenu {
  display: none;
  gap: 2px;
  margin: -2px 0 5px 45px;
  min-width: 174px;
  padding: 1px 0 4px 8px;
  position: relative;
}

.nav-submenu::before {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  bottom: 7px;
  content: "";
  left: 0;
  position: absolute;
  top: 5px;
  width: 1px;
}

.nav-submenu button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: #b8c9c6;
  cursor: pointer;
  display: flex;
  font-size: 12px;
  font-weight: 750;
  gap: 8px;
  min-height: 28px;
  padding: 6px 8px;
  text-align: left;
}

.nav-submenu button::before {
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: #dce9e7;
  content: "\2022";
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 900;
  height: 20px;
  justify-content: center;
  width: 20px;
}

.nav-submenu [data-goto-view="energy"]::before {
  content: "\26A1";
}

.nav-submenu [data-goto-view="mobile"]::before {
  content: "\260E";
}

.nav-submenu [data-goto-view="retentions"]::before {
  content: "\21BB";
}

.nav-submenu [data-goto-view="requests"]::before {
  content: "\002B";
}

.nav-submenu [data-goto-view="tasks"]::before {
  content: "\2713";
}

.nav-submenu [data-goto-view="finance"]::before {
  content: "\20AC";
}

.nav-submenu [data-report-group="commercial"]::before {
  content: "\25A6";
}

.nav-submenu [data-report-group="finance"]::before {
  content: "\20AC";
}

.nav-submenu [data-goto-view="admin"]::before {
  content: "\2713";
}

.nav-submenu [data-goto-view="audit"]::before {
  content: "\21BA";
}

.nav-submenu [data-goto-view="partners"]::before {
  content: "\25EB";
}

.nav-submenu [data-tool-section="comparison"]::before {
  content: "\2248";
}

.nav-submenu [data-tool-section="proposal"]::before {
  content: "\270E";
}

.nav-submenu [data-tool-section="manuals"]::before {
  content: "\1F5CE";
}

.nav-submenu [data-goto-view="toolsUpdate"]::before {
  content: "\21E7";
}

.nav-submenu [data-finance-report="Partner Settlements"]::before {
  content: "\2713";
}

.nav-submenu [data-finance-report="Airtime Settlements"]::before {
  content: "\20AC";
}

.nav-submenu [data-finance-report="Settlement History"]::before {
  content: "\21BA";
}

.nav-submenu [data-finance-report="Import Provider Commissions"]::before {
  content: "\21E7";
}

.nav-submenu [data-finance-report="Import Airtime"]::before {
  content: "\21A5";
}

.nav-submenu [data-finance-report="Profit & Loss"]::before {
  content: "\03A3";
}

.nav-submenu [data-finance-report="Financial transactions"]::before {
  content: "\20AC";
}

.nav-submenu [data-finance-report="Company Reports"]::before {
  content: "\25A6";
}

.nav-submenu [data-finance-report="Payments Reminder"]::before {
  content: "\23F0 \FE0E";
}

.nav-submenu [data-infoportal-product="energy"]::before {
  content: "\26A1";
}

.nav-submenu [data-infoportal-product="mobile"]::before {
  content: "\260E";
}

.nav-submenu button:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.nav-submenu button.has-unread::after {
  align-items: center;
  background: #e11919;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #fff;
  content: attr(data-unread-count);
  display: inline-flex;
  font-size: 10px;
  font-weight: 900;
  height: 18px;
  justify-content: center;
  line-height: 1;
  margin-left: auto;
  min-width: 18px;
  padding: 0 5px;
}

.sidebar:hover .nav-submenu.open,
.sidebar:focus-within .nav-submenu.open {
  display: grid;
}

body.sidebar-force-collapsed .nav-submenu,
.nav-submenu.partner-hidden {
  display: none !important;
}

.commissioning-nav-item,
.commissioning-submenu {
  display: none !important;
}

body:not(.commissioning-standalone) .nav-item[data-view="commissioning"] {
  display: none !important;
}

body.commissioning-standalone .nav-item:not([data-view="commissioning"]):not(.commissioning-nav-item),
body.commissioning-standalone .reports-submenu {
  display: none !important;
}

body.commissioning-standalone .nav-item[data-view="commissioning"] {
  display: none !important;
}

body.commissioning-standalone .commissioning-nav-item {
  display: flex !important;
}

body.commissioning-standalone .commissioning-submenu {
  display: none !important;
}

body.commissioning-standalone .sidebar:hover .commissioning-submenu.open,
body.commissioning-standalone .sidebar:focus-within .commissioning-submenu.open {
  display: grid !important;
}

.nav-submenu button.active,
body.commissioning-standalone .commissioning-submenu button.active {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-weight: 900;
}

.nav-submenu button.active::before {
  background: #fff;
  color: #050505;
}

body.commissioning-standalone #financeTabs {
  display: none;
}

body.commissioning-standalone .user-box > span,
body.commissioning-standalone #roleSwitch,
body.commissioning-standalone #partnerSwitch {
  display: none !important;
}

body.commissioning-standalone .user-box {
  padding: 10px;
}

body.commissioning-standalone #financeTabs .report-tab {
  align-items: center;
  display: flex;
  gap: 9px;
  justify-content: flex-start;
  min-height: 42px;
  text-align: left;
}

.commissioning-tab-icon {
  align-items: center;
  background: rgba(7, 128, 111, 0.12);
  border-radius: 7px;
  color: #07806f;
  display: inline-flex;
  font-weight: 900;
  height: 26px;
  justify-content: center;
  min-width: 26px;
}

body.commissioning-standalone #financeTabs .report-tab.active .commissioning-tab-icon {
  background: #fff;
  color: #07806f;
}

.commissioning-welcome {
  display: grid;
  gap: 16px;
}

.commissioning-hero {
  align-items: end;
  background: linear-gradient(135deg, #050505 0%, #101820 58%, #073f37 100%);
  border-radius: 14px;
  color: #fff;
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr) auto;
  overflow: hidden;
  padding: 26px 28px;
  position: relative;
}

.commissioning-hero::after {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  content: "";
  height: 180px;
  position: absolute;
  right: -50px;
  top: -70px;
  width: 180px;
}

.commissioning-hero .eyebrow {
  color: #9bd7cb;
  font-weight: 900;
}

.commissioning-hero h2 {
  color: #fff;
  font-size: 28px;
  line-height: 1.15;
  margin: 8px 0;
  max-width: 760px;
}

.commissioning-hero span {
  color: #c2d2d6;
}

.commissioning-hero-total {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  display: grid;
  gap: 6px;
  min-width: 230px;
  padding: 18px;
  position: relative;
  z-index: 1;
}

.commissioning-hero-total span {
  color: #9bd7cb;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.commissioning-hero-total strong {
  color: #fff;
  font-size: 28px;
}

.commissioning-kpis {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.commissioning-kpis article,
.commissioning-actions button {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.commissioning-kpis article {
  display: grid;
  gap: 6px;
  padding: 15px;
  position: relative;
}

.commissioning-kpis article::before {
  background: #07806f;
  border-radius: 999px;
  content: "";
  height: 4px;
  left: 15px;
  position: absolute;
  right: 15px;
  top: 0;
}

.commissioning-kpis article.attention::before {
  background: #c47a00;
}

.commissioning-kpis span,
.commissioning-actions span,
.commissioning-kpis small,
.commissioning-activity small {
  color: #5f7184;
  font-size: 12px;
  font-weight: 800;
}

.commissioning-kpis strong {
  color: #0d2233;
  font-size: 22px;
}

.commissioning-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
}

.commissioning-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(170px, 1fr));
}

.commissioning-actions button {
  align-content: start;
  cursor: pointer;
  display: grid;
  gap: 5px;
  padding: 16px;
  position: relative;
  text-align: left;
}

.commissioning-actions b {
  align-items: center;
  background: #061725;
  border-radius: 10px;
  color: #fff;
  display: inline-flex;
  font-size: 18px;
  height: 34px;
  justify-content: center;
  margin-bottom: 8px;
  width: 34px;
}

.commissioning-actions button:hover {
  border-color: #07806f;
  transform: translateY(-1px);
}

.commissioning-actions strong {
  color: #0d2233;
  font-size: 15px;
}

.commissioning-activity {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
  padding: 14px;
}

.commissioning-section-title {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding-bottom: 9px;
}

.commissioning-activity button {
  background: #f8fafb;
  border: 1px solid #dfe8ef;
  border-left: 4px solid #07806f;
  border-radius: 9px;
  cursor: pointer;
  display: grid;
  gap: 3px;
  padding: 10px;
  text-align: left;
}

.commissioning-activity button:hover {
  background: #eef8f6;
}

.commissioning-activity button span {
  color: #0d2233;
  font-weight: 900;
}

.finance-kpi {
  border: 1px solid var(--line);
  cursor: pointer;
  display: grid;
  gap: 4px;
  text-align: left;
}

.finance-kpi.attention {
  border-color: #f0b84d;
  box-shadow: 0 0 0 1px rgba(240, 184, 77, 0.2), var(--shadow);
}

.finance-kpi span {
  color: #5f7184;
  font-size: 12px;
  font-weight: 900;
}

.finance-dashboard-grid {
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
}

.finance-action-grid {
  display: grid;
  gap: 10px;
}

.finance-action-grid button {
  background: #f8fbfb;
  border: 1px solid #d8e5e6;
  border-left: 4px solid #07806f;
  border-radius: 10px;
  cursor: pointer;
  display: grid;
  gap: 4px;
  padding: 12px;
  text-align: left;
}

.finance-action-grid button:hover,
.finance-kpi:hover {
  border-color: #07806f;
  transform: translateY(-1px);
}

.finance-action-grid strong {
  color: #0d2233;
  font-size: 14px;
}

.finance-action-grid span {
  color: #5f7184;
  font-size: 12px;
  font-weight: 800;
}

.finance-money-chart {
  min-height: 330px;
}

.user-box {
  margin-top: 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-width: 224px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-8px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.sidebar:hover .user-box,
.sidebar:focus-within .user-box {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

body.commissioning-standalone .user-box {
  padding: 10px;
}

body.sidebar-force-collapsed .sidebar .user-box,
body.sidebar-force-collapsed .sidebar:hover .user-box,
body.sidebar-force-collapsed .sidebar:focus-within .user-box {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-8px);
}

.sidebar-select {
  background: #121212;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  min-height: 34px;
  width: 100%;
}

.sidebar-logout {
  background: #fff;
  color: #111;
  min-height: 34px;
}

.sidebar-social {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: auto;
  margin-bottom: 12px;
  min-width: 224px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-8px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.sidebar:hover .sidebar-social,
.sidebar:focus-within .sidebar-social {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

body.sidebar-force-collapsed .sidebar .sidebar-social,
body.sidebar-force-collapsed .sidebar:hover .sidebar-social,
body.sidebar-force-collapsed .sidebar:focus-within .sidebar-social {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-8px);
}

.sidebar-social-link {
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.88);
  display: flex;
  height: 34px;
  justify-content: center;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
  width: 34px;
}

.sidebar-social-link:hover,
.sidebar-social-link:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  transform: translateY(-1px);
}

.sidebar-social-link svg {
  fill: none;
  height: 17px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 17px;
}

.sidebar-social-link:first-child svg,
.sidebar-social-link:nth-child(2) svg {
  fill: currentColor;
  stroke: none;
}

.main {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 0;
  padding: 18px 26px 24px;
  margin-left: 96px;
  overflow: hidden;
  width: calc(100vw - 96px);
}

.topbar,
.toolbar,
.panel-header,
.dialog-header,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
}

.confirm-dialog .dialog-header {
  align-items: flex-start;
}

.confirm-dialog .dialog-header h2 {
  font-size: 21px;
}

.topbar {
  flex: 0 0 auto;
  align-items: center;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0 2px 6px;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.18;
}

h2 {
  font-size: 18px;
}

.quick-actions,
.toolbar {
  flex-wrap: wrap;
}

.quick-actions {
  justify-content: flex-end;
  margin-left: auto;
}

.page-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-left: auto;
}

.page-actions .btn {
  min-height: 40px;
  padding-left: 18px;
  padding-right: 18px;
}

.source-badge {
  background: #ffffff;
  border: 1px solid #cfe7d6;
  border-radius: 999px;
  color: var(--ok);
  display: none;
  font-size: 12px;
  margin-top: 7px;
  padding: 5px 10px;
}

.btn {
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  min-height: 38px;
  padding: 8px 14px;
  white-space: nowrap;
}

.btn.primary {
  background: #07806f;
  color: #fff;
}

.btn.primary:hover {
  background: #056b5d;
}

.btn.danger {
  background: #fff0ee;
  border-color: #e3837c;
  color: #b42318;
}

.btn.danger:hover {
  background: #b42318;
  border-color: #b42318;
  color: #fff;
}

.btn.ok {
  background: #e8f7ed;
  border-color: #91d3a6;
  color: #137333;
}

.btn.ok:hover {
  background: #137333;
  border-color: #137333;
  color: #fff;
}

.btn.secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.partner-tree-form {
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) auto;
}

.partner-tree-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  max-height: 280px;
  overflow: auto;
  padding-right: 4px;
}

.partner-tree-group {
  background: #f8fbfc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 10px;
}

.partner-tree-group > strong {
  color: #0f2233;
  font-size: 15px;
}

.partner-tree-item {
  align-items: center;
  background: #fff;
  border: 1px solid #e0e9ef;
  border-radius: 7px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-left: 14px;
  padding: 8px 10px;
}

.partner-tree-item strong {
  color: #0f2233;
}

.partner-tree-item span {
  color: #5d6b78;
  font-size: 13px;
}

.partner-tree-item small {
  color: #71808d;
  display: block;
  font-size: 11px;
  font-weight: 800;
  margin-top: 2px;
}

.data-health-list {
  display: grid;
  gap: 8px;
  max-height: 340px;
  overflow: auto;
  padding-right: 4px;
}

.data-health-item {
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-left: 4px solid #8aa0b3;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px;
}

.data-health-item.warning {
  border-left-color: #d49b00;
}

.data-health-item.danger {
  border-left-color: #c62828;
}

.data-health-item strong {
  color: #0f2233;
  display: block;
}

.data-health-item span {
  color: #617181;
  font-size: 12px;
}

.data-health-item b {
  align-self: start;
  background: #eef5fb;
  border-radius: 999px;
  color: #0f2233;
  padding: 4px 9px;
}

.data-health-samples {
  border-top: 1px solid #e4edf2;
  display: grid;
  gap: 4px;
  grid-column: 1 / -1;
  padding-top: 7px;
}

.data-health-samples span {
  display: block;
  margin: -2px 0 2px;
}

.split-exp-field.hidden,
.parent-exp-display.hidden {
  display: none;
}

.split-exp-field:not(.hidden),
.exp-total-field:has(.readonly-input) {
  background: #f8fbfb;
  border: 1px solid #dce8e5;
  border-radius: 8px;
  padding: 8px;
}

.parent-exp-display input[readonly] {
  background: #f3f7fa;
  color: #425466;
  font-weight: 800;
}

.readonly-input {
  background: #f3f7fa;
  color: #425466;
  font-weight: 800;
}

.icon-btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 24px;
  height: 38px;
  line-height: 1;
  width: 38px;
}

.view {
  display: none;
  flex: 1 1 auto;
  margin-top: 12px;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}

#dashboardView.active {
  display: block;
  overflow: auto;
  overflow-x: hidden;
  padding-bottom: 28px;
}

.view.active {
  display: flex;
  flex-direction: column;
}

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

.kpi,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.kpi {
  padding: 16px;
}

.kpi span {
  color: var(--muted);
  display: block;
  font-size: 13px;
}

.kpi strong {
  display: block;
  font-size: 28px;
  margin-top: 8px;
}

.dashboard-kpis {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 4px;
}

body.partner-mode .dashboard-kpis,
body.subpartner-mode .dashboard-kpis,
body.b2b-mode .dashboard-kpis,
body.salesman-mode .dashboard-kpis,
body.backoffice-mode .dashboard-kpis {
  min-width: 0;
}

.dashboard-kpi-title,
.dashboard-kpi-card {
  border-radius: 10px;
  box-shadow: var(--shadow);
  flex: 0 0 212px;
  min-height: 112px;
  min-width: 0;
  padding: 16px;
}

.dashboard-kpi-title {
  flex-basis: 180px;
}

.dashboard-kpi-title {
  background: #050505;
  color: #fff;
}

.dashboard-kpi-title span,
.dashboard-kpi-card small {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.dashboard-kpi-title span {
  color: #9bb0b5;
}

.dashboard-kpi-title strong {
  display: block;
  font-size: 26px;
  margin-top: 18px;
}

.dashboard-kpi-card {
  background: #fff;
  border: 1px solid var(--line);
  overflow: hidden;
  position: relative;
}

.dashboard-kpi-title.role-title {
  background: linear-gradient(135deg, #050505, #17212b);
}

.dashboard-kpi-card.role-kpi {
  border-top: 4px solid #07806f;
}

.dashboard-kpi-card.role-kpi.attention {
  border-top-color: #ff3158;
}

.dashboard-kpi-card.role-kpi strong {
  font-size: 32px;
}

.dashboard-kpi-title.backoffice-title {
  flex-basis: 230px;
}

.dashboard-kpi-card.backoffice-kpi {
  border-top-color: #083f62;
}

.backoffice-dashboard-grid {
  grid-template-columns: repeat(4, minmax(260px, 1fr));
}

.backoffice-dashboard-grid .role-chart-card {
  min-height: 320px;
}

.dashboard-kpi-card::after {
  border-radius: 999px;
  content: "";
  height: 86px;
  opacity: 0.12;
  position: absolute;
  right: -26px;
  top: -28px;
  width: 86px;
}

.role-dashboard {
  display: block;
  min-height: 0;
}

.role-dashboard-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(min(100%, 520px), 1.4fr) minmax(min(100%, 340px), 0.8fr);
}

.partner-dashboard-grid {
  align-items: start;
}

.role-dashboard-charts {
  margin-bottom: 14px;
}

.role-dashboard-charts .dash-card {
  border-color: #d7e0e8;
}

.role-chart-card {
  min-height: 300px;
  overflow: hidden;
  padding: 18px;
}

.role-chart-card.wide {
  min-height: 470px;
}

.role-heatmap-card {
  min-height: 390px;
}

.role-heatmap-card .heatmap-chart-container {
  max-height: none;
  overflow-y: visible !important;
  padding-bottom: 14px !important;
}

.role-heatmap-card .dash-heatmap {
  padding-bottom: 6px;
}

.role-chart-card .panel-header {
  border-bottom: 1px solid #edf2f5;
  margin-bottom: 14px;
  padding-bottom: 12px;
}

.role-status-list {
  display: grid;
  gap: 10px;
}

.role-task-list {
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

.role-task {
  background: #f8fbfc;
  border: 1px solid #dfe8ee;
  border-left: 4px solid #07806f;
  border-radius: 8px;
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  text-align: left;
  width: 100%;
}

button.role-task {
  cursor: pointer;
  font: inherit;
}

button.role-task.is-active:hover {
  background: #eef9f5;
  border-color: #9bd8ca;
  transform: translateY(-1px);
}

.role-task strong {
  color: #102231;
}

.role-task span,
.role-empty {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.role-empty {
  background: #f8fbfc;
  border: 1px dashed #cbd8e2;
  border-radius: 8px;
  padding: 18px;
}

.dashboard-kpi-card.energy::after {
  background: #07806f;
}

.dashboard-kpi-card.telco::after {
  background: #083f62;
}

.dashboard-kpi-card.grand::after {
  background: #0f2233;
}

.dashboard-kpi-card strong {
  color: #0f2233;
  display: block;
  font-size: 26px;
  line-height: 1.3;
  margin: 16px 0 6px;
  overflow-wrap: anywhere;
}

.dashboard-kpi-card small {
  color: #526171;
  font-size: 11px;
}

.dashboard-kpi-card.energy {
  border-top: 4px solid #07806f;
}

.dashboard-kpi-card.telco {
  border-top: 4px solid #083f62;
}

.dashboard-kpi-card.grand {
  border-top: 4px solid #0f2233;
}

.dashboard-kpi-icon {
  align-items: center;
  background: #f3f7f8;
  border: 1px solid #d8e2e8;
  border-radius: 8px;
  color: #0f2233;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.dashboard-kpi-icon svg {
  fill: none;
  height: 20px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
  width: 20px;
}

.dashboard-kpi-card.energy .dashboard-kpi-icon {
  color: #07806f;
}

.dashboard-kpi-card.telco .dashboard-kpi-icon {
  color: #083f62;
}

.dashboard-kpi-card.grand .dashboard-kpi-icon {
  background: #0f2233;
  border-color: #0f2233;
  color: #fff;
}

.kpi-euro-icon {
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.excel-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 560px), 1fr));
  gap: 10px;
  min-width: 0;
  width: 100%;
}

.dash-card {
  background: #fff;
  border: 1px solid #d8d8d8;
  border-radius: 10px;
  min-height: clamp(260px, 36vw, 340px);
  min-width: 0;
  overflow: hidden;
  padding: 12px 14px;
  position: relative;
}

.dash-card h2 {
  color: #6d6d6d;
  font-size: 17px;
  font-weight: 500;
  margin: 0 0 8px;
  text-align: center;
}

.pie-card {
  grid-row: span 2;
  min-height: clamp(520px, 68vw, 620px);
}

.dash-card.wide {
  min-height: clamp(300px, 42vw, 360px);
}

.dash-logo {
  background: #000;
  border-radius: 2px;
  height: 66px;
  padding: 8px;
  position: absolute;
  right: 12px;
  top: 12px;
  width: 72px;
}

.dash-logo img {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.pivot-filter {
  background: linear-gradient(#eeeeee, #cfcfcf);
  border: 1px solid #b5b5b5;
  border-radius: 2px;
  color: #333;
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 8px;
  padding: 3px 7px;
}

.status-legend {
  display: grid;
  gap: 7px;
  left: 18px;
  max-width: 190px;
  position: absolute;
  top: 18px;
  z-index: 2;
}

.legend-item {
  align-items: center;
  display: flex;
  font-size: 12px;
  gap: 6px;
}

.legend-item.rich {
  align-items: start;
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 2px 7px;
  line-height: 1.15;
}

.legend-item.rich .legend-swatch {
  margin-top: 3px;
}

.legend-item.rich strong {
  color: #17212b;
  font-size: 12px;
  font-weight: 800;
}

.legend-item.rich em {
  color: #526171;
  font-size: 11px;
  font-style: normal;
  grid-column: 2;
}

.legend-swatch {
  display: inline-block;
  height: 7px;
  width: 7px;
}

.pie-wrap {
  align-items: center;
  display: flex;
  height: clamp(430px, 60vw, 540px);
  justify-content: center;
  position: relative;
}

.status-pie-svg {
  height: 100%;
  max-width: 100%;
  overflow: visible;
  width: min(720px, 100%);
}

.pie-top-slice {
  stroke: rgba(255, 255, 255, 0.45);
  stroke-width: 1;
}

.donut-hole {
  fill: #fff;
  filter: drop-shadow(0 2px 8px rgba(15, 34, 51, 0.12));
}

.donut-total-label {
  fill: #526171;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.donut-total {
  fill: #0f2233;
  font-size: 28px;
  font-weight: 900;
}

.pie-label-main {
  color: #ffffff;
  font-size: 14px;
  left: 46%;
  line-height: 1.35;
  position: absolute;
  text-align: center;
  top: 58%;
  transform: translate(-50%, -50%);
  white-space: pre-line;
}

.dashboard-status-table {
  bottom: 12px;
  display: none;
  left: 12px;
  position: absolute;
  width: 260px;
}

.excel-bars {
  align-items: end;
  display: flex;
  gap: 8px;
  height: 235px;
  overflow-x: auto;
  padding: 10px 8px 26px;
}

.excel-bars.dash-chart-container {
  align-items: stretch;
  display: block;
  height: 290px;
  overflow: hidden;
  padding: 4px 0 0;
}

.excel-bars.grouped.dash-chart-container {
  height: 325px;
}

.excel-bars.role-monthly-chart.dash-chart-container {
  height: 382px;
  overflow: visible;
}

.excel-bars.small.dash-chart-container,
.excel-bars.green.dash-chart-container {
  height: 290px;
}

.excel-bars.small {
  height: 190px;
}

.excel-bars.grouped {
  height: 300px;
}

.excel-bar-item {
  align-items: center;
  display: flex;
  flex: 0 0 38px;
  flex-direction: column;
  height: 100%;
  justify-content: end;
  min-width: 38px;
  position: relative;
}

.excel-bar {
  background: #155f7d;
  min-height: 2px;
  width: 22px;
}

.excel-bars.provider .excel-bar,
.excel-bars.green .excel-bar {
  background: #157326;
}

.excel-bars.purple .excel-bar {
  background: #a02b93;
}

.excel-bars.small .excel-bar {
  background: linear-gradient(#d8e0e4, #0f5874);
}

.bar-value {
  color: #4a4a4a;
  font-size: 10px;
  margin-bottom: 4px;
  writing-mode: vertical-rl;
}

.bar-label {
  bottom: -24px;
  color: #666;
  font-size: 10px;
  max-width: 60px;
  overflow: hidden;
  position: absolute;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-chart-empty {
  align-items: center;
  color: #6b7785;
  display: flex;
  font-size: 13px;
  height: 100%;
  justify-content: center;
}

.dash-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 0 8px;
}

.dash-chart-legend span {
  align-items: center;
  color: #405261;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
}

.dash-chart-legend i {
  border-radius: 3px;
  display: inline-block;
  height: 10px;
  width: 10px;
}

.dash-chart-scroll {
  height: calc(100% - 22px);
  overflow-x: auto;
  overflow-y: visible;
  padding: 4px 0 24px;
}

.role-monthly-chart .dash-chart-scroll {
  height: 360px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 0 0 18px;
}

.dash-svg-chart {
  display: block;
  height: 100%;
  width: 100%;
}

.role-monthly-chart .dash-svg-chart {
  height: 350px;
  width: auto;
}

.dash-axis {
  stroke: #c7d2dc;
  stroke-width: 1;
}

.dash-month-band {
  fill: #f5f8fa;
}

.dash-chart-label {
  fill: #526171;
  font-size: 11px;
  font-weight: 850;
}

.role-monthly-chart .dash-chart-label {
  fill: #1f3447;
  font-size: 12px;
  font-weight: 900;
}

.role-monthly-chart .dash-chart-value {
  font-size: 12px;
  font-weight: 900;
}

.dash-chart-value {
  fill: #263746;
  font-size: 11px;
  font-weight: 900;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 3px;
}

.line-point-label,
.line-end-label,
.money-bar-label {
  font-size: 10px;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 3px;
}

.dash-line {
  fill: none;
  stroke-width: 3;
}

.dash-ranking {
  display: grid;
  align-content: start;
  gap: 8px;
  height: 100%;
  overflow: auto;
  padding: 2px 0 18px;
}

.dash-ranking-row {
  align-items: center;
  background: #fbfcfd;
  border: 1px solid #e2ebf1;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: 24px minmax(95px, 1fr) minmax(130px, 2fr) 52px;
  padding: 7px 9px;
}

.dash-ranking-row span {
  align-items: center;
  background: #eef5f8;
  border-radius: 999px;
  color: #405261;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  height: 22px;
  justify-content: center;
  width: 22px;
}

.dash-ranking-row strong {
  color: #17212b;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-ranking-row strong.dash-provider-logo {
  align-items: center;
  display: flex;
  justify-content: center;
  overflow: visible;
}

.dash-ranking-row .report-provider-logo .provider-cell img,
.heat-provider .report-provider-logo .provider-cell img {
  height: 24px;
  width: 54px;
}

.dash-ranking-row div {
  background: #edf3f6;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.dash-ranking-row i {
  background: linear-gradient(90deg, #07806f, #18a590);
  display: block;
  height: 100%;
}

.dash-ranking-row b {
  color: #0f2233;
  font-size: 12px;
  text-align: right;
}

.dash-ranking-row b small {
  color: #6a7885;
  display: block;
  font-size: 10px;
  font-weight: 700;
}

.dash-heatmap {
  display: grid;
  gap: 4px;
  grid-template-columns: 86px repeat(var(--heat-cols), minmax(64px, 1fr));
  min-width: 100%;
  padding-right: 10px;
  width: max-content;
}

.heatmap-chart-container {
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding-bottom: 8px !important;
}

.heat-head,
.heat-month,
.heat-provider,
.heat-cell {
  align-items: center;
  display: flex;
  min-height: 26px;
}

.heat-head {
  background: #fff;
  left: 0;
  position: sticky;
  z-index: 5;
}

.heat-month {
  color: #526171;
  font-size: 10px;
  font-weight: 800;
  justify-content: center;
}

.heat-provider {
  background: #fff;
  left: 0;
  position: sticky;
  z-index: 4;
  justify-content: center;
  color: #17212b;
  font-size: 11px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.heat-cell {
  border-radius: 5px;
  color: #08261f;
  font-size: 11px;
  font-weight: 900;
  justify-content: center;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.panel-header span {
  color: var(--muted);
  font-size: 13px;
}

.metric-list,
.audit-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.metric-row {
  align-items: center;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(110px, auto);
  gap: 12px;
}

.bar {
  background: var(--soft);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.bar > span {
  background: var(--brand);
  display: block;
  height: 100%;
}

.mini-chart {
  align-items: end;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  height: 210px;
  margin-top: 18px;
}

.chart-bar {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  justify-content: end;
}

.chart-bar div {
  background: var(--brand);
  border-radius: 6px 6px 0 0;
  min-height: 8px;
  width: 100%;
}

.chart-bar span {
  color: var(--muted);
  font-size: 12px;
}

.toolbar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
  padding: 12px;
}

.section-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.section-actions .btn {
  min-height: 48px;
  padding-left: 18px;
  padding-right: 18px;
}

.sticky-toolbar {
  align-items: stretch;
  flex: 0 0 auto;
  flex-direction: column;
  z-index: 8;
}

.toolbar-main {
  align-items: end;
  display: grid;
  gap: 9px;
  grid-template-columns: minmax(280px, 1fr) repeat(7, minmax(86px, max-content));
  width: 100%;
}

body:not(.admin-mode) #energyView .toolbar-main {
  grid-template-columns: minmax(280px, 1fr) repeat(6, minmax(86px, max-content));
}

.retentions-toolbar-main {
  grid-template-columns: minmax(280px, 1fr) repeat(6, minmax(86px, max-content));
}

body:not(.admin-mode) #retentionsView .retentions-toolbar-main {
  grid-template-columns: minmax(280px, 1fr) repeat(5, minmax(86px, max-content));
}

.filter-field {
  display: grid;
  gap: 4px;
  min-width: 92px;
}

.filter-field.date-filter {
  min-width: 104px;
}

.filter-field span {
  color: #526171;
  font-size: 11px;
  font-weight: 700;
}

.filter-field select {
  width: 100%;
}

.finance-single-filter {
  background: #fff;
  border: 1px solid #cad5df;
  border-radius: 8px;
  color: var(--ink);
  min-height: 38px;
  padding: 7px 9px;
  width: 100%;
}

.multi-filter {
  position: relative;
}

.multi-filter-button {
  background: #fff;
  border: 1px solid #cad5df;
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  min-height: 38px;
  overflow: hidden;
  padding: 7px 24px 7px 9px;
  position: relative;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.multi-filter-button.active {
  background: #e8f7ed;
  border-color: #63c27a;
  color: #0d6f3f;
  font-weight: 700;
}

.multi-filter-button::after {
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  content: "";
  height: 7px;
  position: absolute;
  right: 13px;
  top: 13px;
  transform: rotate(45deg);
  width: 7px;
}

.multi-filter-menu {
  background: #fff;
  border: 1px solid #cad5df;
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: none;
  left: 0;
  max-height: 176px;
  min-width: 158px;
  overflow: auto;
  padding: 6px;
  position: absolute;
  top: calc(100% + 6px);
  z-index: 30;
}

.multi-filter.open .multi-filter-menu {
  display: grid;
  gap: 4px;
}

.multi-filter-menu label {
  align-items: center;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  gap: 8px;
  font-size: 12px;
  min-height: 28px;
  padding: 3px 6px;
  white-space: nowrap;
}

.multi-filter-menu input {
  min-height: auto;
}

.multi-filter-menu label:hover {
  background: #f3f7fa;
}

.quick-filter-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  width: 100%;
}

.chip {
  background: #f5f7f8;
  border: 1px solid #ccd6df;
  border-radius: 999px;
  color: #26323f;
  cursor: pointer;
  font-size: 12px;
  padding: 6px 10px;
}

.chip:hover,
.chip.active {
  background: #050505;
  border-color: #050505;
  color: #fff;
}

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

.record-count {
  color: var(--muted);
  font-size: 13px;
  margin-left: auto;
}

.daily-change-count {
  background: #f7faf9;
  border: 1px solid #d7e3eb;
  border-radius: 999px;
  color: #52606d;
  margin-left: 0;
  padding: 5px 10px;
}

.daily-change-count.has-change {
  background: #e8f7ed;
  border-color: #9bd7ad;
  color: #137333;
  font-weight: 700;
}

.search {
  flex: 1 1 240px;
  min-width: 220px;
}

.search-home {
  display: none;
}

.filter-reset {
  align-self: end;
  opacity: 0.45;
  min-height: 38px;
  width: auto;
  padding-left: 11px;
  padding-right: 11px;
}

.filter-reset.active {
  border-color: #07806f;
  color: #07806f;
  font-weight: 700;
  opacity: 1;
}

.filter-reset:disabled {
  cursor: default;
}

.date-filter input {
  min-width: 104px;
  padding-left: 8px;
  padding-right: 6px;
}

#requestsView,
#tasksView,
#auditView,
#adminView {
  overflow: auto;
  padding-right: 4px;
}

input,
select,
textarea {
  border: 1px solid #cad5df;
  border-radius: 8px;
  min-height: 38px;
  padding: 8px 10px;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: auto;
}

.admin-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
  padding-bottom: 28px;
}

.admin-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.admin-form input,
.admin-form select {
  flex: 1 1 180px;
}

.password-input-wrap {
  align-items: stretch;
  display: flex;
  flex: 1 1 180px;
  min-width: 180px;
  position: relative;
}

.password-input-wrap input {
  flex: 1 1 auto;
  min-width: 0;
  padding-right: 44px;
  width: 100%;
}

.password-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  padding: 0;
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  transition: background-color 0.15s ease, color 0.15s ease;
  width: 34px;
}

.password-toggle:hover,
.password-toggle.is-visible {
  background: #eef4f7;
  color: #0d2233;
}

.password-toggle svg {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 18px;
}

.admin-form .inline-check {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 13px;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
}

.admin-form .inline-check input {
  flex: 0 0 auto;
}

.local-db-actions .btn {
  flex: 1 1 220px;
}

.admin-help {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 12px 0 0;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag {
  background: #f3f7fa;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
}

.admin-table {
  min-width: 760px;
}

#adminView .admin-table {
  border-collapse: separate;
  border-spacing: 0;
  display: block;
  min-width: 0;
  width: 100%;
}

#adminView .admin-table thead {
  display: none;
}

#adminView .admin-table tbody {
  display: grid;
  gap: 10px;
  padding: 10px;
}

#adminView .admin-table tr {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  padding: 10px;
}

#adminView .admin-table td {
  border: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 0;
}

#adminView .admin-table-wrap {
  overflow-x: hidden;
}

#adminView .admin-user-input,
#adminView .admin-user-select {
  min-width: 0;
  width: 100%;
}

#adminView .row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

#adminView .row-actions .btn {
  flex: 1 1 92px;
  min-width: 0;
}

#adminView .admin-action-save {
  background: #e7f6ee;
  border-color: #74c69d;
  color: #11613a;
  font-weight: 800;
}

#adminView .admin-action-save:hover {
  background: #11613a;
  border-color: #11613a;
  color: #fff;
}

#adminView .admin-action-password {
  background: #e8f1ff;
  border-color: #93b9ef;
  color: #174a8b;
  font-weight: 800;
}

#adminView .admin-action-password:hover {
  background: #174a8b;
  border-color: #174a8b;
  color: #fff;
}

#adminView .admin-action-inactive {
  background: #fff0ee;
  border-color: #e3837c;
  color: #b42318;
  font-weight: 800;
}

#adminView .admin-action-inactive:hover {
  background: #b42318;
  border-color: #b42318;
  color: #fff;
}

#adminView .admin-action-active {
  background: #07806f;
  border-color: #07806f;
  color: #fff;
  font-weight: 800;
}

#adminView .admin-action-active:hover {
  background: #056b5d;
  border-color: #056b5d;
}

.request-table {
  min-width: 980px;
}

body.task-admin-mode #requestCount {
  align-items: center;
  background: #fff7e6;
  border: 1px solid #efd29a;
  border-radius: 999px;
  color: #7a5600;
  display: inline-flex;
  font-size: 12px;
  font-weight: 650;
  min-height: 28px;
  padding: 0 10px;
  white-space: nowrap;
}

body.task-admin-mode .requests-admin .panel {
  background: #ffffff;
}

body.task-admin-mode .requests-admin .admin-table-wrap {
  max-height: min(64vh, 680px);
}

body.task-admin-mode .requests-admin .request-table {
  min-width: 1180px;
}

body.task-admin-mode .requests-admin .request-table th {
  background: #f7fafc;
  color: #263847;
  font-size: 11px;
  font-weight: 650;
  padding-bottom: 9px;
  padding-top: 9px;
}

body.task-admin-mode .requests-admin .request-table td {
  padding-bottom: 7px;
  padding-top: 7px;
  vertical-align: middle;
}

body.task-admin-mode .requests-admin .request-processing-row:hover td {
  background: #f6fbfc;
}

body.task-admin-mode .requests-admin .request-table :is(th, td):nth-child(6),
body.task-admin-mode .requests-admin .request-table :is(th, td):nth-child(9) {
  border-left: 1px solid #edf2f5;
}

body.task-admin-mode .request-date-cell {
  color: #5f7184;
  font-size: 12px;
  white-space: nowrap;
}

body.task-admin-mode .request-client-cell .name-link {
  color: #0d4f72;
  font-weight: 650;
  max-width: 180px;
}

body.task-admin-mode .request-type-cell .muted-cell,
body.task-admin-mode .request-client-cell .muted-cell {
  font-size: 11px;
}

body.task-admin-mode .request-partner-cell,
body.task-admin-mode .request-tax-cell {
  color: #33485a;
  font-size: 12px;
}

body.task-admin-mode .task-assignee-field {
  display: grid;
  gap: 2px;
  min-width: 135px;
}

body.task-admin-mode .task-assignee-field span {
  color: #6b7b88;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
}

body.task-admin-mode .task-assignee-field .compact-select {
  min-height: 30px;
}

body.task-admin-mode .request-status-cell .status-dot {
  font-size: 11px;
  font-weight: 650;
  padding: 4px 8px;
  white-space: nowrap;
}

body.task-admin-mode .status-dot.request-pending {
  background: #fff7e6;
  border: 1px solid #efd29a;
  color: #7a5600;
}

body.task-admin-mode .status-dot.request-returned {
  background: #fff0ee;
  border: 1px solid #efbeb9;
  color: #a33b32;
}

body.task-admin-mode .status-dot.request-to-sign {
  background: #eef6ff;
  border: 1px solid #bfdbf4;
  color: #20577f;
}

body.task-admin-mode .status-dot.request-completed {
  background: #eaf7ef;
  border: 1px solid #bfe5ca;
  color: #1b6c3a;
}

body.task-admin-mode .task-context-chip {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
  margin-top: 4px;
  padding: 4px 7px;
  white-space: nowrap;
}

body.task-admin-mode .task-context-chip.pending-issue {
  background: #fff7e6;
  border: 1px solid #efd29a;
  color: #7a5600;
}

body.task-admin-mode .task-context-chip.request-clarification {
  background: #eef4f8;
  border: 1px solid #d4e2ea;
  color: #345366;
}

body.task-admin-mode .task-context-chip.request-registration {
  background: #eef7f4;
  border: 1px solid #c8e4da;
  color: #17614f;
}

body.task-admin-mode .task-context-chip.request-signing {
  background: #eef6ff;
  border: 1px solid #bfdbf4;
  color: #20577f;
}

body.task-admin-mode .task-context-chip.request-signed {
  background: #eaf7ef;
  border: 1px solid #bfe5ca;
  color: #1b6c3a;
}

body.task-admin-mode .request-files-cell {
  max-width: 230px;
}

body.task-admin-mode .request-file-group {
  align-items: center;
  gap: 3px;
  margin-bottom: 2px;
}

body.task-admin-mode .request-file-group span {
  color: #6b7b88;
  flex: 0 0 100%;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.1;
}

body.task-admin-mode .request-files-cell .file-pill {
  align-items: center;
  background: #f4f8fb;
  border-color: #d5e2ea;
  color: #33485a;
  display: inline-flex;
  font-size: 11px;
  gap: 5px;
  line-height: 1;
  margin: 1px;
  max-width: 145px;
  min-height: 22px;
  overflow: hidden;
  padding: 0 7px;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

body.task-admin-mode .request-files-cell .file-pill::before {
  color: #6d8798;
  content: "PDF";
  flex: 0 0 auto;
  font-size: 9px;
  font-weight: 650;
}

body.task-admin-mode .request-file-actions {
  margin-top: 4px;
}

body.task-admin-mode .request-file-actions .btn {
  min-height: 26px;
  padding: 4px 8px;
}

body.task-admin-mode .request-actions-cell {
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
  min-width: 210px;
}

body.task-admin-mode .request-actions-cell .btn {
  min-height: 28px;
  padding: 5px 8px;
}

.energy-table th:nth-child(1),
.energy-table th:nth-child(5),
.energy-table th:nth-child(6),
.energy-table th:nth-child(7),
.energy-table th:nth-child(10),
.energy-table th:nth-child(12),
.energy-table td:nth-child(1),
.energy-table td:nth-child(5),
.energy-table td:nth-child(6),
.energy-table td:nth-child(7),
.energy-table td:nth-child(10),
.energy-table td:nth-child(12),
.retentions-table th:nth-child(1),
.retentions-table th:nth-child(5),
.retentions-table th:nth-child(6),
.retentions-table th:nth-child(7),
.retentions-table th:nth-child(9),
.retentions-table th:nth-child(11),
.retentions-table td:nth-child(1),
.retentions-table td:nth-child(5),
.retentions-table td:nth-child(6),
.retentions-table td:nth-child(7),
.retentions-table td:nth-child(9),
.retentions-table td:nth-child(11) {
  text-align: center;
}

.mobile-table th:nth-child(1),
.mobile-table th:nth-child(5),
.mobile-table th:nth-child(6),
.mobile-table th:nth-child(10),
.mobile-table td:nth-child(1),
.mobile-table td:nth-child(5),
.mobile-table td:nth-child(6),
.mobile-table td:nth-child(10) {
  text-align: center;
}

.request-form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.request-form-panel {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfe 100%);
}

.request-form-panel .panel-header {
  align-items: flex-start;
  border-bottom: 1px solid #e7eef4;
  padding-bottom: 14px;
}

.request-form .form-section {
  background: #fff;
  border: 1px solid #dbe5ec;
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(24, 39, 75, 0.04);
  padding: 16px;
}

.request-form .form-section h3 {
  color: #0f2233;
  font-size: 15px;
  margin-bottom: 14px;
}

.request-form .field span {
  color: #394a5a;
  font-size: 13px;
  font-weight: 800;
}

.request-form .field .required-star,
.field .required-star,
.pending-note-field .required-star {
  color: #d71920;
  font-weight: 900;
}

.request-form input,
.request-form select,
.request-form textarea {
  background: #fbfdff;
}

.request-form input:focus,
.request-form select:focus,
.request-form textarea:focus {
  border-color: #07806f;
  box-shadow: 0 0 0 3px rgba(7, 128, 111, 0.11);
  outline: none;
}

.address-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(96px, 0.45fr) minmax(0, 1fr) minmax(0, 1fr) minmax(110px, 0.55fr);
}

.request-actions {
  background: #f8fbfc;
  border: 1px solid #dbe5ec;
  border-radius: 10px;
  justify-content: flex-end;
  padding: 12px;
}

.documents-header {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.documents-header h3 {
  margin-bottom: 6px;
}

.documents-header p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.request-documents-wrap {
  overflow-x: auto;
}

.request-documents-table {
  border-collapse: collapse;
  min-width: 920px;
  width: 100%;
}

.request-documents-table th,
.request-documents-table td {
  border-bottom: 1px solid #e6edf3;
  color: #394a5a;
  font-size: 13px;
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
}

.request-documents-table th {
  color: #435261;
  font-weight: 900;
}

.request-documents-table td:first-child {
  font-weight: 700;
  min-width: 260px;
}

.request-documents-table .doc-file-name {
  color: #0f2233;
  font-weight: 700;
  min-width: 190px;
}

.request-documents-table .doc-comment,
.request-documents-table .doc-category-input {
  min-height: 34px;
  width: 100%;
}

.file-action {
  display: inline-flex;
  overflow: hidden;
  position: relative;
}

.file-action input {
  cursor: pointer;
  inset: 0;
  opacity: 0;
  position: absolute;
}

.btn.small {
  min-height: 28px;
  padding: 6px 10px;
}

.remove-doc-row {
  margin-left: 6px;
}

.clear-doc-file {
  margin-left: 6px;
  white-space: nowrap;
}

.request-comments-field {
  margin-top: 14px;
}

.request-card-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.request-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.request-card span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.partner-task-list {
  margin-top: 14px;
}

.partner-task-table {
  min-width: 960px;
}

body.task-partner-mode #returnedRequestCount {
  align-items: center;
  background: #eef7f4;
  border: 1px solid #c9e4dc;
  border-radius: 999px;
  color: #126b5b;
  display: inline-flex;
  font-size: 12px;
  font-weight: 625;
  min-height: 26px;
  padding: 0 9px;
  white-space: nowrap;
}

#tasksView .panel-header {
  justify-content: flex-start;
}

body.task-partner-mode .returned-requests-panel {
  background: #ffffff;
}

body.task-partner-mode .partner-task-list {
  margin-top: 10px;
}

body.task-partner-mode .partner-task-table-wrap {
  max-height: min(62vh, 620px);
}

body.task-partner-mode .partner-task-table {
  min-width: 1040px;
}

body.task-partner-mode .partner-task-table th {
  background: #f5f8fa;
  color: #263847;
  font-size: 11px;
  font-weight: 625;
  padding-bottom: 8px;
  padding-top: 8px;
}

body.task-partner-mode .partner-task-table td {
  padding-bottom: 7px;
  padding-top: 7px;
  vertical-align: middle;
}

body.task-partner-mode .partner-task-table tbody tr:hover td {
  background: #f7fbfc;
}

body.task-partner-mode .partner-task-table .name-link {
  color: #0d4f72;
  font-weight: 650;
}

body.task-partner-mode .partner-task-table .muted-cell {
  font-size: 11px;
}

body.task-partner-mode .partner-task-table .return-comment-cell {
  background: #fff9e8;
  border-left: 2px solid #ecd18a;
  color: #4d3900;
  font-size: 12px;
  max-width: 230px;
  min-width: 150px;
  padding-left: 9px;
}

body.task-partner-mode .partner-task-table .return-comment-cell.is-empty {
  background: #f7f9fa;
  border-left-color: #dbe4ea;
  color: #8a97a3;
  font-style: italic;
}

body.task-partner-mode .partner-task-table .return-comment-cell.is-empty span {
  color: inherit;
}

body.task-partner-mode .partner-task-table .request-source-badge,
body.task-partner-mode .partner-task-table .status-dot {
  font-size: 11px;
  font-weight: 625;
  padding: 4px 7px;
}

body.task-partner-mode .partner-task-table .file-pill {
  background: #f2f7fa;
  border-color: #d5e3ea;
  color: #385264;
  font-size: 11px;
  max-width: 170px;
  overflow: hidden;
  padding: 3px 7px;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

body.task-partner-mode .partner-task-table .request-file-group {
  gap: 5px;
  margin-bottom: 4px;
}

body.task-partner-mode .partner-task-table .request-file-group span {
  color: #6f7f8c;
  font-size: 10px;
  font-weight: 625;
}

body.task-partner-mode .partner-task-table .row-actions {
  gap: 6px;
}

body.task-partner-mode .partner-task-table .row-actions .btn,
body.task-partner-mode .partner-task-table .compact-upload {
  border-radius: 6px;
  font-size: 12px;
  min-height: 30px;
  padding: 5px 9px;
}

body.task-partner-mode .partner-task-table .row-actions .btn.secondary {
  background: #f7fafb;
  border-color: #d6e2e8;
  color: #2b4658;
}

body.task-partner-mode .partner-task-table .row-actions .btn.secondary:hover:not(:disabled) {
  background: #eef5f7;
  border-color: #c7d8e0;
  color: #173549;
}

.partner-admin-list {
  margin-top: 14px;
}

.partner-admin-table-wrap {
  max-height: 360px;
}

.partner-admin-table {
  min-width: 720px;
}

.partner-name-edit {
  background: #fff;
  border: 1px solid #cbd8e3;
  border-radius: 6px;
  color: #0f2d43;
  font: inherit;
  font-weight: 800;
  min-height: 34px;
  padding: 7px 9px;
  width: min(340px, 100%);
}

.return-comment-cell {
  background: #fff8e1;
  color: #4d3900;
  line-height: 1.35;
  max-width: 260px;
  min-width: 180px;
  white-space: pre-wrap;
}

.compact-upload {
  align-items: center;
  display: inline-flex;
  min-height: 34px;
  padding: 7px 10px;
}

.compact-upload span {
  margin: 0;
}

.return-comment {
  background: #fff8e1;
  border: 1px solid #f2d680;
  border-radius: 8px;
  color: #4d3900;
  line-height: 1.45;
  padding: 10px;
  white-space: pre-wrap;
}

.inline-upload {
  align-items: center;
  border: 1px dashed #b9dff5;
  border-radius: 8px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 10px;
}

.inline-upload span,
.request-file-row strong,
.request-file-group span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.request-file-row,
.request-file-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.file-pill {
  background: #eef8ff;
  border: 1px solid #b9dff5;
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  margin: 2px;
  padding: 4px 8px;
}

.new-request-badge {
  background: #ff1f46;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.02em;
  margin-right: 8px;
  padding: 3px 6px;
  vertical-align: middle;
}

.request-source-badge {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  margin: 0 6px 2px 0;
  padding: 5px 8px;
  vertical-align: middle;
  white-space: nowrap;
}

.request-source-badge.new {
  background: #eaf8f3;
  border: 1px solid #bfe6d8;
  color: #087866;
}

.request-source-badge.retention {
  background: #fff4d8;
  border: 1px solid #f0c65c;
  color: #8b5c00;
}

.request-source-badge.returned {
  background: #fff0ee;
  border: 1px solid #efbeb9;
  color: #a33b32;
}

.request-card .request-source-badge {
  display: inline-flex;
}

.request-detail-dialog {
  max-height: calc(100vh - 32px);
  max-width: 980px;
  width: min(980px, calc(100vw - 28px));
}

.request-detail-dialog form {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
  min-height: 0;
}

.request-detail-dialog .dialog-header,
.request-detail-dialog .dialog-actions {
  flex: 0 0 auto;
}

.request-detail-dialog .dialog-actions {
  background: #fff;
  border-top: 1px solid var(--line);
  bottom: 0;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin: 0;
  padding: 12px 16px 16px;
  position: sticky;
  z-index: 2;
}

.request-detail-dialog .request-detail-content {
  flex: 1 1 auto;
  max-height: calc(100vh - 220px);
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 8px;
}

.request-type-dialog {
  max-width: 500px;
  padding: 0;
}

.request-type-dialog form {
  display: grid;
  gap: 18px;
}

.request-type-dialog .field {
  padding: 0 16px;
}

.request-type-dialog .dialog-actions {
  background: #f7f8fb;
  border-top: 1px solid #e2e8ef;
  padding: 16px;
}

.request-detail-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.request-detail-grid div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.request-detail-grid span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}

.request-detail-grid strong {
  color: var(--ink);
  font-weight: 600;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.external-record-grid {
  margin-bottom: 16px;
}

.confirm-dialog:has(.external-record-grid) {
  max-width: 920px;
  width: min(920px, calc(100vw - 28px));
}

.confirm-dialog:has(.external-record-grid) form {
  max-height: calc(100vh - 32px);
}

.confirm-dialog:has(.external-record-grid) .dialog-header {
  min-height: auto;
  padding: 14px 22px;
}

.confirm-dialog:has(.external-record-grid) .dialog-header h2 {
  font-size: 19px;
}

.confirm-dialog:has(.external-record-grid) .confirm-message {
  max-height: calc(100vh - 134px);
  overflow: auto;
}

.external-record-grid.request-detail-grid {
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.external-record-grid.request-detail-grid div {
  border-radius: 8px;
  min-height: 54px;
  padding: 8px 10px;
}

.external-record-grid.request-detail-grid span {
  font-size: 11px;
  margin-bottom: 3px;
}

.external-record-grid.request-detail-grid strong {
  font-size: 14px;
}

.external-record-grid .provider-cell {
  margin-top: 0;
}

.external-comments-section {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  padding-top: 14px;
}

.external-comments-section h3 {
  font-size: 16px;
  margin: 0;
}

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

@media (max-width: 760px) {
  .request-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .external-record-grid.request-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .request-detail-grid {
    grid-template-columns: 1fr;
  }

  .external-record-grid.request-detail-grid {
    grid-template-columns: 1fr;
  }
}

.request-detail-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.muted-cell {
  color: var(--muted);
  font-size: 12px;
}

.row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.admin-table-wrap {
  margin-top: 14px;
  max-height: 460px;
}

.status-dot {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  padding: 4px 8px;
}

.status-dot.active {
  background: #e8f7ed;
  color: var(--ok);
}

.status-dot.closed {
  background: #fff0ee;
  color: var(--danger);
}

.status-dot.warning {
  background: #fff8e1;
  color: #8a5a00;
}

.status-dot.request-pending {
  background: #fff7e6;
  border: 1px solid #efd29a;
  color: #7a5600;
}

.status-dot.request-returned {
  background: #fff0ee;
  border: 1px solid #efbeb9;
  color: #a33b32;
}

.status-dot.request-to-sign {
  background: #eef6ff;
  border: 1px solid #bfdbf4;
  color: #20577f;
}

.status-dot.request-completed {
  background: #eaf7ef;
  border: 1px solid #bfe5ca;
  color: #1b6c3a;
}

.partner-hidden,
body.partner-mode .partner-hidden,
body.subpartner-mode .partner-hidden,
body.b2b-mode .partner-hidden,
body.salesman-mode .partner-hidden,
body.qr_partner-mode .partner-hidden,
body.backoffice-mode .admin-only,
body.partner-mode .admin-only,
body.subpartner-mode .admin-only,
body.b2b-mode .admin-only,
body.salesman-mode .admin-only,
body.qr_partner-mode .admin-only,
body.finance-mode .admin-only {
  display: none !important;
}

body.partner-mode .external-lead-private,
body.subpartner-mode .external-lead-private,
body.b2b-mode .external-lead-private,
body.salesman-mode .external-lead-private,
body.qr_partner-mode .external-lead-private {
  display: none !important;
}

body.task-partner-mode .requests-admin,
body.task-admin-mode .tasks-partner,
body.user-mode #requestsView,
body.user-mode #tasksView,
body.backoffice-mode #requestsView,
body.finance-mode #requestsView,
body.finance-mode #tasksView,
body.admin-mode #requestsView {
  display: none !important;
}

body.logged-in.sql-loading .main::after {
  align-items: center;
  background: rgba(244, 246, 247, 0.94);
  color: #355064;
  content: "Φόρτωση δεδομένων από SQL...";
  display: flex;
  font-size: 14px;
  font-weight: 900;
  inset: 0;
  justify-content: center;
  pointer-events: none;
  position: fixed;
  z-index: 18;
}

body.logged-in.initial-sql-loading .main > * {
  visibility: hidden;
}

.link-button {
  background: transparent;
  border: 0;
  color: var(--primary);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0;
  text-align: left;
}

.login-reset-link {
  justify-self: flex-start;
  margin-top: -2px;
}

.login-message {
  background: #eef8f4;
  border: 1px solid #b9ded1;
  border-radius: 6px;
  color: #17634f;
  font-size: 13px;
  font-weight: 800;
  padding: 9px 10px;
}

.password-reset-row {
  background: #fffaf0;
}

.empty-state {
  color: var(--muted);
  padding: 18px 0 4px;
}

.energy-table-wrap,
.mobile-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
}

table {
  border-collapse: collapse;
  font-size: 13px;
  min-width: 1420px;
  width: 100%;
}

.energy-table,
.mobile-table {
  font-size: 12px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: middle;
}

.energy-table th,
.energy-table td,
.mobile-table th,
.mobile-table td {
  padding: 6px 8px;
}

.name-link {
  background: transparent;
  border: 0;
  color: #0b5f8a;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  padding: 0;
  text-align: left;
  white-space: normal;
}

.name-link:hover {
  text-decoration: underline;
}

.name-cell {
  align-items: center;
  display: inline-flex;
  gap: 7px;
  max-width: 220px;
}

.mini-icon-btn {
  align-items: center;
  background: #eef8f5;
  border: 1px solid #9ed7cc;
  border-radius: 999px;
  color: #067363;
  cursor: pointer;
  display: inline-flex;
  font-size: 14px;
  font-weight: 900;
  height: 24px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 24px;
}

.mini-icon-btn:hover {
  background: #07806f;
  border-color: #07806f;
  color: #fff;
}

.signal-cell {
  max-width: 44px;
  min-width: 44px;
  text-align: center;
  white-space: nowrap;
  width: 44px;
}

.mail-alert,
.paid-alert,
.clawback-alert {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  font-weight: 800;
  height: 22px;
  justify-content: center;
  line-height: 1;
  width: 22px;
}

.mail-alert {
  font-size: 14px;
}

.mail-alert.pending {
  background: #fff2a8;
  border: 1px solid #e0b900;
  color: #7a5500;
}

.mail-alert.replied {
  background: #e6f5ff;
  border: 1px solid #78bce6;
  color: #0b5f8a;
}

.paid-alert {
  background: #e8f7ed;
  border: 1px solid #63c27a;
  color: #15803d;
  font-size: 14px;
  font-weight: 900;
}

.clawback-alert {
  background: #fff0ee;
  border: 1px solid #e3837c;
  color: #b42318;
  font-size: 15px;
  font-weight: 900;
}

.tenure-badge {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  justify-content: center;
  min-width: 32px;
  padding: 4px 9px;
}

.tenure-badge.not-ready {
  background: #fff0ee;
  border: 1px solid #e3837c;
  color: #b42318;
}

.tenure-badge.ready {
  background: #e8f7ed;
  border: 1px solid #63c27a;
  color: #15803d;
}

.tenure-badge.neutral {
  background: #f1f5f8;
  border: 1px solid #cad5df;
  color: #526171;
}

.note-btn {
  background: #f5f7f8;
  border: 1px solid #cad5df;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 9px;
}

.note-btn.has-note {
  background: #fff8e1;
  border-color: #e6c85c;
  color: #6f4f00;
  font-weight: 700;
}

.note-text,
.reply-box {
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 1.45;
  padding: 12px;
  white-space: pre-wrap;
}

.note-meta {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 7px;
}

.reply-box {
  background: #eef8ff;
  border-color: #b9dff5;
  margin-top: 10px;
}

.comment-thread-preview,
.thread-entry + .thread-entry {
  margin-top: 8px;
}

.thread-entry {
  background: #f8fafb;
  border: 1px solid var(--line);
  border-left: 4px solid #0f2233;
  border-radius: 10px;
  display: grid;
  gap: 7px;
  line-height: 1.45;
  padding: 10px 12px;
}

.thread-entry.admin {
  border-left-color: #07806f;
}

.thread-entry.partner {
  background: #eef8ff;
  border-color: #b9dff5;
  border-left-color: #083f62;
}

.thread-entry-meta {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.thread-entry-meta strong {
  color: #17212b;
  font-size: 13px;
}

.thread-entry-meta span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.thread-entry-text {
  white-space: pre-wrap;
}

.reply-form {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.reply-form label {
  color: #435261;
  font-size: 13px;
  font-weight: 700;
}

.reply-form .btn {
  justify-self: end;
}

.reply-form-heading {
  display: grid;
  gap: 3px;
}

.reply-form-heading strong {
  color: #263847;
  font-size: 13px;
  font-weight: 650;
}

.reply-form-heading span {
  color: #748290;
  font-size: 12px;
  line-height: 1.35;
}

.reply-upload-field {
  background: #f7fafb;
  border: 1px dashed #c9d8e1;
  border-radius: 8px;
  color: #34495b;
  cursor: pointer;
  display: grid;
  gap: 4px;
  padding: 9px 10px;
}

.reply-upload-field:hover {
  background: #f2f8f8;
  border-color: #9bc9c0;
}

.reply-upload-field span {
  color: #2f4658;
  font-size: 12px;
  font-weight: 650;
}

.reply-upload-field small {
  color: #798894;
  font-size: 11px;
  font-weight: 500;
}

.reply-upload-field input {
  color: #526473;
  font-size: 12px;
  margin-top: 2px;
  max-width: 100%;
}

.reply-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  white-space: normal;
}

.reply-files.existing {
  margin-top: 0;
}

.readonly-field {
  display: grid;
  gap: 6px;
}

.readonly-note {
  background: #eef8ff;
  border: 1px solid #b9dff5;
  border-radius: 8px;
  line-height: 1.45;
  min-height: 60px;
  padding: 10px;
  white-space: pre-wrap;
}

th {
  background: #f8fafb;
  color: #435261;
  font-weight: 700;
  position: sticky;
  text-align: center;
  top: 0;
  z-index: 1;
}

th .provider-cell,
th .multi-filter {
  margin-left: auto;
  margin-right: auto;
}

body.partner-mode .partner-sensitive,
body.subpartner-mode .partner-sensitive,
body.b2b-mode .partner-sensitive,
body.salesman-mode .partner-sensitive,
body.finance-mode .partner-sensitive {
  display: none;
}

.energy-table th,
.mobile-table th {
  z-index: 5;
}

.energy-table th:nth-child(1),
.energy-table td:nth-child(1),
.mobile-table th:nth-child(1),
.mobile-table td:nth-child(1) {
  left: 0;
  min-width: 92px;
  position: sticky;
  z-index: 4;
}

.energy-table th:nth-child(2),
.energy-table td:nth-child(2),
.mobile-table th:nth-child(2),
.mobile-table td:nth-child(2) {
  left: 92px;
  max-width: 44px;
  min-width: 44px;
  position: sticky;
  text-align: center;
  width: 44px;
  z-index: 4;
}

.energy-table th:nth-child(3),
.energy-table td:nth-child(3),
.mobile-table th:nth-child(3),
.mobile-table td:nth-child(3) {
  left: 136px;
  min-width: 238px;
  position: sticky;
  z-index: 4;
}

.energy-table th:nth-child(10),
.energy-table td:nth-child(10),
.mobile-table th:nth-child(10),
.mobile-table td:nth-child(10) {
  min-width: 104px;
  white-space: nowrap;
}

.energy-table th:nth-child(4),
.energy-table td:nth-child(4),
.mobile-table th:nth-child(4),
.mobile-table td:nth-child(4) {
  min-width: 300px;
}

.energy-table th:nth-child(5),
.energy-table td:nth-child(5),
.mobile-table th:nth-child(5),
.mobile-table td:nth-child(5) {
  min-width: 96px;
}

.energy-table th:nth-child(6),
.energy-table td:nth-child(6) {
  min-width: 168px;
  white-space: nowrap;
}

.mobile-table th:nth-child(6),
.mobile-table td:nth-child(6) {
  min-width: 112px;
  white-space: nowrap;
}

.supply-number-cell {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.energy-table th:nth-child(-n + 3),
.mobile-table th:nth-child(-n + 3) {
  z-index: 7;
}

tbody tr:hover {
  background: #f9fcfb;
}

.energy-table tbody tr:nth-child(odd),
.mobile-table tbody tr:nth-child(odd) {
  background: #ffffff;
}

.energy-table tbody tr:nth-child(even),
.mobile-table tbody tr:nth-child(even) {
  background: #f3f7fa;
}

.energy-table tbody tr:hover,
.mobile-table tbody tr:hover {
  background: #eaf5f2;
}

.energy-table tbody tr:nth-child(odd) td:nth-child(-n + 3),
.mobile-table tbody tr:nth-child(odd) td:nth-child(-n + 3) {
  background: #ffffff;
}

.energy-table tbody tr:nth-child(even) td:nth-child(-n + 3),
.mobile-table tbody tr:nth-child(even) td:nth-child(-n + 3) {
  background: #f3f7fa;
}

.energy-table tbody tr:hover td:nth-child(-n + 3),
.mobile-table tbody tr:hover td:nth-child(-n + 3) {
  background: #eaf5f2;
}

.cell-input,
.cell-select {
  min-height: 30px;
  padding: 4px 6px;
  width: 92px;
}

.status-select,
.status-pill {
  border-width: 1px;
  font-weight: 700;
}

.status-select option {
  font-weight: 700;
}

.status-select option.status-active {
  background: #062765;
  color: #fff;
}

.status-select option.status-change-prov {
  background: #5b185d;
  color: #fff;
}

.status-select option.status-terminated {
  background: #d00000;
  color: #fff;
}

.status-select option.status-pending {
  background: #f4b183;
  color: #3d2414;
}

.status-select option.status-retention {
  background: #00b050;
  color: #fff;
}

.status-select option.status-thalis {
  background: #5b9bd5;
  color: #fff;
}

.status-select option.status-to-be-signed {
  background: #f4c7f2;
  color: #3c193a;
}

.status-select option.status-ekremotita {
  background: #fff200;
  color: #1c1c1c;
}

.status-select option.status-cancelled {
  background: #8e8e8e;
  color: #fff;
}

.status-pill {
  border: 1px solid currentColor;
  border-radius: 8px;
  display: inline-block;
  min-width: 118px;
  padding: 6px 8px;
  text-align: center;
}

.provider-cell {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-width: 56px;
  white-space: nowrap;
}

.provider-cell img {
  background: #fff;
  border: 1px solid #e3e8ee;
  border-radius: 5px;
  height: 28px;
  object-fit: contain;
  padding: 2px;
  width: 58px;
}

.provider-cell.logo-only {
  width: 64px;
}

.report-provider-logo {
  align-items: center;
  display: inline-flex;
  min-height: 30px;
}

.report-provider-logo .provider-cell {
  min-width: 64px;
}

.visually-hidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.status-active {
  background: #062765;
  border-color: #062765;
  color: #fff;
}

.status-change-prov {
  background: #5b185d;
  border-color: #5b185d;
  color: #fff;
}

.status-terminated {
  background: #d00000;
  border-color: #d00000;
  color: #fff;
}

.status-pending {
  background: #f4b183;
  border-color: #f4b183;
  color: #3d2414;
}

.status-retention {
  background: #00b050;
  border-color: #00b050;
  color: #fff;
}

.status-thalis {
  background: #5b9bd5;
  border-color: #5b9bd5;
  color: #fff;
}

.status-to-be-signed {
  background: #f4c7f2;
  border-color: #f4c7f2;
  color: #3c193a;
}

.status-ekremotita {
  background: #fff200;
  border-color: #d7cb00;
  color: #1c1c1c;
}

.status-cancelled {
  background: #8e8e8e;
  border-color: #8e8e8e;
  color: #fff;
}

.cell-select {
  width: 128px;
}

.compact-select {
  min-height: 34px;
  min-width: 156px;
  padding: 6px 8px;
}

.record-dialog {
  border: 0;
  border-radius: 12px;
  background: #f4f6f7;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.28);
  height: calc(100vh - 120px);
  left: 50%;
  margin: 0;
  max-height: calc(100vh - 120px);
  max-width: 1080px;
  overflow: hidden;
  padding: 0;
  position: fixed;
  top: 24px;
  transform: translateX(-50%);
  width: min(1080px, calc(100vw - 28px));
}

.confirm-dialog {
  border: 0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.28);
  max-width: 600px;
  width: min(600px, calc(100vw - 28px));
}

.chart-dialog {
  background: #fff;
  border: 0;
  border-radius: 12px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.28);
  max-height: calc(100vh - 56px);
  max-width: 1180px;
  overflow: hidden;
  padding: 0;
  width: min(1180px, calc(100vw - 32px));
}

.chart-dialog::backdrop {
  background: rgba(16, 32, 42, 0.48);
}

.chart-dialog form {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 56px);
}

.chart-dialog .dialog-header {
  background: linear-gradient(180deg, #050505, #151515);
  color: #fff;
  flex: 0 0 auto;
  padding: 18px 22px;
}

.chart-dialog .dialog-header .eyebrow {
  color: #9bb0b5;
  margin: 0 0 6px;
}

.chart-dialog .icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.chart-popup-content {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px;
}

.chart-pivot-shell {
  background: #fff;
  border: 1px solid #d5dce3;
  border-radius: 12px;
  display: grid;
  gap: 8px 14px;
  grid-template-columns: minmax(0, 1fr) 190px;
  grid-template-rows: auto auto minmax(360px, 1fr) auto;
  min-height: min(620px, calc(100vh - 170px));
  padding: 6px 8px 8px;
}

.chart-pivot-filter-row {
  display: flex;
  gap: 4px;
  grid-column: 1 / -1;
}

.chart-pivot-control {
  display: inline-flex;
  position: relative;
  width: max-content;
}

.chart-pivot-control span {
  background: linear-gradient(180deg, #f1f1f1, #cfcfcf);
  border: 1px solid #b7b7b7;
  border-radius: 2px;
  color: #17212b;
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 18px 4px 5px;
  pointer-events: none;
  position: relative;
  z-index: 1;
}

.chart-pivot-control span::after {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #555;
  content: "";
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-35%);
}

.chart-pivot-control select {
  appearance: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  height: 100%;
  inset: 0;
  min-height: 0;
  opacity: 0;
  padding: 0;
  position: absolute;
  width: 100%;
}

.legend-control {
  display: flex;
  margin-bottom: 2px;
  width: 100%;
}

.legend-control select {
  width: 100%;
}

.chart-pivot-filter-row span,
.chart-measure-pill,
.pivot-legend-title {
  background: linear-gradient(180deg, #f1f1f1, #cfcfcf);
  border: 1px solid #b7b7b7;
  border-radius: 2px;
  color: #17212b;
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 18px 4px 5px;
  position: relative;
  width: max-content;
}

.chart-pivot-filter-row span::after,
.pivot-legend-title::after {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #555;
  content: "";
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-35%);
}

.chart-measure-pill {
  grid-column: 1 / 2;
}

.chart-legend {
  display: grid;
  gap: 8px;
  max-height: 100%;
  overflow: auto;
}

.chart-legend span {
  align-items: center;
  color: #263746;
  display: flex;
  font-size: 12px;
  font-weight: 500;
  gap: 6px;
}

.chart-legend i {
  border-radius: 3px;
  display: inline-block;
  height: 10px;
  width: 10px;
}

.chart-scroll {
  background: #fff;
  grid-column: 1 / 2;
  grid-row: 3 / 4;
  min-height: 0;
  overflow: auto;
  padding: 0;
}

.pivot-chart-legend {
  align-self: center;
  grid-column: 2 / 3;
  grid-row: 3 / 4;
  justify-self: stretch;
}

.pivot-legend-title {
  font-weight: 700 !important;
  margin-bottom: 2px;
  width: 100%;
}

.chart-axis-filter {
  display: inline-flex;
  grid-column: 1 / 2;
  grid-row: 4 / 5;
  width: max-content;
}

.clustered-chart {
  display: block;
}

.chart-grid-line {
  stroke: #fff;
  stroke-width: 1;
}

.chart-axis-line {
  stroke: #c9c9c9;
  stroke-width: 1;
}

.chart-category-line {
  stroke: #d0d0d0;
  stroke-width: 1;
}

.chart-data-label {
  fill: #162431;
  font-size: 11px;
  font-weight: 500;
  text-anchor: middle;
}

.chart-axis-label {
  fill: #40566b;
  font-size: 11px;
  font-weight: 500;
  text-anchor: middle;
}

.chart-y-label {
  fill: #526171;
  font-size: 11px;
  text-anchor: end;
}

.empty-chart {
  align-items: center;
  background: #fbfcfd;
  border: 1px dashed #cbd7e1;
  border-radius: 8px;
  color: #526171;
  display: flex;
  min-height: 220px;
  justify-content: center;
}

.confirm-dialog::backdrop {
  background: rgba(16, 32, 42, 0.48);
}

.confirm-dialog form {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.confirm-message {
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 1.5;
  padding: 14px;
}

.pending-note-field {
  display: grid;
  gap: 6px;
  margin: 6px 0 16px;
}

.pending-note-field span {
  color: #435261;
  font-size: 13px;
  font-weight: 700;
}

.pending-note-field textarea {
  background: #fff;
  min-height: 96px;
  width: 100%;
}

.return-request-mode-field select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 40px;
  padding: 8px 10px;
  width: 100%;
}

.return-request-signing-field.hidden {
  display: none;
}

.record-dialog::backdrop {
  background: rgba(16, 32, 42, 0.48);
}

#recordForm {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.form-grid {
  align-content: start;
  display: grid;
  flex: 1 1 auto;
  gap: 14px;
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px 22px 20px;
  scrollbar-gutter: stable;
}

.record-dialog .dialog-header {
  background: linear-gradient(180deg, #050505, #151515);
  color: #fff;
  padding: 22px 24px;
}

.record-dialog .dialog-header .eyebrow {
  color: #9bb0b5;
  margin: 0 0 6px;
}

.record-dialog .dialog-header h2 {
  font-size: 24px;
}

.record-dialog .icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.form-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.form-section h3 {
  border-bottom: 1px solid #eef2f5;
  color: #17212b;
  font-size: 14px;
  margin: 0 0 14px;
  padding-bottom: 10px;
}

.form-section-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 6px;
}

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

.field > span {
  color: #435261;
  font-size: 13px;
  font-weight: 700;
}

.required-star {
  color: #d71920;
  font-weight: 900;
}

.field input,
.field select,
.field textarea {
  background: #fff;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

#requestTariffColor.tariff-color-green {
  background: #f1f8f4;
  border-color: #b9dfc3;
  box-shadow: inset 4px 0 0 #8acb99;
  color: #236a35;
}

#requestTariffColor.tariff-color-yellow {
  background: #fff9e8;
  border-color: #e7cc79;
  box-shadow: inset 4px 0 0 #dfbd4b;
  color: #735a0a;
}

#requestTariffColor.tariff-color-blue {
  background: #f1f7fc;
  border-color: #b9d3e3;
  box-shadow: inset 4px 0 0 #7fb4d6;
  color: #1f5f99;
}

#requestTariffColor option {
  background: #fff;
  color: #263847;
}

#requestTariffColor option[value="green"] {
  background: #f1f8f4;
  color: #236a35;
}

#requestTariffColor option[value="yellow"] {
  background: #fff9e8;
  color: #735a0a;
}

#requestTariffColor option[value="blue"] {
  background: #f1f7fc;
  color: #1f5f99;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.pending-note-field textarea:focus,
.confirm-dialog input:focus,
.confirm-dialog select:focus,
.confirm-dialog textarea:focus {
  border-color: #07806f;
  box-shadow: 0 0 0 3px rgba(7, 128, 111, 0.13);
  outline: none;
}

.field.is-invalid > span,
.pending-note-field.is-invalid > span {
  color: #b42318;
}

.field.is-invalid input,
.field.is-invalid select,
.field.is-invalid textarea,
.pending-note-field.is-invalid textarea,
.pending-note-field.is-invalid input {
  background: #fff7f7;
  border-color: #d92d20;
  box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.12);
}

.checkbox-field {
  align-items: center;
  border: 0;
  border-radius: 6px;
  display: flex;
  gap: 9px;
  min-height: 32px;
  padding: 4px 6px;
}

.checkbox-field input {
  min-height: auto;
}

.checkbox-group {
  background: #fbfcfd;
  border: 1px solid #cad5df;
  border-radius: 8px;
  padding: 10px;
}

.checkbox-group-grid {
  display: grid;
  gap: 6px 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.record-dialog .warning {
  margin: 16px 22px 0;
}

.record-dialog .dialog-actions {
  align-items: center;
  background: #f8fafb;
  border-top: 1px solid var(--line);
  border-radius: 0 0 12px 12px;
  display: flex;
  flex: 0 0 72px;
  gap: 10px;
  justify-content: flex-end;
  min-height: 72px;
  padding: 14px 24px 16px;
  position: static;
  width: 100%;
}

.dialog-action-spacer {
  flex: 1 1 auto;
}

.record-dialog .dialog-actions .btn {
  flex: 0 0 auto;
  min-width: 0;
}

.confirm-dialog .dialog-actions {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

@media (max-height: 760px) {
  .record-dialog {
    height: calc(100vh - 104px);
    max-height: calc(100vh - 104px);
    top: 14px;
  }

  .record-dialog .dialog-header {
    padding: 14px 20px;
  }

  .record-dialog .dialog-header h2 {
    font-size: 20px;
  }

  .form-grid {
    padding: 12px 18px 14px;
  }

  .record-dialog .dialog-actions {
    flex-basis: 62px;
    min-height: 62px;
    padding: 10px 18px;
  }
}

#noteDialog .confirm-message {
  background: transparent;
  border: 0;
  margin: 14px 18px 0;
  min-height: 0;
  overflow: auto;
  padding: 0;
}

#noteDialog {
  max-height: calc(100vh - 32px);
  max-width: 920px;
  width: min(920px, calc(100vw - 28px));
}

#noteDialog form {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
  min-height: 0;
  gap: 0;
}

#noteDialog .reply-form {
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-bottom: 12px;
  padding-top: 11px;
}

#noteDialog .reply-form .btn {
  max-width: 100%;
  min-height: 32px;
  padding: 7px 12px;
  white-space: normal;
}

#noteDialog .dialog-header {
  min-height: 62px;
  padding: 12px 16px 11px;
}

#noteDialog .dialog-header h2 {
  font-size: 19px;
  line-height: 1.18;
  margin-top: 3px;
}

.note-dialog-subtitle {
  color: rgba(225, 235, 238, 0.68);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  margin: 4px 0 0;
}

.note-dialog-subtitle:empty {
  display: none;
}

#noteDialog .dialog-actions {
  min-height: 48px;
  padding: 8px 16px 10px;
}

#noteDialog .note-empty-state {
  background: #f7f9fa;
  border-color: #dfe8ee;
  color: #7b8792;
  font-size: 13px;
  font-style: italic;
  padding: 11px 12px;
}

#noteDialog .thread-entry {
  border-radius: 8px;
  padding: 9px 11px;
}

#noteDialog .thread-entry + .thread-entry {
  margin-top: 7px;
}

/* Admin task conversation modal enterprise polish */
#noteDialog .note-dialog-subtitle {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

#noteDialog .note-status-chip {
  align-items: center;
  background: rgba(248, 181, 0, 0.14);
  border: 1px solid rgba(248, 181, 0, 0.28);
  border-radius: 999px;
  color: #ffe3a3;
  display: inline-flex;
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  padding: 4px 8px;
}

#noteDialog .admin-task-conversation {
  display: grid;
  gap: 0;
}

#noteDialog .admin-task-conversation .thread-entry {
  border-color: #dfe8ee;
  border-left-width: 3px;
  border-radius: 8px;
  gap: 6px;
  padding: 8px 10px;
}

#noteDialog .admin-task-conversation .thread-entry + .thread-entry {
  margin-top: 6px;
}

#noteDialog .admin-task-conversation .thread-entry.admin {
  background: #f7fbf9;
  border-left-color: #14927f;
}

#noteDialog .admin-task-conversation .thread-entry.partner {
  background: #f4f9fc;
  border-color: #d6e8f3;
  border-left-color: #2c6d92;
}

#noteDialog .admin-task-conversation .thread-entry-meta {
  gap: 8px;
}

#noteDialog .admin-task-conversation .thread-entry-meta strong {
  color: #182532;
  font-size: 12.5px;
  font-weight: 650;
}

#noteDialog .admin-task-conversation .thread-entry-meta span {
  color: #82909c;
  font-size: 10.5px;
  font-weight: 500;
}

#noteDialog .admin-task-conversation .thread-entry-text {
  color: #263743;
  font-size: 13px;
  line-height: 1.42;
}

#noteDialog .admin-task-conversation .reply-files {
  gap: 5px;
  margin-top: 1px;
}

#noteDialog .admin-reply-form {
  background: #fbfcfd;
  border: 1px solid #dfe8ee;
  border-radius: 9px;
  margin-top: 10px;
  padding: 10px;
}

#noteDialog .admin-reply-form textarea {
  min-height: 82px;
}

#noteDialog .note-action-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

#noteDialog .note-action-row .btn {
  justify-self: auto;
}

#noteDialog .note-resolve-action {
  background: #eef8f1;
  border-color: #b9dfc3;
  color: #236a35;
  font-weight: 650;
}

#noteDialog .note-resolve-action:hover {
  background: #e4f3e8;
  border-color: #95cfa5;
  color: #1d5c2d;
}

.warning {
  background: #fff8e1;
  border: 1px solid #f2d680;
  border-radius: 8px;
  color: #6f4f00;
  padding: 12px;
}

.hidden {
  display: none;
}

.audit-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
}

.audit-item strong {
  font-size: 14px;
}

.audit-item span {
  color: var(--muted);
  font-size: 12px;
}

.pill {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  padding: 4px 8px;
}

.pill.ok {
  background: #e8f7ed;
  color: var(--ok);
}

.pill.warn {
  background: #fff8e1;
  color: #7a5600;
}

.pill.danger {
  background: #fff0ee;
  color: var(--danger);
}

.excel-pivot {
  box-shadow: var(--shadow);
  padding: 14px;
}

.pivot-table {
  background: #fff;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  min-width: 100%;
  width: max-content;
}

.pivot-table.gross-partner-table {
  table-layout: fixed;
  min-width: 100%;
  width: var(--gross-min-width, max-content);
}

.gross-partner-table th:not(:first-child),
.gross-partner-table td:not(:first-child) {
  min-width: var(--gross-col-width, 68px);
  max-width: 148px;
  width: max(var(--gross-col-width, 68px), calc((100vw - 560px) / var(--gross-cols, 1)));
}

.gross-partner-table th:first-child,
.gross-partner-table td:first-child {
  min-width: 210px;
  width: 210px;
}

.pivot-table.compact {
  min-width: 0;
}

.pivot-table th {
  background: linear-gradient(180deg, #e4f1fb, #cfe4f4);
  border-bottom: 1px solid #adc7dc;
  border-right: 1px solid #c2d5e6;
  color: #183247;
  font-weight: 800;
  line-height: 1.15;
  overflow: visible;
  padding: 8px 9px;
  position: sticky;
  text-align: center;
  top: 0;
  white-space: nowrap;
  z-index: 3;
}

.pivot-table td {
  border-bottom: 1px solid #e1e8ef;
  border-right: 1px solid #e6edf3;
  color: #162330;
  padding: 7px 8px;
  text-align: right;
  white-space: nowrap;
}

.pivot-table tbody tr:nth-child(even) td {
  background: #f8fbfd;
}

.pivot-table tbody tr:hover td {
  background: #fff8df;
}

.pivot-table th:first-child,
.pivot-table td:first-child {
  border-right: 2px solid #b8cedf;
  left: 0;
  position: sticky;
  z-index: 2;
}

.pivot-table th:first-child {
  background: linear-gradient(180deg, #dbeaf5, #c7deef);
  text-align: left;
  z-index: 4;
}

.pivot-table td:first-child {
  background: #fff;
  color: #0f2233;
  font-weight: 700;
  min-width: 180px;
  padding-left: 12px;
  text-align: left;
}

.pivot-table tbody tr:nth-child(even) td:first-child {
  background: #f8fbfd;
}

.pivot-table tbody tr:hover td:first-child {
  background: #fff8df;
}

.pivot-table .total-row td {
  background: #dceaf7;
  border-top: 2px solid #9dbbd4;
  color: #183247;
  font-weight: 800;
}

.pivot-table .total-row td:first-child {
  background: #dceaf7;
}

.report-tabs {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.report-group-switch {
  align-items: center;
  background: #eef4f8;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: flex;
  gap: 4px;
  padding: 4px;
}

.report-group-switch button {
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: #526274;
  cursor: pointer;
  font-weight: 800;
  padding: 8px 10px;
}

.report-group-switch button.active {
  background: #050505;
  color: #fff;
}

.report-tab {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  padding: 9px 12px;
}

.report-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

#financeTabs {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  gap: 5px;
  margin-bottom: 8px;
  padding: 6px;
}

#financeTabs .report-tab {
  border-radius: 7px;
  min-height: 32px;
  padding: 6px 9px;
}

#financeTabs .settlement-tab {
  background: #eef8f6;
  border-color: #b9ded7;
  color: #064c43;
  font-weight: 800;
}

#financeTabs .settlement-tab.active {
  background: #07806f;
  border-color: #07806f;
  color: #fff;
}

.finance-tab-divider {
  align-items: center;
  color: #637181;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  margin-left: 8px;
  min-height: 30px;
  text-transform: uppercase;
}

.finance-tab-divider::before {
  background: #dce5ec;
  content: "";
  height: 18px;
  margin-right: 8px;
  width: 1px;
}

.report-filters {
  align-items: end;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  padding: 7px 10px;
}

.report-filters.hidden {
  display: none;
}

.report-filters .btn {
  min-height: 34px;
}

.report-filters .filter-field {
  min-width: 130px;
}

.report-filters .multi-filter {
  min-width: 180px;
}

#financePartnerFilters {
  flex-wrap: wrap;
}

.report-table-wrap {
  flex: 1 1 auto;
  margin-top: 14px;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 100%;
}

.finance-custom-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.settlement-layout {
  display: grid;
  gap: 14px;
}

.settlement-summary-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 14px;
}

.settlement-summary-grid div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.settlement-summary-grid div.attention {
  background: #fff8e6;
  border-color: #f2c46d;
}

.settlement-summary-grid span {
  color: #637181;
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
}

.settlement-summary-grid strong {
  color: #0f2233;
  font-size: 20px;
}

.settlement-draft-summary {
  background: transparent;
  border-bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
}

.settlement-steps {
  background: #fbfcfd;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 8px 14px;
}

.settlement-steps div {
  align-items: center;
  background: #fff;
  border: 1px solid #dfe9ef;
  border-radius: 8px;
  display: flex;
  gap: 8px;
  min-height: 36px;
  padding: 6px 10px;
}

.settlement-steps span {
  align-items: center;
  background: #0f8b78;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  flex: 0 0 24px;
  height: 24px;
  justify-content: center;
  font-size: 13px;
}

.settlement-steps strong {
  background: transparent;
  color: #3d4d5c;
  font-size: 12px;
  font-weight: 700;
}

.airtime-rate-panel {
  background: #fbfcfd;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
  padding: 10px 14px;
}

.airtime-rate-panel-title {
  align-items: baseline;
  display: flex;
  gap: 10px;
}

.airtime-rate-panel-title strong {
  color: #0f2233;
  font-size: 14px;
}

.airtime-rate-panel-title span {
  color: var(--muted);
  font-size: 12px;
}

.airtime-rate-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.airtime-provider-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.airtime-provider-tabs.editable {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  overflow: visible;
}

.airtime-provider-tabs button {
  align-items: center;
  background: #fff;
  border: 1px solid #dfe9ef;
  border-radius: 8px;
  cursor: pointer;
  display: inline-grid;
  flex: 0 0 auto;
  gap: 5px;
  justify-items: center;
  min-width: 126px;
  padding: 9px 11px;
}

.airtime-provider-tabs button.active {
  background: #eef8f6;
  border-color: #07806f;
  box-shadow: inset 0 3px 0 #07806f;
}

.airtime-provider-rate {
  align-items: center;
  background: #fff;
  border: 1px solid #dfe9ef;
  border-radius: 8px;
  display: grid;
  flex: 0 1 calc((100% - 32px) / 5);
  gap: 7px;
  grid-template-columns: minmax(86px, 1fr) 86px;
  min-height: 62px;
  min-width: 205px;
  padding: 8px;
}

.airtime-provider-rate.active {
  background: #f4fbf9;
  border-color: #07806f;
  box-shadow: inset 3px 0 0 #07806f;
}

.airtime-provider-rate.airtime-total-rate {
  border-color: #0f766e;
  box-shadow: inset 3px 0 0 #0f766e;
}

.airtime-provider-rate button {
  min-width: 0;
  padding: 6px;
}

.airtime-provider-rate button:disabled {
  cursor: default;
  opacity: 1;
}

.airtime-provider-rate input {
  height: 36px;
  min-width: 0;
  padding: 6px 7px;
  text-align: right;
}

.airtime-provider-rate input:disabled {
  background: #f2f5f7;
  color: #9aa7b2;
}

.airtime-provider-tabs .provider-cell {
  max-width: 104px;
}

.airtime-provider-tabs span {
  color: #5f7184;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.airtime-rate-table {
  background: #fff;
  border: 1px solid #dfe9ef;
  border-radius: 8px;
  display: grid;
  overflow: hidden;
}

.airtime-rate-table-head,
.airtime-rate-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(160px, 1fr) 80px 110px 110px;
  padding: 9px 12px;
}

.airtime-rate-table-head {
  background: #eaf2f8;
  color: #314456;
  font-size: 12px;
  font-weight: 900;
}

.airtime-rate-row {
  border-top: 1px solid #edf2f5;
}

.payment-form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  padding: 14px;
}

.payment-form-grid label {
  display: grid;
  gap: 6px;
}

.payment-form-grid label span {
  color: #314456;
  font-size: 12px;
  font-weight: 900;
}

.payment-form-grid .inline-select-field {
  align-items: center;
  display: grid;
  gap: 0;
  grid-template-columns: auto minmax(0, 1fr);
  min-width: 0;
  position: relative;
}

.payment-form-grid .inline-select-field span {
  align-items: center;
  align-self: stretch;
  background: #f3f7fa;
  border: 1px solid #d7e3eb;
  border-right: 0;
  border-radius: 8px 0 0 8px;
  color: #465d73;
  display: inline-flex;
  font-size: 11px;
  justify-content: center;
  min-height: 38px;
  padding: 0 9px;
  white-space: nowrap;
}

.payment-form-grid input,
.payment-form-grid select,
.payment-table select {
  border: 1px solid #d7e3eb;
  border-radius: 8px;
  min-height: 38px;
  padding: 8px 10px;
}

.payment-form-grid .inline-select-field select {
  border-radius: 0 8px 8px 0;
  min-width: 0;
  width: 100%;
}

.payment-form-grid .company-transaction-select-field {
  display: grid;
  gap: 0;
}

.payment-form-grid .company-transaction-select-field > span {
  display: none;
}

.payment-form-grid .company-transaction-select-field select {
  min-width: 0;
  width: 100%;
}

.payment-reminder-layout {
  align-items: start;
}

.payment-reminder-form-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.compact-reminder-form,
.compact-company-form {
  align-items: end;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  padding: 10px 12px;
}

.compact-reminder-form label,
.compact-company-form label {
  gap: 4px;
}

.compact-reminder-form label span,
.compact-company-form label span {
  font-size: 11px;
  font-weight: 700;
}

.compact-reminder-form input,
.compact-reminder-form select,
.compact-company-form input,
.compact-company-form select {
  min-height: 34px;
  padding: 6px 9px;
}

.compact-reminder-form input[type="file"] {
  padding: 5px 8px;
}

.compact-reminder-form .payment-notes,
.compact-company-form .payment-notes {
  grid-column: span 2;
}

.compact-form-action {
  align-self: end;
  min-height: 34px;
}

.payment-reminder-inline-check {
  align-items: center;
  flex-direction: row;
  gap: 8px;
  justify-content: flex-start;
  min-height: 34px;
  padding-bottom: 1px;
}

.payment-reminder-inline-check input {
  appearance: auto;
  border-radius: 3px;
  flex: 0 0 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  width: 16px;
}

.payment-reminder-complete-dialog {
  width: min(560px, calc(100vw - 32px));
}

.payment-reminder-complete-dialog .confirm-message {
  display: grid;
  gap: 8px;
}

.payment-reminder-complete-dialog .confirm-message p {
  margin: 0;
}

.payment-reminder-complete-actions {
  flex-wrap: wrap;
}

.owner-payment-reminder-popup {
  width: min(720px, calc(100vw - 32px));
}

.owner-payment-reminder-popup form {
  max-height: min(680px, calc(100vh - 34px));
}

.owner-payment-reminder-popup-content {
  display: grid;
  gap: 12px;
}

.owner-payment-reminder-popup-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.owner-payment-reminder-popup-summary span {
  align-items: center;
  background: #f4f6f8;
  border: 1px solid #e1e6eb;
  border-radius: 999px;
  color: #4d5a68;
  display: inline-flex;
  font-size: 12px;
  gap: 5px;
  min-height: 28px;
  padding: 5px 10px;
}

.owner-payment-reminder-popup-summary span.danger {
  background: #fff3f1;
  border-color: #efc5bf;
  color: #9f2f25;
}

.owner-payment-reminder-popup-summary span.today {
  background: #fff8e8;
  border-color: #edcf83;
  color: #80610e;
}

.owner-payment-reminder-popup-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  padding-right: 2px;
}

.owner-payment-reminder-popup-item {
  align-items: center;
  background: #ffffff;
  border: 1px solid #e4e8ec;
  border-left: 4px solid #d8dee4;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px 12px;
}

.owner-payment-reminder-popup-item.overdue {
  border-left-color: #c94f42;
}

.owner-payment-reminder-popup-item.today {
  border-left-color: #d59a18;
}

.owner-payment-reminder-popup-item strong,
.owner-payment-reminder-popup-item small {
  display: block;
}

.owner-payment-reminder-popup-item strong {
  color: #17202a;
  font-size: 14px;
  font-weight: 700;
}

.owner-payment-reminder-popup-item small {
  color: #647282;
  font-size: 12px;
  margin-top: 3px;
}

.owner-payment-reminder-popup-meta {
  align-items: flex-end;
  color: #52606f;
  display: flex;
  flex-direction: column;
  font-size: 12px;
  gap: 3px;
  text-align: right;
  white-space: nowrap;
}

.owner-payment-reminder-popup-meta b {
  color: #111827;
  font-size: 13px;
}

.owner-payment-reminder-due {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
}

.owner-payment-reminder-due.overdue {
  background: #fff0ee;
  color: #a33a30;
}

.owner-payment-reminder-due.today {
  background: #fff4da;
  color: #7a5a08;
}

.owner-payment-reminder-popup-actions {
  align-items: center;
}

@media (max-width: 640px) {
  .owner-payment-reminder-popup-item {
    grid-template-columns: 1fr;
  }

  .owner-payment-reminder-popup-meta {
    align-items: flex-start;
    text-align: left;
  }
}

.payment-reminder-filter {
  align-items: end;
  display: grid;
  gap: 4px;
  min-width: 190px;
}

.payment-reminder-filter span {
  color: #637181;
  font-size: 11px;
  font-weight: 800;
}

.payment-reminder-table th:nth-child(1),
.payment-reminder-table td:nth-child(1) {
  min-width: 90px;
  white-space: nowrap;
}

.payment-reminder-table th:nth-child(3),
.payment-reminder-table td:nth-child(3) {
  min-width: 220px;
}

.payment-reminder-table th:nth-child(8),
.payment-reminder-table td:nth-child(8) {
  min-width: 140px;
}

.payment-reminder-overdue-row td {
  background: #fff7f6;
}

.payment-reminder-today-row td {
  background: #fffaf0;
}

.payment-form-grid .payment-notes {
  grid-column: 1 / -2;
}

.payment-form-grid.compact-reminder-form .payment-notes,
.payment-form-grid.compact-company-form .payment-notes {
  grid-column: span 2;
}

.payment-form-grid #savePaymentButton {
  align-self: end;
  min-height: 38px;
}

.payment-table small {
  color: var(--muted);
  display: block;
  font-size: 11px;
  margin-top: 3px;
}

.payment-table th {
  position: static;
  top: auto;
  z-index: auto;
}

.payments-history-card .settlement-table-wrap {
  margin-top: 0;
  overflow: auto;
}

.payments-history-card .payment-table {
  border-collapse: separate;
  border-spacing: 0;
}

#financeCustomPanel .payments-history-card .payment-table thead {
  display: table-header-group;
}

#financeCustomPanel .payments-history-card .payment-table th {
  position: static;
  top: auto;
  z-index: 1;
}

.payment-delete-button {
  background: #b42318;
  border-color: #b42318;
  color: #fff;
  font-weight: 900;
}

.payment-delete-button:hover {
  background: #8f1d14;
  border-color: #8f1d14;
}

.payment-report-detail-row td {
  background: #f8fbfd;
  border-bottom-color: #edf3f7;
}

.payment-report-detail {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  min-height: 30px;
}

.payment-report-detail strong {
  color: #0c5f54;
  min-width: 84px;
}

.payment-report-detail span {
  color: #314456;
  font-weight: 800;
}

.payment-report-detail small {
  color: var(--muted);
  font-weight: 700;
}

.airtime-rate-row strong {
  color: #0f2233;
  font-size: 13px;
}

.airtime-rate-row span {
  color: #485766;
  font-size: 13px;
  font-weight: 800;
}

.airtime-rate-row input {
  height: 34px;
  min-width: 0;
  padding: 6px 8px;
  text-align: right;
}

.airtime-rate-card {
  align-items: center;
  background: #fff;
  border: 1px solid #dfe9ef;
  border-radius: 8px;
  display: grid;
  gap: 6px;
  grid-template-columns: 86px minmax(0, 1fr) 76px;
  min-height: 44px;
  padding: 8px;
}

.airtime-rate-card input {
  height: 34px;
  min-width: 0;
  padding: 6px 8px;
  text-align: right;
}

.airtime-rate-provider .provider-cell {
  max-width: 78px;
}

.airtime-rate-meta {
  color: #485766;
  font-size: 12px;
  font-weight: 800;
  min-width: 0;
}

.airtime-rate-display {
  background: #eef7f5;
  border: 1px solid #cfe5df;
  border-radius: 999px;
  color: #0a6b5d;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  justify-content: center;
  min-width: 50px;
  padding: 4px 8px;
}

.airtime-import-history {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  padding: 12px 14px 14px;
}

.airtime-history-table {
  min-width: 920px;
}

.settlement-warning {
  align-items: center;
  background: #fff8e1;
  border-bottom: 1px solid #f0ce73;
  color: #6e5200;
  display: flex;
  gap: 3px;
  justify-content: space-between;
  padding: 7px 14px;
}

.settlement-warning span {
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.comm-import-box {
  align-items: center;
  background: #fbfcfd;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px 14px;
}

.comm-import-box.standalone {
  border-bottom: 0;
  border-top: 1px solid var(--line);
  padding: 18px;
}

.comm-import-box div {
  display: grid;
  gap: 3px;
}

.comm-import-box strong {
  color: #0f2233;
}

.comm-import-box span {
  color: #637181;
  font-size: 12px;
}

.comm-import-help-list {
  color: #526273;
  display: grid;
  font-size: 12px;
  gap: 4px;
  line-height: 1.45;
  margin: 6px 0 0;
  padding-left: 18px;
}

.comm-import-help-list b {
  color: #0f2233;
  font-weight: 650;
}

#commissionImportStatus {
  min-width: 220px;
  text-align: right;
}

.settlement-draft-summary div {
  align-items: baseline;
  background: #f8fbfb;
  border: 1px solid #dce8e5;
  border-radius: 7px;
  display: flex;
  gap: 5px;
  padding: 5px 8px;
}

.settlement-draft-summary span {
  color: #637181;
  display: inline;
  font-size: 10px;
  font-weight: 800;
  margin-bottom: 0;
}

.settlement-draft-summary strong {
  color: #0f2233;
  font-size: 13px;
  line-height: 1.1;
}

.settlement-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.settlement-card.settlement-workbench {
  overflow: visible;
}

.settlement-card-header {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 7px 12px;
  position: static;
}

.settlement-workbench > .settlement-card-header {
  position: sticky;
  top: 0;
  z-index: 6;
}

.settlement-toolbar-info {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.settlement-card-header h3 {
  margin: 0 0 3px;
}

.settlement-card-header span {
  color: #637181;
  font-size: 13px;
}

.settlement-context-line {
  display: block;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.settlement-table-wrap {
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
}

.settlement-table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  min-width: 1180px;
  width: 100%;
}

.settlement-table th,
.settlement-table td {
  border-bottom: 1px solid #e0e8ef;
  padding: 8px;
  text-align: left;
  vertical-align: middle;
}

.settlement-table th {
  background: #eef5fb;
  color: #22384d;
  font-weight: 800;
  position: sticky;
  top: 151px;
  z-index: 4;
}

.settlement-workbench .settlement-table th {
  position: static;
}

.settlement-card.airtime-import-card .settlement-card-header {
  position: static;
}

.settlement-table.airtime-history-table th {
  position: static;
  top: auto;
  z-index: auto;
}

.settlement-table td small {
  color: #6a7885;
  display: block;
  margin-top: 2px;
}

.settlement-exp-input {
  max-width: 92px;
  min-height: 34px;
}

.settlement-clawback-row td {
  color: #c62828;
  font-weight: 700;
}

.settlement-blocked-row td {
  background: #fff8f8;
  color: #9f1d1d;
}

.settlement-badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  padding: 4px 8px;
  white-space: nowrap;
}

.settlement-badge.ok {
  background: #e8f7ed;
  color: #137333;
}

.settlement-badge.attention {
  background: #fff4d6;
  color: #8a5a00;
}

.settlement-badge.draft {
  background: #eef2f5;
  color: #52606d;
}

.settlement-badge.split {
  background: #e7f0ff;
  color: #174ea6;
}

.settlement-badge.danger,
.settlement-badge.blocked {
  background: #ffe8e8;
  color: #b3261e;
}

.settlement-history {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.settlement-history-item {
  align-items: center;
  background: #fbfcfd;
  border: 1px solid #e2ebf1;
  border-radius: 8px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 10px;
}

.settlement-history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.settlement-history-item span {
  color: #637181;
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.empty-cell {
  color: #637181;
  padding: 18px !important;
  text-align: center !important;
}

.report-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.provider-breakdown {
  color: #526171;
  display: inline-block;
  font-weight: 600;
  padding-left: 28px;
  position: relative;
}

.provider-breakdown::before {
  background: #9dbbd4;
  content: "";
  height: 1px;
  left: 8px;
  position: absolute;
  top: 50%;
  width: 12px;
}

.provider-breakdown-section {
  color: #0f2233;
  font-weight: 900;
  padding-left: 18px;
  text-transform: uppercase;
}

.provider-breakdown-section::before {
  background: #07806f;
  height: 8px;
  top: 50%;
  width: 8px;
}

.provider-breakdown-child {
  padding-left: 40px;
}

.provider-breakdown-child::before {
  left: 20px;
}

.churn-cell {
  align-items: flex-start;
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
  min-width: 76px;
}

.churn-cell strong {
  color: #1f2937;
  font-size: 13px;
  font-weight: 650;
}

.churn-cell small {
  color: #64748b;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.churn-review-flag {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  color: #9a3412;
  display: inline-flex;
  font-size: 10px;
  font-weight: 650;
  margin-left: 6px;
  padding: 2px 7px;
  vertical-align: top;
  white-space: nowrap;
}

.partner-expander {
  margin-right: 8px;
}

.partner-expander-spacer {
  display: inline-block;
  width: 24px;
}

#reportsView,
#financeView {
  min-height: 0;
}

#financeView {
  gap: 8px;
}

body:has(#financeView.active) .topbar {
  min-height: 46px;
  padding: 8px 14px;
}

body:has(#financeView.active) .topbar h1 {
  font-size: 22px;
}

#reportsView > .panel,
#financeView > .panel {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

#financeView > .panel {
  padding: 10px;
}

.pivot-expander {
  align-items: center;
  background: #fff;
  border: 1px solid #a9c3d8;
  border-radius: 4px;
  color: #183247;
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  height: 16px;
  justify-content: center;
  margin-right: 5px;
  padding: 0;
  vertical-align: middle;
  width: 16px;
}

.pivot-table th .pivot-expander {
  left: 7px;
  margin-right: 0;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.pivot-expander:hover {
  background: #083f62;
  border-color: #083f62;
  color: #fff;
}

.pivot-table th:has(.pivot-expander) {
  background: #c7deef;
  padding-left: 28px;
  position: sticky;
}

.pivot-table th.pivot-label-col {
  color: #0b2235;
  font-size: 12px;
  letter-spacing: 0.01em;
  text-align: left;
}

.gross-partner-table th:not(:first-child) {
  font-size: 11px;
}

.pivot-table .pivot-year-col,
.pivot-table .pivot-quarter-col,
.pivot-table .pivot-grand-col {
  font-weight: 800;
}

.pivot-table th.pivot-year-col,
.pivot-table td.pivot-year-col {
  background: #edf6ee;
  border-left: 2px solid #95c69b;
}

.pivot-table th.mom-average-col,
.pivot-table td.mom-average-col {
  background: #f7f1e4;
  border-left: 2px solid #d7bd7a;
  font-weight: 800;
}

.pivot-table th.mom-grand-average-col,
.pivot-table td.mom-grand-average-col {
  background: #efe4c7;
  border-left: 2px solid #b88420;
  color: #352500;
  font-weight: 900;
}

.mom-table td {
  min-width: 126px;
  padding-left: 10px;
  padding-right: 10px;
}

.mom-table th:not(:first-child),
.mom-table td:not(:first-child) {
  max-width: 150px;
  width: 126px;
}

.mom-table td:first-child,
.mom-table th:first-child {
  max-width: 220px;
  min-width: 220px;
  width: 220px;
}

.trend-cell {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  justify-content: flex-end;
  width: 100%;
}

.trend-cell i {
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}

.trend-cell.up i {
  color: #14853f;
}

.trend-cell.down i {
  color: #c62828;
}

.trend-cell.flat i {
  color: #7a8a99;
}

.mom-section-row td {
  background: #0f2233 !important;
  border-color: #0f2233 !important;
  color: #fff;
  font-weight: 900;
  text-align: left;
}

.mom-net-row td {
  font-weight: 900;
}

.mom-net-row td:first-child {
  color: #061927;
}

.mom-grand-total-row td {
  background: #e8f4ee !important;
  border-top: 2px solid #07806f;
  color: #09261f;
  font-weight: 900;
}

.mom-airtime-input {
  background: #fff;
  border: 1px solid #c7d5df;
  border-radius: 5px;
  font: inherit;
  min-height: 26px;
  padding: 3px 6px;
  text-align: right;
  width: 100%;
}

.mom-airtime-input:focus {
  border-color: #07806f;
  box-shadow: 0 0 0 2px rgba(7, 128, 111, 0.12);
  outline: none;
}

.pivot-table th.pivot-quarter-col,
.pivot-table td.pivot-quarter-col {
  background: #eef5fc;
  border-left: 2px solid #9dbbd4;
}

.pivot-table th.pivot-provider-col,
.pivot-table td.pivot-provider-col {
  text-align: center;
}

.pivot-table th.pivot-provider-col .report-provider-logo {
  justify-content: center;
}

.pnl-report-card {
  min-height: 0;
}

.pnl-table td,
.pnl-table th {
  white-space: nowrap;
}

.pnl-table td:not(:first-child) {
  text-align: right;
}

.pnl-row-label {
  align-items: center;
  display: inline-flex;
  min-height: 22px;
}

.pnl-level-1 {
  padding-left: 22px;
}

.pnl-level-2 {
  color: #496575;
  padding-left: 46px;
}

.pnl-main-row td {
  background: #f1f7fb;
  color: #0b2235;
  font-weight: 900;
}

.pnl-income-row td {
  border-left-color: #07806f;
}

.pnl-expense-row td {
  border-left-color: #c14646;
}

.pnl-category-row td {
  font-weight: 800;
}

.pnl-subcategory-row td:first-child {
  color: #496575;
}

.pnl-net-row td {
  background: #e8f4ee !important;
  border-top: 2px solid #07806f;
  color: #09261f;
  font-weight: 900;
}

.partner-policy-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.partner-policy-form {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  padding: 18px 14px 4px;
}

.partner-policy-form label,
.partner-policy-base-rule label,
.partner-policy-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.partner-policy-form label > span,
.partner-policy-card label > span {
  color: #314456;
  display: block;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  min-height: 15px;
  position: static;
  white-space: nowrap;
}

.partner-policy-form input,
.partner-policy-form select {
  min-height: 42px;
  width: 100%;
}

.partner-policy-form .payment-notes {
  grid-column: span 2;
}

.policy-builder-section {
  background: #f8fbfd;
  border: 1px solid #d9e5ee;
  border-radius: 8px;
  margin: 14px;
  padding: 12px;
}

.policy-builder-title {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.policy-builder-title small {
  color: #667789;
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
}

.policy-builder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.compact-policy-table {
  max-height: none;
  overflow: auto;
}

.partner-policy-card .settlement-table {
  min-width: 980px;
  table-layout: fixed;
}

.policy-wizard-table {
  min-width: 1460px !important;
}

.partner-policy-card .settlement-table th,
.partner-policy-card .settlement-table td,
.partner-policy-history-card .settlement-table th,
.provider-policy-card .settlement-table th,
.provider-policy-card .settlement-table td,
.provider-policy-history-card .settlement-table th {
  position: static;
  top: auto;
  z-index: auto;
}

.partner-policy-card .settlement-table th,
.provider-policy-card .settlement-table th {
  background: #eaf2f7;
}

.partner-policy-card .settlement-table td,
.provider-policy-card .settlement-table td {
  background: #fff;
  vertical-align: top;
}

.compact-policy-table input,
.compact-policy-table select {
  background: #fff;
  border: 1px solid #c8d8e3;
  border-radius: 5px;
  font: inherit;
  min-height: 30px;
  padding: 5px 7px;
  width: 100%;
}

.btn.compact {
  min-height: 30px;
  padding: 5px 8px;
}

.policy-action-row {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin: 14px;
}

.partner-policy-history-card .settlement-table-wrap {
  max-height: 360px;
  overflow: auto;
}

.partner-policy-history-card .settlement-table,
.provider-policy-history-card .settlement-table {
  min-width: 1120px;
}

.policy-check-cell label {
  align-items: center;
  display: inline-flex;
  flex-direction: row;
  gap: 6px;
  white-space: nowrap;
}

.policy-check-cell input {
  min-height: auto;
  width: auto;
}

.policy-preview-box {
  background: #fff;
  border: 1px dashed #b7c9d7;
  border-radius: 8px;
  color: #4b6174;
  font-size: 13px;
  margin-top: 10px;
  padding: 10px 12px;
}

.policy-preview-line {
  align-items: center;
  border-bottom: 1px solid #edf2f6;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 7px 0;
}

.policy-preview-line:last-child {
  border-bottom: 0;
}

@media (max-width: 1500px) {
  .partner-policy-form {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
  }
}

@media (max-width: 980px) {
  .partner-policy-form {
    grid-template-columns: 1fr;
  }

  .partner-policy-form .payment-notes {
    grid-column: auto;
  }
}

.pivot-table th.pivot-grand-col,
.pivot-table td.pivot-grand-col {
  background: #f4ead1;
  border-left: 2px solid #cda64f;
  color: #352500;
}

.paid-commissions-table {
  min-width: 760px;
  width: 100%;
}

.paid-commissions-table th,
.paid-commissions-table td {
  font-size: 12px;
}

.paid-commissions-table td:first-child {
  min-width: 220px;
}

.paid-commissions-table .pivot-grand-col {
  background: #0f6f89;
  border-left: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  font-weight: 800;
}

.paid-commissions-table tbody tr:hover td.pivot-grand-col {
  background: #0b6078;
}

.paid-report-quarter {
  display: inline-block;
  padding-left: 14px;
}

.paid-report-month {
  color: #526171;
  display: inline-block;
  font-weight: 600;
  padding-left: 42px;
}

.pivot-table tbody tr:nth-child(even) td.pivot-year-col,
.pivot-table tbody tr:nth-child(even) td.pivot-quarter-col,
.pivot-table tbody tr:nth-child(even) td.pivot-grand-col {
  filter: brightness(0.985);
}

/* UI cleanup pass */
.main {
  padding: 18px 22px 22px;
}

.topbar {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(24, 39, 75, 0.05);
  min-height: 72px;
  padding: 12px 16px;
}

.topbar h1 {
  letter-spacing: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.topbar > div:first-child {
  flex: 1 0 280px;
  min-width: min(280px, 100%);
}

body:not(.commissioning-standalone) .topbar {
  align-items: flex-start;
  background: linear-gradient(135deg, #050505 0%, #101820 58%, #073f37 100%);
  border: 0;
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(8, 24, 35, 0.16);
  color: #fff;
  flex-wrap: wrap;
  min-height: 92px;
  overflow: hidden;
  padding: 20px 24px;
  position: relative;
}

body:not(.commissioning-standalone) .topbar::after {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  content: "";
  height: 180px;
  position: absolute;
  right: -48px;
  top: -76px;
  width: 180px;
}

body:not(.commissioning-standalone) .topbar > * {
  position: relative;
  z-index: 1;
}

body:not(.commissioning-standalone) .topbar h1 {
  color: #fff;
  font-size: 30px;
}

body:not(.commissioning-standalone):has(#mobileView.active) .topbar h1 {
  font-size: clamp(20px, 1.75vw, 24px);
  line-height: 1.12;
  white-space: nowrap;
}

body:not(.commissioning-standalone) .topbar .source-badge {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  color: #9bd7cb;
}

body:not(.commissioning-standalone) .topbar .btn.secondary {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

body:not(.commissioning-standalone) .topbar .btn.primary {
  background: #07806f;
  border-color: #07806f;
  color: #fff;
}

.hero-tabs {
  flex: 1 0 100%;
  margin-top: 14px;
  min-width: 0;
}

.hero-tabs.hidden {
  display: none;
}

.hero-tabs .report-tabs {
  margin-bottom: 0;
}

.hero-tabs .dashboard-kpis {
  margin-bottom: 0;
  padding-bottom: 2px;
}

body:not(.commissioning-standalone) .hero-tabs .report-tabs {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  display: flex;
  gap: 7px;
  max-height: 96px;
  overflow: auto;
  padding: 7px;
}

body:not(.commissioning-standalone) .hero-tabs #financeTabs {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  margin-bottom: 0;
}

body:not(.commissioning-standalone) .hero-tabs .report-tab {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  color: #dce9e7;
  font-weight: 800;
  min-height: 36px;
}

body:not(.commissioning-standalone) .hero-tabs .report-tab.active {
  background: #fff;
  border-color: #fff;
  color: #050505;
}

body:not(.commissioning-standalone):has(#energyView.active) .topbar,
body:not(.commissioning-standalone):has(#mobileView.active) .topbar {
  align-items: center;
  column-gap: 16px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(340px, 620px) minmax(220px, 1fr);
}

body:not(.commissioning-standalone):has(#energyView.active) .topbar > div:first-child,
body:not(.commissioning-standalone):has(#mobileView.active) .topbar > div:first-child {
  grid-column: 1;
  min-width: 0;
}

body:not(.commissioning-standalone):has(#energyView.active) .topbar .page-actions,
body:not(.commissioning-standalone):has(#mobileView.active) .topbar .page-actions {
  grid-column: 3;
  justify-self: end;
  margin-left: 0;
}

body:not(.commissioning-standalone) .hero-tabs.contract-search-hero {
  align-items: center;
  display: flex;
  grid-column: 2;
  justify-content: center;
  justify-self: center;
  margin-top: 0;
  min-height: 42px;
  position: static;
  transform: none;
  width: 100%;
  z-index: 2;
}

body:not(.commissioning-standalone) .hero-tabs.contract-search-hero .search {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  flex: 1 1 auto;
  max-width: 100%;
  min-width: 0;
}

body:not(.commissioning-standalone) .hero-tabs .finance-tab-divider {
  color: #9bd7cb;
}

body:not(.commissioning-standalone) .hero-tabs .finance-tab-divider::before {
  background: rgba(255, 255, 255, 0.18);
}

body:not(.commissioning-standalone) .hero-tabs .dashboard-kpi-card {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: none;
  flex-basis: 196px;
  min-height: 108px;
}

body:not(.commissioning-standalone) .hero-tabs .dashboard-kpi-title {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: none;
  flex-basis: 210px;
}

body:not(.commissioning-standalone) .hero-tabs .dashboard-kpi-title span {
  color: #9bd7cb;
}

.page-actions .btn {
  min-height: 42px;
}

.view {
  margin-top: 10px;
}

.dashboard-kpis {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(188px, 1fr));
  margin-bottom: 12px;
  overflow: visible;
  padding-bottom: 0;
}

.dashboard-kpi-card {
  display: grid;
  min-height: 118px;
  padding: 16px 18px;
}

.dashboard-kpi-card strong {
  font-size: clamp(24px, 2vw, 30px);
  line-height: 1.25;
  margin: 12px 0 4px;
}

.dashboard-kpi-card small {
  line-height: 1.2;
}

.excel-dashboard,
.role-dashboard-grid {
  gap: 12px;
}

.dash-card,
.panel,
.toolbar,
.table-wrap,
.form-section {
  border-color: #d7e0e8;
}

.dash-card,
.panel,
.toolbar,
.table-wrap {
  box-shadow: 0 10px 26px rgba(24, 39, 75, 0.06);
}

.toolbar {
  border-radius: 10px;
  margin-bottom: 10px;
  padding: 14px;
}

.toolbar-main {
  align-items: end;
  gap: 10px;
  grid-template-columns: minmax(300px, 2fr) repeat(7, minmax(112px, 1fr));
}

#energyView .toolbar-main,
#mobileView .toolbar-main {
  align-items: end;
  display: grid;
  gap: 8px;
  overflow: visible;
}

#energyView .toolbar-main {
  grid-template-columns: repeat(6, minmax(118px, 1fr)) auto;
}

#mobileView .toolbar-main {
  grid-template-columns: repeat(5, minmax(118px, 1fr)) auto;
}

#energyView .toolbar-main > .search,
#mobileView .toolbar-main > .search {
  display: none;
}

#energyView .toolbar-main .filter-field,
#mobileView .toolbar-main .filter-field {
  min-width: 0;
}

#energyView .toolbar-main .date-filter,
#mobileView .toolbar-main .date-filter {
  min-width: 98px;
}

#energyView .toolbar-main .filter-reset,
#mobileView .toolbar-main .filter-reset {
  align-self: end;
  height: 40px;
  justify-self: end;
  min-width: max-content;
  padding-left: 12px;
  padding-right: 12px;
  white-space: nowrap;
}

.toolbar-main .search {
  min-width: 260px;
}

.filter-field {
  gap: 5px;
  min-width: 0;
}

.filter-field span {
  color: #405261;
  font-size: 11px;
  letter-spacing: 0;
}

.filter-field.date-filter {
  min-width: 96px;
}

.date-filter input,
.multi-filter-button,
.filter-reset,
.search {
  min-height: 40px;
}

.multi-filter-button {
  padding-left: 11px;
}

.filter-reset {
  justify-self: stretch;
}

.toolbar-main .filter-reset,
.report-filters .filter-reset {
  justify-self: end;
  min-width: 96px;
}

.quick-filter-row {
  border-top: 1px solid #edf2f5;
  margin-top: 2px;
  padding-top: 10px;
}

.record-count {
  background: #f7fafb;
  border: 1px solid #e3ebf1;
  border-radius: 999px;
  padding: 5px 10px;
}

.pagination-controls {
  align-items: center;
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.page-size-field {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.page-size-field span {
  color: #526171;
  font-size: 12px;
  font-weight: 700;
}

.page-size-field select {
  min-height: 30px;
  padding: 3px 24px 3px 8px;
  width: auto;
}

.icon-page-btn {
  align-items: center;
  background: #fff;
  border: 1px solid #d6e0e8;
  border-radius: 8px;
  color: #132231;
  cursor: pointer;
  display: inline-flex;
  font-size: 20px;
  font-weight: 700;
  height: 30px;
  justify-content: center;
  line-height: 1;
  width: 30px;
}

.icon-page-btn:disabled {
  cursor: default;
  opacity: 0.35;
}

.page-indicator {
  color: #526171;
  font-size: 12px;
  font-weight: 700;
  min-width: 44px;
  text-align: center;
}

.pagination-controls + .record-count {
  margin-left: 0;
}

.table-wrap {
  border-radius: 10px;
}

table {
  font-size: 12px;
}

th {
  background: #f4f8fb;
  color: #263746;
  font-size: 12px;
  line-height: 1.25;
  padding-bottom: 10px;
  padding-top: 10px;
}

td {
  color: #17212b;
}

.energy-table th,
.energy-table td,
.mobile-table th,
.mobile-table td {
  padding: 8px 9px;
}

.name-link {
  color: #065f8f;
}

.cell-input,
.cell-select,
.compact-select {
  border-color: #cbd8e2;
  border-radius: 8px;
}

.record-dialog {
  height: min(820px, calc(100vh - 32px));
  max-height: calc(100vh - 32px);
  top: 16px;
}

.record-dialog .dialog-header {
  padding: 18px 24px;
}

.record-dialog .dialog-header h2 {
  line-height: 1.1;
}

.form-grid {
  gap: 12px;
  padding: 16px 22px 18px;
}

.form-section {
  border-radius: 10px;
  padding: 14px 16px 16px;
}

.form-section h3 {
  margin-bottom: 12px;
}

.form-section-grid {
  gap: 11px 12px;
}

.record-dialog .dialog-actions {
  flex-basis: auto;
  min-height: 68px;
  padding: 12px 22px;
  position: sticky;
  bottom: 0;
  z-index: 3;
}

.record-dialog .dialog-actions .btn {
  min-height: 40px;
  padding-left: 16px;
  padding-right: 16px;
}

.confirm-dialog form {
  gap: 14px;
}

.confirm-message,
.note-text,
.reply-box,
.readonly-note {
  border-radius: 10px;
}

/* Dialog and request form polish */
.request-form-panel {
  border: 1px solid #dbe5ec;
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(24, 39, 75, 0.07);
  overflow: hidden;
}

.request-form-panel .panel-header {
  background: linear-gradient(135deg, #061018 0%, #111 60%, #0b3f39 100%);
  color: #fff;
  margin: -18px -18px 0;
  padding: 22px 24px;
}

.request-form-panel .panel-header h2 {
  color: #fff;
}

.request-form-panel .panel-header span {
  color: #bdd0d6;
}

.request-form-panel > .panel-header {
  display: none;
}

.request-form {
  gap: 14px;
  margin-top: 0;
}

.request-form .form-section {
  background: rgba(248, 250, 251, 0.75);
  border-color: #d8e3ea;
  border-radius: 12px;
  box-shadow: none;
  padding: 18px 20px;
}

.request-form .form-section h3,
.documents-header h3 {
  align-items: center;
  background: #ffffff;
  border: 1px solid #e6eef3;
  border-radius: 8px;
  color: #102231;
  display: flex;
  font-size: 15px;
  font-weight: 800;
  gap: 8px;
  margin: 0 0 13px;
  padding: 8px 11px;
}

.request-form .form-section h3::before,
.documents-header h3::before {
  background: #07806f;
  border-radius: 999px;
  content: "";
  height: 10px;
  width: 10px;
}

.request-form .form-section-grid {
  gap: 12px 14px;
}

.request-form .field span,
.request-form .field > span {
  color: #304456;
  font-size: 12px;
  letter-spacing: 0.01em;
  text-transform: none;
}

.request-form input,
.request-form select,
.request-form textarea,
.request-documents-table .doc-comment,
.request-documents-table .doc-category-input {
  border-color: #c9d6e1;
  border-radius: 9px;
  min-height: 40px;
}

.request-form textarea {
  min-height: 88px;
}

.request-form .required-star {
  color: #c84b46;
  font-size: 11px;
  font-weight: 800;
}

.request-actions {
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid #dbe6ec;
  border-radius: 0 0 12px 12px;
  bottom: 0;
  box-shadow: none;
  position: sticky;
  z-index: 2;
}

.documents-header {
  align-items: center;
  background: #f5f8fb;
  border: 1px solid #e0e8ef;
  border-radius: 10px;
  margin-bottom: 12px;
  padding: 10px 12px;
}

.documents-header h3 {
  border-bottom: 0;
  margin-bottom: 3px;
  padding: 8px 10px;
}

.documents-header p {
  margin: 0;
}

.request-program-field,
.request-comments-field {
  grid-column: 1 / -1;
}

.request-documents-wrap {
  border: 1px solid #e0e8ef;
  border-radius: 12px;
}

.request-documents-table th {
  background: #f7fafc;
  color: #33485a;
}

.request-documents-table th,
.request-documents-table td {
  padding-bottom: 8px;
  padding-top: 8px;
  vertical-align: middle;
}

.request-documents-table .file-action {
  min-height: 36px;
  padding: 7px 10px;
}

.request-documents-table tr:hover td {
  background: #fbfdfd;
}

.request-accordion-section {
  overflow: hidden;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.request-accordion-heading {
  cursor: pointer;
  user-select: none;
}

.request-accordion-heading::after {
  border: solid #526678;
  border-width: 0 2px 2px 0;
  content: "";
  height: 7px;
  margin-left: auto;
  transform: rotate(45deg);
  transition: transform 0.16s ease;
  width: 7px;
}

.request-accordion-heading[aria-expanded="false"]::after {
  transform: rotate(-45deg);
}

.request-accordion-section.is-collapsed {
  background: rgba(248, 250, 251, 0.6);
}

.request-accordion-section.is-collapsed > :not(h3):not(.documents-header) {
  display: none;
}

.request-accordion-section.is-collapsed > .documents-header {
  margin-bottom: 0;
}

.request-accordion-section.is-collapsed > .documents-header p,
.request-accordion-section.is-collapsed > .documents-header .btn {
  display: none;
}

.confirm-dialog {
  border-radius: 16px;
  overflow: hidden;
}

.confirm-dialog form {
  gap: 0;
  padding: 0;
}

.confirm-dialog .dialog-header {
  background: linear-gradient(135deg, #050505, #17212b);
  color: #fff;
  padding: 18px 22px;
}

.confirm-dialog .dialog-header h2 {
  color: #fff;
  font-size: 21px;
}

.confirm-dialog .dialog-header .eyebrow {
  color: #a7bac3;
}

.confirm-dialog .icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.confirm-dialog .confirm-message,
.confirm-dialog .pending-note-field,
.confirm-dialog .request-detail-content,
.request-type-dialog .field {
  margin: 18px 22px 0;
}

.confirm-dialog .confirm-message {
  background: #f8fbfc;
  border-color: #dce6ed;
}

.confirm-dialog .dialog-actions {
  align-items: center;
  background: #f8fafb;
  border-top: 1px solid #dfe7ee;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding: 14px 22px;
}

.request-type-dialog .dialog-actions {
  margin-top: 34px;
}

.request-detail-grid div {
  border-color: #e0e8ef;
  border-radius: 10px;
  padding: 12px;
}

.confirm-dialog.request-detail-dialog {
  max-height: calc(100vh - 32px);
  max-width: 980px;
  width: min(980px, calc(100vw - 28px));
}

.confirm-dialog.request-detail-dialog form {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
  min-height: 0;
}

.confirm-dialog.request-detail-dialog .request-detail-content {
  flex: 1 1 auto;
  max-height: calc(100vh - 220px);
  min-height: 0;
  overflow-y: auto;
}

.confirm-dialog.request-detail-dialog .dialog-actions {
  background: #fff;
  border-top: 1px solid var(--line);
  bottom: 0;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin: 0;
  padding: 12px 16px 16px;
  position: sticky;
  z-index: 2;
}

@media (max-height: 760px) and (min-width: 941px) {
  .sidebar {
    padding: 14px 14px;
  }

  .brand {
    margin-bottom: 16px;
  }

  .nav {
    gap: 4px;
  }

  .nav-item {
    padding: 7px 9px;
  }

  .nav-icon {
    height: 30px;
    width: 30px;
  }

  .user-box {
    gap: 6px;
    padding: 10px;
  }

  .sidebar-select,
  .sidebar-logout {
    min-height: 32px;
  }
}

@media (max-width: 940px) {
  body {
    overflow: auto;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    height: auto;
    position: static;
    width: auto;
  }

  .sidebar:hover,
  .sidebar:focus-within {
    width: auto;
  }

  .brand,
  .nav-item,
  .sidebar-social,
  .user-box {
    min-width: 0;
  }

  .nav-label,
  .brand div,
  .user-box,
  .user-box strong,
  .user-box span {
    opacity: 1;
  }

  .user-box {
    pointer-events: auto;
    transform: none;
  }

  .sidebar-social {
    justify-content: flex-start;
    margin: 12px 0;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .nav {
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  }

  .main {
    height: auto;
    margin-left: 0;
    padding: 14px;
    overflow: visible;
    width: 100%;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
    padding: 12px;
  }

  .page-actions {
    justify-content: stretch;
    width: 100%;
  }

  .page-actions .btn {
    flex: 1 1 auto;
  }

  body:not(.commissioning-standalone) .hero-tabs.contract-search-hero {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    width: 100%;
  }

  .toolbar-main,
  body:not(.admin-mode) #energyView .toolbar-main {
    grid-template-columns: 1fr 1fr;
  }

  #energyView .toolbar-main,
  #mobileView .toolbar-main {
    display: grid;
    flex-wrap: wrap;
    grid-template-columns: 1fr 1fr;
    overflow: visible;
  }

  #energyView .toolbar-main > .search,
  #mobileView .toolbar-main > .search,
  .toolbar-main .search {
    display: block;
    grid-column: 1 / -1;
    min-width: 0;
  }

  .filter-reset {
    grid-column: 1 / -1;
  }

  .dashboard-layout,
  .dashboard-grid,
  .excel-dashboard,
  .role-dashboard-grid,
  .form-section-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-kpis {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    overflow: visible;
  }

  .dashboard-kpi-title,
  .dashboard-kpi-card {
    flex-basis: auto;
  }

  .dashboard-kpi-title {
    flex-basis: 180px;
  }

  .pie-card {
    grid-row: auto;
  }

  .record-dialog {
    height: calc(100vh - 20px);
    max-height: calc(100vh - 20px);
    top: 10px;
    width: calc(100vw - 16px);
  }

  .form-section-grid {
    grid-template-columns: 1fr;
  }

  .record-dialog .dialog-actions {
    flex-wrap: wrap;
  }
}

/* Page-level vertical scroll: keep hero/header inside the same scroll area. */
.main {
  overflow-x: hidden;
  overflow-y: auto;
}

#dashboardView.active,
#reportsView.active,
#financeView.active,
#auditView.active,
#adminView.active {
  flex: 0 0 auto;
  overflow: visible;
}

#reportsView > .panel,
#financeView > .panel {
  flex: 0 0 auto;
}

body:not(.commissioning-standalone):has(#financeView.active) .topbar {
  min-height: 92px;
  padding: 20px 24px;
}

body:not(.commissioning-standalone):has(#financeView.active) .topbar h1 {
  font-size: 30px;
}

/* Final dashboard alignment layer */
.role-dashboard-grid,
.excel-dashboard {
  align-items: stretch;
}

.role-dashboard-grid {
  grid-auto-flow: dense;
}

.role-chart-card {
  display: flex;
  flex-direction: column;
  min-height: 340px;
}

.role-chart-card.wide {
  min-height: 430px;
}

.role-chart-card .panel-header {
  align-items: flex-start;
  flex: 0 0 auto;
  min-height: 54px;
}

.role-chart-card > .excel-bars,
.role-chart-card > .role-status-list,
.role-chart-card > .role-task-list,
.role-chart-card > #roleProviderHeatmap,
.role-chart-card > #financeSettledMonthChart,
.role-chart-card > #partnerSubpartnerList,
.role-chart-card > #financeBlockedPartners {
  flex: 1 1 auto;
  min-height: 0;
}

.role-chart-card .role-task-list {
  max-height: none;
}

.excel-bars.role-monthly-chart.dash-chart-container {
  height: 340px;
  min-height: 340px;
}

.role-monthly-chart .dash-chart-scroll {
  height: 316px;
  padding-bottom: 12px;
}

.role-monthly-chart .dash-svg-chart {
  height: 308px;
}

.role-heatmap-card {
  min-height: 430px;
}

.finance-dashboard-grid .role-chart-card.wide {
  min-height: 390px;
}

.dash-chart-legend {
  min-height: 18px;
}

.metric-row {
  min-height: 42px;
}

/* Settlement workbench: keep filters and headers visible while working long lists. */
#financeView:has(.settlement-workbench) .finance-custom-panel {
  overflow: visible;
}

.settlement-filter-actionbar {
  align-items: center;
  border-top: 1px solid #dce7ef;
  display: flex;
  flex: 0 0 100%;
  gap: 10px;
  justify-content: space-between;
  margin-top: 2px;
  padding-top: 8px;
  width: 100%;
}

.settlement-filter-actionbar .settlement-toolbar-info {
  flex: 1 1 auto;
}

.settlement-filter-actionbar .settlement-draft-summary {
  flex: 1 1 auto;
}

.airtime-settlement-actionbar .settlement-toolbar-info {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.airtime-settlement-actionbar .settlement-context-line {
  flex: 0 1 auto;
}

#financeView .settlement-workbench {
  display: flex;
  flex-direction: column;
  max-height: max(380px, calc(100vh - 310px));
  overflow: hidden;
}

#financeView .settlement-workbench > .settlement-card-header,
#financeView .settlement-workbench > .settlement-warning,
#financeView .settlement-workbench > .airtime-rate-panel {
  flex: 0 0 auto;
}

#financeView .settlement-workbench > .settlement-card-header {
  position: sticky;
  top: 0;
  z-index: 22;
}

#financeView .settlement-workbench .settlement-table-wrap {
  flex: 1 1 auto;
  min-height: 240px;
  overflow: auto;
}

#financeView .settlement-workbench .settlement-table th {
  position: sticky;
  top: 0;
  z-index: 14;
}

/* Live visual polish review layer: cosmetic only, no structural behavior changes. */
:root {
  --ui-radius: 8px;
  --ui-radius-sm: 6px;
  --ui-shadow-soft: 0 8px 24px rgba(24, 39, 75, 0.07);
  --ui-shadow-tight: 0 2px 8px rgba(24, 39, 75, 0.06);
  --ui-focus: 0 0 0 3px rgba(7, 128, 111, 0.14);
}

.main {
  background: #f3f6f8;
}

.sidebar {
  box-shadow: 10px 0 26px rgba(0, 0, 0, 0.18);
}

.nav-item,
.nav-submenu button {
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.nav-item:hover,
.nav-item.active {
  transform: translateX(1px);
}

.topbar {
  border-bottom: 1px solid #dbe4ea;
  box-shadow: 0 1px 0 rgba(15, 34, 51, 0.03);
}

.topbar h1 {
  letter-spacing: 0;
}

.panel,
.report-filters,
.settlement-card,
.record-dialog,
.dashboard-kpi-card,
.role-chart-card {
  border-color: #d8e2e8;
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow-soft);
}

.panel-header {
  min-height: 44px;
}

.panel-header h2,
.request-form-panel .panel-header h2 {
  letter-spacing: 0;
}

.btn {
  border-radius: var(--ui-radius-sm);
  box-shadow: none;
  min-height: 36px;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.btn:hover:not(:disabled) {
  box-shadow: var(--ui-shadow-tight);
  transform: translateY(-1px);
}

.btn:focus-visible,
.icon-btn:focus-visible,
.icon-page-btn:focus-visible,
.multi-filter-button:focus-visible,
.nav-item:focus-visible,
.nav-submenu button:focus-visible {
  box-shadow: var(--ui-focus);
  outline: 0;
}

.btn.primary {
  background: #087c6d;
}

.btn.primary:hover {
  background: #066d60;
}

.btn.secondary,
.filter-reset {
  background: #ffffff;
  border-color: #d6e1e7;
  color: #3e5060;
}

.btn.secondary:hover:not(:disabled),
.filter-reset:hover:not(:disabled) {
  background: #f6fafb;
  border-color: #c7d5dd;
}

.filter-reset.active {
  background: #eef8f6;
  border-color: #97cbc1;
  color: #075e53;
}

.report-filters {
  align-items: end;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px 12px;
}

.report-filters .filter-field,
.request-form .field,
.field {
  gap: 5px;
}

.filter-field > span,
.field > span,
.request-form .field > span {
  color: #314456;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}

.field input,
.field select,
.field textarea,
.page-size-field select,
.multi-filter-button,
.sidebar-select {
  border-color: #cfdbe3;
  border-radius: var(--ui-radius-sm);
  min-height: 36px;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.page-size-field select:focus,
.multi-filter-button:focus-visible {
  border-color: #07806f;
  box-shadow: var(--ui-focus);
}

.report-table-wrap,
.settlement-table-wrap {
  border-color: #d8e2e8;
  border-radius: var(--ui-radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  margin-top: 12px;
}

table th,
.settlement-table th {
  background: #eaf2f7;
  color: #102b43;
  font-size: 12px;
  letter-spacing: 0;
}

table td,
.settlement-table td {
  border-color: #e4ebf0;
}

tbody tr,
.settlement-table tbody tr {
  transition: background 0.12s ease;
}

tbody tr:hover,
.settlement-table tbody tr:hover {
  background: #f8fbfc;
}

.dashboard-kpi-card {
  background: #ffffff;
  border: 1px solid #dce6ec;
}

.dashboard-kpi-card strong {
  letter-spacing: 0;
}

.dashboard-kpi-card small,
.role-task span,
.metric-row span {
  color: #5e7080;
}

.role-chart-card {
  background: #ffffff;
}

.role-task {
  border-color: #e0e8ee;
  border-radius: var(--ui-radius-sm);
}

.role-task:hover {
  background: #f6fafb;
  border-color: #cbd9e1;
}

.settlement-filter-actionbar {
  gap: 12px;
  margin-top: 6px;
  padding-top: 10px;
}

.settlement-context-line,
.settlement-draft-summary div {
  border-color: #d9e6eb;
  border-radius: var(--ui-radius-sm);
}

.settlement-draft-summary div {
  background: #f8fbfc;
}

.settlement-draft-summary div strong {
  color: #082f49;
}

.airtime-rate-panel {
  background: #f8fbfc;
  gap: 12px;
  padding: 12px 14px;
}

.airtime-provider-rate {
  border-color: #d8e4ea;
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow-tight);
}

.airtime-provider-rate input {
  border-color: #cfdbe3;
  border-radius: var(--ui-radius-sm);
}

.airtime-provider-rate input:focus {
  border-color: #07806f;
  box-shadow: var(--ui-focus);
  outline: 0;
}

.airtime-rate-display,
.settlement-badge {
  border-radius: 999px;
}

.record-dialog {
  border: 1px solid #d6e1e7;
}

.record-dialog .dialog-header {
  background: #f8fbfc;
  border-bottom: 1px solid #dce6ec;
  color: #17212b;
}

.record-dialog .dialog-header .eyebrow {
  color: #5f7282;
}

.record-dialog .dialog-actions {
  background: #f8fbfc;
  border-top: 1px solid #dce6ec;
}

body.commissioning-standalone .commissioning-hero {
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow-soft);
}

body.commissioning-standalone .commissioning-actions button,
body.commissioning-standalone .commissioning-activity,
body.commissioning-standalone .commissioning-kpis article {
  border-color: #d8e2e8;
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow-tight);
}

.infoportal-toolbar-panel,
.infoportal-editor {
  margin-bottom: 10px;
}

.infoportal-subtitle {
  color: rgba(226, 239, 237, 0.72);
  display: block;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  margin-top: 5px;
}

.infoportal-tabs,
.infoportal-header-actions,
.infoportal-toolbar,
.infoportal-attachments,
.infoportal-actions,
.infoportal-current-files {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.infoportal-header-actions {
  justify-content: flex-end;
}

.infoportal-toolbar-panel.panel {
  background: #fff;
  border-color: #d8e2e8;
  box-shadow: 0 6px 14px rgba(24, 39, 75, 0.045);
  padding: 9px 10px;
}

.infoportal-toolbar-panel .infoportal-toolbar {
  align-items: center;
  display: grid;
  gap: 7px;
  grid-template-columns: minmax(240px, min(58%, 520px)) minmax(145px, 190px) max-content;
  justify-content: start;
  margin: 0;
  padding: 0;
}

.infoportal-toolbar input,
.infoportal-provider-filter select {
  background: #fff;
  border: 1px solid #cfdbe3;
  border-radius: var(--ui-radius-sm);
  box-shadow: none;
  height: 36px;
  min-height: 36px;
  min-width: 0;
  padding: 0 12px;
  width: 100%;
}

.infoportal-provider-filter {
  display: block;
  min-width: 0;
  width: 190px;
}

.infoportal-toolbar {
  margin-top: 0;
  padding-top: 0;
}

.infoportal-unread-chip {
  align-items: center;
  background: #f3f6f8;
  border: 1px solid #d7e1e8;
  border-radius: 999px;
  color: #637181;
  display: inline-flex;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  min-height: 26px;
  padding: 0 9px;
  white-space: nowrap;
}

.infoportal-unread-chip.has-unread {
  background: #fff7e7;
  border-color: #edd49a;
  color: #7a5600;
}

.infoportal-form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.infoportal-form-grid label,
.infoportal-role-field {
  display: grid;
  gap: 6px;
}

.infoportal-title-field,
.infoportal-body-field,
.infoportal-important-field,
.infoportal-role-field,
.infoportal-current-files {
  grid-column: 1 / -1;
}

.infoportal-form-grid input,
.infoportal-form-grid select,
.infoportal-form-grid textarea {
  border: 1px solid #cfdbe3;
  border-radius: var(--ui-radius-sm);
  padding: 9px 10px;
}

.infoportal-role-picker {
  background: #fff;
  border: 1px solid #cfdbe3;
  border-radius: var(--ui-radius-sm);
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  max-height: 168px;
  overflow: auto;
  padding: 10px;
}

.infoportal-role-picker label {
  align-items: center;
  display: flex;
  font-size: 12px;
  gap: 7px;
}

.infoportal-role-picker input {
  margin: 0;
}

.checkbox-inline {
  align-items: center !important;
  background: #fff;
  border: 1px solid #cfdbe3;
  border-radius: var(--ui-radius-sm);
  display: inline-flex !important;
  gap: 8px !important;
  justify-content: flex-start;
  min-height: 40px;
  padding: 9px 10px;
}

.checkbox-inline input {
  margin: 0;
}

.infoportal-editor-dialog {
  height: auto;
  max-height: calc(100vh - 36px);
  max-width: min(940px, calc(100vw - 32px));
  width: min(940px, calc(100vw - 32px));
}

.infoportal-editor-dialog form {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 36px);
  min-height: 0;
}

.infoportal-editor-dialog .dialog-header,
.infoportal-editor-dialog .dialog-actions {
  flex: 0 0 auto;
}

.infoportal-editor-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 18px 22px;
}

.infoportal-list {
  display: grid;
  gap: 12px;
}

.infoportal-table-wrap {
  border-radius: var(--ui-radius);
  max-height: calc(100vh - 286px);
  overflow: auto;
}

.infoportal-table th:nth-child(1),
.infoportal-table td:nth-child(1),
.infoportal-table th:nth-child(2),
.infoportal-table td:nth-child(2),
.infoportal-table th:nth-child(3),
.infoportal-table td:nth-child(3),
.infoportal-table th:nth-child(5),
.infoportal-table td:nth-child(5),
.infoportal-table th:nth-child(6),
.infoportal-table td:nth-child(6) {
  text-align: center;
}

.infoportal-table th:nth-child(2),
.infoportal-table td:nth-child(2) {
  min-width: 118px;
  width: 118px;
  white-space: nowrap;
}

.infoportal-table th:nth-child(4),
.infoportal-table td:nth-child(4) {
  min-width: 360px;
}

.infoportal-table td:nth-child(3) {
  vertical-align: middle;
}

.infoportal-table .provider-cell {
  background: #f8fbfc;
  border: 1px solid #dbe6ec;
  border-radius: 999px;
  min-height: 30px;
  margin: 0 auto;
  padding: 4px 9px;
  width: fit-content;
}

.infoportal-omnisell-logo img {
  height: 20px;
  max-width: 62px;
  object-fit: contain;
  width: auto;
}

.infoportal-title-button {
  color: #075985;
  font-weight: 650;
  max-width: 560px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.partners-directory-panel .panel-header {
  align-items: center;
}

.partner-profile-table th:nth-child(3),
.partner-profile-table td:nth-child(3),
.partner-profile-table th:nth-child(4),
.partner-profile-table td:nth-child(4) {
  text-align: center;
  white-space: nowrap;
}

.partner-profile-table {
  table-layout: fixed;
}

.partner-profile-table th:nth-child(1),
.partner-profile-table td:nth-child(1) {
  width: 26%;
}

.partner-profile-table th:nth-child(2),
.partner-profile-table td:nth-child(2) {
  width: 28%;
  overflow-wrap: anywhere;
}

.partner-profile-table th:nth-child(3),
.partner-profile-table td:nth-child(3) {
  width: 96px;
}

.partner-profile-table th:nth-child(4),
.partner-profile-table td:nth-child(4) {
  width: 112px;
}

.partner-profile-table th:nth-child(5),
.partner-profile-table td:nth-child(5) {
  width: 22%;
  overflow-wrap: anywhere;
}

.partner-profile-table th:nth-child(6),
.partner-profile-table td:nth-child(6) {
  width: 150px;
}

.partner-profile-title {
  color: #006aa6;
}

.partner-profile-editor-dialog {
  height: min(860px, calc(100vh - 32px));
  max-width: min(1040px, calc(100vw - 32px));
  width: min(1040px, calc(100vw - 32px));
}

.partner-profile-editor-dialog form {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
}

.partner-profile-form-grid {
  overflow: auto;
}

.partner-profile-view-dialog {
  max-width: min(920px, calc(100vw - 34px));
  width: min(920px, calc(100vw - 34px));
}

.partner-profile-view-content {
  background: #fff !important;
  border: 0 !important;
  margin: 0 !important;
  max-height: min(62vh, 560px);
  overflow: auto;
  padding: 18px 22px !important;
}

.infoportal-unread-row td {
  background: #f3fbf8 !important;
}

.infoportal-unread-row td:first-child {
  box-shadow: inset 4px 0 0 #07806f;
}

.infoportal-unread-row .infoportal-title-button {
  color: #043d35;
  font-weight: 750;
}

.infoportal-sos-badge {
  background: #dc2626;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.03em;
  line-height: 1;
  padding: 5px 7px;
}

.infoportal-status-badge,
.infoportal-file-badge {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 650;
  justify-content: center;
  line-height: 1;
  min-height: 24px;
  padding: 0 9px;
  white-space: nowrap;
}

.infoportal-status-badge.read {
  background: #f5f7f8;
  border: 1px solid #e1e7ec;
  color: #84919b;
  font-size: 10px;
  font-weight: 550;
  min-height: 21px;
  padding: 0 8px;
}

.infoportal-status-badge.unread {
  background: #e8f7ee;
  border: 1px solid #b8dfc8;
  color: #126347;
}

.infoportal-file-badge {
  background: #f6f8fa;
  border: 1px solid #d9e2e8;
  color: #344553;
}

.infoportal-table th {
  background: #f4f8fa;
  color: #243849;
  font-weight: 625;
  position: sticky;
  top: 0;
  z-index: 2;
}

.infoportal-table tbody tr:hover td {
  background: #f8fbfc;
}

.infoportal-table td {
  padding-bottom: 9px;
  padding-top: 9px;
  vertical-align: middle;
}

@media (max-width: 720px) {
  .infoportal-toolbar-panel .infoportal-toolbar {
    grid-template-columns: 1fr;
  }

  .infoportal-header-actions {
    justify-content: flex-start;
  }
}

.infoportal-card {
  align-items: flex-start;
  background: #fff;
  border: 1px solid #d8e2e8;
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow-tight);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 16px;
}

.infoportal-card.unread {
  border-color: #07806f;
  box-shadow: 0 0 0 2px rgba(7, 128, 111, 0.12);
}

.infoportal-card-main {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.infoportal-card-main strong {
  color: #082f49;
  font-size: 16px;
}

.infoportal-card-main small,
.infoportal-popup-list span {
  color: #5f7282;
}

.infoportal-card-main p {
  color: #243849;
  line-height: 1.45;
  margin: 0;
}

.infoportal-current-files span {
  align-items: center;
  background: #eef6f7;
  border: 1px solid #d8e6e8;
  border-radius: 999px;
  display: inline-flex;
  gap: 6px;
  padding: 5px 8px;
}

.infoportal-current-files button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.infoportal-popup-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}

.infoportal-popup-dialog {
  max-width: min(520px, calc(100vw - 34px));
}

.infoportal-popup-dialog .dialog-header {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #e3ebf0;
  color: #0f2233;
  padding: 16px 18px 13px;
}

.infoportal-popup-dialog .dialog-header h2 {
  color: #0f2233;
  font-size: 18px;
  line-height: 1.2;
}

.infoportal-popup-dialog .dialog-header .eyebrow {
  color: #087c6d;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.infoportal-popup-dialog .icon-btn {
  background: #f3f7f8;
  border-color: #dbe6ec;
  color: #243849;
}

.infoportal-popup-dialog .confirm-message {
  background: #fff;
  border: 0;
  color: #314758;
  margin: 0;
  padding: 16px 18px 4px;
}

.infoportal-popup-dialog .confirm-message p {
  margin: 0;
}

.infoportal-popup-list li {
  background: #f7fafb;
  border: 1px solid #e0e9ee;
  border-radius: 8px;
  color: #123047;
  padding: 9px 10px;
}

.infoportal-popup-list span {
  display: block;
  font-size: 11px;
  margin-top: 3px;
}

.infoportal-popup-dialog .dialog-actions {
  background: #fff;
  border-top: 0;
  margin-top: 6px;
  padding: 12px 18px 16px;
}

.infoportal-read-dialog {
  max-width: min(860px, calc(100vw - 34px));
  width: min(860px, calc(100vw - 34px));
}

.infoportal-read-dialog .dialog-header {
  background: linear-gradient(180deg, #071016, #101a21);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  min-height: 0;
  padding: 12px 16px 11px;
}

.infoportal-read-dialog .dialog-header h2 {
  color: #ffffff;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.22;
  margin-top: 4px;
}

.infoportal-read-dialog .dialog-header .eyebrow {
  align-items: center;
  color: rgba(225, 235, 238, 0.72);
  display: grid;
  flex-wrap: wrap;
  gap: 5px;
  grid-template-columns: max-content max-content max-content max-content;
  letter-spacing: 0;
  min-width: min(640px, calc(100vw - 120px));
  white-space: nowrap;
}

.infoportal-read-dialog .dialog-header .eyebrow .provider-cell {
  display: inline-flex;
}

.infoportal-read-dialog .dialog-header .eyebrow .provider-cell,
.infoportal-provider-fallback {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  min-height: 26px;
  padding: 3px 8px;
}

.infoportal-read-dialog .dialog-header .eyebrow .provider-cell img {
  border-color: rgba(255, 255, 255, 0.24);
  height: 22px;
  width: 50px;
}

.infoportal-provider-fallback {
  color: #ffffff;
  display: inline-flex;
  font-size: 11px;
  font-weight: 650;
}

.infoportal-meta-date,
.infoportal-meta-category {
  font-size: 11px;
  font-weight: 550;
}

.infoportal-meta-category {
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: rgba(231, 239, 241, 0.8);
  padding: 5px 8px;
}

.infoportal-read-dialog .icon-btn {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  height: 32px;
  width: 32px;
}

.infoportal-read-content {
  background: #fff !important;
  border: 0 !important;
  margin: 0 !important;
  max-height: min(56vh, 480px);
  overflow: auto;
  padding: 14px 18px !important;
}

.infoportal-read-body {
  color: #243849;
  font-size: 14px;
  line-height: 1.62;
  max-width: 720px;
  white-space: normal;
}

.infoportal-read-body br + br {
  line-height: 1.9;
}

.infoportal-read-files {
  background: #f8fbfc;
  border: 1px solid #e1eaf0;
  border-radius: 8px;
  display: grid;
  gap: 7px;
  margin-top: 12px;
  max-width: 720px;
  padding: 9px;
}

.infoportal-read-files strong {
  color: #344553;
  font-size: 12px;
  font-weight: 650;
}

.infoportal-read-files .infoportal-attachments {
  gap: 7px;
}

.infoportal-attachment-chip.btn.secondary {
  align-items: center;
  background: #ffffff;
  border-color: #d6e2e9;
  border-radius: 999px;
  color: #263847;
  display: inline-flex;
  font-size: 12px;
  font-weight: 600;
  gap: 7px;
  min-height: 30px;
  padding: 0 10px;
}

.infoportal-attachment-chip::before {
  background: #eef5f7;
  border: 1px solid #d6e2e9;
  border-radius: 6px;
  color: #c24155;
  content: "PDF";
  font-size: 9px;
  font-weight: 750;
  line-height: 1;
  padding: 4px 5px;
}

.infoportal-read-dialog .dialog-actions {
  padding: 8px 16px 10px;
}

.infoportal-log-dialog {
  height: min(860px, calc(100vh - 28px));
  max-height: calc(100vh - 28px);
  max-width: min(1180px, calc(100vw - 28px));
  width: min(1180px, calc(100vw - 28px));
}

.infoportal-log-dialog form {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: calc(100vh - 28px);
  min-height: 0;
}

.infoportal-log-dialog .dialog-header,
.infoportal-log-dialog .dialog-actions {
  flex: 0 0 auto;
}

.infoportal-log-content {
  background: #fff !important;
  border: 0 !important;
  flex: 1 1 auto;
  margin: 0 !important;
  max-height: none;
  min-height: 0;
  overflow-x: auto;
  overflow-y: auto;
  padding: 16px 18px !important;
}

.infoportal-log-table-wrap {
  box-shadow: none;
  max-height: none;
  overflow: visible;
}

.infoportal-log-table-wrap .settlement-table {
  min-width: 920px;
}

.infoportal-log-table-wrap .settlement-table th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.tools-shell {
  align-content: start;
  display: grid;
  gap: 14px;
  min-height: 0;
  overflow: visible;
  padding: 16px;
  width: 100%;
}

.tools-shell > * {
  min-width: 0;
}

#toolsView .tools-shell,
#toolsUpdateView .tools-shell {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

#toolsView,
#toolsUpdateView {
  min-width: 0;
}

.tools-shell .panel-header {
  align-items: flex-start;
  gap: 12px;
}

.tools-page-hero {
  align-items: center;
  background: #fff;
  border: 1px solid #d8e2e8;
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow-tight);
  display: flex;
  justify-content: space-between;
  min-width: 0;
  min-height: 58px;
  padding: 11px 14px;
}

.tools-page-hero h2 {
  color: #082f49;
  font-size: 18px;
  margin: 0 0 3px;
}

.tools-page-hero span {
  color: #617487;
  font-size: 12px;
}

.tools-tabs,
.tools-product-tabs,
.tools-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.tools-tabs button,
.tools-product-tabs button {
  background: #fff;
  border: 1px solid #cfdbe3;
  border-radius: var(--ui-radius-sm);
  color: #213445;
  cursor: pointer;
  min-height: 38px;
  padding: 0 12px;
}

.tools-tabs button.active,
.tools-product-tabs button.active {
  background: #082f49;
  border-color: #082f49;
  color: #fff;
}

.tools-product-tabs button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.tools-controls {
  align-items: end;
  background: #f8fbfc;
  border: 1px solid #d8e2e8;
  border-radius: var(--ui-radius);
  display: grid;
  gap: 12px;
  grid-template-columns: 150px minmax(180px, 1fr) minmax(170px, 220px) minmax(180px, 230px) minmax(220px, 1.2fr);
  padding: 14px;
  min-width: 0;
}

.tools-controls.proposal-controls {
  grid-template-columns: repeat(5, minmax(130px, 1fr));
}

.tools-controls.comparison-controls {
  grid-template-columns: 150px minmax(140px, 1fr) minmax(170px, 1fr) minmax(160px, 1fr) minmax(140px, 1fr) minmax(130px, 0.8fr) minmax(220px, 1.4fr);
}

.tools-controls label,
.tool-update-card label,
.tools-draft-box label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.tools-controls span,
.tool-update-card label > span,
.tools-draft-box label > span {
  color: #41566a;
  font-size: 12px;
  font-weight: 800;
}

.tools-controls input,
.tools-controls select,
.tool-update-card input,
.tool-update-card select,
.tool-update-card textarea {
  background: #fff;
  border: 1px solid #cfdbe3;
  border-radius: var(--ui-radius-sm);
  color: #0f2233;
  min-height: 40px;
  padding: 8px 10px;
  width: 100%;
}

.tools-controls input:focus,
.tools-controls select:focus,
.tool-update-card input:focus,
.tool-update-card select:focus,
.tool-update-card textarea:focus {
  border-color: #07806f;
  box-shadow: var(--ui-focus);
  outline: 0;
}

.tools-search {
  min-width: min(360px, 100%);
}

.tools-summary-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

.tools-summary-grid article {
  background: #fff;
  border: 1px solid #dce6ec;
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow-tight);
  padding: 12px;
}

.tools-summary-grid span {
  color: #617487;
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 5px;
}

.tools-summary-grid strong {
  color: #082f49;
  font-size: 18px;
}

.tools-table-wrap {
  border: 1px solid #d8e2e8;
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow-tight);
  max-height: min(62vh, 620px);
  overflow: auto;
  scrollbar-gutter: stable;
  width: 100%;
}

.tools-table {
  min-width: 1280px;
  table-layout: fixed;
  width: 100%;
}

.comparison-table {
  min-width: 1500px;
}

.tools-table th {
  line-height: 1.25;
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: normal;
}

.tools-table th:nth-child(1),
.tools-table td:nth-child(1),
.tools-table th:nth-child(3),
.tools-table td:nth-child(3),
.tools-table th:nth-child(5),
.tools-table td:nth-child(5),
.tools-table th:nth-child(6),
.tools-table td:nth-child(6),
.tools-table th:nth-child(7),
.tools-table td:nth-child(7),
.tools-table th:nth-child(8),
.tools-table td:nth-child(8),
.tools-table th:nth-child(9),
.tools-table td:nth-child(9) {
  text-align: center;
}

.tools-table td:nth-child(10) {
  color: #41566a;
  line-height: 1.45;
}

.comparison-table th:nth-child(1),
.comparison-table td:nth-child(1) {
  width: 46px;
}

.comparison-table th:nth-child(2),
.comparison-table td:nth-child(2) {
  width: 70px;
}

.comparison-table th:nth-child(3),
.comparison-table td:nth-child(3) {
  width: 96px;
}

.comparison-table th:nth-child(4),
.comparison-table td:nth-child(4) {
  width: 310px;
}

.comparison-table th:nth-child(5),
.comparison-table td:nth-child(5) {
  width: 90px;
}

.comparison-table th:nth-child(6),
.comparison-table td:nth-child(6),
.comparison-table th:nth-child(7),
.comparison-table td:nth-child(7),
.comparison-table th:nth-child(8),
.comparison-table td:nth-child(8),
.comparison-table th:nth-child(9),
.comparison-table td:nth-child(9) {
  width: 130px;
}

.comparison-table th:nth-child(10),
.comparison-table td:nth-child(10) {
  width: 468px;
}

.comparison-table td {
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.comparison-table td:nth-child(10) {
  white-space: pre-line;
}

.tools-table .provider-cell,
.manual-card .provider-cell,
.tools-check-grid .provider-cell {
  margin: 0 auto;
}

.tools-table .provider-cell img {
  height: 22px;
  max-width: 62px;
}

.tool-category-badge {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  width: 100%;
}

.tool-category-badge > span {
  align-items: center;
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  flex: 0 0 28px;
  font-weight: 900;
  height: 28px;
  justify-content: center;
  position: relative;
  width: 28px;
}

.tool-category-badge > span::before {
  content: "";
  display: block;
}

.tool-category-badge.home > span::before {
  border-bottom: 8px solid #fff;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  height: 0;
  left: 6px;
  position: absolute;
  top: 6px;
  width: 0;
}

.tool-category-badge.home > span::after {
  background: #fff;
  border-radius: 1px;
  content: "";
  height: 9px;
  left: 9px;
  position: absolute;
  top: 14px;
  width: 10px;
}

.tool-category-badge.business > span::before {
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 5px 0 #fff, 0 10px 0 #fff;
  content: "";
  height: 3px;
  left: 8px;
  position: absolute;
  top: 7px;
  width: 12px;
}

.tool-category-badge.blue > span {
  background: #1f5f99;
}

.tool-category-badge.yellow > span {
  background: #bf8a00;
}

.tool-category-badge.green > span {
  background: #15804d;
}

.tool-category-badge.neutral > span {
  background: #617487;
}

.manual-card .provider-cell img,
.tools-check-grid .provider-cell img {
  height: 20px;
  max-width: 56px;
}

.tools-best-row td {
  background: #f1fbf7 !important;
}

.tools-best-row td:first-child {
  box-shadow: inset 4px 0 0 #07806f;
}

.strong-cell {
  color: #082f49;
  font-weight: 900;
}

.tools-special-list,
.manuals-list,
.tools-update-grid,
.tools-draft-box {
  display: grid;
  gap: 10px;
}

.tools-update-grid {
  align-items: start;
  gap: 12px;
  grid-template-columns: minmax(320px, 0.8fr) minmax(420px, 1.2fr);
}

.tools-program-editor-card {
  grid-column: 1 / -1;
}

.tools-import-card,
.tools-manuals-card {
  align-self: stretch;
}

.tools-update-shell .tools-page-hero {
  min-height: 54px;
  padding: 10px 14px;
}

.tools-update-shell .tools-page-hero h2 {
  font-size: 18px;
  margin-bottom: 2px;
}

.tool-update-card {
  position: relative;
}

.tool-update-card.tools-primary-card {
  border-color: #c4d6df;
  box-shadow: 0 10px 24px rgba(15, 34, 51, 0.08);
}

.tool-update-card.tools-primary-card::before,
.tool-update-card.tools-secondary-card::before,
.tool-update-card.tools-tertiary-card::before {
  border-radius: 999px;
  content: "";
  height: 3px;
  left: 14px;
  position: absolute;
  right: 14px;
  top: 0;
}

.tool-update-card.tools-primary-card::before {
  background: #07806f;
}

.tool-update-card.tools-secondary-card::before {
  background: #8aa2b4;
}

.tool-update-card.tools-tertiary-card::before {
  background: #c3d0d8;
}

.tools-import-compact {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(150px, 0.75fr) minmax(220px, 1.25fr);
}

.tools-upload-control {
  min-width: 0;
}

.tools-upload-control input[type="file"],
.tools-manual-form input[type="file"] {
  min-height: 38px;
  padding: 6px 8px;
}

.tools-dataset-status {
  align-items: center;
  background: #f7fafb;
  border: 1px solid #d7e3ea;
  border-radius: var(--ui-radius-sm);
  display: grid;
  grid-column: 1 / -1;
  gap: 3px;
  min-height: 48px;
  padding: 8px 10px;
}

.tools-dataset-status span {
  color: #617487;
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.tools-dataset-status strong {
  color: #0f2233;
  font-size: 13px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-card-header,
.tools-row-actions,
.tools-program-actions,
.tools-program-form-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.tool-card-header {
  justify-content: space-between;
  margin-bottom: 12px;
}

.tool-card-header h3 {
  margin-bottom: 3px;
}

.tool-card-header span,
.tools-program-row span {
  color: #617487;
  display: block;
  font-size: 12px;
}

.tools-admin-table-wrap {
  border: 1px solid #d8e2e8;
  border-radius: var(--ui-radius);
  max-height: 460px;
  overflow: auto;
  scrollbar-gutter: stable;
}

.tools-admin-table-wrap.compact {
  margin-top: 12px;
  max-height: 320px;
}

.tools-admin-table {
  min-width: 1120px;
  table-layout: fixed;
  width: 100%;
}

.tools-admin-table th {
  background: #f5f8fa;
  color: #425566;
  font-size: 11.5px;
  font-weight: 650;
  position: sticky;
  top: 0;
  z-index: 1;
}

.tools-admin-table td {
  font-size: 12.5px;
  padding-bottom: 8px;
  padding-top: 8px;
}

.tools-admin-table th:nth-child(1),
.tools-admin-table td:nth-child(1) {
  width: 90px;
  text-align: center;
}

.tools-admin-table th:nth-child(2),
.tools-admin-table td:nth-child(2) {
  width: 390px;
}

.tools-admin-table th:nth-child(3),
.tools-admin-table td:nth-child(3) {
  width: 170px;
}

.tools-admin-table th:nth-child(4),
.tools-admin-table td:nth-child(4),
.tools-admin-table th:nth-child(5),
.tools-admin-table td:nth-child(5) {
  width: 120px;
  text-align: center;
}

.tools-admin-table th:nth-child(6),
.tools-admin-table td:nth-child(6) {
  width: 230px;
  color: #41566a;
  line-height: 1.4;
  white-space: pre-line;
}

.tools-admin-table th:nth-child(7),
.tools-admin-table td:nth-child(7) {
  width: 150px;
}

.tools-admin-table td {
  vertical-align: top;
}

.tools-admin-table strong {
  color: #082f49;
}

.programs-admin-table {
  min-width: 1360px;
  width: 100%;
}

.programs-admin-table .program-provider-col {
  width: 108px;
}

.programs-admin-table .program-name-col {
  width: 470px;
}

.programs-admin-table .program-category-col {
  width: 96px;
}

.programs-admin-table .program-fee-col,
.programs-admin-table .program-price-col {
  width: 118px;
}

.programs-admin-table .program-comments-col {
  width: 360px;
}

.programs-admin-table .program-actions-col {
  width: 172px;
}

.programs-admin-table th:nth-child(1),
.programs-admin-table td:nth-child(1) {
  width: 105px;
}

.programs-admin-table th:nth-child(2),
.programs-admin-table td:nth-child(2) {
  width: 470px;
  white-space: normal;
}

.programs-admin-table th:nth-child(2) strong,
.programs-admin-table td:nth-child(2) strong {
  display: block;
  overflow-wrap: anywhere;
  white-space: normal;
}

.programs-admin-table .program-name-cell strong {
  color: #0e2b3f;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.28;
}

.programs-admin-table th:nth-child(3),
.programs-admin-table td:nth-child(3) {
  width: 96px;
  text-align: center;
}

.programs-admin-table th:nth-child(6),
.programs-admin-table td:nth-child(6) {
  width: 360px;
  white-space: normal;
}

.program-comment-clamp {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: #526373;
  display: -webkit-box;
  font-size: 12px;
  line-height: 1.35;
  max-height: 33px;
  overflow: hidden;
  white-space: normal;
}

.programs-admin-table .tool-category-badge > span {
  border: 1px solid #c7d8e4;
  box-shadow: none;
  color: #1f5f99;
  flex: 0 0 22px;
  height: 22px;
  line-height: 0;
  overflow: visible;
  width: 22px;
}

.programs-admin-table .tool-category-badge.blue > span {
  background: #e8f2f8;
  border-color: #b9d3e3;
  color: #1f5f99;
}

.programs-admin-table .tool-category-badge.yellow > span {
  background: #fff5d8;
  border-color: #e4c979;
  color: #946800;
}

.programs-admin-table .tool-category-badge.green > span {
  background: #e7f5ed;
  border-color: #addbc1;
  color: #1e734c;
}

.programs-admin-table .tool-category-badge {
  line-height: 0;
  min-height: 22px;
  overflow: visible;
}

.programs-admin-table .tool-category-badge.home > span::before {
  border-bottom-color: currentColor;
  border-bottom-width: 6px;
  border-left-width: 6px;
  border-right-width: 6px;
  left: 5px;
  top: 5px;
}

.programs-admin-table .tool-category-badge.home > span::after {
  background: currentColor;
  height: 7px;
  left: 7px;
  top: 11px;
  width: 8px;
}

.programs-admin-table .tool-category-badge.business > span::before {
  background: currentColor;
  box-shadow: 0 4px 0 currentColor, 0 8px 0 currentColor;
  height: 2px;
  left: 6px;
  top: 6px;
  width: 10px;
}

.compact-actions {
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  padding-right: 12px !important;
}

.compact-actions .btn {
  min-height: 28px;
  padding: 5px 9px;
}

.manuals-admin-table {
  min-width: 0;
  table-layout: fixed;
}

.manuals-admin-table th {
  background: #f4f8fa;
  font-weight: 625;
}

.manuals-admin-table td {
  padding-bottom: 7px;
  padding-top: 7px;
  vertical-align: middle;
}

.manual-file-name {
  color: #314657;
  display: block;
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.manuals-admin-table th:nth-child(1),
.manuals-admin-table td:nth-child(1) {
  width: 48%;
  text-align: left;
}

.manuals-admin-table th:nth-child(2),
.manuals-admin-table td:nth-child(2) {
  width: 28%;
  text-align: center;
  white-space: nowrap;
}

.manuals-admin-table th:nth-child(3),
.manuals-admin-table td:nth-child(3) {
  width: 24%;
  padding-right: 18px;
}

.manuals-admin-table td:first-child {
  align-items: center;
  display: flex;
  gap: 7px;
  justify-content: flex-start;
  padding-left: 18px;
}

.manuals-admin-table td:first-child .provider-cell {
  flex: 0 0 54px;
  margin: 0;
}

.manuals-admin-table td:first-child .provider-cell img {
  max-height: 22px;
  max-width: 48px;
}

.tool-import-product {
  display: block;
  margin-bottom: 0;
}

.tools-row-actions {
  justify-content: flex-end;
}

.tools-program-edit-panel {
  background: #f8fbfc;
  border: 1px solid #d8e2e8;
  border-radius: var(--ui-radius);
  padding: 14px;
}

.tools-program-form {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tools-program-form label {
  display: grid;
  gap: 6px;
}

.tools-program-form label.wide {
  grid-column: span 2;
}

.tools-program-form label > span {
  color: #41566a;
  font-size: 12px;
  font-weight: 800;
}

.tools-program-form input,
.tools-program-form select,
.tools-program-form textarea {
  background: #fff;
  border: 1px solid #cfdbe3;
  border-radius: var(--ui-radius-sm);
  color: #0f2233;
  min-height: 40px;
  padding: 8px 10px;
  width: 100%;
}

.tools-program-form .controlled-field select {
  border-color: #b9cad6;
  font-weight: 600;
}

.tools-manual-form {
  align-items: end;
  background: #f8fbfc;
  border: 1px solid #d8e2e8;
  border-radius: var(--ui-radius);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.2fr) auto;
  padding: 10px;
}

.tools-manual-form label {
  display: grid;
  gap: 6px;
}

.tools-manual-form label > span {
  color: #41566a;
  font-size: 12px;
  font-weight: 800;
}

.tools-manual-form input,
.tools-manual-form select {
  background: #fff;
  border: 1px solid #cfdbe3;
  border-radius: var(--ui-radius-sm);
  color: #0f2233;
  min-height: 36px;
  padding: 7px 9px;
  width: 100%;
}

.tools-program-form-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.tool-update-card,
.tools-special-card,
.manual-card {
  background: #fff;
  border: 1px solid #d8e2e8;
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow-tight);
  padding: 12px;
  min-width: 0;
}

.tool-update-card {
  overflow: hidden;
}

.tool-update-card h3,
.tools-special-card h3 {
  color: #082f49;
  margin: 0 0 12px;
}

.tools-check-grid {
  background: #f8fbfc;
  border: 1px solid #dce6ec;
  border-radius: var(--ui-radius-sm);
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  max-height: 190px;
  overflow: auto;
  padding: 10px;
}

.tools-check-grid label {
  align-items: center;
  display: flex !important;
  font-size: 12px;
  gap: 7px;
  grid-template-columns: none;
  min-width: 0;
}

.tools-check-grid label > span {
  align-items: center;
  display: inline-flex;
  gap: 7px;
  min-width: 0;
}

.tools-check-grid input[type="checkbox"] {
  flex: 0 0 16px;
  height: 16px;
  margin: 0;
  min-height: 0;
  padding: 0;
  width: 16px;
}

.manual-card {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
}

.manual-card > div {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.manual-card strong {
  color: #082f49;
}

.manual-card span {
  color: #617487;
  font-size: 12px;
}

.manuals-list.compact {
  margin-top: 10px;
}

.proposal-tool-card {
  display: grid;
  gap: 14px;
  margin: 0 auto;
  max-width: none;
  min-width: 0;
  width: 100%;
}

.proposal-actions {
  background: #fff;
  border: 1px solid #d8e2e8;
  border-radius: var(--ui-radius);
  padding: 10px;
}

.proposal-result {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.proposal-result .tools-table {
  min-width: 1700px;
}

.proposal-table th,
.proposal-table td {
  display: table-cell !important;
  max-height: none;
  overflow: visible;
  white-space: normal;
}

.proposal-table th:nth-child(1),
.proposal-table td:nth-child(1) {
  width: 46px;
}

.proposal-table th:nth-child(2),
.proposal-table td:nth-child(2) {
  width: 70px;
}

.proposal-table th:nth-child(3),
.proposal-table td:nth-child(3) {
  width: 96px;
}

.proposal-table th:nth-child(4),
.proposal-table td:nth-child(4) {
  width: 310px;
}

.proposal-table th:nth-child(5),
.proposal-table td:nth-child(5),
.proposal-table th:nth-child(6),
.proposal-table td:nth-child(6),
.proposal-table th:nth-child(7),
.proposal-table td:nth-child(7),
.proposal-table th:nth-child(8),
.proposal-table td:nth-child(8) {
  width: 130px;
  text-align: right;
}

.proposal-table th:nth-child(9),
.proposal-table td:nth-child(9) {
  width: 658px;
}

.proposal-table td {
  vertical-align: top;
}

.proposal-table td:nth-child(9) {
  line-height: 1.45;
  text-align: left;
  white-space: pre-line;
  word-break: normal;
  overflow-wrap: anywhere;
  overflow: visible;
}

.proposal-table td {
  vertical-align: top;
  word-break: normal;
  overflow-wrap: anywhere;
}

.proposal-table td:nth-child(2),
.proposal-table td:nth-child(3) {
  text-align: center;
}

.proposal-notes {
  background: #f7f9fb;
  border: 1px solid #d9e4ee;
  border-radius: var(--ui-radius);
  color: #41566a;
  font-size: 13px;
  line-height: 1.45;
  padding: 12px 14px;
}

.proposal-notes strong {
  color: #082f49;
}

.proposal-notes ul {
  margin: 8px 0 0 18px;
  padding: 0;
}

.proposal-summary-row {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.proposal-summary-row article {
  background: #fff;
  border: 1px solid #dce6ec;
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow-tight);
  padding: 18px;
  text-align: center;
}

.proposal-summary-row span,
.proposal-benefit-box span {
  color: #5e7080;
  display: block;
  font-size: 13px;
  font-weight: 850;
  margin-bottom: 8px;
}

.proposal-summary-row strong {
  color: #1f4e79;
  display: block;
  font-size: 26px;
}

.proposal-summary-row small,
.proposal-benefit-box small {
  color: #5e7080;
  display: block;
  font-size: 13px;
  margin-top: 7px;
}

.proposal-benefit-box {
  background: #eef8f0;
  border: 1px solid #b8dfc0;
  border-radius: var(--ui-radius);
  padding: 20px;
  text-align: center;
}

.proposal-benefit-box strong {
  color: #0a8a2a;
  display: block;
  font-size: 38px;
  line-height: 1.1;
}

.proposal-benefit-box p {
  color: #4e6475;
  font-size: 12px;
  line-height: 1.45;
  margin: 10px auto 0;
  max-width: 760px;
}

.proposal-benefit-box span,
.proposal-benefit-box small {
  color: #0a8a2a;
}

.proposal-benefit-box.negative {
  background: #fff1f1;
  border-color: #efb5b5;
}

.proposal-benefit-box.negative strong,
.proposal-benefit-box.negative span,
.proposal-benefit-box.negative small {
  color: #d62828;
}

.hero-tabs .tools-product-tabs {
  justify-content: flex-end;
}

.hero-tabs .tools-product-tabs button {
  min-width: 92px;
}

@media (max-width: 1100px) {
  .compact-reminder-form,
  .compact-company-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tools-controls,
  .tools-controls.comparison-controls,
  .tools-controls.proposal-controls,
  .tools-update-tabs,
  .tools-program-toolbar,
  .tools-update-grid,
  .tools-program-form,
  .tools-manual-form,
  .tools-summary-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .compact-reminder-form,
  .compact-company-form,
  .compact-reminder-form .payment-notes,
  .compact-company-form .payment-notes {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .tools-controls,
  .tools-controls.comparison-controls,
  .tools-controls.proposal-controls,
  .tools-update-tabs,
  .tools-program-toolbar,
  .tools-update-grid,
  .tools-program-form,
  .tools-manual-form,
  .tools-summary-grid {
    grid-template-columns: 1fr;
  }

  .tools-program-form label.wide {
    grid-column: auto;
  }

  .tool-card-header,
  .tools-page-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .tools-tabs,
  .tools-product-tabs,
  .tools-actions {
    justify-content: flex-start;
  }

  .proposal-summary-row {
    grid-template-columns: 1fr;
  }
}

#toolsView.active,
#toolsUpdateView.active {
  overflow: auto;
  overflow-x: hidden;
  padding-bottom: 28px;
}

/* Final launch UI polish: cosmetic-only overrides. */
:root {
  --ui-surface: #ffffff;
  --ui-surface-soft: #f8fbfc;
  --ui-header: #e9f2f7;
  --ui-header-strong: #dfeaf1;
  --ui-border: #d7e2ea;
  --ui-text: #102b43;
  --ui-muted: #5d7082;
  --ui-green: #07806f;
  --ui-green-dark: #056b5d;
  --ui-blue: #176b93;
  --ui-blue-dark: #115676;
  --ui-amber: #b7791f;
  --ui-danger: #c9352b;
  --ui-danger-dark: #a9251d;
  --ui-shadow-panel: 0 8px 22px rgba(15, 34, 51, 0.07);
  --ui-shadow-card: 0 4px 14px rgba(15, 34, 51, 0.055);
}

.sidebar {
  padding-top: 24px;
  transition: width 0.14s ease;
}

.brand {
  margin-bottom: 24px;
}

.nav {
  gap: 5px;
}

.nav-item {
  min-height: 42px;
  padding: 8px 11px;
}

.nav-item,
.nav-submenu button {
  transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.nav-item:hover,
.nav-item.active {
  transform: none;
}

.nav-submenu {
  margin-bottom: 7px;
  margin-top: 0;
}

.nav-submenu button {
  min-height: 30px;
}

.nav-item.has-unread .nav-icon::after,
.nav-submenu button.has-unread::after {
  background: #d92d20;
  box-shadow: 0 0 0 2px rgba(5, 5, 5, 0.85);
  font-size: 9px;
  height: 17px;
  min-width: 17px;
}

.panel,
.settlement-card,
.request-form-panel,
.role-chart-card,
.dash-card,
.dashboard-kpi-card,
.tools-page-hero,
.tools-summary-grid article,
.proposal-summary-row article,
.proposal-benefit-box,
.tools-import-card,
.tools-manuals-card,
.tools-program-editor-card,
.tools-draft-box,
.tools-special-card {
  border-color: var(--ui-border);
  border-radius: 8px;
  box-shadow: var(--ui-shadow-panel);
}

.panel-header,
.settlement-card-header,
.tool-card-header,
.tools-shell .panel-header {
  align-items: center;
  background: linear-gradient(180deg, #ffffff, #f7fafc);
  border-bottom: 1px solid var(--ui-border);
  min-height: 52px;
  padding-bottom: 12px;
}

.panel-header h2,
.settlement-card-header h2,
.tool-card-header h3,
.tools-page-hero h2,
.dash-card h2 {
  color: var(--ui-text);
  font-weight: 850;
  letter-spacing: 0;
}

.panel-header span,
.settlement-card-header span,
.tools-page-hero span {
  color: var(--ui-muted);
}

.btn {
  border-radius: 7px;
  font-weight: 800;
  letter-spacing: 0;
  min-height: 36px;
}

.btn.primary,
#saveRecord,
#saveRequest,
#createDraft,
#finalizeSettlement,
#savePayment,
#saveCompanyTransaction,
#saveInfoPortalPost,
#savePartnerProfile,
#saveToolManual,
#saveToolsDataset,
#addUser,
#addPartnerTreeLink {
  background: var(--ui-green);
  border-color: var(--ui-green);
  color: #ffffff;
}

.btn.primary:hover:not(:disabled),
#saveRecord:hover:not(:disabled),
#saveRequest:hover:not(:disabled),
#createDraft:hover:not(:disabled),
#finalizeSettlement:hover:not(:disabled),
#savePayment:hover:not(:disabled),
#saveCompanyTransaction:hover:not(:disabled),
#saveInfoPortalPost:hover:not(:disabled),
#savePartnerProfile:hover:not(:disabled),
#saveToolManual:hover:not(:disabled),
#saveToolsDataset:hover:not(:disabled),
#addUser:hover:not(:disabled),
#addPartnerTreeLink:hover:not(:disabled) {
  background: var(--ui-green-dark);
  border-color: var(--ui-green-dark);
}

#pageExportButton,
#exportReportExcel,
#exportReportPdf,
#showReportChart,
#exportFinanceExcel,
#showFinanceChart,
#printProposalTool,
#printComparisonTool,
.btn.export,
.btn.download {
  background: #f1f7fa;
  border-color: #bdd4e0;
  color: var(--ui-blue);
}

#pageExportButton:hover:not(:disabled),
#exportReportExcel:hover:not(:disabled),
#exportReportPdf:hover:not(:disabled),
#showReportChart:hover:not(:disabled),
#exportFinanceExcel:hover:not(:disabled),
#showFinanceChart:hover:not(:disabled),
#printProposalTool:hover:not(:disabled),
#printComparisonTool:hover:not(:disabled),
.btn.export:hover:not(:disabled),
.btn.download:hover:not(:disabled) {
  background: #e3f1f7;
  border-color: #9fc5d7;
  color: var(--ui-blue-dark);
}

.btn.danger,
#deleteRecord,
#confirmDelete,
#deleteRequestFromDetail,
#deletePartnerProfileFromView {
  background: var(--ui-danger);
  border-color: var(--ui-danger);
  color: #ffffff;
}

.btn.danger:hover:not(:disabled),
#deleteRecord:hover:not(:disabled),
#confirmDelete:hover:not(:disabled),
#deleteRequestFromDetail:hover:not(:disabled),
#deletePartnerProfileFromView:hover:not(:disabled) {
  background: var(--ui-danger-dark);
  border-color: var(--ui-danger-dark);
}

.btn.secondary,
.filter-reset,
#resetProposalTool,
#clearEnergyFilters,
#clearMobileFilters,
#clearFinancePartnerFilter,
#clearGrossPartnerFilter {
  background: #ffffff;
  border-color: #cfdbe3;
  color: #33485a;
}

.btn.secondary:hover:not(:disabled),
.filter-reset:hover:not(:disabled),
#resetProposalTool:hover:not(:disabled),
#clearEnergyFilters:hover:not(:disabled),
#clearMobileFilters:hover:not(:disabled),
#clearFinancePartnerFilter:hover:not(:disabled),
#clearGrossPartnerFilter:hover:not(:disabled) {
  background: #f5fafb;
  border-color: #b8ccd8;
}

.report-filters,
.energy-filters,
.mobile-filters,
.tools-controls,
.proposal-actions {
  background: var(--ui-surface);
  border-color: var(--ui-border);
  box-shadow: var(--ui-shadow-card);
}

.field input,
.field select,
.field textarea,
.tools-controls input,
.tools-controls select,
.tool-update-card input,
.tool-update-card select,
.tool-update-card textarea,
.multi-filter-button {
  border-color: #c9d7e0;
  border-radius: 7px;
}

.table-wrap,
.report-table-wrap,
.settlement-table-wrap,
.tools-table-wrap,
.tools-admin-table-wrap,
.infoportal-table-wrap,
.admin-table-wrap,
.energy-table-wrap,
.mobile-table-wrap,
.partner-admin-table-wrap {
  border-color: var(--ui-border);
  border-radius: 8px;
  box-shadow: var(--ui-shadow-card);
}

table th,
.energy-table th,
.mobile-table th,
.request-table th,
.admin-table th,
.pivot-table th,
.settlement-table th,
.tools-table th,
.tools-admin-table th,
.payment-table th,
.request-documents-table th {
  background: var(--ui-header);
  border-bottom: 1px solid #cbdbe5;
  color: var(--ui-text);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.25;
  padding-bottom: 11px;
  padding-top: 11px;
}

table td,
.energy-table td,
.mobile-table td,
.request-table td,
.admin-table td,
.pivot-table td,
.settlement-table td,
.tools-table td,
.tools-admin-table td,
.payment-table td,
.request-documents-table td {
  border-bottom-color: #e3ebf0;
}

.energy-table tbody tr:hover,
.mobile-table tbody tr:hover,
.settlement-table tbody tr:hover,
.tools-table tbody tr:hover,
.tools-admin-table tbody tr:hover,
.pivot-table tbody tr:hover td {
  background: #f1f8fa;
}

.dash-card {
  background: var(--ui-surface);
  min-height: clamp(270px, 34vw, 340px);
  padding: 14px 16px;
}

.dash-card h2 {
  background: #f7fafc;
  border-bottom: 1px solid #e2ebf1;
  font-size: 15px;
  margin: -14px -16px 12px;
  min-height: 42px;
  padding: 12px 14px 10px;
  text-align: left;
}

.dash-card.wide {
  min-height: clamp(310px, 40vw, 360px);
}

.pie-card {
  min-height: clamp(520px, 66vw, 620px);
}

.dashboard-kpi-card {
  background: #ffffff;
}

.dashboard-kpi-card strong {
  color: var(--ui-text);
}

.dashboard-kpi-card small {
  color: var(--ui-muted);
}

.record-dialog,
.confirm-dialog,
.chart-dialog,
.infoportal-editor-dialog,
.infoportal-read-dialog,
.infoportal-log-dialog,
.partner-profile-editor-dialog,
.partner-profile-view-dialog {
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

.record-dialog .dialog-header,
.confirm-dialog .dialog-header,
.chart-dialog .dialog-header,
.infoportal-popup-dialog .dialog-header,
.infoportal-read-dialog .dialog-header,
.infoportal-log-dialog .dialog-header {
  background: linear-gradient(180deg, #071016, #111b22);
  color: #ffffff;
  min-height: 64px;
}

.confirm-dialog form,
.infoportal-read-dialog form,
.infoportal-log-dialog form,
.partner-profile-view-dialog form {
  max-height: calc(100vh - 64px);
}

.confirm-message,
.infoportal-read-content,
.infoportal-log-content,
.partner-profile-view-content,
.request-detail-content {
  background: #fbfdfe;
  border-color: var(--ui-border);
}

.record-dialog .dialog-actions,
.confirm-dialog .dialog-actions,
.infoportal-editor-dialog .dialog-actions,
.infoportal-read-dialog .dialog-actions,
.infoportal-log-dialog .dialog-actions,
.partner-profile-editor-dialog .dialog-actions,
.partner-profile-view-dialog .dialog-actions {
  background: #f8fbfc;
  border-top-color: var(--ui-border);
}

.tools-page-hero {
  background: linear-gradient(180deg, #ffffff, #f8fbfc);
  min-height: 68px;
}

.tools-controls {
  padding: 13px;
}

.tools-summary-grid article,
.proposal-summary-row article,
.proposal-benefit-box {
  box-shadow: var(--ui-shadow-card);
}

.tools-table-wrap {
  max-height: min(64vh, 660px);
}

.tools-table th,
.proposal-table th,
.comparison-table th {
  background: var(--ui-header);
}

.tool-card-header {
  border-bottom: 1px solid var(--ui-border);
  margin-bottom: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .nav-item,
  .nav-submenu button,
  .btn {
    transition: none;
  }
}

/* Final launch typography clarity pass: visual-only. */
.sidebar {
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.sidebar .nav-label,
.sidebar .brand div,
.sidebar .brand strong,
.sidebar .brand span,
.sidebar .user-box strong,
.sidebar .user-box span,
.sidebar .nav-submenu button {
  color: rgba(255, 255, 255, 0.96);
  letter-spacing: 0.01em;
}

.nav-submenu button {
  font-size: 12px;
  font-weight: 600;
}

.nav-submenu button::before {
  font-weight: 600;
}

.nav-submenu button.active,
body.commissioning-standalone .commissioning-submenu button.active {
  font-weight: 600;
}

.nav-item {
  font-weight: 600;
}

.panel-header h2,
.settlement-card-header h2,
.tools-page-hero h1,
.tool-card-header h3,
.dash-card h2 {
  font-weight: 650;
  letter-spacing: 0;
}

.table th,
.data-table th,
.settlement-table th,
.tools-table th,
.proposal-table th,
.comparison-table th,
.report-table th {
  font-weight: 650;
  letter-spacing: 0;
}

.dash-chart-label,
.dash-chart-value,
.chart-pivot-control span,
.chart-dialog .dialog-header .eyebrow,
.role-chart-card .panel-header,
.finance-money-chart,
.mini-chart,
.chart-bar span {
  font-weight: 600;
  letter-spacing: 0;
}

/* Final audit fix: keep shared dark dialog headers readable after specific dialog rules. */
.record-dialog .dialog-header h2,
.confirm-dialog .dialog-header h2,
.chart-dialog .dialog-header h2,
.infoportal-popup-dialog .dialog-header h2,
.infoportal-read-dialog .dialog-header h2,
.infoportal-log-dialog .dialog-header h2,
.record-dialog .dialog-header .eyebrow,
.confirm-dialog .dialog-header .eyebrow,
.chart-dialog .dialog-header .eyebrow,
.infoportal-popup-dialog .dialog-header .eyebrow,
.infoportal-read-dialog .dialog-header .eyebrow,
.infoportal-log-dialog .dialog-header .eyebrow {
  color: #ffffff;
}

.record-dialog .dialog-header .icon-btn,
.confirm-dialog .dialog-header .icon-btn,
.chart-dialog .dialog-header .icon-btn,
.infoportal-popup-dialog .dialog-header .icon-btn,
.infoportal-read-dialog .dialog-header .icon-btn,
.infoportal-log-dialog .dialog-header .icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

.record-dialog .dialog-header .icon-btn:hover,
.confirm-dialog .dialog-header .icon-btn:hover,
.chart-dialog .dialog-header .icon-btn:hover,
.infoportal-popup-dialog .dialog-header .icon-btn:hover,
.infoportal-read-dialog .dialog-header .icon-btn:hover,
.infoportal-log-dialog .dialog-header .icon-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.34);
  color: #ffffff;
}

.record-dialog .dialog-header .eyebrow,
.confirm-dialog .dialog-header .eyebrow,
.chart-dialog .dialog-header .eyebrow,
.infoportal-popup-dialog .dialog-header .eyebrow,
.infoportal-read-dialog .dialog-header .eyebrow {
  opacity: 0.86;
}

.infoportal-read-dialog .dialog-header .eyebrow {
  opacity: 1;
}

.infoportal-read-dialog .infoportal-meta-date {
  color: rgba(225, 235, 238, 0.62);
}

.infoportal-read-dialog .infoportal-meta-category {
  color: rgba(231, 239, 241, 0.78);
}

/* Final audit button/typography balance: cosmetic only. */
.btn,
.filter-reset,
.multi-filter-button,
.link-button,
.page-actions .btn,
.section-actions .btn,
.row-actions .btn,
.tools-row-actions .btn,
.dialog-actions .btn {
  font-weight: 600;
  letter-spacing: 0;
}

.btn.primary,
.btn.danger,
.payment-delete-button,
.admin-action-inactive,
.admin-action-active,
.admin-action-password {
  font-weight: 650;
}

.btn:disabled,
.filter-reset:disabled {
  font-weight: 500;
  opacity: 0.64;
}

.btn.is-loading {
  align-items: center;
  cursor: not-allowed;
  display: inline-flex;
  gap: 8px;
  justify-content: center;
  opacity: 0.75;
  pointer-events: none;
  white-space: nowrap;
}

.btn.is-loading::before {
  animation: button-loading-spin 0.8s linear infinite;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  content: "";
  display: inline-block;
  flex: 0 0 auto;
  height: 13px;
  width: 13px;
}

@keyframes button-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.icon-btn,
.mini-icon-btn,
.icon-page-btn {
  font-weight: 500;
}

.table th,
.data-table th,
.energy-table th,
.settlement-table th,
.tools-table th,
.proposal-table th,
.comparison-table th,
.report-table th {
  font-weight: 650;
}

.muted-cell,
.payment-table small,
.settlement-card-header span,
.tool-card-header span,
.tools-page-hero span,
.panel-header span,
.infoportal-popup-list span,
.infoportal-read-files strong {
  font-weight: 500;
}

/* Executive dashboard hero refinement: visual-only, scoped to Owner/Admin dashboard. */
body:not(.commissioning-standalone).owner-mode:has(#dashboardView.active) .topbar,
body:not(.commissioning-standalone).admin-mode:has(#dashboardView.active) .topbar {
  background: linear-gradient(135deg, #050505 0%, #10171c 64%, #082822 100%);
  box-shadow: 0 10px 26px rgba(8, 24, 35, 0.13);
  min-height: 76px;
  padding: 15px 20px 16px;
}

body:not(.commissioning-standalone).owner-mode:has(#dashboardView.active) .topbar::after,
body:not(.commissioning-standalone).admin-mode:has(#dashboardView.active) .topbar::after {
  background: rgba(255, 255, 255, 0.045);
  height: 132px;
  right: -42px;
  top: -58px;
  width: 132px;
}

body:not(.commissioning-standalone).owner-mode:has(#dashboardView.active) .topbar h1,
body:not(.commissioning-standalone).admin-mode:has(#dashboardView.active) .topbar h1 {
  font-size: 27px;
  line-height: 1.05;
}

body:not(.commissioning-standalone).owner-mode:has(#dashboardView.active) .topbar h1::after,
body:not(.commissioning-standalone).admin-mode:has(#dashboardView.active) .topbar h1::after {
  color: rgba(226, 239, 237, 0.72);
  content: "Commissioning overview & operational metrics";
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.25;
  margin-top: 6px;
}

body:not(.commissioning-standalone).owner-mode:has(#dashboardView.active) .hero-tabs.contract-search-hero,
body:not(.commissioning-standalone).admin-mode:has(#dashboardView.active) .hero-tabs.contract-search-hero {
  min-height: 0;
}

body:not(.commissioning-standalone).owner-mode:has(#dashboardView.active) .hero-tabs .dashboard-kpis,
body:not(.commissioning-standalone).admin-mode:has(#dashboardView.active) .hero-tabs .dashboard-kpis {
  gap: 9px;
  margin-bottom: 0;
}

body:not(.commissioning-standalone).owner-mode:has(#dashboardView.active) .hero-tabs .dashboard-kpi-card,
body:not(.commissioning-standalone).admin-mode:has(#dashboardView.active) .hero-tabs .dashboard-kpi-card {
  border-top-width: 3px;
  box-shadow: 0 5px 14px rgba(2, 8, 12, 0.12);
  flex-basis: 184px;
  min-height: 96px;
  padding: 12px 14px;
}

body:not(.commissioning-standalone).owner-mode:has(#dashboardView.active) .hero-tabs .dashboard-kpi-card.primary-kpi,
body:not(.commissioning-standalone).admin-mode:has(#dashboardView.active) .hero-tabs .dashboard-kpi-card.primary-kpi {
  background: rgba(255, 255, 255, 0.965);
  border-top-width: 4px;
}

body:not(.commissioning-standalone).owner-mode:has(#dashboardView.active) .hero-tabs .dashboard-kpi-card.secondary-kpi,
body:not(.commissioning-standalone).admin-mode:has(#dashboardView.active) .hero-tabs .dashboard-kpi-card.secondary-kpi {
  background: rgba(248, 251, 252, 0.92);
  border-top-color: #8a9aa6;
}

body:not(.commissioning-standalone).owner-mode:has(#dashboardView.active) .hero-tabs .dashboard-kpi-card.production-accent,
body:not(.commissioning-standalone).admin-mode:has(#dashboardView.active) .hero-tabs .dashboard-kpi-card.production-accent {
  border-top-color: #2563eb;
}

body:not(.commissioning-standalone).owner-mode:has(#dashboardView.active) .hero-tabs .dashboard-kpi-card.money-accent,
body:not(.commissioning-standalone).admin-mode:has(#dashboardView.active) .hero-tabs .dashboard-kpi-card.money-accent {
  border-top-color: #16a34a;
}

body:not(.commissioning-standalone).owner-mode:has(#dashboardView.active) .hero-tabs .dashboard-kpi-card.total-accent,
body:not(.commissioning-standalone).admin-mode:has(#dashboardView.active) .hero-tabs .dashboard-kpi-card.total-accent {
  border-top-color: #5eead4;
}

body:not(.commissioning-standalone).owner-mode:has(#dashboardView.active) .hero-tabs .dashboard-kpi-card::after,
body:not(.commissioning-standalone).admin-mode:has(#dashboardView.active) .hero-tabs .dashboard-kpi-card::after {
  height: 68px;
  opacity: 0.07;
  right: -24px;
  top: -24px;
  width: 68px;
}

body:not(.commissioning-standalone).owner-mode:has(#dashboardView.active) .hero-tabs .dashboard-kpi-icon,
body:not(.commissioning-standalone).admin-mode:has(#dashboardView.active) .hero-tabs .dashboard-kpi-icon {
  border-radius: 7px;
  height: 29px;
  width: 29px;
}

body:not(.commissioning-standalone).owner-mode:has(#dashboardView.active) .hero-tabs .dashboard-kpi-icon svg,
body:not(.commissioning-standalone).admin-mode:has(#dashboardView.active) .hero-tabs .dashboard-kpi-icon svg {
  height: 17px;
  stroke-width: 2.1;
  width: 17px;
}

body:not(.commissioning-standalone).owner-mode:has(#dashboardView.active) .hero-tabs .dashboard-kpi-card strong,
body:not(.commissioning-standalone).admin-mode:has(#dashboardView.active) .hero-tabs .dashboard-kpi-card strong {
  font-size: clamp(20px, 1.45vw, 24px);
  font-weight: 650;
  line-height: 1.15;
  margin: 9px 0 4px;
}

body:not(.commissioning-standalone).owner-mode:has(#dashboardView.active) .hero-tabs .dashboard-kpi-card small,
body:not(.commissioning-standalone).admin-mode:has(#dashboardView.active) .hero-tabs .dashboard-kpi-card small {
  color: #637181;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

body:not(.commissioning-standalone).owner-mode:has(#dashboardView.active) .hero-tabs .dashboard-kpi-card.secondary-kpi strong,
body:not(.commissioning-standalone).admin-mode:has(#dashboardView.active) .hero-tabs .dashboard-kpi-card.secondary-kpi strong {
  color: #263847;
  font-weight: 600;
}

/* Partner operational dashboard hero refinement: visual-only, scoped to partner-like roles. */
body:not(.commissioning-standalone):is(.partner-mode, .subpartner-mode, .b2b-mode, .salesman-mode, .qr_partner-mode):has(#dashboardView.active) .topbar {
  background: linear-gradient(135deg, #050505 0%, #10161b 68%, #07251f 100%);
  box-shadow: 0 8px 22px rgba(8, 24, 35, 0.12);
  min-height: 72px;
  padding: 13px 20px 14px;
}

body:not(.commissioning-standalone):is(.partner-mode, .subpartner-mode, .b2b-mode, .salesman-mode, .qr_partner-mode):has(#dashboardView.active) .topbar::after {
  background: rgba(255, 255, 255, 0.035);
  height: 120px;
  right: -38px;
  top: -54px;
  width: 120px;
}

body:not(.commissioning-standalone):is(.partner-mode, .subpartner-mode, .b2b-mode, .salesman-mode, .qr_partner-mode):has(#dashboardView.active) .hero-tabs {
  margin-top: 9px;
}

body:not(.commissioning-standalone):is(.partner-mode, .subpartner-mode, .b2b-mode, .salesman-mode, .qr_partner-mode):has(#dashboardView.active) .hero-tabs .dashboard-kpis {
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  margin-bottom: 0;
}

body:not(.commissioning-standalone):is(.partner-mode, .subpartner-mode, .b2b-mode, .salesman-mode, .qr_partner-mode):has(#dashboardView.active) .hero-tabs .dashboard-kpi-title,
body:not(.commissioning-standalone):is(.partner-mode, .subpartner-mode, .b2b-mode, .salesman-mode, .qr_partner-mode):has(#dashboardView.active) .hero-tabs .dashboard-kpi-card {
  border-radius: 8px;
  min-height: 86px;
  padding: 11px 13px;
}

body:not(.commissioning-standalone):is(.partner-mode, .subpartner-mode, .b2b-mode, .salesman-mode, .qr_partner-mode):has(#dashboardView.active) .hero-tabs .dashboard-kpi-title {
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
}

body:not(.commissioning-standalone):is(.partner-mode, .subpartner-mode, .b2b-mode, .salesman-mode, .qr_partner-mode):has(#dashboardView.active) .hero-tabs .dashboard-kpi-title span {
  color: rgba(155, 215, 203, 0.74);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

body:not(.commissioning-standalone):is(.partner-mode, .subpartner-mode, .b2b-mode, .salesman-mode, .qr_partner-mode):has(#dashboardView.active) .hero-tabs .dashboard-kpi-title strong {
  font-size: clamp(18px, 1.45vw, 21px);
  font-weight: 600;
  line-height: 1.15;
  margin-top: 10px;
}

body:not(.commissioning-standalone):is(.partner-mode, .subpartner-mode, .b2b-mode, .salesman-mode, .qr_partner-mode):has(#dashboardView.active) .hero-tabs .dashboard-kpi-card {
  border-top-width: 3px;
  box-shadow: 0 4px 12px rgba(2, 8, 12, 0.1);
}

body:not(.commissioning-standalone):is(.partner-mode, .subpartner-mode, .b2b-mode, .salesman-mode, .qr_partner-mode):has(#dashboardView.active) .hero-tabs .dashboard-kpi-card.operational-action-kpi {
  background: rgba(255, 255, 255, 0.965);
  border-top-color: #b97312;
}

body:not(.commissioning-standalone):is(.partner-mode, .subpartner-mode, .b2b-mode, .salesman-mode, .qr_partner-mode):has(#dashboardView.active) .hero-tabs .dashboard-kpi-card.operational-stat-kpi {
  background: rgba(248, 251, 252, 0.92);
  border-top-color: #81939b;
}

body:not(.commissioning-standalone):is(.partner-mode, .subpartner-mode, .b2b-mode, .salesman-mode, .qr_partner-mode):has(#dashboardView.active) .hero-tabs .dashboard-kpi-card.attention {
  border-top-color: #c24155;
}

body:not(.commissioning-standalone):is(.partner-mode, .subpartner-mode, .b2b-mode, .salesman-mode, .qr_partner-mode):has(#dashboardView.active) .hero-tabs .dashboard-kpi-card.has-action-value::before {
  background: #b97312;
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(185, 115, 18, 0.13);
  content: "";
  height: 6px;
  position: absolute;
  right: 10px;
  top: 10px;
  width: 6px;
}

body:not(.commissioning-standalone):is(.partner-mode, .subpartner-mode, .b2b-mode, .salesman-mode, .qr_partner-mode):has(#dashboardView.active) .hero-tabs .dashboard-kpi-card strong {
  font-size: clamp(20px, 1.35vw, 23px);
  font-weight: 650;
  line-height: 1.1;
  margin: 6px 0 4px;
}

body:not(.commissioning-standalone):is(.partner-mode, .subpartner-mode, .b2b-mode, .salesman-mode, .qr_partner-mode):has(#dashboardView.active) .hero-tabs .dashboard-kpi-card small {
  color: #61707d;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.18;
}

body:not(.commissioning-standalone):is(.partner-mode, .subpartner-mode, .b2b-mode, .salesman-mode, .qr_partner-mode):has(#dashboardView.active) .hero-tabs .dashboard-kpi-card.operational-stat-kpi strong {
  color: #263847;
  font-weight: 600;
}

.request-file-actions {
  display: flex;
  margin-top: 8px;
}

.attachment-preview-dialog {
  width: min(1120px, calc(100vw - 32px));
  max-width: 1120px;
  padding: 0;
}

.attachment-preview-dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.attachment-preview-shell {
  display: flex;
  max-height: calc(100vh - 44px);
  min-height: min(690px, calc(100vh - 44px));
  flex-direction: column;
  overflow: hidden;
  background: #f7fafc;
}

.attachment-preview-header {
  flex: 0 0 auto;
  min-height: 58px;
  padding: 10px 14px;
}

.attachment-preview-header .eyebrow {
  color: rgba(225, 235, 238, 0.72);
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0;
}

.attachment-preview-header h2 {
  color: #ffffff;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.2;
  margin-top: 3px;
}

.attachment-preview-header .icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  height: 30px;
  width: 30px;
}

.attachment-preview-body {
  display: grid;
  grid-template-columns: minmax(250px, 305px) minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
  flex: 1 1 auto;
  padding: 10px;
}

.attachment-preview-list {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

.attachment-preview-item {
  display: grid;
  gap: 7px;
  padding: 9px;
  border-bottom: 1px solid var(--line);
}

.attachment-preview-item.active {
  background: #f1f8fa;
  box-shadow: inset 3px 0 0 #07806f;
}

.attachment-preview-item strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.attachment-preview-item span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.attachment-preview-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.attachment-preview-item-actions .btn {
  min-height: 26px;
  padding: 4px 8px;
}

.attachment-preview-stage {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

.attachment-preview-frame {
  width: 100%;
  height: 100%;
  min-height: 520px;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.attachment-preview-frame iframe,
.attachment-preview-frame img {
  width: 100%;
  height: 100%;
  min-height: 520px;
  border: 0;
  object-fit: contain;
  background: #ffffff;
}

.attachment-preview-empty {
  width: 100%;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.attachment-preview-footer {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 8px;
  padding: 9px 10px;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

@media (max-width: 900px) {
  .attachment-preview-body {
    grid-template-columns: 1fr;
  }

  .attachment-preview-frame,
  .attachment-preview-frame iframe,
  .attachment-preview-frame img {
    min-height: 380px;
  }
}

/* Final enterprise operational polish: visual-only consistency layer. */
.tools-page-hero {
  min-height: 58px;
  padding: 11px 14px;
}

.tools-page-hero h2 {
  font-size: 18px;
}

.tools-page-hero span {
  font-size: 12px;
}

.infoportal-toolbar-panel.panel {
  box-shadow: 0 6px 14px rgba(24, 39, 75, 0.045);
}

.infoportal-read-dialog .dialog-header,
.attachment-preview-header {
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}

.manuals-admin-table .btn,
.manual-card .btn,
.attachment-preview-footer .btn {
  min-height: 30px;
  padding: 6px 10px;
}

/* Comparison tool enterprise polish: visual-only, scoped to Tools > Comparison. */
body.tools-comparison-mode .topbar h1::after {
  color: rgba(226, 239, 237, 0.72);
  content: "Εργαλείο σύγκρισης παρόχων και προγραμμάτων";
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.25;
  margin-top: 5px;
}

body.tools-comparison-mode .tools-controls.comparison-controls {
  align-items: end;
  background: linear-gradient(180deg, #ffffff, #f8fbfc);
  border-color: #d7e4eb;
  box-shadow: 0 7px 18px rgba(24, 39, 75, 0.055);
  gap: 9px;
  grid-template-columns: minmax(132px, 150px) minmax(116px, 0.8fr) minmax(145px, 0.95fr) minmax(148px, 0.95fr) minmax(125px, 0.8fr) minmax(112px, 0.7fr) minmax(280px, 1.7fr);
  padding: 12px;
}

body.tools-comparison-mode .tools-controls.comparison-controls label {
  gap: 5px;
}

body.tools-comparison-mode .tools-controls.comparison-controls span {
  color: #526678;
  font-size: 11px;
  font-weight: 650;
}

body.tools-comparison-mode .tools-controls.comparison-controls .tools-primary-filter > span {
  color: #17384a;
  font-weight: 700;
}

body.tools-comparison-mode .tools-controls.comparison-controls input,
body.tools-comparison-mode .tools-controls.comparison-controls select {
  min-height: 36px;
  padding: 7px 9px;
}

body.tools-comparison-mode .tools-search {
  min-width: 0;
}

body.tools-comparison-mode .comparison-table-wrap {
  border-color: #d7e4eb;
  box-shadow: 0 8px 22px rgba(24, 39, 75, 0.065);
  max-height: min(64vh, 660px);
  scrollbar-color: #b8c8d1 transparent;
  scrollbar-width: thin;
}

body.tools-comparison-mode .comparison-table {
  min-width: 1480px;
}

body.tools-comparison-mode .comparison-table th {
  background: #f4f8fa;
  color: #253949;
  font-size: 11px;
  font-weight: 650;
  padding-bottom: 9px;
  padding-top: 9px;
}

body.tools-comparison-mode .comparison-table td {
  padding-bottom: 9px;
  padding-top: 9px;
  vertical-align: middle;
}

body.tools-comparison-mode .comparison-table tbody tr:hover td {
  background: #f7fbfc;
}

body.tools-comparison-mode .comparison-table th:nth-child(2),
body.tools-comparison-mode .comparison-table td:nth-child(2) {
  width: 62px;
}

body.tools-comparison-mode .comparison-table th:nth-child(3),
body.tools-comparison-mode .comparison-table td:nth-child(3) {
  width: 106px;
}

body.tools-comparison-mode .comparison-table th:nth-child(4),
body.tools-comparison-mode .comparison-table td:nth-child(4) {
  width: 300px;
}

body.tools-comparison-mode .comparison-table th:nth-child(8),
body.tools-comparison-mode .comparison-table td:nth-child(8),
body.tools-comparison-mode .comparison-table th:nth-child(9),
body.tools-comparison-mode .comparison-table td:nth-child(9) {
  width: 138px;
}

body.tools-comparison-mode .comparison-table th:nth-child(10),
body.tools-comparison-mode .comparison-table td:nth-child(10) {
  width: 440px;
}

body.tools-comparison-mode .comparison-program-cell {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

body.tools-comparison-mode .comparison-program-cell strong {
  color: #122d40;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.32;
}

body.tools-comparison-mode .top-choice-chip {
  align-items: center;
  background: #eaf7f1;
  border: 1px solid #bfe4d0;
  border-radius: 999px;
  color: #1b6b43;
  display: inline-flex;
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
  min-height: 19px;
  padding: 0 7px;
  white-space: nowrap;
}

body.tools-comparison-mode .tools-best-row td {
  background: #f3fbf7 !important;
  border-bottom-color: #cfe8da;
  border-top: 1px solid #cfe8da;
}

body.tools-comparison-mode .tools-best-row td:first-child {
  box-shadow: inset 3px 0 0 #07806f;
}

body.tools-comparison-mode .comparison-table .provider-cell {
  background: #ffffff;
  border: 1px solid #dfe8ee;
  border-radius: 7px;
  min-height: 30px;
  min-width: 78px;
  padding: 4px 6px;
}

body.tools-comparison-mode .comparison-table .provider-cell img {
  height: 20px;
  max-width: 66px;
  object-fit: contain;
}

body.tools-comparison-mode .tool-category-badge > span {
  flex-basis: 24px;
  height: 24px;
  opacity: 0.92;
  width: 24px;
}

body.tools-comparison-mode .tool-category-badge.home > span::before {
  border-bottom-width: 7px;
  border-left-width: 7px;
  border-right-width: 7px;
  left: 5px;
  top: 5px;
}

body.tools-comparison-mode .tool-category-badge.home > span::after {
  height: 8px;
  left: 8px;
  top: 12px;
  width: 8px;
}

body.tools-comparison-mode .tool-category-badge.business > span::before {
  box-shadow: 0 4px 0 #fff, 0 8px 0 #fff;
  height: 3px;
  left: 7px;
  top: 6px;
  width: 10px;
}

body.tools-comparison-mode .comparison-table .strong-cell {
  color: #0a3d56;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0;
}

/* Tools update enterprise polish */
.tools-update-workspace {
  display: grid;
  gap: 12px;
}

.tools-update-tabs {
  align-items: stretch;
  background: #f5f8fa;
  border: 1px solid #d8e3ea;
  border-radius: 12px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 8px;
}

.tools-update-tabs button {
  align-items: flex-start;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #24384a;
  cursor: pointer;
  display: grid;
  gap: 2px;
  min-height: 54px;
  padding: 9px 11px;
  text-align: left;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.tools-update-tabs button:hover {
  background: #fff;
  border-color: #d3e0e8;
}

.tools-update-tabs button.active {
  background: #fff;
  border-color: #adc4d1;
  box-shadow: inset 3px 0 0 #07806f;
}

.tools-update-tabs strong {
  font-size: 13px;
  font-weight: 700;
}

.tools-update-tabs span {
  color: #65798a;
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tools-update-section-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.tools-program-toolbar {
  align-items: end;
  background: #f7fafb;
  border: 1px solid #dbe6ec;
  border-radius: 10px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(260px, 420px) auto;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 10px;
}

.tools-program-search {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.tools-program-search span {
  color: #5f7182;
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.tools-program-count {
  align-self: end;
  background: #fff;
  border: 1px solid #dbe6ec;
  border-radius: 999px;
  color: #405366;
  font-size: 12px;
  font-weight: 700;
  min-height: 38px;
  padding: 10px 12px;
  white-space: nowrap;
}

#toolsUpdateView .tool-card-header h3 {
  margin: 0 0 3px;
}

#toolsUpdateView .tools-manual-form {
  align-items: end;
  gap: 9px;
}

#toolsUpdateView .tools-manual-form .btn {
  min-height: 36px;
  padding: 7px 12px;
  white-space: nowrap;
}

#toolsUpdateView .tools-admin-table tbody tr:hover td {
  background: #f8fbfc;
}

#toolsUpdateView .programs-admin-table td {
  vertical-align: middle;
}

#toolsUpdateView .programs-admin-table td:nth-child(6) {
  vertical-align: top;
}

#toolsUpdateView .programs-admin-table th:nth-child(7),
#toolsUpdateView .programs-admin-table td:nth-child(7) {
  width: 172px;
}

#toolsUpdateView .programs-admin-table td:last-child {
  box-sizing: border-box;
  padding-left: 8px;
  padding-right: 14px;
}

#toolsUpdateView .programs-admin-table .provider-cell,
#toolsUpdateView .manuals-admin-table .provider-cell {
  background: #fff;
  border: 1px solid #e0e9ef;
  border-radius: 7px;
  min-height: 28px;
  padding: 4px 6px;
}

#toolsUpdateView .programs-admin-table .provider-cell img {
  height: 19px;
  max-width: 54px;
}

#toolsUpdateView .tools-draft-box {
  margin-top: 10px;
}

/* Desktop app-shell layout fix: keep fixed sidebar and content wrapper separated. */
@media (min-width: 941px) {
  :root {
    --sidebar-content-offset: 84px;
  }

  .app-shell {
    display: block;
    min-height: 100vh;
    overflow-x: hidden;
  }

  .sidebar {
    border-right: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 4px 0 14px rgba(0, 0, 0, 0.25);
  }

  .main {
    margin-left: var(--sidebar-content-offset);
    max-width: none;
    min-width: 0;
    padding-left: 14px;
    transition: none;
    width: auto;
  }

  body.sidebar-force-collapsed .main {
    margin-left: var(--sidebar-content-offset);
  }

  .topbar,
  .view,
  .panel,
  .tools-shell,
  .tools-page-hero {
    max-width: 100%;
  }
}

/* Final enterprise UI consistency pass: end-of-file visual overrides only. */
.record-dialog .dialog-header .icon-btn,
.confirm-dialog .dialog-header .icon-btn,
.chart-dialog .dialog-header .icon-btn,
.infoportal-popup-dialog .dialog-header .icon-btn,
.infoportal-read-dialog .dialog-header .icon-btn,
.infoportal-log-dialog .dialog-header .icon-btn,
.attachment-preview-header .icon-btn {
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #ffffff;
  display: inline-flex;
  flex: 0 0 44px;
  font-size: 24px;
  height: 44px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 44px;
}

.record-dialog .dialog-header .icon-btn:hover,
.confirm-dialog .dialog-header .icon-btn:hover,
.chart-dialog .dialog-header .icon-btn:hover,
.infoportal-popup-dialog .dialog-header .icon-btn:hover,
.infoportal-read-dialog .dialog-header .icon-btn:hover,
.infoportal-log-dialog .dialog-header .icon-btn:hover,
.attachment-preview-header .icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.btn.primary {
  background: #07806f;
  border-color: #07806f;
  color: #ffffff;
}

.btn.primary:hover:not(:disabled) {
  background: #066f61;
  border-color: #066f61;
  color: #ffffff;
}

.btn.secondary {
  background: #ffffff;
  border-color: #cfd8df;
  color: #243642;
}

.btn.secondary:hover:not(:disabled) {
  background: #f4f7f9;
  border-color: #b9c7d0;
  color: #142733;
}

.btn.danger {
  background: #c83f3f;
  border-color: #c83f3f;
  color: #ffffff;
}

.btn.danger:hover:not(:disabled) {
  background: #ae3535;
  border-color: #ae3535;
  color: #ffffff;
}

.row-icon-action {
  align-items: center;
  border-radius: 10px;
  box-shadow: none;
  display: inline-flex;
  gap: 0;
  height: 40px;
  justify-content: center;
  min-height: 40px;
  min-width: 40px;
  padding: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  width: 40px;
}

.row-icon-action svg,
.row-icon-action img,
.row-icon-action i {
  flex: 0 0 18px;
  height: 18px;
  width: 18px;
}

.row-icon-action:hover:not(:disabled) {
  transform: translateY(-1px);
}

.row-icon-action:active:not(:disabled) {
  transform: scale(0.98);
}

.row-icon-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.row-icon-action.edit {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}

.row-icon-action.delete {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

.row-icon-action.view,
.row-icon-action.preview {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
}

.row-icon-action.download {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #059669;
}

body.task-admin-mode .request-actions-cell {
  align-items: center;
  gap: 8px;
}

body.task-admin-mode .request-actions-cell .btn {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-height: 30px;
  white-space: nowrap;
}

body.task-admin-mode .request-actions-cell .utility-action {
  background: #f6f9fa;
  border-color: #d7e1e8;
  color: #475866;
}

.infoportal-toolbar-panel .infoportal-toolbar {
  align-items: center;
  gap: 8px;
  grid-template-columns: minmax(210px, min(44%, 420px)) minmax(160px, 190px) max-content max-content max-content;
}

.infoportal-toolbar input,
.infoportal-provider-filter select,
.infoportal-toolbar .btn {
  height: 36px;
  min-height: 36px;
}

.infoportal-toolbar .btn {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  padding: 0 13px;
  white-space: nowrap;
}

.infoportal-unread-chip {
  background: #f6f8fa;
  border-color: #dce4ea;
  color: #6b7785;
  min-height: 32px;
  padding: 0 11px;
  white-space: nowrap;
}

.infoportal-row-actions {
  text-align: right;
  white-space: nowrap;
}

.infoportal-title-cell strong {
  color: #17252b;
  font-weight: 650;
}

.audit-filters {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(220px, 320px) 150px 150px max-content;
  margin: 8px 0 12px;
}

.audit-filters select,
.audit-filters input {
  background: #fff;
  border: 1px solid #cfdbe3;
  border-radius: var(--ui-radius-sm);
  color: var(--ink);
  height: 36px;
  min-height: 36px;
  padding: 0 10px;
}

.manual-card {
  gap: 8px;
  min-height: 46px;
  padding: 8px 10px;
}

.manual-card > div {
  gap: 8px;
}

.manual-card .provider-cell {
  min-height: 26px;
  padding: 3px 6px;
}

.manual-card .provider-cell img {
  max-height: 18px;
  max-width: 60px;
}

.manual-card .btn {
  min-height: 32px;
  padding: 6px 10px;
}

.compact-company-form #saveCompanyTransactionButton {
  justify-self: end;
  min-width: 142px;
  width: auto;
}

.compact-company-form .compact-form-action,
.compact-reminder-form .compact-form-action {
  padding-left: 14px;
  padding-right: 14px;
  width: auto;
}

.payment-reminder-recurrence-field:has(select:disabled) {
  opacity: 0.58;
}

.payment-reminder-recurrence-field select:disabled {
  cursor: not-allowed;
}

.partner-profile-editor-dialog .dialog-actions {
  margin-top: 8px;
  padding-top: 10px;
}

.partner-profile-editor-dialog #partnerProfileEditorContent {
  padding-bottom: 4px;
}

.energy-table th,
.data-table th,
.settlement-table th,
.tools-table th,
.proposal-table th,
.comparison-table th,
.report-table th,
.tools-admin-table th {
  padding-bottom: 9px;
  padding-top: 9px;
  vertical-align: middle;
}

.energy-table td,
.data-table td,
.settlement-table td,
.tools-table td,
.proposal-table td,
.comparison-table td,
.report-table td,
.tools-admin-table td {
  padding-bottom: 8px;
  padding-top: 8px;
  vertical-align: middle;
}

#toolsUpdateView .programs-admin-table {
  min-width: 1280px;
}

#toolsUpdateView .programs-admin-table .program-category-col,
#toolsUpdateView .programs-admin-table th:nth-child(3),
#toolsUpdateView .programs-admin-table td:nth-child(3) {
  width: 82px;
}

#toolsUpdateView .programs-admin-table .program-actions-col,
#toolsUpdateView .programs-admin-table th:nth-child(7),
#toolsUpdateView .programs-admin-table td:nth-child(7) {
  width: 154px;
}

#toolsUpdateView .programs-admin-table td:last-child {
  padding-left: 8px;
  padding-right: 16px;
}

#toolsUpdateView .programs-admin-table .tool-category-badge {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  line-height: 1;
  min-height: 24px;
  overflow: visible;
  vertical-align: middle;
}

#toolsUpdateView .programs-admin-table .tool-category-badge > span {
  align-items: center;
  border-width: 1px;
  display: inline-flex;
  flex: 0 0 24px;
  height: 24px;
  justify-content: center;
  line-height: 1;
  overflow: visible;
  width: 24px;
}

#toolsUpdateView .programs-admin-table .tool-category-badge.blue > span {
  background: #dcecf6;
  border-color: #a9c9dc;
  color: #1b5d93;
}

#toolsUpdateView .programs-admin-table .tool-category-badge.yellow > span {
  background: #fff1bf;
  border-color: #ddc05e;
  color: #8a6500;
}

#toolsUpdateView .programs-admin-table .tool-category-badge.green > span {
  background: #dcf0e6;
  border-color: #9fd0b8;
  color: #176a45;
}

#toolsUpdateView .programs-admin-table .tool-category-badge.home > span::before {
  border-bottom-width: 6px;
  border-left-width: 6px;
  border-right-width: 6px;
  left: 6px;
  top: 5px;
}

#toolsUpdateView .programs-admin-table .tool-category-badge.home > span::after {
  height: 7px;
  left: 8px;
  top: 11px;
  width: 8px;
}

#toolsUpdateView .programs-admin-table .tool-category-badge.business > span::before {
  height: 2px;
  left: 7px;
  top: 6px;
  width: 10px;
}

#toolsUpdateView .program-comment-clamp {
  line-height: 1.32;
  max-height: 32px;
}

/* Final modal header compactness pass: visual-only, no modal structure changes. */
.record-dialog .dialog-header,
.confirm-dialog .dialog-header,
.chart-dialog .dialog-header,
.infoportal-editor-dialog .dialog-header,
.infoportal-popup-dialog .dialog-header,
.infoportal-read-dialog .dialog-header,
.infoportal-log-dialog .dialog-header,
.partner-profile-editor-dialog .dialog-header,
.partner-profile-view-dialog .dialog-header,
.attachment-preview-header {
  min-height: 52px;
  padding: 10px 14px;
}

.record-dialog .dialog-header h2,
.confirm-dialog .dialog-header h2,
.chart-dialog .dialog-header h2,
.infoportal-editor-dialog .dialog-header h2,
.infoportal-popup-dialog .dialog-header h2,
.infoportal-read-dialog .dialog-header h2,
.infoportal-log-dialog .dialog-header h2,
.partner-profile-editor-dialog .dialog-header h2,
.partner-profile-view-dialog .dialog-header h2,
.attachment-preview-header h2 {
  font-size: 18px;
  font-weight: 650;
  line-height: 1.18;
  margin-top: 2px;
}

.record-dialog .dialog-header .eyebrow,
.confirm-dialog .dialog-header .eyebrow,
.chart-dialog .dialog-header .eyebrow,
.infoportal-editor-dialog .dialog-header .eyebrow,
.infoportal-popup-dialog .dialog-header .eyebrow,
.infoportal-read-dialog .dialog-header .eyebrow,
.infoportal-log-dialog .dialog-header .eyebrow,
.partner-profile-editor-dialog .dialog-header .eyebrow,
.partner-profile-view-dialog .dialog-header .eyebrow,
.attachment-preview-header .eyebrow {
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 3px;
}

#noteDialog .dialog-header {
  min-height: 52px;
  padding: 10px 14px;
}

#noteDialog .dialog-header h2 {
  font-size: 18px;
  line-height: 1.18;
  margin-top: 2px;
}

.infoportal-read-dialog .dialog-header .eyebrow {
  gap: 4px;
}

.infoportal-read-dialog .dialog-header .eyebrow .provider-cell,
.infoportal-provider-fallback {
  min-height: 24px;
  padding: 2px 7px;
}

.attachment-preview-header .icon-btn {
  height: 36px;
  width: 36px;
}

@media (min-width: 941px) {
  :root {
    --sidebar-content-offset: 76px;
  }

  .main {
    margin-left: var(--sidebar-content-offset);
    padding-left: 8px;
    transition: none;
  }

  body.sidebar-force-collapsed .main {
    margin-left: var(--sidebar-content-offset);
  }
}

@media (max-width: 760px) {
  .infoportal-toolbar-panel .infoportal-toolbar {
    grid-template-columns: 1fr;
  }

  .compact-company-form #saveCompanyTransactionButton {
    justify-self: stretch;
    width: 100%;
  }
}

/* Launch quick-view optimization: visual-only modal density polish. */
.confirm-dialog.request-detail-dialog,
#noteDialog {
  max-width: 1040px;
  width: min(1040px, calc(100vw - 36px));
}

.confirm-dialog.request-detail-dialog .dialog-header,
#noteDialog .dialog-header {
  min-height: 54px;
  padding: 14px 18px;
}

.confirm-dialog.request-detail-dialog .dialog-header h2,
#noteDialog .dialog-header h2 {
  font-size: 20px;
  line-height: 1.15;
}

.confirm-dialog.request-detail-dialog .dialog-header .eyebrow,
#noteDialog .dialog-header .eyebrow,
#noteDialog .note-dialog-subtitle {
  font-size: 11px;
  margin-bottom: 2px;
}

.confirm-dialog.request-detail-dialog .request-detail-content,
#noteDialog .confirm-message {
  padding: 14px 16px;
}

.confirm-dialog.request-detail-dialog .request-detail-content {
  max-height: calc(100vh - 188px);
}

.request-detail-grid,
.external-record-grid.request-detail-grid {
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.request-detail-grid div,
.external-record-grid.request-detail-grid div {
  background: #ffffff;
  border-color: #dfe8ee;
  border-radius: 9px;
  padding: 9px 10px;
}

.request-detail-grid span,
.external-record-grid.request-detail-grid span {
  color: #697b8a;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.01em;
  margin-bottom: 3px;
}

.request-detail-grid strong,
.external-record-grid.request-detail-grid strong {
  color: #142637;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.28;
  margin-top: 0;
}

.external-comments-section {
  background: #ffffff;
  border: 1px solid #dfe8ee;
  border-radius: 10px;
  gap: 9px;
  margin-top: 12px;
  padding: 11px 12px;
}

.external-comments-section h3 {
  color: #142637;
  font-size: 14px;
  font-weight: 750;
}

.external-comments-section .note-empty-state,
.quick-view-comments .note-empty-state {
  background: #f7fafb;
  border: 1px dashed #cfdbe3;
  color: #6b7b88;
  font-size: 12px;
  padding: 10px 11px;
}

.external-comments-section .thread-entry {
  gap: 5px;
  padding: 8px 10px;
}

.external-comments-section .reply-form {
  gap: 8px;
  margin-top: 8px;
}

.confirm-dialog.request-detail-dialog .dialog-actions,
#noteDialog .dialog-actions {
  gap: 8px;
  padding: 10px 16px 12px;
}

.confirm-dialog.request-detail-dialog .dialog-actions .btn,
#noteDialog .dialog-actions .btn {
  min-height: 38px;
}

@media (max-width: 760px) {
  .request-detail-grid,
  .external-record-grid.request-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Quick-view final micro polish: visual-only launch refinements. */
.confirm-dialog.request-detail-dialog .dialog-header,
#noteDialog .dialog-header {
  min-height: 49px;
  padding: 12px 17px;
}

.confirm-dialog.request-detail-dialog .dialog-header h2,
#noteDialog .dialog-header h2 {
  font-size: 19px;
}

.confirm-dialog.request-detail-dialog .dialog-header .icon-btn,
#noteDialog .dialog-header .icon-btn {
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.confirm-dialog.request-detail-dialog .dialog-header .icon-btn:hover,
#noteDialog .dialog-header .icon-btn:hover {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.16);
}

.request-detail-grid,
.external-record-grid.request-detail-grid {
  align-items: stretch;
  grid-auto-flow: dense;
}

.request-detail-grid div:last-child:nth-child(3n + 1),
.external-record-grid.request-detail-grid div:last-child:nth-child(3n + 1) {
  grid-column: span 3;
}

.request-detail-grid div:last-child:nth-child(3n + 2),
.external-record-grid.request-detail-grid div:last-child:nth-child(3n + 2) {
  grid-column: span 2;
}

.request-detail-grid span,
.external-record-grid.request-detail-grid span {
  color: #526575;
  font-weight: 700;
}

.external-comments-section {
  gap: 7px;
  margin-top: 10px;
  padding: 9px 10px;
}

.external-comments-section .note-empty-state,
.quick-view-comments .note-empty-state {
  background: #fafcfd;
  color: #738391;
  line-height: 1.35;
  padding: 7px 9px;
}

.external-comments-section .muted-note {
  background: #fbfcfd;
  border-color: #e4ebf0;
  font-size: 12px;
  line-height: 1.35;
  padding: 8px 9px;
}

/* Typography refinement: soften heavy value/label rendering without layout changes. */
.request-detail-grid strong,
.external-record-grid.request-detail-grid strong,
.thread-entry-meta strong,
.request-file-row strong,
.manual-card strong,
.infoportal-title-cell strong,
.programs-admin-table .program-name-cell strong,
body.tools-comparison-mode .comparison-program-cell strong,
.proposal-summary-row strong,
.proposal-benefit-box strong,
.airtime-rate-row strong,
.payment-report-detail strong,
.tools-summary-grid strong,
.dashboard-kpi-card strong,
.name-link {
  font-weight: 650;
  letter-spacing: -0.01em;
}

.request-detail-grid span,
.external-record-grid.request-detail-grid span,
.field > span,
.filter-field > span,
.request-form .field > span,
.thread-entry-meta span,
.muted-cell,
.dashboard-kpi-card small,
.payment-table small,
.settlement-table td small,
.tools-dataset-status span {
  color: #5f6b7a;
  font-weight: 600;
}

.provider-cell,
.comparison-program-cell,
.programs-admin-table .program-name-cell,
.request-detail-grid strong,
.external-record-grid.request-detail-grid strong,
.infoportal-title-cell strong,
.proposal-table td,
.tools-table td,
.energy-table td,
.mobile-table td {
  letter-spacing: -0.01em;
}

.thread-entry-meta span,
.request-detail-grid span,
.external-record-grid.request-detail-grid span,
.payment-table small,
.settlement-table td small,
.manual-meta,
.tools-dataset-status span {
  letter-spacing: 0;
}

/* Final typography balance tuning: restore value authority without heavy bold. */
.request-detail-grid div,
.external-record-grid.request-detail-grid div {
  border-color: #d7e0e8;
}

.request-detail-grid strong,
.external-record-grid.request-detail-grid strong {
  font-size: 13.5px;
  font-weight: 650;
}

.confirm-dialog.request-detail-dialog .dialog-header h2,
#noteDialog .dialog-header h2 {
  font-size: 19.5px;
  font-weight: 650;
}

.name-link,
.provider-cell,
.infoportal-title-cell strong,
.programs-admin-table .program-name-cell strong,
body.tools-comparison-mode .comparison-program-cell strong {
  font-weight: 650;
}
