:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #64748b;
  --line: #dbe3ea;
  --primary: #2563eb;
  --income: #16a34a;
  --expense: #dc2626;
  --warn: #f97316;
  --info: #0284c7;
  --radius: 8px;
  --shadow: 0 12px 30px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
}
body.dark-mode {
  --bg: #0f1115;
  --surface: #181b22;
  --text: #f8fafc;
  --muted: #a1a8b5;
  --line: #303747;
  color-scheme: dark;
}
body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea,
body.dark-mode label,
body.dark-mode .field-block,
body.dark-mode .inline-check,
body.dark-mode .checkbox-row,
body.dark-mode .check-line,
body.dark-mode .search-select-trigger,
body.dark-mode .search-select-panel,
body.dark-mode .search-select-option,
body.dark-mode .multi-select-trigger,
body.dark-mode .multi-select-panel {
  background: #111827;
  color: #f8fafc;
  border-color: #374151;
}
body.dark-mode .btn.secondary,
body.dark-mode .icon-btn {
  background: #111827;
  color: #f8fafc;
  border-color: #374151;
}
body.dark-mode .card,
body.dark-mode .panel,
body.dark-mode .topbar {
  background: var(--surface);
  border-color: var(--line);
}
body.dark-mode th {
  background: #111827;
  color: #f8fafc;
}
body.dark-mode td,
body.dark-mode .detail-list div,
body.dark-mode .contact-link {
  color: #f8fafc;
}
body.dark-mode .muted,
body.dark-mode .small.muted {
  color: #a1a8b5;
}
a { color: var(--primary); text-decoration: none; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.crm-tooltip {
  position: fixed;
  z-index: 9999;
  max-width: min(280px, calc(100vw - 16px));
  min-height: 32px;
  padding: 8px 13px;
  border-radius: 8px;
  background: #17171b;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .22);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .12s ease, transform .12s ease;
  white-space: normal;
}
.crm-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 245px;
  padding: 16px;
  background: #111827;
  color: #fff;
  transform: translateX(-100%);
  transition: transform .2s ease;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.sidebar-right {
  inset: 0 0 0 auto;
  background: #0f172a;
  transform: translateX(100%);
}
.sidebar.open { transform: translateX(0); }
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10;
  background: rgba(15, 23, 42, .4);
}
.sidebar-backdrop.open { display: block; }
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: #fff;
  font-weight: 800;
}
.nav-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 10px 6px;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.brand-mark {
  display: grid;
  place-items: center;
  min-width: 42px;
  width: auto;
  height: 42px;
  border-radius: 8px;
  background: var(--primary);
  padding: 0 9px;
}
.brand-compact { font-size: 12px; color: #94a3b8; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav a,
.logout {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 14px;
}
.sidebar nav a.active,
.sidebar nav a:hover,
.logout:hover { background: #1f2937; color: #fff; }
.nav-group {
  display: grid;
  gap: 5px;
  margin: 8px 0;
}
.nav-group summary {
  list-style: none;
  cursor: pointer;
  padding: 9px 12px;
  border-radius: 8px;
  color: #f8fafc;
  font-weight: 800;
  background: rgba(255,255,255,.06);
}
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group a { margin-left: 8px; }
.logout { margin-top: 26px; }
.logout .bi { margin-right: 8px; }
.theme-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 4px 0;
  padding: 10px 8px;
  border-radius: 8px;
  color: #cbd5e1;
}
.theme-toggle-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.main { min-width: 0; }
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar-title {
  min-width: 190px;
  flex: 1 1 auto;
}
.topbar-actions {
  display: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.topbar-actions-mobile { display: none; }
.mobile-header-period {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 900;
  white-space: nowrap;
}
.mobile-header-period a {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
}
.quick-icon {
  width: auto;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  display: inline-grid;
  place-items: center;
  background: var(--primary);
  border: 1px solid var(--primary);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .18);
}
.menu-file-btn {
  min-width: 96px;
  justify-content: center;
  text-align: center;
}
.provider-internal-grid {
  align-items: end;
}
.candidate-form-grid,
.grupo-form-grid {
  align-items: start;
}
.candidate-form-grid > label,
.grupo-form-grid > label {
  align-content: start;
}
.acreedor-movimiento-form input,
.acreedor-movimiento-form select,
.provider-internal-grid input,
.provider-internal-grid select,
.candidate-form-grid input,
.candidate-form-grid select {
  height: 42px;
  min-height: 42px;
  padding: 9px 11px;
  box-sizing: border-box;
}
.candidate-form-grid input[type="file"] {
  height: 42px;
  min-height: 42px;
  padding: 8px 11px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
}
.candidate-form-grid .checkbox-row {
  min-height: 28px;
  align-items: center;
}
.candidate-form-grid .checkbox-row input[type="checkbox"],
.grupo-form-grid .checkbox-row input[type="checkbox"],
.checkbox-grid .checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  min-height: 16px;
  flex: 0 0 16px;
}
.badge.grupo-state-enviar {
  background: var(--warn);
  color: #fff;
}
.badge.grupo-state-reservado {
  background: var(--primary);
  color: #fff;
}
.acreedor-tipo-badge {
  color: #fff;
}
.table-bulk-actions {
  margin-bottom: 10px;
}
.horario-preview-grid {
  display: grid;
  grid-template-columns: minmax(160px, 1.1fr) repeat(7, minmax(115px, 1fr));
  gap: 6px;
  overflow-x: auto;
}
.horario-preview-head,
.horario-preview-name,
.horario-preview-cell {
  min-height: 66px;
  padding: 8px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}
.horario-preview-head {
  min-height: 46px;
  background: #111827;
  color: #fff;
  font-weight: 900;
  text-align: center;
}
.horario-preview-head span {
  color: #cbd5e1;
  font-size: 12px;
}
.horario-preview-name {
  font-weight: 900;
  display: flex;
  align-items: center;
}
.horario-preview-cell {
  border-left-width: 5px;
  display: grid;
  gap: 2px;
  font-size: 12px;
}
.horario-preview-cell strong {
  font-size: 13px;
}
.horario-preview-empty {
  grid-column: 1 / -1;
  color: var(--muted);
}
.dashboard-quick-actions .btn,
.dashboard-quick-actions a.btn,
.dashboard-quick-actions a.btn:link,
.dashboard-quick-actions a.btn:visited {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #fff !important;
}
@media (max-width: 760px) {
  .mobile-header-period { display: flex; }
  .topbar .topbar-actions-mobile { display: none !important; }
  .dashboard-balance-cards { margin-top: 18px; }
  .dashboard-period-panel { display: none; }
  .dashboard-quick-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    gap: 10px;
  }
  .dashboard-quick-actions .btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }
}
.quick-abbr { display: none; }
.quick-label { display: inline; }
.btn-back-top {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 13px;
  white-space: nowrap;
}
.sidebar-back-btn {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  margin: 0 0 6px;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid #1e293b;
  transition: background .15s, color .15s;
}
.sidebar-back-btn:hover {
  background: #1f2937;
  color: #fff;
}
.topbar h1 { margin: 0; font-size: 22px; }
.topbar p { margin: 2px 0 0; color: var(--muted); }
.icon-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}
.right-sidebar-mobile-toggle {
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}
.content {
  width: 100%;
  margin: 0 auto;
  padding: 18px 14px 36px;
}
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
  background: linear-gradient(135deg, #f4f6f8, #e8eef5);
}
.login-card {
  width: min(420px, 100%);
  padding: 28px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}
.login-card h1 { margin: 0 0 8px; }
.login-card p { color: var(--muted); margin: 0 0 22px; }
.login-card .btn {
  display: flex;
  margin: 18px auto 0;
  min-width: 150px;
}
.grid { display: grid; gap: 16px; }
.grid.cards { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 18px rgba(15, 23, 42, .04);
}
.card { padding: 18px; }
.card span { color: var(--muted); font-size: 13px; }
.card strong { display: block; margin-top: 8px; font-size: 24px; }
.panel { padding: 18px; margin-top: 18px; }
.panel-header,
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.panel-header h2,
.form-section h2,
.detail-list h3 {
  margin-top: 0;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}
.panel-header h2 { margin: 0; font-size: 18px; }
legend,
.crm-legend {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 13px;
  border: 0;
  border-radius: 8px;
  background: #17171b;
  color: #fff;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
}
.filters,
.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.panel .filters + .filters {
  margin-top: 14px;
}
.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.sort-link {
  color: inherit;
  font-weight: 800;
}
.profile-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.detail-list {
  display: grid;
  gap: 10px;
}
.detail-list div {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.rating {
  color: #f59e0b;
  font-weight: 900;
  letter-spacing: 1px;
}
.form-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.form-section h2 { margin: 0 0 14px; font-size: 18px; }
label { display: grid; gap: 6px; font-weight: 650; color: #334155; }
.field-block {
  display: grid;
  gap: 6px;
  font-weight: 650;
  color: #334155;
}
.field-label { display: block; }
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
}
.inline-input-group {
  display: grid;
  grid-template-columns: minmax(120px, .45fr) 1fr;
  gap: 8px;
}
.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 9px 11px;
  background: #fff;
  color: var(--text);
  font: inherit;
}
.native-select-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.search-select {
  position: relative;
  width: 100%;
}
.search-select-trigger {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 9px 34px 9px 11px;
  background: #fff;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  position: relative;
}
.search-select-trigger::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: translateY(-65%) rotate(45deg);
}
.search-select-trigger.is-empty { color: var(--muted); }
.search-select.open .search-select-trigger {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .08);
}
.search-select-panel {
  position: absolute;
  z-index: 45;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  padding: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .18);
}
.search-select-input {
  min-height: 38px;
  margin-bottom: 7px;
  border-radius: 8px;
}
.search-select-list {
  display: grid;
  gap: 3px;
  max-height: 235px;
  overflow: auto;
}
.search-select-option {
  width: 100%;
  border: 0;
  border-radius: 7px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.search-select-option:hover,
.search-select-option.selected {
  background: #eff6ff;
  color: #1d4ed8;
}
.search-select-empty {
  padding: 10px;
  color: var(--muted);
  font-size: 13px;
}
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  margin: 0;
  border: 2px solid #94a3b8;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  display: inline-grid;
  place-content: center;
  vertical-align: middle;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .12s ease;
}
input[type="checkbox"]::after {
  content: "";
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transform-origin: center;
  transition: transform .14s ease;
}
input[type="checkbox"]:checked {
  border-color: #0f9f91;
  background: #0f9f91;
}
input[type="checkbox"]:checked::after {
  transform: rotate(45deg) scale(1);
}
input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 159, 145, .18);
}
input[type="checkbox"]:active {
  transform: scale(.94);
}
textarea { min-height: 98px; resize: vertical; }
.multi-select {
  position: relative;
}
.multi-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 9px 11px;
  background: #fff;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.multi-select-trigger:hover,
.multi-select-trigger[aria-expanded="true"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .08);
}
.multi-select-arrow {
  color: var(--muted);
  font-size: 12px;
}
.multi-select-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  padding: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, .16);
}
.multi-select-panel input[type="search"] {
  margin-bottom: 8px;
}
.checkbox-select {
  display: grid;
  gap: 4px;
  max-height: 210px;
  overflow: auto;
}
.check-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 5px 8px;
  border-radius: 7px;
  font-weight: 600;
  cursor: pointer;
}
.check-row:hover { background: #f0fdfa; }
.check-row input[type="checkbox"] {
  width: 17px;
  min-height: 17px;
  height: 17px;
  flex: 0 0 17px;
}
.check-row span {
  display: block;
  min-width: 0;
  font-size: 14px;
}
.check-row small {
  color: var(--muted);
  font-weight: 650;
}
@media (max-width: 720px) {
  .multi-select-panel {
    position: static;
    margin-top: 6px;
    box-shadow: none;
  }
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 750;
  cursor: pointer;
}
.btn.secondary { background: #fff; color: var(--text); border-color: var(--line); }
.btn.danger { background: var(--expense); }
.btn.ok { background: var(--income); }
.btn.warn { background: var(--warn); color: #fff; border-color: var(--warn); }
.btn.info { background: var(--info); color: #fff; border-color: var(--info); }
.btn.whatsapp { background: #16a34a; color: #fff; border-color: #16a34a; }
.btn.neutral { background: #475569; color: #fff; border-color: #475569; }
.btn.anthracite { background: #4b5563; color: #fff; border-color: #4b5563; }
.btn.filter-active {
  background: #1f2937;
  color: #fff;
  border-color: #1f2937;
  box-shadow: 0 8px 18px rgba(31, 41, 55, .2);
}
.btn .bi {
  flex: 0 0 auto;
  font-size: 1em;
  line-height: 1;
}
.btn:not(.btn-icon-only) .bi:first-child {
  margin-right: 7px;
}
.btn-icon-only {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 8px;
}
.btn-icon-only .bi {
  margin: 0;
  font-size: 15px;
}
.pdf-file-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  object-fit: contain;
  vertical-align: middle;
  border-radius: 3px;
}
.btn-icon-only .pdf-file-icon {
  width: 21px;
  height: 21px;
}
.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-weight: 700;
}
.contact-link:hover { color: var(--primary); }
.contact-icon,
.wa-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
}
.wa-icon {
  background: #16a34a;
  box-shadow: 0 5px 12px rgba(22, 163, 74, .24);
}
.phone-icon {
  background: #0284c7;
  box-shadow: 0 5px 12px rgba(2, 132, 199, .22);
}
.email-icon {
  background: #64748b;
  box-shadow: 0 5px 12px rgba(100, 116, 139, .2);
}
.whatsapp-link:hover .wa-icon { background: #128c3f; }
.phone-link:hover .phone-icon { background: #0369a1; }
.email-link:hover .email-icon { background: #475569; }
.table-wrap { overflow-x: auto; }
.sortable-th {
  cursor: pointer;
  user-select: none;
}
.sortable-th::after {
  content: " \2195";
  color: #94a3b8;
  font-size: 0.78rem;
}
.sortable-th.sort-asc::after { content: " \2191"; color: #1f2937; }
.sortable-th.sort-desc::after { content: " \2193"; color: #1f2937; }
table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  min-width: 760px;
}
tbody tr {
  height: 56px;
}
th,
td {
  padding: 10px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  height: 56px;
  line-height: 1.35;
}
td > *:first-child { margin-top: 0; }
td > *:last-child { margin-bottom: 0; }
td.wrap,
th.wrap,
.wrap-cell { white-space: normal; }
th { color: #475569; font-size: 13px; background: #f8fafc; }
.row-inactive td {
  color: #94a3b8;
  background: #fbfcfd;
}
.row-inactive td strong,
.row-inactive td a:not(.btn) {
  color: #64748b;
}
.row-inactive .contact-icon,
.row-inactive .wa-icon {
  opacity: .62;
  filter: grayscale(.35);
}
.row-inactive:hover td { background: #f6f8fa; }
.amount.ingreso,
.income { color: var(--income); font-weight: 800; }
.amount.gasto,
.expense { color: var(--expense); font-weight: 800; }
.text-success { color: var(--income); font-weight: 800; }
.text-danger { color: var(--expense); font-weight: 800; }
.muted-row {
  color: #94a3b8;
}
.muted-row a,
.muted-row strong {
  color: #64748b;
}
.split-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 6px;
  color: #374151;
  font-weight: 700;
}
.salary-inline {
  display: grid;
  grid-template-columns: minmax(120px, .6fr) 1fr;
  gap: 8px;
}
.field-missing {
  border: 2px solid var(--expense) !important;
  background: #fff7f7;
}
.forecast-empty {
  min-height: 34px;
  border: 2px solid var(--expense);
  border-radius: 6px;
  background: #fff7f7;
  display: block;
}
.accounting-done {
  color: #94a3b8;
  background: #f8fafc;
}
.accounting-done a,
.accounting-done strong {
  color: #64748b;
}
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  background: #e2e8f0;
  color: #334155;
}
.badge.ok,
.badge.status-ok { background: var(--income); color: #fff; }
.badge.danger { background: #dc2626; color: #fff; }
.badge.warn { background: #ffedd5; color: #9a3412; }
.badge.info { background: #e0f2fe; color: #075985; }
.badge.muted { background: #e5e7eb; color: #4b5563; }
.badge.neutral { background: #475569; color: #fff; }
.btn.filter-active {
  background: #1f2937;
  border-color: #1f2937;
  color: #fff;
}
.btn.purple {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #fff;
}
.btn.nav-outline {
  background: #fff;
  border: 2px solid #111827;
  color: var(--expense);
  font-weight: 900;
}
.btn-fit {
  width: auto;
  justify-self: start;
}
.date-highlight input {
  border-color: var(--primary);
  border-width: 2px;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .08);
  min-width: 150px;
}
.horarios-form {
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  align-items: end;
}
.horarios-form label:first-of-type {
  min-width: 190px;
}
.horarios-form input[type="time"] {
  max-width: 116px;
}
.horarios-form .form-actions-right {
  align-self: end;
  justify-self: end;
}
.bulk-panel {
  margin: 12px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.notification-toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}
.notification-save-actions {
  margin-top: 22px;
}
.notification-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: 8px;
  background: #e0f2fe;
  color: #075985;
  font-weight: 900;
  border: 1px solid #bae6fd;
}
.notification-switch {
  justify-content: flex-start;
  background: #fff1f2;
  color: #991b1b;
  border: 1px solid #fecdd3;
}
.notification-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.switch-ui {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 24px;
  border-radius: 999px;
  background: #dc2626;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.05);
  transition: background .18s ease;
}
.switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(15, 23, 42, .25);
  transition: transform .18s ease;
}
.notification-switch input:checked + .switch-ui,
.theme-toggle-row input:checked + .switch-ui {
  background: #16a34a;
}
.notification-switch input:checked + .switch-ui::after,
.theme-toggle-row input:checked + .switch-ui::after {
  transform: translateX(22px);
}
.notification-switch:has(input:checked) {
  background: #ecfdf5;
  color: #166534;
  border-color: #bbf7d0;
}
.debug-text {
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  background: #111827;
  color: #f9fafb;
  border-radius: 8px;
  padding: 12px;
}
.is-hidden { display: none !important; }
.movement-type-badge {
  background: #fff;
  border: 2px solid #111827;
  color: #111827;
}
.movement-type-badge.income { color: #16a34a; }
.movement-type-badge.expense { color: #dc2626; }
.attach-inline-btn {
  min-width: 112px;
  min-height: 36px;
  justify-content: center;
}
.acreedor-type-badge {
  min-width: 74px;
  justify-content: center;
  text-align: center;
  color: #fff;
}
.acreedor-type-badge.pago { background: #16a34a; }
.acreedor-type-badge.deuda { background: #dc2626; }
.acreedor-type-badge.ajuste { background: #f97316; }
.menu-file-btn,
.row-actions .menu-file-btn {
  min-width: 96px;
  min-height: 34px;
  justify-content: center;
}
.article-list-lines {
  display: grid;
  gap: 3px;
  white-space: normal;
}
.readonly-field:disabled {
  background: #e5e7eb;
  color: #64748b;
  cursor: not-allowed;
}
.form-actions-right {
  justify-content: flex-end;
}
.datos-restaurante-actions {
  justify-content: flex-end;
}
.flow-type-badge {
  min-width: 26px;
  justify-content: center;
  background: var(--income);
  color: #fff;
  border-radius: 999px;
  font-weight: 900;
}
.accounting-table .amount {
  font-weight: 400;
}
.period-nav {
  align-items: center;
  justify-content: flex-end;
}
.period-nav .badge {
  margin-left: auto;
}
.horarios-form .employee-field {
  min-width: 240px;
}
.horarios-form .date-highlight {
  margin-left: 10px;
}
.entrevista-inline {
  grid-template-columns: minmax(130px, 1.5fr) repeat(auto-fit, minmax(110px, 1fr));
  align-items: end;
}
.entrevista-inline textarea {
  min-height: 42px;
}
.candidate-state-nuevo { background: #64748b; color: #fff; }
.candidate-state-preseleccionado { background: #0284c7; color: #fff; }
.candidate-state-contactado { background: #7c3aed; color: #fff; }
.candidate-state-entrevista { background: #f97316; color: #fff; }
.candidate-state-no-presentado { background: #dc2626; color: #fff; }
.candidate-state-descartado { background: #475569; color: #fff; }
.candidate-state-contratable { background: #16a34a; color: #fff; }
.candidate-state-contratado { background: #15803d; color: #fff; }
.category-badge {
  max-width: 180px;
  white-space: normal;
}
.period-arrow {
  color: #dc2626;
  border-color: #dc2626;
  font-weight: 900;
  min-width: 38px;
  justify-content: center;
}
.amount-normal,
.panel td.amount-normal {
  font-weight: 400 !important;
}
.text-center-badge {
  justify-content: center;
  text-align: center;
  min-width: 74px;
}
.horarios-form {
  margin-top: 18px;
}
.employee-cost-form {
  margin-top: 18px;
}
.employee-cost-form .form-grid {
  margin-top: 16px;
}
.menu-price-cell,
.invoice-cell-normal {
  font-weight: 400 !important;
}
.compact-text {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.copied {
  filter: brightness(1.05);
}
.entrevista-inline input,
.entrevista-inline select,
.entrevista-inline textarea {
  min-height: 42px;
}
.muted-row,
.muted-row td {
  color: #94a3b8;
  background: #f8fafc;
}
.right-actions {
  justify-content: flex-end;
  margin-top: 18px;
}
.badge.flow-type-badge-x {
  background: #f97316;
  color: #fff;
}
.badge.flow-type-badge-z {
  background: #16a34a;
  color: #fff;
}
.badge.purple {
  background: #7c3aed;
  color: #fff;
}
.payment-calendar-grid {
  display: grid;
  gap: 10px;
}
.payment-calendar-row {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 8px;
  align-items: end;
}
.copy-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.economic-sheet {
  padding: 12px;
}
.numbers-table {
  min-width: 1320px;
  border-collapse: collapse;
}
.numbers-table th,
.numbers-table td {
  padding: 6px 8px;
  vertical-align: middle;
}
.sheet-group td {
  background: #111827;
  color: #fff;
  font-weight: 900;
  text-transform: uppercase;
}
.sheet-subtotal td,
.sheet-total td {
  background: #e0f2fe;
  font-weight: 900;
}
.sheet-percent td {
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
}
.sheet-benefit td {
  background: #fef3c7;
  font-weight: 900;
}
.sheet-input {
  min-width: 104px;
  min-height: 34px;
  padding: 5px 7px;
  text-align: right;
}
.sheet-input.missing-value {
  border: 2px solid #dc2626;
  background: #fff7f7;
}
body.dark-mode .sheet-percent td {
  background: #111827;
}
body.dark-mode .sheet-input.missing-value {
  background: #2a1416;
}
.alert {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  background: #e0f2fe;
  color: #075985;
}
.alert.error { background: #fee2e2; color: #991b1b; }
.alert.success { background: #dcfce7; color: #166534; }
.alert.warning { background: #ffedd5; color: #9a3412; }
.inline-form { display: inline-flex; align-items: center; margin: 0; }
.row-actions:not(td) {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  min-height: 36px;
}
td.row-actions {
  display: table-cell;
  vertical-align: middle;
  white-space: nowrap;
}
td.row-actions > .btn,
td.row-actions > .inline-form,
td.row-actions > form {
  margin: 2px 6px 2px 0;
  vertical-align: middle;
}
.actions-cell {
  height: 56px;
  align-items: center;
  vertical-align: middle;
}
.row-actions .btn,
td.row-actions .btn {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
}
td .inline-form,
td form.inline-form,
.actions-cell .inline-form,
.actions-cell form {
  display: inline-flex;
  align-items: center;
  margin: 0;
}
td .btn,
.actions-cell .btn { margin: 0; }
.name-status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 220px;
}
.name-status-line .badge {
  flex: 0 0 auto;
}
.muted { color: var(--muted); }
.text-danger { color: #dc2626; font-weight: 800; }
.text-success { color: #16a34a; font-weight: 800; }
.text-propina { color: #dc2626; font-weight: 900; }
.employee-name-compact {
  display: inline-block;
  max-width: 17ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.layout-separated > * + * {
  border-left: 1px solid var(--line);
  padding-left: 18px;
}
.google-review-qr {
  display: grid;
  place-items: center;
  gap: 16px;
  text-align: center;
}
.google-review-qr img {
  width: min(92vw, 620px);
  max-height: 76vh;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  padding: 12px;
}
.doc-share-actions {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}
.code-block {
  max-height: 340px;
  overflow: auto;
  white-space: pre-wrap;
  background: #0f172a;
  color: #e5eefb;
  border-radius: 8px;
  padding: 14px;
}
.weekly {
  min-width: 980px;
}
.turno-cell {
  display: grid;
  gap: 6px;
  min-width: 120px;
}
.turno-cell strong { font-size: 13px; }
.turno-state-baja { color: #dc2626; font-weight: 900; }
.turno-state-vacaciones { color: #16a34a; font-weight: 900; }
.turno-state-ausencia { color: #2563eb; }
.turno-state-libre,
.turno-state-manana,
.turno-state-tarde,
.turno-state-partido,
.turno-state-noche { color: #111827; }
.mini-card {
  border: 1px solid #dbe3ea;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}
.check-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}
.check-line input:checked + span,
.check-line input:disabled + span {
  color: #6b7280;
}
.small { font-size: 13px; }
.media-thumb {
  display: block;
  max-width: 180px;
  max-height: 120px;
  border-radius: 8px;
  border: 1px solid var(--line);
  object-fit: cover;
}
.media-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, .78);
}
.media-modal img {
  max-width: min(1100px, 96vw);
  max-height: 86vh;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0,0,0,.35);
}
.media-modal-close {
  position: fixed;
  top: 18px;
  right: 18px;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}
.amount-normal {
  font-weight: 500 !important;
}
.btn-sigla {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  min-height: 22px;
  border-radius: 999px;
  background: rgba(255,255,255,.22);
  color: inherit;
  font-size: 11px;
  font-weight: 900;
}
.color-swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid rgba(15,23,42,.16);
  vertical-align: middle;
  margin-right: 6px;
}
.required-help {
  display: none;
  margin-top: 5px;
  color: #b91c1c;
  font-weight: 800;
}
select:required:invalid + .required-help {
  display: block;
}
.candidate-form-grid input:not([type="checkbox"]):not([type="file"]):not([type="hidden"]),
.candidate-form-grid select {
  height: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;
  padding: 9px 11px;
  box-sizing: border-box !important;
  align-self: start !important;
}
.candidate-form-grid textarea {
  height: auto;
  min-height: 92px;
}
.candidate-form-actions,
.acreedor-movimiento-actions,
.grupo-form-actions {
  margin-top: 22px;
}
.provider-actions {
  margin-top: 18px;
  gap: 12px;
}
.provider-internal-grid input,
.provider-internal-grid select,
.provider-internal-grid textarea,
.acreedor-movimiento-form input,
.acreedor-movimiento-form select,
.grupo-form-grid input:not([type="checkbox"]):not([type="hidden"]),
.grupo-form-grid select {
  height: 42px !important;
  min-height: 42px !important;
  width: 100%;
  box-sizing: border-box !important;
  padding: 9px 11px;
}
.provider-internal-grid textarea,
.grupo-form-grid textarea,
.acreedor-movimiento-form textarea {
  min-height: 92px;
}
.grupo-form-grid input[name="precio_por_persona"],
.grupo-form-grid input[name="menu_custom"] {
  height: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;
  box-sizing: border-box !important;
  align-self: start !important;
}
.table-bulk-actions {
  margin-bottom: 10px;
}
.calendar-lines-form table input[type="date"],
.calendar-lines-form table input[type="number"],
.calendar-lines-form table input:not([type]) {
  min-height: 34px;
  padding: 6px 8px;
}
.menu-file-btn {
  min-width: 78px;
  min-height: 34px;
  padding: 7px 10px;
}
.print-only {
  display: none;
}

@media (min-width: 920px) {
  .sidebar {
    transform: none;
  }
  .main {
    margin-left: 245px;
    margin-right: 245px;
    transition: margin-left .2s ease, margin-right .2s ease;
  }
  .menu-toggle {
    display: none;
  }
  .right-sidebar-mobile-toggle {
    display: none;
  }
  .btn-back-top {
    display: inline-flex;
    align-items: center;
  }
  .sidebar-collapse-toggle,
  .right-sidebar-toggle {
    display: inline-grid;
    place-items: center;
  }
  .topbar-actions {
    display: flex;
  }
  .topbar-actions .quick-icon {
    display: none;
  }
  .topbar-actions-mobile {
    display: none !important;
  }
  body.sidebar-collapsed .sidebar-left {
    transform: translateX(-100%);
  }
  body.sidebar-collapsed .main {
    margin-left: 0;
  }
  body.right-sidebar-collapsed .sidebar-right {
    transform: translateX(100%);
  }
  body.right-sidebar-collapsed .main {
    margin-right: 0;
  }
  .content {
    padding: 18px 18px 44px;
  }
}

@media (max-width: 919px) {
  .sidebar-collapse-toggle,
  .right-sidebar-toggle { display: none; }
  .topbar-actions:not(.topbar-actions-mobile) { display: none; }
  .topbar-actions-mobile {
    order: 2;
    display: flex;
    flex: 1 1 auto;
    justify-content: center;
    gap: 7px;
  }
  .topbar-actions-mobile .quick-icon {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    font-size: 12px;
  }
  .quick-label { display: none; }
  .quick-abbr { display: inline; }
  .topbar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .menu-toggle {
    order: 1;
  }
  .mobile-header-period {
    order: 2;
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
  }
  .btn-back-top {
    order: 2;
    margin-left: 0;
  }
  .topbar-title {
    order: 5;
    min-width: 0;
    flex: 1 1 100%;
  }
  .right-sidebar-mobile-toggle {
    order: 4;
    margin-left: auto;
    display: inline-grid;
    place-items: center;
  }
  .dashboard-period-panel .panel-header {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .dashboard-period-panel h2 {
    display: grid;
    gap: 8px;
    justify-items: center;
    width: 100%;
  }
  .dashboard-period-panel h2 .badge {
    display: inline-flex;
  }
  .dashboard-period-panel .period-nav {
    justify-content: center;
    width: 100%;
  }
  .dashboard-period-panel {
    margin-bottom: 14px;
  }
  .period-nav {
    gap: 7px;
  }
  .period-nav .btn {
    min-height: 31px;
    padding: 5px 8px;
    font-size: 12px;
  }
  .period-nav .badge {
    margin-left: 0;
    font-size: 11px;
    padding: 4px 7px;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }
  body {
    background: #fff !important;
  }
  .sidebar,
  .topbar,
  .alert,
  .horario-preview-panel,
  .content > .panel:not(.horario-print-section),
  .content > .grid,
  .horario-print-section .turno-cell a,
  .horario-print-section .turno-cell form,
  .horario-print-section .btn {
    display: none !important;
  }
  .app-shell,
  .main,
  .content {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .horario-print-section {
    display: block !important;
    box-shadow: none !important;
    border: 0 !important;
    padding: 0 !important;
  }
  .print-only {
    display: block !important;
  }
  .horario-print-title {
    margin-bottom: 10px;
  }
  .horario-print-title h2 {
    margin: 0 0 4px;
    font-size: 17px;
  }
  .horario-print-title p {
    margin: 0;
    font-weight: 800;
  }
  .horario-print-section .table-wrap {
    overflow: visible !important;
  }
  .horario-print-section table {
    width: 100% !important;
    font-size: 10px;
  }
  .horario-print-section th,
  .horario-print-section td {
    padding: 5px !important;
  }
}
@media (max-width: 720px) {
  .payment-calendar-row {
    grid-template-columns: 1fr;
  }
  .datos-restaurante-actions {
    justify-content: center;
    margin-top: 14px;
  }
}
