.mraf-portal-shell,
.mraf-dashboard{
  --mraf-bg:#ffffff;
  --mraf-ink:#0f172a;
  --mraf-muted:#64748b;
  --mraf-border:#dbe5f0;
  --mraf-primary:#2563eb;
  --mraf-primary-dark:#1d4ed8;
  --mraf-success:#059669;
  --mraf-warn:#d97706;
  --mraf-danger:#dc2626;
  color:var(--mraf-ink);
}

.mraf-portal-shell{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:24px;
}

.mraf-portal-shell--guest{
  grid-template-columns:minmax(300px,380px) minmax(0,1fr);
  align-items:start;
  max-width:1120px;
  margin:0 auto;
}

.mraf-portal-card,
.mraf-portal-hero{
  padding:24px;
  border:1px solid var(--mraf-border);
  border-radius:24px;
  background:
    radial-gradient(circle at top right, rgba(37,99,235,.08), transparent 28%),
    linear-gradient(145deg, #ffffff 0%, #fbfdff 100%);
  box-shadow:0 14px 32px rgba(15,23,42,.06);
}

.mraf-portal-card--accent{
  background:
    radial-gradient(circle at top right, rgba(37,99,235,.14), transparent 34%),
    linear-gradient(145deg, #ffffff 0%, #f6faff 100%);
}

.mraf-portal-card--compact{
  max-width:760px;
}

.mraf-portal-shell--guest > .mraf-portal-card{
  align-self:start !important;
  min-height:0 !important;
  height:auto !important;
}

.mraf-portal-shell--guest .mraf-portal-card{
  display:block;
  padding:22px;
}

.mraf-portal-shell--guest .mraf-portal-card__head{
  margin-bottom:14px;
}

.mraf-portal-card__head,
.mraf-portal-hero__head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  flex-wrap:wrap;
  margin-bottom:18px;
}

.mraf-portal-card__head h3,
.mraf-portal-hero__head h2{
  margin:0 0 8px;
  font-size:28px;
  line-height:1.1;
}

.mraf-portal-card__head p,
.mraf-portal-hero__head p{
  margin:0;
  color:var(--mraf-muted);
}

.mraf-dashboard{
  display:grid;
  gap:24px;
}

.mraf-profile-shell{
  overflow:hidden;
  border:1px solid var(--mraf-border);
  border-radius:28px;
  background:#fff;
  box-shadow:0 18px 36px rgba(15,23,42,.06);
}

.mraf-profile-cover{
  min-height:150px;
  background:
    radial-gradient(circle at top left, rgba(76, 233, 210, .55), transparent 38%),
    linear-gradient(102deg, #63ead6 0%, #d8fff4 55%, #d9ff96 100%);
}

.mraf-profile-panel{
  padding:0 24px 24px;
}

.mraf-profile-header{
  display:flex;
  align-items:flex-end;
  gap:20px;
  margin-top:-52px;
  margin-bottom:22px;
  flex-wrap:wrap;
}

.mraf-profile-avatar{
  display:flex;
  align-items:center;
  justify-content:center;
  width:104px;
  height:104px;
  border:5px solid #fff;
  border-radius:999px;
  background:linear-gradient(145deg, #0f172a 0%, #334155 100%);
  box-shadow:0 14px 28px rgba(15,23,42,.14);
  color:#fff;
  font-size:34px;
  font-weight:800;
  letter-spacing:.04em;
}

.mraf-profile-identity{
  flex:1;
  min-width:260px;
}

.mraf-profile-heading{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}

.mraf-profile-heading h3{
  margin:0;
  font-size:44px;
  line-height:1.04;
  letter-spacing:-.03em;
}

.mraf-profile-chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 14px;
  border:1px solid #a7f3d0;
  border-radius:999px;
  background:#ecfdf5;
  color:#047857;
  font-size:13px;
  font-weight:700;
}

.mraf-profile-subline{
  margin:12px 0 0;
  color:var(--mraf-muted);
  font-size:16px;
}

.mraf-profile-meta{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:16px;
}

.mraf-profile-card{
  padding:24px;
  border:1px solid #e5edf6;
  border-radius:24px;
  background:#fff;
  box-shadow:0 10px 24px rgba(15,23,42,.04);
}

.mraf-profile-card__head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:18px;
  margin-bottom:18px;
  padding-bottom:18px;
  border-bottom:1px solid #edf2f7;
  flex-wrap:wrap;
}

.mraf-profile-card__head h4{
  margin:0 0 8px;
  font-size:18px;
}

.mraf-profile-card__head p{
  margin:0;
  max-width:720px;
  color:var(--mraf-muted);
}

.mraf-profile-card__head > :first-child{
  flex:1 1 320px;
  min-width:0;
}

.mraf-profile-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
  align-items:start;
}

.mraf-profile-item{
  display:grid;
  gap:4px;
  align-self:start;
  padding:14px 18px;
  border:1px solid #ecf1f7;
  border-radius:18px;
  background:#fbfdff;
}

.mraf-profile-item span{
  color:var(--mraf-muted);
  font-size:12px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.mraf-profile-item strong{
  font-size:18px;
  line-height:1.25;
  color:#111827;
  word-break:break-word;
}

.mraf-profile-editor{
  min-width:150px;
  margin-left:auto;
}

.mraf-profile-editor summary{
  display:inline-flex;
  list-style:none;
  cursor:pointer;
}

.mraf-profile-editor summary::-webkit-details-marker{
  display:none;
}

.mraf-profile-editor[open]{
  flex:1 1 100%;
  width:100%;
}

.mraf-profile-editor[open] summary{
  margin-left:auto;
}

.mraf-profile-editor__panel{
  margin-top:14px;
  padding:16px 18px;
  border:1px solid #e5edf6;
  border-radius:20px;
  background:linear-gradient(180deg, #fbfdff 0%, #f7fbff 100%);
}

.mraf-profile-form{
  width:100%;
  max-width:none;
}

.mraf-profile-editor__panel .mraf-form__grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px 14px;
  align-items:start;
}

.mraf-profile-form .mraf-field{
  display:flex !important;
  flex-direction:column !important;
  justify-content:flex-start !important;
  align-items:stretch !important;
  width:100% !important;
  min-width:0;
  min-height:0 !important;
  margin:0 !important;
  padding:0 !important;
  gap:6px !important;
  float:none !important;
  height:auto !important;
}

.mraf-profile-form .mraf-field__label{
  display:block !important;
  margin:0 !important;
  font-size:12px;
  font-weight:700;
  color:#334155;
  line-height:1.3;
}

.mraf-profile-form .mraf-field > input{
  display:block !important;
  width:100% !important;
  max-width:none !important;
  margin:0 !important;
  min-height:44px;
  padding:10px 13px;
}

.mraf-profile-form .mraf-form__grid > *{
  min-width:0;
}

.mraf-profile-editor__panel .mraf-form__actions{
  margin-top:14px;
}

.mraf-kpi-grid{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:14px;
}

.mraf-stat-card{
  padding:18px;
  border:1px solid var(--mraf-border);
  border-radius:18px;
  background:#fff;
  box-shadow:0 8px 24px rgba(15,23,42,.05);
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.mraf-stat-card:hover{
  transform:translateY(-1px);
  border-color:#cbd8ee;
  box-shadow:0 14px 30px rgba(15,23,42,.08);
}

.mraf-stat-card__label{
  color:var(--mraf-muted);
  font-size:11px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.1em;
}

.mraf-stat-card__value{
  margin-top:8px;
  font-size:26px;
  font-weight:800;
}

.mraf-promo-card{
  display:grid;
  gap:14px;
  padding:18px;
  border:1px solid #cfe0ff;
  border-radius:18px;
  background:#f8fbff;
}

.mraf-eyebrow{
  display:block;
  margin-bottom:8px;
  color:var(--mraf-muted);
  font-size:12px;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.mraf-copy-field{
  display:flex;
  align-items:center;
  gap:10px;
}

.mraf-copy-field--wide code{
  flex:1;
}

.mraf-copy-field code{
  display:block;
  padding:12px 14px;
  border-radius:14px;
  background:#fff;
  border:1px solid #dbeafe;
  color:#0f172a;
  white-space:normal;
  word-break:break-all;
}

.mraf-copy-btn.is-copied{
  background:#ecfdf5 !important;
  border-color:#86efac !important;
  color:#065f46 !important;
}

.mraf-promo-card__footer{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}

.mraf-detail-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:8px 12px;
  border-radius:999px;
  background:#fff;
  border:1px solid #dbeafe;
  color:#1e3a8a;
  font-size:13px;
}

.mraf-form__grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}

.mraf-form__stack{
  display:grid;
  gap:14px;
}

.mraf-field{
  display:grid;
  gap:8px;
}

.mraf-field span{
  color:#334155;
  font-size:13px;
  font-weight:700;
}

.mraf-field input,
.mraf-field select{
  width:100%;
  min-height:48px;
  padding:11px 14px;
  border:1px solid var(--mraf-border);
  border-radius:14px;
  background:#fff;
  box-sizing:border-box;
}

.mraf-field input:focus,
.mraf-field select:focus{
  border-color:rgba(37,99,235,.55);
  box-shadow:0 0 0 3px rgba(37,99,235,.12);
  outline:none;
}

.mraf-form__actions{
  margin-top:18px;
}

.mraf-form .button-primary{
  min-height:46px;
  padding:0 18px;
  border-radius:14px;
}

.mraf-portal-shell--guest .mraf-form__grid{
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr));
  align-items:start !important;
  gap:14px 16px !important;
}

.mraf-portal-shell--guest .mraf-form__stack{
  display:grid !important;
  align-content:start !important;
  gap:14px !important;
}

.mraf-portal-shell--guest .mraf-form,
.mraf-portal-shell--guest .mraf-form *{
  box-sizing:border-box;
}

.mraf-form--guest-login,
.mraf-form--guest-register{
  width:100%;
  max-width:none;
}

.mraf-form--guest-login .mraf-form__stack,
.mraf-form--guest-register .mraf-form__grid{
  width:100%;
}

.mraf-form--guest-login .mraf-field,
.mraf-form--guest-register .mraf-field,
.mraf-portal-shell--guest label.mraf-field{
  display:flex !important;
  flex-direction:column !important;
  justify-content:flex-start !important;
  align-items:stretch !important;
  width:100% !important;
  min-width:0;
  min-height:0 !important;
  margin:0 !important;
  padding:0 !important;
  gap:6px !important;
  float:none !important;
  height:auto !important;
}

.mraf-form--guest-login .mraf-field__label,
.mraf-form--guest-register .mraf-field__label,
.mraf-portal-shell--guest label.mraf-field > span{
  display:block !important;
  margin:0 !important;
  font-size:12px;
  font-weight:700;
  color:#334155;
  line-height:1.3;
}

.mraf-form--guest-login .mraf-field > input,
.mraf-form--guest-register .mraf-field > input,
.mraf-form--guest-register .mraf-field > select,
.mraf-portal-shell--guest label.mraf-field > input,
.mraf-portal-shell--guest label.mraf-field > select{
  display:block !important;
  width:100% !important;
  max-width:none !important;
  margin:0 !important;
  min-height:44px;
  padding:10px 13px;
}

.mraf-form--guest-register .mraf-form__grid > *{
  min-width:0;
}

.mraf-form--guest-register .mraf-form__grid > :last-child:nth-child(odd){
  grid-column:1 / -1;
  max-width:calc(50% - 8px);
}

.mraf-portal-shell--guest .mraf-form__actions{
  margin-top:14px;
}

.mraf-portal-shell .button,
.mraf-dashboard .button{
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.mraf-portal-shell .button:hover,
.mraf-dashboard .button:hover{
  transform:translateY(-1px);
}

.mraf-portal-shell .button-primary,
.mraf-dashboard .button-primary{
  border-color:var(--mraf-primary-dark);
  background:linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  box-shadow:0 10px 20px rgba(37,99,235,.18);
}

.mraf-table{
  border:0 !important;
  box-shadow:none !important;
}

.mraf-table-wrap{
  overflow:auto;
  border:1px solid #e7edf5;
  border-radius:18px;
  background:#fff;
}

.mraf-table-wrap .mraf-table{
  min-width:720px;
}

.mraf-table thead th{
  padding:14px 14px !important;
  border-bottom:1px solid var(--mraf-border) !important;
  background:#f8fafc;
  color:#475569;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.mraf-table tbody td{
  padding:14px 14px !important;
  border-bottom:1px solid #edf2f7 !important;
  vertical-align:middle;
}

.mraf-table tbody tr:hover td{
  background:#fbfdff;
}

.mraf-table__title{
  font-weight:700;
}

.mraf-table__sub{
  margin-top:4px;
  color:var(--mraf-muted);
  font-size:12px;
}

.mraf-mini-badges{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:6px;
}

.mraf-mini-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid transparent;
  font-size:11px;
  font-weight:700;
  letter-spacing:.03em;
}

.mraf-mini-badge.is-deposit{
  color:#1d4ed8;
  background:#eff6ff;
  border-color:#bfdbfe;
}

.mraf-mini-badge.is-full{
  color:#065f46;
  background:#ecfdf5;
  border-color:#bbf7d0;
}

.mraf-mini-badge.is-balance{
  color:#92400e;
  background:#fffbeb;
  border-color:#fde68a;
}

.mraf-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:88px;
  padding:7px 12px;
  border-radius:999px;
  border:1px solid transparent;
  font-size:12px;
  font-weight:700;
}

.mraf-badge.is-active,
.mraf-badge.is-paid,
.mraf-badge.is-success{
  color:#065f46;
  background:#ecfdf5;
  border-color:#bbf7d0;
}

.mraf-badge.is-pending,
.mraf-badge.is-processing,
.mraf-badge.is-prebook{
  color:#92400e;
  background:#fffbeb;
  border-color:#fde68a;
}

.mraf-badge.is-failed,
.mraf-badge.is-refunded,
.mraf-badge.is-inactive{
  color:#991b1b;
  background:#fef2f2;
  border-color:#fecaca;
}

.mraf-alert{
  margin-bottom:16px;
  padding:14px 16px;
  border-radius:14px;
  border:1px solid transparent;
}

.mraf-alert.is-success{
  color:#166534;
  background:#ecfdf5;
  border-color:#86efac;
}

.mraf-alert.is-error{
  color:#991b1b;
  background:#fef2f2;
  border-color:#fca5a5;
}

@media (max-width: 1024px){
  .mraf-portal-shell,
  .mraf-kpi-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .mraf-portal-shell--guest{
    grid-template-columns:1fr;
  }

  .mraf-profile-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .mraf-profile-editor__panel .mraf-form__grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media (max-width: 720px){
  .mraf-portal-shell,
  .mraf-kpi-grid,
  .mraf-form__grid{
    grid-template-columns:1fr;
  }

  .mraf-copy-field,
  .mraf-promo-card__footer{
    flex-direction:column;
    align-items:stretch;
  }

  .mraf-profile-panel{
    padding:0 18px 18px;
  }

  .mraf-form--guest-register .mraf-form__grid > :last-child:nth-child(odd){
    grid-column:auto;
    max-width:none;
  }

  .mraf-profile-header{
    margin-top:-42px;
    gap:16px;
    align-items:flex-start;
  }

  .mraf-profile-avatar{
    width:88px;
    height:88px;
    font-size:28px;
  }

  .mraf-profile-heading h3{
    font-size:34px;
  }

  .mraf-profile-card{
    padding:18px;
    border-radius:20px;
  }

  .mraf-profile-grid{
    grid-template-columns:1fr;
  }

  .mraf-profile-editor__panel .mraf-form__grid{
    grid-template-columns:1fr;
  }

  .mraf-profile-editor{
    width:100%;
    margin-left:0;
  }

  .mraf-profile-editor summary{
    width:100%;
    justify-content:center;
  }

  .mraf-portal-card,
  .mraf-portal-hero{
    padding:20px;
    border-radius:20px;
  }
}
