:root {
  --primary: #e51400;
  --primary-dark: #c01100;
  --surface: #fff;
  --canvas: #fbf8ff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --success: #107c10;
  --warning: #ff8c00;
  font-family: Inter, sans-serif;
}
*,
*::before,
*::after {
  box-sizing: border-box;
  border-radius: 0 !important;
  box-shadow: none !important;
}
html {
  scroll-padding-top: 72px;
}
body {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--surface);
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
button,
a {
  transition:
    color 0.15s,
    background-color 0.15s,
    border-color 0.15s;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
h1,
h2,
h3,
h4,
h5,
th,
label,
.btn,
.row-btn {
  letter-spacing: 0.04em;
}
h1,
h2,
h3,
h4,
h5,
.btn,
th,
label {
  text-transform: uppercase;
}
h1 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
}
h2 {
  font-size: 18px;
  font-weight: 600;
}
h3,
h4 {
  font-size: 14px;
  font-weight: 700;
}
p {
  margin: 0.5rem 0;
}
a {
  color: inherit;
  text-decoration: none;
}
.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: 400;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none !important;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: "liga";
  vertical-align: middle;
  font-variation-settings:
    "FILL" 0,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
}
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 100;
  background: #fff;
  padding: 12px;
  border: 2px solid #e51400;
}
.skip-link:focus {
  top: 8px;
}
.page-main {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px;
  flex: 1;
  min-width: 0;
}
.page-path {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}
.page-path a:hover {
  color: var(--primary);
}
.page-path .session-actions {
  margin-left: auto;
  display: flex;
  gap: 16px;
}
.page-path .session-actions a {
  display: flex;
  align-items: center;
  gap: 4px;
}
.module-content {
  position: static;
  display: block;
  width: 100%;
  background: #fff;
}
.module-head,
.module-budget-heading,
.module-admin-heading,
.maintenance-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding: 0;
  border: 0;
  background: #fff;
}
.module-head > div:first-child {
  display: flex;
  align-items: center;
  gap: 12px;
}
.module-head h2 {
  font-size: 24px;
  margin: 0;
}
.back-btn {
  display: none;
}
.head-actions,
.module-budget-actions,
.module-admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.btn,
.row-btn,
.table-page-btn,
.clients-close,
.clients-dialog-header button,
.clients-pagination button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid #d1d5db;
  background: #fff;
  padding: 8px 12px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.btn:hover,
.row-btn:hover,
.table-page-btn:hover {
  background: #f3f4f6;
  border-color: #111827;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}
.btn-danger,
.red {
  color: var(--primary);
}
.btn-block {
  width: 100%;
}
.btn-dark {
  background: #111827;
  color: #fff;
}
.row-btn {
  padding: 6px;
  min-width: 32px;
  min-height: 32px;
}
.row-btn .material-symbols-outlined {
  font-size: 18px;
}
.module-toolbar,
.form-actions,
.clients-toolbar,
.personnel-toolbar,
.salary-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 0 16px;
}
.form-actions {
  margin-top: 24px;
  justify-content: flex-end;
}
.form-actions > .hint:first-child {
  margin-right: auto;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #d1d5db;
  min-width: 200px;
  max-width: 100%;
  padding: 0 12px;
}
.search-box > input {
  border: 0 !important;
  outline: 0 !important;
  min-height: 36px;
  width: 100%;
  background: transparent;
}
.module-toolbar select {
  max-width: 100%;
  min-height: 36px;
}
.summary-chip {
  font-size: 12px;
  border: 1px solid var(--line);
  padding: 8px 12px;
  display: flex;
  gap: 8px;
}
.summary-chip strong {
  font-family: "JetBrains Mono", monospace;
}
.table-wrap,
.history-table-wrap,
.clients-table-wrap,
.module-admin-table-wrap,
.salary-role-matrix-wrap,
.maintenance-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
}
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--muted);
  padding: 12px;
  border-bottom: 1px solid #d1d5db;
  background: #f3f4f6;
  white-space: nowrap;
}
td {
  font-size: 13px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
td strong,
.amount,
.money,
[data-label*="Monto"],
[data-label*="Precio"],
[data-label*="Subtotal"] {
  font-variant-numeric: tabular-nums;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #fbf8ff;
}
.actions {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: nowrap;
}
td:has(.actions) {
  width: 1%;
  white-space: nowrap;
}
.hint,
small {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.empty,
.clients-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
}
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 6px;
  background: #f3f4f6;
  border: 1px solid var(--line);
  white-space: nowrap;
}
.badge.active {
  color: var(--success);
  background: #f0fdf4;
}
.badge.inactive,
.badge.pending {
  color: #9a3412;
  background: #fff7ed;
}
.badge.mat,
.badge.mdo,
.badge.gas {
  color: #111827;
  background: #f3f4f6;
}
.progress {
  height: 4px;
  background: #e5e7eb;
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  background: #e51400;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field.full,
.full {
  grid-column: 1/-1;
}
label {
  font-size: 11px;
  font-weight: 600;
  color: #4b5563;
}
.field input,
.field select,
.field textarea,
.module-toolbar > select,
.module-toolbar > input,
select,
input[type="search"],
.maintenance-table input {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  min-height: 36px;
  padding: 8px 12px;
  max-width: 100%;
  font-size: 14px;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  outline: 1px solid var(--primary);
}
input[readonly],
input:disabled,
select:disabled {
  background: #f3f4f6;
  color: #6b7280;
}
.field textarea {
  min-height: 80px;
  resize: vertical;
}
input[type="checkbox"] {
  accent-color: #e51400;
  border: 1px solid #d1d5db;
  width: 16px;
  height: 16px;
}
.perm-check {
  display: flex;
  gap: 8px;
  align-items: center;
  text-transform: none;
  font-size: 13px;
}
.permission-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 24px;
  background: rgb(0 0 0/0.6);
  backdrop-filter: blur(4px);
}
.modal.open {
  display: flex;
}
.sub-modal {
  z-index: 70;
}
.modal-card,
.clients-admin-dialog,
.module-admin-dialog,
.module-budget-dialog {
  background: #fff;
  border: 2px solid #111827;
  width: 90vw;
  max-width: 1152px;
  max-height: 85vh;
  overflow: auto;
  padding: 0;
  margin: auto;
}
.modal-card {
  display: flex;
  flex-direction: column;
  height: 85vh;
}
.modal-head,
.clients-dialog-header,
.module-admin-dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-bottom: 2px solid #e51400;
  padding: 16px 24px;
  flex-shrink: 0;
}
.modal-head h2,
.modal-head h3 {
  margin: 0;
  font-size: 16px;
}
.modal-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #e51400;
  background: #fff;
  border: 1px solid #e5e7eb;
  min-width: 36px;
  min-height: 36px;
  cursor: pointer;
}
#modalBody,
#subModalBody,
#clientsEditorBody,
#moduleAdminDialogBody,
#moduleBudgetModalBody {
  padding: 24px;
  overflow: auto;
  min-height: 0;
}
.modal-body {
  padding: 24px;
}
dialog::backdrop {
  background: rgb(0 0 0/0.6);
  backdrop-filter: blur(4px);
}
dialog:not([open]) {
  display: none;
}
.is-hidden,
[hidden] {
  display: none !important;
}
.admin-content {
  min-width: 0;
}
.admin-content > .form-actions:first-child {
  margin-top: 0;
}
.roles-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
}
.roles-list {
  border: 1px solid var(--line);
}
.role-item {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.role-item.active {
  border-left: 3px solid #e51400;
  background: #f3f4f6;
}
.toast {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  border: 1px solid #111827;
  background: #111827;
  color: #fff;
  padding: 12px 20px;
  z-index: 100;
  font-size: 13px;
}
.toast.show {
  display: block;
}
.toast.error {
  background: #e51400;
  border-color: #e51400;
}
.table-loading,
.clients-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 96px;
  color: var(--muted);
}
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #d1d5db;
  border-top-color: #e51400;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.table-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.table-pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}
.table-page-current {
  padding: 0 8px;
}
.table-pagination-summary strong,
.table-page-current strong {
  color: #111827;
  font-weight: 600;
}
.home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 1152px;
}
.home-tile {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  border: 1px solid var(--line);
  padding: 16px;
  text-align: center;
  background: #fff;
}
.home-tile:hover {
  border-color: #e51400;
  color: #e51400;
  background: #fbf8ff;
}
.home-tile > .material-symbols-outlined {
  font-size: 36px;
}
.home-tile > span:last-child {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.today-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.today-loaded-card {
  padding: 16px;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
}
.today-loaded-card strong {
  display: block;
  font:
    600 24px "JetBrains Mono",
    monospace;
}
.today-loaded-card small,
.today-loaded-card em {
  font-size: 12px;
  font-style: normal;
  color: var(--muted);
}
.today-detail-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}
.today-desc {
  flex: 1;
}
.today-desc > *,
.today-work > * {
  display: block;
}
.login-shell {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-frame {
  width: 100%;
  max-width: 1024px;
}
.tenant-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 24px;
}
.tenant-card {
  border: 1px solid var(--line);
  background: #fff;
  min-height: 224px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  cursor: pointer;
}
.tenant-card:hover,
.tenant-card[aria-pressed="true"] {
  border: 2px solid #e51400;
}
.tenant-card img {
  width: 100%;
  height: 112px;
  object-fit: contain;
}
.tenant-card span {
  text-transform: uppercase;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.login-credentials {
  max-width: 420px;
  margin: 24px auto 0;
  border: 1px solid var(--line);
  padding: 24px;
}
.login-error {
  margin-top: 16px;
  border-left: 3px solid #e51400;
  padding: 12px;
  background: #fbf8ff;
  color: #111827;
}
.login-step-title {
  font:
    600 12px "JetBrains Mono",
    monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.login-password {
  position: relative;
}
.login-password input {
  width: 100%;
  padding-right: 48px;
}
.login-password button {
  position: absolute;
  right: 0;
  top: 0;
  width: 40px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.chart-card {
  border: 1px solid var(--line);
  padding: 16px;
  min-width: 0;
}
.chart-card h3 {
  margin: 0 0 16px;
}
.chart-box {
  position: relative;
  height: 240px;
}
.chart-mobile-select {
  display: none;
}
.rubro-filter-popover {
  position: fixed;
  z-index: 50;
  padding: 16px;
  border: 1px solid #111827;
  background: #fff;
  max-width: calc(100vw - 32px);
}
.rubro-editor-composition-scroll,
.budget-detail-scroll {
  overflow: auto;
  max-width: 100%;
}
.company-table-logo,
.company-edit-logo {
  max-width: 160px;
  min-height: 40px;
  display: flex;
  align-items: center;
}
.company-table-logo img,
.company-edit-logo img {
  max-height: 64px;
  max-width: 160px;
  object-fit: contain;
}
.salary-hour-hint {
  display: block;
  font:
    11px "JetBrains Mono",
    monospace;
  color: var(--muted);
}
.salary-role-rate {
  padding: 6px 0;
}
.salary-role-rate > div {
  display: flex;
  flex-direction: column;
}
.salary-role-summary {
  min-width: 150px;
}
.salary-special-rates > summary {
  cursor: pointer;
  font-size: 11px;
  color: #0066cc;
}
.invoice-photo-preview img,
.order-item-image img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}
@media (min-width: 768px) {
  .home-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 1100px) {
  .home-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
@media (max-width: 767px) {
  .page-main {
    padding: 16px;
  }
  .page-path {
    font-size: 11px;
    flex-wrap: wrap;
  }
  .page-path .session-actions {
    gap: 8px;
  }
  .page-path .session-actions .action-label {
    display: none;
  }
  .module-head {
    margin-bottom: 16px;
    gap: 12px;
  }
  .module-head h2,
  h1 {
    font-size: 20px;
  }
  .head-actions {
    gap: 8px;
  }
  .btn,
  .row-btn,
  .table-page-btn {
    min-height: 44px;
  }
  .head-actions .btn {
    padding: 8px;
  }
  .modal {
    padding: 16px;
  }
  .modal-card {
    width: 100%;
    height: 90vh;
    max-height: 90vh;
  }
  .modal-head {
    padding: 12px 16px;
  }
  #modalBody,
  #subModalBody {
    padding: 16px;
  }
  .form-grid,
  .roles-layout,
  .tenant-grid,
  .charts-grid {
    grid-template-columns: 1fr;
  }
  .permission-grid {
    grid-template-columns: 1fr 1fr;
  }
  .module-toolbar > * {
    max-width: 100%;
  }
  .search-box {
    flex: 1;
    min-width: 160px;
  }
  .table-pagination {
    align-items: flex-start;
  }
  .table-pagination-summary {
    width: 100%;
  }
  .chart-box {
    height: 200px;
  }
  .tenant-grid {
    gap: 16px;
  }
  .tenant-card {
    min-height: 140px;
    padding: 16px;
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
  }
  .tenant-card img {
    width: 104px;
    height: 80px;
  }
  .login-shell {
    padding: 16px;
  }
  .login-credentials {
    padding: 16px;
  }
  .today-cards-grid {
    grid-template-columns: 1fr;
  }
  .today-detail-row {
    flex-wrap: wrap;
  }
  .today-work {
    width: 100%;
    text-align: right;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media print {
  header,
  footer,
  .page-path,
  .head-actions,
  .btn,
  .row-btn,
  .toast,
  .modal,
  .table-pagination {
    display: none !important;
  }
  .page-main {
    padding: 0;
    max-width: none;
  }
  body {
    font-size: 10pt;
  }
  .table-wrap {
    overflow: visible;
    border: 0;
  }
  table {
    page-break-inside: auto;
  }
  tr {
    page-break-inside: avoid;
  }
  thead {
    display: table-header-group;
  }
}

.clients-inline {
  width: 100%;
  max-width: none;
  max-height: none;
  border: 0;
  margin: 0;
  overflow: visible;
}
.clients-inline .clients-dialog-header {
  display: none;
}
.clients-inline .clients-toolbar {
  padding: 0;
  margin: 0 0 16px;
}
.clients-inline .clients-pagination {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  font-size: 12px;
}
.clients-inline .clients-pagination > div {
  display: flex;
  gap: 8px;
}
.module-content .rubro-table-area {
  max-width: 100%;
  overflow: hidden;
}
.rubro-table-area .table-wrap {
  overflow: auto;
}
.rubro-category-header {
  cursor: pointer;
}
.rubro-table td,
.rubro-table th {
  padding: 8px;
}
.rubro-category-columns {
  position: sticky;
  top: 0;
}
.budget-page-main,
.module-budget-main,
.module-admin-main,
.maintenance-main {
  padding: 0 !important;
  max-width: 100% !important;
  width: 100%;
  margin: 0 !important;
}
.budget-page-panel {
  border: 1px solid #e5e7eb;
  background: #fff;
  margin-bottom: 16px;
  padding: 16px;
}
.budget-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.budget-panel-head h1,
.budget-panel-head h2 {
  font-size: 18px;
}
.budget-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.budget-table-wrap {
  overflow: auto;
  max-width: 100%;
}
.budget-information-form {
  margin: 0;
}
.module-admin-table-wrap {
  overflow: auto;
}
.module-admin-dialog,
.module-budget-dialog {
  padding: 0;
}
.module-budget-dialog > div:last-child {
  padding: 24px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
}
.btn .material-symbols-outlined {
  font-size: 18px;
}
.search-box > .material-symbols-outlined {
  color: #6b7280;
  font-size: 18px;
}
.salary-admin-modal,
.personnel-admin-modal {
  max-width: 1152px;
}
.home-grid.max-w-none {
  max-width: none;
}
.module-head h1 {
  max-width: 100%;
}
.module-head:has(.head-actions) {
  align-items: flex-start;
}
.module-head .head-actions {
  flex: 1;
  justify-content: flex-end;
}
.rubro-search-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.rubro-global-search {
  flex: 1;
}
.rubro-calculation-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}
.rubro-column-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
}
.rubro-table-filters {
  display: flex;
  gap: 16px;
  margin: 12px 0;
}
.rubro-table-filters > span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.rubro-filter-trigger {
  display: inline-flex;
  align-items: center;
  padding: 4px;
  border: 1px solid #e5e7eb;
  background: #fff;
}
.rubro-filter-trigger .material-symbols-outlined {
  font-size: 16px;
}
.rubro-source-filter {
  max-width: 200px;
}
@media (max-width: 767px) {
  .budget-form-grid {
    grid-template-columns: 1fr;
  }
  .module-head .head-actions {
    justify-content: flex-start;
  }
  .rubro-calculation-controls {
    width: 100%;
    flex-wrap: wrap;
  }
  .rubro-table-filters {
    flex-wrap: wrap;
    gap: 8px;
  }
  .rubro-global-search {
    min-width: 100%;
  }
  .rubro-source-filter {
    max-width: 100%;
  }
}
