/* ============================================
   style.css - VERSÃO CORRIGIDA
   ============================================ */

/* ============================================
   RESET
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

:root {
    --primary: #1E1B48;
    --primary-dark: #120F2E;
    --accent: #8A8BA6;
    --background: #F5F6FA;
    --white: #FFFFFF;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background);
    color: #333;
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   HEADER LANDING PAGE
   ============================================ */
.landing-header {
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(30, 27, 72, 0.92);
    backdrop-filter: blur(12px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.landing-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
}

.landing-header .logo img {
    height: 35px;
    width: auto;
    display: block;
}

.landing-header .logo span {
    color: var(--accent);
}

.landing-header .nav-links {
    display: flex;
    gap: 15px;
    align-items: center;
}

.landing-header .nav-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    transition: 0.3s;
    font-size: 0.95rem;
}

.landing-header .nav-links a:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.landing-header .btn-login {
    border: 2px solid rgba(255,255,255,0.3);
}

.landing-header .btn-register {
    background: var(--accent);
    color: white;
}

.landing-header .btn-register:hover {
    background: #9899A6;
    transform: translateY(-2px);
}

/* ============================================
   HEADER LOGADO
   ============================================ */
.header-logado {
    background: var(--primary);
    padding: 10px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 60px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.header-logado .header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logado .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
}

.header-logado .logo img {
    height: 32px;
    width: auto;
    display: block;
}

.header-logado .logo span {
    color: var(--accent);
}

.header-logado .header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logado .user-name {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
}

.header-logado .btn-logout {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 5px;
    transition: 0.3s;
}

.header-logado .btn-logout:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

/* ============================================
   BOTÃO HAMBÚRGUER
   ============================================ */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    flex-direction: column;
    gap: 4px;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: 0.3s;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ============================================
   SIDEBAR - AJUSTADO PARA TOPO
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;                     /* ⭐ MUDEI DE 60px PARA 0 */
    left: 0;
    bottom: 0;
    width: 250px;
    background: var(--primary);
    padding: 0;
    z-index: 999;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    text-align: center;
    padding: 25px 15px 20px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-brand img {
    height: 55px;
    width: auto;
    display: block;
    margin: 0 auto 10px auto;
}

.sidebar-brand .brand-name {
    display: block;
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.2;
}

.sidebar-brand .brand-name span {
    color: #8A8BA6;
}

.sidebar-brand .brand-slogan {
    display: block;
    color: #8A8BA6;
    font-size: 0.7rem;
    font-weight: 300;
    margin-top: 2px;
    letter-spacing: 0.5px;
}

.sidebar-brand.center {
    text-align: center;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px 20px;
    float: right;
}

.sidebar nav ul {
    list-style: none;
    padding: 10px 0;
}

.sidebar nav ul li a {
    display: block;
    padding: 12px 25px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: 0.3s;
    font-size: 0.95rem;
}

.sidebar nav ul li a:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}

.sidebar nav ul li.active a {
    background: rgba(255,255,255,0.08);
    color: white;
    border-left: 3px solid var(--accent);
}

.sidebar .divider {
    height: 1px;
    background: rgba(255,255,255,0.05);
    margin: 10px 20px;
}

.sidebar .logout-link {
    color: rgba(255,100,100,0.7);
}

.sidebar .logout-link:hover {
    color: #ff6b6b;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;                     /* ⭐ MUDEI DE 60px PARA 0 */
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-left: 250px;
    margin-top: 60px;           /* Mantém espaço para o header */
    padding: 25px 30px;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header {
    margin-bottom: 20px;
    margin-top: 0;
    padding-top: 0;
}

.page-header h1 {
    color: var(--primary);
    font-size: 2rem;
    font-weight: 300;
    margin-top: 0;
}

.page-header p {
    color: #666;
    font-size: 1.05rem;
    margin-top: 5px;
}

/* ============================================
   HERO
   ============================================ */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px 30px;
    text-align: center;
    min-height: 70vh;
    flex: 1;
}

.hero-content {
    max-width: 900px;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
    color: white;
}

.hero-content h1 span {
    color: var(--accent);
}

.hero-content p {
    font-size: 1.1rem;
    opacity: 0.85;
    max-width: 700px;
    margin: 0 auto 30px;
    line-height: 1.7;
    color: white;
}

.hero-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-actions .btn-primary {
    padding: 14px 35px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 1.05rem;
    transition: 0.3s;
    display: inline-block;
    background: var(--accent);
    color: white;
}

.hero-actions .btn-primary:hover {
    background: #9899A6;
    transform: translateY(-3px);
}

.hero-actions .btn-outline {
    padding: 14px 35px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 1.05rem;
    transition: 0.3s;
    display: inline-block;
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    background: transparent;
}

.hero-actions .btn-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: white;
}

.hero-footer {
    margin-top: 30px;
}

.hero-footer h4 {
    font-size: 1.1rem;
    font-weight: 400;
    color: white;
}

.hero-footer h4 span {
    color: var(--accent);
    font-weight: 700;
}

.hero-footer p {
    font-size: 0.85rem;
    opacity: 0.4;
    margin-top: 5px;
    color: white;
}

/* ============================================
   SEÇÕES DA LANDING PAGE
   ============================================ */
.secao {
    padding: 60px 40px;
}

.secao-titulo {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
}

.secao-titulo span {
    color: var(--accent);
}

.secao-subtitulo {
    text-align: center;
    color: rgba(255,255,255,0.6);
    font-size: 1.05rem;
    margin-bottom: 35px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    max-width: 1100px;
    margin: 0 auto;
}

.card-recurso {
    background: rgba(255,255,255,0.05);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid rgba(255,255,255,0.08);
    text-align: center;
    transition: 0.3s;
}

.card-recurso:hover {
    transform: translateY(-5px);
    background: rgba(255,255,255,0.08);
    border-color: var(--accent);
}

.card-recurso .icon {
    font-size: 2.8rem;
    margin-bottom: 15px;
}

.card-recurso h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: white;
}

.card-recurso p {
    color: rgba(255,255,255,0.7);
    line-height: 1.6;
    font-size: 0.9rem;
}

#features {
    padding: 50px 40px;
    background: rgba(255,255,255,0.02);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    text-align: center;
    padding: 15px;
    color: rgba(255,255,255,0.25);
    font-size: 0.8rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* ============================================
   BOTÕES GERAIS
   ============================================ */
.btn-primary {
    padding: 12px 30px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    display: inline-block;
    transition: 0.3s;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    padding: 12px 30px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    display: inline-block;
    transition: 0.3s;
}

.btn-secondary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* ============================================
   FORMULÁRIOS
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--primary);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* ============================================
   TABELAS
   ============================================ */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

table thead {
    background: var(--primary);
    color: white;
}

table th,
table td {
    padding: 12px 20px;
    text-align: left;
}

table tbody tr:hover {
    background: #f8f9fa;
}

/* ============================================
   STATS CARDS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
    display: block;
    margin-top: 5px;
}

.quick-actions {
    display: flex;
    gap: 15px;
    margin: 20px 0 30px;
    flex-wrap: wrap;
}

/* ============================================
   RESPONSIVO
   ============================================ */

@media (max-width: 1024px) {
    .menu-toggle {
        display: flex !important;
    }
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        top: 0;                 /* ⭐ MANTÉM TOPO */
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .sidebar-close {
        display: block !important;
    }
    .sidebar-overlay.active {
        display: block !important;
    }
    .main-content {
        margin-left: 0 !important;
        padding: 15px !important;
    }
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
    .grid-3 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .header-logado {
        height: 55px;
        padding: 8px 15px;
    }
    .header-logado .logo img {
        height: 22px;
    }
    .header-logado .logo {
        font-size: 1rem;
    }
    .header-logado .user-name {
        display: none;
    }
    .sidebar {
        top: 0;                 /* ⭐ MANTÉM TOPO */
        width: 260px;
    }
    .sidebar-overlay {
        top: 0;                 /* ⭐ MANTÉM TOPO */
    }
    .sidebar-brand img {
        height: 40px;
    }
    .sidebar-brand .brand-name {
        font-size: 1rem;
    }
    .main-content {
        margin-top: 55px;
        padding: 12px !important;
    }
    .landing-header {
        flex-direction: column;
        padding: 12px 20px;
        gap: 10px;
    }
    .landing-header .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    .landing-header .nav-links a {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    .landing-header .logo img {
        height: 25px;
    }
    .landing-header .logo {
        font-size: 1.1rem;
    }
    .hero {
        padding: 140px 15px 30px !important;
        min-height: auto !important;
    }
    .hero-content h1 {
        font-size: 2rem !important;
    }
    .hero-content p {
        font-size: 1rem !important;
        padding: 0 10px !important;
    }
    .hero-actions {
        flex-direction: column !important;
        align-items: center !important;
    }
    .hero-actions a {
        width: 100% !important;
        max-width: 280px !important;
        text-align: center !important;
        padding: 12px 20px !important;
    }
    .grid-3 {
        grid-template-columns: 1fr !important;
    }
    .secao {
        padding: 40px 15px !important;
    }
    .secao-titulo {
        font-size: 1.8rem !important;
    }
    #features > div {
        grid-template-columns: 1fr !important;
    }
    .form-row {
        grid-template-columns: 1fr !important;
    }
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px !important;
    }
    table {
        font-size: 0.8rem !important;
        min-width: 600px !important;
    }
    table th,
    table td {
        padding: 8px 12px !important;
    }
    .btn-primary,
    .btn-secondary {
        width: 100% !important;
        text-align: center !important;
    }
    .acoes-rodape {
        flex-direction: column !important;
        gap: 10px !important;
    }
    .acoes-rodape button,
    .acoes-rodape a {
        width: 100% !important;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .quick-actions {
        flex-direction: column;
    }
    .quick-actions a {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .header-logado {
        height: 50px;
        padding: 5px 10px;
    }
    .header-logado .logo img {
        height: 18px;
    }
    .header-logado .logo {
        font-size: 0.85rem;
    }
    .sidebar {
        top: 0;                 /* ⭐ MANTÉM TOPO */
        width: 240px;
    }
    .sidebar-overlay {
        top: 0;                 /* ⭐ MANTÉM TOPO */
    }
    .sidebar-brand img {
        height: 35px;
    }
    .sidebar-brand .brand-name {
        font-size: 0.9rem;
    }
    .sidebar-brand .brand-slogan {
        font-size: 0.65rem;
    }
    .main-content {
        margin-top: 50px;
        padding: 10px !important;
    }
    .page-header h1 {
        font-size: 1.5rem !important;
    }
    .landing-header .logo img {
        height: 20px;
    }
    .hero-content h1 {
        font-size: 1.5rem !important;
    }
    .hero-content p {
        font-size: 0.9rem !important;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1025px) {
    .sidebar {
        transform: translateX(0) !important;
        top: 0;                 /* ⭐ MANTÉM TOPO */
    }
    .sidebar-close {
        display: none !important;
    }
    .sidebar-overlay {
        display: none !important;
    }
}

/* ============================================
   IMPRESSÃO
   ============================================ */
@media print {
    .header-logado,
    .landing-header,
    .sidebar,
    .footer,
    .nav-links,
    .btn,
    button {
        display: none !important;
    }
    .main-content {
        margin: 0 !important;
        padding: 20px !important;
    }
    .container {
        max-width: 100% !important;
    }
}