/**
 * Arquivo: layout.css
 * Caminho: /gestao/public/assets/css/layout.css
 */

.main-content {
    margin-left: 270px;
    padding: 92px 24px 32px;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 270px;
    height: 100vh;
    z-index: 1000;
    overflow-y: auto;
    background:
        linear-gradient(rgba(15, 23, 42, 0.88), rgba(15, 23, 42, 0.88)),
        url('https://dfpanfletagem.com.br/wp-content/uploads/2025/06/banner-site-8.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #fff;
    border-right: 1px solid rgba(255,255,255,0.08);
    transition: transform .28s ease;
}

.sidebar-brand {
    padding: 20px 16px 14px;
    display: flex;
    justify-content: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
    width: 165px;
    max-width: 100%;
    object-fit: contain;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 18px 14px 28px;
    gap: 6px;
}

.sidebar-nav a {
    color: rgba(255,255,255,0.88);
    text-decoration: none;
    padding: 14px 12px;
    border-radius: 12px;
    font-weight: 700;
    transition: all .2s ease;
}

.sidebar-nav a:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

.sidebar-nav a.active {
    color: #fff;
    background: rgba(255,255,255,0.12);
    border-left: 4px solid var(--brand-green);
    padding-left: 10px;
}

.topbar {
    position: fixed;
    top: 0;
    left: 270px;
    right: 0;
    height: 68px;
    z-index: 900;
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 22px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.topbar-app {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.topbar-icon {
    width: 42px;
    height: 42px;
    object-fit: contain;
    flex-shrink: 0;
}

.topbar-brand-text {
    min-width: 0;
}

.topbar-brand-text strong {
    display: block;
    font-size: 16px;
    color: #111827;
    line-height: 1.1;
}

.topbar-subtitle {
    font-size: 13px;
    color: var(--muted);
    margin-top: 2px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.topbar-user {
    color: var(--muted);
    font-weight: 600;
}

.topbar-logout {
    color: #111827;
    text-decoration: none;
    font-weight: 700;
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: #f3f4f6;
    cursor: pointer;
    padding: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: #111827;
    border-radius: 999px;
}

.mobile-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.46);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
    z-index: 998;
}

.mobile-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 28px;
    margin-bottom: 6px;
}

.page-header p {
    color: var(--muted);
}

.panel {
    background: rgba(255,255,255,.96);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.flash {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 18px;
}

.flash-success {
    background: var(--success-bg);
    color: var(--success-text);
}

.flash-error {
    background: var(--error-bg);
    color: var(--error-text);
}

/* LOGIN */
body.login-page {
    overflow: hidden;
    height: 100vh;
}

body:not(.login-page) {
    overflow-x: hidden;
}

.login-page {
    background: linear-gradient(135deg, #111827 0%, #1f2937 55%, #374151 100%);
    min-height: 100vh;
}

.login-shell {
    height: 100vh;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    overflow: hidden;
}

.login-visual {
    position: relative;
    overflow: hidden;
    height: 100vh;
}

.login-hero {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.login-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(17,24,39,.35), rgba(17,24,39,.8));
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: #fff;
}

.login-logo {
    width: 240px;
    margin-bottom: 20px;
}

.login-overlay h1 {
    font-size: 38px;
    margin-bottom: 10px;
}

.login-overlay p {
    max-width: 520px;
    color: rgba(255,255,255,.88);
}

.login-card {
    margin: auto;
    width: min(460px, calc(100% - 40px));
    max-height: calc(100vh - 40px);
    overflow: auto;
    padding: 28px;
    background: rgba(255,255,255,.98);
}

.login-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.login-icon {
    width: 54px;
    height: 54px;
    object-fit: contain;
}

.login-form {
    margin-top: 18px;
}

.login-submit {
    width: 100%;
    margin-top: 8px;
}

.login-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

.slider-visual {
    position: relative;
    overflow: hidden;
    height: 100vh;
}

.slider-fade {
    position: absolute;
    inset: 0;
}

.slider-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
}

.slider-image.active {
    opacity: 1;
}

/* TABLET / MOBILE ADMIN */
@media (max-width: 900px) {
    .sidebar {
        width: 280px;
        left: 0;
        transform: translateX(-100%);
        box-shadow: 12px 0 30px rgba(15,23,42,.28);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .menu-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        z-index: 1200;
    }

    .topbar-user,
    .topbar-logout {
        display: none !important;
    }

    .topbar {
        left: 0 !important;
        right: 0;
        width: 100% !important;
        height: 64px;
        padding: 0 12px !important;
    }

    .topbar-left {
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
        flex: 1;
    }

    .topbar-app {
        min-width: 0;
        flex: 1;
    }

    .topbar-brand-text {
        min-width: 0;
        overflow: hidden;
    }

    .topbar-brand-text strong,
    .topbar-subtitle {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 80px 14px 22px !important;
    }

    .main-content,
    .page-header,
    .dashboard-main-grid,
    .dashboard-left-column,
    .dashboard-right-column {
        min-width: 0;
    }

    .page-header {
        flex-direction: column;
        gap: 10px;
    }

    body.menu-open {
        overflow: hidden;
    }
}

/* LOGIN RESPONSIVO */
@media (max-width: 960px) {
    .login-page {
        overflow: auto;
    }

    .login-shell {
        min-height: 100vh;
        height: auto;
        grid-template-columns: 1fr;
    }

    .login-visual {
        min-height: 280px;
        height: 280px;
    }

    .login-card {
        margin: 20px auto;
        max-height: none;
    }
}

/* MOBILE PEQUENO */
@media (max-width: 560px) {
    .topbar {
        padding: 0 10px !important;
    }

    .topbar-icon {
        width: 36px;
        height: 36px;
    }

    .topbar-brand-text strong {
        font-size: 14px;
    }

    .topbar-subtitle {
        font-size: 10px;
    }

    .main-content {
        padding: 78px 10px 18px !important;
    }

    .page-header h1 {
        font-size: 24px;
    }

    .sidebar-logo {
        width: 150px;
    }
}


.portal-overlay-custom {
    justify-content: flex-end;
    padding: 44px;
}

.portal-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.16);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: 16px;
}

.portal-overlay-custom h1 {
    font-size: 42px;
    line-height: 1.05;
    margin-bottom: 12px;
    max-width: 520px;
}

.portal-overlay-custom p {
    max-width: 560px;
    font-size: 18px;
    line-height: 1.55;
    color: rgba(255,255,255,0.9);
}

.portal-card-custom {
    width: min(520px, calc(100% - 56px));
    padding: 30px;
    border-radius: 24px;
    background: rgba(255,255,255,0.96);
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.22);
}

.portal-card-header-custom {
    margin-bottom: 22px;
}

.portal-options {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.portal-option {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 18px 18px;
    transition: all .22s ease;
    color: #111827;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.portal-option:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 122, 18, 0.32);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.10);
}

.portal-option-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #f8fafc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.portal-option-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.portal-option-content strong {
    font-size: 20px;
    line-height: 1.1;
    color: #111827;
}

.portal-option-content small {
    font-size: 14px;
    color: #6b7280;
    margin-top: 4px;
    line-height: 1.35;
}

.portal-option-arrow {
    margin-left: auto;
    font-size: 22px;
    color: #9ca3af;
    transition: transform .2s ease, color .2s ease;
}

.portal-option:hover .portal-option-arrow {
    transform: translateX(3px);
    color: var(--brand-orange);
}

.portal-option-primary {
    background: linear-gradient(135deg, rgba(255,122,18,.10), rgba(255,122,18,.18));
    border-color: rgba(255,122,18,.30);
}

.portal-option-primary .portal-option-icon {
    background: rgba(255,122,18,.12);
}

@media (max-width: 960px) {
    .portal-overlay-custom {
        padding: 26px 22px;
    }

    .portal-badge {
        font-size: 12px;
        padding: 7px 12px;
        margin-bottom: 12px;
    }

    .portal-overlay-custom h1 {
        font-size: 30px;
        max-width: 100%;
    }

    .portal-overlay-custom p {
        font-size: 15px;
        max-width: 100%;
    }

    .portal-card-custom {
        width: min(100%, calc(100% - 32px));
        padding: 22px;
        border-radius: 20px;
    }

    .portal-option {
        padding: 16px;
        border-radius: 16px;
    }

    .portal-option-content strong {
        font-size: 18px;
    }

    .portal-option-content small {
        font-size: 13px;
    }
}

@media (max-width: 560px) {
    .portal-overlay-custom h1 {
        font-size: 26px;
    }

    .portal-overlay-custom p {
        font-size: 14px;
    }

    .portal-option-icon {
        width: 42px;
        height: 42px;
        font-size: 20px;
        border-radius: 12px;
    }

    .portal-option-content strong {
        font-size: 17px;
    }

    .portal-option-arrow {
        font-size: 20px;
    }
}