﻿:root {
  --bg: #f7f3eb;
  --surface: #ffffff;
  --surface-alt: #fcfaf6;
  --text: #2d2923;
  --muted: #6d6457;
  --accent: #9f7a3c;
  --accent-2: #6f5630;
  --accent-soft: #efe3ce;
  --accent-line: #d7c2a0;
  --danger: #b00020;
  --border: #e6dccb;
  --shadow: 0 10px 28px rgba(77, 60, 32, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #faf6ee 0%, #f2ecdf 100%);
}

header {
  background: linear-gradient(180deg, #fffdfa 0%, #f7f1e7 100%);
  border-bottom: 1px solid var(--accent-line);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 5;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.header-left::before {
  content: "";
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  background: url('/LTrojesLogo.png') center/contain no-repeat;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-right .secondary {
  min-width: 90px;
}

.header-right .back-btn {
  padding: 10px 14px;
  font-size: 14px;
}

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

 .page-id {
  background: #f2eadc;
  color: #5e503c;
  font-size: 12px;
  letter-spacing: 0.2px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
}

header .brand {
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--accent-2);
  line-height: 1.2;
}

header nav a {
  margin-right: 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

header nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  min-width: 0;
  flex: 1 1 360px;
}

header nav summary {
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
}

header nav summary::-webkit-details-marker {
  display: none;
}

header nav a:hover {
  color: var(--accent-2);
}

header nav summary:hover {
  color: var(--accent-2);
}

.nav-group {
  position: relative;
}

.nav-group[open] summary {
  color: var(--accent-2);
}

.nav-group .dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: rgba(255, 253, 249, 0.98);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  box-shadow: var(--shadow);
  min-width: 190px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
}

.nav-group .dropdown a {
  margin-right: 0;
}

main {
  max-width: 1100px;
  margin: 24px auto 48px;
  padding: 0 16px;
}

.card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-alt) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

h1, h2 {
  margin: 0 0 12px 0;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 18px;
  color: var(--accent-2);
}

form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  align-items: end;
  width: 100%;
}

.full-span {
  grid-column: 1 / -1;
}

.payment-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

label {
  font-size: 12px;
  color: var(--muted);
}

input, select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: #fffdfa;
  color: var(--text);
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(159, 122, 60, 0.18);
  border-color: var(--accent);
}

textarea {
  min-height: 70px;
  resize: vertical;
}

button {
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(159, 122, 60, 0.18);
  max-width: 100%;
}

button.secondary {
  background: #efe3ce;
  color: var(--text);
  box-shadow: none;
}

button.danger {
  background: var(--danger);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th, .table td {
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 10px 8px;
}

.table th {
  color: var(--accent-2);
  font-weight: 700;
}

thead {
  background: rgba(239, 227, 206, 0.45);
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--accent-2);
}

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

.icon-btn.danger {
  color: var(--danger);
  border-color: rgba(176, 0, 32, 0.22);
}

.icon-btn.warning {
  border-color: #f3e3b3;
  color: #7a5b00;
  background: transparent;
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  background: #c0c0c0;
}

.status-dot.on {
  background: #1f6f5c;
}


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

.table-toolbar input[type="search"] {
  max-width: 320px;
}

.table-page-info {
  font-size: 14px;
  color: var(--muted);
}

.table th.sortable {
  cursor: pointer;
  user-select: none;
}

.table-toolbar select {
  min-width: 160px;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eaf3ef;
  color: var(--accent-2);
  font-size: 12px;
}

.badge.inactive {
  background: #fde7ea;
  color: #9b1c31;
}

.badge.active {
  background: #eaf3ef;
  color: var(--accent-2);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

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

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

@media (max-width: 640px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

.row-paid td {
  background: #e8f7ed;
  color: #1a6e3c;
}

.row-overdue td {
  background: #fde7ea;
  color: #9b1c31;
}

.row-warning td {
  background: #fff4d6;
  color: #7a5b00;
}

.text-green {
  color: #1a6e3c;
}

.text-yellow {
  color: #7a5b00;
}

.text-red {
  color: #9b1c31;
}

.pay-summary {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.pay-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
}

.total-text {
  font-weight: 700;
  font-size: 18px;
}

.card-number-inline {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.receipts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
}

.receipt-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: #fbfbf9;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.info-block {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  width: 100%;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

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

.actions-row > * {
  flex: 0 0 auto;
}

.table-card {
  overflow: hidden;
}

.receipt-panel .table {
  width: 100%;
}

.stacked-panel {
  width: 100%;
}

.table th.col-money,
.table td.col-money {
  text-align: right;
  width: 140px;
  white-space: nowrap;
}

.table th.col-date,
.table td.col-date {
  width: 140px;
  white-space: nowrap;
}

.table th.col-check,
.table td.col-check {
  text-align: center;
  width: 110px;
  white-space: nowrap;
}

.table-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

.table-scroll > .table {
  min-width: 640px;
}

.table-scroll > .table.table-compact {
  min-width: 0;
}

.table-scroll > .table.table-wide {
  min-width: 860px;
}

.table-horizontal th,
.table-horizontal td {
  white-space: nowrap;
  vertical-align: top;
}

.table-horizontal {
  width: 100%;
}

.table-horizontal input[type="text"],
.table-horizontal input[type="email"],
.table-horizontal input[type="password"] {
  min-width: 140px;
}

.table input[type="text"],
.table input[type="email"],
.table input[type="password"] {
  width: 100%;
}

.charge-card {
  margin-bottom: 16px;
}

.charge-card:last-child {
  margin-bottom: 0;
}

.notice {
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff4d6;
  color: #7a5b00;
  font-size: 14px;
  margin-top: 8px;
}

.success {
  background: #e8f7ed;
  color: #1a6e3c;
}

.error {
  background: #fde7ea;
  color: #9b1c31;
}

.relay-page {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.relay-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.relay-subtitle,
.relay-section-copy {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.relay-ip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.relay-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f5f5f0;
  min-width: 220px;
  font-weight: 600;
}

.relay-status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #a6a6a6;
  flex: 0 0 auto;
}

.relay-status.success,
.relay-status.ok {
  background: #e8f7ed;
  color: #1a6e3c;
}

.relay-status.success .relay-status-dot,
.relay-status.ok .relay-status-dot {
  background: #1a6e3c;
}

.relay-status.error {
  background: #fde7ea;
  color: #9b1c31;
}

.relay-status.error .relay-status-dot {
  background: #9b1c31;
}

.relay-status.loading {
  background: #fff4d6;
  color: #7a5b00;
}

.relay-status.loading .relay-status-dot {
  background: #d48a00;
}

.relay-sections {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.relay-section {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  background: linear-gradient(180deg, #fbfbf9 0%, #f4f4ef 100%);
}

.relay-section-head,
.relay-log-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.relay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.relay-actions button {
  min-width: 190px;
}

.relay-loader {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #ffffff;
  display: inline-block;
  animation: relay-spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

.relay-log {
  margin-top: 16px;
  min-height: 240px;
  max-height: 420px;
  overflow: auto;
  border-radius: 12px;
  background: #122018;
  color: #eef7f1;
  padding: 16px;
  font-family: "IBM Plex Mono", Consolas, monospace;
}

.relay-log-entry {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.relay-log-entry:first-child {
  padding-top: 0;
}

.relay-log-entry:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.relay-log-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #8fb8a3;
  font-size: 12px;
}

.relay-log-title {
  margin-top: 6px;
  font-weight: 700;
}

.relay-log-detail {
  margin: 8px 0 0 0;
  white-space: pre-wrap;
  color: #d8e8df;
  font-size: 13px;
}

.relay-log-entry.success .relay-log-title {
  color: #85d4a4;
}

.relay-log-entry.error .relay-log-title {
  color: #ff9fb0;
}

@keyframes relay-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 600px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 14px 16px;
  }

  .header-left::before {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  header nav a {
    margin-right: 0;
  }

  header nav {
    width: 100%;
    gap: 8px;
  }

  header nav a,
  header nav summary {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 253, 249, 0.9);
  }

  .header-right {
    width: 100%;
    justify-content: stretch;
  }

  .header-right .secondary {
    flex: 1 1 160px;
    min-width: 0;
  }

  main {
    margin-top: 16px;
    padding: 0 12px;
  }

  .card {
    padding: 16px;
  }

  h1 {
    font-size: 22px;
  }

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

  button,
  .icon-btn,
  .card-number-inline button {
    min-height: 42px;
  }

  .card-number-inline {
    flex-wrap: wrap;
  }

  .card-number-inline > input {
    min-width: 0;
    flex: 1 1 100%;
  }

  .card-number-inline > button {
    flex: 1 1 auto;
  }

  .table-scroll > .table {
    min-width: 560px;
  }

  .table-scroll > .table.table-wide {
    min-width: 760px;
  }

  .actions-row > * {
    flex: 1 1 100%;
  }

  .nav-group .dropdown {
    position: static;
    min-width: 0;
    border: none;
    box-shadow: none;
    padding: 6px 0 0 0;
  }

  .relay-hero,
  .relay-section-head,
  .relay-log-head {
    flex-direction: column;
  }

  .relay-status {
    width: 100%;
  }

  .relay-actions button {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .receipts-grid {
    grid-template-columns: 1fr;
  }
}
.openpay-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 14px;
  font-size: 12px;
  color: var(--muted);
}

.openpay-brand img {
  height: 24px;
  width: auto;
  display: block;
}

.openpay-shell {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f6f8f7 100%);
  padding: 20px;
  box-shadow: 0 14px 32px rgba(15, 61, 51, 0.08);
}

.openpay-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 20px;
  align-items: start;
}

.payment-title {
  font-size: 22px;
  margin: 0 0 10px;
  color: #153d33;
}

.payment-copy {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.card-logos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.card-logo-chip {
  border: 1px solid #d7ddd9;
  border-radius: 999px;
  padding: 6px 12px;
  background: #ffffff;
  font-size: 12px;
  font-weight: 700;
  color: #23483f;
}

.security-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #edf7f2;
  color: #1d5c47;
  font-size: 13px;
  font-weight: 600;
}

.security-pill::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #2c8a63;
}

.payment-panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #ffffff;
  padding: 16px;
}

.payment-fields {
  display: grid;
  gap: 14px;
}

.payment-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}

.payment-field input {
  min-height: 44px;
}

.field-split {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.payment-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.payment-actions button {
  min-width: 180px;
}

.payment-security-note {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 900px) {
  .openpay-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .openpay-shell {
    padding: 16px;
  }

  .field-split {
    grid-template-columns: 1fr 1fr;
  }

  .payment-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .payment-actions button {
    width: 100%;
  }

  .dt-row,
  .dt-actions {
    flex-direction: column;
  }

  .dt-actions button {
    width: 100%;
  }
}

