﻿/**
 * Folha de estilos principal.
 * ContÃ©m variÃ¡veis de cores, layout responsivo, componentes (cards, tabelas, botÃµes) e temas.
 */

@import url('reset.css');

:root {
    --bg-body: #f4f6f9;
    --bg-card: #ffffff;
    --text-main: #000000;
    --text-muted: #555555;
    --border-color: #e0e0e0;
    --input-bg: #ffffff;
    --primary: #143B21;
    --primary-rgb: 20, 59, 33;
    --primary-hover: #0f2b18;
    --btn-text: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --nav-bg: #ffffff;
    --nav-text: #000000;
    --btn-sair-bg: #143B21;
    --btn-sair-text: #ffffff;
}

body.dark-mode {
    --bg-body: #0a0a0a;
    --bg-card: #141414;
    --text-main: #ffffff;
    --text-muted: #aaaaaa;
    --border-color: #333333;
    --input-bg: #1f1f1f;
    --primary: #143B21;
    --primary-rgb: 20, 59, 33;
    --primary-hover: #0f2b18;
    --btn-text: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
    --nav-bg: #000000;
    --nav-text: #ffffff;
    --btn-sair-bg: #143B21;
    --btn-sair-text: #ffffff;
}

html {
    height: auto;
}


body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    padding-top: 70px;
    transition: background 0.3s, color 0.3s;
    min-height: 100vh;
    position: relative;
    padding-bottom: 120px;
    box-sizing: border-box;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover);
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background-color: var(--nav-bg);
    box-shadow: var(--shadow);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
}

.navbar-content {
    width: 100%;
    max-width: 1100px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 100%;
}

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

.impersonator-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #dc3545;
    color: white;
    text-align: center;
    padding: 5px;
    font-size: 12px;
    font-weight: bold;
    z-index: 2000;
}

.impersonator-link-back {
    color: white;
    text-decoration: underline;
    margin-left: 10px;
}

.impersonator-link-back:hover {
    color: #f8f9fa;
    text-decoration: none;
}

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

.link-danger {
    color: #dc3545 !important;
}


.logo img {
    height: 40px;
    /* Altura Fixa */
    width: auto;
    object-fit: contain;
    /* Garante que não distorça */
    display: none;
}

/* Logo Verde (Light Mode) */
body:not(.dark-mode) .logo-light {
    display: block;
    height: 40px;
}

/* Filtro para pintar a logo branca de verde (#143B21) */
.logo-painted-green {
    /* Filter generated for #143B21 */
    filter: brightness(0) saturate(100%) invert(16%) sepia(25%) saturate(2250%) hue-rotate(94deg) brightness(93%) contrast(93%) !important;
}

/* Logo Branca (Dark Mode) */
body.dark-mode .logo-dark {
    display: block;
    height: 40px;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    transition: color 0.3s;
    position: relative;
}

.nav-link:hover {
    color: var(--primary);
}

body.dark-mode .nav-link:hover,
body.dark-mode .nav-dropdown:hover .nav-link,
body.dark-mode .menu-card:hover .menu-title,
body.dark-mode .menu-card:hover p {
    color: #ffffff !important;
}

.btn-copy-mini {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 14px;
}

.btn-copy-mini:hover {
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.1);
}

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

.btn-toggle-creds {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-transform: none;
}

.btn-toggle-creds:hover {
    background: var(--primary);
    color: #fff;
}

.btn-toggle-creds.active {
    background: var(--text-muted);
    border-color: var(--text-muted);
    color: #fff;
}

/* Componentes de Credenciais Dashboard Premium */
.credentials-container {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cred-item {
    display: flex;
    align-items: center;
    background: rgba(var(--primary-rgb), 0.04);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 10px;
    transition: all 0.2s;
}

.cred-item:hover {
    background: rgba(var(--primary-rgb), 0.08);
    border-color: var(--primary);
}

.cred-icon {
    flex: 0 0 24px;
    color: var(--primary);
    font-size: 14px;
    display: flex;
    justify-content: center;
}

.link-card-ios {
    padding: 25px 20px !important;
    /* Mais espaço horizontal interno */
}

.cred-text {
    flex: 1;
    min-width: 0;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 10px;
    line-height: 1.4;
    display: block;
}

.btn-copy-action {
    flex: 0 0 30px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-copy-action:hover {
    color: var(--primary);
    transform: scale(1.1);
}

.btn-nav-logout {
    background: var(--btn-sair-bg);
    color: #ffffff !important;
    /* FIXED: White text forced */
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid var(--primary-hover);
    font-weight: bold;
    transition: background 0.3s;
    text-transform: uppercase;
}

.btn-nav-logout:hover {
    opacity: 0.8;
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    color: var(--text-muted);
    transition: color 0.3s;
    margin-right: 0;
}

.theme-toggle:hover {
    color: var(--primary);
}

/* Nav Dropdown Styles */
.nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--bg-card);
    min-width: 180px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    z-index: 1000;
    padding: 10px 0;
    margin-top: 5px;
    animation: fadeIn 0.2s ease-out;
}

/* Ponte invisível para evitar que o menu feche ao mover o mouse */
.nav-dropdown-content::after {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    width: 100%;
    height: 10px;
    background: transparent;
}

.nav-dropdown-content::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 20px;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid var(--border-color);
}

.nav-dropdown-content a {
    color: var(--text-main);
    padding: 10px 20px;
    text-decoration: none;
    display: block;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
    text-transform: none;
}

.nav-dropdown-content a:hover {
    background-color: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
}

body.dark-mode .nav-dropdown-content a {
    color: #b0b0b0 !important;
    /* Cinza claro */
}

body.dark-mode .nav-dropdown-content a:hover {
    color: #ffffff !important;
    /* Branco */
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.nav-dropdown:hover .nav-dropdown-content {
    display: block;
}

.nav-link i {
    font-size: 10px;
    margin-left: 5px;
    transition: transform 0.2s;
}

.nav-dropdown:hover .nav-link i {
    transform: rotate(180deg);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Dropdown Fixes */
@media (max-width: 991px) {
    .nav-dropdown {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .nav-dropdown-content {
        position: static;
        display: none;
        width: 100%;
        box-shadow: none;
        border: none;
        background: transparent;
        padding-left: 20px;
        margin-top: 0;
    }

    .nav-dropdown.active .nav-dropdown-content {
        display: block;
    }
}

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 25px;
    height: 18px;
    cursor: pointer;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--text-main);
    border-radius: 3px;
    transition: 0.3s;
}

.mobile-only-link {
    display: none;
}

.container {
    max-width: 1400px;
    margin: 30px auto;
    padding: 20px;
}

.login-container {
    background: var(--bg-card);
    padding: 40px;
    width: 100%;
    max-width: 320px;
    margin: 100px auto;
    border-radius: 8px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.card {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

h1,
h2,
h3 {
    color: var(--text-main);
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    background-color: var(--input-bg);
    color: var(--text-main);
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
    transition: border-color 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--input-bg) inset !important;
    -webkit-text-fill-color: var(--text-main) !important;
    transition: background-color 5000s ease-in-out 0s;
}

button {
    width: 100%;
    padding: 12px;
    background-color: var(--primary);
    color: var(--btn-text);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    transition: opacity 0.3s;
    text-transform: uppercase;
}

button:hover {
    opacity: 0.8;
}

.btn {
    display: inline-block;
    padding: 8px 20px;
    background: var(--primary);
    color: #ffffff;
    /* Contrast fix: White text on Dark Green */
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    width: auto;
    text-transform: uppercase;
    transition: opacity 0.2s;
}

.btn:hover {
    opacity: 0.8;
}

.btn-blue {
    background: var(--primary);
    color: #ffffff !important;
    /* Contrast fix */
}

.btn-new {
    background: #000000;
    color: #ffffff;
    /* Contrast fix: White text on Black */
}

body.dark-mode .btn-new {
    background: #ffffff;
    color: #000000;
}

.file-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    width: 100%;
    align-items: center;
}

.btn-download {
    flex-grow: 1;
    background: var(--primary);
    color: #000000;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 800;
    padding: 10px 0;
    text-align: center;
    text-transform: uppercase;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.btn-download:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-delete {
    width: 40px;
    height: 36px;
    background: #dc3545;
    color: #ffffff;
    border-radius: 4px;
    font-size: 16px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.2s;
}

.btn-delete:hover {
    background: #b02a37;
}

.file-tag {
    position: absolute;
    top: 5px;
    left: 5px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    color: #000;
    z-index: 5;
    text-transform: uppercase;
}

.tag-video {
    background-color: #f7a300;
}

.tag-pdf {
    background-color: #dc3545;
    color: #fff;
}

.tag-image {
    background-color: #51FFB4;
}

.tag-other {
    background-color: #6c757d;
    color: #fff;
}

.file-progress-item {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    position: relative;
    transition: opacity 0.5s;
}

.upload-status-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding-right: 30px;
}

.progress-bar-bg {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    margin-top: 5px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.2s;
}

.btn-cancel-upload {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #dc3545;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 15;
}

.btn-cancel-upload:hover {
    background: #b02a37;
}

.file-name {
    font-weight: 600;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th {
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
}

td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.status-dot {
    height: 10px;
    width: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}

.ativo {
    background-color: var(--primary);
    box-shadow: 0 0 5px var(--primary);
}

.inativo {
    background-color: #dc3545;
}

.badge-admin {
    background: #000000;
    color: var(--primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

body.dark-mode .badge-admin {
    background: #ffffff;
    color: #000000;
}

.badge-membro {
    background: var(--border-color);
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.slug-tag {
    background: var(--border-color);
    padding: 3px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
    color: var(--text-main);
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--primary);
}

input:checked+.slider:before {
    transform: translateX(26px);
    background-color: #000;
}

.msg-box {
    margin: 20px 0;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    font-weight: 600;
    font-size: 14px;
}

.msg-success {
    background-color: var(--primary);
    color: #ffffff;
    border: 1px solid var(--primary-hover);
}

.msg-error {
    background-color: #dc3545;
    color: #ffffff;
    border: 1px solid #b02a37;
}

.msg-blocked {
    background-color: #000000;
    color: var(--primary);
    padding: 20px;
    border-radius: 5px;
    text-align: center;
    margin-top: 10px;
    font-weight: 700;
    border: 1px solid var(--primary);
}

.menu-container {
    max-width: 1400px;
    margin: 50px auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* Força 3 colunas */
    gap: 30px;
}

.menu-card {
    background: var(--bg-card);
    color: var(--text-main);
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, border-color 0.2s;
}

.menu-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.disabled-card {
    opacity: 0.5;
    filter: grayscale(1);
    cursor: not-allowed;
    pointer-events: none;
    background-color: rgba(128, 128, 128, 0.1);
}

.icon {
    font-size: 35px;
    display: block;
    margin-bottom: 15px;
    filter: none;
    transition: transform 0.2s;
}

.icon-ios {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px auto;
    display: block;
    overflow: hidden;
    border-radius: 14px;
    /* iOS corner radius style */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
}

.icon-ios img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.menu-card:hover .icon-ios {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.menu-card:hover .icon {
    filter: grayscale(0%);
}

.menu-title {
    font-size: 18px;
    font-weight: 700;
    display: block;
    margin-bottom: 10px;
}

.welcome-bar {
    max-width: 1400px;
    margin: 30px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-main);
    flex-direction: column;
}

.preview-img {
    height: 100px;
    border-radius: 4px;
    margin-top: 10px;
    display: block;
    border: 1px solid var(--border-color);
}

.upload-area,
.upload-area-banner {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    background-color: var(--bg-card);
    transition: all 0.3s;
    position: relative;
}

.upload-area:hover,
.upload-area-banner:hover {
    border-color: var(--primary);
}

.upload-icon {
    font-size: 40px;
    color: var(--primary);
    margin-bottom: 10px;
}

.upload-text {
    font-size: 16px;
    color: var(--text-main);
    font-weight: 700;
}

.filter-bar {
    background: var(--bg-card);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-input {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--input-bg);
    color: var(--text-main);
    min-width: 150px;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

/* --- FILTER CHIPS --- */
.filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
    opacity: 0.6;
    background-color: var(--bg-body);
    color: var(--text-muted);
    user-select: none;
    text-transform: uppercase;
}

.filter-chip:hover {
    opacity: 1;
}

.filter-chip input {
    display: none;
}

.filter-chip:has(input:checked) {
    opacity: 1;
    color: #000000;
    border-color: var(--primary);
    background-color: var(--primary);
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    color: #000;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    white-space: nowrap;
    text-transform: uppercase;
}

.bg-red,
.filter-chip:has(input:checked).bg-red {
    background-color: #dc3545;
    color: #fff;
}

.bg-orange,
.filter-chip:has(input:checked).bg-orange {
    background-color: #fd7e14;
    color: #000;
}

.bg-green,
.filter-chip:has(input:checked).bg-green {
    background-color: var(--primary);
    color: #000;
}

.bg-blue,
.filter-chip:has(input:checked).bg-blue {
    background-color: #0d6efd;
    color: #fff;
}

.bg-teal,
.filter-chip:has(input:checked).bg-teal {
    background-color: #20c997;
    color: #000;
}

.bg-gray,
.filter-chip:has(input:checked).bg-gray {
    background-color: #6c757d;
    color: #fff;
}

.device-info {
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-muted);
    text-align: right;
}

.ip-tag {
    background: var(--bg-body);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    border: 1px solid var(--border-color);
}

.grid-arquivos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.card-arquivo {
    background: var(--bg-card);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s;
}

.card-arquivo:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
}

.preview-box {
    width: 100%;
    aspect-ratio: 3/4;
    background: var(--input-bg);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    position: relative;
}

.preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s;
}

.preview-box img:hover {
    transform: scale(1.05);
}

.file-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    color: var(--text-muted);
    cursor: pointer;
}

.file-placeholder:hover {
    color: var(--primary);
}

.file-icon-large {
    font-size: 40px;
    margin-bottom: 10px;
}

.meta-info {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 5px;
    border-top: 1px solid var(--border-color);
    padding-top: 5px;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: transparent;
    max-width: 95%;
    max-height: 95%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content img,
.modal-content video {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.modal-content iframe {
    width: 90vw;
    height: 85vh;
    background: white;
    border-radius: 4px;
    border: none;
}

.close-modal {
    position: absolute;
    top: -35px;
    right: 0;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: background 0.2s;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Fix: Garantir que o botÃ£o X nÃ£o apareÃ§a sem o modal estar ativo */
.modal-overlay:not(.active) .close-modal,
.modal-overlay:not(.active) .modal-content,
.modal-overlay:not(.active) .confirm-box {
    display: none;
}

/* Modal de ConfirmaÃ§Ã£o (Dialog) */
.confirm-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 10000;
}

.confirm-box h3 {
    margin-top: 0;
    color: var(--primary);
    font-size: 20px;
    margin-bottom: 15px;
}

.confirm-box p {
    color: var(--text-main);
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 25px;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-actions button {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 14px;
    transition: opacity 0.2s;
}

.confirm-actions button:hover {
    opacity: 0.9;
}

.confirm-actions .btn-cancel {
    background: #e0e0e0;
    color: #333;
}

body.dark-mode .confirm-actions .btn-cancel {
    background: #333;
    color: #eee;
}

.confirm-actions .btn-confirm {
    background: var(--primary);
    color: #fff;
}

.container,
.menu-container,
.login-container {
    min-height: auto;
}

.main-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 12px;
    padding: 20px 0;
    color: var(--text-muted);
    background: transparent;
    height: auto;
    opacity: 0.7;
}

.main-footer p {
    margin: 2px 0;
}

.main-footer .version {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 5px;
}

@media (max-width: 768px) {
    .nav-links {
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: var(--bg-card);
        flex-direction: column;
        align-items: center;
        gap: 0;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow);
        overflow: hidden;
        max-height: 0;
        transition: max-height 0.3s ease-in-out;
    }

    .nav-links.active {
        max-height: 400px;
    }

    .nav-link {
        width: 100%;
        text-align: center;
        padding: 20px;
        border-bottom: 1px solid var(--border-color);
    }

    .desktop-only {
        display: none;
    }

    .mobile-only-link {
        display: block;
    }

    .hamburger {
        display: flex;
    }
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
}

input:checked+.slider {
    background-color: #198754;
}

input:focus+.slider {
    box-shadow: 0 0 1px #198754;
}

input:checked+.slider:before {
    -webkit-transform: translateX(20px);
    -ms-transform: translateX(20px);
    transform: translateX(20px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.admin-impersonate-box {
    background: #fff3cd;
    padding: 15px;
    border: 1px solid #ffeeba;
    border-radius: 4px;
    margin-top: 20px;
    color: #856404;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-impersonate-box .btn {
    background: #856404;
    color: #fff;
    font-size: 12px;
    padding: 8px 15px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

body.dark-mode .admin-impersonate-box {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid #ffc107;
    color: #ffc107;
}

body.dark-mode .admin-impersonate-box .btn {
    background: #ffc107;
    color: #000;
}

/* --- TOAST NOTIFICATIONS (GLOBAL) --- */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    color: #ffffff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 400px;
    animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    position: relative;
    overflow: hidden;
    font-weight: 600;
    border: none;
}

/* Cores SÃ³lidas */
.toast.success {
    background-color: #28a745;
}

.toast.error {
    background-color: #dc3545;
}

.toast-icon {
    font-size: 22px;
    background: rgba(255, 255, 255, 0.2);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-content {
    flex: 1;
    font-size: 14px;
}

.toast.hide {
    animation: fadeOutRight 0.5s ease-in forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(120%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* --- FOOTER --- */
.main-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    text-align: center;
    background-color: transparent;
    border-top: none;
    color: var(--text-muted);
    font-size: 13px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 70px;
}

.main-footer .version {
    margin-left: 5px;
    font-weight: 700;
    opacity: 0.7;
}

@keyframes fadeOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

/* Modal de ConfirmaÃ§Ã£o Customizado */
/* Modal de ConfirmaÃ§Ã£o Customizado */
.confirm-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 400px;
    width: 90%;
    /* Responsivo em mobile */
    text-align: center;
    padding: 30px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.confirm-title {
    margin-bottom: 10px;
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--text-color);
    width: 100%;
}

.confirm-message {
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: var(--text-muted);
    width: 100%;
}

.confirm-actions {
    display: flex;
    flex-direction: row;
    /* Garante lado a lado */
    justify-content: center;
    gap: 15px;
    width: 100%;
    margin-top: 25px;
    /* Adicionado espaÃ§o extra */
}

.btn-cancel-modal,
.btn-confirm-modal {
    padding: 10px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
}

.btn-cancel-modal {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.btn-cancel-modal:hover {
    background: var(--bg-hover);
}

.btn-confirm-modal {
    background: #FF4444;
    color: white;
}

.btn-confirm-modal:hover {
    background: #ff2020;
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.3);
}

/* Footer - Ensure consistent styling */
main.main-content {
    min-height: calc(100vh - 120px);
    padding-bottom: 20px;
}

.main-footer {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center;
    padding: 20px 20px 40px;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: auto;
    width: 100%;
}

.main-footer>div {
    width: 100%;
    margin-bottom: 5px;
}

.main-footer a {
    color: var(--primary);
    font-weight: 600;
    transition: opacity 0.2s;
}

.main-footer a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Responsividade Mobile - Android First (Galaxy S21: 360x800) */
@media (max-width: 768px) {

    /* Navbar Mobile: Aumentar Ã¡rea de toque para mÃ­nimo 44x44px */
    .nav-link,
    .mobile-only-link {
        padding: 15px 20px !important;
        display: block !important;
        font-size: 14px !important;
        min-height: 44px;
        line-height: 1.5;
    }

    /* Link "SAIR" - destaque e tamanho adequado */
    .link-danger {
        padding: 18px 20px !important;
        font-size: 15px !important;
        font-weight: 800 !important;
        min-height: 48px;
    }

    /* Dashboard/Home: Cards compactos para caber 4 na tela */
    .menu-container {
        margin: 20px auto;
        padding: 0 5%;
        gap: 12px;
        grid-template-columns: 1fr;
    }

    .menu-card {
        padding: 20px 15px;
    }

    /* Reduzir Ã­cones e textos */
    .menu-card .icon {
        font-size: 28px;
        margin-bottom: 8px;
    }

    .menu-card .menu-title {
        font-size: 15px;
        margin-bottom: 5px;
    }

    .menu-card p {
        font-size: 12px;
        margin: 0;
        line-height: 1.4;
    }

    /* Boas-vindas mais compacto */
    .welcome-bar {
        margin: 15px auto 10px;
    }

    .welcome-bar h2 {
        font-size: 18px;
        margin: 0;
    }

    /* ReordenaÃ§Ã£o para Parceiro (mais usado primeiro) */
    /* Ordem original: RelatÃ³rios, Links, Materiais, Dados */
    /* Ordem mobile: RelatÃ³rios, Materiais, Links, Dados */
    .menu-card:nth-child(1) {
        order: 1;
    }

    /* RelatÃ³rios - mantÃ©m */
    .menu-card:nth-child(2) {
        order: 3;
    }

    /* Links - desce para 3Âº */
    .menu-card:nth-child(3) {
        order: 2;
    }

    /* Materiais - sobe para 2º */
    .menu-card:nth-child(4) {
        order: 4;
    }

    /* Centralizar títulos e cabeçalhos APENAS no mobile */
    h1,
    h2,
    h3,
    h4 {
        text-align: center;
    }

    .page-header,
    .page-header-title,
    .links-header h1,
    .materiais-header h1,
    .user-header h2,
    .welcome-bar h2 {
        text-align: center !important;
    }

    /* GLOBAL OVERRIDE FOR DOWNLOAD BUTTON */
    html body .materials-grid .btn-download,
    body.dark-mode .materials-grid .btn-download {
        background-color: #143B21 !important;
        color: #fff !important;
        background-image: none !important;
    }
}