/* RAWA — Pilot UX: ajustes pontuais validados por codigo; sem refazer temas. */
/* Login: garante marca legivel no card branco independente do tema do ERP. */
#login-view .rawa-login-logo {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: min(245px, 76%) !important;
    max-width: 245px !important;
    height: auto !important;
    max-height: 72px !important;
    object-fit: contain !important;
    object-position: center !important;
    margin: 0 auto 16px !important;
    filter: none !important;
    transform: none !important;
}
#login-view > .login-card {
    min-width: 0 !important;
    box-sizing: border-box !important;
}
#login-view #login-form input {
    min-width: 0 !important;
    max-width: 100% !important;
}

/* Master desktop: painel esquerdo fixo na viewport, apenas o direito rola. */
@media (min-width: 681px) {
    html:has(body.rawa-master), body.rawa-master {
        width: 100%;
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }
    .rawa-master .master-shell:not([hidden]) {
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        overflow: hidden;
        grid-template-rows: minmax(0, 1fr);
    }
    .rawa-master .master-aside {
        height: 100%;
        min-height: 0;
        overflow: hidden;
        overscroll-behavior: contain;
    }
    .rawa-master .master-picker-side,
    .rawa-master .master-auth-side {
        height: 100%;
        min-height: 0;
        min-width: 0;
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior-y: contain;
        scrollbar-gutter: stable;
    }
    .rawa-master .master-picker-side:focus-visible {
        outline: 2px solid #3175e6;
        outline-offset: -2px;
    }
}
/* Janelas desktop curtas: escondemos apenas ornamentos, sem cortar login. */
@media (min-width: 681px) and (max-height: 690px) {
    .rawa-master .master-aside { padding-block: 20px; }
    .rawa-master .master-aside .master-brand { margin-bottom: 22px; }
    .rawa-master .master-aside h1 { font-size: clamp(29px, 3vw, 42px); }
    .rawa-master .master-aside-note { margin-top: 18px; padding: 10px 14px; }
}

@media (min-width: 681px) and (max-height: 540px) {
    /* Evita corte de conteudo no painel esquerdo em notebooks muito baixos. */
    .rawa-master .master-aside-note { display: none; }
    .rawa-master .master-aside h1 { font-size: 29px; margin-block: 9px; }
    .rawa-master .master-aside .master-brand { margin-bottom: 12px; }
    .rawa-master .master-aside { padding-block: 12px; }
}

/* Master: mesmo modelo de cards e listas dos modulos operacionais. */
.rawa-master .master-tenant-choice,
.rawa-master .master-audit-item,
.rawa-master .master-choice {
    min-width: 0;
    border: 1px solid #dfe6f0;
    background: #fff;
    border-radius: 13px;
    box-shadow: 0 2px 7px rgba(13, 28, 49, .03);
}
.rawa-master .master-choice {
    align-items: center;
    gap: 12px;
    min-height: 75px;
}
.rawa-master .master-choice:focus-visible,
.rawa-master .master-tenant-choice:focus-visible {
    outline: 3px solid rgba(49, 117, 230, .24);
    outline-offset: 2px;
    border-color: #6a97e8;
}
.rawa-master .master-choice-copy strong,
.rawa-master .master-audit-item strong {
    color: #172d4a;
    font-size: 13px;
    line-height: 1.4;
}
.rawa-master .master-choice-copy small,
.rawa-master .master-audit-item small {
    color: #61758f;
    line-height: 1.5;
}
.rawa-master .master-filters {
    border: 1px solid #e3e9f2;
    padding: 12px;
    border-radius: 12px;
    background: #f9fbff;
}
.rawa-master .master-empty { border-radius: 13px; }
.rawa-master .master-detail-list { max-width: 100%; }
.rawa-master .master-detail-list div { overflow-wrap: anywhere; }

/* Em mobile, a tela inteira rola normalmente; nunca fixar a coluna Master. */
@media (max-width: 780px) {
    #login-view.login-view:not([hidden]) {
        position: fixed !important;
        inset: 0 !important;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-rows: auto auto !important;
        align-content: start !important;
        height: 100vh !important;
        height: 100dvh !important;
        min-height: 0 !important;
        padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
    }
    #login-view > .login-art {
        order: 1 !important;
        grid-column: 1 !important;
        min-height: 0 !important;
        height: auto !important;
        padding: 18px 20px 16px !important;
    }
    #login-view .login-art h2 {
        font-size: clamp(22px, 5.7vw, 31px) !important;
        line-height: 1.2 !important;
        margin: 6px 0 0 !important;
    }
    #login-view .login-art-content > p { display: none !important; }
    #login-view .rawa-showcase-brand { margin-bottom: 9px !important; }
    #login-view > .login-card {
        order: 2 !important;
        grid-column: 1 !important;
        justify-self: center !important;
        align-self: start !important;
        width: min(410px, calc(100% - 28px)) !important;
        max-width: calc(100% - 28px) !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 13px auto max(20px, env(safe-area-inset-bottom, 0px)) !important;
    }
    #login-view .rawa-login-logo { width: min(210px, 70%) !important; margin-bottom: 10px !important; }
    #login-view #login-form input { font-size: 16px !important; }
}
@media (max-width: 680px) {
    html:has(body.rawa-master), body.rawa-master { height: auto; min-height: 100%; overflow: auto; }
    .rawa-master .master-shell:not([hidden]) { height: auto; min-height: 100dvh; overflow: visible; }
    .rawa-master .master-aside { height: auto; min-height: 0; overflow: visible; }
    .rawa-master .master-picker-side,
    .rawa-master .master-auth-side { height: auto; min-height: 0; overflow: visible; }
}
@media (max-width: 390px) {
    #login-view > .login-art { padding: 12px 15px !important; }
    #login-view .login-art h2 { font-size: 22px !important; }
    #login-view > .login-card {
        width: calc(100% - 20px) !important;
        max-width: calc(100% - 20px) !important;
        margin-top: 9px !important;
    }
    #login-view .rawa-login-logo { width: min(184px, 68%) !important; }
    .rawa-master .master-filters { padding: 9px; }
    .rawa-master .master-detail { padding: 14px; }
    .rawa-master .master-detail-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 780px) and (max-height: 650px) {
    #login-view .login-art h2 { display: none !important; }
    #login-view > .login-art { padding-block: 12px !important; }
    #login-view .rawa-showcase-brand { margin-bottom: 0 !important; }
    #login-view > .login-card { margin-top: 8px !important; }
}
@media (prefers-reduced-motion: reduce) {
    #login-view .rawa-login-logo,
    .rawa-master .master-choice { transition: none !important; }
}
