:root {
  --color-white: #ffffff;
  --color-black: #151515;
  --color-red: #b51f24;
  --color-red-dark: #7f1519;
  --color-red-soft: #fff0f1;
  --color-ink: #20242a;
  --color-muted: #65707d;
  --color-line: #d8dde3;
  --color-panel: #f8fafc;
  --color-steel: #edf1f5;
  --color-warning: #f4b63f;
  --border-strong: 1px solid var(--color-line);
  --shadow-panel: 0 18px 45px rgba(20, 31, 45, 0.12);
  --shadow-control: 0 8px 18px rgba(25, 32, 42, 0.1);
  --font-main: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(216, 221, 227, 0.6) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(0deg, rgba(216, 221, 227, 0.45) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(135deg, #f7f9fb 0%, #ffffff 46%, #eef2f6 100%);
  color: var(--color-ink);
  font-family: var(--font-main);
}

button,
input {
  font: inherit;
}

a {
  text-decoration: none;
}

.screen {
  display: flex;
  min-height: 100vh;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  padding: 30px 24px 44px;
}

.screen-main {
  justify-content: flex-start;
}

.brand-header {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: min(100%, 720px);
  margin-inline: auto;
  text-align: center;
}

.brand-logo {
  width: clamp(118px, 13vw, 172px);
  height: auto;
  display: block;
  filter: drop-shadow(0 12px 18px rgba(32, 36, 42, 0.14));
}

.brand-header h1 {
  margin: 0;
  color: var(--color-red-dark);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0;
}

.profile-action {
  position: fixed;
  top: clamp(28px, 11vh, 130px);
  left: clamp(8px, 2vw, 36px);
  z-index: 90;
  display: grid;
  width: clamp(120px, 12vw, 166px);
  gap: 14px;
  overflow: hidden;
  border: var(--border-strong);
  border-radius: 10px;
  padding: 24px 10px 18px;
  color: var(--color-ink);
  background: var(--color-white);
  box-shadow: var(--shadow-panel);
  text-align: center;
  transition: transform 0.15s;
}

.profile-action::before,
.welcome-message::before {
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  content: "";
  background: linear-gradient(90deg, var(--color-red-dark), var(--color-red) 52%, var(--color-warning));
}

.profile-action:hover,
.profile-action:focus-visible {
  transform: translateY(-2px);
}

.profile-action-icon {
  display: grid;
  place-items: center;
  color: var(--color-ink);
}

.profile-action-title {
  color: var(--color-red-dark);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
}

.profile-action-cta {
  display: block;
  padding: 11px 8px;
  border: 1px solid #aab3bd;
  border-radius: 6px;
  color: var(--color-ink);
  background: linear-gradient(180deg, #ffffff, #eef2f6);
  box-shadow: var(--shadow-control);
  font-size: 12px;
  font-weight: 800;
}

.welcome-message {
  position: relative;
  display: grid;
  min-height: 96px;
  place-items: center;
  width: min(92vw, 620px);
  overflow: hidden;
  margin: 14px auto 0;
  border: var(--border-strong);
  border-radius: 10px;
  padding: 30px 24px 22px;
  background: var(--color-white);
  box-shadow: var(--shadow-panel);
  color: var(--color-ink);
  text-align: center;
  font-size: clamp(17px, 2.2vw, 22px);
  font-weight: 800;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

.login-panel,
.plate-panel,
.records-panel {
  border: var(--border-strong);
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: var(--color-white);
  box-shadow: var(--shadow-panel);
  margin-inline: auto;
}

.login-panel::before,
.plate-panel::before,
.records-panel::before,
.modal-box::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  background: linear-gradient(90deg, var(--color-red-dark), var(--color-red) 52%, var(--color-warning));
}

.login-panel::after,
.plate-panel::after,
.records-panel::after {
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 5px 9px;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  color: var(--color-muted);
  background: var(--color-panel);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.login-panel::after {
  content: "ACCESO";
}

.plate-panel::after {
  content: "TURNO ACTIVO";
}

.records-panel::after {
  content: "CONTROL";
}

.login-panel form,
.plate-panel form {
  display: grid;
  justify-items: center;
  position: relative;
  z-index: 1;
}

.login-panel {
  width: min(92vw, 360px);
  min-height: 238px;
  margin-top: 34px;
  padding: 40px 34px 28px;
}

.plate-panel {
  width: min(92vw, 620px);
  min-height: 294px;
  margin-top: 42px;
  padding: 42px 40px 30px;
}

.records-panel {
  width: min(96vw, 1020px);
  margin-top: 26px;
  padding: 42px 18px 26px;
}

.history-panel[hidden] {
  display: none;
}

.login-panel h2,
.plate-panel h2,
.records-panel h2 {
  position: relative;
  z-index: 1;
  margin: 0 0 8px;
  color: var(--color-red-dark);
  text-align: center;
  font-size: 24px;
  font-weight: 800;
}

.login-panel h2::before,
.plate-panel h2::before,
.records-panel h2::before {
  content: "";
  display: block;
  width: 46px;
  height: 4px;
  margin: 0 auto 10px;
  border-radius: 999px;
  background: var(--color-warning);
}

.field {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin: 10px auto 12px;
  color: var(--color-ink);
  font-size: 15px;
  font-weight: 800;
}

.field span {
  justify-self: start;
  width: min(100%, 260px);
  color: var(--color-muted);
  font-size: 12px;
  letter-spacing: 0;
}

.field input {
  width: min(100%, 260px);
  height: 42px;
  border: 1px solid #bfc7d0;
  border-radius: 6px;
  background: linear-gradient(180deg, #ffffff, #f9fbfd);
  color: var(--color-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  text-align: left;
  padding: 0 14px;
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
}

.field input:focus {
  border-color: var(--color-red);
  outline: 3px solid rgba(181, 31, 36, 0.15);
  outline-offset: 0;
}

.plate-field input {
  width: min(100%, 260px);
  height: 58px;
  border: 2px solid var(--color-ink);
  background:
    linear-gradient(90deg, rgba(244, 182, 63, 0.22) 0 14px, transparent 14px),
    linear-gradient(180deg, #ffffff, #f8fafc);
  text-align: center;
  font-size: 28px;
  letter-spacing: 0;
}

.plate-field span {
  justify-self: center;
  text-align: center;
}

.primary-action,
.secondary-action,
.exit-action,
.delete-action,
.danger-action,
.side-actions button {
  border: 1px solid #aab3bd;
  border-radius: 6px;
  background: linear-gradient(180deg, #ffffff, #eef2f6);
  color: var(--color-ink);
  box-shadow: var(--shadow-control);
  min-height: 74px;
  padding: 12px 22px;
  font-weight: 800;
  cursor: pointer;
}

.primary-action {
  display: block;
  min-height: 48px;
  margin: 16px auto 0;
  color: var(--color-white);
  border-color: var(--color-red-dark);
  background: linear-gradient(180deg, #c9252b, var(--color-red-dark));
  box-shadow: 0 12px 22px rgba(127, 21, 25, 0.22);
}

.secondary-action {
  display: inline-grid;
  place-items: center;
  min-height: 54px;
  margin-top: 20px;
  color: var(--color-white);
  border-color: var(--color-red-dark);
  background: linear-gradient(180deg, #c9252b, var(--color-red-dark));
  font-size: 20px;
}

.exit-action {
  min-height: 40px;
  padding: 8px 14px;
  color: var(--color-white);
  border: 1px solid var(--color-red-dark);
  background: linear-gradient(180deg, #c9252b, var(--color-red-dark));
  font-size: 14px;
}

.delete-action,
.danger-action {
  min-height: 40px;
  padding: 8px 14px;
  color: var(--color-white);
  border: 1px solid #6f1010;
  background: linear-gradient(180deg, #a51d22, #761114);
  font-size: 14px;
}

.primary-action:hover,
.primary-action:focus-visible,
.secondary-action:hover,
.secondary-action:focus-visible,
.exit-action:hover,
.exit-action:focus-visible,
.delete-action:hover,
.delete-action:focus-visible,
.danger-action:hover,
.danger-action:focus-visible {
  background: var(--color-red-dark);
  transform: translateY(-1px);
}

.side-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  width: min(92vw, 620px);
  margin-top: 26px;
}

.side-actions button {
  width: min(100%, 220px);
  min-height: 58px;
  font-size: 18px;
}

.side-actions button:hover,
.side-actions button:focus-visible {
  color: var(--color-red-dark);
  border-color: var(--color-red-dark);
  background: var(--color-red-soft);
}

.side-actions-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: min(100%, 220px);
  min-height: 58px;
  font-size: 15px;
  font-weight: 800;
  border: 1px solid #aab3bd;
  border-radius: 6px;
  background: linear-gradient(180deg, #ffffff, #eef2f6);
  color: var(--color-ink);
  box-shadow: var(--shadow-control);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  padding: 12px 14px;
  transition: color 0.15s, border-color 0.15s, background 0.15s, transform 0.15s;
}

.side-actions-link:hover,
.side-actions-link:focus-visible {
  color: var(--color-red-dark);
  border-color: var(--color-red-dark);
  background: var(--color-red-soft);
  transform: translateY(-1px);
}

.logout-action {
  min-height: 40px;
  margin-top: 22px;
  border: 1px solid #c8ced6;
  border-radius: 6px;
  padding: 9px 16px;
  color: var(--color-muted);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: none;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.logout-action:hover,
.logout-action:focus-visible {
  color: var(--color-red-dark);
  border-color: var(--color-red-dark);
  background: var(--color-red-soft);
}

.form-message {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--color-red-dark);
  text-align: center;
  font-size: 14px;
  font-weight: 800;
}

.date-box {
  display: grid;
  justify-content: center;
  gap: 8px;
  width: min(100%, 410px);
  margin-top: 28px;
  border: 1px dashed #aeb7c1;
  border-left: 5px solid var(--color-warning);
  border-radius: 8px;
  padding: 16px 18px;
  background:
    linear-gradient(90deg, rgba(244, 182, 63, 0.14), transparent 58%),
    var(--color-panel);
  text-align: center;
  font-weight: 800;
}

.date-box span {
  max-width: 340px;
  color: var(--color-muted);
  font-size: 12px;
}

.date-box strong {
  color: var(--color-red-dark);
  font-size: 20px;
}

.records-filter {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 7px;
  width: min(100%, 360px);
  margin: 18px auto 2px;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 800;
}

.records-filter input {
  width: 100%;
  height: 46px;
  border: 1px solid #bfc7d0;
  border-left: 5px solid var(--color-warning);
  border-radius: 7px;
  padding: 0 14px;
  color: var(--color-ink);
  background:
    linear-gradient(90deg, rgba(244, 182, 63, 0.12), transparent 48%),
    linear-gradient(180deg, #ffffff, #f8fafc);
  box-shadow: var(--shadow-control);
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
}

.records-filter input:focus {
  border-color: var(--color-red);
  border-left-color: var(--color-warning);
  outline: 3px solid rgba(181, 31, 36, 0.15);
}

.report-link {
  width: min(92vw, 330px);
}

.report-panel {
  width: min(94vw, 1040px);
}

.report-filters {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr)) auto auto;
  align-items: end;
  gap: 14px;
  width: 100%;
  margin-top: 22px;
  padding: 16px;
  border: 1px solid var(--color-line);
  border-radius: 8px;
  background: var(--color-panel);
}

.report-filters label {
  display: grid;
  gap: 7px;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 800;
}

.report-filters input {
  height: 46px;
  border: 1px solid #bfc7d0;
  border-radius: 7px;
  padding: 0 12px;
  color: var(--color-ink);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  font-size: 16px;
  font-weight: 800;
}

.report-filters input:focus {
  border-color: var(--color-red);
  outline: 3px solid rgba(181, 31, 36, 0.15);
}

.report-filters .primary-action,
.report-filters .secondary-action {
  min-height: 46px;
  margin-top: 0;
  padding-inline: 16px;
  font-size: 14px;
}

.report-summary {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 1fr;
  gap: 14px;
  margin-top: 18px;
}

.report-summary article {
  min-height: 92px;
  border: 1px solid var(--color-line);
  border-left: 5px solid var(--color-warning);
  border-radius: 8px;
  padding: 16px;
  background:
    linear-gradient(90deg, rgba(244, 182, 63, 0.12), transparent 55%),
    var(--color-white);
  box-shadow: var(--shadow-control);
}

.report-summary span {
  display: block;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 800;
}

.report-summary strong {
  display: block;
  margin-top: 10px;
  color: var(--color-red-dark);
  font-size: 24px;
  font-weight: 800;
}

.monthly-reports {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

.month-report {
  display: grid;
  gap: 12px;
}

.month-report header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--color-line);
  border-radius: 8px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.month-report h3,
.month-report p {
  margin: 0;
  font-weight: 800;
}

.month-report h3 {
  color: var(--color-red-dark);
  font-size: 18px;
}

.month-report p {
  color: var(--color-ink);
  font-size: 15px;
}

.price-selector {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  width: 100%;
  margin: 24px 0 4px;
  padding: 0;
  border: 0;
}

.price-selector legend {
  width: 100%;
  margin-bottom: 6px;
  color: var(--color-muted);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.price-selector label {
  cursor: pointer;
}

.price-selector input {
  position: absolute;
  opacity: 0;
}

.price-selector span {
  display: grid;
  min-height: 62px;
  min-width: 190px;
  place-items: center;
  border: 1px solid #bfc7d0;
  border-radius: 8px;
  padding: 10px 16px;
  color: var(--color-ink);
  background:
    linear-gradient(90deg, rgba(181, 31, 36, 0.08) 0 5px, transparent 5px),
    linear-gradient(180deg, #ffffff, #f4f7fa);
  box-shadow: var(--shadow-control);
  font-size: 16px;
  font-weight: 800;
}

.price-selector input:checked + span,
.price-selector input:focus-visible + span {
  color: var(--color-white);
  border-color: var(--color-red-dark);
  background:
    linear-gradient(90deg, var(--color-warning) 0 5px, transparent 5px),
    linear-gradient(180deg, #c9252b, var(--color-red-dark));
}

.records-table-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  margin-top: 18px;
  border: 1px solid var(--color-line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-white);
}

.records-panel .records-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
  text-align: center;
}

.records-col-ticket { width: 8%; }
.records-col-plate { width: 7%; }
.records-col-date { width: 9%; }
.records-col-time { width: 8%; }
.records-col-vehicle { width: 8%; }
.records-col-price { width: 8%; }
.records-col-live-charge { width: 9%; }
.records-col-hours { width: 6%; }
.records-col-user { width: 17%; }
.records-col-exit { width: 10%; }
.records-col-delete { width: 10%; }

.records-panel .records-table th,
.records-panel .records-table td {
  border: 1px solid var(--color-line);
  padding: 10px 7px;
  color: var(--color-ink);
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 800;
}

.records-panel .records-table th {
  color: var(--color-white);
  background: linear-gradient(180deg, var(--color-red), var(--color-red-dark));
  font-size: 11px;
}

.records-panel .exit-action,
.records-panel .delete-action {
  width: 100%;
  min-height: 36px;
  padding: 7px 5px;
  font-size: 11px;
}



.records-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.records-table tbody tr:hover {
  background: #fff8e8;
}

.empty-record td {
  color: var(--color-red-dark);
  padding: 28px 10px;
  background: var(--color-panel);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  isolation: isolate;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(23, 29, 36, 0.52);
}

.modal-overlay[hidden] {
  display: none;
}

.modal-box {
  width: min(92vw, 440px);
  position: relative;
  z-index: 1001;
  overflow: hidden;
  border: var(--border-strong);
  border-radius: 8px;
  padding: 38px 24px 24px;
  background: var(--color-white);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  text-align: center;
}

.modal-box h2 {
  margin: 0 0 14px;
  color: var(--color-red-dark);
  font-size: 24px;
  font-weight: 800;
}

.charge-modal-box {
  width: min(92vw, 500px);
}

.charge-title {
  font-size: 40px;
}

.charge-summary {
  display: grid;
  gap: 10px;
  margin: 18px 0 4px;
}

.charge-summary div {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--color-line);
  border-radius: 7px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  text-align: left;
}

.charge-summary dt,
.charge-summary dd {
  margin: 0;
  font-weight: 800;
}

.charge-summary dt {
  color: var(--color-muted);
  font-size: 12px;
}

.charge-summary dd {
  color: var(--color-ink);
  font-size: 17px;
  text-align: right;
}

.charge-summary .charge-total-row {
  border-color: rgba(127, 21, 25, 0.35);
  border-left: 5px solid var(--color-warning);
  background:
    linear-gradient(90deg, rgba(244, 182, 63, 0.16), transparent 55%),
    var(--color-white);
}

.charge-total-row dd {
  color: var(--color-red-dark);
  font-size: 26px;
}

.pdf-action {
  min-height: 38px;
  border: 1px solid #aab3bd;
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--color-ink);
  background: linear-gradient(180deg, #ffffff, #eef2f6);
  box-shadow: var(--shadow-control);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.pdf-action:hover,
.pdf-action:focus-visible {
  color: var(--color-red-dark);
  border-color: var(--color-red-dark);
  background: var(--color-red-soft);
}

.modal-text {
  margin: 0 0 18px;
  color: var(--color-black);
  font-size: 18px;
  font-weight: 800;
}

.modal-field input {
  width: min(100%, 280px);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}

.modal-actions .secondary-action,
.modal-actions .danger-action {
  min-height: 48px;
  margin-top: 0;
}

/* ================================================================
   PANEL LATERAL — MODULOS (MENSUALIDADES, etc.)
   ================================================================ */

.side-module {
  position: fixed;
  left: clamp(8px, 2vw, 36px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  width: clamp(120px, 12vw, 166px);
  background: var(--color-white);
  border: var(--border-strong);
  border-radius: 10px;
  padding: 24px 10px 18px;
  box-shadow: var(--shadow-panel);
  text-align: center;
  display: grid;
  gap: 14px;
  overflow: hidden;
}

/* Barra de color superior igual que los paneles principales */
.side-module::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  background: linear-gradient(90deg, var(--color-red-dark), var(--color-red) 52%, var(--color-warning));
}

.side-module-icon {
  font-size: 36px;
  line-height: 1;
}

.side-module-title {
  margin: 0;
  color: var(--color-red-dark);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.3;
}

.side-module-link {
  display: block;
  padding: 11px 8px;
  border: 1px solid #aab3bd;
  border-radius: 6px;
  background: linear-gradient(180deg, #ffffff, #eef2f6);
  color: var(--color-ink);
  box-shadow: var(--shadow-control);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}

.side-module-link:hover,
.side-module-link:focus-visible {
  color: var(--color-red-dark);
  border-color: var(--color-red-dark);
  background: var(--color-red-soft);
  transform: translateY(-1px);
}

/* Configuración de precios: tercera tarjeta flotante bajo Mensualidades. */
.price-action {
  top: calc(50% + 260px);
}

/* ================================================================
   MENSUALIDADES — LAYOUT SUPERIOR (REGISTRO + CALENDARIO)
   ================================================================ */

.monthly-top-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  justify-content: center;
  align-items: flex-start;
  width: min(94vw, 1040px);
  margin: 28px auto 0;
}

/* Override del plate-panel para el registro de mensualidades */
.monthly-reg-panel {
  width: min(92vw, 420px) !important;
  margin-top: 0 !important;
}

.monthly-reg-panel::after {
  content: "MENSUALIDAD" !important;
}

/* Campo de fecha dentro del formulario de mensualidades */
.monthly-date-field input,
.monthly-rate-field input {
  width: min(100%, 260px);
  height: 48px;
  border: 1px solid #bfc7d0;
  border-radius: 6px;
  background: linear-gradient(180deg, #ffffff, #f9fbfd);
  color: var(--color-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  padding: 0 14px;
  font-size: 16px;
  font-weight: 700;
}

.monthly-date-field input:focus,
.monthly-rate-field input:focus {
  border-color: var(--color-red);
  outline: 3px solid rgba(181, 31, 36, 0.15);
  outline-offset: 0;
}

/* ================================================================
   CALENDARIO DE MENSUALIDADES
   ================================================================ */

.monthly-calendar-section {
  flex: 0 0 auto;
  display: grid;
  gap: 12px;
}

.monthly-calendar {
  width: min(92vw, 360px);
  border: var(--border-strong);
  border-radius: 10px;
  background: var(--color-white);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(180deg, var(--color-red), var(--color-red-dark));
  color: var(--color-white);
}

.cal-month-label {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--color-white);
}

.cal-nav-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  color: var(--color-white);
  width: 32px;
  height: 32px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  transition: background 0.12s;
}

.cal-nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  padding: 10px;
  background: var(--color-panel);
}

.cal-header-cell {
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  color: var(--color-muted);
  padding: 6px 2px 4px;
}

.cal-day {
  min-height: 44px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 4px 2px;
  background: var(--color-white);
  border: 1px solid transparent;
  cursor: default;
  transition: background 0.1s;
}

.cal-empty {
  background: transparent;
  border-color: transparent;
}

.cal-today {
  border-color: var(--color-red);
  background: var(--color-red-soft);
}

.cal-active {
  background: rgba(34, 197, 94, 0.10);
  border-color: rgba(34, 197, 94, 0.3);
}

.cal-warning-day {
  background: rgba(244, 182, 63, 0.18);
  border-color: rgba(244, 182, 63, 0.5);
}

.cal-expiry {
  background: rgba(181, 31, 36, 0.08);
  border-color: rgba(181, 31, 36, 0.35);
}

.cal-num {
  font-size: 12px;
  font-weight: 800;
  color: var(--color-ink);
  line-height: 1.4;
}

.cal-today .cal-num {
  color: var(--color-red-dark);
}

.cal-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 2px;
  justify-content: center;
}

.cal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #22c55e;
  display: block;
}

.cal-warning-day .cal-dot {
  background: var(--color-warning);
}

.cal-expiry .cal-dot {
  background: var(--color-red);
}

.cal-dot-more {
  font-size: 8px;
  font-weight: 800;
  color: var(--color-muted);
  line-height: 1;
}

/* Leyenda del calendario */
.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: center;
  padding: 6px 4px;
}

.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  color: var(--color-muted);
}

.cal-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: block;
  flex-shrink: 0;
}

.cal-legend-active  { background: #22c55e; }
.cal-legend-warning { background: var(--color-warning); }
.cal-legend-expiry  { background: var(--color-red); }
.cal-legend-today   { background: var(--color-red-dark); }

/* ================================================================
   ESTADO DE MENSUALIDAD (BADGES)
   ================================================================ */

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-active {
  color: #166534;
  background: #dcfce7;
  border: 1px solid #86efac;
}

.status-warning {
  color: #92400e;
  background: #fef3c7;
  border: 1px solid var(--color-warning);
}

.status-expired {
  color: var(--color-white);
  background: var(--color-red-dark);
  border: 1px solid var(--color-red-dark);
}

/* ================================================================
   PANELES DE MENSUALIDADES (ajustes de ancho y tabla)
   ================================================================ */

.monthly-active-panel {
  width: min(94vw, 1040px) !important;
  margin-top: 22px;
}

.monthly-history-panel {
  width: min(94vw, 1040px) !important;
  margin-top: 22px;
}

.monthly-active-table {
  min-width: 1020px;
}

.monthly-history-table {
  min-width: 860px;
}

.modal-subtext {
  margin: -8px 0 14px;
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 800;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 820px) {
  .screen {
    padding: 24px 14px 36px;
  }

  .login-panel,
  .plate-panel,
  .records-panel {
    margin-top: 24px;
  }

  .side-actions,
  .side-actions-main {
    gap: 16px;
    margin-top: 20px;
  }

  .side-actions button {
    width: min(92vw, 280px);
    min-height: 60px;
  }

  .secondary-action {
    width: min(92vw, 280px);
  }

  .plate-panel {
    padding-inline: 18px;
  }

  .records-panel {
    padding-inline: 12px;
  }

  .report-filters,
  .report-summary {
    grid-template-columns: 1fr;
  }

  .records-panel .records-table th,
  .records-panel .records-table td {
    padding: 7px 3px;
    font-size: 9px;
  }

  .records-panel .records-table th {
    font-size: 8px;
  }

  .records-panel .exit-action,
  .records-panel .delete-action {
    min-height: 28px;
    padding: 4px 2px;
    font-size: 8px;
  }

  .price-selector span {
    width: min(78vw, 260px);
  }

  .modal-actions .secondary-action,
  .modal-actions .danger-action {
    width: min(72vw, 240px);
  }

  .charge-summary div {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .charge-summary dd {
    text-align: center;
  }

  /* Ocultar panel lateral en pantallas estrechas */
  .side-module {
    display: none;
  }

  .profile-action {
    position: static;
    width: min(92vw, 320px);
    min-height: 0;
    margin-bottom: 8px;
  }
}

/* En pantallas medianas mostrar el panel lateral mas compacto */
@media (min-width: 821px) and (max-width: 1180px) {
  .profile-action {
    top: 30px;
    left: 16px;
    width: 150px;
    gap: 12px;
    padding: 26px 10px 18px;
  }

  .side-module {
    width: clamp(110px, 11vw, 150px);
    padding: 28px 10px 20px;
    gap: 12px;
  }

  .price-action {
    top: calc(50% + 205px);
  }

  .side-module-icon {
    font-size: 28px;
  }

  .side-module-title {
    font-size: 12px;
  }
}

/* En movil: mostrar el panel de modulos como fila horizontal */
@media (max-width: 820px) {
  .monthly-top-layout {
    flex-direction: column;
    align-items: center;
  }

  .monthly-reg-panel {
    width: min(92vw, 420px) !important;
  }

  .monthly-calendar {
    width: min(92vw, 340px);
  }

  .monthly-active-panel,
  .monthly-history-panel {
    width: min(94vw, 100%) !important;
  }
}
