/* ═══════════════════════════════════════════
   JENGA MY ACCOUNT — Public CSS v2.3
   ═══════════════════════════════════════════ */

:root {
    --jma-primary:       #2563eb;
    --jma-accent:        #0ea5e9;
    --jma-bg:            #f8fafc;
    --jma-card:          #ffffff;
    --jma-border:        #e2e8f0;
    --jma-text:          #1e293b;
    --jma-muted:         #64748b;
    --jma-light:         #94a3b8;
    --jma-r:             10px;
    --jma-side:          260px;
    --jma-font-size:     14px;
    --jma-avatar-radius: 50%;
}

*, *::before, *::after { box-sizing: border-box; }

/* ── WRAPPER ── */
.jma {
    font-size: var(--jma-font-size);
    display: flex;
    max-width: 1280px;
    margin: 0 auto;
    background: var(--jma-card);
    border-radius: var(--jma-r);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.07), 0 2px 8px rgba(0,0,0,.04);
    min-height: 560px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--jma-text);
    line-height: 1.55;
}
.jma[data-position="right"]      { flex-direction: row-reverse; }
.jma[data-position="horizontal"] { flex-direction: column; }

/* ── SIDEBAR ── */
.jma__sidebar {
    width: var(--jma-side);
    min-width: var(--jma-side);
    background: var(--jma-bg);
    border-right: 1px solid var(--jma-border);
    padding: 0;
    display: flex;
    flex-direction: column;
}
.jma[data-position="right"] .jma__sidebar      { border-right: none; border-left: 1px solid var(--jma-border); }
.jma[data-position="horizontal"] .jma__sidebar  { width: 100%; min-width: 100%; border-right: none; border-bottom: 1px solid var(--jma-border); }

/* Dark */
.jma[data-style="dark"] .jma__sidebar              { background: #1e293b; border-color: #334155; }
.jma[data-style="dark"] .jma__user-card             { border-color: #334155; }
.jma[data-style="dark"] .jma__user-name             { color: #f1f5f9; }
.jma[data-style="dark"] .jma__user-email            { color: #94a3b8; }
.jma[data-style="dark"] .jma__nav-item              { color: #94a3b8; }
.jma[data-style="dark"] .jma__nav-item:hover        { background: #334155; color: #e2e8f0; }
.jma[data-style="dark"] .jma__nav-item--active      { background: var(--jma-primary); color: #fff; border-color: transparent; }
.jma[data-style="dark"] .jma__nav-item--active .jma__nav-icon { opacity: 1; }

/* Minimal */
.jma[data-style="minimal"] .jma__sidebar            { background: #fff; border-right-color: var(--jma-border); }
.jma[data-style="minimal"] .jma__nav-item--active   { background: transparent; font-weight: 600; }

/* Glass */
.jma[data-style="glass"] .jma__sidebar {
    background: rgba(255,255,255,.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ── USER CARD ── */
.jma__user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--jma-border);
}
.jma__avatar              { border-radius: var(--jma-avatar-radius, 50%); width: 42px; height: 42px; flex-shrink: 0; }
.jma__user-info           { display: flex; flex-direction: column; min-width: 0; }
.jma__user-name           { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jma__user-email          { font-size: 11px; color: var(--jma-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── NAV ── */
.jma__nav {
    display: flex;
    flex-direction: column;
    padding: 10px 0;
    flex: 1;
    gap: 1px;
}
.jma[data-position="horizontal"] .jma__nav {
    flex-direction: row;
    padding: 0 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex: none;
}
.jma__nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 18px;
    color: var(--jma-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border: none;
    background: none;
    cursor: pointer;
    transition: all .12s;
    border-right: 2px solid transparent;
    white-space: nowrap;
    width: 100%;
    text-align: left;
}
.jma__nav-item:hover { background: rgba(0,0,0,.03); color: var(--jma-text); }
.jma__nav-item--active {
    color: var(--jma-primary);
    background: rgba(37,99,235,.07);
    border-right-color: var(--jma-primary);
}
.jma[data-position="horizontal"] .jma__nav-item {
    width: auto;
    border-right: none;
    border-bottom: 2px solid transparent;
    padding: 10px 14px;
}
.jma[data-position="horizontal"] .jma__nav-item--active {
    border-bottom-color: var(--jma-primary);
    border-right-color: transparent;
}
.jma__nav-icon            { display: flex; flex-shrink: 0; opacity: .6; transition: opacity .12s; }
.jma__nav-item--active .jma__nav-icon  { opacity: 1; }
.jma__nav-item:hover .jma__nav-icon    { opacity: .8; }
.jma__badge {
    background: var(--jma-primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding: 0 5px;
}

/* ── CONTENT AREA ── */
.jma__content {
    flex: 1;
    padding: 28px 32px;
    min-width: 0;
    overflow-y: auto;
}
.jma__section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 12px;
    flex-wrap: wrap;
}
.jma__section-header h2 { font-size: 18px; font-weight: 700; margin: 0; letter-spacing: -.02em; }

/* ── DASHBOARD ── */
.jma__dash-hero   { margin-bottom: 24px; }
.jma__dash-greet  { font-size: 22px; font-weight: 300; color: var(--jma-text); letter-spacing: -.02em; }
.jma__dash-greet strong { font-weight: 700; }
.jma__dash-sub    { font-size: 13px; color: var(--jma-muted); margin: 4px 0 0; }

.jma__stat-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}
.jma__stat-card {
    background: var(--jma-bg);
    border: 1px solid var(--jma-border);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    transition: box-shadow .15s, transform .15s, border-color .15s;
    text-align: left;
    font-family: inherit;
}
.jma__stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); transform: translateY(-1px); border-color: var(--jma-primary); }
.jma__stat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.jma__stat-icon--blue   { background: #eff6ff; color: #2563eb; }
.jma__stat-icon--amber  { background: #fffbeb; color: #d97706; }
.jma__stat-icon--green  { background: #f0fdf4; color: #16a34a; }
.jma__stat-icon--purple { background: #f5f3ff; color: #7c3aed; }
.jma__stat-num  { font-size: 24px; font-weight: 700; line-height: 1; color: var(--jma-text); display: flex; align-items: center; }
.jma__stat-lbl  { font-size: 11px; color: var(--jma-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }

/* ── PANEL (dashboard recent orders) ── */
.jma__panel {
    background: var(--jma-bg);
    border: 1px solid var(--jma-border);
    border-radius: 10px;
    overflow: hidden;
}
.jma__panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--jma-border);
}
.jma__panel-title { font-size: 13px; font-weight: 600; }

/* ── ORDER LIST (dashboard + orders page) ── */
.jma__order-list { display: flex; flex-direction: column; }
.jma__order-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--jma-border);
    cursor: pointer;
    transition: background .1s;
}
.jma__order-row:last-child { border-bottom: none; }
.jma__order-row:hover { background: rgba(37,99,235,.03); }
.jma__order-icon { color: var(--jma-muted); flex-shrink: 0; }
.jma__order-info { flex: 1; min-width: 0; }
.jma__order-num  { font-size: 13px; font-weight: 600; display: block; }
.jma__order-date { font-size: 11px; color: var(--jma-muted); }
.jma__order-total { font-size: 14px; font-weight: 600; color: var(--jma-text); white-space: nowrap; }
.jma__order-chevron { color: var(--jma-light); flex-shrink: 0; }

/* ── ORDER CARDS (orders page) ── */
.jma__order-card {
    background: var(--jma-bg);
    border: 1px solid var(--jma-border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
    transition: box-shadow .15s;
}
.jma__order-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.07); }
.jma__order-card:last-child { margin-bottom: 0; }

.jma__order-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--jma-border);
}
.jma__order-card-id {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
}
.jma__order-icon-wrap {
    width: 32px; height: 32px;
    background: #eff6ff;
    color: var(--jma-primary);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.jma__order-card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
}
.jma__order-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--jma-muted);
}
.jma__order-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}
.jma__order-card-total {
    font-size: 16px;
    font-weight: 700;
    color: var(--jma-text);
}
.jma__order-card-foot {
    padding: 10px 18px;
    border-top: 1px solid var(--jma-border);
    background: rgba(0,0,0,.01);
}

/* ── FILTER BAR ── */
.jma__filter-bar { display: flex; gap: 8px; }
.jma__select-sm {
    border: 1px solid var(--jma-border);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    background: var(--jma-card);
    color: var(--jma-text);
    outline: none;
    font-family: inherit;
    cursor: pointer;
}
.jma__select-sm:focus { border-color: var(--jma-primary); }

/* ── PROFILE HERO ── */
.jma__profile-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--jma-bg);
    border: 1px solid var(--jma-border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
}
.jma__profile-avatar    { border-radius: var(--jma-avatar-radius, 50%); width: 60px; height: 60px; flex-shrink: 0; }
.jma__profile-name      { font-size: 16px; font-weight: 700; }
.jma__profile-email     { font-size: 12px; color: var(--jma-muted); margin-top: 2px; }

/* ── FORM SECTIONS ── */
.jma__form-section { margin-bottom: 24px; }
.jma__form-section:last-of-type { margin-bottom: 0; }
.jma__form-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--jma-muted);
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--jma-border);
}

/* ── FIELD GRID ── */
.jma__field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.jma__field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.jma__field--full { grid-column: 1 / -1; }

.jma__label {
    font-size: 11px;
    font-weight: 600;
    color: var(--jma-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}
/* Los campos van a 16px, y no es una preferencia estética: por debajo de esa medida
   iOS amplía la página entera al enfocarlos y en la aplicación instalada se queda
   ampliada. Es el tamaño mínimo de un campo de texto, igual que un botón tiene un
   tamaño mínimo para poder pulsarlo. El resto del panel conserva su escala. */
.jma__input {
    border: 1px solid var(--jma-border);
    border-radius: 7px;
    padding: 11px 13px;
    font-size: 16px;
    background: var(--jma-card);
    color: var(--jma-text);
    outline: none;
    width: 100%;
    font-family: inherit;
    transition: border-color .12s, box-shadow .12s;
}
.jma__input:focus { border-color: var(--jma-primary); box-shadow: 0 0 0 3px rgba(37,99,235,.09); }
textarea.jma__input { resize: vertical; min-height: 80px; }
.jma__check-label { display: flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; }

/* ── FORM FOOTER ── */
.jma__form-footer {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--jma-border);
}

/* ── BUTTONS ── */
.jma__btn {
    background: var(--jma-primary);
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .12s, transform .12s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.jma__btn:hover          { opacity: .88; transform: translateY(-1px); }
.jma__btn--sm            { padding: 7px 16px; font-size: 12px; }
.jma__btn--ghost         { background: transparent; color: var(--jma-muted); border: 1px solid var(--jma-border); }
.jma__btn--ghost:hover   { border-color: var(--jma-primary); color: var(--jma-primary); opacity: 1; transform: none; }
.jma__text-link {
    background: none;
    border: none;
    color: var(--jma-primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: opacity .12s;
}
.jma__text-link:hover { opacity: .75; }

/* ── FORM MESSAGE ── */
.jma__msg { font-size: 12px; font-weight: 500; }
.jma__msg.ok  { color: #16a34a; }
.jma__msg.err { color: #dc2626; }

/* ── STATUS PILLS ── */
.jma__pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.jma__pill--pending    { background: #fef3c7; color: #92400e; }
.jma__pill--processing { background: #dbeafe; color: #1e40af; }
.jma__pill--shipped    { background: #e0e7ff; color: #3730a3; }
.jma__pill--completed  { background: #dcfce7; color: #166534; }
.jma__pill--cancelled  { background: #f1f5f9; color: #64748b; }
.jma__pill--refunded   { background: #fce7f3; color: #9d174d; }
.jma__pill--on-hold    { background: #fef9c3; color: #854d0e; }
.jma__pill--failed     { background: #fee2e2; color: #991b1b; }
.jma__pill--info       { background: #dbeafe; color: #1e40af; }
.jma__pill--success    { background: #dcfce7; color: #166534; }
.jma__pill--warning    { background: #fef3c7; color: #92400e; }
.jma__pill--error      { background: #fee2e2; color: #991b1b; }

/* ── ADDRESS CARDS ── */
.jma__addr-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.jma__addr-card {
    background: var(--jma-bg);
    border: 1px solid var(--jma-border);
    border-radius: 10px;
    overflow: hidden;
}
.jma__addr-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    padding: 14px 18px;
    border-bottom: 1px solid var(--jma-border);
    background: var(--jma-card);
    color: var(--jma-text);
}
.jma__addr-form {
    padding: 18px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.jma__addr-form .jma__field--full { grid-column: 1 / -1; }
.jma__addr-form .jma__form-footer { grid-column: 1 / -1; margin-top: 4px; padding-top: 14px; }

/* ── NOTIFICATIONS ── */
.jma__notif-list       { display: flex; flex-direction: column; gap: 2px; }
.jma__notif {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .1s;
    border: 1px solid transparent;
}
.jma__notif:hover        { background: var(--jma-bg); }
.jma__notif--unread      { background: rgba(37,99,235,.04); border-color: rgba(37,99,235,.1); }
.jma__notif-icon {
    width: 34px; height: 34px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}
.jma__notif-icon--info    { background: #eff6ff; color: #2563eb; }
.jma__notif-icon--success { background: #f0fdf4; color: #16a34a; }
.jma__notif-icon--warning { background: #fffbeb; color: #d97706; }
.jma__notif-icon--error   { background: #fef2f2; color: #dc2626; }
.jma__notif-body           { flex: 1; min-width: 0; }
.jma__notif-title          { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.jma__notif-msg            { font-size: 12px; color: var(--jma-muted); line-height: 1.45; margin-bottom: 4px; }
.jma__notif-time           { font-size: 11px; color: var(--jma-light); }
.jma__notif-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--jma-primary);
    flex-shrink: 0;
    margin-top: 6px;
}

/* ── DATA CARDS ── */
.jma__data-card {
    background: var(--jma-bg);
    border: 1px solid var(--jma-border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 10px;
}
.jma__data-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.jma__data-date { font-size: 11px; color: var(--jma-light); margin-left: auto; }

/* ── KV GRID ── */
.jma__kv-grid  { display: grid; gap: 0; }
.jma__kv {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid var(--jma-border);
    font-size: 12px;
    gap: 16px;
}
.jma__kv:last-child    { border-bottom: none; }
.jma__kv-key           { color: var(--jma-muted); font-weight: 500; }
.jma__kv-val           { text-align: right; font-weight: 500; }

/* ── MODAL ── */
.jma__overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center;
    z-index: 99999;
    backdrop-filter: blur(2px);
}
.jma__modal {
    background: var(--jma-card);
    border-radius: var(--jma-r);
    width: 90%; max-width: 520px;
    max-height: 80vh; overflow-y: auto;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.jma__modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.jma__modal-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.jma__modal-x { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--jma-muted); line-height: 1; padding: 4px; border-radius: 4px; }
.jma__modal-x:hover { background: var(--jma-bg); }

/* ── LOGIN ── */
.jma__login { display: flex; align-items: center; justify-content: center; padding: 40px; }
.jma__login-box { max-width: 380px; width: 100%; }
.jma__login-box h2 { font-size: 20px; font-weight: 700; margin: 0 0 20px; }
.jma__login-register { margin-top: 16px; font-size: 12px; color: var(--jma-muted); text-align: center; }
.jma__login-register a { color: var(--jma-primary); }

/* ── EMPTY STATE ── */
.jma__empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 64px 20px; color: var(--jma-light); text-align: center; }
.jma__empty svg { opacity: .35; }
.jma__empty p { margin: 14px 0 0; font-size: 14px; }

/* ── WC PASSTHROUGH ── */
.jma__wc-wrap { font-size: 14px; }
.jma__wc-wrap .woocommerce-MyAccount-navigation { display: none !important; }
.jma__wc-wrap .woocommerce-MyAccount-content { width: 100% !important; float: none !important; }

/* ── LOADING ── */
.jma__loading { display: flex; align-items: center; justify-content: center; padding: 64px; }
.jma__spinner { width: 28px; height: 28px; border: 2px solid var(--jma-border); border-top-color: var(--jma-primary); border-radius: 50%; animation: jma-spin .6s linear infinite; }
@keyframes jma-spin { to { transform: rotate(360deg); } }

/* ── IFRAME ── */
.jma__iframe { width: 100%; min-height: 500px; border: none; border-radius: 8px; }

/* ── CUSTOM CONTENT ── */
.jma__custom-content { font-size: 14px; line-height: 1.65; }
.jma__custom-content h1, .jma__custom-content h2, .jma__custom-content h3 { font-weight: 700; margin: 1em 0 .5em; }
.jma__custom-content p { margin: 0 0 .75em; }
.jma__custom-content a { color: var(--jma-primary); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .jma { flex-direction: column; }
    .jma__sidebar { width: 100%; min-width: 100%; border-right: none; border-bottom: 1px solid var(--jma-border); }
    .jma[data-position="right"] .jma__sidebar { border-left: none; border-bottom: 1px solid var(--jma-border); }
    .jma__user-card { padding: 14px 16px 12px; }
    .jma__nav { flex-direction: row; overflow-x: auto; padding: 0 10px; flex: none; }
    .jma__nav-item { width: auto; border-right: none; border-bottom: 2px solid transparent; padding: 10px 12px; font-size: 12px; }
    .jma__nav-item--active { border-right-color: transparent; border-bottom-color: var(--jma-primary); }
    .jma__nav-label { display: none; }
    .jma__content { padding: 20px 16px; }
    .jma__stat-row { grid-template-columns: 1fr 1fr; }
    .jma__field-grid { grid-template-columns: 1fr; }
    .jma__addr-grid { grid-template-columns: 1fr; }
    .jma__addr-form { grid-template-columns: 1fr; }
    .jma__addr-form .jma__field--full { grid-column: 1; }
    .jma__addr-form .jma__form-footer { grid-column: 1; }
}
@media (max-width: 480px) {
    .jma__stat-row { grid-template-columns: 1fr 1fr; gap: 8px; }
    .jma__stat-card { padding: 12px; }
    .jma__stat-num { font-size: 20px; }
}

/* ═══════════════════════════════════
   MI AUTOESCUELA — Panel PrestaShop
   ═══════════════════════════════════ */

/* Sync badge */
.jma__sync-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--jma-muted);
    background: var(--jma-bg);
    border: 1px solid var(--jma-border);
    border-radius: 20px;
    padding: 4px 10px;
}

/* Notice boxes */
.jma__ae-notice {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 13px;
}
.jma__ae-notice--setup {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}
.jma__ae-notice--empty {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}
.jma__ae-notice strong { display: block; margin-bottom: 3px; font-size: 13px; }
.jma__ae-notice p { margin: 0; font-size: 12px; opacity: .85; }

/* ── TABS ── */
.jma__ae-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 5px;
    margin-bottom: 22px;
    background: #eef2f7;
    border-radius: 14px;
    border: 0;
}
.jma__ae-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--jma-muted);
    background: transparent;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s, box-shadow .15s;
    font-family: inherit;
}
.jma__ae-tab:hover { color: var(--jma-text); background: rgba(255,255,255,.7); }
.jma__ae-tab--active,
.jma__ae-tab--active:hover {
    color: var(--jma-primary);
    background: #fff;
    box-shadow: 0 1px 3px rgba(15,23,42,.12), 0 0 0 1px rgba(15,23,42,.04);
}
@media (max-width: 700px) {
    .jma__ae-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .jma__ae-tabs::-webkit-scrollbar { display: none; }
}

/* ── PANELS ── */
.jma__ae-panel { min-height: 160px; }

/* ── PERMISOS ── */
.jma__ae-permiso-grid,
.jma__ae-placeholder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}
.jma__ae-permiso {
    background: var(--jma-bg);
    border: 1px solid var(--jma-border);
    border-radius: 10px;
    padding: 20px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.jma__ae-permiso--active {
    background: #f0fdf4;
    border-color: #86efac;
}
.jma__ae-permiso--empty {
    opacity: .4;
}
.jma__ae-permiso-icon { color: var(--jma-primary); }
.jma__ae-permiso--active .jma__ae-permiso-icon { color: #16a34a; }
.jma__ae-permiso-name  { font-weight: 700; font-size: 15px; }
.jma__ae-permiso-tipo  { font-size: 11px; color: var(--jma-muted); }
.jma__ae-permiso-conv  { font-size: 11px; color: var(--jma-muted); }
.jma__ae-alerta {
    display: flex; align-items: center; gap: 4px;
    font-size: 11px; color: #d97706;
}

/* ── SALDO HERO ── */
.jma__ae-saldo-hero {
    background: linear-gradient(135deg, var(--jma-primary), var(--jma-accent));
    color: #fff;
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    margin-bottom: 20px;
}
.jma__ae-saldo-label { font-size: 12px; opacity: .8; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.jma__ae-saldo-num   { font-size: 36px; font-weight: 700; letter-spacing: -.02em; }

/* ── SUBSECTIONS ── */
.jma__ae-subsections { display: flex; flex-direction: column; gap: 20px; }
.jma__ae-sub-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--jma-text);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--jma-border);
}
.jma__ae-empty-row {
    color: var(--jma-light);
    font-size: 13px;
    padding: 16px;
    text-align: center;
    background: var(--jma-bg);
    border-radius: 6px;
}
.jma__ae-exam-info { font-size: 12px; color: var(--jma-muted); margin-bottom: 8px; }

/* ── AMOUNTS ── */
.jma__pos { color: #16a34a; font-weight: 600; }
.jma__neg { color: #dc2626; font-weight: 600; }
.jma__muted { color: var(--jma-muted); }

/* ── HINT ── */
.jma__ae-hint {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--jma-light);
    margin-top: 12px;
}

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
    .jma__ae-permiso-grid,
    .jma__ae-placeholder-grid { grid-template-columns: 1fr 1fr; }
    .jma__ae-saldo-num { font-size: 28px; }
}

/* ─── PACK PURCHASE BUTTONS ─── */

.jma__ae-packs {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--jma-border);
}

.jma__ae-packs-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--jma-muted);
    margin-bottom: 14px;
}

.jma__ae-packs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.jma__ae-pack-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 16px;
    background: var(--jma-bg);
    border: 1px solid var(--jma-border);
    border-radius: 10px;
    text-decoration: none;
    color: var(--jma-text);
    transition: all .15s;
    position: relative;
    overflow: hidden;
}

.jma__ae-pack-btn:hover {
    border-color: var(--jma-primary);
    background: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37,99,235,.12);
    color: var(--jma-text);
}

.jma__ae-pack-icon {
    color: var(--jma-primary);
    margin-bottom: 4px;
}

.jma__ae-pack-label {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
}

.jma__ae-pack-desc {
    font-size: 11px;
    color: var(--jma-muted);
}

.jma__ae-pack-arrow {
    position: absolute;
    bottom: 14px;
    right: 14px;
    color: var(--jma-primary);
    opacity: 0;
    transition: opacity .15s, transform .15s;
    transform: translateX(-4px);
}

.jma__ae-pack-btn:hover .jma__ae-pack-arrow {
    opacity: 1;
    transform: translateX(0);
}

@media (max-width: 600px) {
    .jma__ae-packs-grid { grid-template-columns: 1fr; }
}

/* ─── ORDER MODAL REDESIGN ─── */

.jma__order-products {
    font-size: 11px;
    color: var(--jma-muted);
    font-weight: 400;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

.jma__order-summary-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    background: var(--jma-bg);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.jma__order-summary-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.jma__order-summary-lbl {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--jma-light);
    font-weight: 600;
}

.jma__order-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--jma-muted);
    margin: 16px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--jma-border);
}

.jma__order-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.jma__order-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--jma-bg);
    border-radius: 6px;
    font-size: 13px;
}

.jma__order-item-name { flex: 1; font-weight: 500; }
.jma__order-item-qty  { color: var(--jma-muted); font-size: 12px; }
.jma__order-item-price { font-weight: 600; color: var(--jma-text); }

.jma__order-note {
    font-size: 13px;
    color: var(--jma-muted);
    background: var(--jma-bg);
    border-radius: 6px;
    padding: 10px 12px;
    margin: 0;
}

.jma__modal-foot {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--jma-border);
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 480px) {
    .jma__order-summary-row { grid-template-columns: 1fr 1fr; }
}

/* ─── NOTIFICATION THREADS & REPLIES ─── */

.jma__notif-thread {
    border: 1px solid var(--jma-border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
    background: var(--jma-card);
    transition: box-shadow .15s;
}
.jma__notif-thread:hover { box-shadow: 0 2px 8px rgba(0,0,0,.05); }

.jma__notif-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.jma__notif-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.jma__notif-reply-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--jma-muted);
}

/* Replies list */
.jma__notif-replies {
    border-top: 1px solid var(--jma-border);
    background: var(--jma-bg);
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.jma__notif-reply {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.jma__notif-reply--admin .jma__notif-reply-badge {
    background: #eff6ff;
    color: var(--jma-primary);
}

.jma__notif-reply--user .jma__notif-reply-badge {
    background: #f0fdf4;
    color: #16a34a;
    margin-left: auto;
}

.jma__notif-reply--user {
    flex-direction: row-reverse;
}

.jma__notif-reply-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.jma__notif-reply-body {
    background: var(--jma-card);
    border: 1px solid var(--jma-border);
    border-radius: 8px;
    padding: 10px 12px;
    max-width: 80%;
}

.jma__notif-reply--user .jma__notif-reply-body {
    background: #eff6ff;
    border-color: #bfdbfe;
}

/* Attachments */
.jma__notif-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.jma__notif-attachment {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--jma-primary);
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 4px;
    padding: 3px 8px;
    text-decoration: none;
}
.jma__notif-attachment:hover { background: #dbeafe; }

/* Reply form */
.jma__notif-reply-form {
    border-top: 1px solid var(--jma-border);
    padding: 12px 16px;
    background: var(--jma-bg);
}

.jma__reply-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.jma__file-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--jma-muted);
    cursor: pointer;
    padding: 6px 12px;
    border: 1px solid var(--jma-border);
    border-radius: 6px;
    transition: border-color .12s;
}
.jma__file-label:hover { border-color: var(--jma-primary); color: var(--jma-primary); }

.jma__reply-files-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex: 1;
}

.jma__reply-file-tag {
    font-size: 11px;
    background: #eff6ff;
    color: var(--jma-primary);
    border-radius: 4px;
    padding: 2px 8px;
    border: 1px solid #bfdbfe;
}

/* Reply toggle button */
.jma__notif-reply-toggle {
    display: block;
    padding: 8px 16px;
    border-top: 1px solid var(--jma-border);
    font-size: 12px;
    width: 100%;
    text-align: left;
    color: var(--jma-muted);
    background: none;
    border-left: none;
    border-right: none;
    border-bottom: none;
    cursor: pointer;
    font-family: inherit;
    transition: color .12s, background .12s;
}
.jma__notif-reply-toggle:hover {
    color: var(--jma-primary);
    background: rgba(37,99,235,.03);
}

/* ─── RICH TEXT REPLY EDITOR ─── */

.jma__fmt-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    background: var(--jma-bg);
    border: 1px solid var(--jma-border);
    border-bottom: none;
    border-radius: 7px 7px 0 0;
}

.jma__fmt-btn {
    background: none;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: var(--jma-muted);
    font-family: inherit;
    transition: background .1s, color .1s;
    line-height: 1;
}
.jma__fmt-btn:hover { background: var(--jma-border); color: var(--jma-text); }
.jma__fmt-btn strong { font-size: 13px; }
.jma__fmt-btn em { font-size: 13px; }
.jma__fmt-btn u { font-size: 13px; }

.jma__fmt-sep {
    width: 1px;
    height: 16px;
    background: var(--jma-border);
    margin: 0 4px;
}

.jma__reply-editor {
    min-height: 80px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--jma-border);
    border-bottom: none;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--jma-text);
    background: var(--jma-card);
    outline: none;
    font-family: inherit;
    line-height: 1.55;
    word-break: break-word;
}

.jma__reply-editor:focus {
    border-color: var(--jma-primary);
}

.jma__reply-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--jma-light);
    pointer-events: none;
}

.jma__reply-editor b, .jma__reply-editor strong { font-weight: 700; }
.jma__reply-editor i, .jma__reply-editor em { font-style: italic; }
.jma__reply-editor u { text-decoration: underline; }
.jma__reply-editor ul { padding-left: 20px; margin: 4px 0; }
.jma__reply-editor a { color: var(--jma-primary); }

/* Rich message display */
.jma__notif-msg--rich { line-height: 1.55; }
.jma__notif-msg--rich b, .jma__notif-msg--rich strong { font-weight: 700; }
.jma__notif-msg--rich i, .jma__notif-msg--rich em { font-style: italic; }
.jma__notif-msg--rich u { text-decoration: underline; }
.jma__notif-msg--rich ul { padding-left: 18px; margin: 4px 0; }
.jma__notif-msg--rich a { color: var(--jma-primary); }

/* Attachments area */
.jma__reply-attachments {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 12px;
    background: var(--jma-bg);
    border: 1px solid var(--jma-border);
    border-bottom: none;
}

.jma__reply-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--jma-bg);
    border: 1px solid var(--jma-border);
    border-radius: 0 0 7px 7px;
}

.jma__notif-reply-form {
    border-top: 1px solid var(--jma-border);
    padding: 12px 16px;
    background: #fafcff;
}

/* ─── AVATAR UPLOAD ─── */
.jma__avatar-upload-wrap {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}
.jma__avatar-upload-btn {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 24px;
    height: 24px;
    background: var(--jma-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .15s, opacity .15s;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.jma__avatar-upload-btn:hover { transform: scale(1.12); opacity: .9; }

/* ─── IFRAME WRAP ─── */
.jma__iframe-wrap {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--jma-border);
    background: var(--jma-bg);
}
.jma__iframe {
    width: 100%;
    min-height: 500px;
    border: none;
    display: block;
}

/* ─── FICHA DE PERMISO DETALLADA ─── */
.jma__ae-permiso-detail {
    background: #fff;
    border: 1px solid var(--jma-border, #e2e8f0);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
}
.jma__ae-pd-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}
.jma__ae-pd-badge {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: var(--jma-primary, #2563eb);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    flex-shrink: 0;
    letter-spacing: -.5px;
}
.jma__ae-pd-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 14px;
}
.jma__ae-pd-info strong { font-size: 15px; }

/* Progress bar */
.jma__ae-progress { margin: 16px 0; }
.jma__ae-progress-track {
    height: 6px;
    background: var(--jma-border, #e2e8f0);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 14px;
}
.jma__ae-progress-fill {
    height: 100%;
    background: var(--jma-primary, #2563eb);
    border-radius: 99px;
    transition: width .4s ease;
}
.jma__ae-progress-steps {
    display: flex;
    justify-content: space-between;
    gap: 4px;
}
.jma__ae-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
}
.jma__ae-step span {
    font-size: 10px;
    color: var(--jma-muted, #94a3b8);
    text-align: center;
    line-height: 1.2;
}
.jma__ae-step-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--jma-border, #e2e8f0);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}
.jma__ae-step--done .jma__ae-step-dot {
    background: var(--jma-primary, #2563eb);
    border-color: var(--jma-primary, #2563eb);
    color: #fff;
}
.jma__ae-step--done span { color: var(--jma-primary, #2563eb); font-weight: 600; }

/* Detail columns */
.jma__ae-pd-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}
@media (max-width: 600px) { .jma__ae-pd-cols { grid-template-columns: 1fr; } }
.jma__ae-pd-col {
    background: var(--jma-bg, #f8fafc);
    border-radius: 8px;
    padding: 14px;
}
.jma__ae-pd-col-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--jma-muted, #94a3b8);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}
.jma__kv-list { display: flex; flex-direction: column; gap: 8px; }
.jma__kv-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.jma__kv-key { color: var(--jma-muted, #94a3b8); }

/* Reconocimiento */
.jma__ae-pd-medico {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--jma-border, #e2e8f0);
}

/* KV grid for summary */
.jma__kv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 16px;
}
.jma__kv {
    background: #fff;
    border: 1px solid var(--jma-border, #e2e8f0);
    border-radius: 8px;
    padding: 12px 14px;
}
.jma__kv-key {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--jma-muted, #94a3b8);
    margin-bottom: 4px;
}
.jma__kv-val { font-size: 15px; font-weight: 600; }

/* Empty row */
.jma__ae-empty-row {
    padding: 12px 0;
    color: var(--jma-muted, #94a3b8);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ─── LOGIN FORM ─── */
.jma__login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 40px 16px;
    background: var(--jma-bg, #f8fafc);
}
.jma__login-box {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
    padding: 36px 32px;
}
@media (max-width: 480px) {
    .jma__login-box { padding: 28px 20px; border-radius: 12px; }
}
.jma__login-logo {
    text-align: center;
    margin-bottom: 20px;
}
.jma__login-logo img { max-height: 60px; width: auto; }
.jma__login-sitename {
    text-align: center;
    font-size: 18px;
    font-weight: 800;
    color: var(--jma-primary, #2563eb);
    margin-bottom: 20px;
    letter-spacing: -.02em;
}
.jma__login-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--jma-text, #1e293b);
    margin: 0 0 6px;
    text-align: center;
    letter-spacing: -.02em;
}
.jma__login-sub {
    font-size: 13px;
    color: var(--jma-muted, #94a3b8);
    text-align: center;
    margin: 0 0 24px;
}

/* Form fields */
.jma__lf { display: flex; flex-direction: column; gap: 16px; }
.jma__lf-field { display: flex; flex-direction: column; gap: 6px; }
.jma__lf-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--jma-text, #374151);
    display: flex;
    align-items: center;
    gap: 5px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.jma__lf-input {
    height: 46px;
    padding: 0 14px;
    border: 1.5px solid var(--jma-border, #e2e8f0);
    border-radius: 8px;
    font-size: 14px;
    color: var(--jma-text, #1e293b);
    width: 100%;
    box-sizing: border-box;
    background: #f8fafc;
    transition: border-color .15s, background .15s, box-shadow .15s;
    -webkit-appearance: none;
}
.jma__lf-input:focus {
    outline: none;
    border-color: var(--jma-primary, #2563eb);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.jma__lf-input::placeholder { color: #cbd5e1; }

/* Password wrap */
.jma__lf-pass-wrap { position: relative; }
.jma__lf-pass-wrap .jma__lf-input { padding-right: 46px; }
.jma__lf-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--jma-muted, #94a3b8);
    padding: 4px;
    display: flex;
    align-items: center;
}
.jma__lf-eye:hover { color: var(--jma-primary, #2563eb); }

/* Remember + forgot */
.jma__lf-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    margin-top: -4px;
}
.jma__lf-remember {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--jma-muted, #64748b);
    cursor: pointer;
    user-select: none;
}
.jma__lf-remember input { accent-color: var(--jma-primary, #2563eb); }
.jma__lf-forgot {
    color: var(--jma-primary, #2563eb);
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
}
.jma__lf-forgot:hover { text-decoration: underline; }

/* Submit button */
.jma__lf-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    background: var(--jma-primary, #2563eb);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, transform .1s, box-shadow .15s;
    box-shadow: 0 2px 8px rgba(37,99,235,.3);
    margin-top: 4px;
}
.jma__lf-submit:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 16px rgba(37,99,235,.4);
    transform: translateY(-1px);
}
.jma__lf-submit:active { transform: translateY(0); }
.jma__lf-submit:disabled { opacity: .65; cursor: not-allowed; transform: none; }

/* Messages */
.jma-login-msg {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 4px;
}
.jma-login-msg--ok { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.jma-login-msg--err { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

/* ─── LOGIN BACK LINK ─── */
.jma__lf-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    text-decoration: none;
    margin-bottom: 20px;
    transition: color .15s;
}
.jma__lf-back:hover { color: #2563eb; }

/* ─── JENGA LOGIN OVERLAY (shared) ─── */
#jma-back-link {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #94a3b8 !important;
    text-decoration: none !important;
    margin-bottom: 20px !important;
    transition: color .15s !important;
}
#jma-back-link:hover { color: #2563eb !important; }
#jma-lost-msg, #jma-reset-msg {
    border-radius: 8px !important;
    padding: 12px 14px !important;
    font-size: 13px !important;
    margin-bottom: 16px !important;
    border: 1px solid !important;
}
#jma-lost-msg.ok, #jma-reset-msg.ok { background:#f0fdf4 !important;color:#166534 !important;border-color:#bbf7d0 !important; }
#jma-lost-msg.err, #jma-reset-msg.err { background:#fef2f2 !important;color:#dc2626 !important;border-color:#fecaca !important; }

/* ─── MÓDULO DE CONTRATO ─── */
.jma__contrato-wrap {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.jma__contrato-info {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: var(--jma-bg, #f8fafc);
    border-radius: 10px;
    border: 1px solid var(--jma-border, #e2e8f0);
}
.jma__contrato-badge {
    width: 48px;
    height: 48px;
    background: var(--jma-primary, #2563eb);
    color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.jma__contrato-datos, .jma__contrato-preview, .jma__firma-section {
    background: #fff;
    border: 1px solid var(--jma-border, #e2e8f0);
    border-radius: 10px;
    padding: 20px;
}
.jma__contrato-datos h4, .jma__contrato-preview h4, .jma__firma-section h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--jma-text, #1e293b);
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--jma-border, #e2e8f0);
}
.jma__contrato-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.jma__contrato-text {
    font-size: 12px;
    line-height: 1.7;
    color: #475569;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 8px;
    overscroll-behavior: contain;
}
.jma__contrato-text strong { color: #1e293b; }
.jma__contrato-text p { margin: 0 0 8px; }

/* Pad de firma */
.jma__firma-canvas-wrap {
    position: relative;
    border: 2px dashed var(--jma-border, #e2e8f0);
    border-radius: 10px;
    overflow: hidden;
    background: #fafafa;
    cursor: crosshair;
    touch-action: none;
}
.jma__firma-canvas {
    display: block;
    width: 100%;
    height: 160px;
}
.jma__firma-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: 14px;
    pointer-events: none;
}
.jma__firma-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

/* Contrato firmado */
.jma__contrato-signed {
    text-align: center;
    padding: 40px 20px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
}
.jma__contrato-signed-icon {
    width: 64px;
    height: 64px;
    background: #16a34a;
    color: #fff;
    border-radius: 50%;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.jma__contrato-signed h3 { color: #166534; margin: 0 0 8px; }
.jma__contrato-meta {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin: 16px 0;
    text-align: left;
}
.jma__kv-hash {
    font-family: monospace;
    font-size: 11px;
    color: #64748b;
}

/* Tarjetas de datos (Mi autoescuela, contrato, contrato firmado, datos importados): etiqueta arriba, valor debajo, nunca se sale del cuadro */
.jma__kv-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.jma__kv-grid .jma__kv, .jma__contrato-grid .jma__kv, .jma__contrato-meta .jma__kv {
    display: block; min-width: 0; padding: 12px 14px; background: #fff;
    border: 1px solid var(--jma-border, #e2e8f0); border-radius: 10px; text-align: left;
}
.jma__kv-grid .jma__kv-key, .jma__contrato-grid .jma__kv-key, .jma__contrato-meta .jma__kv-key {
    display: block; margin: 0 0 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--jma-muted, #94a3b8);
}
.jma__kv-grid .jma__kv-val, .jma__contrato-grid .jma__kv-val, .jma__contrato-meta .jma__kv-val {
    display: block; text-align: left; font-size: 15px; font-weight: 600; color: var(--jma-text, #0f172a); overflow-wrap: anywhere; word-break: break-word; line-height: 1.35;
}
.jma__contrato-meta .jma__kv-hash { font-size: 11px; font-weight: 500; }

/* Aviso rojo: contrato por firmar */
.jma__badge--alert { background: #dc2626; box-shadow: 0 0 0 3px rgba(220,38,38,.18); animation: jmaPulse 2s ease-in-out infinite; }
@keyframes jmaPulse { 50% { box-shadow: 0 0 0 6px rgba(220,38,38,.06); } }
@media (prefers-reduced-motion: reduce) { .jma__badge--alert { animation: none; } }

/* Mi autoescuela · permiso: aire entre bloques y pasos legibles en móvil */
.jma__kv-grid + .jma__ae-permiso-detail, .jma__kv-grid + * { margin-top: 16px; }
@media (max-width: 480px) {
    .jma__ae-progress-steps { gap: 2px; }
    .jma__ae-step span { font-size: 9px; letter-spacing: -.01em; overflow-wrap: anywhere; hyphens: auto; }
    .jma__ae-permiso-detail { padding: 16px 12px; }
}

.jma__stat-sub { display:block; margin-top:4px; font-size:11.5px; color: var(--jma-muted,#64748b); line-height:1.3; }

/* ── Expediente del alumno: convocatorias, pruebas y cargos ── */
.jma-exp{margin-top:16px;padding-top:14px;border-top:1px dashed var(--jma-border,#e2e8f0);}
.jma-exp-head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:10px;}
.jma-exp-title{display:inline-flex;align-items:center;gap:6px;font-weight:700;font-size:14px;}
.jma-exp-meta{font-size:13px;color:var(--jma-muted,#64748b);}
.jma-exp-meta b{color:var(--jma-text,#0f172a);}
.jma-exp .jma__ae-alerta{align-items:flex-start;gap:6px;font-size:12.5px;line-height:1.5;padding:9px 11px;margin-bottom:8px;border-radius:9px;background:#fef2f2;border:1px solid #fecaca;color:#991b1b;}
.jma-exp .jma__ae-alerta svg{flex:0 0 auto;margin-top:2px;}
.jma-exp .jma-exp-warn{background:#fffbeb;border-color:#fde68a;color:#92400e;}
.jma-exp-tbl{margin-top:8px;}
.jma-exp-sub{margin:16px 0 8px;font-size:12px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;color:var(--jma-muted,#64748b);}
.jma-exp-cargos{display:grid;gap:10px;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));}
.jma-exp-cargo{display:flex;flex-direction:column;gap:8px;padding:12px 14px;border:1px solid var(--jma-border,#e2e8f0);border-radius:12px;background:#fff;}
.jma-exp-cargo-t{display:flex;align-items:baseline;justify-content:space-between;gap:10px;}
.jma-exp-cargo-i{font-weight:800;white-space:nowrap;}
.jma-exp-cargo-n{font-size:12px;}
.jma-exp-cargo .jma__btn{align-self:flex-start;}
.jma__ae-pack-btn .jma__ae-pack-price{display:block;margin-top:4px;font-weight:800;font-size:14px;}
.jma__ae-pack-btn .jma__ae-pack-price del{opacity:.55;font-weight:600;margin-right:4px;}
.jma__ae-pack-label .jma-tag{margin-left:6px;}


/* ── Ficha de progreso del alumno (la abre su profesor) ──
   OJO con el peso de los selectores: el tema del sitio da estilo a «button» y a los
   titulares con más fuerza que una clase suelta. Sin el contenedor delante salía un
   botón de formulario gris y unos titulares enormes en medio de la tabla. Por eso todo
   cuelga de «.jma». */

.jma .jma-prog__abrir {
    display: inline-flex; align-items: center; gap: 7px;
    width: auto; min-height: 0; max-width: 100%;
    margin: 0; padding: 0;
    border: 0 !important; border-radius: 0 !important; background: none !important;
    box-shadow: none !important; text-shadow: none;
    color: var(--jma-text); font: inherit; font-weight: 600; line-height: 1.35;
    letter-spacing: normal; text-transform: none; text-align: left; cursor: pointer;
}
.jma .jma-prog__abrir:hover, .jma .jma-prog__abrir:focus {
    background: none !important; box-shadow: none !important; color: var(--jma-primary);
}
.jma .jma-prog__abrir strong { font-weight: 600; border-bottom: 1px dashed var(--jma-border); }
.jma .jma-prog__abrir:hover strong { border-bottom-color: var(--jma-primary); }
.jma .jma-prog__flecha { flex: none; width: 13px; height: 13px; color: var(--jma-muted); transition: transform .18s; }
.jma .jma-prog__abrir[aria-expanded="true"] .jma-prog__flecha { transform: rotate(180deg); color: var(--jma-primary); }

.jma .jma-prog__fila > td { background: var(--jma-bg); padding: 18px 16px !important; text-align: left; }

/* Los rótulos de cada bloque: pequeños y en versalitas, no titulares de página. */
.jma .jma-prog__t {
    display: block; margin: 18px 0 8px; padding: 0;
    font-family: inherit; font-size: 11px; font-weight: 700; line-height: 1.4;
    letter-spacing: .09em; text-transform: uppercase; color: var(--jma-muted);
}
.jma .jma-prog__t:first-child { margin-top: 0; }

.jma .jma-prog__permisos { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; }
.jma .jma-prog__permiso {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 15px 10px 10px; border-radius: 12px;
    background: var(--jma-card); border: 1px solid var(--jma-border);
}
.jma .jma-prog__placa {
    flex: none; display: grid; place-items: center; min-width: 38px; height: 34px;
    padding: 0 9px; border-radius: 9px;
    background: var(--jma-text); color: #fff;
    font-size: 15px; font-weight: 750; line-height: 1;
}
.jma .jma-prog__ex { display: flex; flex-direction: column; gap: 3px; text-align: left; }
.jma .jma-prog__ex1 { font-size: 12px; line-height: 1.3; color: var(--jma-muted); white-space: nowrap; }
.jma .jma-prog__ex1 b { color: var(--jma-text); font-weight: 650; }
.jma .jma-prog__ex1 b.es-apto      { color: #16a34a; }
.jma .jma-prog__ex1 b.es-no_apto   { color: #dc2626; }
.jma .jma-prog__ex1 b.es-convocado { color: #c77700; }

/* La tabla de dentro no necesita su propio marco: ya está dentro de la ficha. */
.jma .jma-prog .jma-tbl-wrap { border: 0; border-radius: 10px; background: var(--jma-card); overflow: hidden; }
.jma .jma-prog .jma-tbl { margin: 0; }
.jma .jma-prog .jma-tbl th { font-size: 10.5px; padding: 10px 12px; }
.jma .jma-prog .jma-tbl td { font-size: 13px; padding: 11px 12px; }

.jma .jma-prog__tests { list-style: none; margin: 0; padding: 0; }
.jma .jma-prog__tests li {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 0; margin: 0; border-bottom: 1px solid var(--jma-border); font-size: 13px;
}
.jma .jma-prog__tests li:last-child { border-bottom: 0; }
.jma .jma-prog__tests li span { flex: none; width: 80px; color: var(--jma-muted); font-size: 12px; }
.jma .jma-prog__tests li strong { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jma .jma-prog__tests li b { flex: none; font-variant-numeric: tabular-nums; font-weight: 700; }
.jma .jma-prog__tests li b.es-apto    { color: #16a34a; }
.jma .jma-prog__tests li b.es-no_apto { color: #dc2626; }

.jma .jma-prog .jma-hint { margin: 0; font-size: 13px; color: var(--jma-muted); }

@media (max-width: 719px) {
    .jma .jma-prog__permisos { flex-direction: column; }
    .jma .jma-prog__permiso { width: 100%; }
    .jma .jma-prog__ex1 { white-space: normal; }
    .jma .jma-prog__fila > td { padding: 14px 12px !important; }
    .jma .jma-prog__tests li { flex-wrap: wrap; gap: 4px 10px; }
    .jma .jma-prog__tests li strong { flex-basis: 100%; order: 3; }
}

/* Todo lo que se escribe, a la misma medida: campos del panel, desplegables, áreas de
   texto y los del calendario. Una sola regla y sin condiciones de pantalla: el problema
   no es del móvil, es del tamaño del texto.

   El selector lleva «body» delante a propósito, no como truco. El tema del sitio da
   estilo a TODOS los campos de la página con «body input[type=text]»; el panel es un
   componente dentro de esa página y tiene que poder fijar los suyos. Enraizar el
   componente es la forma limpia de delimitar su territorio: pesa lo justo para ganar
   dentro del panel y ni una pizca fuera. La alternativa —«!important»— ganaría también
   donde no debe y dejaría el estilo imposible de ajustar después. */
body .jma input[type="text"], body .jma input[type="email"], body .jma input[type="tel"],
body .jma input[type="number"], body .jma input[type="password"], body .jma input[type="search"],
body .jma input[type="url"], body .jma input[type="date"], body .jma input[type="time"],
body .jma input[type="datetime-local"], body .jma select, body .jma textarea,
body .jma .jma__input,
body .jmc input, body .jmc select, body .jmc textarea,
body .jmc .jmc-in, body .jmc .jmc-select {
    font-size: 16px;
}
body .jmc .jmc-in, body .jmc .jmc-select { min-height: 42px; }
