/* ================================================
   SISTEMA ADMINISTRATIVO - ESTILOS LIMPOS
   ================================================ */

/* ---- VARIÁVEIS CSS ---- */
:root {
    --primary-color: #15868e;
    --primary-dark: #134f54;
    --primary-light: #1a9ba5;
    --secondary-color: #f8f9fa;
    --text-color: #333;
    --text-muted: #666;
    --border-color: #e9ecef;
    --hover-bg: #f8f9fa;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --sidebar-width: 250px;
}

/* ---- RESET E BASE ---- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: var(--text-color);
    line-height: 1.6;
}

/* ---- LAYOUT PRINCIPAL ---- */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

/* ---- SIDEBAR ---- */
#sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: 0;
    left: -var(--sidebar-width);
    height: 100vh;
    z-index: 999;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    transition: all 0.3s;
    overflow-y: auto;
}

#sidebar.active {
    left: 0;
}

#sidebar .sidebar-header {
    padding: 20px;
    background: rgba(0,0,0,0.1);
}

#sidebar .close-sidebar {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
    transition: background-color 0.3s;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#sidebar .close-sidebar:hover {
    background-color: rgba(255,255,255,0.1);
}

#sidebar ul.components {
    padding: 20px 0;
    list-style: none;
}

#sidebar ul li a {
    padding: 15px 25px;
    font-size: 1.1em;
    display: block;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
}

#sidebar ul li a:hover {
    background: rgba(255,255,255,0.1);
}

#sidebar ul li.active > a {
    background: rgba(255,255,255,0.2);
}

#sidebar ul li a i {
    margin-right: 10px;
    width: 20px;
}

/* ---- CONTEÚDO PRINCIPAL ---- */
#content {
    width: 100%;
    padding: 0;
    min-height: 100vh;
    transition: all 0.3s;
    margin-left: 0;
}

#content.active {
    margin-left: var(--sidebar-width);
}

/* Garantir que o conteúdo não fique atrás da sidebar em desktop */
@media (min-width: 769px) {
    #content {
        margin-left: var(--sidebar-width);
    }
    
    #sidebar {
        left: 0;
    }
    
    #sidebar.active {
        left: -var(--sidebar-width);
    }
    
    #content.active {
        margin-left: 0;
    }
}

/* ---- HEADER/NAVBAR ---- */
header {
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.logo {
    max-height: 40px;
    width: auto;
}

.navbar {
    padding: 0.5rem 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-btn {
    box-shadow: none;
    outline: none !important;
    border: none;
    background: transparent;
}

.custom-toggler {
    border: none;
    background: transparent;
    padding: 0.25rem 0.5rem;
    margin-right: 0.5rem;
}

.custom-toggler:focus {
    box-shadow: none;
    outline: none;
}

.custom-toggler .navbar-toggler-icon {
    background-image: none;
    width: 24px;
    height: 24px;
    color: white;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar-text {
    color: white !important;
    font-weight: 500;
    margin: 0;
    font-size: 0.9rem;
}

/* ---- RESPONSIVIDADE ---- */
@media (max-width: 768px) {
    #sidebar {
        left: -var(--sidebar-width);
    }
    
    #sidebar.active {
        left: 0;
    }
    
    #content {
        width: 100%;
        margin-left: 0;
    }
    
    #content.active {
        margin-left: 0;
    }
    
    .navbar-text {
        font-size: 0.8rem;
    }
}

/* ---- CARDS ---- */
.card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    background: white;
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: var(--secondary-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
}

.card-header .card-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.card-body {
    padding: 1.25rem;
}

/* ---- ESPAÇAMENTO PARA CONTEÚDO ---- */
.container-fluid {
    padding: 1rem;
}

@media (min-width: 769px) {
    .container-fluid {
        padding: 1.5rem;
    }
}

/* ---- FORMULÁRIOS ---- */
.form-group {
    margin-bottom: 1rem;
}

.form-actions {
    margin-top: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(21, 134, 142, 0.2);
}

/* ---- BOTÕES ---- */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
    line-height: 1.5;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn i {
    margin-right: 0.5rem;
}

/* ---- TABELAS ---- */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background-color: var(--secondary-color);
    font-weight: 600;
    color: var(--text-color);
}

.table tbody tr:hover {
    background-color: var(--hover-bg);
}

/* ---- ALERTAS ---- */
.alert {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

/* ---- LOGIN PAGE ---- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-page .logo-container {
    text-align: center;
    margin-bottom: 2rem;
}

.login-page .logo {
    max-width: 200px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.login-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 400px;
}

.login-container h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-weight: 600;
}

.login-container .form-group {
    margin-bottom: 1.5rem;
}

.login-container label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.login-container input[type="email"],
.login-container input[type="password"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.login-container input[type="email"]:focus,
.login-container input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(21, 134, 142, 0.1);
}

.login-container button[type="submit"] {
    width: 100%;
    padding: 0.875rem;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-container button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(21, 134, 142, 0.4);
}

/* ---- DASHBOARD ---- */
.dashboard-container {
    padding: 2rem 0;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.dashboard-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-color);
    margin: 0;
}

.stat-content p {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.9rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.dashboard-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem 1rem;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
    min-height: 180px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.dashboard-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: var(--primary-color);
    color: var(--primary-color);
    text-decoration: none;
}

.dashboard-btn i {
    font-size: 3rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.dashboard-btn span {
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
}

.dashboard-btn:hover i {
    transform: scale(1.1);
}

/* ---- PWA STYLES ---- */
.pwa-install-popup {
    position: fixed;
    bottom: -300px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    padding: 1.5rem;
    max-width: 350px;
    width: 90%;
    z-index: 1000;
    transition: bottom 0.3s ease;
}

.pwa-install-popup.show {
    bottom: 20px;
}

.pwa-install-popup .btn-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-muted);
}

.install-pwa-link {
    margin-top: 1rem;
    text-align: center;
}

.install-pwa-link a {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.install-pwa-link a:hover {
    opacity: 1;
}

.pwa-test-link {
    margin-top: 0.5rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 0.5rem;
}

.pwa-test-link a {
    color: #ffc107;
    text-decoration: none;
    font-size: 0.8rem;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.pwa-test-link a:hover {
    opacity: 1;
}

/* ---- SUPORTE MODAL ---- */
.suporte-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.suporte-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.suporte-modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    position: relative;
}

/* ---- RESPONSIVIDADE GERAL ---- */
@media (max-width: 768px) {
    .container-fluid {
        padding: 0.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .login-container {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .dashboard-btn {
        min-height: 150px;
        padding: 1.5rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .login-page {
        padding: 1rem;
    }
    
    .login-container {
        padding: 1rem;
    }
    
    .pwa-install-popup {
        width: 95%;
        padding: 1rem;
    }
}

/* ---- UTILITÁRIOS ---- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.mt-3 { margin-top: 1rem; }
.mb-3 { margin-bottom: 1rem; }
.p-0 { padding: 0; }
.d-none { display: none; }
.d-block { display: block; }
.w-100 { width: 100%; }
.mensagem { 
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}
.mensagem.sucesso { 
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.mensagem.erro { 
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.mensagem.aviso { 
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
} 