/* SIEC - Estilos Globais */

:root {
    --cor-primaria: #00A2AC;
    --cor-secundaria: #005C66;
    --cor-fundo: #ffffff;
    --cor-fundo-claro: #f5f5f5;
    --cor-texto: #333333;
    --cor-texto-claro: #666666;
    --cor-borda: #e0e0e0;
    --cor-sucesso: #28a745;
    --cor-aviso: #ffc107;
    --cor-erro: #dc3545;
    --cor-info: #17a2b8;
}

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

html, body {
    height: 100%;
}

body {
    font-family: 'Literata', serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--cor-texto);
    background-color: var(--cor-fundo);
}

/* Tipografia */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Rethink Sans', sans-serif;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--cor-texto);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--cor-primaria);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--cor-secundaria);
}

/* Header */
header {
    background: linear-gradient(135deg, var(--cor-primaria) 0%, var(--cor-secundaria) 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Rethink Sans', sans-serif;
}

.logo img {
    height: 50px;
    width: auto;
}

.header-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.header-nav a {
    color: white;
    font-family: 'Rethink Sans', sans-serif;
    font-weight: 600;
    transition: opacity 0.3s ease;
}

.header-nav a:hover {
    opacity: 0.8;
}

/* Main */
main {
    flex: 1;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--cor-primaria) 0%, var(--cor-secundaria) 100%);
    color: white;
    padding: 4rem 1rem;
    text-align: center;
}

.hero h1 {
    color: white;
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    opacity: 0.95;
}

.hero-description {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.container-small {
    max-width: 600px;
}

/* Seções */
section {
    padding: 3rem 0;
}

.py-5 {
    padding: 3rem 0;
}

.py-4 {
    padding: 2rem 0;
}

.py-3 {
    padding: 1.5rem 0;
}

/* Grid */
.grid {
    display: grid;
    gap: 2rem;
    margin-bottom: 2rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Cards */
.card {
    background: white;
    border: 1px solid var(--cor-borda);
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.card-header {
    background: var(--cor-fundo-claro);
    padding: 1.5rem;
    border-bottom: 1px solid var(--cor-borda);
}

.card-title {
    margin: 0;
    font-size: 1.25rem;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1.5rem;
    background: var(--cor-fundo-claro);
    border-top: 1px solid var(--cor-borda);
}

/* Botões */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--cor-primaria);
    color: white;
    border: none;
    border-radius: 4px;
    font-family: 'Rethink Sans', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    text-decoration: none;
}

.btn:hover {
    background: var(--cor-secundaria);
    color: white;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-success {
    background: var(--cor-sucesso);
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: var(--cor-erro);
}

.btn-danger:hover {
    background: #c82333;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-info {
    background: var(--cor-info);
}

.btn-info:hover {
    background: #138496;
}

/* Formulários */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-family: 'Rethink Sans', sans-serif;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--cor-borda);
    border-radius: 4px;
    font-family: 'Literata', serif;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--cor-primaria);
    box-shadow: 0 0 0 3px rgba(0, 162, 172, 0.1);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* Tabelas */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

thead {
    background: var(--cor-fundo-claro);
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--cor-borda);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--cor-borda);
}

tbody tr:hover {
    background: var(--cor-fundo-claro);
}

/* Alertas */
.alert {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    border-color: var(--cor-sucesso);
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    border-color: var(--cor-erro);
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border-color: var(--cor-aviso);
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    border-color: var(--cor-info);
    color: #0c5460;
}

.alert-highlight {
    background: linear-gradient(135deg, #ffe5e5 0%, #fff0f0 100%);
    border: 2px solid var(--cor-erro);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.alert-highlight h2 {
    color: var(--cor-erro);
    margin-bottom: 1rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.35rem 0.65rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background: var(--cor-sucesso);
    color: white;
}

.badge-danger {
    background: var(--cor-erro);
    color: white;
}

.badge-warning {
    background: var(--cor-aviso);
    color: #333;
}

.badge-info {
    background: var(--cor-info);
    color: white;
}

.badge-primary {
    background: var(--cor-primaria);
    color: white;
}

.badge-secondary {
    background: #6c757d;
    color: white;
}

/* Utilitários */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--cor-texto-claro);
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

/* Footer */
footer {
    background: var(--cor-secundaria);
    color: white;
    padding: 1.5rem 0;
    margin-top: auto;
    font-size: 0.9rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left {
    flex: 1;
}

footer a {
    color: white;
    opacity: 0.8;
}

footer a:hover {
    opacity: 1;
}

/* Dashboard */
.dashboard-container {
    display: flex;
    min-height: calc(100vh - 100px);
}

.dashboard-sidebar {
    width: 250px;
    background: var(--cor-fundo-claro);
    border-right: 1px solid var(--cor-borda);
    padding: 2rem 0;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu a {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--cor-texto);
    font-family: 'Rethink Sans', sans-serif;
    font-weight: 600;
    transition: background 0.3s ease, color 0.3s ease;
    border-left: 4px solid transparent;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: white;
    color: var(--cor-primaria);
    border-left-color: var(--cor-primaria);
}

.dashboard-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* Responsivo */
@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .grid-3 {
        grid-template-columns: 1fr;
    }

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

    .header-nav {
        gap: 1rem;
    }

    .header-nav a {
        font-size: 0.9rem;
    }

    .dashboard-container {
        flex-direction: column;
    }

    .dashboard-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--cor-borda);
        padding: 1rem 0;
    }

    .sidebar-menu {
        display: flex;
        overflow-x: auto;
    }

    .sidebar-menu li {
        flex-shrink: 0;
    }

    .sidebar-menu a {
        padding: 0.75rem 1rem;
        border-left: none;
        border-bottom: 3px solid transparent;
    }

    .sidebar-menu a:hover,
    .sidebar-menu a.active {
        border-left: none;
        border-bottom-color: var(--cor-primaria);
    }

    .dashboard-content {
        padding: 1rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .grid-4 {
        grid-template-columns: 1fr;
    }

    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    table {
        font-size: 0.9rem;
    }

    th, td {
        padding: 0.75rem 0.5rem;
    }
}


/* ============================================
   HEADER PADRÃO
   ============================================ */

.header-padrao {
    background: linear-gradient(135deg, var(--cor-primaria) 0%, var(--cor-secundaria) 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Rethink Sans', sans-serif;
}

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

.logo-text {
    color: white;
}

.header-nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.nav-link {
    color: white;
    font-family: 'Rethink Sans', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-solicitacao {
    background: var(--cor-sucesso);
    color: white !important;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    font-weight: 700;
}

.btn-solicitacao:hover {
    background: #1e7e34;
}

.btn-login {
    background: rgba(255, 255, 255, 0.2);
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.btn-login:hover {
    background: rgba(255, 255, 255, 0.3);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    padding-left: 1rem;
}

.usuario-nome {
    color: white;
    font-family: 'Rethink Sans', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
}

.btn-logout {
    background: var(--cor-erro);
    color: white !important;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.btn-logout:hover {
    background: #c82333;
}

/* ============================================
   FOOTER PADRÃO
   ============================================ */

.footer-padrao {
    background: linear-gradient(135deg, var(--cor-secundaria) 0%, #003d47 100%);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-section h4 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-family: 'Rethink Sans', sans-serif;
}

.footer-section p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    opacity: 0.9;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: white;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.footer-section a:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer-copyright {
    font-size: 0.85rem;
    opacity: 0.8;
}

.footer-bottom {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ============================================
   ADMIN SIDEBAR
   ============================================ */

.admin-sidebar {
    background: white;
    border-right: 1px solid var(--cor-borda);
    height: calc(100vh - 80px);
    overflow-y: auto;
    position: fixed;
    left: 0;
    top: 80px;
    width: 250px;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transform: translateX(0);
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 2px solid var(--cor-primaria);
    background: linear-gradient(135deg, var(--cor-primaria) 0%, var(--cor-secundaria) 100%);
    color: white;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-family: 'Rethink Sans', sans-serif;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.sidebar-menu {
    list-style: none;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    color: var(--cor-texto);
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    font-family: 'Rethink Sans', sans-serif;
    font-weight: 600;
}

.menu-item:hover {
    background: var(--cor-fundo-claro);
    border-left-color: var(--cor-primaria);
    color: var(--cor-primaria);
}

.menu-item.active {
    background: var(--cor-fundo-claro);
    border-left-color: var(--cor-primaria);
    color: var(--cor-primaria);
}

.menu-icon {
    font-size: 1.2rem;
}

.menu-text {
    flex: 1;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--cor-borda);
    background: var(--cor-fundo-claro);
}

.user-info {
    margin-bottom: 1rem;
}

.user-name {
    font-weight: 700;
    color: var(--cor-texto);
    margin-bottom: 0.25rem;
    font-family: 'Rethink Sans', sans-serif;
}

.user-role {
    font-size: 0.85rem;
    color: var(--cor-texto-claro);
}

.btn-logout-sidebar {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background: var(--cor-erro);
    color: white !important;
    text-align: center;
    border-radius: 4px;
    font-weight: 600;
    font-family: 'Rethink Sans', sans-serif;
    transition: background 0.3s ease;
}

.btn-logout-sidebar:hover {
    background: #c82333;
}

/* ============================================
   MAIN CONTENT COM SIDEBAR
   ============================================ */

.main-content {
    margin-left: 250px !important;
    padding: 2rem;
    max-width: 1400px;
    margin-right: auto;
}

/* Frontend - sem sidebar */
body:not(.has-admin) .main-content {
    margin-left: 0 !important;
    padding: 0;
    max-width: 100%;
}

/* ============================================
   MENU RESPONSIVO - MOBILE
   ============================================ */

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 1rem;
}

.menu-toggle:hover {
    opacity: 0.8;
}

/* Desktop: Menu fixo, conteudo ao lado - APENAS NO ADMIN */
body.has-admin .admin-sidebar {
    position: fixed;
    left: 0;
    top: 80px;
    width: 250px;
    height: calc(100vh - 80px);
    transform: translateX(0);
    z-index: 100;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

body.has-admin .main-content {
    margin-left: 250px;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

body:not(.has-admin) .admin-sidebar {
    display: none;
}

body:not(.has-admin) .main-content {
    margin-left: 0;
}

.menu-toggle {
    display: none;
}

/* Tablet/Mobile: Menu responsivo com hamburger */
@media (max-width: 768px) {
    .admin-sidebar {
        position: fixed;
        left: 0;
        top: 80px;
        width: 100%;
        max-width: 250px;
        height: calc(100vh - 80px);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    }

    .admin-sidebar.active {
        transform: translateX(0);
    }

    .menu-toggle {
        display: block;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .menu-item {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }

    .menu-text {
        display: none;
    }

    .menu-item.active .menu-text,
    .admin-sidebar.active .menu-text {
        display: inline;
    }

    .menu-icon {
        font-size: 1.5rem;
    }

    .admin-sidebar.active .menu-icon {
        margin-right: 0.5rem;
    }
}

@media (max-width: 480px) {
    .admin-sidebar {
        max-width: 100%;
    }

    .header-container {
        padding: 0 0.5rem;
    }

    .logo {
        gap: 0.25rem;
        font-size: 1.2rem;
    }

    .logo img {
        height: 40px;
    }

    .header-nav {
        gap: 0.5rem;
        font-size: 0.9rem;
    }

    .menu-toggle {
        margin-right: 0.5rem;
    }

    .main-content {
        padding: 0.75rem;
    }
}
