/* ═══════════════════════════════════════════════════════════════════
   N9 Área Restrita — Auth & Dashboard Styles
   Depende de: n9-brand.css (variáveis)
   ═══════════════════════════════════════════════════════════════════ */

/* ── AUTH VIEWS ─────────────────────────────────────────────────── */
.n9-auth-view {
    min-height: 100vh;
}

/* ── LOADING ────────────────────────────────────────────────────── */
#n9-view-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--n9-bg-light, #F8F9FA);
}

.n9-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--n9-gray-lighter, #D5DBDB);
    border-top-color: var(--n9-primary, #2C3E50);
    border-radius: 50%;
    animation: n9spin 0.8s linear infinite;
}

@keyframes n9spin {
    to { transform: rotate(360deg); }
}

/* ── LOGIN SCREEN ───────────────────────────────────────────────── */
#n9-view-login {
    display: none;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--n9-primary-dark, #1A252F) 0%, var(--n9-primary, #2C3E50) 100%);
}

.n9-login-card {
    background: var(--n9-white, #FFFFFF);
    border-radius: var(--n9-radius-xl, 16px);
    padding: 3rem 2.5rem;
    text-align: center;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.n9-login-card img.n9-login-logo {
    width: 160px;
    height: auto;
    margin-bottom: 1.5rem;
}

.n9-login-card h1 {
    font-family: var(--n9-font-primary, 'Inter', -apple-system, sans-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--n9-primary, #2C3E50);
    margin-bottom: 0.5rem;
}

.n9-login-card p {
    font-family: var(--n9-font-primary, 'Inter', -apple-system, sans-serif);
    color: var(--n9-text-light, #7F8C8D);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.n9-btn-google {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 32px;
    background: var(--n9-white, #FFFFFF);
    color: var(--n9-accent, #333333);
    border: 2px solid var(--n9-gray-lighter, #D5DBDB);
    border-radius: 8px;
    font-family: var(--n9-font-primary, 'Inter', -apple-system, sans-serif);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    text-decoration: none;
}

.n9-btn-google:hover {
    border-color: var(--n9-primary, #2C3E50);
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.15);
}

.n9-btn-google svg {
    width: 20px;
    height: 20px;
}

.n9-login-error {
    display: none;
    margin-top: 1rem;
    color: #c0392b;
    font-size: 0.85rem;
}

.n9-login-footer {
    margin-top: 2rem;
    font-size: 0.78rem;
    color: var(--n9-gray-neutral, #95A5A6);
}

/* ── DASHBOARD ──────────────────────────────────────────────────── */
#n9-view-dashboard {
    display: none;
    min-height: 100vh;
    background: var(--n9-bg-light, #F8F9FA);
}

/* User Bar */
.n9-user-bar {
    background: var(--n9-primary-dark, #1A252F);
    color: var(--n9-white, #FFFFFF);
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 2px solid var(--n9-gold, #C9A96E);
}

.n9-user-bar__left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.n9-user-bar__left a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--n9-white, #FFFFFF);
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 1px;
    font-family: var(--n9-font-primary, 'Inter', -apple-system, sans-serif);
}

.n9-user-bar__left img {
    height: 28px;
    width: auto;
}

.n9-user-bar__right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.n9-user-bar__info {
    text-align: right;
    line-height: 1.3;
}

.n9-user-bar__info .n9-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--n9-font-primary, 'Inter', -apple-system, sans-serif);
}

.n9-user-bar__info .n9-user-email {
    font-size: 0.72rem;
    opacity: 0.7;
    font-family: var(--n9-font-primary, 'Inter', -apple-system, sans-serif);
}

img.n9-user-photo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
}

.n9-btn-logout {
    padding: 6px 16px;
    background: transparent;
    color: var(--n9-white, #FFFFFF);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--n9-font-primary, 'Inter', -apple-system, sans-serif);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.n9-btn-logout:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.6);
}

/* ── TABS ───────────────────────────────────────────────────────── */
.n9-tabs-bar {
    background: var(--n9-white, #FFFFFF);
    border-bottom: 1px solid var(--n9-gray-lighter, #D5DBDB);
    padding: 0 2rem;
    display: flex;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.n9-tab-btn {
    padding: 14px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--n9-text-light, #7F8C8D);
    font-family: var(--n9-font-primary, 'Inter', -apple-system, sans-serif);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.n9-tab-btn:hover {
    color: var(--n9-primary, #2C3E50);
    background: var(--n9-bg-light, #F8F9FA);
}

.n9-tab-btn.active {
    color: var(--n9-primary, #2C3E50);
    font-weight: 700;
    border-bottom-color: var(--n9-gold, #C9A96E);
}

.n9-tab-panel {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* ── CARDS GRID (Ferramentas Web) ───────────────────────────────── */
.n9-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.n9-tool-card {
    background: var(--n9-white, #FFFFFF);
    border: 1px solid var(--n9-gray-lighter, #D5DBDB);
    border-radius: var(--n9-radius-lg, 12px);
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s;
    display: block;
}

.n9-tool-card:hover {
    box-shadow: var(--n9-shadow-lg, 0 10px 25px rgba(26,37,47,0.06), 0 20px 48px rgba(26,37,47,0.08));
    border-color: var(--n9-gold, #C9A96E);
    transform: translateY(-3px);
}

.n9-tool-card__icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.n9-tool-card__title {
    font-family: var(--n9-font-primary, 'Inter', -apple-system, sans-serif);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--n9-primary, #2C3E50);
    margin-bottom: 0.4rem;
}

.n9-tool-card__desc {
    font-family: var(--n9-font-primary, 'Inter', -apple-system, sans-serif);
    font-size: 0.82rem;
    color: var(--n9-text-light, #7F8C8D);
    line-height: 1.5;
}

/* ── DOCUMENT LIST (Normas, Regulamentos, etc.) ─────────────────── */
.n9-doc-section-title {
    font-family: var(--n9-font-primary, 'Inter', -apple-system, sans-serif);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--n9-primary, #2C3E50);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--n9-primary, #2C3E50);
}

.n9-doc-list {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
}

.n9-doc-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--n9-white, #FFFFFF);
    border: 1px solid var(--n9-gray-lighter, #D5DBDB);
    border-radius: var(--n9-radius-md, 8px);
    margin-bottom: 0.5rem;
    transition: box-shadow 0.2s;
}

.n9-doc-item:hover {
    box-shadow: var(--n9-shadow-sm, 0 1px 2px rgba(26,37,47,0.06));
}

.n9-doc-item__info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.n9-doc-item__icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.n9-doc-item__name {
    font-family: var(--n9-font-primary, 'Inter', -apple-system, sans-serif);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--n9-accent, #333333);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.n9-doc-item__meta {
    font-size: 0.75rem;
    color: var(--n9-text-light, #7F8C8D);
}

.n9-doc-item__actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    margin-left: 1rem;
}

.n9-btn-sm {
    padding: 6px 14px;
    border-radius: 4px;
    font-family: var(--n9-font-primary, 'Inter', -apple-system, sans-serif);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.n9-btn-sm--primary {
    background: var(--n9-primary, #2C3E50);
    color: var(--n9-white, #FFFFFF);
}

.n9-btn-sm--primary:hover {
    background: var(--n9-primary-dark, #1A252F);
}

.n9-btn-sm--secondary {
    background: var(--n9-bg-light, #F8F9FA);
    color: var(--n9-primary, #2C3E50);
    border: 1px solid var(--n9-gray-lighter, #D5DBDB);
}

.n9-btn-sm--secondary:hover {
    background: var(--n9-bg-alt, #ECF0F1);
}

/* ── LOGOS GRID (Identidade Visual) ─────────────────────────────── */
.n9-logos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.n9-logo-card {
    background: var(--n9-white, #FFFFFF);
    border: 1px solid var(--n9-gray-lighter, #D5DBDB);
    border-radius: var(--n9-radius-md, 8px);
    padding: 1rem;
    text-align: center;
}

.n9-logo-card__preview {
    width: 100%;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    border-radius: var(--n9-radius-sm, 4px);
    overflow: hidden;
}

.n9-logo-card__preview--dark {
    background: var(--n9-primary-dark, #1A252F);
}

.n9-logo-card__preview--light {
    background: var(--n9-bg-alt, #ECF0F1);
    border: 1px solid var(--n9-gray-lighter, #D5DBDB);
}

.n9-logo-card__preview img {
    max-width: 90%;
    max-height: 80px;
    object-fit: contain;
}

.n9-logo-card__name {
    font-size: 0.75rem;
    color: var(--n9-secondary, #555555);
    margin-bottom: 0.5rem;
    font-family: var(--n9-font-primary, 'Inter', -apple-system, sans-serif);
}

/* ── INTERNAL PAGE AUTH BAR ─────────────────────────────────────── */
.n9-auth-topbar {
    background: var(--n9-primary-dark, #1A252F);
    color: var(--n9-white, #FFFFFF);
    padding: 0.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1200;
    font-family: var(--n9-font-primary, 'Inter', -apple-system, sans-serif);
}

.n9-auth-topbar a {
    color: var(--n9-white, #FFFFFF);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.n9-auth-topbar a:hover {
    opacity: 1;
}

.n9-auth-topbar__back {
    display: flex;
    align-items: center;
    gap: 6px;
}

.n9-auth-topbar__right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .n9-login-card {
        padding: 2rem 1.5rem;
    }

    .n9-user-bar {
        padding: 0.5rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .n9-user-bar__info {
        display: none;
    }

    .n9-tabs-bar {
        padding: 0 0.5rem;
    }

    .n9-tab-btn {
        padding: 12px 14px;
        font-size: 0.78rem;
    }

    .n9-tab-panel {
        padding: 1rem;
    }

    .n9-cards-grid {
        grid-template-columns: 1fr;
    }

    .n9-logos-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .n9-doc-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .n9-doc-item__actions {
        margin-left: 0;
        width: 100%;
    }

    .n9-doc-item__actions .n9-btn-sm {
        flex: 1;
        justify-content: center;
    }

    .n9-auth-topbar {
        padding: 0.5rem 1rem;
    }
}

@media (max-width: 480px) {
    .n9-logos-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Iframe embed panels ───────────────────────────────────────── */
.n9-tab-panel--iframe {
    padding: 0;
    max-width: none;
}

.n9-embed-frame {
    width: 100%;
    height: calc(100vh - 120px);
    border: none;
    display: block;
}

/* ── PRINT ──────────────────────────────────────────────────────── */
@media print {
    .n9-user-bar,
    .n9-tabs-bar,
    .n9-auth-topbar,
    .n9-btn-logout {
        display: none !important;
    }
}
