:root {
  --orange: #f26a21;
  --orange-dark: #c94f12;
  --gray-950: #242424;
  --gray-850: #303030;
  --gray-700: #565656;
  --gray-500: #8a8a8a;
  --gray-200: #e8e8e8;
  --gray-100: #f5f5f5;
  --white: #ffffff;
  --green: #2f8f5b;
  --blue: #2f6f9f;
  --red: #c93636;
  --shadow: 0 20px 50px rgba(36, 36, 36, 0.14);
  --radius: 8px;
  font-family: "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--gray-950);
  background: var(--gray-100);
}

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(340px, 0.95fr);
  min-height: 100vh;
  background: var(--white);
}

.brand-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: var(--white);
  background:
    linear-gradient(135deg, rgba(36, 36, 36, 0.94), rgba(48, 48, 48, 0.86)),
    url("/static/img/login-bg.png");
  background-size: cover;
  background-position: center;
}

.brand-panel__content {
  width: min(560px, 100%);
}

.brand-logo {
  width: min(260px, 70vw);
  max-height: 92px;
  object-fit: contain;
  margin-bottom: 72px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--orange);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-panel h1 {
  margin: 0;
  font-size: clamp(2.7rem, 6vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.brand-copy {
  max-width: 460px;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.05rem;
  line-height: 1.55;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(245,245,245,0.98));
}

.login-card {
  width: min(420px, 100%);
  padding: 36px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.login-logo {
  display: block;
  width: 84px;
  height: 84px;
  object-fit: contain;
  margin: 0 auto 20px;
}

.login-card h2 {
  margin: 0 0 24px;
  text-align: center;
  font-size: 1.7rem;
  letter-spacing: 0;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--gray-700);
  font-weight: 700;
  font-size: 0.9rem;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d6d6d6;
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--white);
  color: var(--gray-950);
  outline: none;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(242, 106, 33, 0.14);
}

.primary-btn,
.ghost-btn,
.icon-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  font-weight: 800;
  letter-spacing: 0;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.primary-btn {
  width: 100%;
  min-height: 46px;
  color: var(--white);
  background: var(--orange);
  box-shadow: 0 12px 26px rgba(242, 106, 33, 0.28);
}

.primary-btn:hover {
  background: var(--orange-dark);
  transform: translateY(-1px);
}

.secondary-btn {
  color: var(--gray-950);
  background: var(--gray-200);
}

.ghost-btn {
  color: var(--gray-950);
  background: var(--white);
  border: 1px solid var(--gray-200);
}

.ghost-btn:hover,
.secondary-btn:hover {
  box-shadow: 0 10px 24px rgba(36, 36, 36, 0.10);
  transform: translateY(-1px);
}

.danger {
  color: var(--red);
}

.form-message {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--red);
  font-weight: 700;
  text-align: center;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 18px 14px;
  color: var(--white);
  background: var(--gray-950);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 8px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  font-weight: 900;
}

.sidebar-brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.side-nav {
  display: grid;
  gap: 6px;
  padding: 18px 0;
}

.side-nav button {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 10px 12px;
  color: rgba(255,255,255,0.82);
  background: transparent;
  text-align: left;
  font-weight: 700;
}

.side-nav button:hover,
.side-nav button.active {
  color: var(--white);
  background: rgba(242, 106, 33, 0.18);
}

.side-nav button.active {
  box-shadow: inset 3px 0 0 var(--orange);
}

svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.sidebar-user {
  margin-top: auto;
  padding: 14px 10px 4px;
  border-top: 1px solid rgba(255,255,255,0.10);
}

.sidebar-user span,
.sidebar-user small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user span {
  font-weight: 900;
}

.sidebar-user small {
  color: rgba(255,255,255,0.62);
  margin-top: 3px;
}

.workspace {
  min-width: 0;
  background: var(--gray-100);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 78px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--gray-200);
  background: rgba(255,255,255,0.94);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.portal,
.view-container {
  width: min(1180px, calc(100vw - 320px));
  margin: 0 auto;
  padding: 30px 28px 48px;
}

.portal-heading {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin: 8px 0 30px;
}

.portal-heading img {
  width: min(250px, 72vw);
  max-height: 86px;
  object-fit: contain;
}

.portal-heading h1 {
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 3.6rem);
  letter-spacing: 0;
}

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

.module-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  min-height: 218px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--white);
  box-shadow: 0 12px 28px rgba(36,36,36,0.08);
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.module-card:hover {
  border-color: rgba(242, 106, 33, 0.42);
  box-shadow: 0 18px 38px rgba(36,36,36,0.14);
}

.module-icon {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  color: var(--white);
  background: var(--orange);
}

.module-card h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  letter-spacing: 0;
}

.module-card p {
  margin: 0;
  color: var(--gray-700);
  line-height: 1.45;
}

.module-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--green);
  font-weight: 800;
  font-size: 0.85rem;
}

.portal-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  color: var(--gray-700);
  font-weight: 700;
}

.nc-page {
  background: var(--gray-100);
}

.nc-module {
  width: min(1180px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 30px 0 52px;
  display: grid;
  grid-template-columns: minmax(300px, 420px) 1fr;
  gap: 18px;
}

.nc-module .panel {
  min-width: 0;
}

.panel {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 10px 24px rgba(36,36,36,0.07);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--gray-200);
}

.panel-header h3,
.section-title {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.panel-body {
  padding: 20px;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(360px, 1.2fr);
  gap: 18px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 14px 16px;
}

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

.actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--green);
  background: rgba(47, 143, 91, 0.12);
  font-weight: 800;
  font-size: 0.82rem;
}

.status-pill.warn {
  color: var(--orange-dark);
  background: rgba(242, 106, 33, 0.12);
}

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

.source-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.source-list span {
  min-height: 36px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--gray-100);
  overflow-wrap: anywhere;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--gray-200);
  text-align: left;
  vertical-align: top;
  font-size: 0.9rem;
}

th {
  color: var(--gray-700);
  background: var(--gray-100);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

tr:last-child td {
  border-bottom: 0;
}

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

.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  margin: 0;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--white);
  font-weight: 700;
}

.check-item input {
  width: 16px;
  min-height: 16px;
}

.action-permission-item {
  align-items: flex-start;
  flex-direction: column;
  gap: 3px;
  font-weight: 560;
}

.action-permission-item input {
  align-self: flex-start;
}

.action-permission-item small {
  color: var(--gray-500);
  font-size: 0.72rem;
  font-weight: 500;
}

.message-box {
  margin-top: 12px;
  border-left: 4px solid var(--orange);
  border-radius: 6px;
  padding: 12px;
  background: rgba(242, 106, 33, 0.10);
  color: var(--gray-950);
  overflow-wrap: anywhere;
}

.sql-preview {
  width: 100%;
  min-height: 220px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px;
  background: #1f1f1f;
  color: #f3f3f3;
  overflow: auto;
  white-space: pre-wrap;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed #cfcfcf;
  border-radius: var(--radius);
  color: var(--gray-700);
  background: rgba(255,255,255,0.72);
  text-align: center;
}

@media (max-width: 980px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    min-height: 42vh;
  }

  .brand-logo {
    margin-bottom: 40px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    position: sticky;
    top: 0;
    z-index: 20;
  }

  .side-nav {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }

  .portal,
  .view-container {
    width: min(100%, 1180px);
    padding: 22px 16px 36px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .split-grid,
  .field-grid,
  .nc-module {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .auth-panel,
  .brand-panel {
    padding: 24px 18px;
  }

  .login-card {
    padding: 24px;
  }

  .module-grid {
    grid-template-columns: 1fr;
  }

  .topbar-actions,
  .actions-row {
    width: 100%;
  }

  .topbar-actions button,
  .actions-row button {
    flex: 1 1 160px;
  }
}

/* Neocon ERP portal shell */
.app-shell {
  grid-template-columns: 96px minmax(0, 1fr);
  background: #f7f8f5;
}

.app-shell.is-portal .topbar {
  display: none;
}

.app-shell.is-portal .workspace {
  background:
    linear-gradient(rgba(32,32,32,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32,32,32,0.045) 1px, transparent 1px),
    linear-gradient(rgba(242,106,33,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(242,106,33,0.025) 1px, transparent 1px),
    #fbfcf8;
  background-size: 18px 18px, 18px 18px, 90px 90px, 90px 90px;
}

.sidebar {
  width: 96px;
  padding: 18px 12px;
  align-items: center;
  background: linear-gradient(180deg, #1f1f21 0%, #303033 100%);
  box-shadow: 10px 0 28px rgba(36,36,36,0.16);
}

.sidebar-brand {
  width: 70px;
  height: 70px;
  min-height: 70px;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(0,0,0,0.18);
}

.sidebar-brand img {
  width: 54px;
  height: 54px;
}

.sidebar-brand span,
.rail-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.side-nav {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 28px 0;
}

.side-nav button {
  width: 48px;
  height: 48px;
  min-height: 48px;
  display: grid;
  place-items: center;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 0;
  border-radius: 8px;
  color: #fff;
  background: rgba(255,255,255,0.11);
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.side-nav button:hover,
.side-nav button.active {
  background: var(--orange);
  box-shadow: 0 12px 22px rgba(242,106,33,0.28);
  transform: translateY(-1px);
}

.side-nav button.active {
  box-shadow: 0 12px 22px rgba(242,106,33,0.28);
}

.rail-short {
  display: block;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
}

.sidebar-user {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  margin-top: auto;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 35%, rgba(242,106,33,0.36), transparent 42%),
    rgba(255,255,255,0.07);
}

.sidebar-user span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-size: 0;
}

.sidebar-user span::first-letter {
  font-size: 1rem;
}

.sidebar-user small {
  display: none;
}

.portal {
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 0 32px;
}

.portal-heading {
  margin: 0;
  gap: 20px;
  text-align: center;
}

.portal-heading h1 {
  margin: 0;
  font-size: clamp(2rem, 3.2vw, 3.2rem);
  font-weight: 900;
  color: #242426;
}

.portal-heading img {
  width: min(720px, 64vw);
  max-height: 250px;
  filter: drop-shadow(0 22px 34px rgba(36,36,36,0.14));
}

.portal-heading p {
  margin: 0;
  color: #303033;
  font-size: clamp(1.1rem, 2vw, 1.65rem);
}

.app-shell:not(.is-portal) {
  display: block;
}

.app-shell:not(.is-portal) .sidebar,
.app-shell:not(.is-portal) .portal {
  display: none;
}

.app-shell:not(.is-portal) .workspace {
  min-height: 100vh;
}

.app-shell:not(.is-portal) .topbar,
.app-shell:not(.is-portal) .view-container {
  width: min(1180px, calc(100vw - 40px));
  margin: 0 auto;
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .sidebar {
    width: 72px;
    padding: 12px 8px;
  }

  .sidebar-brand,
  .sidebar-user {
    width: 54px;
    height: 54px;
    min-height: 54px;
  }

  .sidebar-brand img {
    width: 42px;
    height: 42px;
  }

  .side-nav {
    gap: 12px;
  }

  .side-nav button {
    width: 42px;
    height: 42px;
    min-height: 42px;
  }

  .portal {
    padding: 0 18px;
  }

  .portal-heading img {
    width: min(620px, 76vw);
  }
}

/* Ajustes 25/06 - padrão visual Neocon ERP */
:root {
  --orange: #ff6600;
  --green: #13a349;
  --gray-100: #f2f2f2;
  --gray-200: #e4e4e4;
  --gray-850: #4a4c50;
  --gray-950: #303236;
}

body,
button,
input,
select,
textarea {
  font-weight: 400;
}

h1,
h2,
h3,
h4,
strong,
b,
.panel-header h3,
.section-title,
.sidebar-user span {
  font-weight: 600;
}

.login-shell {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  min-height: 100vh;
  padding: 28px;
  background:
    linear-gradient(rgba(255,255,255,.74), rgba(255,255,255,.9)),
    url("/static/img/login-bg.png") center/cover no-repeat,
    #f2f2f2;
}

.auth-panel {
  width: 100%;
  padding: 0;
  background: transparent;
}

.login-card {
  width: min(650px, calc(100vw - 44px));
  padding: 38px;
  border-radius: 8px;
  border-color: #d8dce0;
  box-shadow: 0 24px 70px rgba(48,50,54,.16);
}

.login-logo-wide {
  width: min(300px, 70vw);
  height: auto;
  max-height: 82px;
  margin: 0 0 20px;
}

.login-card h2 {
  margin: 0 0 22px;
  text-align: left;
  font-size: clamp(1.4rem, 2.3vw, 1.9rem);
  font-weight: 600;
  color: #303236;
}

label {
  font-weight: 500;
}

.login-card label span,
.field-grid label span {
  color: #70747a;
}

input,
select,
textarea {
  border-color: #cfd5dc;
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(19,163,73,.13);
}

.primary-btn {
  background: var(--green);
  box-shadow: 0 14px 28px rgba(19,163,73,.24);
  font-weight: 600;
}

.primary-btn:hover {
  background: #0f8d3f;
}

.secondary-btn,
.ghost-btn {
  font-weight: 500;
}

.app-shell {
  grid-template-columns: 94px minmax(0, 1fr);
}

.sidebar {
  width: 94px;
  background: linear-gradient(180deg, #414348 0%, #51545a 100%);
  box-shadow: 10px 0 28px rgba(48,50,54,.11);
}

.sidebar-brand {
  width: 68px;
  height: 68px;
  min-height: 68px;
}

.side-nav {
  gap: 20px;
}

.side-nav button {
  width: 52px;
  height: 52px;
  min-height: 52px;
  color: #f7f7f7;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 12px 24px rgba(0,0,0,.12);
}

.side-nav button:hover,
.side-nav button.active {
  color: #fff;
  background: var(--orange);
  border-color: transparent;
  box-shadow: 0 14px 28px rgba(255,102,0,.26);
}

.rail-icon,
.rail-icon i,
.rail-icon svg {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
}

.rail-icon svg {
  stroke-width: 1.9;
}

.sidebar-user {
  background: rgba(255,255,255,.10);
}

.app-shell.is-portal .workspace {
  background:
    radial-gradient(circle at 50% 43%, rgba(255,255,255,.98), rgba(255,255,255,.74) 34%, rgba(242,242,242,.9) 72%),
    #f2f2f2;
}

.portal-heading {
  gap: 88px;
}

.portal-heading h1 {
  display: none;
}

.portal-heading img {
  width: min(760px, 60vw);
  max-height: 270px;
  filter: drop-shadow(0 24px 35px rgba(48,50,54,.13));
}

.portal-heading p {
  color: #303236;
  font-size: clamp(1.6rem, 3vw, 2.55rem);
  font-weight: 300;
}

.odbc-page {
  width: 100%;
}

.admin-kicker {
  margin: 0 0 6px;
  color: var(--orange);
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
}

.odbc-page h3 {
  margin: 0 0 12px;
  font-size: 1.7rem;
  font-weight: 500;
}

.odbc-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 14px;
  padding: 14px 12px 18px;
  border: 1px solid #cfd5dc;
  border-radius: 8px;
  background: #fff;
}

.odbc-card label {
  margin: 0;
  gap: 7px;
  color: #303236;
}

.odbc-card .full,
.odbc-card .wide {
  grid-column: 1 / -1;
}

.odbc-card input {
  min-height: 42px;
  font-weight: 500;
}

.odbc-card .form-actions {
  margin-top: 0;
}

.loading-overlay,
.neocon-module-loading {
  position: fixed;
  inset: 0;
  z-index: 2147483640;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  background: rgba(246,246,246,.72);
  backdrop-filter: blur(5px);
  color: var(--green);
  text-transform: uppercase;
  font-size: .78rem;
  font-weight: 600;
}

.neocon-spinner {
  position: relative;
  width: 78px;
  height: 78px;
  animation: neoconSpin 1.05s linear infinite;
}

.neocon-spinner span {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  border-radius: 999px;
  background: var(--green);
  transform-origin: 0 0;
}

.neocon-spinner span:nth-child(1) { width: 11px; height: 11px; transform: rotate(0deg) translate(30px) translate(-50%, -50%); opacity: 1; }
.neocon-spinner span:nth-child(2) { width: 10px; height: 10px; transform: rotate(30deg) translate(30px) translate(-50%, -50%); opacity: .94; }
.neocon-spinner span:nth-child(3) { width: 9px; height: 9px; transform: rotate(60deg) translate(30px) translate(-50%, -50%); opacity: .88; }
.neocon-spinner span:nth-child(4) { width: 8.5px; height: 8.5px; transform: rotate(90deg) translate(30px) translate(-50%, -50%); opacity: .82; }
.neocon-spinner span:nth-child(5) { width: 8px; height: 8px; transform: rotate(120deg) translate(30px) translate(-50%, -50%); opacity: .76; }
.neocon-spinner span:nth-child(6) { width: 7.5px; height: 7.5px; transform: rotate(150deg) translate(30px) translate(-50%, -50%); opacity: .70; }
.neocon-spinner span:nth-child(7) { width: 7px; height: 7px; transform: rotate(180deg) translate(30px) translate(-50%, -50%); opacity: .64; }
.neocon-spinner span:nth-child(8) { width: 6.5px; height: 6.5px; transform: rotate(210deg) translate(30px) translate(-50%, -50%); opacity: .58; }
.neocon-spinner span:nth-child(9) { width: 6px; height: 6px; transform: rotate(240deg) translate(30px) translate(-50%, -50%); opacity: .52; }
.neocon-spinner span:nth-child(10) { width: 5.5px; height: 5.5px; transform: rotate(270deg) translate(30px) translate(-50%, -50%); opacity: .46; }
.neocon-spinner span:nth-child(11) { width: 5px; height: 5px; transform: rotate(300deg) translate(30px) translate(-50%, -50%); opacity: .40; }
.neocon-spinner span:nth-child(12) { width: 4.5px; height: 4.5px; transform: rotate(330deg) translate(30px) translate(-50%, -50%); opacity: .34; }

@keyframes neoconSpin {
  to { transform: rotate(360deg); }
}

.nc-fat-app {
  width: min(1240px, calc(100vw - 42px));
  margin: 0 auto;
  padding: 22px 0 52px;
}

.nc-fat-page .table-scroll {
  overflow: auto;
}

.nc-fat-page .money-strong {
  color: var(--green);
  font-weight: 600;
}

@media (max-width: 760px) {
  .login-card {
    padding: 28px;
  }

  .portal-heading {
    gap: 54px;
  }

  .portal-heading img {
    width: min(640px, 78vw);
  }

  .odbc-card {
    grid-template-columns: 1fr;
  }
}

/* Ajustes 25/06 - densidade visual equivalente ao Chrome em ~80% */
:root {
  --green: #13a349;
  --app-font-size: 14px;
}

body {
  font-size: var(--app-font-size);
}

.topbar {
  min-height: 64px;
  padding: 12px 22px;
}

.topbar h2 {
  font-size: 1.12rem;
  font-weight: 500;
}

.portal,
.view-container {
  width: min(1320px, calc(100vw - 132px));
  padding: 24px 22px 42px;
}

.panel-header {
  padding: 14px 16px;
}

.panel-body {
  padding: 16px;
}

input,
select,
textarea {
  min-height: 38px;
  padding: 8px 10px;
}

.primary-btn,
.ghost-btn,
.icon-btn,
.secondary-btn {
  min-height: 36px;
  padding: 8px 12px;
  font-weight: 500;
}

.compact-action {
  width: auto;
  min-height: 34px;
}

th,
td {
  padding: 9px 10px;
  font-size: .82rem;
}

.side-nav {
  gap: 14px;
}

.side-nav button {
  width: 48px;
  height: 48px;
  min-height: 48px;
}

.erp-modal {
  width: min(920px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.erp-modal::backdrop {
  background: rgba(36, 38, 42, .34);
  backdrop-filter: blur(3px);
}

.erp-modal-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: min(760px, calc(100vh - 32px));
  margin: 0;
  border: 1px solid #d7dce1;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 24px 70px rgba(35, 38, 42, .22);
}

.erp-modal-card > header,
.erp-modal-card > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e5e8;
  background: #fff;
}

.erp-modal-card > footer {
  justify-content: flex-end;
  border-top: 1px solid #e2e5e8;
  border-bottom: 0;
}

.erp-modal-card h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 500;
}

.erp-modal-body {
  min-height: 0;
  overflow: auto;
  padding: 16px;
}

.compact-grid {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.row-actions .icon-btn,
.erp-modal .icon-btn {
  width: 34px;
  min-width: 34px;
  padding: 0;
  border: 1px solid #dfe3e7;
  background: #fff;
}

.row-actions .icon-btn:hover,
.erp-modal .icon-btn:hover {
  background: #f2f2f2;
}

.users-table-wrap table {
  min-width: 980px;
}

.auditor-contabil-page {
  background: #f2f2f2;
}

.accounting-app {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  gap: 18px;
  width: min(1420px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 74px 0 42px;
}

.accounting-subnav {
  position: sticky;
  top: 74px;
  align-self: start;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(48, 50, 54, .07);
}

.accounting-subnav button {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 10px;
  color: #303236;
  background: #fff;
  text-align: left;
}

.accounting-subnav button.active,
.accounting-subnav button:hover {
  border-color: rgba(255, 102, 0, .28);
  background: #fff3eb;
  color: var(--orange);
}

.accounting-subnav small {
  grid-column: 2;
  color: #7b828a;
  font-size: .72rem;
}

.accounting-workspace {
  min-width: 0;
}

.accounting-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  background: #fff;
}

.accounting-hero h1 {
  margin: 0 0 4px;
  font-size: 1.55rem;
  font-weight: 500;
}

.accounting-hero span {
  color: #626a73;
}

.compact-field {
  width: min(260px, 100%);
  margin: 0;
}

.accounting-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.accounting-toolbar .primary-btn,
.accounting-toolbar .secondary-btn {
  width: auto;
}

.accounting-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.ac-summary-card {
  min-height: 72px;
  border: 1px solid #dfe3e7;
  border-left: 4px solid #bfbfbf;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.ac-summary-card span {
  display: block;
  color: #6d7480;
  font-size: .76rem;
}

.ac-summary-card strong {
  display: block;
  margin-top: 8px;
  color: #303236;
  font-size: 1rem;
  font-weight: 500;
}

.ac-summary-card.ok {
  border-left-color: var(--green);
}

.ac-summary-card.warn,
.ac-summary-card.pending {
  border-left-color: #ffb020;
}

.ac-summary-card.error {
  border-left-color: #dc3545;
}

.accounting-table-panel .panel-body {
  padding: 0;
}

.accounting-table-wrap {
  max-height: calc(100vh - 360px);
  border: 0;
  border-radius: 0 0 8px 8px;
}

.accounting-table-wrap table {
  min-width: 1780px;
}

.accounting-table-wrap th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #bfbfbf;
  color: #303236;
  font-weight: 500;
  text-transform: none;
}

.accounting-table-wrap td {
  font-weight: 400;
}

.accounting-table-wrap th,
.accounting-table-wrap td {
  height: 32px;
  max-height: 32px;
  padding: 5px 8px;
  font-size: .76rem;
  line-height: 1.18;
  white-space: nowrap;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}

.accounting-table-wrap .nowrap-cell {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.accounting-table-wrap .error-cell {
  max-width: 330px;
  min-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.18;
}

.conference-select-col,
.conference-selection-cell {
  width: 38px;
  min-width: 38px;
  text-align: center;
}

.conference-selection-cell input,
.conference-select-col input {
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  accent-color: var(--green);
}

.status-action-cell {
  min-width: 132px;
  white-space: nowrap;
}

.status-action-cell .ac-status {
  margin-right: 6px;
  vertical-align: middle;
}

.accounting-table-wrap .ac-status {
  min-height: 20px;
  padding: 2px 7px;
  font-size: .68rem;
  line-height: 1;
}

.row-edit-btn {
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  color: #ff6600;
  background: rgba(255, 102, 0, .08);
  vertical-align: middle;
}

.row-edit-btn svg {
  width: 13px;
  height: 13px;
}

.pending-processing-row {
  background: #fffaf0;
}

.pending-processing-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-right: 6px;
  border-radius: 999px;
  color: #a86600;
  background: rgba(255, 176, 32, .18);
  vertical-align: middle;
}

.pending-processing-chip svg {
  width: 14px;
  height: 14px;
}

.editable-cell {
  cursor: cell;
  box-shadow: inset 0 -1px 0 rgba(19, 163, 73, .28);
}

.editable-cell:hover {
  background: rgba(19, 163, 73, .08);
}

.conference-filterbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid #edf0f2;
  border-bottom: 1px solid #edf0f2;
  background: #fff;
}

.conference-filter-group,
.conference-bulk-actions,
.conference-selection-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.conference-bulk-actions {
  align-self: center;
}

.conference-selection-summary {
  margin-left: auto;
  color: #58606a;
  font-size: .82rem;
}

.conference-filterbar button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  border: 1px solid #dfe3e7;
  border-radius: 7px;
  padding: 6px 10px;
  color: #303236;
  background: #f8f8f8;
}

.conference-filterbar .compact-btn {
  min-height: 32px;
  padding: 6px 10px;
  width: auto;
  box-shadow: none;
}

.conference-filterbar .compact-btn small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  padding: 0 6px;
  color: #fff;
  background: rgba(0, 0, 0, .22);
}

.conference-filterbar .process-pending-btn {
  position: relative;
  width: 34px;
  min-width: 34px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 7px;
}

.conference-filterbar .process-pending-btn svg {
  width: 15px;
  height: 15px;
}

.conference-filterbar .process-pending-btn small {
  position: absolute;
  transform: translate(14px, -13px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: .62rem;
}

.conference-filterbar button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.conference-filterbar button.active,
.conference-filterbar button:hover {
  border-color: rgba(255, 102, 0, .35);
  color: #ff6600;
  background: #fff3eb;
}

.conference-filter-group button span {
  min-width: 22px;
  border-radius: 999px;
  padding: 2px 6px;
  color: #58606a;
  background: #edf0f2;
  font-size: .72rem;
}

.account-search-results {
  margin-top: 10px;
}

.account-search-list {
  display: grid;
  gap: 8px;
  max-height: 250px;
  overflow: auto;
}

.account-search-list button {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #dfe3e7;
  border-radius: 7px;
  padding: 8px 10px;
  color: #303236;
  background: #fff;
  text-align: left;
}

.account-search-list button:hover {
  border-color: rgba(255, 102, 0, .35);
  background: #fff8f2;
}

.account-search-list small {
  color: #6b7280;
}

.compact-empty {
  padding: 10px;
}

.ac-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: .74rem;
  background: #e8ebee;
}

.ac-status.ok {
  color: #0f8d3f;
  background: rgba(19, 163, 73, .12);
}

.ac-status.warn {
  color: #a86600;
  background: rgba(255, 176, 32, .18);
}

.ac-status.pending {
  color: #9a6400;
  background: rgba(255, 176, 32, .24);
}

.ac-status.error {
  color: #b42318;
  background: rgba(220, 53, 69, .12);
}

.modal-table {
  max-height: 260px;
  margin: 8px 0 12px;
}

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

.modal-table input,
.modal-table select {
  min-width: 120px;
}

.params-tabs {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: -2px 0 14px;
  padding: 8px;
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  background: #fff;
}

.params-tabs button {
  min-height: 34px;
  border: 1px solid #dfe3e7;
  border-radius: 7px;
  padding: 6px 10px;
  color: #303236;
  background: #f8f8f8;
}

.params-tabs button.active,
.params-tabs button:hover {
  border-color: rgba(255, 102, 0, .35);
  color: #ff6600;
  background: #fff3eb;
}

.params-panel.hidden {
  display: none;
}

.field-grid > .mapping-groups {
  grid-column: 1 / -1;
}

.mapping-groups {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.mapping-group {
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.mapping-group h5 {
  margin: 0 0 10px;
  color: #303236;
  font-size: .86rem;
  font-weight: 500;
}

.mapping-group.dates {
  background: #f8fbff;
}

.mapping-group.supplier {
  background: #fffaf6;
}

.mapping-group.bank {
  background: #f5fbf7;
}

.mapping-group.debit {
  background: #fbfaf4;
}

.mapping-group.values {
  background: #fff8f8;
}

.soft-alert {
  border-left: 4px solid #ff6600;
  background: #fff4ec;
  color: #303236;
}

.modal-check {
  align-self: end;
}

.soft-empty {
  margin: 10px 0;
  padding: 12px;
  border: 1px dashed #dfe3e7;
  border-radius: 8px;
  background: #fafafa;
}

.inline-action {
  width: auto;
  margin-bottom: 16px;
}

.empty-state {
  color: #7b828a;
  text-align: center;
}

@media (max-width: 980px) {
  .compact-grid {
    grid-template-columns: 1fr;
  }

  .accounting-app {
    grid-template-columns: 1fr;
  }

  .accounting-subnav {
    position: static;
  }

  .accounting-summary {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

.auditor-contabil-page .accounting-app {
  display: block;
  width: min(1360px, calc(100vw - 28px));
  padding-top: 10px;
}

.auditor-contabil-page .accounting-hero {
  align-items: center;
  margin-bottom: 10px;
}

.auditor-contabil-page .compact-field input {
  min-width: 220px;
}

.company-preview {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: -4px 0 10px;
}

.company-preview > div {
  min-width: 180px;
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
}

.company-preview span {
  display: block;
  color: #707780;
  font-size: .72rem;
}

.company-preview strong {
  display: block;
  color: #303236;
  font-size: .9rem;
  font-weight: 500;
}

.accounting-topnav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 8px;
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  background: #fff;
}

.accounting-topnav button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid #dfe3e7;
  border-radius: 7px;
  padding: 7px 12px;
  color: #303236;
  background: #f8f8f8;
  font-weight: 500;
}

.accounting-topnav button.active,
.accounting-topnav button:hover {
  border-color: rgba(255, 102, 0, .32);
  color: #ff6600;
  background: #fff3eb;
}

.accounting-topnav small {
  margin-left: 2px;
  color: #7b828a;
  font-size: .7rem;
}

.clean-toolbar {
  align-items: center;
  padding: 8px 0;
}

.orange-action {
  border-color: #ff6600 !important;
  background: #ff6600 !important;
  color: #fff !important;
}

.compact-summary {
  grid-template-columns: repeat(6, minmax(110px, 1fr));
}

.fiscal-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(112px, 1fr)) repeat(4, max-content);
  gap: 10px;
  align-items: end;
}

.transfer-filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(112px, 1fr)) repeat(5, max-content);
  gap: 10px;
  align-items: end;
}

.fiscal-filter-grid label {
  margin: 0;
}

.transfer-filter-grid label {
  margin: 0;
}

.fiscal-filter-grid .primary-btn,
.fiscal-filter-grid .secondary-btn,
.transfer-filter-grid .primary-btn,
.transfer-filter-grid .secondary-btn {
  min-height: 43px;
  width: auto;
  padding-inline: 10px;
  white-space: nowrap;
}

#acFiscalExportBtn {
  grid-column: 1;
  grid-row: 2;
  justify-self: start;
}

.fiscal-summary {
  margin-top: 12px;
}

.transfer-summary {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  margin-top: 12px;
}

.transfer-table-wrap table {
  min-width: 2140px;
}

.transfer-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.modal-section {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e5e7eb;
}

.modal-section h4 {
  margin: 0 0 10px;
  color: #303236;
  font-size: .95rem;
  font-weight: 500;
}

#acFiscalTable input,
#acFiscalTable select {
  min-width: 110px;
  height: 34px;
}

#acFiscalTable input[data-fiscal="description"],
#acFiscalTable input[data-fiscal="cfops"],
#acFiscalTable input[data-fiscal="account_name"],
#acFiscalTable input[data-fiscal="note"] {
  min-width: 220px;
}

.fiscal-audit-row {
  cursor: pointer;
}

.fiscal-audit-row.selected td {
  background: #fff7f0;
}

.small-line {
  display: block;
  margin-top: 3px;
  font-size: .72rem;
}

.metric-cell {
  color: #303236;
  font-size: .95rem;
  font-weight: 600;
}

.mini-action {
  width: auto;
  min-height: 30px;
  padding: 5px 9px;
  white-space: nowrap;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.detail-grid article {
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.detail-grid span {
  display: block;
  color: #737b85;
  font-size: .74rem;
}

.detail-grid strong {
  display: block;
  margin-top: 5px;
  color: #303236;
  font-size: 1rem;
  font-weight: 600;
}

.modal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.modal-actions .secondary-btn {
  width: auto;
}

.wide-modal-table {
  max-height: min(62vh, 520px);
}

.wide-modal-table table {
  min-width: 1080px;
}

.wide-modal-table textarea {
  min-width: 320px;
  min-height: 54px;
  resize: vertical;
}

@media (max-width: 1100px) {
  .fiscal-filter-grid,
  .transfer-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    align-items: stretch;
  }

  .fiscal-filter-grid .primary-btn,
  .fiscal-filter-grid .secondary-btn,
  .transfer-filter-grid .primary-btn,
  .transfer-filter-grid .secondary-btn {
    justify-content: center;
  }

  #acFiscalExportBtn {
    grid-column: auto;
    grid-row: auto;
    justify-self: stretch;
  }

  .transfer-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .auditor-contabil-page .accounting-hero,
  .company-preview {
    display: block;
  }

  .company-preview > div {
    margin-bottom: 8px;
  }

  .compact-summary,
  .fiscal-summary,
  .transfer-summary {
    grid-template-columns: repeat(2, minmax(110px, 1fr));
  }
}

/* Dense desktop rhythm: approximates the former 80% Chrome zoom at 100%. */
@media (min-width: 900px) {
  html {
    font-size: 82.5%;
  }

  body,
  input,
  select,
  textarea,
  button {
    font-size: 12.5px;
  }

  input,
  select,
  textarea {
    min-height: 36px;
    padding: 7px 10px;
  }

  label {
    gap: 5px;
    margin-bottom: 10px;
  }

  .primary-btn,
  .ghost-btn,
  .icon-btn,
  .secondary-btn {
    min-height: 34px;
    padding: 7px 11px;
  }

  .workspace,
  .view-container {
    padding: 18px 22px;
  }

  .topbar {
    min-height: 58px;
    padding: 10px 16px;
  }

  .panel-body {
    padding: 14px;
  }

  .panel-header {
    min-height: 46px;
    padding: 12px 14px;
  }

  .accounting-hero {
    padding: 12px 14px;
    margin-bottom: 10px;
  }

  .accounting-topnav {
    min-height: 52px;
    padding: 9px 10px;
    gap: 8px;
  }

  .accounting-topnav button {
    min-height: 36px;
    padding: 8px 12px;
  }
}

@media (min-width: 900px) {
  .app-shell {
    grid-template-columns: 76px minmax(0, 1fr);
    transition: grid-template-columns .18s ease;
  }

  .app-shell:has(.sidebar:hover) {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .sidebar {
    width: 76px;
    padding: 16px 10px;
    transition: width .18s ease, align-items .18s ease;
  }

  .sidebar:hover {
    width: 220px;
    align-items: stretch;
  }

  .sidebar:hover .sidebar-brand {
    width: 100%;
    justify-content: flex-start;
    gap: 10px;
    padding: 0 10px;
  }

  .sidebar:hover .sidebar-brand span,
  .sidebar:hover .rail-label {
    position: static;
    width: auto;
    height: auto;
    clip: auto;
    overflow: visible;
    white-space: nowrap;
  }

  .sidebar:hover .side-nav {
    align-items: stretch;
  }

  .sidebar:hover .side-nav button {
    width: 100%;
    grid-template-columns: 28px minmax(0, 1fr);
    justify-content: flex-start;
    justify-items: start;
    place-items: center start;
    padding: 0 12px;
    text-align: left;
  }

  .sidebar:hover .rail-label {
    opacity: 1;
  }

  .sidebar:hover .sidebar-user {
    width: 100%;
    grid-template-columns: 42px minmax(0, 1fr);
    justify-content: flex-start;
    gap: 10px;
    padding: 10px;
  }

  .sidebar:hover .sidebar-user small {
    display: block;
    color: rgba(255,255,255,.74);
  }
}

.sidebar-user span.has-photo,
.profile-photo.has-photo {
  background-size: cover;
  background-position: center;
}

.sidebar-user span.has-photo {
  color: transparent;
}

.sidebar-user span.has-photo::first-letter {
  font-size: 0;
}

.profile-page,
.password-page {
  margin-bottom: 16px;
}

.profile-grid {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.profile-photo-block {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.profile-photo {
  width: 108px;
  height: 108px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid #dfe3e7;
  background: linear-gradient(135deg, var(--orange), #ff8a3c);
  color: #fff;
  box-shadow: 0 14px 30px rgba(36,36,36,.12);
}

.profile-photo span {
  font-size: 2rem;
  font-weight: 600;
}

.profile-photo.has-photo span {
  display: none;
}

.profile-file-btn {
  width: auto;
  cursor: pointer;
}

.profile-file-btn input {
  display: none;
}

.profile-fields {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.user-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.user-toolbar label {
  width: min(320px, 100%);
  margin-bottom: 0;
}

.module-list-cell {
  min-width: 240px;
  white-space: normal;
  line-height: 1.35;
}

@media (max-width: 760px) {
  .profile-grid,
  .profile-fields {
    grid-template-columns: 1fr;
  }

  .user-toolbar {
    display: grid;
    align-items: stretch;
  }
}

.message-box.success {
  border-left-color: var(--green);
  background: rgba(19, 163, 73, .10);
}

.message-box.warn {
  border-left-color: #ffb020;
  background: rgba(255, 176, 32, .12);
}

.message-box.error {
  border-left-color: var(--red);
  background: rgba(201, 54, 54, .10);
}

.utility-app {
  min-height: 100vh;
  padding: 16px;
  background: #f3f4f2;
}

.utility-hero {
  align-items: center;
}

.utility-panel {
  overflow: hidden;
}

.utility-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 10px;
  align-items: end;
}

.company-manual-grid {
  margin-top: 12px;
  grid-template-columns: minmax(240px, 2fr) repeat(4, minmax(120px, 1fr));
}

.utility-inline-action {
  display: flex;
  align-items: end;
  min-height: 36px;
}

.utility-inline-action .secondary-btn,
.utility-actions .primary-btn,
.utility-plus {
  width: auto;
}

.utility-mode {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0 10px;
}

.radio-card {
  display: inline-flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  margin: 0;
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: #303236;
}

.radio-card input {
  width: 16px;
  min-height: 16px;
}

.compact-utility-grid {
  grid-template-columns: repeat(5, minmax(120px, 180px));
}

.utility-plus {
  min-width: 44px;
  margin-top: 10px;
  background: var(--orange);
  color: #fff;
  box-shadow: 0 10px 24px rgba(255, 102, 0, .20);
}

.utility-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.company-preview article {
  border: 1px solid #dfe3e7;
  border-left: 4px solid var(--orange);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.company-preview article span {
  display: block;
  color: #6d7480;
  font-size: .76rem;
}

.company-preview article strong {
  display: block;
  margin-top: 4px;
  font-weight: 500;
}

@media (max-width: 1100px) {
  .utility-grid,
  .company-manual-grid,
  .compact-utility-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }
}

@media (max-width: 680px) {
  .utility-grid,
  .company-manual-grid,
  .compact-utility-grid {
    grid-template-columns: 1fr;
  }
}

.accounting-table-wrap .row-edit-btn.icon-btn {
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
}
