:root {
    --rme-bg: #050b12;
    --rme-bg-deep: #02060a;
    --rme-surface: rgba(255,255,255,0.035);
    --rme-surface-strong: rgba(8,18,30,0.92);
    --rme-border: rgba(0,183,255,0.16);
    --rme-border-strong: rgba(0,183,255,0.38);
    --rme-blue: #00b7ff;
    --rme-blue-soft: #35d0ff;
    --rme-green: #00ff9c;
    --rme-yellow: #ffcc00;
    --rme-red: #ff4d5f;
    --rme-text: #f4f8fb;
    --rme-muted: #a8b6c4;
    --rme-muted-2: #6f8193;
    --rme-radius: 8px;
    --rme-shadow: 0 18px 55px rgba(0,0,0,0.36);
}

/* ========================================================================== */
/* Painel Master RME-SOST — escopo exclusivo do body.rme-master               */
/* ========================================================================== */

.rme-master {
    --master-bg: #03080f;
    --master-panel: #08131f;
    --master-panel-2: #0b1826;
    --master-line: rgba(66, 198, 255, .16);
    --master-line-strong: rgba(66, 198, 255, .42);
    --master-blue: #00b7ff;
    --master-cyan: #44d7ff;
    --master-text: #f3f8fc;
    --master-muted: #94a8b9;
    --master-success: #34d399;
    --master-warning: #fbbf24;
    --master-danger: #fb7185;
    --master-radius: 14px;
    --master-radius-sm: 8px;
    --master-radius-lg: 18px;
    --master-shadow: 0 18px 45px rgba(0,0,0,.2);
    --master-space-xs: 6px;
    --master-space-sm: 10px;
    --master-space-md: 16px;
    --master-space-lg: 24px;
    color-scheme: dark;
    min-height: 100vh;
    margin: 0;
    color: var(--master-text);
    background: var(--master-bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

.rme-master *, .rme-master *::before, .rme-master *::after { box-sizing: border-box; }
.rme-master a { color: inherit; text-decoration: none; }
.rme-master button, .rme-master input, .rme-master select, .rme-master textarea { font: inherit; }
.rme-master :focus-visible { outline: 3px solid rgba(68, 215, 255, .75); outline-offset: 3px; }

.rme-master-shell { display: flex; min-height: 100vh; background: radial-gradient(circle at 88% 8%, rgba(0,183,255,.1), transparent 27rem), var(--master-bg); }
.rme-master-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; flex-direction: column; width: 280px; padding: 25px 20px 20px; border-right: 1px solid var(--master-line); background: linear-gradient(180deg, rgba(8,19,31,.98), rgba(3,9,16,.99)); box-shadow: 18px 0 50px rgba(0,0,0,.22); }
.rme-master-brand { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 4px 8px 22px; border-bottom: 1px solid var(--master-line); }
.rme-master-brand img { width: 74px; height: 48px; object-fit: cover; object-position: center 47%; filter: drop-shadow(0 0 14px rgba(0,183,255,.24)); }
.rme-master-brand span, .rme-master-brand strong, .rme-master-brand small { display: block; }
.rme-master-brand strong { font-size: 1rem; letter-spacing: .08em; }
.rme-master-brand small { margin-top: 3px; color: var(--master-muted); font-size: .66rem; letter-spacing: .03em; }
.rme-master-menu { display: grid; gap: 6px; margin-top: 27px; }
.rme-master-menu-label { padding: 0 13px 8px; color: #658096; font-size: .67rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.rme-master-menu a, .rme-master-logout { position: relative; display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 11px 13px; border: 1px solid transparent; border-radius: 10px; color: #b8c7d3; font-size: .9rem; font-weight: 650; transition: color .18s ease, border-color .18s ease, background .18s ease; }
.rme-master-menu svg, .rme-master-logout svg { width: 20px; height: 20px; flex: 0 0 auto; fill: currentColor; }
.rme-master-menu a:hover { color: #fff; border-color: var(--master-line); background: rgba(0,183,255,.07); }
.rme-master-menu a.active { color: #fff; border-color: var(--master-line-strong); background: linear-gradient(90deg, rgba(0,183,255,.2), rgba(0,183,255,.06)); box-shadow: inset 3px 0 0 var(--master-cyan), 0 8px 24px rgba(0,0,0,.16); }
.rme-master-sidebar-footer { display: grid; gap: 10px; margin-top: auto; padding-top: 20px; border-top: 1px solid var(--master-line); }
.rme-master-system-status { padding: 0 12px; color: #71899d; font-size: .7rem; }
.rme-master-system-status i { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--master-success); box-shadow: 0 0 10px rgba(52,211,153,.65); }
.rme-master-logout:hover { color: #fff; border-color: rgba(251,113,133,.25); background: rgba(251,113,133,.08); }

.rme-master-main { min-width: 0; width: calc(100% - 280px); margin-left: 280px; }
.rme-master-topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; min-height: 78px; padding: 13px clamp(22px, 3vw, 46px); border-bottom: 1px solid var(--master-line); background: rgba(3,8,15,.84); backdrop-filter: blur(12px); }
.rme-master-topbar > div:first-child > * { display: block; }
.rme-master-eyebrow { color: var(--master-cyan); font-size: .65rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.rme-master-topbar > div:first-child strong { margin-top: 2px; font-size: .95rem; }
.rme-master-user { display: flex; align-items: center; gap: 10px; }
.rme-master-user > span:last-child, .rme-master-user small, .rme-master-user strong { display: block; }
.rme-master-user small { color: var(--master-muted); font-size: .66rem; }
.rme-master-user strong { max-width: 220px; overflow: hidden; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.rme-master-avatar { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--master-line-strong); border-radius: 10px; color: var(--master-cyan); background: rgba(0,183,255,.1); font-size: .88rem; font-weight: 800; }
.rme-master-page { width: 100%; max-width: 1600px; margin: 0 auto; padding: clamp(25px, 3vw, 46px); }

.rme-master .page-header { display: flex; align-items: flex-start; justify-content: space-between; margin: 0; }
.rme-master .page-header h1 { margin: 0; color: #fff; font-size: clamp(1.7rem, 3vw, 2.35rem); line-height: 1.15; letter-spacing: -.03em; }
.rme-master .page-description, .rme-master .page-header p { max-width: 760px; margin: 9px 0 0; color: var(--master-muted); font-size: .92rem; }
.rme-master .page-actions { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; }
.rme-master .page-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.rme-master .library-stat, .rme-master .stat-card { position: relative; min-width: 0; padding: 18px 20px; overflow: hidden; border: 1px solid var(--master-line); border-radius: var(--master-radius); background: linear-gradient(145deg, rgba(12,29,45,.94), rgba(7,17,28,.94)); box-shadow: 0 15px 35px rgba(0,0,0,.16); }
.rme-master .library-stat::after, .rme-master .stat-card::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 2px; background: var(--master-blue); }
.rme-master .library-stat > *, .rme-master .stat-card > * { display: block; }
.rme-master .library-stat-label { color: var(--master-muted); font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.rme-master .library-stat-value, .rme-master .stat-card strong { margin: 3px 0; color: #fff; font-size: 1.7rem; line-height: 1.2; }
.rme-master .library-stat small, .rme-master .stat-card span { color: #71899d; font-size: .75rem; }
.rme-master .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin: 22px 0; }

.rme-master .card, .rme-master .card-table, .rme-master .question-card, .rme-master .conclusion-card { width: 100%; margin-top: 22px; padding: 22px; border: 1px solid var(--master-line); border-radius: var(--master-radius); color: var(--master-text); background: linear-gradient(145deg, rgba(10,24,38,.96), rgba(6,15,25,.96)); box-shadow: 0 18px 45px rgba(0,0,0,.2); }
.rme-master .card-table { overflow-x: auto; }
.rme-master .card h2, .rme-master .card h3 { color: #fff; }
.rme-master hr { height: 1px; margin: 28px 0; border: 0; background: var(--master-line); }
.rme-master small, .rme-master .text-muted { color: var(--master-muted); }

.rme-master label { display: block; margin: 0 0 7px; color: #cfdae3; font-size: .8rem; font-weight: 750; }
.rme-master input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), .rme-master select, .rme-master textarea { width: 100%; min-height: 44px; margin: 0 0 17px; padding: 10px 12px; border: 1px solid rgba(148,168,185,.25); border-radius: 9px; outline: 0; color: #f5f9fc; background: rgba(2,9,16,.72); transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.rme-master textarea { min-height: 130px; resize: vertical; }
.rme-master input:focus, .rme-master select:focus, .rme-master textarea:focus { border-color: var(--master-cyan); background: rgba(5,17,28,.95); box-shadow: 0 0 0 3px rgba(0,183,255,.12); }
.rme-master input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):hover, .rme-master select:hover, .rme-master textarea:hover { border-color: rgba(148,168,185,.42); }
.rme-master input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):disabled, .rme-master select:disabled, .rme-master textarea:disabled { cursor: not-allowed; opacity: .58; }
.rme-master input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):user-invalid, .rme-master select:user-invalid, .rme-master textarea:user-invalid { border-color: rgba(251,113,133,.7); }
.rme-master input::placeholder, .rme-master textarea::placeholder { color: #71899d; opacity: 1; }
.rme-master .inline-actions { display: flex; align-items: flex-start; gap: 10px; }
.rme-master .inline-actions input { margin-bottom: 0; }
.rme-master .form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 25px; }

.rme-master .btn, .rme-master .btn-primary, .rme-master .btn-secondary, .rme-master .btn-danger, .rme-master .btn-small, .rme-master button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 9px 16px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; color: #fff; background: rgba(0,183,255,.12); font-weight: 750; line-height: 1.2; transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease; }
.rme-master .btn-primary, .rme-master .btn.btn-primary, .rme-master button[type="submit"] { border-color: rgba(68,215,255,.55); background: linear-gradient(135deg, #008cc9, #00b7ff); box-shadow: 0 8px 22px rgba(0,143,210,.2); }
.rme-master .btn-primary:hover, .rme-master .btn.btn-primary:hover, .rme-master button[type="submit"]:hover { background: linear-gradient(135deg, #00a7eb, #36caff); box-shadow: 0 10px 28px rgba(0,183,255,.28); transform: translateY(-1px); }
.rme-master .btn-secondary, .rme-master .btn-small { border-color: var(--master-line-strong); color: var(--master-cyan); background: rgba(0,183,255,.06); }
.rme-master .btn-secondary:hover, .rme-master .btn-small:hover { color: #fff; background: rgba(0,183,255,.16); }
.rme-master .btn-danger { border-color: rgba(251,113,133,.5); color: #fecdd3; background: rgba(190,24,48,.32); }
.rme-master .btn-danger:hover { color: #fff; background: rgba(225,29,72,.55); }

.rme-master .table { width: 100%; min-width: 680px; border-collapse: collapse; }
.rme-master .table th { padding: 13px 15px; border-bottom: 1px solid var(--master-line-strong); color: #91a7b9; background: rgba(0,183,255,.045); text-align: left; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.rme-master .table td { padding: 14px 15px; border-bottom: 1px solid rgba(148,168,185,.1); color: #cbd6df; font-size: .87rem; vertical-align: middle; }
.rme-master .table tbody tr { transition: background .15s ease; }
.rme-master .table tbody tr:hover { background: rgba(0,183,255,.045); }
.rme-master .table tbody tr:last-child td { border-bottom: 0; }
.rme-master .table td strong { color: #fff; }
.rme-master .empty-state { padding: 38px !important; color: var(--master-muted) !important; text-align: center; }

.rme-master .badge { display: inline-flex; align-items: center; min-height: 25px; padding: 4px 10px; border: 1px solid rgba(148,168,185,.25); border-radius: 999px; color: #cbd6df; background: rgba(148,168,185,.1); font-size: .67rem; font-weight: 800; }
.rme-master .badge-success, .rme-master .badge-homologado { border-color: rgba(52,211,153,.35); color: #a7f3d0; background: rgba(16,185,129,.12); }
.rme-master .badge-warning, .rme-master .badge-test { border-color: rgba(251,191,36,.35); color: #fde68a; background: rgba(245,158,11,.12); }
.rme-master .badge-danger { border-color: rgba(251,113,133,.35); color: #fecdd3; background: rgba(225,29,72,.13); }
.rme-master .badge-info, .rme-master .badge-dev { border-color: var(--master-line-strong); color: #bae6fd; background: rgba(0,183,255,.12); }
.rme-master .sucesso, .rme-master .erro, .rme-master .alert { margin-top: 18px; padding: 13px 15px; border: 1px solid; border-radius: 10px; }
.rme-master .sucesso, .rme-master .alert-success { border-color: rgba(52,211,153,.35); color: #a7f3d0; background: rgba(16,185,129,.1); }
.rme-master .erro, .rme-master .alert-danger { border-color: rgba(251,113,133,.38); color: #fecdd3; background: rgba(225,29,72,.11); }
.rme-master .alert-warning { border-color: rgba(251,191,36,.36); color: #fde68a; background: rgba(245,158,11,.1); }
.rme-master .mt-20 { margin-top: 20px; }

/* Componentes administrativos reutilizáveis do Painel Master. */
.rme-master .rme-action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: var(--master-space-md); width: min(100%, 72rem); }
.rme-master .rme-action-card { display: flex; min-width: 0; flex-direction: column; gap: var(--master-space-sm); padding: var(--master-space-lg); overflow: hidden; border: 1px solid var(--master-line); border-radius: var(--master-radius); color: var(--master-text); background: linear-gradient(145deg, rgba(11,27,42,.97), rgba(6,16,26,.98)); box-shadow: var(--master-shadow); }
.rme-master .rme-action-card--primary { border-left: 3px solid var(--master-cyan); }
.rme-master .rme-action-card--warning { border-left: 3px solid var(--master-warning); }
.rme-master .rme-action-card--danger { border-left: 3px solid var(--master-danger); }
.rme-master .rme-action-card--neutral { border-left: 3px solid var(--master-muted-2, #6f8193); }
.rme-master .rme-action-card__header { display: grid; gap: var(--master-space-xs); }
.rme-master .rme-action-card__title { margin: 0; color: #fff; font-size: 1.05rem; line-height: 1.3; }
.rme-master .rme-action-card__description { margin: 0; color: var(--master-muted); font-size: .82rem; line-height: 1.5; }
.rme-master .rme-action-card__body { display: grid; gap: var(--master-space-sm); }
.rme-master .rme-action-card__actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--master-space-sm); margin-top: auto; padding-top: var(--master-space-xs); }
.rme-master .rme-form-group { display: grid; min-width: 0; gap: var(--master-space-xs); }
.rme-master .rme-form-group > label { margin: 0; color: #dbe7ef; }
.rme-master .rme-form-control { max-width: 100%; margin: 0; }
.rme-master textarea.rme-form-control { min-height: 108px; }
.rme-master .rme-form-help { display: block; color: var(--master-muted); font-size: .75rem; line-height: 1.45; overflow-wrap: anywhere; }
.rme-master .rme-form-error { color: #fecdd3; font-size: .75rem; line-height: 1.4; }
.rme-master .rme-confirmation { display: flex; width: 100%; max-width: 100%; align-items: flex-start; gap: var(--master-space-sm); margin: 0; padding: var(--master-space-sm); overflow: hidden; border: 1px solid rgba(148,168,185,.18); border-radius: var(--master-radius-sm); color: #dbe7ef; background: rgba(2,9,16,.45); cursor: pointer; font-size: .82rem; line-height: 1.4; }
.rme-master .rme-confirmation input[type="checkbox"] { width: 20px; height: 20px; min-width: 20px; flex: 0 0 20px; margin: 0; accent-color: var(--master-blue); }
.rme-master .rme-confirmation span { min-width: 0; overflow-wrap: anywhere; }
.rme-master .rme-confirmation:focus-within { border-color: var(--master-cyan); box-shadow: 0 0 0 3px rgba(0,183,255,.12); }
.rme-master .rme-btn { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; padding: 9px 16px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-weight: 750; line-height: 1.2; }
.rme-master .rme-btn--primary, .rme-master button.rme-btn--primary { border-color: rgba(68,215,255,.55); color: #fff; background: linear-gradient(135deg, #008cc9, #00b7ff); }
.rme-master .rme-btn--secondary, .rme-master button.rme-btn--secondary { border-color: var(--master-line-strong); color: var(--master-cyan); background: rgba(0,183,255,.06); box-shadow: none; }
.rme-master .rme-btn--warning, .rme-master button.rme-btn--warning { border-color: rgba(251,191,36,.48); color: #fde68a; background: rgba(245,158,11,.11); box-shadow: none; }
.rme-master .rme-btn--danger, .rme-master button.rme-btn--danger { border-color: rgba(251,113,133,.5); color: #fecdd3; background: rgba(190,24,48,.25); box-shadow: none; }
.rme-master .rme-btn--primary:hover, .rme-master button.rme-btn--primary:hover { background: linear-gradient(135deg, #00a7eb, #36caff); }
.rme-master .rme-btn--secondary:hover, .rme-master button.rme-btn--secondary:hover { color: #fff; background: rgba(0,183,255,.16); }
.rme-master .rme-btn--warning:hover, .rme-master button.rme-btn--warning:hover { color: #fff; background: rgba(245,158,11,.2); }
.rme-master .rme-btn--danger:hover, .rme-master button.rme-btn--danger:hover { color: #fff; background: rgba(225,29,72,.42); }
.rme-master .rme-btn:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.rme-master .rme-alert { margin-top: var(--master-space-md); padding: 13px 15px; border: 1px solid; border-radius: var(--master-radius-sm); }
.rme-master .rme-alert--success { border-color: rgba(52,211,153,.35); color: #a7f3d0; background: rgba(16,185,129,.1); }
.rme-master .rme-alert--danger { border-color: rgba(251,113,133,.38); color: #fecdd3; background: rgba(225,29,72,.11); }
.rme-master .rme-alert--warning { border-color: rgba(251,191,36,.36); color: #fde68a; background: rgba(245,158,11,.1); }
.rme-master .rme-editor-steps { display: flex; flex-wrap: wrap; gap: var(--master-space-sm); margin: var(--master-space-lg) 0; color: var(--master-muted); font-size: .78rem; }
.rme-master .rme-editor-steps span { padding: 7px 10px; border: 1px solid var(--master-line); border-radius: 999px; background: rgba(0,183,255,.05); }
.rme-master .rme-editor-section { display: grid; gap: var(--master-space-md); margin-top: var(--master-space-lg); padding: var(--master-space-lg); border: 1px solid var(--master-line); border-radius: var(--master-radius); background: linear-gradient(145deg, rgba(10,24,38,.96), rgba(6,15,25,.96)); box-shadow: var(--master-shadow); }
.rme-master .rme-editor-section > header h2, .rme-master .rme-editor-section > h2 { margin: 0; color: #fff; }
.rme-master .rme-editor-section > header p, .rme-master .rme-editor-section > p { margin: 4px 0 0; color: var(--master-muted); }
.rme-master .rme-editor-form, .rme-master .rme-editor-item { display: grid; min-width: 0; gap: var(--master-space-md); }
.rme-master .rme-editor-item { padding: var(--master-space-md); border: 1px solid rgba(148,168,185,.16); border-radius: var(--master-radius-sm); background: rgba(2,9,16,.35); }
.rme-master .rme-editor-item--new { border-style: dashed; background: rgba(0,183,255,.035); }
.rme-master .rme-editor-item h3, .rme-master .rme-editor-item h4 { margin: 0; color: #fff; }
.rme-master .rme-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--master-space-md); }
.rme-master .rme-editor-grid--compact { grid-template-columns: minmax(220px,2fr) minmax(90px,.55fr) minmax(220px,2fr); }
.rme-master .rme-editor-actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--master-space-sm); }
.rme-master .rme-editor-actions form { display: flex; flex-wrap: wrap; gap: var(--master-space-xs); margin: 0; }
.rme-master .rme-editor-options { display: grid; gap: var(--master-space-md); padding-top: var(--master-space-md); border-top: 1px solid var(--master-line); }
.rme-master .rme-editor-option { display: grid; gap: var(--master-space-sm); padding: var(--master-space-md); border-left: 2px solid var(--master-line-strong); background: rgba(8,19,31,.72); }
.rme-master .rme-text-destination { display: grid; gap: var(--master-space-sm); padding: var(--master-space-md); border: 1px solid var(--master-line); border-radius: var(--master-radius-sm); }
.rme-master [hidden] { display: none; }

.rme-master-welcome { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 290px; padding: clamp(28px, 4.5vw, 60px); overflow: hidden; border: 1px solid var(--master-line); border-radius: 18px; background: linear-gradient(90deg, rgba(3,10,18,.98) 0%, rgba(3,10,18,.9) 48%, rgba(3,10,18,.45) 100%), url('../img/home.webp') center 42% / cover; box-shadow: 0 22px 55px rgba(0,0,0,.28); }
.rme-master-welcome::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(120deg, transparent 55%, rgba(0,183,255,.1)); }
.rme-master-welcome-content { position: relative; z-index: 1; max-width: 680px; }
.rme-master-kicker { color: var(--master-cyan); font-size: .69rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.rme-master-welcome h1 { max-width: 650px; margin: 12px 0 15px; color: #fff; font-size: clamp(2rem, 4vw, 3.3rem); letter-spacing: -.045em; line-height: 1.05; text-shadow: 0 3px 24px rgba(0,0,0,.65); }
.rme-master-welcome p { max-width: 625px; margin: 0; color: #b7c5d0; font-size: clamp(.9rem, 1.4vw, 1.04rem); }
.rme-master-welcome-mark { position: relative; z-index: 1; display: grid; place-items: center; width: 136px; height: 136px; flex: 0 0 auto; margin-left: 30px; border: 1px solid rgba(68,215,255,.3); border-radius: 50%; color: rgba(255,255,255,.75); background: rgba(0,10,18,.46); box-shadow: inset 0 0 35px rgba(0,183,255,.09), 0 0 40px rgba(0,0,0,.32); }
.rme-master-welcome-mark span { font-size: 1.45rem; font-weight: 850; letter-spacing: .1em; }
.rme-master-welcome-mark small { margin-top: -45px; color: var(--master-cyan); font-size: .55rem; letter-spacing: .26em; }
.rme-master-dashboard-section { margin-top: 34px; }
.rme-master-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.rme-master-section-heading h2 { margin: 4px 0 0; font-size: 1.35rem; }
.rme-master-section-heading p { margin: 0; color: var(--master-muted); font-size: .8rem; }
.rme-master-shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.rme-master-shortcut { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 14px; min-height: 118px; padding: 20px; border: 1px solid var(--master-line); border-radius: var(--master-radius); background: linear-gradient(145deg, rgba(11,27,42,.94), rgba(6,16,26,.96)); transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.rme-master-shortcut:hover { border-color: var(--master-line-strong); transform: translateY(-2px); box-shadow: 0 18px 35px rgba(0,0,0,.22), inset 0 1px rgba(255,255,255,.02); }
.rme-master-shortcut-icon { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid var(--master-line-strong); border-radius: 11px; color: var(--master-cyan); background: rgba(0,183,255,.08); }
.rme-master-shortcut-icon svg { width: 23px; height: 23px; fill: currentColor; }
.rme-master-shortcut strong, .rme-master-shortcut small { display: block; }
.rme-master-shortcut strong { color: #fff; font-size: .94rem; }
.rme-master-shortcut small { margin-top: 5px; color: var(--master-muted); font-size: .73rem; line-height: 1.4; }
.rme-master-shortcut > i { color: var(--master-cyan); font-size: 1.2rem; font-style: normal; }

.rme-master-auth { display: grid; min-height: 100vh; place-items: center; padding: clamp(20px, 4vw, 48px); background: linear-gradient(rgba(2,7,12,.76), rgba(2,7,12,.9)), url('../img/home2.png') center / cover fixed; }
.rme-master-login-shell { display: block; width: min(480px, 100%); margin: auto; }
.rme-master-auth .login-box { width: 100%; max-width: none; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.rme-master-auth .login-box .logo { margin: 0 0 12px; text-align: center; }
.rme-master-auth .login-box .logo img { display: block; width: 160px; height: auto; max-height: 106px; margin: 0 auto; object-fit: contain; mix-blend-mode: screen; filter: drop-shadow(0 0 18px rgba(0,183,255,.2)); }
.rme-master-auth .login-box .subtitle { display: grid; margin-bottom: 30px; text-align: center; }
.rme-master .login-box .subtitle span { color: var(--master-cyan); font-size: .67rem; font-weight: 850; letter-spacing: .15em; }
.rme-master .login-box .subtitle strong { margin-top: 4px; color: #fff; font-size: 1.45rem; }
.rme-master .login-box .subtitle small { margin-top: 5px; color: var(--master-muted); }
.rme-master-login-form { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.rme-master-auth .login-box label { margin-top: 3px; }
.rme-master-auth .login-box input:not([type="hidden"]) { min-height: 50px; padding: 12px 14px; }
.rme-master-auth .rme-master-login-form > form > button[type="submit"] { width: 100%; min-height: 48px; margin-top: 5px; }
.rme-master-password-field { position: relative; }
.rme-master-auth .rme-master-password-field input { padding-right: 104px; }
.rme-master-auth .rme-master-password-toggle { position: absolute; top: 5px; right: 5px; width: auto; min-height: 40px; padding: 7px 10px; border-color: transparent; color: var(--master-muted); background: transparent; box-shadow: none; font-size: .72rem; }
.rme-master-auth .rme-master-password-toggle:hover { color: #fff; border-color: var(--master-line); background: rgba(0,183,255,.08); transform: none; }
.rme-master-password-toggle svg { width: 18px; height: 18px; margin-right: 5px; fill: currentColor; }
.rme-master .login-box .error { margin-bottom: 20px; padding: 12px; border: 1px solid rgba(251,113,133,.4); border-radius: 9px; color: #fecdd3; background: rgba(225,29,72,.12); }
.rme-master .login-box .footer { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 25px; color: #7890a3; text-align: center; font-size: .7rem; }
.rme-master .login-box .footer svg { width: 15px; height: 15px; flex: 0 0 auto; fill: currentColor; }

@media (max-width: 1050px) {
    .rme-master-sidebar { width: 224px; padding-inline: 13px; }
    .rme-master-main { width: calc(100% - 224px); margin-left: 224px; }
    .rme-master-brand img { width: 58px; }
    .rme-master-brand small { display: none; }
    .rme-master-shortcuts { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .rme-master .rme-action-grid { grid-template-columns: 1fr; }
    .rme-master .rme-editor-grid, .rme-master .rme-editor-grid--compact { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .rme-master-shell { display: block; }
    .rme-master-sidebar { position: static; width: 100%; min-height: auto; padding: 12px 15px; border-right: 0; border-bottom: 1px solid var(--master-line); }
    .rme-master-brand { min-height: 52px; padding: 0 4px 10px; }
    .rme-master-brand img { width: 54px; height: 38px; }
    .rme-master-menu { display: flex; gap: 6px; margin-top: 12px; overflow-x: auto; padding-bottom: 3px; }
    .rme-master-menu-label, .rme-master-sidebar-footer { display: none; }
    .rme-master-menu a { min-width: max-content; min-height: 40px; padding: 8px 11px; font-size: .78rem; }
    .rme-master-menu svg { width: 17px; height: 17px; }
    .rme-master-main { width: 100%; margin-left: 0; }
    .rme-master-topbar { min-height: 65px; padding: 10px 18px; }
    .rme-master-user small { display: none; }
    .rme-master-user strong { max-width: 125px; }
    .rme-master-page { padding: 22px 16px 38px; }
    .rme-master .rme-action-card { padding: var(--master-space-md); }
    .rme-master .rme-editor-section { padding: var(--master-space-md); }
    .rme-master-welcome { min-height: 270px; }
    .rme-master-welcome-mark { display: none; }
    .rme-master-section-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
    .rme-master-login-shell { width: min(480px, 100%); }
}

@media (max-width: 480px) {
    .rme-master-menu a span { display: none; }
    .rme-master-menu a { min-width: 42px; justify-content: center; }
    .rme-master-topbar > div:first-child { display: none; }
    .rme-master-topbar { justify-content: flex-end; }
    .rme-master-welcome { padding: 25px 20px; }
    .rme-master-welcome h1 { font-size: 1.8rem; }
    .rme-master-shortcut { grid-template-columns: 42px minmax(0, 1fr); padding: 16px; }
    .rme-master-shortcut > i { display: none; }
    .rme-master-auth { padding: 14px; background-attachment: scroll; }
    .rme-master-auth .login-box { padding: 0; }
    .rme-master-login-form { padding: 0; }
    .rme-master-auth .login-box .logo img { width: 130px; }
    .rme-master .login-box .subtitle strong { font-size: 1.28rem; }
}

* {
    box-sizing: border-box;
}

body.rme-app {
    color-scheme: dark;
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 78% 12%, rgba(0,183,255,0.18), transparent 28rem),
        radial-gradient(circle at 12% 6%, rgba(0,255,156,0.07), transparent 20rem),
        linear-gradient(180deg, #02060a 0%, var(--rme-bg) 48%, #030911 100%);
    color: var(--rme-text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
}

a {
    color: var(--rme-blue-soft);
    text-decoration: none;
}

a:hover {
    color: #ffffff;
}

.rme-shell {
    min-height: 100vh;
}

.rme-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--rme-border);
    background: rgba(0,0,0,0.76);
    backdrop-filter: blur(10px);
}

.rme-header-main {
    min-height: 82px;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.rme-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: #ffffff;
    font-weight: 700;
}

.rme-brand img {
    width: 92px;
    height: auto;
    display: block;
    filter: drop-shadow(0 0 18px rgba(0,183,255,0.18));
}

.rme-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.rme-brand-title {
    font-size: 1rem;
}

.rme-brand-subtitle {
    color: var(--rme-muted);
    font-size: 0.76rem;
    font-weight: 600;
}

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

.rme-nav a {
    color: #ffffff;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 9px 14px;
    font-size: 0.92rem;
    font-weight: 700;
    transition: 0.2s ease;
}

.rme-nav a:hover,
.rme-nav a.active {
    color: #ffffff;
    background: rgba(0,183,255,0.13);
    border-color: var(--rme-border-strong);
    box-shadow: 0 0 22px rgba(0,183,255,0.12);
}

.rme-top-metrics {
    border-top: 1px solid rgba(255,255,255,0.06);
    background: rgba(2,6,10,0.48);
}

.metrics-grid {
    max-width: 1440px;
    margin: 0 auto;
    padding: 12px 42px 14px;
    display: grid;
    grid-template-columns: repeat(8, minmax(92px, 1fr));
    gap: 10px;
}

.metric-box {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--rme-border);
    border-radius: var(--rme-radius);
    background: rgba(255,255,255,0.035);
}

.metric-label {
    color: var(--rme-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.metric-value {
    margin-top: 2px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 800;
}

.metric-row-inline {
    min-height: 26px;
    display: flex;
    align-items: center;
}

.metric-normal { color: var(--rme-green); }
.metric-warning { color: var(--rme-yellow); }
.metric-critical { color: var(--rme-red); font-weight: 800; }

.metric-blink {
    animation: blinkAlert 1s infinite;
}

@keyframes blinkAlert {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.34; }
}

.badge-fail {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255,77,95,0.22);
    color: #ffffff;
    border: 1px solid rgba(255,77,95,0.44);
    font-size: 0.78rem;
    font-weight: 800;
}

.main-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 38px 42px 72px;
}

.page-heading {
    margin-bottom: 26px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.page-heading h1,
.page-heading h2 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(1.65rem, 2.4vw, 2.35rem);
    font-weight: 800;
    line-height: 1.15;
    text-shadow: 0 0 16px rgba(0,183,255,0.18);
}

.page-kicker {
    margin: 0 0 6px;
    color: var(--rme-blue-soft);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

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

.rme-grid {
    display: grid;
    gap: 16px;
}

.dashboard-grid-primary {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.dashboard-grid-secondary {
    grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.rme-card,
.card {
    min-width: 0;
    color: var(--rme-text);
    background: var(--rme-surface);
    border: 1px solid var(--rme-border);
    border-radius: var(--rme-radius);
    box-shadow: var(--rme-shadow);
}

.rme-card {
    padding: 20px;
}

.rme-card:hover {
    border-color: var(--rme-border-strong);
}

.stat-card {
    min-height: 126px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-label {
    color: var(--rme-muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.stat-value {
    margin-top: 12px;
    color: #ffffff;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.stat-note {
    margin-top: 10px;
    color: var(--rme-muted-2);
    font-size: 0.85rem;
}

.accent-blue { border-color: rgba(0,183,255,0.34); }
.accent-green { border-color: rgba(0,255,156,0.28); }
.accent-yellow { border-color: rgba(255,204,0,0.28); }
.accent-red { border-color: rgba(255,77,95,0.32); }

.rme-panel {
    overflow: hidden;
    border: 1px solid var(--rme-border);
    border-radius: var(--rme-radius);
    background: rgba(2,8,14,0.58);
    box-shadow: var(--rme-shadow);
}

.table-wrap {
    max-width: 100%;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.rme-table,
.table {
    width: 100%;
    margin: 0;
    color: var(--rme-text);
    border-collapse: collapse;
}

.rme-table {
    min-width: 980px;
}

.rme-table-wide {
    min-width: 1760px;
}

.rme-table th,
.rme-table td,
.table th,
.table td {
    padding: 13px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.075);
    vertical-align: middle;
}

.rme-table th,
.table th {
    color: var(--rme-blue-soft);
    background: rgba(0,183,255,0.07);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.rme-table tr:hover td,
.table tr:hover td {
    background: rgba(0,183,255,0.045);
}

.cell-nowrap {
    white-space: nowrap;
}

.cell-wide {
    min-width: 280px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 10px;
    border: 1px solid var(--rme-border);
    border-radius: 999px;
    color: #ffffff;
    background: rgba(255,255,255,0.04);
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
}

.status-processing { border-color: rgba(255,204,0,0.42); color: var(--rme-yellow); }
.status-ok { border-color: rgba(0,255,156,0.34); color: var(--rme-green); }
.status-error { border-color: rgba(255,77,95,0.42); color: var(--rme-red); }
.status-warning { border-color: rgba(255,204,0,0.42); color: var(--rme-yellow); }
.status-muted { color: var(--rme-muted); }

.btn,
button,
input[type="submit"] {
    border: 1px solid rgba(0,183,255,0.26);
    border-radius: 999px;
    padding: 10px 18px;
    background: var(--rme-blue);
    color: #ffffff;
    font-weight: 800;
    line-height: 1.2;
    transition: 0.2s ease;
}

.btn:hover,
button:hover,
input[type="submit"]:hover {
    border-color: rgba(0,183,255,0.62);
    background: #008fd6;
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-secondary,
.btn-outline-primary {
    background: transparent;
    color: var(--rme-blue-soft);
}

.btn-secondary:hover,
.btn-outline-primary:hover {
    background: rgba(0,183,255,0.13);
}

.btn-success {
    background: var(--rme-green);
    border-color: rgba(0,255,156,0.45);
    color: #00130c;
}

.btn-success:hover {
    background: #00d889;
    color: #00130c;
}

.btn-warning {
    background: var(--rme-yellow);
    border-color: rgba(255,204,0,0.48);
    color: #161000;
}

.btn-danger {
    background: var(--rme-red);
    border-color: rgba(255,77,95,0.54);
}

form {
    margin: 0;
}

.form-panel {
    max-width: 960px;
}

.form-label-title {
    margin: 0 0 12px;
    color: #ffffff;
    font-size: 1.08rem;
    font-weight: 800;
}

textarea,
select,
.form-select,
.form-control {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--rme-border);
    border-radius: var(--rme-radius);
    background: rgba(0,0,0,0.24);
    color: #ffffff;
    padding: 12px 14px;
}

textarea:focus,
select:focus,
.form-select:focus,
.form-control:focus {
    outline: none;
    border-color: var(--rme-border-strong);
    box-shadow: 0 0 0 3px rgba(0,183,255,0.12);
    background: rgba(0,0,0,0.32);
    color: #ffffff;
}

textarea::placeholder {
    color: #8293a3;
}

select {
    min-height: 44px;
    color-scheme: dark;
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--rme-blue-soft) 50%),
        linear-gradient(135deg, var(--rme-blue-soft) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 50%,
        calc(100% - 12px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 42px;
}

select:hover,
.form-select:hover {
    border-color: var(--rme-border-strong);
    background-color: rgba(0,0,0,0.30);
}

select:disabled,
.form-select:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

select:invalid,
.form-select:invalid {
    border-color: rgba(255,204,0,0.45);
}

select option,
select optgroup,
.form-select option,
.form-select optgroup {
    background-color: #07111c;
    color: #ffffff;
}

select option:checked,
.form-select option:checked {
    background-color: #08344a;
    color: #ffffff;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 18px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
    gap: 14px;
}

.filter-grid > *,
.form-grid > *,
.detail-grid > *,
.dashboard-grid-primary > *,
.dashboard-grid-secondary > * {
    min-width: 0;
}

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

.cell-cause {
    max-width: 260px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.info-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.info-list li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.075);
    padding-bottom: 10px;
}

.info-list li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.model-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.model-list li {
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--rme-radius);
    background: rgba(255,255,255,0.03);
}

.pagination-row {
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: var(--rme-muted);
}

.detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.json-box,
pre {
    max-height: 520px;
    overflow: auto;
    padding: 18px;
    border: 1px solid var(--rme-border);
    border-radius: var(--rme-radius);
    background: rgba(0,0,0,0.28);
    color: #dcecff;
}

.content-box {
    white-space: pre-wrap;
    line-height: 1.7;
}

hr {
    border-color: rgba(255,255,255,0.1);
    opacity: 1;
    margin: 24px 0;
}

@media (max-width: 1100px) {
    .metrics-grid {
        grid-template-columns: repeat(4, minmax(110px, 1fr));
    }

    .dashboard-grid-primary,
    .dashboard-grid-secondary {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}

@media (max-width: 760px) {
    .rme-header-main {
        padding: 14px 18px;
        align-items: flex-start;
        flex-direction: column;
    }

    .rme-brand img {
        width: 78px;
    }

    .rme-nav {
        width: 100%;
        justify-content: flex-start;
    }

    .rme-nav a {
        padding: 8px 10px;
        font-size: 0.86rem;
    }

    .metrics-grid {
        padding: 12px 18px;
        grid-template-columns: repeat(2, minmax(110px, 1fr));
    }

    .main-container {
        padding: 28px 18px 56px;
    }

    .page-heading {
        flex-direction: column;
    }

    .dashboard-grid-primary,
    .dashboard-grid-secondary,
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* UI 1.0 Freeze refinements */
.rme-card,
.stat-card {
    min-height: 100%;
}

.rme-card h4,
.rme-card h5 {
    margin: 0;
    color: #ffffff;
    font-weight: 800;
}

.rme-card > * + * {
    margin-top: 14px;
}

.rme-table-wide {
    min-width: 1480px;
}

.rme-table th,
.rme-table td {
    line-height: 1.45;
}

.cell-number {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.cell-model,
.text-wrap-anywhere {
    min-width: 170px;
    max-width: 280px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.cell-wide {
    max-width: 340px;
    overflow-wrap: anywhere;
}

.btn:disabled,
button:disabled,
input[type="submit"]:disabled,
.btn.disabled,
button[aria-busy="true"] {
    cursor: not-allowed;
    opacity: 0.56;
    transform: none;
    box-shadow: none;
}

.btn:focus-visible,
button:focus-visible,
input[type="submit"]:focus-visible,
.rme-nav a:focus-visible,
select:focus-visible,
textarea:focus-visible,
input:focus-visible {
    outline: 2px solid var(--rme-blue-soft);
    outline-offset: 2px;
}

.model-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
}

.info-list strong {
    text-align: right;
    overflow-wrap: anywhere;
}

@media (max-width: 1280px) {
    .rme-header-main,
    .metrics-grid,
    .main-container {
        max-width: 1180px;
    }

    .dashboard-grid-primary {
        grid-template-columns: repeat(3, minmax(180px, 1fr));
    }
}

@media (max-width: 1024px) {
    .rme-header-main {
        padding: 0 28px;
    }

    .metrics-grid {
        padding-left: 28px;
        padding-right: 28px;
    }

    .main-container {
        padding-left: 28px;
        padding-right: 28px;
    }

    .dashboard-grid-primary,
    .dashboard-grid-secondary {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}

@media (max-width: 480px) {
    .rme-brand-text {
        display: none;
    }

    .rme-nav {
        gap: 6px;
    }

    .rme-nav a {
        font-size: 0.8rem;
        padding: 7px 9px;
    }

    .metrics-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stat-value {
        font-size: 1.65rem;
    }

    .rme-card {
        padding: 16px;
    }
}


/* Auth and responsive baseline 2026-07-13 */
html,
body {
    max-width: 100%;
}

.rme-userbar {
    max-width: 1440px;
    margin: 0 auto;
    padding: 8px 42px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.user-chip {
    color: var(--rme-muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.logout-form {
    display: inline-flex;
}

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-shell {
    width: min(100%, 460px);
}

.auth-card {
    padding: 28px;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
}

.auth-brand img {
    width: 92px;
    height: auto;
}

.auth-brand h1 {
    margin: 0;
    font-size: 1.6rem;
    color: #fff;
}

.password-row,
.inline-form-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.password-row .form-control,
.inline-form-row .form-control {
    min-width: 0;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="date"] {
    width: 100%;
    border: 1px solid var(--rme-border);
    border-radius: var(--rme-radius);
    background: rgba(0,0,0,0.24);
    color: #ffffff;
    padding: 12px 14px;
    min-height: 44px;
}

input:focus {
    outline: none;
    border-color: var(--rme-border-strong);
    box-shadow: 0 0 0 3px rgba(0,183,255,0.12);
    background: rgba(0,0,0,0.32);
    color: #ffffff;
}

input::placeholder {
    color: #8293a3;
}

.check-stack {
    display: grid;
    align-content: center;
    gap: 12px;
    color: var(--rme-text);
}

.check-stack label,
.check-option {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    margin: 0;
    cursor: pointer;
    font-weight: 700;
    line-height: 1.35;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    flex: 0 0 auto;
    accent-color: var(--rme-green);
    cursor: pointer;
}

input[type="checkbox"]:disabled,
.check-option:has(input[type="checkbox"]:disabled) {
    cursor: not-allowed;
    opacity: 0.58;
}

input[type="checkbox"]:focus-visible {
    outline: 3px solid rgba(0,183,255,0.55);
    outline-offset: 3px;
}

.user-filter {
    max-width: 100%;
}

.compact-actions {
    gap: 8px;
}

.text-wrap-anywhere,
.cell-model,
.cell-wide,
.content-box,
.json-box,
pre {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.btn:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(0,183,255,0.55);
    outline-offset: 2px;
}

.alert {
    border-radius: var(--rme-radius);
}

@media (max-width: 991px) {
    .rme-header-main,
    .rme-userbar,
    .metrics-grid,
    .main-container {
        padding-left: 24px;
        padding-right: 24px;
    }

    .rme-header-main {
        align-items: flex-start;
        flex-direction: column;
    }

    .rme-nav {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .metrics-grid {
        grid-template-columns: repeat(4, minmax(110px, 1fr));
    }

    .dashboard-grid-primary,
    .dashboard-grid-secondary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 575px) {
    .auth-page {
        align-items: flex-start;
        padding: 14px;
    }

    .auth-card,
    .rme-card {
        padding: 16px;
    }

    .auth-brand {
        align-items: flex-start;
        flex-direction: column;
    }

    .rme-header-main,
    .rme-userbar,
    .metrics-grid,
    .main-container {
        padding-left: 14px;
        padding-right: 14px;
    }

    .rme-userbar {
        align-items: stretch;
        justify-content: flex-start;
        flex-direction: column;
    }

    .logout-form .btn {
        width: 100%;
    }

    .metrics-grid,
    .dashboard-grid-primary,
    .dashboard-grid-secondary,
    .form-grid,
    .filter-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .page-heading,
    .page-actions,
    .action-row,
    .password-row,
    .inline-form-row {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .page-actions .btn,
    .action-row .btn,
    .action-row button,
    .inline-form-row button,
    .password-row button {
        width: 100%;
    }

    .stat-value {
        font-size: 1.55rem;
    }

    .rme-table.users-table,
    .rme-table.users-table thead,
    .rme-table.users-table tbody,
    .rme-table.users-table th,
    .rme-table.users-table td,
    .rme-table.users-table tr {
        display: block;
        min-width: 0;
        width: 100%;
    }

    .rme-table.users-table thead {
        display: none;
    }

    .rme-table.users-table tr {
        padding: 12px;
        border-bottom: 1px solid rgba(255,255,255,0.12);
    }

    .rme-table.users-table td {
        display: grid;
        grid-template-columns: minmax(96px, 38%) 1fr;
        gap: 10px;
        padding: 8px 0;
        border-bottom: 0;
    }

    .rme-table.users-table td::before {
        content: attr(data-label);
        color: var(--rme-muted);
        font-weight: 800;
        text-transform: uppercase;
        font-size: 0.72rem;
    }

    .cell-cause {
        max-width: none;
    }

    textarea {
        min-height: 260px;
    }
}
.rme-master .rme-ia-filters { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:14px; padding:18px; background:var(--master-panel); border:1px solid var(--master-line); border-radius:14px; }
.rme-master .rme-ia-filters label,.rme-master .rme-ia-action-form label { display:grid; gap:7px; color:var(--master-muted); font-size:.82rem; font-weight:700; }
.rme-master .rme-ia-filters input,.rme-master .rme-ia-filters select,.rme-master .rme-ia-action-form textarea { width:100%; padding:10px 12px; color:#fff; background:#07111d; border:1px solid var(--master-line); border-radius:8px; }
.rme-master .rme-ia-filter-actions { display:flex; align-items:end; gap:8px; }
.rme-master .rme-ia-technical { display:block; margin-top:5px; color:var(--master-muted); }
.rme-master .rme-ia-panel { margin-top:20px; padding:22px; background:var(--master-panel); border:1px solid var(--master-line); border-radius:14px; color:#d9e4ef; }
.rme-master .rme-ia-panel h2 { margin:0 0 16px; color:#fff; }
.rme-master .rme-ia-details { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:16px; }
.rme-master .rme-ia-details div { padding:14px; background:#07111d; border-radius:10px; }
.rme-master .rme-ia-details dt { color:var(--master-muted); font-size:.78rem; font-weight:800; text-transform:uppercase; }
.rme-master .rme-ia-details dd { margin:7px 0 0; overflow-wrap:anywhere; }
.rme-master .rme-ia-warning { padding:12px 14px; border-left:3px solid #f3b63f; background:rgba(243,182,63,.08); }
.rme-master .rme-ia-muted { color:var(--master-muted); font-size:.84rem; }
.rme-master .rme-ia-timeline { display:grid; gap:10px; padding:0; list-style:none; }
.rme-master .rme-ia-timeline li { display:grid; gap:4px; padding:13px 15px; background:#07111d; border-left:3px solid #2d7dd2; border-radius:8px; }
.rme-master .rme-ia-timeline small { color:var(--master-muted); }
.rme-master .rme-ia-action-form { display:grid; gap:12px; margin-top:15px; padding:16px; border:1px solid var(--master-line); border-radius:10px; }
.rme-master .rme-ia-action-form textarea { min-height:90px; resize:vertical; }
.rme-master .rme-ia-confirm { display:flex!important; grid-template-columns:auto 1fr; align-items:center; }
.rme-master .rme-ia-confirm input { width:auto; }
@media (max-width:720px) { .rme-master .rme-ia-panel { padding:15px; } .rme-master .rme-ia-details { grid-template-columns:1fr; } }

/* Editor de Grafo RME Core */
.rme-master .rme-graph-editor { --graph-tree: 292px; --graph-context: 248px; display:grid; grid-template-columns:var(--graph-tree) minmax(0,1fr) var(--graph-context); min-height:calc(100vh - 250px); margin-top:20px; overflow:hidden; border:1px solid var(--master-line); border-radius:16px; background:#06101a; box-shadow:var(--master-shadow); }
.rme-master .rme-graph-tree,.rme-master .rme-graph-context { min-width:0; background:linear-gradient(180deg,#081725,#06101a); }
.rme-master .rme-graph-tree { display:flex; max-height:calc(100vh - 110px); flex-direction:column; border-right:1px solid var(--master-line); }
.rme-master .rme-graph-tree__header { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding:18px; border-bottom:1px solid var(--master-line); }
.rme-master .rme-graph-tree__header strong { display:block; margin-top:5px; color:#fff; font-size:.88rem; }
.rme-master .rme-graph-tree__close { display:none; border:0; color:var(--master-muted); background:transparent; font-size:1.5rem; cursor:pointer; }
.rme-master .rme-graph-search { display:grid; gap:7px; padding:14px 14px 8px; color:var(--master-muted); font-size:.7rem; font-weight:800; text-transform:uppercase; }
.rme-master .rme-graph-search input { min-height:40px; font-size:.78rem; text-transform:none; }
.rme-master .rme-graph-search-empty { margin:8px 14px; color:#fda4af; font-size:.76rem; }
.rme-master .rme-graph-navigation { flex:1; min-height:0; overflow-y:auto; padding:8px 10px 20px; scrollbar-color:rgba(68,215,255,.35) transparent; }
.rme-master .rme-graph-navigation details { margin-top:8px; }
.rme-master .rme-graph-navigation summary { display:flex; align-items:center; justify-content:space-between; padding:9px 8px; color:#91a8b9; cursor:pointer; font-size:.68rem; font-weight:850; letter-spacing:.08em; text-transform:uppercase; }
.rme-master .rme-graph-navigation summary span { padding:2px 7px; border-radius:999px; background:rgba(148,168,185,.12); }
.rme-master .rme-graph-nav-list { display:grid; gap:3px; }
.rme-master .rme-graph-nav-item { display:grid; grid-template-columns:20px minmax(0,1fr); gap:8px; padding:9px 8px; border:1px solid transparent; border-radius:9px; color:#dce8ef; text-decoration:none; transition:.16s ease; }
.rme-master .rme-graph-nav-item:hover { border-color:var(--master-line); background:rgba(0,183,255,.06); }
.rme-master .rme-graph-nav-item.is-active { border-color:rgba(68,215,255,.45); background:linear-gradient(90deg,rgba(0,183,255,.15),rgba(0,183,255,.04)); box-shadow:inset 3px 0 var(--master-cyan); }
.rme-master .rme-graph-nav-item strong,.rme-master .rme-graph-nav-item small,.rme-master .rme-graph-nav-item em { display:block; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rme-master .rme-graph-nav-item strong { color:#eaf5fb; font-size:.74rem; }
.rme-master .rme-graph-nav-item small { margin-top:3px; color:#8399aa; font-size:.67rem; }
.rme-master .rme-graph-nav-item em { margin-top:4px; color:var(--master-cyan); font-size:.59rem; font-style:normal; font-weight:750; text-transform:uppercase; }
.rme-master .rme-graph-health { padding-top:1px; color:#fbbf24; font-size:.7rem; text-align:center; }
.rme-master .rme-graph-health.is-valid { color:#34d399; }
.rme-master .rme-graph-health.is-error { color:#fb7185; }
.rme-master .rme-graph-node-icon { color:var(--master-cyan); font-size:.7rem; text-align:center; }
.rme-master .rme-graph-nav-add { display:block; margin:5px 3px; padding:9px 10px; border:1px dashed var(--master-line-strong); border-radius:8px; color:var(--master-cyan); text-align:center; text-decoration:none; font-size:.7rem; font-weight:800; }
.rme-master .rme-graph-nav-add:hover,.rme-master .rme-graph-nav-add.is-active { color:#fff; background:rgba(0,183,255,.12); }
.rme-master .rme-graph-canvas { min-width:0; max-height:calc(100vh - 110px); overflow-y:auto; padding:clamp(20px,3vw,38px); background:radial-gradient(circle at 50% 0,rgba(0,183,255,.07),transparent 34%),#07121e; }
.rme-master #editor-contextual { scroll-margin-top:96px; }
.rme-master .rme-graph-node-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:25px; padding-bottom:20px; border-bottom:1px solid var(--master-line); }
.rme-master .rme-graph-node-heading h2 { max-width:780px; margin:5px 0; color:#fff; font-size:clamp(1.25rem,2.2vw,1.85rem); line-height:1.2; }
.rme-master .rme-graph-node-heading h2 small { color:var(--master-cyan); }
.rme-master .rme-graph-node-heading p { margin:0; color:var(--master-muted); }
.rme-master .rme-graph-node-kind { color:var(--master-cyan); font-size:.65rem; font-weight:850; letter-spacing:.12em; text-transform:uppercase; }
.rme-master .rme-graph-node-badge { flex:0 0 auto; padding:7px 11px; border:1px solid var(--master-line-strong); border-radius:999px; color:#a5e9ff; background:rgba(0,183,255,.08); font-size:.65rem; font-weight:850; text-transform:uppercase; }
.rme-master .rme-graph-node-form { display:grid; gap:18px; }
.rme-master .rme-form-control--question { min-height:126px; font-size:1rem; line-height:1.55; }
.rme-master .rme-graph-actionbar { position:sticky; z-index:3; bottom:-1px; display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-top:24px; padding:14px 0 2px; background:linear-gradient(transparent,#07121e 22%); }
.rme-master .rme-graph-actionbar form,.rme-master .rme-graph-option__actions form { display:flex; flex-wrap:wrap; gap:8px; margin:0; }
.rme-master .rme-graph-options { display:grid; gap:14px; margin-top:30px; padding-top:25px; border-top:1px solid var(--master-line); }
.rme-master .rme-graph-options > header { display:flex; align-items:center; justify-content:space-between; }
.rme-master .rme-graph-options > header h3 { margin:4px 0 0; color:#fff; }
.rme-master .rme-graph-options > header > span { display:grid; width:34px; height:34px; place-items:center; border-radius:50%; color:var(--master-cyan); background:rgba(0,183,255,.1); font-weight:850; }
.rme-master .rme-graph-option { display:grid; gap:14px; padding:18px; border:1px solid rgba(148,168,185,.18); border-left:3px solid #238fc1; border-radius:11px; background:linear-gradient(145deg,rgba(11,27,42,.95),rgba(5,14,23,.98)); }
.rme-master .rme-graph-option--new { border-style:dashed; border-left-style:solid; }
.rme-master .rme-graph-option__line { display:grid; grid-template-columns:32px minmax(0,1fr); align-items:end; gap:10px; }
.rme-master .rme-graph-option__order { display:grid; width:30px; height:30px; place-items:center; margin-bottom:6px; border-radius:50%; color:#a5e9ff; background:rgba(0,183,255,.12); font-size:.72rem; font-weight:850; }
.rme-master .rme-graph-route { display:grid; grid-template-columns:32px minmax(0,1fr); gap:10px; padding-top:2px; }
.rme-master .rme-graph-route > span { color:var(--master-cyan); text-align:center; font-size:1.15rem; }
.rme-master .rme-graph-route strong { display:block; margin-bottom:8px; color:#b9cbd7; font-size:.7rem; text-transform:uppercase; }
.rme-master .rme-graph-route p { margin:0 0 7px; color:#fbbf24; font-size:.76rem; }
.rme-master .rme-graph-destination { padding:16px; border:1px solid var(--master-line); border-radius:10px; background:rgba(2,9,16,.32); }
.rme-master .rme-graph-destination h3 { margin:0 0 10px; color:#fff; font-size:.9rem; }
.rme-master .rme-graph-destination-types { display:flex; flex-wrap:wrap; gap:8px 16px; margin-bottom:10px; }
.rme-master .rme-graph-destination-types label { display:flex; align-items:center; gap:6px; margin:0; color:#dce8ef; cursor:pointer; font-size:.78rem; }
.rme-master .rme-graph-destination-types input { accent-color:var(--master-cyan); }
.rme-master .rme-graph-option__actions { display:flex; flex-wrap:wrap; gap:8px; padding-top:12px; border-top:1px solid rgba(148,168,185,.12); }
.rme-master .rme-graph-context { max-height:calc(100vh - 110px); overflow-y:auto; border-left:1px solid var(--master-line); }
.rme-master .rme-graph-context section { padding:20px 17px; border-bottom:1px solid var(--master-line); }
.rme-master .rme-graph-context dl { display:grid; gap:10px; margin:14px 0; }
.rme-master .rme-graph-context dl div { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; }
.rme-master .rme-graph-context dt { color:#8198a9; font-size:.7rem; }
.rme-master .rme-graph-context dd { max-width:132px; margin:0; overflow:hidden; color:#e2edf3; font-size:.72rem; font-weight:750; text-align:right; text-overflow:ellipsis; white-space:nowrap; }
.rme-master .rme-graph-context code { color:#9bdcf3; }
.rme-master .rme-graph-references { display:grid; gap:7px; margin:12px 0 0; padding:0; list-style:none; }
.rme-master .rme-graph-references li { padding:8px; border-radius:7px; color:#aebfca; background:rgba(0,0,0,.2); font-size:.66rem; line-height:1.35; }
.rme-master .rme-graph-validation-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-bottom:24px; }
.rme-master .rme-graph-validation-summary div { display:grid; gap:4px; padding:20px; border:1px solid var(--master-line); border-radius:10px; background:rgba(0,183,255,.04); }
.rme-master .rme-graph-validation-summary strong { color:#fff; font-size:1.8rem; }
.rme-master .rme-graph-validation-summary span { color:var(--master-muted); font-size:.72rem; text-transform:uppercase; }
.rme-master .rme-graph-backdrop,.rme-master .rme-graph-tree-toggle { display:none; }

@media (max-width:1180px) {
    .rme-master .rme-graph-editor { --graph-tree:260px; grid-template-columns:var(--graph-tree) minmax(0,1fr); }
    .rme-master .rme-graph-context { display:none; }
}
@media (max-width:900px) {
    .rme-master .rme-graph-editor { display:block; min-height:70vh; overflow:visible; }
    .rme-master .rme-graph-tree-toggle { display:inline-flex; }
    .rme-master .rme-graph-tree { position:fixed; z-index:1002; top:0; bottom:0; left:0; width:min(340px,88vw); max-height:none; transform:translateX(-105%); border-right:1px solid var(--master-line-strong); box-shadow:20px 0 45px rgba(0,0,0,.5); transition:transform .2s ease; }
    .rme-master .rme-graph-tree__close { display:block; }
    .rme-master .rme-graph-editor.is-tree-open .rme-graph-tree { transform:translateX(0); }
    .rme-master .rme-graph-backdrop { position:fixed; z-index:1001; inset:0; background:rgba(0,6,12,.72); }
    .rme-master .rme-graph-editor.is-tree-open .rme-graph-backdrop { display:block; }
    .rme-master .rme-graph-canvas { max-height:none; overflow:visible; }
}
@media (max-width:600px) {
    .rme-master .rme-graph-canvas { padding:18px 14px; }
    .rme-master .rme-graph-node-heading { flex-direction:column; gap:10px; }
    .rme-master .rme-graph-actionbar,.rme-master .rme-graph-option__actions { align-items:stretch; flex-direction:column; }
    .rme-master .rme-graph-actionbar > *,.rme-master .rme-graph-actionbar form,.rme-master .rme-graph-option__actions > *,.rme-master .rme-graph-option__actions form { width:100%; }
    .rme-master .rme-graph-actionbar form .rme-btn,.rme-master .rme-graph-option__actions form .rme-btn { flex:1; }
    .rme-master .rme-graph-option { padding:14px 12px; }
    .rme-master .rme-graph-validation-summary { grid-template-columns:1fr; }
}
