.mw-card {
  position: relative;
  padding: 24px;
  border: 1px solid var(--mw-border);
  border-radius: var(--mw-radius-lg);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--mw-shadow);
}

.mw-card--inner {
  padding: 18px;
  border-radius: var(--mw-radius);
  box-shadow: var(--mw-shadow-sm);
}

.mw-card--metric {
  padding: 18px 20px;
  box-shadow: 0 14px 34px rgba(6, 107, 179, 0.08);
}

.mw-card--metric span {
  display: block;
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mw-card--metric strong {
  display: block;
  margin-top: 10px;
  color: #0f172a;
  font-size: 2rem;
  line-height: 1;
}

.mw-card--with-footer {
  display: flex;
  flex-direction: column;
}

.mw-card__body {
  flex: 1 1 auto;
}

.mw-panel-stack,
.mw-form,
.mw-site-card,
.mw-ticket-card,
.mw-notification-card,
.mw-empty-state {
  display: grid;
  gap: 14px;
}

.mw-form label,
.mw-form-group {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

.mw-label {
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 700;
}

.mw-help,
.mw-setting-help,
.mw-inline-status,
.mw-form small,
.mw-form .mw-help {
  color: var(--mw-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.mw-auth-card {
  padding: 28px;
  border: 1px solid var(--mw-border);
  border-radius: var(--mw-radius-lg);
  background: var(--mw-white);
  box-shadow: var(--mw-shadow);
}

.mw-alert {
  padding: 14px 16px;
  border-radius: 8px;
  margin: 16px 0;
  border: 1px solid transparent;
}

.mw-alert strong {
  color: inherit;
}

.mw-alert--error {
  background: #fff1f1;
  color: #8c1d18;
  border-color: #f5c2c0;
}

.mw-alert--success {
  background: #edf9f2;
  color: #0f6a43;
  border-color: #bfe4cf;
}

.mw-alert--muted {
  background: #eaf8ff;
  color: var(--mw-muted);
  border-color: var(--mw-border);
}

.mw-alert--warning {
  background: #fff7e8;
  color: #92400e;
  border-color: #f7d7a5;
}

.mw-alert--info {
  background: #eff8ff;
  color: #0c4a6e;
  border-color: #cfefff;
}

.mw-alert--banner {
  margin: 18px 0;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.mw-dialog-popup {
  border: 1px solid var(--mw-border);
  border-radius: 22px;
  font-family: inherit;
  box-shadow: 0 24px 70px rgba(11, 44, 69, 0.2);
}

.mw-dialog-title {
  color: var(--mw-text);
}

.mw-dialog-confirm,
.mw-dialog-cancel {
  min-width: 130px;
}

.swal2-actions {
  gap: 12px;
}

/* SweetAlert enfoca una accion al abrir el modal. Reemplazamos el contorno
   negro del navegador por un halo accesible y coherente con Miweb. */
.swal2-actions button:focus,
.swal2-actions button:focus-visible {
  outline: none !important;
  border-color: rgba(11, 143, 232, 0.58) !important;
  box-shadow: 0 0 0 4px rgba(11, 143, 232, 0.18), 0 10px 24px rgba(11, 143, 232, 0.18) !important;
}

.swal2-actions .mw-btn-danger:focus,
.swal2-actions .mw-btn-danger:focus-visible {
  border-color: rgba(239, 68, 68, 0.58) !important;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.16), 0 10px 24px rgba(239, 68, 68, 0.18) !important;
}

.mw-button,
.mw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--mw-gradient);
  color: var(--mw-white);
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--mw-shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease;
}

.mw-button:hover,
.mw-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(11, 143, 232, 0.18);
}

.mw-button:disabled,
.mw-btn:disabled {
  opacity: .65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.mw-button--ghost,
.mw-btn-outline {
  background: rgba(255, 255, 255, 0.9);
  color: var(--mw-blue-dark);
  border-color: var(--mw-border-strong);
}

.mw-button--secondary,
.mw-btn-secondary {
  background: linear-gradient(135deg, #0c75c0 0%, #14b8e6 100%);
  color: var(--mw-white);
}

.mw-btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
}

.mw-btn-success {
  background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
}

.mw-button--small,
.mw-btn-sm {
  min-height: 36px;
  padding: 8px 14px;
  font-size: 0.84rem;
}

.mw-link {
  color: var(--mw-blue-dark);
  font-weight: 700;
  text-decoration: none;
}

.mw-link:hover {
  text-decoration: underline;
}

.mw-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 10px;
  background: #eef7ff;
  border: 1px solid var(--mw-border);
  color: #0f4c81;
  font-size: 0.81rem;
  font-weight: 800;
  line-height: 1;
}

.mw-badge--status {
  color: var(--mw-blue-dark);
}

.mw-badge--soft {
  background: #f5fbff;
  color: #155e75;
}

.mw-badge--success {
  background: #edf9f2;
  color: #0f6a43;
  border-color: #bfe4cf;
}

.mw-badge--warning {
  background: #fff7e8;
  color: #92400e;
  border-color: #f7d7a5;
}

.mw-badge--danger {
  background: #fff1f1;
  color: #8c1d18;
  border-color: #f5c2c0;
}

.mw-badge--info {
  background: #ecf8ff;
  color: #0c4a6e;
  border-color: #cfefff;
}

.mw-badge--muted {
  background: #f4f7fb;
  color: #64748b;
  border-color: #dbe6ef;
}

.mw-detail-head,
.mw-action-row,
.mw-site-list__head,
.mw-app-topbar,
.mw-app-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.mw-site-list,
.mw-list-clean {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}

.mw-site-list__item,
.mw-list-clean li {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--mw-border);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.mw-site-list__actions,
.mw-table-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.mw-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.mw-detail-list {
  margin: 0;
  display: grid;
  gap: 12px;
}

.mw-detail-list > div {
  padding: 14px 16px;
  border: 1px solid var(--mw-border);
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfdff 0%, #f5fbff 100%);
}

.mw-detail-list dt {
  margin: 0 0 8px;
  color: var(--mw-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.mw-detail-list dd {
  margin: 0;
  color: #0f172a;
  font-weight: 700;
  line-height: 1.55;
  word-break: break-word;
}

.mw-detail-grid > div,
.mw-notification-admin-grid > span {
  padding: 14px 16px;
  border: 1px solid var(--mw-border);
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfdff 0%, #f5fbff 100%);
}

.mw-detail-grid dt {
  font-size: 0.82rem;
  color: var(--mw-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mw-detail-grid dd {
  margin: 8px 0 0;
  font-weight: 700;
}

.mw-inline-form {
  margin-top: 16px;
}

.mw-card-footer {
  margin-top: auto;
  flex-shrink: 0;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--mw-border);
}

.mw-card-footer__actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.mw-card-footer .mw-inline-form {
  margin-top: 0;
}

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

.mw-check,
.mw-check-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
}

.mw-check input {
  width: auto;
}

.mw-table-wrap,
.mw-table-responsive {
  overflow-x: auto;
}

.mw-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.mw-table thead th {
  padding: 13px 12px;
  border-bottom: 1px solid var(--mw-border);
  background: linear-gradient(180deg, #fbfdff 0%, #f0f8ff 100%);
  color: #3b556f;
  font-size: 0.82rem;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mw-table td {
  padding: 14px 12px;
  border-bottom: 1px solid #e8f1f8;
  text-align: left;
  vertical-align: top;
}

.mw-table tbody tr:hover {
  background: rgba(11, 143, 232, 0.04);
}

.mw-table--rich tbody tr:hover {
  background: rgba(11, 143, 232, 0.04);
}

.mw-empty-state {
  justify-items: start;
  padding: 28px;
  border: 1px dashed #c7deef;
  border-radius: 10px;
  background: linear-gradient(180deg, #fbfdff 0%, #f4faff 100%);
  color: #4b5563;
}

.mw-empty-state[hidden] {
  display: none;
}

.mw-empty-state::before {
  content: "";
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 30% 30%, rgba(34, 199, 242, 0.24), transparent 45%),
    var(--mw-gradient-soft);
  box-shadow: inset 0 0 0 1px rgba(11, 143, 232, 0.08);
}

.mw-empty-state--with-icon::before {
  display: none;
}

.mw-empty-state__icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid rgba(7, 143, 201, 0.14);
  border-radius: 8px;
  color: var(--mw-blue-dark, #08739d);
  background:
    radial-gradient(circle at 30% 30%, rgba(37, 184, 221, 0.22), transparent 48%),
    var(--mw-gradient-soft);
}

.mw-empty-state__icon svg {
  width: 29px;
  height: 29px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mw-empty-state strong {
  color: #0f172a;
  font-size: 1rem;
}

.mw-mini-list,
.mw-mini-list--quiet {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.mw-mini-list--quiet {
  color: #475569;
}

.mw-filter-grid,
.mw-stat-grid {
  display: grid;
  gap: 16px;
}

.mw-four-columns {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mw-three-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mw-admin-hero {
  background:
    radial-gradient(circle at top right, rgba(34, 199, 242, 0.18), transparent 32rem),
    linear-gradient(145deg, #ffffff 0%, #f7fbff 58%, #eef8ff 100%);
}

.mw-eyebrow {
  margin: 0 0 .35rem;
  color: #64748b;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.mw-pagination {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.mw-pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--mw-border);
  background: #fff;
  color: var(--mw-blue-dark);
  font-weight: 700;
  text-decoration: none;
}

.mw-pagination a.is-active {
  color: #fff;
  border-color: transparent;
  background: var(--mw-gradient);
}

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

.mw-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.mw-preview-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(4px);
}

.mw-preview-modal__dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1100px, 90vw);
  max-width: 1100px;
  height: min(80vh, 860px);
  overflow: hidden;
  border: 1px solid rgba(217, 237, 249, 0.95);
  border-radius: 16px;
  background: var(--mw-white);
  box-shadow: 0 32px 90px rgba(15, 23, 42, 0.28);
}

.mw-preview-modal__dialog:focus {
  outline: none;
}

.mw-preview-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--mw-border);
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.mw-preview-modal__body {
  min-height: 0;
  background: #f8fbfe;
}

.mw-preview-modal__body iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

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

@media (max-width: 720px) {
  .mw-two-columns,
  .mw-four-columns,
  .mw-three-columns {
    grid-template-columns: 1fr;
  }

  .mw-card {
    padding: 20px;
    border-radius: 20px;
  }

  .mw-card-footer {
    margin-top: 22px;
    padding-top: 16px;
  }

  .mw-preview-modal {
    padding: 8px;
  }

  .mw-preview-modal__dialog {
    width: 100%;
    height: 88vh;
    border-radius: 14px;
  }

  .mw-preview-modal__header {
    padding: 14px 16px;
  }
}
