:root {
  --ink: #152331;
  --muted: #637186;
  --line: #c7d7e1;
  --brand: #1f83a3;
  --brand-dark: #0f4255;
  --panel: #ffffff;
  --surface: #f4f8fa;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(rgba(4, 14, 21, 0.8), rgba(4, 14, 21, 0.8)),
    url("../img/fondo dalvosystem.png") center / cover fixed;
}

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
}

.login-card {
  width: min(1040px, 100%);
  min-height: 630px;
  display: grid;
  grid-template-columns: 1.12fr 0.95fr;
  overflow: hidden;
  border: 1px solid rgba(235, 246, 252, 0.82);
  border-radius: 23px;
  background: var(--panel);
  box-shadow: 0 30px 90px rgba(2, 11, 17, 0.42);
}

.brand-panel {
  position: relative;
  min-height: 630px;
  overflow: hidden;
  color: #fff;
  background: url("../img/fondo principañ dalvo.png") center / cover;
}

.brand-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 38, 51, 0.92), rgba(21, 121, 151, 0.7)),
    rgba(0, 0, 0, 0.2);
}

.brand-content {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 46px 56px 36px;
}

.brand-mark,
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.4px;
}

.brand-mark img {
  width: 32px;
  height: auto;
  object-fit: contain;
}

.brand-copy {
  max-width: 470px;
}

.eyebrow {
  margin: 0 0 16px;
  color: #9bd7eb;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.brand-copy h1 {
  margin: 0;
  font-size: clamp(45px, 5vw, 62px);
  line-height: 0.92;
  letter-spacing: 0;
}

.brand-copy p:not(.eyebrow) {
  max-width: 430px;
  margin: 26px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.55;
}

.brand-foot {
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
}

.form-panel {
  min-height: 630px;
  display: grid;
  align-items: center;
  padding: 54px 46px;
  background: #fff;
}

.login-form {
  width: min(386px, 100%);
  margin: 0 auto;
}

.login-logo {
  width: 218px;
  max-width: 70%;
  height: auto;
  display: block;
  margin-bottom: 24px;
}

.form-heading {
  margin-bottom: 46px;
}

.form-heading h2 {
  margin: 0 0 4px;
  font-size: 24px;
  line-height: 1.2;
}

.form-heading p {
  margin: 0;
  color: #637186;
  font-size: 13px;
  font-weight: 800;
}

label {
  display: block;
  margin-bottom: 16px;
}

label span {
  display: block;
  margin-bottom: 8px;
  color: #637186;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  color: var(--ink);
  background: #f9fcfd;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(31, 131, 163, 0.12);
}

textarea {
  min-height: 120px;
  padding: 14px 15px;
  resize: vertical;
}

.form-message {
  min-height: 20px;
  margin: 0 0 8px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.primary-button,
.ghost-button {
  border: 0;
  border-radius: 8px;
  font-weight: 800;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.primary-button {
  width: 100%;
  min-height: 50px;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 18px 28px rgba(31, 131, 163, 0.22);
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.command-center {
  min-height: 100vh;
  background:
    linear-gradient(rgba(244, 248, 250, 0.94), rgba(244, 248, 250, 0.94)),
    url("../img/fondo dalvosystem.png") center / cover fixed;
}

.topbar {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(210px, 0.7fr) minmax(420px, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 14px clamp(18px, 4vw, 42px);
  border-bottom: 1px solid rgba(21, 35, 49, 0.1);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
}

.topbar-brand img {
  width: 145px;
  height: auto;
}

.topbar-brand span {
  color: var(--brand-dark);
}

.topbar-actions {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.global-search {
  position: relative;
  width: 100%;
}

.global-search label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.global-search input {
  min-height: 40px;
  padding: 0 64px 0 42px;
  border-radius: 12px;
  background: #f7fbfc;
}

.global-search::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 50%;
  width: 11px;
  height: 11px;
  border: 2px solid #8a98aa;
  border-radius: 50%;
  transform: translateY(-50%);
}

.global-search::after {
  content: "";
  position: absolute;
  left: 29px;
  top: 26px;
  width: 7px;
  height: 2px;
  border-radius: 2px;
  background: #8a98aa;
  transform: rotate(45deg);
}

.global-search kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  min-width: 44px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd6e1;
  border-radius: 5px;
  color: #718095;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  transform: translateY(-50%);
}

.create-button,
.launcher-button {
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  font-weight: 900;
}

.create-button {
  min-width: 90px;
  padding: 0 18px;
  color: #fff;
  background: #121a29;
  font-size: 14px;
}

.launcher-button {
  width: 42px;
  display: grid;
  grid-template-columns: repeat(2, 5px);
  grid-auto-rows: 5px;
  place-content: center;
  gap: 4px;
  border: 1px solid #d6e0e9;
  background: #fff;
}

.launcher-button span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #64748b;
}

.global-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 320px;
  overflow: auto;
  border: 1px solid rgba(21, 35, 49, 0.12);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(21, 35, 49, 0.16);
}

.search-result {
  display: block;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(21, 35, 49, 0.08);
}

.search-result:last-child {
  border-bottom: 0;
}

.search-result strong,
.search-result span {
  display: block;
}

.search-result strong {
  color: var(--brand-dark);
  font-size: 12px;
  text-transform: uppercase;
}

.search-result span {
  margin-top: 3px;
  color: var(--ink);
  font-size: 13px;
}

.module-launcher {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(7, 18, 28, 0.38);
}

.module-launcher-panel {
  width: min(860px, 100%);
  max-height: min(92vh, 760px);
  overflow: auto;
  padding: 28px 22px;
  border: 1px solid #d5e0eb;
  border-radius: 18px;
  background: #fbfcfe;
  box-shadow: 0 24px 80px rgba(7, 18, 28, 0.28);
}

.launcher-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.launcher-heading .eyebrow {
  margin-bottom: 8px;
  color: #8997ab;
}

.launcher-heading h1 {
  margin: 0;
  color: #071225;
  font-size: clamp(30px, 4vw, 36px);
  line-height: 1;
}

.launcher-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: var(--brand);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.launcher-search {
  position: relative;
  margin: 0 0 20px;
}

.launcher-search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.launcher-search input {
  min-height: 52px;
  padding-left: 44px;
  border-radius: 13px;
  background: #fff;
}

.launcher-search::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  width: 11px;
  height: 11px;
  border: 2px solid #8a98aa;
  border-radius: 50%;
  transform: translateY(-50%);
}

.launcher-search::after {
  content: "";
  position: absolute;
  left: 30px;
  top: 32px;
  width: 7px;
  height: 2px;
  border-radius: 2px;
  background: #8a98aa;
  transform: rotate(45deg);
}

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

.launcher-card {
  min-height: 96px;
  display: grid;
  grid-template-columns: 48px 1fr;
  grid-template-rows: auto auto;
  column-gap: 14px;
  align-items: center;
  padding: 18px;
  border: 1px solid #d8e3ee;
  border-radius: 14px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.launcher-card:hover,
.launcher-card:focus {
  border-color: var(--brand);
  box-shadow: 0 12px 30px rgba(31, 131, 163, 0.1);
}

.launcher-icon {
  grid-row: 1 / span 2;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  font-size: 13px;
  font-weight: 900;
}

.launcher-icon.teal {
  color: #1787a4;
  background: #e4f8fb;
}

.launcher-icon.blue {
  color: #1c6fa3;
  background: #e8f1ff;
}

.launcher-icon.green {
  color: #23865f;
  background: #e4f6ed;
}

.launcher-icon.purple {
  color: #7c3be6;
  background: #eee6ff;
}

.launcher-icon.orange {
  color: #d5662c;
  background: #fff0e8;
}

.launcher-icon.gold {
  color: #a87716;
  background: #fff5d7;
}

.launcher-card strong {
  align-self: end;
  color: #111827;
  font-size: 15px;
  line-height: 1.2;
}

.launcher-card small {
  align-self: start;
  margin-top: 6px;
  color: #526176;
  font-size: 12px;
  font-weight: 800;
}

.launcher-card.filtered-out {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(7, 18, 28, 0.42);
}

.modal-panel {
  width: min(1120px, 100%);
  max-height: min(92vh, 820px);
  overflow: auto;
  padding: 26px 28px;
  border: 1px solid #d5e0eb;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(7, 18, 28, 0.28);
}

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

.modal-heading .eyebrow {
  margin-bottom: 8px;
  color: #8997ab;
}

.modal-heading h2 {
  margin: 0;
  color: #071225;
  font-size: 24px;
  line-height: 1.1;
}

.modal-close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: var(--brand);
  font-size: 21px;
  font-weight: 900;
}

.modal-status {
  display: block;
  min-height: 18px;
  margin-bottom: 12px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.session-box {
  display: flex;
  align-items: center;
  gap: 18px;
}

.session-box strong,
.session-box span {
  display: block;
  text-align: right;
}

.session-box strong {
  font-size: 14px;
}

.session-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ghost-button {
  min-height: 40px;
  padding: 0 18px;
  color: var(--brand-dark);
  background: #dcebf0;
}

.main-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px clamp(18px, 4vw, 42px);
  border-bottom: 1px solid rgba(21, 35, 49, 0.1);
  background: rgba(247, 250, 251, 0.94);
  backdrop-filter: blur(14px);
  scrollbar-width: thin;
}

.main-nav.collapsed {
  display: none;
}

.nav-item {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #405264;
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.nav-item:hover {
  color: var(--brand-dark);
  background: #e8f2f5;
}

.nav-item.active {
  color: #fff;
  background: var(--brand-dark);
  box-shadow: 0 8px 18px rgba(15, 66, 85, 0.18);
}

.workspace {
  width: min(1280px, calc(100% - 44px));
  max-width: calc(100% - 44px);
  min-width: 0;
  overflow-x: clip;
  margin: 0 auto;
  padding: 36px 0 54px;
}

.workspace-heading {
  max-width: 760px;
  margin-bottom: 26px;
}

.workspace-heading h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1;
  letter-spacing: 0;
}

.workspace-heading p:last-child {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.workspace-heading.compact {
  max-width: 680px;
  margin-top: 34px;
}

.module-view {
  display: none;
}

.module-view.active {
  display: block;
}

.module-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  margin-bottom: 16px;
}

.module-search {
  width: min(420px, 100%);
  margin: 0;
}

.module-search input {
  min-height: 42px;
}

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

.metric-card {
  position: relative;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 18px;
  border: 1px solid rgba(21, 35, 49, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 30px rgba(21, 35, 49, 0.07);
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--brand);
}

.metric-card span {
  display: block;
  max-width: 210px;
  color: #405264;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.8px;
  line-height: 1.35;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin-top: 18px;
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0;
}

.accent-sales::before {
  background: #1f83a3;
}

.accent-clientes::before {
  background: #2f8f6b;
}

.accent-compras::before {
  background: #8062a8;
}

.accent-gastos::before {
  background: #b56b45;
}

.accent-presupuestos::before {
  background: #52677a;
}

.accent-facturacion::before {
  background: #b68a2b;
}

.users-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.42fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.users-panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid #cfe0ea;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
  min-width: 100%;
  margin: 12px 0 4px;
  padding: 10px 2px 0;
  color: #52677d;
  font-size: 12px;
  font-weight: 700;
}

.table-pagination button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #c8deea;
  border-radius: 8px;
  background: #fff;
  color: #0b5268;
  font-weight: 800;
  cursor: pointer;
}

.table-pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.user-form,
.users-list-panel {
  border: 1px solid rgba(21, 35, 49, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 30px rgba(21, 35, 49, 0.07);
}

.user-form {
  padding: 20px;
}

.modal .user-form {
  border-color: #d5e0eb;
  box-shadow: 0 24px 80px rgba(7, 18, 28, 0.28);
}

.create-user-button {
  flex: 0 0 auto;
  min-height: 43px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--brand);
  font-weight: 900;
  white-space: nowrap;
}

.users-list-panel {
  overflow: hidden;
}

.form-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.form-section-title h2 {
  margin: 0;
  font-size: 18px;
}

.form-section-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.client-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 16px;
}

.client-form {
  width: min(1240px, 100%);
}

.payment-box {
  margin: 20px 0;
  padding: 18px;
  border: 1px solid #d5e0eb;
  border-radius: 12px;
  background: #fbfdfe;
}

.payment-box h3 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 16px;
}

fieldset {
  margin: 8px 0 16px;
  padding: 14px;
  border: 1px solid rgba(21, 35, 49, 0.12);
  border-radius: 8px;
}

legend {
  padding: 0 6px;
  color: #405264;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.check-grid {
  display: grid;
  gap: 8px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.check-row input {
  width: 16px;
  min-height: 16px;
  padding: 0;
  accent-color: var(--brand);
}

.users-table-wrap {
  overflow: auto;
}

.users-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
}

.users-table th,
.users-table td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(21, 35, 49, 0.08);
  text-align: left;
  vertical-align: top;
}

.users-table th {
  color: #405264;
  background: #edf4f6;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.users-table td {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: #e8f2f5;
  font-size: 11px;
  font-weight: 900;
}

.empty-state {
  padding: 22px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.users-card-list {
  display: grid;
  gap: 14px;
}

.user-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 14px 14px 14px 18px;
  border: 1px solid #cfe0ea;
  border-left: 5px solid var(--brand);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
}

.user-card h2 {
  margin: 0 0 8px;
  color: #071225;
  font-size: 16px;
}

.user-facts {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 8px;
}

.client-facts {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.user-facts > span {
  min-height: 44px;
  display: block;
  padding: 10px;
  border: 1px solid #cfe0ea;
  border-radius: 8px;
  color: #153047;
  background: #f8fcfd;
  font-size: 12px;
  font-weight: 800;
}

.user-facts strong {
  font-weight: 900;
}

.user-card-actions {
  display: flex;
  align-items: start;
  gap: 9px;
}

.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--brand);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.danger-button {
  background: #cf3f45;
}

.document-form {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.fixed-expense-form {
  width: min(1040px, 100%);
}

.fixed-expense-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  padding: 4px 0 20px;
}

.fixed-expenses-panel {
  display: grid;
  gap: 20px;
}

.fixed-expense-table-shell {
  display: grid;
  gap: 8px;
}

.fixed-expense-table-actions {
  display: flex;
  justify-content: flex-end;
}

.fixed-expense-table {
  overflow: hidden;
  border: 1px solid #cfe0ea;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(7, 18, 37, 0.05);
}

.fixed-expense-table-head,
.fixed-expense-table-row {
  display: grid;
  grid-template-columns: var(
    --grid-columns,
    minmax(210px, 1.3fr) minmax(150px, 0.75fr) minmax(130px, 0.65fr) minmax(140px, 0.65fr) minmax(160px, 0.65fr)
  );
  align-items: center;
  gap: 12px;
}

.fixed-expense-table-head {
  min-height: 36px;
  padding: 0 14px;
  color: #fff;
  background: #0f84aa;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.fixed-expense-table-row {
  min-height: 58px;
  padding: 10px 14px;
  border-top: 1px solid #e2edf2;
  background: rgba(255, 255, 255, 0.92);
}

.fixed-expense-table-row:nth-child(even) {
  background: #f8fcfd;
}

.fixed-expense-table-row strong,
.fixed-expense-table-row span,
.fixed-expense-table-row b {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
}

.fixed-expense-table-row strong {
  overflow-wrap: anywhere;
  font-weight: 850;
  text-transform: uppercase;
}

.fixed-expense-table-row span {
  font-weight: 750;
}

.fixed-expense-table-row b {
  font-weight: 900;
}

.fixed-expense-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-start;
}

.fixed-expense-table-empty {
  padding: 28px 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.resizable-grid-table.is-resizing {
  cursor: col-resize;
  user-select: none;
}

.grid-th {
  position: relative;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
}

.sortable-column {
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 0 14px 0 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  text-transform: inherit;
}

.sortable-column::before {
  content: "\2195";
  margin-right: 6px;
  color: rgba(255, 255, 255, 0.55);
}

.grid-th[data-sort-direction="asc"] .sortable-column::before {
  content: "\2191";
  color: #fff;
}

.grid-th[data-sort-direction="desc"] .sortable-column::before {
  content: "\2193";
  color: #fff;
}

.column-resizer {
  position: absolute;
  top: 7px;
  right: -6px;
  width: 12px;
  height: calc(100% - 14px);
  cursor: col-resize;
}

.column-resizer::after {
  content: "";
  display: block;
  width: 2px;
  height: 100%;
  margin: 0 auto;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
}

.action-th {
  padding-right: 0;
}

.budgets-panel {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  contain: inline-size;
}

#budgetsListView {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  contain: inline-size;
}

#budgetsListView .module-toolbar {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.budget-form {
  width: min(1240px, 100%);
}

.budget-header-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 14px;
  padding-bottom: 16px;
}

.budget-header-grid .wide-field {
  grid-column: span 2;
}

.budget-header-grid input[readonly] {
  color: #314457;
  background: #f4f8fa;
}

.inline-check-field {
  min-height: 50px;
  align-self: end;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid #c3d8e3;
  border-radius: 9px;
  background: #f8fcfd;
}

.inline-check-field input {
  width: 16px;
  min-height: 16px;
  padding: 0;
  accent-color: var(--brand);
}

.inline-check-field span {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.budget-cost-toggle-row {
  display: flex;
  justify-content: flex-start;
  padding: 2px 0 14px;
}

.secondary-action-button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid #c3d8e3;
  border-radius: 9px;
  color: var(--brand-dark);
  background: #edf6f8;
  font-size: 14px;
  font-weight: 900;
}

.budget-costs-panel {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.budget-cost-card {
  overflow: hidden;
  border: 1px solid #cfe0ea;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(7, 18, 37, 0.06);
}

.budget-cost-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid #dce8ee;
  background: #f8fcfd;
}

.budget-cost-heading span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.budget-cost-heading h3 {
  margin: 0;
  color: #071225;
  font-size: 18px;
}

.budget-cost-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.budget-cost-actions strong {
  min-width: 120px;
  color: #071225;
  font-size: 16px;
  text-align: right;
}

.budget-cost-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px 16px;
  border-top: 1px solid #e2edf2;
  background: #fbfdfe;
}

.budget-cost-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.budget-cost-footer > strong {
  min-width: 140px;
  color: #071225;
  font-size: 17px;
  font-weight: 900;
  text-align: right;
}

.budget-documents-card {
  overflow: hidden;
  border: 1px solid #cfe0ea;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(7, 18, 37, 0.06);
}

.budget-documents-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid #dce8ee;
  background: #f8fcfd;
}

.budget-documents-heading span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.budget-documents-heading h3 {
  margin: 0;
  color: #071225;
  font-size: 18px;
}

.file-upload-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--brand);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.file-upload-button input {
  display: none;
}

.budget-documents-table {
  overflow: auto;
}

.budget-documents-head,
.budget-documents-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.5fr) minmax(260px, 1fr) minmax(110px, 0.35fr);
  align-items: center;
  gap: 12px;
  min-width: 560px;
}

.budget-documents-head {
  min-height: 38px;
  padding: 0 14px;
  color: #fff;
  background: #0f84aa;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.budget-documents-row {
  min-height: 54px;
  padding: 10px 14px;
  border-top: 1px solid #e2edf2;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
}

.budgets-table-shell {
  width: 100%;
  inline-size: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: auto;
  overscroll-behavior-inline: contain;
  border: 1px solid #cfe0ea;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(7, 18, 37, 0.05);
}

.budgets-table {
  width: max-content;
  min-width: 100%;
  max-width: none;
}

.budgets-table-head,
.budget-table-row {
  display: grid;
  grid-template-columns: var(
    --grid-columns,
    minmax(132px, 0.9fr) minmax(118px, 0.75fr) minmax(100px, 0.55fr) minmax(70px, 0.35fr)
      minmax(168px, 1fr) minmax(108px, 0.48fr) minmax(118px, 0.52fr) minmax(82px, 0.4fr)
      minmax(128px, 0.72fr) minmax(96px, 0.48fr) minmax(108px, 0.56fr) minmax(74px, 0.34fr)
  );
  align-items: center;
  gap: 8px;
  min-width: max-content;
}

.budgets-table-head {
  min-height: 38px;
  padding: 0 10px;
  color: #fff;
  background: #0f84aa;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.budget-table-row {
  min-height: 54px;
  padding: 9px 10px;
  border-top: 1px solid #e2edf2;
  color: var(--ink);
  font-size: 11px;
  font-weight: 400;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.budget-table-row .small-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 11px;
}

.budget-table-row > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.budget-table-row:nth-child(even) {
  background: #f8fcfd;
}

.budget-table-row.is-clickable {
  cursor: pointer;
}

.budget-table-row.is-clickable:hover {
  background: #eef8fb;
  box-shadow: inset 4px 0 0 var(--brand);
}

.budget-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.purchase-section {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
}

.purchase-section h2 {
  margin: 0;
  color: #071225;
  font-size: 20px;
}

.purchase-table {
  width: max-content;
  min-width: 100%;
}

.purchase-table-head,
.purchase-table-row {
  display: grid;
  gap: 8px;
  align-items: center;
  min-width: max-content;
}

.purchase-pending-table .purchase-table-head,
.purchase-pending-table .purchase-table-row {
  grid-template-columns: 150px 110px 110px 240px 260px 170px 120px 132px;
}

.purchase-created-table .purchase-table-head,
.purchase-created-table .purchase-table-row {
  grid-template-columns: 150px 110px 120px 180px 240px 130px 132px 170px;
}

.fixed-purchase-table .purchase-table-head,
.fixed-purchase-table .purchase-table-row {
  grid-template-columns: 150px 96px 130px 190px 260px 128px 132px 150px 110px 76px;
}

.fixed-purchase-section .module-toolbar {
  grid-template-columns: auto minmax(260px, 1fr) auto;
}

.fixed-purchase-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.fixed-purchase-budget-panel {
  margin: 28px 0;
}

.fixed-purchase-summary article {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 84px;
  padding: 16px 18px;
  border: 1px solid #c8deea;
  border-left: 4px solid #0f85a5;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
}

.fixed-purchase-summary span {
  color: #5f7288;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fixed-purchase-summary strong {
  color: #06172a;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
}

.fixed-purchase-order-row {
  display: grid;
  grid-template-columns: 140px 180px minmax(220px, 1fr) 130px 160px 120px 54px;
  gap: 10px;
  align-items: center;
  min-width: 980px;
  padding: 12px;
  border-top: 1px solid #dbe9ef;
}

.fixed-purchase-order-row input {
  min-height: 36px;
}

.accounts-receivable-table .purchase-table-head,
.accounts-receivable-table .purchase-table-row {
  grid-template-columns: var(
    --grid-columns,
    150px 150px 110px 110px 220px 108px 118px 140px 180px 92px 120px 110px
  );
}

.accounts-payable-table .purchase-table-head,
.accounts-payable-table .purchase-table-row {
  grid-template-columns: var(
    --grid-columns,
    130px 170px 110px 120px 110px 150px 140px 180px 96px 120px 108px 118px 110px
  );
}

.accounts-payable-ocgf-table .purchase-table-head,
.accounts-payable-ocgf-table .purchase-table-row {
  grid-template-columns: var(--grid-columns, 190px 120px 130px 130px 180px 96px 120px 108px 118px 110px);
}

.accounts-quote-table .purchase-table-head,
.accounts-quote-table .purchase-table-row {
  grid-template-columns: 95px 95px minmax(260px, 1fr) 120px 120px;
}

.purchase-table-head {
  min-height: 38px;
  padding: 0 10px;
  color: #fff;
  background: #0f84aa;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.purchase-table-row {
  min-height: 54px;
  padding: 9px 10px;
  border-top: 1px solid #e2edf2;
  color: var(--ink);
  font-size: 12px;
  font-weight: 400;
}

.purchase-table-row:nth-child(even) {
  background: #f8fcfd;
}

.purchase-table-row.is-clickable {
  cursor: pointer;
}

.purchase-table-row.is-clickable:hover {
  background: #eef8fb;
  box-shadow: inset 4px 0 0 var(--brand);
}

.purchase-table-empty {
  grid-template-columns: minmax(260px, 1fr);
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: #e8f2f5;
  font-size: 10px;
  font-weight: 400;
}

.accounts-receivable-upload-form {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fcfd;
}

.accounts-receivable-upload-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.accounts-receivable-upload-form input,
.accounts-receivable-upload-form select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  font-weight: 400;
}

.budget-table-empty {
  grid-template-columns: 1fr;
}

.budget-detail {
  display: grid;
  gap: 16px;
}

.budget-detail.hidden,
.budget-detail-actions.hidden {
  display: none !important;
}

.budget-detail h2 {
  margin: 0;
  color: #071225;
  font-size: 27px;
  line-height: 1.1;
}

#budgetDetailContent {
  display: grid;
  gap: 20px;
}

.budget-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
  border: 1px solid #cfe0ea;
  border-radius: 12px;
  background: #f8fcfd;
}

.budget-detail-card {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid #cfe0ea;
  border-top: 4px solid var(--brand);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(7, 18, 37, 0.05);
}

.budget-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 14px;
}

.budget-detail-grid .wide-field {
  grid-column: span 2;
}

.budget-detail-grid label {
  margin: 0;
}

.budget-detail-grid input {
  background: #f4f8fa;
  color: #314457;
}

.budget-detail-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
}

.budget-detail-summary article {
  padding: 14px;
  border: 1px solid #cfe0ea;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(7, 18, 37, 0.04);
}

.budget-detail-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.budget-detail-summary strong {
  display: block;
  margin-top: 8px;
  color: #071225;
  font-size: 18px;
}

.budget-costs-access {
  display: flex;
  justify-content: flex-end;
  padding: 14px 16px;
  border: 1px solid #cfe0ea;
  border-radius: 12px;
  background: #fbfdfe;
}

.budget-readonly-stack {
  display: grid;
  gap: 22px;
  padding: 4px 0;
}

.budget-readonly-card {
  overflow: hidden;
  border: 1px solid #cfe0ea;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(7, 18, 37, 0.04);
}

.budget-readonly-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid #dce8ee;
}

.budget-readonly-heading h3 {
  margin: 0;
  color: #071225;
  font-size: 16px;
}

.budget-readonly-heading strong {
  color: var(--brand-dark);
  font-size: 15px;
}

.budget-readonly-table-shell {
  overflow-x: auto;
}

.budget-readonly-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
}

.budget-readonly-table th {
  padding: 12px 14px;
  color: #fff;
  background: #0f84aa;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
}

.budget-readonly-table td {
  padding: 16px 14px;
  border-top: 1px solid #e2edf2;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
}

.budget-readonly-table td:first-child {
  white-space: normal;
}

.budget-readonly-table tr:nth-child(even) td {
  background: #f8fcfd;
}

.budget-readonly-table .empty-cell {
  color: var(--muted);
  text-align: center;
}

.budget-block-panel {
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid #cfe0ea;
  border-radius: 12px;
  background: #fbfdfe;
}

.budget-block-panel h3,
.budget-block-form h4 {
  margin: 0;
  color: #071225;
}

.budget-block-panel h3 {
  font-size: 18px;
}

.budget-block-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 14px;
}

.budget-block-cards article {
  min-height: 84px;
  padding: 14px;
  border: 1px solid #cfe0ea;
  border-left: 4px solid var(--brand);
  border-radius: 10px;
  background: #fff;
}

.budget-block-cards span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.budget-block-cards strong {
  display: block;
  margin-top: 8px;
  color: #071225;
  font-size: 22px;
}

.budget-block-form {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(170px, 0.6fr) minmax(170px, 0.6fr) minmax(160px, 0.55fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid #d5e6ee;
  border-radius: 10px;
  background: #fff;
}

.budget-block-form[data-budget-block-form="additional"] {
  grid-template-columns: minmax(220px, 0.8fr) minmax(180px, 0.55fr) minmax(170px, 0.55fr) auto 1fr;
}

.budget-block-form h4 {
  align-self: center;
  font-size: 16px;
}

.budget-block-form select,
.budget-block-form input {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #c9dce7;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-weight: 400;
}

.budget-warranty-check {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 10px;
  min-height: 42px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid #cfe0ea;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  font-weight: 400;
}

.budget-warranty-check input {
  width: 16px;
  min-height: 16px;
  padding: 0;
  accent-color: var(--brand);
}

.budget-financial-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid #cfe0ea;
  border-radius: 12px;
  background: #fbfdfe;
}

.budget-financial-panel h3 {
  margin: 0;
  color: #071225;
  font-size: 18px;
}

.budget-financial-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
  align-items: start;
  padding: 14px;
  border: 1px solid #d5e6ee;
  border-radius: 10px;
  background: #fff;
}

.budget-financial-profit {
  grid-template-columns: repeat(4, minmax(150px, 1fr)) minmax(170px, 0.75fr);
  align-items: end;
}

.budget-financial-field {
  display: grid;
  gap: 8px;
  align-content: start;
  margin: 0;
}

.budget-financial-field label {
  display: grid;
  gap: 8px;
  margin: 0;
}

.budget-financial-field span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  margin-bottom: 0;
  text-transform: uppercase;
}

.budget-financial-field input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #c9dce7;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  font-weight: 400;
}

.budget-financial-field input[readonly] {
  background: #f4f8fa;
}

.budget-financial-field.is-highlight input {
  color: var(--brand-dark);
  background: #e9f6fb;
}

.success-button {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: #129161;
  font-size: 12px;
  font-weight: 800;
}

.client-quote-module {
  display: grid;
  gap: 18px;
  margin: 22px 0;
  padding: 18px;
  border: 1px solid #cfe0ea;
  border-radius: 12px;
  background: #fff;
}

.accounts-payable-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.payment-order-card {
  display: grid;
  gap: 16px;
}

.payment-order-summary {
  display: grid;
  gap: 4px;
  color: var(--brand-dark);
}

.payment-order-summary span {
  color: #5c6b82;
  font-size: 13px;
}

.payment-order-form {
  display: grid;
  grid-template-columns: minmax(190px, 0.22fr) auto minmax(0, 1fr);
  gap: 14px;
  align-items: end;
  padding: 14px;
  border: 1px solid #cfe0ea;
  border-radius: 10px;
  background: #fbfdfe;
}

.payment-order-form label {
  margin: 0;
}

.payment-order-history {
  display: grid;
  gap: 10px;
}

.payment-order-history h4 {
  margin: 0;
  color: #071225;
  font-size: 16px;
}

.payment-order-history-row {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid #cfe0ea;
  border-radius: 8px;
  background: #fff;
}

.payment-order-history-row div {
  display: grid;
  gap: 3px;
}

.payment-order-history-row span {
  color: #5c6b82;
  font-size: 13px;
}

.client-quote-module h3 {
  margin: 0;
  color: #071225;
  font-size: 18px;
}

.client-quote-cost-picker {
  display: grid;
  grid-template-columns: minmax(170px, 0.35fr) auto auto minmax(0, 1fr);
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid #d5e6ee;
  border-radius: 10px;
  background: #fbfdfe;
}

.client-quote-cost-picker label {
  margin: 0;
}

.client-quote-cost-picker select {
  min-height: 40px;
  font-weight: 400;
}

.client-quote-ghost {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #c9dce7;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.client-quote-parts-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  min-height: 48px;
}

.client-quote-empty {
  padding: 14px;
  border: 1px dashed #c9dce7;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.client-quote-part {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #d5e6ee;
  border-radius: 10px;
  background: #fff;
}

.client-quote-part input {
  width: 16px;
  min-height: 16px;
  padding: 0;
  accent-color: var(--brand);
}

.client-quote-part span {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.client-quote-part strong {
  font-size: 13px;
}

.client-quote-table {
  overflow: hidden;
  border: 1px solid #cfe0ea;
  border-radius: 12px;
}

.client-quote-head,
.client-quote-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.45fr) minmax(90px, 0.45fr) minmax(260px, 1.5fr) minmax(120px, 0.6fr) minmax(120px, 0.6fr) 56px;
  gap: 10px;
  align-items: center;
}

.client-quote-head {
  min-height: 38px;
  padding: 0 14px;
  color: #fff;
  background: #0f84aa;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.client-quote-row {
  min-height: 58px;
  padding: 10px 14px;
  border-top: 1px solid #e2edf2;
  background: #f8fcfd;
}

.client-quote-row input {
  min-height: 38px;
  font-size: 13px;
  font-weight: 400;
}

.client-quote-row b {
  font-size: 13px;
  font-weight: 400;
}

.client-quote-total-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  width: 100%;
}

.client-quote-total {
  padding: 10px 12px;
  border: 1px solid #cfe0ea;
  border-radius: 9px;
  background: #fbfdfe;
  font-size: 13px;
}

.client-quote-total strong {
  font-weight: 800;
}

.client-quote-terms {
  margin: 0;
}

.client-quote-terms textarea {
  min-height: 190px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
}

.client-quote-actions,
.client-quote-history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.client-quote-history-title {
  margin-top: 4px;
}

.client-quote-history {
  display: grid;
  gap: 10px;
}

.client-quote-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #cfe0ea;
  border-radius: 10px;
  background: #fbfdfe;
}

.client-quote-history-row strong,
.client-quote-history-row span {
  display: block;
}

.client-quote-history-row strong {
  color: #071225;
}

.client-quote-history-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.client-po-form,
.supplier-order-file-form {
  display: grid;
  grid-template-columns: minmax(190px, 0.7fr) minmax(260px, 1fr) auto auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid #d5e6ee;
  border-radius: 10px;
  background: #fbfdfe;
}

.client-po-form label,
.supplier-order-file-form label {
  margin: 0;
}

.client-po-form input[type="file"],
.supplier-order-file-form input[type="file"] {
  min-height: 40px;
  padding: 8px;
}

.client-po-check {
  min-height: 42px;
}

.client-po-current {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #cfe0ea;
  border-radius: 10px;
  background: #f8fcfd;
  color: var(--ink);
  font-size: 13px;
}

.client-po-current a {
  color: var(--brand-dark);
  font-weight: 800;
  text-decoration: none;
}

.supplier-budget-panel {
  margin: 0;
}

.supplier-order-picker {
  grid-template-columns: minmax(150px, 0.3fr) minmax(220px, 0.45fr) auto minmax(0, 1fr);
}

.supplier-order-table {
  overflow: hidden;
  border: 1px solid #cfe0ea;
  border-radius: 12px;
}

.supplier-order-head,
.supplier-order-row {
  display: grid;
  grid-template-columns:
    minmax(120px, 0.55fr) minmax(150px, 0.7fr) minmax(260px, 1.45fr)
    minmax(100px, 0.45fr) minmax(130px, 0.62fr) minmax(120px, 0.55fr) 56px;
  gap: 10px;
  align-items: center;
}

.supplier-order-head {
  min-height: 38px;
  padding: 0 14px;
  color: #fff;
  background: #0f84aa;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.supplier-order-row {
  min-height: 58px;
  padding: 10px 14px;
  border-top: 1px solid #e2edf2;
  background: #f8fcfd;
}

.supplier-order-row input,
.supplier-order-row select {
  min-height: 38px;
  font-size: 13px;
  font-weight: 400;
}

.supplier-order-row b {
  font-size: 13px;
  font-weight: 400;
}

.supplier-order-retention {
  display: grid;
  grid-template-columns: minmax(220px, 0.32fr);
  gap: 8px;
}

.supplier-order-retention label {
  margin: 0;
}

.supplier-order-file-form {
  grid-template-columns: minmax(260px, 1fr) auto;
}

.dark-button {
  background: #121a29;
}

.budget-documents-row a {
  color: var(--brand-dark);
  font-weight: 900;
  text-decoration: none;
}

.budget-documents-row a:hover {
  text-decoration: underline;
}

.budget-equipment-table {
  overflow: auto;
}

.budget-equipment-head,
.budget-equipment-row {
  display: grid;
  grid-template-columns: var(
    --grid-columns,
    minmax(220px, 1.4fr) minmax(92px, 0.45fr) minmax(92px, 0.45fr) minmax(82px, 0.38fr) minmax(130px, 0.58fr) minmax(110px, 0.48fr) minmax(130px, 0.58fr) 42px
  );
  align-items: center;
  gap: 10px;
  min-width: 1020px;
}

.budget-equipment-head {
  min-height: 38px;
  padding: 0 12px;
  color: #fff;
  background: #0f84aa;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.budget-equipment-row {
  min-height: 62px;
  padding: 10px 12px;
  border-top: 1px solid #e2edf2;
  background: #fff;
}

.budget-equipment-row:nth-child(even) {
  background: #f8fcfd;
}

.budget-equipment-row select,
.budget-equipment-row input {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid #c3d8e3;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.budget-equipment-row b {
  color: #071225;
  font-size: 13px;
  font-weight: 900;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: #cf3f45;
  font-size: 16px;
  font-weight: 900;
}

.budget-equipment-empty {
  min-width: 1020px;
  padding: 28px 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.document-form label {
  margin: 0;
}

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

.document-row {
  display: block;
  padding: 12px 14px;
  border: 1px solid #cfe0ea;
  border-radius: 8px;
  color: var(--ink);
  background: #f8fcfd;
  text-decoration: none;
}

.document-row strong,
.document-row span {
  display: block;
}

.document-row strong {
  font-size: 13px;
}

.document-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.price-panel {
  display: grid;
  gap: 14px;
}

.price-form {
  display: grid;
  grid-template-columns: minmax(240px, 0.55fr) minmax(320px, 1fr) minmax(180px, 0.5fr) auto;
  gap: 12px;
  align-items: end;
}

.price-form label {
  margin: 0;
}

.price-form .primary-button {
  min-width: 90px;
  min-height: 43px;
}

.price-toolbar {
  margin: 0;
}

.price-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.price-category-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #cfe0ea;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 252, 253, 0.96)),
    #fff;
  box-shadow: 0 18px 42px rgba(7, 18, 37, 0.06);
}

.price-category-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 14px;
}

.price-category-heading span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.price-category-heading h2 {
  margin: 0;
  color: #071225;
  font-size: 18px;
  line-height: 1.25;
}

.columns-button {
  min-width: 84px;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--brand);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(30, 132, 162, 0.2);
}

.price-table {
  padding: 0 16px 16px;
}

.price-table-head,
.price-table-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(130px, 0.45fr) minmax(92px, 0.28fr);
  align-items: center;
  gap: 12px;
}

.price-table-head {
  min-height: 36px;
  padding: 0 10px;
  border-radius: 8px 8px 0 0;
  color: #fff;
  background: #0f84aa;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.price-table-head span {
  min-width: 0;
}

.price-table-head span::before {
  content: "\2195";
  margin-right: 6px;
  color: rgba(255, 255, 255, 0.55);
}

.price-table-body {
  overflow: hidden;
  border: 1px solid #dce8ee;
  border-top: 0;
  border-radius: 0 0 10px 10px;
  background: rgba(255, 255, 255, 0.82);
}

.price-table-row {
  min-height: 56px;
  padding: 10px;
  border-top: 1px solid #e2edf2;
}

.price-table-row:first-child {
  border-top: 0;
}

.price-table-row strong,
.price-table-row b {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
}

.price-table-row strong {
  overflow-wrap: anywhere;
  font-weight: 800;
  text-transform: uppercase;
}

.price-table-row b {
  font-weight: 900;
  text-align: left;
}

.price-table-row .small-button {
  justify-self: end;
  min-width: 80px;
}

.price-table-empty {
  padding: 28px 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

@media (max-width: 900px) {
  .shell {
    padding: 14px;
    place-items: start center;
  }

  .login-card {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .brand-panel {
    min-height: 410px;
  }

  .brand-content {
    padding: 34px 32px 28px;
  }

  .brand-copy h1 {
    font-size: clamp(38px, 12vw, 54px);
  }

  .form-panel {
    min-height: auto;
    padding: 42px 28px;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .topbar-actions {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .session-box strong,
  .session-box span {
    text-align: left;
  }

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

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

  .user-card,
  .user-facts {
    grid-template-columns: 1fr;
  }

  .client-form-grid,
  .document-form,
  .price-form,
  .fixed-expense-form-grid,
  .budget-header-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .budget-header-grid .wide-field {
    grid-column: span 2;
  }

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

  .budget-detail-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .budget-block-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .budget-block-form,
  .budget-block-form[data-budget-block-form="additional"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .budget-financial-grid,
  .budget-financial-profit {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-quote-cost-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-quote-table {
    overflow-x: auto;
  }

  .client-quote-head,
  .client-quote-row {
    min-width: 880px;
  }

  .price-board {
    grid-template-columns: 1fr;
  }

  .fixed-expense-table {
    overflow-x: auto;
  }

  .fixed-expense-table-head,
  .fixed-expense-table-row {
    min-width: 820px;
  }

  .budget-cost-heading,
  .budget-cost-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .user-card-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 620px) {
  .shell {
    padding: 0;
  }

  .login-card {
    border: 0;
    border-radius: 0;
  }

  .brand-panel {
    min-height: 360px;
  }

  .brand-content {
    padding: 28px 24px;
  }

  .brand-copy p:not(.eyebrow) {
    font-size: 15px;
  }

  .topbar-brand {
    width: 100%;
    justify-content: space-between;
  }

  .topbar-actions {
    grid-template-columns: minmax(0, 1fr) 42px;
  }

  .create-button {
    display: none;
  }

  .session-box {
    width: 100%;
    justify-content: space-between;
  }

  .session-box strong,
  .session-box span {
    text-align: left;
  }

  .workspace {
    width: calc(100% - 32px);
    padding: 36px 0;
  }

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

  .metric-card {
    min-height: 106px;
  }

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

  .client-form-grid,
  .document-form,
  .price-form,
  .fixed-expense-form-grid,
  .budget-header-grid,
  .price-table-head,
  .price-table-row {
    grid-template-columns: 1fr;
  }

  .budget-header-grid .wide-field {
    grid-column: auto;
  }

  .budget-detail-grid,
  .budget-detail-summary,
  .budget-block-cards,
  .budget-block-form,
  .budget-block-form[data-budget-block-form="additional"],
  .budget-financial-grid,
  .budget-financial-profit,
  .client-quote-cost-picker,
  .accounts-receivable-upload-form {
    grid-template-columns: 1fr;
  }

  .client-quote-history-row {
    grid-template-columns: 1fr;
  }

  .budget-detail-grid .wide-field {
    grid-column: auto;
  }

  .budget-detail-actions .small-button {
    flex: 1;
  }

  .budget-readonly-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .price-table-head {
    display: none;
  }

  .price-table-body {
    border-top: 1px solid #dce8ee;
    border-radius: 10px;
  }

  .price-table-row b {
    text-align: left;
  }

  .price-table-row .small-button {
    justify-self: stretch;
  }

  .fixed-expense-table {
    overflow: hidden;
  }

  .fixed-expense-table-head {
    display: none;
  }

  .fixed-expense-table-head,
  .fixed-expense-table-row {
    min-width: 0;
  }

  .fixed-expense-table-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .fixed-expense-actions {
    width: 100%;
  }

  .fixed-expense-actions .small-button {
    flex: 1;
  }

  .budget-cost-actions {
    width: 100%;
  }

  .budget-cost-actions strong {
    min-width: 0;
    text-align: left;
  }

  .module-launcher {
    padding: 0;
  }

  .module-launcher-panel {
    width: 100%;
    max-height: 100vh;
    min-height: 100vh;
    border-radius: 0;
  }

  .modal {
    padding: 0;
  }

  .modal-panel {
    width: 100%;
    max-height: 100vh;
    min-height: 100vh;
    border-radius: 0;
  }

  .module-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .create-user-button {
    width: 100%;
  }
}
