/* ============================================================
   MAMANGUÁ GROUP - css/style.css
   Estilos globais + login centralizado + menu mobile flutuante
   ============================================================ */

/* ===== RESET E BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f4f4f4;
    color: #333;
    min-height: 100vh;
}

/* ===== LAYOUT PRINCIPAL ===== */
.wrapper { display: flex; min-height: 100vh; }

/* ===== SIDEBAR (menu lateral) - SEMPRE FLUTUANTE ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100vh;
    background: #1b4332;
    color: #fff;
    overflow-y: auto;
    z-index: 1060;
    box-shadow: 2px 0 10px rgba(0,0,0,0.2);
}
.sidebar-header {
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    margin-bottom: 8px;
}
.sidebar-header h3 { color: #f5e9c8; font-size: 18px; letter-spacing: 1px; }
.nav-links { list-style: none; }
.nav-links li { margin: 0; }
.nav-links a {
    display: block;
    padding: 12px 20px;
    color: #e8e8e8;
    text-decoration: none;
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: background 0.2s, color 0.2s;
}
.nav-links a:hover { background: #2d6a4f; color: #fff; }
.nav-links a.active { background: #2d6a4f; color: #fff; border-left-color: #f5e9c8; font-weight: 600; }
.nav-links .submenu { list-style: none; background: #16372a; }
.nav-links .submenu a { padding-left: 34px; font-size: 13px; }
.nav-links .submenu-toggle { cursor: pointer; }

/* ===== CONTEÚDO (desktop: deixa espaço para a sidebar fixa) ===== */
.content {
    margin-left: 250px;
    padding: 20px;
    min-height: 100vh;
    min-width: 0;
}
.top-bar { margin-bottom: 20px; }
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.section-header h2 { color: #1b4332; font-size: 22px; }

/* ===== CARDS ===== */
.card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}
.card h3 { color: #1b4332; margin-bottom: 12px; }
.section-subtitle { color: #1b4332; margin-bottom: 16px; font-size: 17px; }

/* ===== CARDS KPI ===== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}
.card-kpi {
    background: #fff;
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-left: 4px solid #1b4332;
}
.card-kpi h4 { font-size: 13px; color: #666; margin-bottom: 6px; }
.kpi-valor { font-size: 22px; font-weight: 700; color: #1b4332; }

/* ===== TABELAS ===== */
.table-geral {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.table-geral th, .table-geral td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}
.table-geral th { background: #f0f0f0; color: #333; font-weight: 600; }
.table-geral tr:hover { background: #f9f9f9; }
.table-geral .actions { white-space: nowrap; }

/* ===== FORMULÁRIOS ===== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 15px;
}
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full-width { grid-column: 1 / -1; }
.form-group label { font-weight: 600; font-size: 13px; color: #333; }
.form-group input,
.form-group select,
.form-group textarea {
    padding: 9px 11px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2d6a4f;
    box-shadow: 0 0 0 2px rgba(45,106,79,0.2);
}
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* ===== BOTÕES ===== */
.btn-primary {
    background: #1b4332;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 11px 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
}
.btn-primary:hover { background: #2d6a4f; }
.btn-link {
    color: #1b4332;
    background: transparent;
    border: none;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 0;
    display: inline-block;
}
.btn-link:hover { text-decoration: underline; }
.btn-pagar {
    background: #2d6a4f;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    display: inline-block;
}
.btn-edit { color: #1b4332; padding: 6px 8px; text-decoration: none; font-size: 13px; }
.btn-excluir { color: #b71c1c; padding: 6px 8px; text-decoration: none; font-size: 13px; }

/* ===== ALERTAS ===== */
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 15px; font-size: 14px; }
.alert-danger { background: #fdecea; color: #b71c1c; border: 1px solid #f5c6c2; }
.alert-success { background: #e8f5e9; color: #1b5e20; border: 1px solid #c8e6c9; }

/* ===== TEXTOS AUXILIARES ===== */
.text-muted { color: #888; font-size: 12px; }
.text-danger { color: #b71c1c; }

/* ============================================================
   LOGIN CENTRALIZADO (desktop + celular)
   ============================================================ */
body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    background: #1b4332; /* fundo verde do sistema */
}
.login-container {
    width: 100%;
    max-width: 380px;
    padding: 30px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    margin: 20px;
}
.login-container h2 {
    text-align: center;
    color: #1b4332;
    margin-bottom: 20px;
    font-size: 24px;
}
.login-container .form-group { margin-bottom: 15px; }
.btn-login {
    width: 100%;
    background: #1b4332;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 5px;
}
.btn-login:hover { background: #2d6a4f; }

/* ============================================================
   MENU MOBILE (hambúrguer) - flutuante em qualquer celular
   ============================================================ */
.btn-menu {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1100;
    background: #1b4332;
    color: #fff;
    border: none;
    border-radius: 6px;
    width: 44px;
    height: 44px;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.btn-menu:hover { background: #2d6a4f; }

.overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1050;
}
.overlay.show { display: block; }

/* ===== RESPONSIVO - TELAS PEQUENAS (celular/tablet) ===== */
@media (max-width: 900px) {
    .btn-menu { display: block; }

    /* Sidebar escondida fora da tela; abre flutuando POR CIMA do conteúdo */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1060;
    }
    .sidebar.open { transform: translateX(0); }

    /* No celular o conteúdo ocupa a tela toda (sidebar flutua por cima) */
    .content { margin-left: 0; padding: 70px 14px 20px; }
    .section-header h2 { font-size: 18px; }
    .cards-grid { grid-template-columns: 1fr 1fr; }
    .table-geral { font-size: 12px; }
    .table-geral th, .table-geral td { padding: 8px 6px; }
}

@media (max-width: 480px) {
    .cards-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .login-container { padding: 24px; margin: 15px; }
}