/* ============================================================
   Guarda-chuva Allure Goiânia — estilo do portal
   Baseado no design system das aplicações Allure
   (tema escuro, dourado, fontes PP Hatton + Outfit).
   ============================================================ */

@font-face {
    font-family: 'PP Hatton';
    src: url('fonts/PPHatton-Ultralight.ttf') format('truetype');
    font-weight: 300;
    font-display: swap;
}
@font-face {
    font-family: 'PP Hatton';
    src: url('fonts/PPHatton-Medium.otf') format('opentype');
    font-weight: 500;
    font-display: swap;
}
@font-face {
    font-family: 'PP Hatton';
    src: url('fonts/PPHatton-Bold.otf') format('opentype');
    font-weight: 700;
    font-display: swap;
}

:root {
    --bg: #181A10;
    --bg-2: #21231A;
    --bg-card: rgba(28, 30, 18, 0.92);
    --bg-card-hover: rgba(36, 38, 24, 0.98);
    --bg-input: rgba(24, 26, 16, 0.6);

    --gold-1: #8F6538;
    --gold-2: #9F7F44;
    --gold-3: #C3C26E;
    --gold-4: #E2EAA2;
    --gold-text: #D6C181;

    --cream: #F3EDDF;
    --cream-muted: rgba(243, 237, 223, 0.55);

    --border-gold: rgba(195, 194, 110, 0.18);
    --border-gold-hover: rgba(195, 194, 110, 0.45);

    --ok: #90C976;
    --erro: #ef6b6b;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse at 5% 5%, rgba(143, 101, 56, 0.09) 0%, transparent 45%),
        radial-gradient(ellipse at 95% 95%, rgba(101, 105, 80, 0.11) 0%, transparent 45%);
    color: var(--cream);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

a { color: inherit; }

/* ===== Ornamentos de fundo ===== */
.bg-ornament {
    position: fixed;
    border-radius: 50%;
    filter: blur(60px);
    z-index: 0;
    pointer-events: none;
}
.ornament-1 {
    width: 520px; height: 520px;
    background: radial-gradient(circle, rgba(143, 101, 56, 0.13) 0%, transparent 70%);
    top: -120px; left: -160px;
    animation: driftSlow 28s infinite alternate ease-in-out;
}
.ornament-2 {
    width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(101, 105, 80, 0.11) 0%, transparent 70%);
    bottom: -100px; right: -120px;
    animation: driftSlow 32s infinite alternate-reverse ease-in-out;
}
.ornament-3 {
    width: 280px; height: 280px;
    background: radial-gradient(circle, rgba(195, 194, 110, 0.07) 0%, transparent 70%);
    top: 48%; left: 44%;
    animation: driftSlow 22s infinite alternate ease-in-out;
    animation-delay: -9s;
}
@keyframes driftSlow {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(45px, 35px, 0); }
}

/* ===== Layout base ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 42px 56px;
    position: relative;
    z-index: 1;
}

/* ===== Header ===== */
.topo {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}
.header-logo { display: flex; align-items: center; justify-content: flex-start; }
.brand-logo-img {
    height: 78px; width: auto;
    filter: drop-shadow(0 0 12px rgba(195, 194, 110, 0.25));
}
.header-center { text-align: center; }
.page-title {
    font-family: 'PP Hatton', serif;
    font-size: 1.3rem;
    font-weight: 300;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    background: linear-gradient(130deg, #8F6538 0%, #C3C26E 50%, #E2EAA2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}
.page-sub {
    margin-top: 4px;
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--cream-muted);
}
.header-right { display: flex; justify-content: flex-end; }

.usuario-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}
.usuario-nome {
    font-size: 0.92rem;
    color: var(--cream);
}
.usuario-acoes { display: flex; gap: 10px; }
.link-acao {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold-text);
    text-decoration: none;
    padding: 6px 14px;
    border: 1px solid var(--border-gold);
    border-radius: 20px;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.link-acao:hover { border-color: var(--border-gold-hover); color: var(--gold-4); }
.link-sair:hover { border-color: rgba(239, 107, 107, 0.5); color: #f0a3a3; }

/* ===== Divider ===== */
.divider {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 26px;
    opacity: 0.5;
}
.divider-line {
    flex: 1; height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-3), transparent);
}
.divider-ornament { font-size: 0.85rem; color: var(--gold-3); }

/* ===== Card ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 18px;
    padding: 26px 28px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.card-glow {
    position: absolute;
    top: -40px; right: -40px;
    width: 180px; height: 180px;
    border-radius: 50%;
    background: var(--gold-3);
    opacity: 0.08;
    filter: blur(40px);
    pointer-events: none;
}

/* ===== Login ===== */
.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    position: relative;
    z-index: 1;
}
.login-card {
    width: 100%;
    max-width: 430px;
    padding: 40px 38px;
    text-align: center;
}
.login-logo { margin-bottom: 16px; }
.login-logo img {
    height: 230px; width: auto;
    filter: drop-shadow(0 0 22px rgba(195, 194, 110, 0.38));
    transition: transform 0.3s ease;
}
.login-logo img:hover {
    transform: scale(1.03);
}
.login-titulo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 2px;
    line-height: 1.1;
}
.login-titulo .portal-text {
    font-family: 'PP Hatton', serif;
    font-size: 1.35rem;
    font-weight: 300;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #a8844f 0%, #C3C26E 55%, #E2EAA2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
}
.login-titulo .cidade-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 300;
    letter-spacing: 0.42em;
    text-transform: uppercase;
    color: var(--gold-text);
    display: block;
    margin-top: 2px;
    padding-left: 0.42em; /* Centralização perfeita compensando o letter-spacing */
}
.login-sub {
    margin-top: 8px;
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--cream-muted);
}
.login-card form { text-align: left; }

/* ===== Formulários ===== */
.form-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--cream-muted);
    margin-bottom: 10px;
}
.campo-espaco { margin-top: 18px; }
.form-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-gold);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--cream);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.form-input::placeholder { color: var(--cream-muted); }
.form-input:focus {
    outline: none;
    border-color: var(--border-gold-hover);
    box-shadow: 0 0 0 3px rgba(195, 194, 110, 0.10);
}
.form-button {
    width: 100%;
    margin-top: 24px;
    padding: 15px 24px;
    border: 1px solid rgba(195, 194, 110, 0.45);
    border-radius: 14px;
    background: linear-gradient(130deg, rgba(143, 101, 56, 0.25) 0%, rgba(195, 194, 110, 0.18) 100%);
    color: var(--cream);
    font-family: 'Outfit', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.form-button:hover {
    transform: translateY(-2px);
    border-color: var(--gold-3);
    box-shadow: 0 12px 32px rgba(195, 194, 110, 0.18);
}
.form-button-link { text-decoration: none; }
.form-button-compacto { width: auto; margin-top: 0; padding: 14px 28px; }

/* ===== Flash / avisos ===== */
.flash {
    border-radius: 12px;
    padding: 13px 18px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    border: 1px solid var(--border-gold);
}
.flash-erro {
    background: rgba(239, 107, 107, 0.12);
    border-color: rgba(239, 107, 107, 0.4);
    color: #f0b4b4;
}
.flash-ok {
    background: rgba(144, 201, 118, 0.12);
    border-color: rgba(144, 201, 118, 0.4);
    color: #bfe0ac;
}

/* ===== Título de seção ===== */
.secao-titulo {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.secao-titulo h2 {
    font-family: 'PP Hatton', serif;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--cream);
    letter-spacing: 0.03em;
}
.secao-sub { font-size: 0.85rem; color: var(--cream-muted); }

/* ===== Grade de módulos ===== */
.modulos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 22px;
}
.modulo-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    padding: 26px 26px 22px;
    text-decoration: none;
    color: var(--cream);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.modulo-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-gold-hover);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    background: var(--bg-card-hover);
}
.modulo-icone {
    width: 60px; height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    border-radius: 16px;
    background: rgba(195, 194, 110, 0.10);
    border: 1px solid rgba(195, 194, 110, 0.22);
}
.modulo-info { flex: 1; }
.modulo-info h3 {
    font-family: 'PP Hatton', serif;
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 6px;
}
.modulo-info p {
    font-size: 0.9rem;
    color: var(--cream-muted);
    line-height: 1.5;
}
.modulo-abrir {
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold-text);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.modulo-card:hover .modulo-abrir span { transform: translateX(4px); }
.modulo-abrir span { transition: transform 0.22s ease; }

/* ===== Ícones Lucide Dourados Premium ===== */
.modulo-lucide-icon {
    width: 26px;
    height: 26px;
    color: var(--gold-text);
    stroke-width: 1.5px;
    transition: color 0.3s ease, filter 0.3s ease, transform 0.3s ease;
}
.modulo-card:hover .modulo-lucide-icon {
    color: var(--gold-4);
    filter: drop-shadow(0 0 8px rgba(226, 234, 162, 0.6));
    transform: scale(1.08);
}

/* ===== Indicador de Status Dinâmico (Health Check) ===== */
.modulo-status {
    position: absolute;
    top: 18px;
    right: 18px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(24, 26, 16, 0.5);
    border: 1px solid rgba(195, 194, 110, 0.08);
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--cream-muted);
    transition: all 0.3s ease;
    z-index: 2;
}
.modulo-card:hover .modulo-status {
    border-color: rgba(195, 194, 110, 0.22);
    background: rgba(24, 26, 16, 0.7);
    color: var(--cream);
}
.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

/* Estados do Health Check */
.status-dot.status-carregando {
    background-color: var(--gold-text);
    box-shadow: 0 0 6px var(--gold-text);
    animation: pulseGold 1.5s infinite ease-in-out;
}
.status-dot.status-online {
    background-color: var(--ok);
    box-shadow: 0 0 6px var(--ok);
    animation: pulseGreen 2.0s infinite ease-in-out;
}
.status-dot.status-offline {
    background-color: var(--erro);
    box-shadow: 0 0 6px var(--erro);
    animation: pulseRed 2.5s infinite ease-in-out;
}

@keyframes pulseGold {
    0% { box-shadow: 0 0 0 0 rgba(214, 193, 129, 0.7); }
    70% { box-shadow: 0 0 0 5px rgba(214, 193, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(214, 193, 129, 0); }
}
@keyframes pulseGreen {
    0% { box-shadow: 0 0 0 0 rgba(144, 201, 118, 0.7); }
    70% { box-shadow: 0 0 0 5px rgba(144, 201, 118, 0); }
    100% { box-shadow: 0 0 0 0 rgba(144, 201, 118, 0); }
}
@keyframes pulseRed {
    0% { box-shadow: 0 0 0 0 rgba(239, 107, 107, 0.7); }
    70% { box-shadow: 0 0 0 5px rgba(239, 107, 107, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 107, 107, 0); }
}

.vazio {
    padding: 40px;
    text-align: center;
    color: var(--cream-muted);
    border: 1px dashed var(--border-gold);
    border-radius: 16px;
}

/* ===== Administração ===== */
.admin-card { margin-bottom: 24px; }
.section-header {
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-gold);
}
.section-header h2 {
    font-family: 'PP Hatton', serif;
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--cream);
    letter-spacing: 0.03em;
}
.form-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 18px;
}
.form-inline .campo { flex: 1; min-width: 170px; }
.check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--cream-muted);
    padding-bottom: 14px;
    cursor: pointer;
}
.check input { width: 16px; height: 16px; accent-color: var(--gold-3); }

/* ===== Tabelas ===== */
.nota-tabela {
    font-size: 0.8rem;
    color: var(--cream-muted);
    margin: -10px 0 16px;
}
.tabela-wrap { overflow-x: auto; }
.tabela {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.tabela th {
    text-align: left;
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold-text);
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-gold);
    white-space: nowrap;
}
.tabela td {
    padding: 13px 14px;
    border-bottom: 1px solid rgba(195, 194, 110, 0.08);
    color: var(--cream);
    vertical-align: middle;
}
.tabela tr:hover td { background: rgba(195, 194, 110, 0.04); }
.vazio-celula { text-align: center; color: var(--cream-muted); padding: 26px; }

.tag {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
}
.tag-ok { background: rgba(144, 201, 118, 0.14); color: var(--ok); }
.tag-off { background: rgba(239, 107, 107, 0.14); color: var(--erro); }

.acoes-cel {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.form-senha { display: flex; gap: 6px; align-items: center; }
.btn-mini {
    background: rgba(195, 194, 110, 0.10);
    border: 1px solid var(--border-gold);
    border-radius: 10px;
    color: var(--cream);
    font-family: 'Outfit', sans-serif;
    font-size: 0.76rem;
    padding: 8px 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.btn-mini:hover {
    border-color: var(--border-gold-hover);
    background: rgba(195, 194, 110, 0.18);
}
.input-mini {
    background: var(--bg-input);
    border: 1px solid var(--border-gold);
    border-radius: 10px;
    color: var(--cream);
    font-family: 'Outfit', sans-serif;
    font-size: 0.82rem;
    padding: 8px 10px;
    width: 130px;
}
.input-mini:focus {
    outline: none;
    border-color: var(--border-gold-hover);
}

/* ===== Efeito Skeleton Shimmer Dourado Premium ===== */
.shimmer {
    background: linear-gradient(
        90deg,
        rgba(28, 30, 18, 0.6) 25%,
        rgba(143, 101, 56, 0.25) 50%,
        rgba(28, 30, 18, 0.6) 75%
    );
    background-size: 200% 100%;
    animation: loadingShimmer 1.6s infinite linear;
}
@keyframes loadingShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Transição de conteúdo dos cards */
.modulo-card {
    min-height: 190px;
    position: relative;
}
.modulo-card .modulo-conteudo-real {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
}
.modulo-card .modulo-skeleton {
    opacity: 1;
    transition: opacity 0.4s ease;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    position: absolute;
    top: 26px;
    left: 0;
    padding: 0 26px;
    pointer-events: none;
}
/* Quando o card não está mais carregando, oculta skeleton e mostra real */
.modulo-card:not(.loading) .modulo-conteudo-real {
    opacity: 1;
    visibility: visible;
}
.modulo-card:not(.loading) .modulo-skeleton {
    opacity: 0;
    display: none;
}

/* Placeholders do Skeleton */
.skeleton-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    border: 1px solid rgba(195, 194, 110, 0.08);
}
.skeleton-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.skeleton-title {
    width: 60%;
    height: 18px;
    border-radius: 4px;
}
.skeleton-desc {
    width: 80%;
    height: 14px;
    border-radius: 4px;
}
.skeleton-button {
    width: 30%;
    height: 12px;
    border-radius: 4px;
    margin-top: 6px;
}

/* Form Grid para CRUD */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    width: 100%;
}
.form-grid-full {
    grid-column: 1 / -1;
}
.form-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 14px;
    grid-column: 1 / -1;
}
.btn-secundario {
    background: transparent;
    border: 1px solid rgba(243, 237, 223, 0.2);
    color: var(--cream);
}
.btn-secundario:hover {
    border-color: rgba(243, 237, 223, 0.45);
    background: rgba(243, 237, 223, 0.05);
    transform: translateY(-2px);
}
.btn-deletar {
    border-color: rgba(239, 107, 107, 0.3);
    background: rgba(239, 107, 107, 0.05);
    color: #ffaeae;
}
.btn-deletar:hover {
    border-color: var(--erro);
    background: rgba(239, 107, 107, 0.15);
    color: #ff8c8c;
}

/* Busca rápida de logs */
.busca-wrap {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 18px;
}
.busca-input {
    width: 100%;
    max-width: 320px;
    background: var(--bg-input);
    border: 1px solid var(--border-gold);
    border-radius: 20px;
    padding: 10px 18px;
    color: var(--cream);
    font-family: 'Outfit', sans-serif;
    font-size: 0.88rem;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.busca-input::placeholder {
    color: var(--cream-muted);
}
.busca-input:focus {
    outline: none;
    border-color: var(--border-gold-hover);
    box-shadow: 0 0 0 3px rgba(195, 194, 110, 0.10);
}

/* Painel de Segurança RSA */
.rsa-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.rsa-info {
    flex: 1;
    min-width: 280px;
}
.rsa-info p {
    font-size: 0.92rem;
    color: var(--cream-muted);
    line-height: 1.6;
    margin-top: 8px;
}
.kid-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(195, 194, 110, 0.08);
    border: 1px solid var(--border-gold);
    border-radius: 6px;
    padding: 6px 12px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    color: var(--gold-text);
    font-weight: bold;
}

/* ===== Layout Unificado (Sidebar & IFrame) ===== */
.app-layout {
    width: 100vw;
    height: 100vh;
    display: flex;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

/* Sidebar */
.sidebar {
    width: 280px;
    height: 100%;
    background: var(--bg-card);
    border-right: 1px solid var(--border-gold);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 10;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-bottom: 1px solid rgba(195, 194, 110, 0.08);
}

.sidebar-logo-img {
    height: 52px;
    width: auto;
    filter: drop-shadow(0 0 10px rgba(195, 194, 110, 0.2));
    margin-bottom: 8px;
}

.sidebar-title {
    font-family: 'PP Hatton', serif;
    font-size: 0.95rem;
    font-weight: 300;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    background: linear-gradient(130deg, #8F6538 0%, #C3C26E 50%, #E2EAA2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-sub {
    font-size: 0.58rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--cream-muted);
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    text-decoration: none;
    color: var(--cream-muted);
    transition: all 0.22s ease;
}

.nav-item:hover {
    color: var(--cream);
    border-color: rgba(195, 194, 110, 0.12);
    background: rgba(195, 194, 110, 0.03);
}

.nav-item.active {
    color: var(--gold-text);
    border-color: var(--border-gold-hover);
    background: rgba(195, 194, 110, 0.08);
    font-weight: 500;
}

.nav-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-item-icon {
    width: 18px;
    height: 18px;
    color: var(--gold-text);
    stroke-width: 1.5px;
    transition: all 0.25s ease;
}

.nav-item.active .nav-item-icon,
.nav-item:hover .nav-item-icon {
    color: var(--gold-4);
    filter: drop-shadow(0 0 4px rgba(226, 234, 162, 0.4));
}

.nav-item-name {
    font-size: 0.88rem;
    letter-spacing: 0.02em;
}

.nav-item-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.nav-status-dot.status-carregando { background-color: var(--gold-text); }
.nav-status-dot.status-online { background-color: var(--ok); box-shadow: 0 0 4px var(--ok); }
.nav-status-dot.status-offline { background-color: var(--erro); }

.nav-external-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cream-muted);
    opacity: 0.35;
    transition: all 0.2s ease;
    padding: 3px;
    border-radius: 4px;
}

.nav-external-btn:hover {
    color: var(--gold-4);
    opacity: 1;
    background: rgba(195, 194, 110, 0.1);
    transform: scale(1.1);
}

.nav-external-icon {
    width: 13px;
    height: 13px;
    stroke-width: 2px;
}

.sidebar-footer {
    padding: 18px 14px;
    border-top: 1px solid rgba(195, 194, 110, 0.08);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-usuario {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 6px;
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(130deg, rgba(143, 101, 56, 0.25) 0%, rgba(195, 194, 110, 0.15) 100%);
    border: 1px solid var(--border-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gold-text);
    text-transform: uppercase;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-user-nome {
    font-size: 0.85rem;
    color: var(--cream);
    font-weight: 500;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.sidebar-user-status {
    font-size: 0.65rem;
    color: var(--cream-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.sidebar-user-actions {
    display: flex;
    gap: 6px;
}

.sidebar-btn-acao {
    flex: 1;
    text-align: center;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gold-text);
    border: 1px solid rgba(195, 194, 110, 0.25);
    border-radius: 8px;
    padding: 6px 4px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.sidebar-btn-acao:hover {
    border-color: var(--border-gold-hover);
    color: var(--gold-4);
    background: rgba(195, 194, 110, 0.03);
}

.sidebar-btn-sair:hover {
    border-color: rgba(239, 107, 107, 0.35);
    color: #f0a3a3;
    background: rgba(239, 107, 107, 0.03);
}

/* Área de Conteúdo Principal */
.main-content {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    background: var(--bg);
    overflow-y: auto;
}

/* IFrame e Cabeçalho do IFrame */
.iframe-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.iframe-header {
    height: 48px;
    background: #1c1e12;
    border-bottom: 1px solid var(--border-gold);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 5;
}

.iframe-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--gold-text);
    border: 1px solid rgba(195, 194, 110, 0.3);
    padding: 5px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}

.iframe-back-btn:hover {
    border-color: var(--border-gold-hover);
    color: var(--gold-4);
    background: rgba(195, 194, 110, 0.04);
}

.iframe-title {
    font-size: 0.85rem;
    color: var(--cream);
    font-weight: 500;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.iframe-security-tag {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    color: var(--ok);
    background: rgba(144, 201, 118, 0.06);
    border: 1px solid rgba(144, 201, 118, 0.15);
    padding: 3px 8px;
    border-radius: 12px;
}

.iframe-wrapper {
    flex: 1;
    width: 100%;
    position: relative;
    background: #181A10;
}

.modulo-iframe {
    width: 100%;
    height: 100%;
    border: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.modulo-iframe.loaded {
    opacity: 1;
}

/* Spinner de Carregamento Premium no Iframe */
.iframe-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    z-index: 2;
    gap: 16px;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.iframe-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.spinner-boutique {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(195, 194, 110, 0.1);
    border-radius: 50%;
    border-top-color: var(--gold-3);
    animation: spin 1s infinite linear;
}

.loader-text {
    font-size: 0.72rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--cream-muted);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Dashboard / Tela de Boas-Vindas */
.dashboard-welcome {
    width: 100%;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.welcome-container {
    width: 100%;
    max-width: 960px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 36px;
}

.welcome-header {
    text-align: center;
}

.welcome-logo-img {
    height: 84px;
    width: auto;
    filter: drop-shadow(0 0 14px rgba(195, 194, 110, 0.25));
    margin-bottom: 12px;
}

.welcome-title {
    font-family: 'PP Hatton', serif;
    font-size: 1.7rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    background: linear-gradient(130deg, #8F6538 0%, #C3C26E 50%, #E2EAA2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-sub {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--cream-muted);
    margin-top: 4px;
}

.welcome-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    max-width: 320px;
    margin: 10px auto 0;
    opacity: 0.45;
}

.welcome-divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-3), transparent);
}

.welcome-divider-ornament {
    font-size: 0.75rem;
    color: var(--gold-3);
}

.welcome-intro {
    font-size: 0.95rem;
    color: var(--cream);
    text-align: center;
    max-width: 580px;
    line-height: 1.6;
    margin-top: -10px;
}

.welcome-intro strong {
    color: var(--gold-text);
}

.welcome-sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
}

.welcome-modulo-card {
    text-decoration: none;
    color: var(--cream);
    min-height: auto;
    padding: 22px 24px;
    display: flex;
    gap: 16px;
    text-align: left;
    align-items: flex-start;
    justify-content: flex-start;
}

.welcome-modulo-card .modulo-conteudo-real {
    display: flex;
    flex-direction: row;
    gap: 16px;
    align-items: flex-start;
    text-align: left;
    opacity: 1;
    visibility: visible;
}

.welcome-modulo-card .modulo-icone {
    width: 48px;
    height: 48px;
    font-size: 1.4rem;
    flex-shrink: 0;
    border-radius: 12px;
}

.welcome-modulo-card .modulo-info {
    flex: 1;
}

.welcome-modulo-card .modulo-info h3 {
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.welcome-modulo-card .modulo-info p {
    font-size: 0.82rem;
    line-height: 1.4;
}

.welcome-modulo-card .modulo-abrir {
    margin-top: 10px;
    justify-content: flex-start;
    font-size: 0.68rem;
}

.welcome-modulo-card .modulo-status {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 3px 6px;
    font-size: 0.6rem;
}

/* Mobile Bar & Drawer Mobile overlays */
.mobile-bar {
    display: none;
    height: 56px;
    width: 100%;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-gold);
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    position: relative;
    z-index: 15;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.mobile-menu-toggle {
    background: transparent;
    border: none;
    color: var(--cream);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.mobile-menu-toggle:hover {
    border-color: var(--border-gold);
    background: rgba(195, 194, 110, 0.04);
}

.mobile-menu-icon {
    width: 22px;
    height: 22px;
}

.mobile-logo {
    display: flex;
    align-items: center;
}

.mobile-logo-img {
    height: 36px;
    width: auto;
}

.mobile-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(130deg, rgba(143, 101, 56, 0.25) 0%, rgba(195, 194, 110, 0.15) 100%);
    border: 1px solid var(--border-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--gold-text);
    text-transform: uppercase;
    cursor: pointer;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 95;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
}

/* Responsividade Mobile e Ajustes Finais */
@media (max-width: 900px) {
    .app-layout {
        flex-direction: column;
    }

    .mobile-bar {
        display: flex;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 100;
        transform: translateX(-100%);
        box-shadow: 15px 0 35px rgba(0, 0, 0, 0.55);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        height: calc(100% - 56px);
        width: 100%;
    }

    .welcome-container {
        padding: 10px 0;
    }

    .welcome-title {
        font-size: 1.35rem;
    }

    .welcome-sections-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Responsivo original (mantido para compatibilidade com login e admin) ===== */
@media (max-width: 720px) {
    .container { padding: 20px 18px 40px; }
    .topo {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }
    .header-logo, .header-right { justify-content: center; }
    .usuario-box { align-items: center; }
    .brand-logo-img { height: 64px; }
    .login-card { padding: 32px 24px; }
    .form-inline .campo { min-width: 100%; }
    .form-grid { grid-template-columns: 1fr; }
    .rsa-panel { flex-direction: column; align-items: stretch; text-align: center; }
    .rsa-panel button { width: 100%; }
}
