@import url('https://fonts.googleapis.com/css2?family=Exo:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #c0392b;
    /* Vermelho padrão conforme anexo */
    --secondary-color: #a93226;
    --accent-color: #f1c40f;
    /* Amarelo para badges/admin */
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-white: #ffffff;
    --border-radius: 8px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --sidebar-width: 260px;
    --sidebar-bg: #f5f5f5;
    /* Menu lateral cinza claro conforme anexo */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Exo', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

header {
    background-color: var(--primary-color);
    color: var(--text-white);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 1px;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: var(--text-white);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: var(--accent-color);
}

/* Sidebar Layout */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: #333;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    transition: all 0.3s;
    z-index: 1000;
    border-right: 1px solid #ddd;
}

.sidebar-header {
    padding: 1rem 1.5rem;
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--primary-color);
    color: white;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 1.5rem;
    color: #555;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar-nav li a i {
    width: 20px;
    text-align: center;
    color: var(--primary-color);
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
    background-color: #fff;
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
}

/* Cabeçalho Laranja Apenas para Painel de Controle */
.sidebar-nav li.nav-header-highlight {
    background: #e67e22;
    /* Laranja conforme solicitado */
    color: white;
    padding: 0.8rem 1.5rem;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Cabeçalhos de Seção Expansíveis (Cadastros, Escalas, etc) */
.sidebar-nav li.nav-item-togglable {
    padding: 0.8rem 1.5rem;
    font-weight: 600;
    color: #444;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background 0.2s;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.sidebar-nav li.nav-item-togglable:hover {
    background-color: #eaeaea;
    color: var(--primary-color);
}

.sidebar-nav li.nav-item-togglable i.nav-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.sidebar-nav li.nav-item-togglable.active {
    color: var(--primary-color);
    background-color: #f1f1f1;
}

.sidebar-nav li.nav-item-togglable.active i.nav-arrow {
    transform: rotate(180deg);
}

/* Submenus */
.sidebar-submenu {
    list-style: none;
    background-color: #f0f0f0;
    display: none;
    /* Oculto por padrão */
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
}

.sidebar-submenu.show {
    display: block;
}

.sidebar-submenu li a {
    padding: 0.7rem 1.5rem 0.7rem 2.5rem;
    /* Indentação maior */
    font-size: 0.85rem;
    border-bottom: none;
    color: #666;
}

.sidebar-submenu li a:hover,
.sidebar-submenu li a.active {
    color: var(--primary-color);
    background-color: #e2e2e2;
    border-left: 4px solid var(--primary-color);
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 1rem;
    background: #fff;
    border-top: 1px solid #ddd;
}

.user-footer-info {
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.btn-logout-full {
    display: block;
    width: 100%;
    text-align: center;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.8rem;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    background-color: var(--bg-color);
}

header.admin-header {
    background-color: white;
    color: var(--text-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin: 0 auto 2rem auto;
    border-radius: var(--border-radius);
    max-width: 1600px;
    width: 95%;
}

main {
    padding: 0;
    max-width: 1600px;
    width: 95%;
    margin: 0 auto;
}

.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s, opacity 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-accent {
    background-color: var(--accent-color);
    color: #000;
}

.btn:active {
    transform: scale(0.98);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th {
    background-color: #f8f9fa;
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid #dee2e6;
}

td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
}

.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
}

/* Grid Layout for Dashboard */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Botões de Ação na Tabela */
.actions {
    display: flex;
    gap: 8px;
}

.btn-action {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-size: 1rem;
}

.btn-edit {
    background-color: #e3f2fd;
    color: #1a237e;
}

.btn-edit:hover {
    background-color: #1a237e;
    color: white;
}

.btn-delete {
    background-color: #ffebee;
    color: #c0392b;
}

.btn-delete:hover {
    background-color: #c0392b;
    color: white;
}

/* Modais */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    overflow-y: auto;
    padding: 20px;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 500px;
    margin: 50px auto;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

@keyframes slideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    font-weight: bold;
    font-size: 1.2rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #f8f9fa;
}

/* Popup de Boas-Vindas Padronizado */
.welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-popup {
    background: white;
    width: 100%;
    max-width: 450px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: popupIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popupIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.welcome-header {
    background: var(--primary-color);
    padding: 30px;
    color: white;
}

.welcome-header i.crown {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 15px;
    display: block;
}

.welcome-body {
    padding: 30px;
}

.welcome-body h2 {
    font-size: 1.4rem;
    margin-bottom: 20px;
}

.user-badge-container {
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.rank-text {
    color: var(--primary-color);
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.level-badge {
    background: var(--accent-color);
    color: #000;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.8rem;
    display: inline-block;
}

.system-status {
    background: #e3f2fd;
    color: #01579b;
    padding: 12px;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: 500;
}

.btn-start {
    background: var(--primary-color);
    color: white;
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    text-transform: uppercase;
}