:root {
  --pmt-primary: #6b0f2f;
  --pmt-primary-dark: #4a0a20;
  --pmt-gold: #c9a227;
  --pmt-bg: #f4f6f9;
  --pmt-text: #1f2937;
  --pmt-muted: #6b7280;
  --pmt-border: #e5e7eb;
}

html {
  font-size: 14px;
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--pmt-bg);
  color: var(--pmt-text);
  display: flex;
  flex-direction: column;
}

body > .container {
  flex: 1 0 auto;
  width: 100%;
}

main {
  padding-bottom: 28px;
}

.footer {
  position: static;
  flex-shrink: 0;
  width: 100%;
  min-height: 58px;
  line-height: 1.4;
  display: flex;
  align-items: center;
  background: #fff;
}

body footer.footer {
  position: static !important;
  bottom: auto !important;
  white-space: normal !important;
  line-height: 1.4 !important;
}

.navbar-brand {
  color: var(--pmt-primary) !important;
  font-weight: 900;
}

.container {
  max-width: 1380px;
}

.btn-pmt {
  min-height: 42px;
  border-color: var(--pmt-primary);
  background: var(--pmt-primary);
  color: #fff;
  font-weight: 800;
}

.btn-pmt:hover,
.btn-pmt:focus {
  border-color: var(--pmt-primary-dark);
  background: var(--pmt-primary-dark);
  color: #fff;
}

.login-shell {
  min-height: calc(100vh - 180px);
  display: grid;
  place-items: center;
  padding: 36px 0;
}

.login-panel {
  display: grid;
  width: min(100%, 430px);
  background: #fff;
  border: 1px solid var(--pmt-border);
  border-top: 6px solid var(--pmt-primary);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 16px 34px rgba(15, 23, 42, .12);
}

.login-panel .btn-pmt {
  margin-top: 16px;
}

.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 8px;
  background: var(--pmt-primary);
  color: #fff;
  font-weight: 900;
}

.login-panel h1,
.page-heading h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 900;
}

.login-panel p,
.page-heading p {
  color: var(--pmt-muted);
}

label {
  margin-top: 12px;
  margin-bottom: 6px;
  font-weight: 800;
}

.form-control,
.form-select {
  min-height: 42px;
  border-radius: 8px;
}

.work-surface {
  display: grid;
  gap: 18px;
  padding-bottom: 30px;
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -16px -12px 4px;
  padding: 18px 24px;
  border-bottom: 4px solid var(--pmt-gold);
  background: linear-gradient(135deg, var(--pmt-primary), var(--pmt-primary-dark));
  color: #fff;
}

.page-heading p {
  margin: 4px 0 0;
  color: #f4dbe4;
}

.panel {
  background: #fff;
  border: 1px solid var(--pmt-border);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
}

.panel h2 {
  margin: 0 0 14px;
  padding-left: 10px;
  border-left: 5px solid var(--pmt-gold);
  color: var(--pmt-primary);
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.pmt-alert {
  display: grid;
  gap: 3px;
  margin: 0;
  border-radius: 8px;
}

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

.content-grid {
  grid-template-columns: minmax(0, 1fr) minmax(320px, .75fr);
}

.metric {
  background: #fff;
  border: 1px solid var(--pmt-border);
  border-left: 5px solid var(--pmt-primary);
  border-radius: 8px;
  padding: 14px;
}

.metric span {
  display: block;
  color: var(--pmt-muted);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 4px;
  color: var(--pmt-primary);
  font-size: 1.15rem;
}

.metric-danger {
  border-left-color: #dc3545;
}

.metric-danger strong {
  color: #b02a37;
}

.metric-ok {
  border-left-color: #198754;
}

.metric-ok strong {
  color: #146c43;
}

.details-list {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 10px 14px;
  margin: 0;
}

.details-list dt {
  color: var(--pmt-muted);
  font-weight: 900;
}

.details-list dd {
  margin: 0;
}

.register-form {
  display: grid;
  gap: 2px;
}

.register-form .btn-pmt {
  margin-top: 16px;
}

.blocked-box,
.empty-state {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f9fafb;
  color: var(--pmt-muted);
}

.blocked-box {
  border-color: #f1aeb5;
  background: #fff5f6;
  color: #842029;
}

.table thead th {
  background: var(--pmt-primary);
  color: #fff;
  white-space: nowrap;
}

.table-responsive {
  border: 1px solid var(--pmt-border);
  border-radius: 8px;
}

.table {
  min-width: 720px;
  margin-bottom: 0;
}

.table td,
.table th {
  vertical-align: top;
}

.admin-table {
  min-width: 900px;
}

.catalog-table {
  min-width: 680px;
}

.action-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 900;
}

.status-ok {
  background: #e8f5ee;
  color: #146c43;
}

.status-off {
  background: #f3f4f6;
  color: #4b5563;
}

.status-danger,
.status-error {
  background: #f8d7da;
  color: #842029;
}

.form-panel {
  max-width: 900px;
}

.compact-form {
  max-width: 520px;
}

.admin-form {
  display: grid;
  gap: 16px;
}

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

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 38px;
}

.compact-check {
  padding-top: 0;
}

.check-row label {
  margin: 0;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pmt-modal {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
}

.pmt-modal .modal-header {
  border-bottom: 4px solid var(--pmt-gold);
  background: var(--pmt-primary);
  color: #fff;
}

.pmt-modal .modal-title {
  font-size: 1.05rem;
  font-weight: 900;
}

.pmt-modal .modal-body {
  color: var(--pmt-text);
  font-weight: 700;
}

.filter-form {
  display: grid;
  gap: 4px;
}

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

.bitacora-summary {
  margin-bottom: 10px;
  color: var(--pmt-muted);
  font-weight: 800;
}

.bitacora-table {
  min-width: 1180px;
}

.detail-cell {
  max-width: 420px;
  white-space: normal;
}

.about-grid .panel p {
  margin: 0;
  color: var(--pmt-text);
  line-height: 1.65;
}

.about-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

@media (max-width: 768px) {
  .page-heading,
  .search-row,
  .summary-grid,
  .content-grid,
  .details-list,
  .form-grid,
  .filter-grid {
    grid-template-columns: 1fr;
  }

  .page-heading {
    align-items: stretch;
    flex-direction: column;
    margin-inline: -12px;
  }

  .search-row .btn,
  .page-heading .btn {
    width: 100%;
  }

  .login-shell {
    min-height: calc(100vh - 150px);
    padding: 28px 0;
  }

  .login-panel {
    padding: 28px;
  }

  .table {
    min-width: 760px;
  }

  .admin-table {
    min-width: 900px;
  }

  .catalog-table {
    min-width: 680px;
  }

  .check-row {
    padding-top: 4px;
  }
}
