:root {
  --ink: #1B2A4A;
  --ink-soft: #2E3F5C;
  --paper: #f7f8fb;
  --paper-alt: #e4e9f2;
  --gold: #ff0000;
  --gold-light: #ffa2a2;
  --gold-dark: #800000;
  --slate: #5C6B7A;
  --slate-light: #8B97A3;
  --line: #c8ccd8;
  --placeholder: #a8b0bc;
  --red: #B4483F;
  --red-bg: #F7E9E7;
  --green: #3F7D5C;
  --green-bg: #E7F0EA;
  --blue: #3E6FA8;
  --blue-bg: #dae0ec;
  --amber: #C99A3A;
  --amber-bg: #FBF2E1;
  --purple: #7B5EA7;
  --purple-bg: #EDE7F6;
  --white: #FFFFFF;
  --shadow: 0 2px 10px rgba(27, 42, 74, 0.06), 0 1px 2px rgba(27, 42, 74, 0.08);
  --shadow-lg: 0 12px 32px rgba(27, 42, 74, 0.14), 0 2px 8px rgba(27, 42, 74, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Nunito Sans', sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: 'IBM Plex Mono', monospace;
}

.serif {
  font-family: 'Oswald', sans-serif;
  letter-spacing: .4px;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: 14px;
}

input::placeholder,
textarea::placeholder {
  color: var(--placeholder);
  opacity: 1;
}

::selection {
  background: var(--gold-light);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 6px;
}

#app {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* ============ DASHBOARD SHELL ============ */
.dashboard-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  background: var(--paper);
}

.dashboard-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px 18px;
  background: var(--white);
  border-right: 1px solid var(--line);
  z-index: 20;
}

.dashboard-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
}

.dashboard-logo {
  width: 34px;
  height: 34px;
  display: block;
  flex: 0 0 auto;
}

.dashboard-brand-text {
  color: var(--ink);
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
  text-transform: none;
}

.dashboard-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dashboard-nav-item {
  width: 100%;
  min-height: 40px;
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  transition: background .15s, color .15s;
}

.dashboard-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dashboard-nav-icon {
  width: 20px;
  height: 20px;
}

.dashboard-nav-item:hover {
  background: var(--paper-alt);
  color: var(--ink);
}

.dashboard-nav-item.active {
  background: var(--ink);
  color: var(--white);
}

.dashboard-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.dashboard-header {
  position: sticky;
  top: 0;
  z-index: 11;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 32px;
  background: rgba(247, 248, 251, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.dashboard-title {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 28px;
  font-weight: 700;
}

.dashboard-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dashboard-panel>.topbar {
  display: none;
}

.dashboard-empty-wrap {
  min-height: calc(100vh - 92px);
}

.dashboard-empty-state {
  min-height: 320px;
}

/* ============ AUTH SCREEN ============ */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background:
    radial-gradient(circle at 15% 20%, rgba(176, 141, 87, 0.08), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(27, 42, 74, 0.05), transparent 50%),
    var(--paper);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 40px 36px 32px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.stamp-mark {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.stamp-logo {
  width: 74px;
  height: 74px;
  display: block;
}

.auth-title {
  font-size: 30px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--ink);
}

.auth-sub {
  color: var(--slate);
  font-size: 13px;
  margin: 0 0 24px;
}

.auth-error {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(180, 72, 63, 0.25);
  font-size: 12.5px;
  padding: 9px 12px;
  border-radius: 3px;
  margin-bottom: 14px;
  text-align: left;
}

.auth-form {
  display: flex;
  flex-direction: column;
  text-align: left;
  gap: 2px;
}

.auth-note {
  margin-top: 18px;
  font-size: 11px;
  color: var(--slate-light);
  line-height: 1.5;
}

.demo-hint {
  background: var(--amber-bg);
  color: var(--gold-dark);
  border: 1px solid rgba(176, 141, 87, 0.3);
  font-size: 12px;
  padding: 9px 12px;
  border-radius: 3px;
  margin-bottom: 14px;
  text-align: center;
  line-height: 1.6;
}

/* ============ SHARED FIELD STYLES ============ */
.field-label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin: 12px 0 5px;
}

.field-input,
.field-select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--white);
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.field-input:focus,
.field-select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(87, 114, 176, 0.15);
}

.field-input.invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(180, 72, 63, 0.12);
}

.field-error {
  min-height: 16px;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--red);
}

.field-input:disabled {
  background: var(--paper-alt);
  color: var(--slate);
}

textarea.field-input {
  resize: vertical;
}

.rich-text-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.rich-text-help {
  font-size: 11.5px;
  color: var(--slate);
}

.service-conditions-check {
  margin-top: 12px;
}

.section-disabled {
  opacity: .5;
  pointer-events: none;
}

/* ============ BUTTONS ============ */
.btn {
  border: none;
  border-radius: 3px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .2px;
  transition: transform .1s, filter .15s, background .15s;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--ink);
  color: var(--white);
}

.btn-primary:hover {
  filter: brightness(1.15);
}

.data-form-actions .btn:disabled,
.data-form-actions .btn:disabled:hover {
  opacity: .45;
  cursor: not-allowed;
  filter: none;
  transform: none;
}

.btn-secondary {
  background: var(--gold);
  color: var(--white);
}

.btn-secondary:hover {
  filter: brightness(1.08);
}

.btn-danger {
  background: var(--gold);
  color: var(--white);
  border-color: var(--gold);
}

.btn-danger:hover {
  filter: brightness(.95);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  background: var(--paper-alt);
}

.btn-block {
  width: 100%;
  margin-top: 18px;
  padding: 11px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* ============ TOPBAR ============ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}

.brand-nav-button {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.brand-nav-button:hover {
  opacity: .82;
}

.brand-nav-button:focus-visible {
  outline: 2px solid #3f55b2;
  outline-offset: 4px;
  border-radius: 4px;
}

.brand-logo {
  width: 28px;
  height: 28px;
  display: block;
  flex: 0 0 auto;
}

.ludics-logo {
  color: #ff0000;
  background: currentColor;
  -webkit-mask-image: url('assets/img/logoLudics.svg');
  mask-image: url('assets/img/logoLudics.svg');
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.secondary-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 32px;
  background: #e9edf5;
  border-bottom: 1px solid #c8ceda;
}

.form-secondary-nav {
  position: sticky;
  top: 61px;
  z-index: 9;
}

.secondary-nav-left,
.secondary-nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.secondary-folio {
  min-width: 505px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 14px;
  border: 1px solid #c8ceda;
  border-radius: 3px;
  background: var(--white);
  color: #202d4a;
  font-size: 12px;
  font-weight: 700;
}

.secondary-folio-dot {
  width: 12px;
  height: 12px;
  display: none;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #ff0000;
}

.secondary-folio-dot.visible {
  display: block;
}

.secondary-status-control {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #c8ceda;
  border-radius: 3px;
  background: var(--white);
  overflow: hidden;
}

.secondary-status-control span {
  height: 100%;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-right: 1px solid #c8ceda;
  color: #4f5b6f;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.secondary-status-control .field-select {
  min-height: 30px;
  width: 132px;
  border: 0;
  border-radius: 0;
  background-color: var(--white);
}

.topbar-icon-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: transparent;
  color: var(--ink);
  transition: transform .1s, background .15s, border-color .15s;
}

.topbar-icon-btn:hover {
  background: var(--paper-alt);
}

.topbar-icon-btn:active {
  transform: translateY(1px);
}

.topbar-icon-btn .svg-mask {
  width: 20px;
  height: 20px;
}

.user-chip {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--slate);
  background: var(--paper-alt);
  padding: 6px 12px;
  border-radius: 20px;
}

/* ============ MAIN / DASHBOARD ============ */
.main-wrap {
  /* Nunca más ancho que el panel: si no, en pantallas chicas la tabla empuja la página fuera de la ventana. */
  max-width: min(1320px, 100%);
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  align-items: center;
}

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

.toolbar-search input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--white);
  outline: none;
}

.toolbar-search input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(87, 114, 176, 0.15);
}

.toolbar select,
.toolbar input[type=date] {
  width: auto;
}

.toolbar-date-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--slate);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .35px;
}

.toolbar-date-filter input {
  min-width: 142px;
}

.toolbar-toggle-filter {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--white);
  color: var(--slate);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .35px;
}

.toolbar-toggle-filter input {
  accent-color: var(--red);
}

.toolbar-toggle-filter.active {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-bg);
}

.search-field {
  position: relative;
}

.toolbar-search.search-field input {
  padding-left: 40px;
  padding-right: 42px;
}

.search-field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  color: var(--slate);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-field-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--slate);
  transform: translateY(-50%);
  transition: background .15s, color .15s;
}

.search-field-clear:hover {
  background: var(--paper-alt);
  color: var(--ink);
}

.search-field-clear .svg-mask {
  width: 20px;
  height: 20px;
}

.toolbar-filter-btn {
  position: relative;
  width: 42px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--white);
  color: var(--ink);
  transition: transform .1s, background .15s, border-color .15s;
}

.toolbar-filter-btn:hover {
  background: var(--paper-alt);
}

.toolbar-filter-btn:active {
  transform: translateY(1px);
}

.toolbar-filter-btn.open {
  border-color: var(--ink);
  background: var(--paper-alt);
}

.toolbar-filter-btn .svg-mask {
  width: 22px;
  height: 22px;
}

.toolbar-filter-btn.has-filters {
  border-color: var(--ink);
}

.toolbar-filter-count {
  position: absolute;
  top: -9px;
  right: -9px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: var(--gold);
  color: var(--white);
  box-shadow: 0 0 0 2px var(--white);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

/* El panel se despliega hacia abajo: la fila de la grilla crece de 0 a su alto real. */
.filters-panel-reveal {
  display: grid;
  grid-template-rows: 1fr;
  margin: -4px 0 18px;
}

.filters-panel-reveal.is-entering {
  animation: filters-panel-open .24s cubic-bezier(.2, .7, .3, 1);
}

.filters-panel-reveal.is-leaving {
  animation: filters-panel-close .18s ease-in forwards;
  pointer-events: none;
}

.filters-panel {
  min-height: 0;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.filters-panel-reveal.is-entering .filters-panel-inner {
  animation: filters-panel-content-in .24s ease-out;
}

.filters-panel-reveal.is-leaving .filters-panel-inner {
  animation: filters-panel-content-out .18s ease-in forwards;
}

.filters-panel-inner {
  padding: 18px 22px 16px;
}

@keyframes filters-panel-open {
  from {
    grid-template-rows: 0fr;
    margin-bottom: 2px;
    opacity: 0;
  }

  to {
    grid-template-rows: 1fr;
    margin-bottom: 18px;
    opacity: 1;
  }
}

@keyframes filters-panel-close {
  from {
    grid-template-rows: 1fr;
    margin-bottom: 18px;
    opacity: 1;
  }

  to {
    grid-template-rows: 0fr;
    margin-bottom: 2px;
    opacity: 0;
  }
}

@keyframes filters-panel-content-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes filters-panel-content-out {
  from {
    opacity: 1;
    transform: none;
  }

  to {
    opacity: 0;
    transform: translateY(-4px);
  }
}

@media (prefers-reduced-motion: reduce) {

  .filters-panel-reveal.is-entering,
  .filters-panel-reveal.is-leaving,
  .filters-panel-reveal .filters-panel-inner {
    animation: none !important;
  }
}

.filters-panel-title {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.filters-panel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.filters-panel-grid.filters-panel-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.filters-panel-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 2px 22px 4px;
}

.filters-panel-group:first-child {
  padding-left: 6px;
}

.filters-panel-group+.filters-panel-group {
  border-left: 1px solid var(--line);
}

.filters-panel-heading {
  margin: 0;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.filter-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  transition: background .15s, border-color .15s, color .15s;
}

.filter-chip:hover {
  background: var(--paper-alt);
}

.filter-chip.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.filter-chip .svg-mask {
  width: 15px;
  height: 15px;
}

.filters-panel-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--slate);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.filters-panel-selects {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filters-panel-field .field-select {
  width: auto;
  min-width: 150px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  font-weight: 400;
}

.filters-panel-field .filters-panel-heading {
  margin-bottom: 7px;
}

.filters-panel-date-range {
  margin-top: 10px;
}

.filters-panel-date {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filters-panel-date .field-select {
  min-width: 140px;
}

.filters-panel-field+.filters-panel-check {
  margin-top: 6px;
}

.filters-panel-check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.filters-panel-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--ink);
}

.filters-panel-help {
  max-width: 280px;
  margin: -4px 0 0;
  color: var(--slate);
  font-size: 12px;
  line-height: 1.45;
}

.filters-panel-empty {
  color: var(--slate);
  font-size: 12.5px;
}

.filters-panel-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

@media (max-width: 1100px) {
  .filters-panel-grid.filters-panel-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters-panel-grid-4 .filters-panel-group:nth-child(3) {
    border-left: 0;
    padding-left: 6px;
  }

  .filters-panel-grid-4 .filters-panel-group:nth-child(n+3) {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
  }
}

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

  .filters-panel-group,
  .filters-panel-group:first-child {
    padding: 14px 0;
  }

  .filters-panel-group+.filters-panel-group {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

.table-wrap {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow-x: auto;
}

.quotes-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.quotes-table thead th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--slate);
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-alt);
}

.quotes-table tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  vertical-align: middle;
}

.quotes-table tbody tr:last-child td {
  border-bottom: none;
}

.quotes-table tbody tr:hover {
  background: rgba(87, 114, 176, 0.08);
}

.folio-cell {
  font-weight: 600;
  color: var(--gold-dark);
}

.cell-primary {
  font-weight: 600;
  color: var(--ink);
}

.cell-sub {
  font-size: 12px;
  color: var(--slate);
  margin-top: 2px;
}

.empty-row {
  text-align: center;
  padding: 48px 20px !important;
  color: var(--slate);
  font-size: 13.5px;
}

.actions-cell {
  white-space: nowrap;
  text-align: right;
}

.quote-actions-menu-wrap {
  position: relative;
  display: inline-block;
}

.quote-more-button {
  margin-left: 0;
}

/* Posición fija calculada en positionQuoteFabMenu() para que no se salga de la ventana. */
.quote-fab-menu.project-fab-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: auto;
  min-width: 188px;
  max-width: calc(100vw - 16px);
  padding: 4px;
  z-index: 1000;
}

.quote-fab-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
}

.quote-fab-menu-item .svg-mask {
  width: 18px;
  height: 18px;
  color: var(--slate);
}

.quote-fab-menu-item:hover .svg-mask {
  color: var(--ink);
}

.quote-fab-menu-item-danger {
  color: var(--red);
}

.quote-fab-menu-item-danger .svg-mask {
  color: var(--red);
}

.quote-fab-menu-item-danger:hover {
  color: var(--red);
  background: var(--red-bg);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 3px;
  width: 28px;
  height: 28px;
  color: var(--slate);
  font-size: 13px;
  margin-left: 4px;
  line-height: 1;
}

.icon-btn .svg-mask {
  width: 16px;
  height: 16px;
}

.icon-btn:hover {
  background: var(--paper-alt);
  color: var(--ink);
  border-color: var(--gold);
}

.icon-btn-danger:hover {
  color: var(--red);
  border-color: var(--red);
}

/* ---- badges (stamp motif) ---- */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 4px 11px;
  border-radius: 20px;
  border: 1.5px solid transparent;
}

.badge-amber {
  background: var(--amber-bg);
  color: var(--amber);
  border-color: rgba(87, 114, 176, 0.15);
}

.badge-blue {
  background: var(--blue-bg);
  color: var(--blue);
  border-color: rgba(62, 111, 168, 0.4);
}

.badge-green {
  background: var(--green-bg);
  color: var(--green);
  border-color: rgba(63, 125, 92, 0.4);
}

.badge-red {
  background: var(--red-bg);
  color: var(--red);
  border-color: rgba(180, 72, 63, 0.4);
}

.badge-purple {
  background: var(--purple-bg);
  color: var(--purple);
  border-color: rgba(123, 94, 167, 0.4);
}

/* ============ FORM VIEW ============ */
.form-wrap {
  max-width: min(1680px, calc(100vw - 32px));
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 14px;
}

.folio-tag {
  font-size: 13px;
  color: var(--gold-dark);
  font-weight: 600;
  letter-spacing: .5px;
}

.form-title {
  font-size: 26px;
  font-weight: 600;
  margin: 2px 0 0;
  color: var(--ink);
}

.form-header-right {
  min-width: 180px;
}

.estado-select {
  font-weight: 600;
}

.form-section {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 20px 24px 24px;
  margin-bottom: 18px;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-hint {
  font-size: 12.5px;
  color: var(--slate);
  margin: 0 0 14px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}

.grid-2>div {
  min-width: 0;
}

.price-tabs {
  display: flex;
  width: 100%;
  gap: 4px;
  padding: 4px;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper-alt);
}

.price-tab-title {
  flex: 1;
  margin: 0;
}

.price-tab {
  width: 100%;
  border: none;
  border-radius: 3px;
  background: transparent;
  color: var(--slate);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 10px 12px;
}

.price-tab.active {
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.price-mode-hidden {
  display: none !important;
}

.price-options-row {
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 18px;
  margin-top: 12px;
}

.price-options-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.price-options-checks {
  display: flex;
  align-items: center;
  gap: 28px;
}

.commission-row-inline {
  width: 140px;
}

.commission-row-inline .field-label {
  margin-top: 0;
}

.commission-row.section-disabled .field-input {
  background: var(--white);
  color: var(--ink);
}

.global-totals-box {
  justify-content: flex-end;
}

.price-sections {
  margin-top: 12px;
}

.price-section-card {
  position: relative;
  overflow-x: auto;
  border: 1px solid #c8ceda;
  border-radius: 4px;
  background: #f4f6fa;
}

.price-grid {
  min-width: 1380px;
  display: grid;
  grid-template-columns: 132px minmax(280px, 1.8fr) 36px 70px 78px 58px 104px 120px 70px 96px 108px 118px 104px;
  color: #0d0f14;
}

.price-grid-band {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 12px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid #c8ceda;
}

.price-grid-band-client {
  grid-column: 1 / 9;
  background: #000;
}

.price-grid-band-budget {
  grid-column: 9 / 14;
  background: #ff0000;
  border-left: 4px solid #c8ceda;
}

.price-grid-head,
.price-grid-cell {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 8px 10px;
  border-right: 1px solid #c8ceda;
  border-bottom: 1px solid #c8ceda;
}

.price-grid-head {
  justify-content: center;
  background: #000;
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  white-space: nowrap;
}

.price-grid-actions-head {
  position: relative;
  justify-content: center;
  gap: 8px;
}

.price-grid-name-head {
  justify-content: flex-start;
  padding-left: 14px;
}

.price-grid-cost-head {
  white-space: normal;
  line-height: 1.12;
  text-align: center;
}

.price-grid-budget-start {
  border-left: 4px solid #c8ceda;
}

.price-grid-head.price-grid-budget-start {
  background: #ff0000;
}

.price-grid-head.price-grid-budget-start,
.price-grid-head.price-grid-budget-start~.price-grid-head {
  background: #ff0000;
}

.section-cell {
  background: #e7ebf2;
  min-height: 36px;
  padding-top: 4px;
  padding-bottom: 4px;
}

.item-cell {
  background: #fff;
  min-height: 32px;
  padding-top: 2px;
  padding-bottom: 2px;
}

.price-total-cell {
  min-height: 34px;
  padding-top: 5px;
  padding-bottom: 5px;
  background: #f2f4f8;
  color: #202b47;
  font-size: 12px;
  font-weight: 800;
}

.price-total-label {
  grid-column: span 7;
  justify-content: flex-end;
  text-transform: uppercase;
  letter-spacing: .35px;
}

.price-total-budget-label {
  grid-column: span 10;
}

/* Pie de la tabla de precios: subtotal, comisión, neto, IVA y total final */
.price-grid-totals {
  display: contents;
}

.price-total-budget-label-short {
  grid-column: span 2;
}

.price-total-budget-filler {
  grid-column: span 5;
  background: #f4f6fa;
}

.price-total-muted {
  color: #8a93a8;
  font-weight: 600;
}

.price-total-cell.price-total-final {
  background: #000;
  color: #fff;
  font-size: 13.5px;
  min-height: 40px;
}

.price-total-cell.price-total-budget-filler.price-total-final {
  background: #f4f6fa;
}

.section-action-cell,
.item-action-cell {
  justify-content: center;
  gap: 2px;
}

.section-action-cell .table-icon-button,
.item-action-cell .table-icon-button {
  width: 22px;
  height: 22px;
}

.item-action-cell {
  color: #c4cad5;
}

.section-name-cell,
.item-name-cell {
  padding-left: 14px;
}

.money-cell {
  justify-content: center;
  font-size: 13.5px;
  font-weight: 600;
}

.info-cell {
  justify-content: center;
  color: #667383;
  padding-left: 6px;
  padding-right: 6px;
}

.info-cell-active {
  color: #3f55b2;
}

.info-cell .svg-mask {
  width: 20px;
  height: 20px;
}

.description-indicator {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.description-indicator:focus-visible {
  outline: 2px solid #3f55b2;
  outline-offset: 2px;
  border-radius: 4px;
}

.description-indicator.has-private-description::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #ff0000;
  box-shadow: 0 0 0 2px #fff;
}

.price-grid-input {
  width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  color: #0d0f14;
  outline: none;
  font-size: 13.5px;
  font-family: inherit;
}

.price-grid-input::placeholder {
  color: var(--placeholder);
}

.price-grid-input:focus {
  box-shadow: inset 0 -2px 0 #3f55b2;
}

.center-input {
  text-align: center;
}

.money-input,
.percent-input {
  text-align: center;
}

.percent-cell {
  gap: 4px;
  justify-content: center;
}

.percent-cell .percent-input {
  width: auto;
  min-width: 44px;
  max-width: 64px;
}

.percent-suffix {
  color: var(--ink);
  font-size: 13.5px;
}

.table-icon-button {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0;
  border: none;
  background: transparent;
  color: #667383;
  cursor: pointer;
}

.table-icon-button:hover {
  color: #3f55b2;
}

.table-icon-button:disabled {
  opacity: .32;
  cursor: default;
}

.table-icon-button:disabled:hover {
  color: #667383;
}

.table-icon-button-light {
  color: #fff;
}

.price-grid-more-button:hover {
  color: #d6dbe5;
  background: transparent;
}

.price-grid-disabled-add-button,
.price-grid-disabled-add-button:hover,
.price-grid-disabled-add-button:disabled:hover {
  color: #fff;
  opacity: .32;
  background: transparent;
  transform: none;
  cursor: default;
}

.drag-handle {
  cursor: grab;
}

.drag-handle:active {
  cursor: grabbing;
}

.price-row-dragging {
  opacity: .42;
  background-image: linear-gradient(0deg, rgba(63, 85, 178, .08), rgba(63, 85, 178, .08));
}

.price-drop-indicator {
  position: absolute;
  z-index: 8;
  display: none;
  height: 2px;
  background: #3f55b2;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(63, 85, 178, .16);
}

.price-drop-indicator.visible {
  display: block;
}

.price-drag-preview {
  position: fixed;
  top: -10000px;
  left: -10000px;
  z-index: -1;
  display: grid;
  overflow: hidden;
  border: 1px solid #3f55b2;
  border-radius: 4px;
  box-shadow: 0 12px 28px rgba(22, 30, 48, .18);
  opacity: .96;
  pointer-events: none;
}

.price-drag-preview .price-grid-cell {
  border-bottom: 0;
}

.table-icon-button .svg-mask {
  width: 20px;
  height: 20px;
}

.svg-mask {
  width: 24px;
  height: 24px;
  display: block;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.icon-add-circle {
  -webkit-mask-image: url('assets/icons/add-circle.svg');
  mask-image: url('assets/icons/add-circle.svg');
}

.icon-chat-add {
  -webkit-mask-image: url('assets/icons/chat-add.svg');
  mask-image: url('assets/icons/chat-add.svg');
}

.icon-more-vert {
  -webkit-mask-image: url('assets/icons/more-vert.svg');
  mask-image: url('assets/icons/more-vert.svg');
}

.icon-more-vert-circle {
  -webkit-mask-image: url('assets/icons/more-vert-circle.svg');
  mask-image: url('assets/icons/more-vert-circle.svg');
}

.icon-page-edit {
  -webkit-mask-image: url('assets/icons/page-edit.svg');
  mask-image: url('assets/icons/page-edit.svg');
}

.icon-trash {
  -webkit-mask-image: url('assets/icons/trash.svg');
  mask-image: url('assets/icons/trash.svg');
}

.icon-copy {
  -webkit-mask-image: url('assets/icons/copy.svg');
  mask-image: url('assets/icons/copy.svg');
}

.icon-download {
  -webkit-mask-image: url('assets/icons/download.svg');
  mask-image: url('assets/icons/download.svg');
}

.icon-edit-pencil {
  -webkit-mask-image: url('assets/icons/edit-pencil.svg');
  mask-image: url('assets/icons/edit-pencil.svg');
}

.icon-drag {
  -webkit-mask-image: url('assets/icons/drag.svg');
  mask-image: url('assets/icons/drag.svg');
}

.icon-plus {
  -webkit-mask-image: url('assets/icons/plus.svg');
  mask-image: url('assets/icons/plus.svg');
}

.icon-nav-arrow-up {
  -webkit-mask-image: url('assets/icons/nav-arrow-up.svg');
  mask-image: url('assets/icons/nav-arrow-up.svg');
}

.icon-nav-arrow-down {
  -webkit-mask-image: url('assets/icons/nav-arrow-down.svg');
  mask-image: url('assets/icons/nav-arrow-down.svg');
}

.icon-empty-page {
  -webkit-mask-image: url('assets/icons/empty-page.svg');
  mask-image: url('assets/icons/empty-page.svg');
}

.icon-settings {
  -webkit-mask-image: url('assets/icons/settings.svg');
  mask-image: url('assets/icons/settings.svg');
}

.icon-db {
  -webkit-mask-image: url('assets/icons/db.svg');
  mask-image: url('assets/icons/db.svg');
}

.icon-user-cart {
  -webkit-mask-image: url('assets/icons/user-cart.svg');
  mask-image: url('assets/icons/user-cart.svg');
}

.icon-cart {
  -webkit-mask-image: url('assets/icons/cart.svg');
  mask-image: url('assets/icons/cart.svg');
}

.icon-home-sale {
  -webkit-mask-image: url('assets/icons/home-sale.svg');
  mask-image: url('assets/icons/home-sale.svg');
}

.icon-filter-list {
  -webkit-mask-image: url('assets/icons/filter-list.svg');
  mask-image: url('assets/icons/filter-list.svg');
}

.icon-search {
  -webkit-mask-image: url('assets/icons/search.svg');
  mask-image: url('assets/icons/search.svg');
}

.icon-cancel {
  -webkit-mask-image: url('assets/icons/cancel.svg');
  mask-image: url('assets/icons/cancel.svg');
}

.icon-check {
  -webkit-mask-image: url('assets/icons/check.svg');
  mask-image: url('assets/icons/check.svg');
}

.icon-page {
  -webkit-mask-image: url('assets/icons/page.svg');
  mask-image: url('assets/icons/page.svg');
}

.icon-eye-alt {
  -webkit-mask-image: url('assets/icons/eye-alt.svg');
  mask-image: url('assets/icons/eye-alt.svg');
}

.icon-eye-close {
  -webkit-mask-image: url('assets/icons/eye-close.svg');
  mask-image: url('assets/icons/eye-close.svg');
}

.icon-info-empty {
  -webkit-mask-image: url('assets/icons/info-empty.svg');
  mask-image: url('assets/icons/info-empty.svg');
}

.icon-warning-triangle {
  -webkit-mask-image: url('assets/icons/warning-triangle.svg');
  mask-image: url('assets/icons/warning-triangle.svg');
}

.evento-layout {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(470px, .94fr);
  gap: 0 32px;
}

.evento-layout .field-label {
  margin-top: 12px;
}

.evento-details-stack {
  min-width: 0;
}

.evento-schedule {
  min-width: 0;
}

.evento-schedule-row {
  display: grid;
  grid-template-columns: minmax(168px, 1fr) minmax(252px, 1.28fr) max-content;
  align-items: end;
  gap: 10px;
}

.evento-fecha-field,
.evento-horario-block {
  min-width: 0;
}

.evento-fechas-action {
  padding-bottom: 1px;
}

.evento-add-button {
  min-height: 37px;
  padding-inline: 14px;
  white-space: nowrap;
}

.evento-horario-row {
  display: grid;
  grid-template-columns: minmax(106px, 1fr) minmax(106px, 1fr);
  gap: 10px;
}

.evento-horario-field {
  display: grid;
  grid-template-columns: auto minmax(72px, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.evento-horario-label {
  font-size: 12.5px;
  color: var(--slate);
  white-space: nowrap;
}

.evento-horario-field .field-input {
  min-width: 0;
}

.evento-fechas-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.evento-fechas-empty {
  font-size: 12.5px;
  color: var(--slate-light);
}

.evento-fecha-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px 5px 12px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--white);
  font-size: 12.5px;
  color: var(--ink);
}

.evento-fecha-remove {
  border: none;
  background: transparent;
  color: var(--slate);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 50%;
}

.evento-fecha-remove:hover {
  background: var(--paper-alt);
  color: var(--ink);
}

.items-table {
  margin-top: 12px;
}

.items-head {
  display: grid;
  grid-template-columns: 2.2fr .7fr .7fr 1fr 1fr 100px;
  gap: 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--slate);
  padding: 0 4px 6px;
}

.item-row {
  display: grid;
  grid-template-columns: 2.2fr .7fr .7fr 1fr 1fr 100px;
  gap: 10px;
  align-items: center;
}

.item-block {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.item-block:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.item-subtotal {
  font-size: 13.5px;
  color: var(--ink);
  text-align: right;
  padding-right: 6px;
}

.item-subtotal-input {
  text-align: right;
}

.internal-cost-panel {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 10px;
  margin-top: 8px;
  padding: 10px;
  border-left: 3px solid var(--line);
  background: var(--paper-alt);
}

.internal-cost-label {
  align-self: center;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--slate);
  letter-spacing: .4px;
}

.internal-cost-grid {
  display: grid;
  grid-template-columns: .75fr 1fr 1fr 1fr .8fr;
  gap: 10px;
  align-items: end;
}

.internal-cost-grid .field-label {
  margin-top: 0;
  margin-bottom: 5px;
}

.internal-value {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  font-size: 13px;
}

.totals-box {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 18px;
  flex-wrap: wrap;
  gap: 14px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--slate);
}

.send-without-total-row {
  margin-left: auto;
  margin-top: 2px;
  color: var(--red);
  font-weight: 700;
}

.send-without-total-row input {
  accent-color: var(--red);
}

.totals-lines {
  min-width: 220px;
}

.totals-line {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--slate);
  padding: 4px 0;
}

.totals-final {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 8px;
}

.floating-totals-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 35;
  width: min(480px, calc(100vw - 24px));
  overflow: hidden;
  border: 1px solid #c8ceda;
  border-radius: 6px;
  background: var(--white);
  box-shadow: 0 12px 30px rgba(18, 27, 43, .18);
  user-select: none;
}

.floating-totals-panel.is-dragging {
  cursor: grabbing;
  box-shadow: 0 16px 36px rgba(18, 27, 43, .24);
}

.floating-totals-handle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 38px;
  padding: 8px 14px;
  background: #202b47;
  color: #fff;
  cursor: grab;
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.floating-totals-handle strong {
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

.floating-totals-panel.is-dragging .floating-totals-handle {
  cursor: grabbing;
}

.floating-totals-lines {
  padding: 6px 14px 7px;
}

.floating-totals-line {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) 128px 62px;
  align-items: center;
  column-gap: 14px;
  min-height: 26px;
  color: #637083;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
}

.floating-totals-line strong {
  color: #637083;
  font-size: 14px;
  font-weight: 600;
  text-align: right;
}

.floating-totals-line span {
  min-width: 0;
}

/* Barra lateral compacta: solo íconos; se extiende con el texto al pasar el mouse. */
@media (min-width: 761px) {
  .dashboard-shell {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .dashboard-sidebar {
    width: 72px;
    padding: 24px 14px;
    overflow: hidden;
    transition: width .2s ease, box-shadow .2s ease;
  }

  .dashboard-sidebar:hover,
  .dashboard-sidebar:focus-within,
  .dashboard-sidebar.is-open {
    width: 248px;
    box-shadow: 8px 0 24px rgba(19, 25, 39, 0.08);
  }

  .dashboard-sidebar.no-transition,
  .dashboard-sidebar.no-transition * {
    transition: none !important;
  }

  .dashboard-brand {
    padding-left: 5px;
  }

  .dashboard-brand-text,
  .dashboard-nav-label {
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    /* Al cerrar: el texto se va de inmediato, antes de que la barra se angoste. */
    transition: opacity .08s ease, visibility 0s linear .08s;
  }

  .dashboard-sidebar:hover .dashboard-brand-text,
  .dashboard-sidebar:hover .dashboard-nav-label,
  .dashboard-sidebar:focus-within .dashboard-brand-text,
  .dashboard-sidebar:focus-within .dashboard-nav-label,
  .dashboard-sidebar.is-open .dashboard-brand-text,
  .dashboard-sidebar.is-open .dashboard-nav-label {
    opacity: 1;
    visibility: visible;
    /* Al abrir: el texto aparece recién cuando la barra terminó de extenderse. */
    transition: opacity .15s ease .2s, visibility 0s linear .2s;
  }
}

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

  .dashboard-sidebar {
    position: sticky;
    top: 0;
    height: auto;
    padding: 14px 16px 12px;
    gap: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .dashboard-brand {
    min-height: 34px;
  }

  .dashboard-brand-text {
    font-size: 18px;
  }

  .dashboard-nav {
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .dashboard-nav-item {
    width: auto;
    min-height: 36px;
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 13px;
  }

  .dashboard-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .dashboard-header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .dashboard-title {
    font-size: 24px;
  }

  .floating-totals-panel {
    width: calc(100vw - 24px);
  }

  .floating-totals-handle {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 15px;
  }

  .floating-totals-handle strong {
    font-size: 15px;
  }

  .floating-totals-lines {
    padding: 6px 12px 7px;
  }

  .floating-totals-line {
    grid-template-columns: minmax(0, 1fr) 118px 62px;
    column-gap: 10px;
    min-height: 26px;
    font-size: 12.5px;
  }

  .floating-totals-line strong {
    font-size: 12.5px;
  }
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12.5px;
  color: var(--slate);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-date {
  color: var(--ink);
}

.history-user {
  color: var(--slate-light);
}

.history-detail {
  margin: 6px 0 0;
  padding-left: 16px;
  color: var(--slate);
  font-size: 12px;
  line-height: 1.45;
}

.history-detail li {
  margin: 2px 0;
}

/* Seguimiento: línea de tiempo de creación y cambios de estado. */
.quote-tracking {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}

.status-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.status-timeline-item {
  position: relative;
  display: flex;
  gap: 12px;
  padding-bottom: 16px;
}

.status-timeline-item:last-child {
  padding-bottom: 0;
}

/* Línea que une los puntos. */
.status-timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 16px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

.status-timeline-dot {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border: 2px solid var(--slate-light);
  border-radius: 50%;
  background: var(--white);
}

.status-timeline-item.is-current .status-timeline-dot {
  border-color: var(--ink);
  background: var(--ink);
}

.status-timeline-content {
  min-width: 0;
}

.status-timeline-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.status-timeline-arrow {
  color: var(--slate);
}

.status-timeline-meta {
  margin-top: 4px;
  color: var(--slate);
  font-size: 12px;
}

.status-timeline-note {
  margin-top: 3px;
  color: var(--slate);
  font-size: 12px;
}

/* Historial de edición: desplegable cerrado por defecto. */
.edit-history-dropdown {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
}

.edit-history-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.edit-history-summary::-webkit-details-marker {
  display: none;
}

.edit-history-summary:hover {
  background: var(--paper);
}

.edit-history-chevron {
  width: 16px;
  height: 16px;
  color: var(--slate);
  transform: rotate(-90deg);
  transition: transform .15s;
}

.edit-history-dropdown[open] .edit-history-chevron {
  transform: rotate(0deg);
}

.edit-history-count {
  margin-left: auto;
  min-width: 24px;
  padding: 1px 8px;
  border-radius: 20px;
  background: var(--paper-alt);
  color: var(--slate);
  font-size: 11px;
  text-align: center;
}

.edit-history-list,
.edit-history-empty,
.tracking-history .edit-history-list {
  margin: 0;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 8px 0 40px;
}

.autosave-status {
  margin-right: auto;
  color: var(--slate);
  font-size: 12px;
  min-height: 18px;
}

.autosave-status.ok {
  color: var(--green);
}

.autosave-status.error {
  color: var(--red);
}

.autosave-snackbar {
  position: fixed;
  top: 88px;
  right: 24px;
  z-index: 9000;
  display: grid;
  grid-template-columns: 5px 34px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 12px;
  width: min(430px, calc(100vw - 32px));
  min-height: 78px;
  padding: 16px 14px 16px 0;
  overflow: hidden;
  background: var(--white);
  border: 1px solid rgba(200, 204, 216, 0.9);
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(27, 42, 74, 0.18), 0 2px 6px rgba(27, 42, 74, 0.12);
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: auto;
  transition: opacity .18s ease, transform .18s ease;
}

.autosave-snackbar.show {
  opacity: 1;
  transform: translateY(0);
}

.autosave-snackbar-accent {
  align-self: stretch;
  background: #2fbf71;
}

.autosave-snackbar-icon {
  width: 28px;
  height: 28px;
  justify-self: center;
  color: #2fbf71;
}

.autosave-snackbar-copy {
  min-width: 0;
}

.autosave-snackbar-title {
  color: #2fbf71;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 4px;
}

.autosave-snackbar-message {
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.35;
}

.autosave-snackbar-close {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  align-self: start;
  padding: 0;
  border: 0;
  background: transparent;
  color: #121826;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
}

.autosave-snackbar-close:hover {
  color: var(--ink-soft);
}

@media (max-width: 640px) {
  .autosave-snackbar {
    top: 78px;
    right: 12px;
    grid-template-columns: 5px 30px minmax(0, 1fr) 28px;
    gap: 10px;
    width: calc(100vw - 24px);
    min-height: 74px;
    padding: 14px 12px 14px 0;
  }

  .autosave-snackbar-icon {
    width: 26px;
    height: 26px;
  }

  .autosave-snackbar-title {
    font-size: 16px;
    margin-bottom: 4px;
  }

  .autosave-snackbar-message {
    font-size: 13px;
  }

  .autosave-snackbar-close {
    width: 28px;
    height: 28px;
    font-size: 22px;
  }
}

/* ============ DATA VIEW ============ */
.data-wrap {
  max-width: 980px;
  width: 100%;
}

.data-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 16px;
}

.data-storage-note {
  max-width: 360px;
  padding: 9px 12px;
  border: 1px solid rgba(201, 154, 58, 0.35);
  border-radius: 4px;
  background: var(--amber-bg);
  color: var(--gold-dark);
  font-size: 12px;
  line-height: 1.4;
}

.data-tabs {
  width: 100%;
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.data-tab {
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  padding: 10px 16px;
  background: var(--paper-alt);
  color: var(--slate);
  font-size: 13px;
  font-weight: 700;
}

.data-tab.active {
  background: var(--white);
  color: var(--ink);
  position: relative;
  top: 1px;
}

.data-form-actions {
  padding-bottom: 0;
}

.data-client-form {
  display: grid;
  gap: 18px;
}

.data-image-url-field {
  grid-column: 1 / -1;
}

.data-image-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 5px;
}

.data-image-label-row .field-label {
  margin: 0;
}

.data-image-info-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
}

.data-image-info-button .svg-mask {
  width: 20px;
  height: 20px;
}

.data-image-info-button:hover,
.data-image-info-button:focus-visible {
  color: var(--ink);
}

.data-image-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 20;
  width: 260px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow);
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity .15s, transform .15s;
}

.data-image-tooltip strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12.5px;
}

.data-image-tooltip span {
  display: block;
}

.data-image-info-button:hover .data-image-tooltip,
.data-image-info-button:focus-visible .data-image-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.floating-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  max-width: 320px;
  padding: 7px 10px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s;
}

.floating-tooltip.visible {
  opacity: 1;
}

.has-tooltip {
  cursor: help;
}

.data-image-preview-wrap {
  width: 132px;
  height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
}

.data-image-preview {
  display: block;
  width: var(--image-size, 100%);
  height: var(--image-size, 100%);
  object-fit: contain;
}

.data-image-size-control {
  max-width: 340px;
}

.data-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.data-photo-upload {
  cursor: pointer;
}

.photo-crop-modal {
  max-width: 420px;
}

.photo-crop-hint {
  margin: 0 0 14px;
  color: var(--slate);
  font-size: 13px;
  line-height: 1.5;
}

/* Recuadro del editor: se ve la foto completa atenuada y el círculo marca lo que se guarda. */
.photo-crop-viewport {
  position: relative;
  width: min(280px, 100%);
  aspect-ratio: 1;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 4px;
  background: var(--paper);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.photo-crop-viewport.is-dragging {
  cursor: grabbing;
}

.photo-crop-viewport img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  transform-origin: 0 0;
  pointer-events: none;
}

.photo-crop-viewport::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 999px rgba(27, 42, 74, .45);
  pointer-events: none;
}

.photo-crop-zoom {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(280px, 100%);
  margin: 16px auto 0;
}

.photo-crop-zoom input {
  flex: 1;
}

.photo-crop-zoom .svg-mask {
  width: 16px;
  height: 16px;
  color: var(--slate);
}

.data-image-size-control input {
  width: 100%;
}

.data-company-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.data-company-thumb {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  flex: 0 0 auto;
}

.data-company-thumb img {
  display: block;
  width: var(--image-size, 100%);
  height: var(--image-size, 100%);
  object-fit: contain;
}

.data-company-thumb-empty {
  display: none;
}

.data-contact-block {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.data-contact-title-row {
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 4px;
}

.data-subtitle {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .35px;
}

.data-add-contact-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.data-add-contact-button .svg-mask {
  width: 14px;
  height: 14px;
}

.data-contact-list {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.data-contact-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 9px 12px;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
}

.data-contact-pill-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  flex: 1;
}

.data-contact-pill-main span {
  color: var(--slate);
  text-align: right;
}

.data-contact-pill-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.data-contact-delete-button {
  margin-left: 0;
}

.data-toolbar {
  margin-top: 6px;
}

.data-table {
  min-width: 920px;
}

.data-empty {
  background: var(--white);
}

/* ============ PROJECTS VIEW ============ */
.projects-wrap {
  max-width: 1480px;
  width: 100%;
}

.projects-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.projects-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.production-row-total {
  white-space: nowrap;
  font-weight: 600;
  color: var(--ink);
}

.projects-count {
  min-width: 52px;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  color: var(--gold-dark);
  font-size: 22px;
  font-weight: 700;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

/* Lista de Negocios: igual que Cotizaciones, el ancho se ajusta al contenido de las columnas
   en vez de estirarse a toda la pantalla. El detalle de un negocio sigue usando todo el ancho. */
.projects-wrap.projects-list-wrap {
  width: auto;
  max-width: 1320px;
}

.expense-reports-wrap {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Buscador, filtros y tabla van juntos, con la misma separación que en las otras secciones
   (sin el espacio extra del gap de .expense-reports-wrap). */
.expense-reports-list {
  min-width: 0;
}

.expense-reports-table {
  min-width: 980px;
}

.expense-reports-table td:nth-child(2),
.expense-reports-table td:nth-child(5),
.expense-reports-table td:nth-child(6) {
  white-space: nowrap;
}

.project-expense-reports-list {
  width: 100%;
}

.project-client-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.project-client-thumb {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
}

.project-client-thumb img {
  display: block;
  width: var(--image-size, 100%);
  height: var(--image-size, 100%);
  object-fit: contain;
}

.project-card {
  min-height: 254px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .12s, border-color .15s, box-shadow .15s;
}

.project-card:hover {
  transform: translateY(-1px);
  border-color: rgba(128, 0, 0, 0.35);
  box-shadow: var(--shadow-lg);
}

.project-card:focus {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.project-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.project-code {
  color: var(--gold-dark);
  font-size: 13px;
  font-weight: 700;
}

.project-title {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.25;
}

.project-client,
.project-location {
  color: var(--slate);
  font-size: 13px;
  line-height: 1.35;
}

.project-client {
  color: var(--ink-soft);
  font-weight: 700;
}

.project-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.project-meta span,
.project-meta strong {
  display: block;
}

.project-meta span {
  margin-bottom: 3px;
  color: var(--slate-light);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.project-meta strong {
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.25;
}

.project-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}

.project-detail-header {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.project-detail-sub {
  margin: 4px 0 0;
  color: var(--slate);
  font-size: 14px;
  font-weight: 700;
}

.project-tabs {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: end;
  margin: 0 0 16px;
  border-bottom: 1px solid #bfc6d2;
  background: var(--white);
}

.project-tab {
  position: relative;
  min-height: 44px;
  padding: 10px 14px 11px;
  border: 0;
  background: transparent;
  color: #8d97a4;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.project-tab.active {
  color: #000;
}

.project-tab.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: #ff0000;
}

.project-tab-panel {
  width: 100%;
  min-width: 0;
}

.project-tab-panel>.project-orders-list,
.project-tab-panel>.project-tab-empty {
  width: 100%;
}

/* Negocios → Resumen: el formulario de la cotización dentro de la ficha del negocio. */
.project-form-page {
  max-width: min(1680px, 100%);
}

.project-form-nav {
  top: var(--dashboard-header-height, 81px);
  margin: 0 0 18px;
  padding: 10px 14px;
  border: 1px solid #c8ceda;
  border-radius: 4px;
}

.project-form-nav .secondary-folio {
  min-width: 0;
  gap: 10px;
}

.project-form-wrap {
  max-width: none;
}

/* "Información general del negocio": desplegable cerrado por defecto. */
.project-info-dropdown {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
}

.project-info-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.project-info-summary::-webkit-details-marker {
  display: none;
}

.project-info-summary:hover {
  background: var(--paper);
}

.project-info-summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.project-info-chevron {
  width: 18px;
  height: 18px;
  color: var(--slate);
  transform: rotate(-90deg);
  transition: transform .15s;
}

.project-info-dropdown[open] .project-info-chevron {
  transform: rotate(0deg);
}

.project-info-dropdown[open] .project-info-summary {
  border-bottom: 1px solid var(--line);
}

.project-info-body {
  padding: 18px 18px 0;
  background: var(--paper);
}

.project-summary-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.project-summary-content .price-grid-readonly .price-grid-input:disabled,
.project-summary-content .price-grid-readonly select:disabled {
  color: #0d0f14;
  opacity: 1;
  -webkit-text-fill-color: #0d0f14;
}

.project-summary-content .price-grid-readonly .description-indicator:disabled {
  color: inherit;
  cursor: default;
  opacity: 1;
}

.project-summary-content .price-grid-readonly .price-grid-input:focus {
  box-shadow: none;
}

.project-fab-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 8px;
  z-index: 20;
  min-width: 184px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  box-shadow: var(--shadow-lg);
}

.project-fab-menu-item {
  width: 100%;
  min-height: 34px;
  padding: 8px 10px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  text-align: left;
}

.project-fab-menu-item:hover {
  background: var(--paper-alt);
}

.project-fab-menu-item:disabled,
.project-fab-menu-item:disabled:hover {
  cursor: default;
  opacity: .42;
  background: transparent;
}

.project-summary-content .price-grid-readonly .section-action-cell,
.project-summary-content .price-grid-readonly .item-action-cell {
  gap: 4px;
  padding-left: 6px;
  padding-right: 6px;
}

.project-summary-content .price-grid-readonly .section-action-cell .table-icon-button,
.project-summary-content .price-grid-readonly .item-action-cell .table-icon-button {
  width: 20px;
  height: 20px;
}

.project-item-check {
  width: 15px;
  height: 15px;
  margin: 0 3px 0 0;
  accent-color: var(--gold);
  cursor: pointer;
  flex: 0 0 auto;
}

.project-totals-box {
  margin-top: 0;
}

.project-tab-empty {
  box-sizing: border-box;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
}

.project-orders-empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 28px;
}

.project-orders-empty p {
  margin: 0;
  color: var(--slate);
  font-size: 13px;
}

.project-orders-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

/* ---- Producción ---- */
.production-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.production-status-row {
  display: flex;
  justify-content: flex-end;
  margin-top: -6px;
}

.production-status-row .autosave-status {
  margin-right: 0;
}

.production-overall {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
}

.production-overall-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--slate);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.production-overall-head strong {
  color: var(--ink);
  font-size: 20px;
}

.production-bar {
  display: block;
  width: 100%;
  height: 6px;
  border-radius: 6px;
  background: var(--paper-alt);
  overflow: hidden;
}

.production-bar-fill {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: var(--gold);
  transition: width .25s ease;
}

.production-bar-fill.complete {
  background: var(--green);
}

.production-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.production-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 14px 16px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}

.production-tab:hover {
  border-color: rgba(128, 0, 0, 0.35);
  box-shadow: var(--shadow);
}

.production-tab.active {
  border-color: var(--ink);
  box-shadow: var(--shadow);
}

.production-tab.active::after {
  content: '';
  position: absolute;
  left: -1px;
  right: -1px;
  bottom: -1px;
  height: 4px;
  border-radius: 0 0 4px 4px;
  background: #ff0000;
}

.production-tab-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.production-tab-label {
  color: #8d97a4;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.production-tab.active .production-tab-label {
  color: #000;
}

.production-tab-pct {
  color: var(--gold-dark);
  font-size: 12px;
  font-weight: 600;
}

.production-tab-main {
  font-size: 16px;
  font-weight: 700;
}

.production-tab-sub {
  margin-bottom: 6px;
  color: var(--slate);
  font-size: 12px;
}

.production-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.production-section-head .section-hint {
  margin: 0;
}

.production-head-actions,
.production-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.production-empty {
  min-height: 200px;
}

.production-empty-actions {
  margin-top: 6px;
}

.production-table {
  min-width: 1000px;
}

.production-table.production-equipment-table {
  min-width: 720px;
}

.production-table th:first-child,
.production-table td:first-child {
  padding-left: 12px;
}

.production-table thead th {
  padding: 11px 6px;
}

.production-table tbody td,
.production-table tfoot td {
  padding: 8px 6px;
  vertical-align: middle;
}

.production-table tbody tr:hover {
  background: transparent;
}

.production-input.field-input,
.production-input.field-select {
  min-width: 0;
  padding: 7px 9px;
  font-size: 13px;
}

.production-input.field-input:not(:focus):not(:hover) {
  border-color: #dde1ea;
}

.production-input.field-input.invalid {
  border-color: var(--red);
}

.production-time-range {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 200px;
  color: var(--slate);
  font-size: 12px;
}

.production-input.production-money {
  min-width: 105px;
  text-align: right;
}

.production-input.production-qty {
  width: 72px;
}

.production-input.production-role-select {
  min-width: 190px;
}

.production-input.production-short-select {
  min-width: 120px;
}

.production-input.production-status-select {
  min-width: 140px;
  font-weight: 700;
}

.production-status-select[data-status="Por Confirmar"] {
  background: var(--amber-bg);
  color: var(--amber);
}

.production-status-select[data-status="Confirmado"] {
  background: var(--blue-bg);
  color: var(--blue);
}

.production-status-select[data-status="Pendiente"] {
  background: var(--amber-bg);
  color: var(--amber);
}

.production-status-select[data-status="Cargado"],
.production-status-select[data-status="Pagado"] {
  background: var(--green-bg);
  color: var(--green);
}

.production-input.production-select-empty {
  color: var(--slate-light);
}

.production-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.production-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--green);
  cursor: pointer;
}

.production-row-done td {
  background: rgba(63, 125, 92, 0.06);
}

.production-row-done .production-input:not(:focus) {
  color: var(--slate);
}

.production-staff-table td:first-child {
  min-width: 190px;
}

.production-staff-table td:nth-child(2) {
  min-width: 140px;
}

.production-table input[type="date"] {
  min-width: 135px;
}

.production-input.production-stage-select {
  min-width: 120px;
}

.production-equipment-table td:first-child,
.production-schedule-table td:nth-child(4) {
  min-width: 220px;
}

.production-total-label {
  color: var(--slate);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  text-align: right;
  background: var(--paper-alt);
}

.production-total-value {
  padding-left: 19px !important;
  font-weight: 700;
  color: var(--ink);
  background: var(--paper-alt);
}

.production-table tfoot td {
  border-top: 1px solid var(--line);
  background: var(--paper-alt);
}

.project-order-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .12s, border-color .15s, box-shadow .15s;
}

.project-order-card:hover {
  transform: translateY(-1px);
  border-color: rgba(128, 0, 0, 0.35);
  box-shadow: var(--shadow-lg);
}

.project-order-card:focus {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.project-order-title {
  margin: 4px 0 6px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.25;
}

.project-order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--slate);
  font-size: 12.5px;
  font-weight: 700;
}

.purchase-order-header {
  margin-bottom: 18px;
}

.purchase-order-bank-grid {
  grid-template-columns: repeat(3, 1fr);
}

.purchase-order-total {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper-alt);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.purchase-order-items-wrap {
  margin-top: 12px;
}

.purchase-order-grid-card {
  background: #f4f6fa;
}

.purchase-order-grid {
  width: max-content;
  min-width: 100%;
  grid-template-columns:
    132px minmax(94px, max-content) minmax(140px, max-content) minmax(190px, 1fr) 36px minmax(102px, max-content) minmax(82px, max-content) minmax(82px, max-content) minmax(118px, max-content) 56px 44px minmax(94px, max-content) minmax(94px, max-content);
}

.purchase-order-grid .price-grid-head {
  background: #000;
  color: #fff;
  padding-left: 6px;
  padding-right: 6px;
  letter-spacing: .2px;
}

.purchase-order-grid .price-grid-actions-head {
  justify-content: center;
  padding-left: 6px;
  padding-right: 6px;
  gap: 8px;
}

.purchase-order-grid .price-grid-name-head {
  padding-left: 8px;
}

.purchase-order-grid .section-action-cell,
.purchase-order-grid .item-action-cell {
  justify-content: center;
  gap: 2px;
}

.purchase-order-grid .section-cell {
  background: #e7ebf2;
}

.purchase-order-grid .item-cell {
  background: #fff;
}

.purchase-order-table-input,
.purchase-order-table-select {
  min-height: 32px;
  margin: 0;
  padding: 6px 8px;
  font-size: 12.5px;
}

.purchase-order-table-input.center-input {
  text-align: center;
}

.purchase-order-fixed-cell {
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}

.purchase-order-negative-balance {
  color: #d10000;
}

.purchase-order-item-fixed-name {
  color: var(--slate);
  font-size: 13.5px;
  line-height: 1.2;
}

.purchase-order-billing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.purchase-order-billing-grid>div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper-alt);
}

.purchase-order-billing-grid span,
.purchase-order-billing-grid strong {
  display: block;
}

.purchase-order-billing-grid span {
  color: var(--slate);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.purchase-order-billing-grid strong {
  margin-top: 3px;
  color: var(--ink);
  font-size: 13px;
}

.purchase-order-billing-grid .field-label {
  margin-top: 0;
}

.purchase-order-billing-note {
  margin-top: 12px;
  color: var(--slate);
  font-size: 13px;
  line-height: 1.45;
}

.projects-empty {
  padding: 44px 20px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  text-align: center;
  color: var(--slate);
}

.projects-empty p {
  margin: 10px 0 0;
}


/* ============ TRACKING MODAL ============ */
.quote-row {
  cursor: pointer;
}

.quote-row:focus {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(27, 42, 74, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.tracking-modal {
  width: min(620px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 5px;
  box-shadow: var(--shadow-lg);
}

.tracking-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--line);
}

.tracking-title {
  margin: 3px 0 0;
  font-size: 24px;
  font-weight: 600;
}

.tracking-body {
  padding: 20px 24px 24px;
}

.delete-confirm-modal {
  max-width: 520px;
}

.delete-confirm-message {
  margin: 0 0 22px;
  line-height: 1.55;
  color: var(--ink);
}

.pdf-validation-modal {
  max-width: 540px;
}

.pdf-validation-message {
  margin: 0 0 12px;
  color: var(--ink);
  line-height: 1.5;
}

.pdf-validation-note {
  margin-top: -6px;
  color: var(--slate);
}

.pdf-validation-list {
  margin: 0 0 22px;
  padding-left: 18px;
  color: var(--slate);
  font-size: 13px;
  line-height: 1.55;
}

.pdf-validation-list li {
  margin: 3px 0;
}

.item-description-modal {
  width: min(760px, 100%);
}

.item-description-head {
  padding: 24px 28px 20px;
}

.item-description-kicker {
  color: #7a1710;
  font-size: 15px;
  font-weight: 600;
}

.item-description-title {
  color: #202d4a;
  font-size: 28px;
  line-height: 1.1;
  margin-top: 12px;
}

.item-description-body {
  padding: 24px 28px 28px;
}

.description-field-group+.description-field-group {
  margin-top: 24px;
}

.description-field-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--slate);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
}

.description-field-label .svg-mask {
  width: 24px;
  height: 24px;
  color: #202d4a;
}

.description-textarea {
  min-height: 112px;
}

.description-textarea-client {
  border-color: var(--red);
}

.description-alert {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.45;
}

.description-alert .svg-mask {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
}

.description-alert-client {
  color: var(--red);
  border-color: var(--red);
  background: rgba(180, 72, 63, .06);
}

.description-alert-private {
  color: #0b84ff;
  border-color: #0b84ff;
  background: rgba(11, 132, 255, .05);
}

.item-description-actions {
  justify-content: flex-end;
  margin-top: 28px;
}

.btn-danger-action {
  background: var(--red);
  border-color: var(--red);
}

.btn-danger-action:hover {
  background: #9f372f;
  border-color: #9f372f;
}

.btn-danger-action:disabled,
.btn-danger-action:disabled:hover {
  cursor: not-allowed;
  opacity: .45;
  background: var(--red);
  border-color: var(--red);
}

.quotation-delete-modal .field-input {
  margin-bottom: 18px;
}

.tracking-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
  background: var(--paper-alt);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 15px;
}

.tracking-summary-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .45px;
  color: var(--slate);
  font-weight: 700;
}

.tracking-summary-value {
  margin-top: 4px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.tracking-status-box {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.tracking-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.tracking-history {
  margin-top: 20px;
}

.tracking-history .history-list {
  margin-top: 12px;
}

.tracking-history .history-list>li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  line-height: 1.45;
}

.tracking-history .history-list>li:last-child {
  border-bottom: none;
}

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

/* ============ RESPONSIVE ============ */
@media (max-width: 720px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .purchase-order-bank-grid {
    grid-template-columns: 1fr;
  }

  .purchase-order-billing-grid {
    grid-template-columns: 1fr;
  }

  .evento-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .evento-schedule-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .evento-fechas-action {
    padding: 10px 0 0;
  }

  .evento-add-button {
    width: 100%;
  }

  .price-tabs {
    display: flex;
    width: 100%;
  }

  .price-tab-title,
  .price-tab {
    flex: 1;
  }

  .project-detail-header {
    align-items: stretch;
    flex-direction: column;
  }

  .project-tabs {
    grid-template-columns: 1fr;
  }

  .production-tabs {
    grid-template-columns: 1fr;
  }

  .production-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .project-tab {
    min-height: 42px;
    font-size: 12px;
  }

  .project-tab.active::after {
    left: 0;
    right: 0;
    height: 3px;
  }

  .price-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .price-section-title {
    min-width: 0;
  }

  .price-section-actions {
    flex-wrap: wrap;
  }

  .data-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .data-tabs {
    overflow-x: auto;
  }

  .items-head {
    display: none;
  }

  .item-row {
    grid-template-columns: 1fr;
    gap: 6px;
    background: var(--paper-alt);
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
  }

  .item-subtotal {
    text-align: left;
    padding: 0;
    font-weight: 600;
  }

  .internal-cost-panel {
    grid-template-columns: 1fr;
  }

  .internal-cost-grid {
    grid-template-columns: 1fr;
  }

  .internal-value {
    justify-content: flex-start;
  }

  .main-wrap {
    padding: 20px 16px 60px;
  }

  .topbar {
    padding: 14px 16px;
  }

  .form-secondary-nav {
    top: 57px;
  }

  .secondary-nav {
    align-items: stretch;
    flex-direction: column;
    padding: 12px 16px;
  }

  .secondary-nav-left,
  .secondary-nav-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .secondary-folio {
    min-width: 0;
    width: 100%;
  }

  .actions-cell {
    text-align: left;
  }
}

/* ---------- Cartola mensual ---------- */
.cartola-modal {
  width: min(1040px, 100%);
}

.cartola-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}

.cartola-control {
  display: flex;
  flex-direction: column;
  min-width: 200px;
}

.cartola-control .field-label {
  margin-top: 0;
}

.cartola-table-wrap {
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow-x: auto;
  max-height: 46vh;
}

.cartola-table {
  min-width: 820px;
}

.cartola-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.cartola-table th.num,
.cartola-table td.num {
  text-align: right;
  white-space: nowrap;
}

.cartola-table tbody tr:hover {
  background: transparent;
}

.cartola-flag {
  color: var(--red);
  font-weight: 700;
  margin-left: 2px;
}

.cartola-neg {
  color: var(--red);
}

.cartola-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.cartola-summary>div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink);
  border-radius: 3px;
}

.cartola-summary>div:nth-child(n+3) {
  border-left-color: var(--gold);
}

.cartola-summary span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--slate);
}

.cartola-summary strong {
  font-size: 18px;
  color: var(--ink);
}

.cartola-note {
  margin: 10px 0 0;
}

.cartola-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--slate);
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: 4px;
}

.staff-month-suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.cartola-control[hidden] {
  display: none;
}

.cartola-actions {
  justify-content: flex-end;
  margin-top: 20px;
}

.cartola-actions .btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

@media (max-width: 720px) {
  .cartola-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.cartola-table td.nowrap,
.cartola-table .cell-primary.nowrap,
.cartola-table .cell-sub.nowrap {
  white-space: nowrap;
}

.cartola-subtitle {
  margin: 22px 0 10px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--slate);
}

.cartola-table-wrap-short {
  max-height: 30vh;
}

.cartola-table-compact {
  min-width: 560px;
}

/* ---------- Enlace para compartir formulario de rendición ---------- */
.storage-usage-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
  padding: 16px 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.storage-usage-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.storage-usage-plan {
  font-size: 12px;
  color: var(--slate);
}

.storage-usage-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 28px;
}

.storage-usage-body>.share-link-hint {
  grid-column: 1 / -1;
  margin: 0;
}

.storage-meter-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.storage-meter-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.storage-meter-value {
  font-size: 12.5px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.storage-meter-bar {
  display: flex;
  gap: 2px;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--white);
}

.storage-segment {
  flex-basis: 0;
  min-width: 3px;
  height: 100%;
}

.storage-segment-photos {
  background: #3E6FA8;
}

.storage-segment-other {
  background: #C99A3A;
}

.storage-segment-free {
  background: var(--paper-alt);
}

.storage-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.storage-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.storage-legend-key {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.storage-legend-detail {
  color: var(--slate);
}

.storage-warning {
  margin: 8px 0 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
}

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

.share-link-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
  padding: 16px 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
}

.share-link-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.share-link-hint {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--slate);
}

.share-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.share-link-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12.5px;
  outline: none;
}

.share-link-input:focus {
  border-color: var(--gold);
  background: var(--white);
}

.share-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.share-link-btn .svg-mask {
  width: 15px;
  height: 15px;
  background-color: currentColor;
}

.share-link-btn.is-copied {
  background: var(--green);
}

@media (max-width: 640px) {
  .share-link-row {
    flex-wrap: wrap;
  }

  .share-link-input {
    flex-basis: 100%;
  }
}

/* ---------- Detalle de rendición ---------- */
.expense-detail-modal {
  width: min(680px, 100%);
}

.expense-edit-modal {
  width: min(720px, 100%);
}

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

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

.expense-edit-note {
  margin: 14px 0 0;
}

.expense-event-options {
  max-height: 240px;
  overflow-y: auto;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--white);
  box-shadow: 0 8px 20px rgba(27, 42, 74, .12);
}

.expense-event-option {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.expense-event-option:last-child {
  border-bottom: 0;
}

.expense-event-option:hover,
.expense-event-option:focus,
.expense-event-option.selected {
  background: var(--paper);
  outline: none;
}

.expense-event-option-title {
  font-size: 13px;
  font-weight: 700;
}

.expense-event-option-meta {
  color: var(--slate);
  font-size: 12px;
}

.expense-event-options-empty {
  padding: 12px;
  color: var(--slate);
  font-size: 12.5px;
}

.expense-edit-actions {
  justify-content: flex-end;
  margin-top: 22px;
}

.expense-detail-sub {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--slate);
}

.expense-detail-amount {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
}

.expense-detail-amount-value {
  margin-top: 4px;
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
}

.expense-detail-movement {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate);
}

.expense-detail-section {
  margin: 22px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--gold-dark);
}

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

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

.expense-detail-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .35px;
  color: var(--slate);
}

.expense-detail-value {
  margin-top: 3px;
  font-size: 14px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.expense-detail-value.multiline {
  white-space: pre-line;
}

.expense-detail-status-select {
  margin-top: 6px;
  min-height: 38px;
}

.expense-detail-status-message {
  min-height: 16px;
  margin: 6px 0 0;
}

.expense-detail-photo {
  margin-top: 14px;
}

.expense-detail-photo-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  cursor: zoom-in;
  overflow: hidden;
}

.expense-detail-photo-btn img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
}

.expense-detail-photo-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.expense-detail-photo-actions .section-hint {
  margin: 0;
}

.expense-detail-nophoto {
  margin: 12px 0 0;
}

.expense-photo-zoom {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 16, 30, .88);
  cursor: zoom-out;
}

.expense-photo-zoom img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: var(--shadow-lg);
}

@media (max-width: 520px) {

  .expense-edit-grid,
  .expense-detail-grid {
    grid-template-columns: 1fr;
  }
}

.quotes-table .nowrap-cell {
  white-space: nowrap;
}

/* ---------- OC: ítems de varios negocios ---------- */
.purchase-order-empty-cell {
  grid-column: 1 / -1;
  padding: 18px 16px;
  color: var(--slate);
  font-size: 13px;
  text-align: center;
}

.purchase-order-empty-cell .svg-mask {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin: 0 3px;
  vertical-align: -2px;
}

.po-add-items-modal .tracking-head {
  align-items: center;
}

.po-add-items-search {
  margin-bottom: 12px;
}

.po-add-items-project-list,
.po-add-items-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(48vh, 420px);
  overflow: auto;
  padding-right: 2px;
}

.po-add-items-project {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}

.po-add-items-project:hover,
.po-add-items-project:focus-visible {
  border-color: rgba(128, 0, 0, 0.35);
  box-shadow: var(--shadow);
  outline: none;
}

.po-add-items-project-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.po-add-items-selected {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.po-add-items-selected-info {
  flex: 1;
  min-width: 0;
}

.po-add-items-all {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--slate);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.po-add-items-section+.po-add-items-section {
  margin-top: 10px;
}

.po-add-items-section-title {
  padding: 6px 10px;
  border-radius: 3px;
  background: var(--ink);
  color: var(--white);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.po-add-items-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.po-add-items-item:hover {
  background: var(--paper);
}

.po-add-items-item.is-disabled {
  color: var(--slate-light);
  cursor: default;
}

.po-add-items-item-name {
  min-width: 0;
  font-size: 13.5px;
}

.po-add-items-item-cost {
  color: var(--slate);
  font-size: 12.5px;
}

.po-add-items-count {
  margin-right: auto;
  align-self: center;
  color: var(--slate);
  font-size: 12.5px;
  font-weight: 700;
}

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

.project-orders-summary>div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.project-orders-summary span {
  color: var(--slate);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.project-orders-summary strong {
  color: var(--ink);
  font-size: 15px;
}

.project-order-shared {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--slate);
  font-size: 12px;
}

@media (max-width: 640px) {
  .project-orders-summary {
    grid-template-columns: 1fr;
  }

  .po-add-items-selected {
    flex-wrap: wrap;
  }
}

/* ---------- Importar staff desde Excel ---------- */
.data-title-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.staff-import-modal {
  width: min(1240px, 100%);
  max-height: 92vh;
}

.staff-import-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 44px 20px;
  text-align: center;
  color: var(--slate);
  background: var(--paper);
  border: 2px dashed var(--line);
  border-radius: 5px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.staff-import-drop:hover,
.staff-import-drop.dragging {
  border-color: var(--ink);
  background: var(--white);
}

.staff-import-drop strong {
  color: var(--ink);
  font-size: 15px;
}

.staff-import-loading {
  font-weight: 700;
  color: var(--ink);
}

.staff-import-error,
.staff-import-global-errors div {
  color: var(--red);
  font-weight: 700;
}

.staff-import-global-errors div {
  margin-bottom: 10px;
  padding: 8px 12px;
  background: var(--red-bg);
  border-radius: 3px;
}

.staff-import-file-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px 20px;
  margin-bottom: 12px;
}

.staff-import-file-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-right: auto;
  min-width: 0;
}

.staff-import-file-name strong {
  overflow-wrap: anywhere;
}

.staff-import-option {
  padding-bottom: 9px;
}

.staff-import-table-wrap {
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: auto;
  max-height: 52vh;
}

.staff-import-table {
  min-width: 100%;
  font-size: 12px;
}

.staff-import-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  vertical-align: top;
  min-width: 190px;
}

.staff-import-table th.si-num,
.staff-import-table td.si-num {
  min-width: 0;
  width: 44px;
  color: var(--slate);
  text-align: right;
}

.staff-import-table th.si-status,
.staff-import-table td.si-status {
  min-width: 150px;
  max-width: 200px;
}

.si-cell-error {
  max-width: 220px;
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.3;
  color: var(--red);
}

.si-cell-error:empty {
  display: none;
}

.staff-import-table th.si-actions {
  min-width: 0;
  width: 44px;
}

.staff-import-table tbody tr:hover {
  background: transparent;
}

.staff-import-table td {
  padding: 6px 8px;
  vertical-align: top;
}

.staff-import-map {
  width: 100%;
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.staff-import-map.is-ignored {
  color: var(--slate);
  font-weight: 400;
}

.staff-import-header {
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
  font-size: 11px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  opacity: .85;
}

.staff-import-input {
  width: 100%;
  min-width: 140px;
  padding: 6px 8px;
  font-size: 12.5px;
}

.si-col-ignored {
  opacity: .45;
}

.staff-import-input:disabled {
  background: transparent;
  cursor: default;
}

.staff-import-row-msg {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--slate);
}

.si-row-error td {
  background: rgba(180, 72, 63, .05);
}

.si-row-error .staff-import-row-msg {
  color: var(--red);
}

.si-row-skip .staff-import-row-msg {
  color: var(--amber);
}

.si-row-removed td:not(.si-actions) {
  opacity: .4;
}

.si-row-removed .staff-import-input {
  text-decoration: line-through;
}

.staff-import-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 20px;
  margin-top: 14px;
}

.staff-import-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 13px;
  color: var(--slate);
}

.staff-import-summary strong {
  color: var(--ink);
  font-size: 15px;
}

.staff-import-summary .si-sum-new strong {
  color: var(--green);
}

.staff-import-summary .si-sum-existing strong {
  color: var(--amber);
}

.staff-import-summary .si-sum-error strong {
  color: var(--red);
}

.staff-import-footer-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.staff-import-result {
  padding: 22px 18px;
  border-radius: 4px;
  font-weight: 700;
  line-height: 1.5;
}

.staff-import-result.ok {
  color: var(--green);
  background: var(--green-bg);
}

.staff-import-result.error {
  color: var(--red);
  background: var(--red-bg);
}

/* ---------- OC: eliminar ---------- */
.project-order-actions {
  display: flex;
  flex-shrink: 0;
  gap: 6px;
}

.purchase-order-delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
  color: var(--red);
}

.purchase-order-delete-btn .svg-mask {
  width: 15px;
  height: 15px;
}

.purchase-order-delete-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

.purchase-orders-table .actions-cell {
  white-space: nowrap;
}

.delete-confirm-warning {
  margin-top: 4px;
  font-size: 13.5px;
}

.delete-confirm-warning .svg-mask {
  width: 20px;
  height: 20px;
}
/* ---------- OC de staff ---------- */
.purchase-order-grid.purchase-order-grid-staff {
  /* Igual que la tabla de OC, sin la columna Días. */
  grid-template-columns:
    132px minmax(94px, max-content) minmax(140px, max-content) minmax(190px, 1fr) 36px minmax(102px, max-content) minmax(82px, max-content) minmax(82px, max-content) minmax(118px, max-content) 56px minmax(94px, max-content) minmax(94px, max-content);
}

.purchase-order-staff-totals {
  margin-top: 12px;
}

.purchase-order-staff-totals .totals-lines {
  min-width: 300px;
}

.purchase-order-staff-totals .totals-line {
  gap: 24px;
}

.purchase-order-type-badge {
  margin-left: 6px;
  font-family: inherit;
  font-size: 10px;
  vertical-align: middle;
}

.status-select {
  width: auto;
  min-width: 118px;
  padding: 5px 12px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  cursor: pointer;
}

.status-select option {
  text-transform: uppercase;
}

.status-select:disabled {
  opacity: .6;
  cursor: progress;
}

.status-select[data-status="Pendiente"],
.status-select[data-status="Negociación"] {
  background-color: var(--amber-bg);
  color: var(--amber);
  border-color: rgba(87, 114, 176, 0.15);
}

.status-select[data-status="Pagado"],
.status-select[data-status="Aprobado"] {
  background-color: var(--green-bg);
  color: var(--green);
  border-color: rgba(63, 125, 92, 0.4);
}

.status-select[data-status="Realizado"] {
  background-color: var(--purple-bg);
  color: var(--purple);
  border-color: rgba(123, 94, 167, 0.4);
}

.status-select[data-status="Facturado"] {
  background-color: var(--blue-bg);
  color: var(--blue);
  border-color: rgba(62, 111, 168, 0.4);
}

.status-select[data-status="Cancelado"] {
  background-color: var(--red-bg);
  color: var(--red);
  border-color: rgba(180, 72, 63, 0.4);
}

.form-title .purchase-order-type-badge {
  margin-left: 10px;
  font-size: 11px;
}

.po-type-modal {
  width: min(560px, 100%);
}

.po-type-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.po-type-option {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}

.po-type-option:hover,
.po-type-option:focus-visible {
  border-color: var(--gold);
  box-shadow: var(--shadow-lg);
  outline: none;
  transform: translateY(-1px);
}

.po-type-option-title {
  font-family: 'Oswald', sans-serif;
  font-size: 18px;
  font-weight: 600;
}

.po-type-option-hint {
  color: var(--slate);
  font-size: 12.5px;
  line-height: 1.4;
}

@media (max-width: 560px) {
  .po-type-options {
    grid-template-columns: 1fr;
  }
}

/* Encabezado "Doc.(FE/BHE/EXENTO)" de la tabla de OC: elige el Doc de todos los ítems. */
.purchase-order-grid .purchase-order-doc-head {
  padding: 0 4px;
}

.purchase-order-doc-select {
  width: 100%;
  padding: 4px 2px;
  border: none;
  background: transparent;
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-transform: none;
  text-align: center;
  cursor: pointer;
}

.purchase-order-doc-select:focus {
  outline: none;
}

.purchase-order-doc-select:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 2px;
}

.purchase-order-doc-select option {
  color: var(--ink);
  background: var(--white);
}

/* Encabezado P.U de la tabla de ítems de la OC, en rojo. */
.purchase-order-grid .price-grid-head.purchase-order-unit-price-head {
  background: #ff0000;
}

/* Producción > Personal ↔ OC de staff */
.production-input.production-item-select {
  min-width: 190px;
}

.production-po-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.production-po-open {
  padding: 4px 8px;
}

.production-input.field-input[readonly] {
  background: var(--paper);
  color: var(--slate);
}

.production-staff-modal {
  width: min(620px, 100%);
}

.production-staff-form {
  margin-bottom: 14px;
}

.production-staff-form-wide {
  grid-column: 1 / -1;
}

.production-staff-po {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.production-staff-po .section-hint {
  margin: 2px 0 0;
}

.production-staff-person-field {
  position: relative;
}

.production-staff-person-options {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 5;
}

/* Código de la OC con el color de su estado */
.production-po-open[data-status="Pendiente"] {
  background: var(--amber-bg);
  border-color: var(--amber);
  color: var(--amber);
}

.production-po-open[data-status="Pagado"] {
  background: var(--green-bg);
  border-color: var(--green);
  color: var(--green);
}

.production-po-warning {
  display: inline-flex;
  color: var(--amber);
}

.production-po-warning .svg-mask {
  width: 16px;
  height: 16px;
}
