/* =========================================
   SEDA - Global Stylesheet
   ========================================= */

/* --- 1. BASE & RESET --- */
body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    margin: 0;
}

/* Útil para telas que não são o dashboard */
.page-padding {
    padding: 20px;
}

/* --- 2. CONTAINERS & FORMS --- */
.container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 800px;
    margin: 40px auto; /* Centraliza a caixa na tela */
}

.container-sm {
    max-width: 400px; /* Para Login e Register */
}

/* Bordas superiores coloridas para separar visualmente as seções */
.border-top-green { border-top: 5px solid #28a745; }
.border-top-orange { border-top: 5px solid #f39c12; }
.border-top-blue { border-top: 5px solid #3498db; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px; }
.form-group { display: flex; flex-direction: column; margin-bottom: 15px; }
.form-group.full-width { grid-column: span 2; }

label { margin-bottom: 5px; color: #666; font-weight: bold; font-size: 14px; }
input[type="text"], input[type="number"], input[type="email"], input[type="password"], select { 
    padding: 10px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; width: 100%;
}

.checkbox-group { display: flex; flex-wrap: wrap; gap: 10px; }
.checkbox-group label { font-weight: normal; display: flex; align-items: center; gap: 5px; margin-bottom: 0; }

/* --- 3. TYPOGRAPHY & HEADER --- */
h2, h3 { margin-top: 0; color: #333; }
.text-center { text-align: center; }
.header-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }

/* --- 4. BUTTONS --- */
.btn { cursor: pointer; border: none; border-radius: 4px; font-weight: bold; text-align: center; text-decoration: none; display: inline-block; padding: 10px 15px; box-sizing: border-box; }
.btn-submit { width: 100%; padding: 12px; font-size: 16px; }
.btn-small { padding: 5px 10px; }

/* Cores Padrão dos Botões */
.btn-primary { background-color: #0056b3; color: white; }
.btn-primary:hover { background-color: #004494; }

.btn-success { background-color: #28a745; color: white; }
.btn-success:hover { background-color: #218838; }

.btn-warning { background-color: #f39c12; color: white; }
.btn-warning:hover { background-color: #d68910; }

.btn-info { background-color: #3498db; color: white; }
.btn-info:hover { background-color: #2980b9; }

.btn-danger-solid { background-color: #c0392b; color: white; }
.btn-danger-solid:hover { background-color: #a5281b; }

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

/* Botões de Ação na Tabela (texto puro) */
.btn-action { color: #3498db; background: none; font-weight: bold; padding: 0; margin-right: 10px; cursor: pointer; border: none; }
.btn-action.locked { color: #95a5a6; cursor: not-allowed; }
.btn-delete { color: #e74c3c; background: none; font-weight: bold; padding: 0; cursor: pointer; border: none; }
.btn-action:hover:not(.locked), .btn-delete:hover { text-decoration: underline; }

/* --- 5. TABLES --- */
table { width: 100%; border-collapse: collapse; background: white; box-shadow: 0 2px 4px rgba(0,0,0,0.1); border-radius: 8px; overflow: hidden; margin-bottom: 15px; }
th, td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #ddd; }
th { background-color: #2c3e50; color: white; text-transform: uppercase; font-size: 14px; }
tr:hover { background-color: #f1f1f1; }

/* Estilo específico para a tabela de diâmetros nos formulários */
#entriesTable th, #entriesTable td { text-align: center; border: 1px solid #ddd; }
#entriesTable th { background-color: #f8f9fa; color: #333; }

/* --- 6. BADGES, ALERTS & MESSAGES --- */
.badge { padding: 4px 8px; border-radius: 12px; font-size: 12px; font-weight: bold; color: white; }
.badge-global { background-color: #0056b3; }
.badge-private { background-color: #e67e22; }
.badge-admin { background-color: #28a745; }
.badge-warning { background-color: #f39c12; }

.admin-warning { padding: 15px; border-radius: 4px; margin-bottom: 20px; font-weight: bold; }
.warning-yellow { background-color: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.warning-blue { background-color: #e8f4f8; color: #2980b9; border: 1px solid #bce8f1; }

#messageBox { margin-bottom: 15px; padding: 10px; border-radius: 4px; text-align: center; display: none; }
.success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* --- 7. MODALS --- */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); justify-content: center; align-items: center; z-index: 1000; }
.modal-content { background: white; padding: 25px; border-radius: 8px; width: 550px; max-height: 80vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #ddd; padding-bottom: 10px; margin-bottom: 15px; }
.close-btn { background: none; border: none; font-size: 20px; cursor: pointer; color: #999; }
.country-group { margin-top: 20px; border-bottom: 2px solid #eee; padding-bottom: 5px; color: #2c3e50; font-size: 18px; }
.global-item { display: flex; justify-content: space-between; align-items: center; padding: 10px; border: 1px solid #eee; margin-top: 8px; border-radius: 4px; background-color: #fcfcfc; }

/* --- 8. DASHBOARD LAYOUT --- */
.dashboard-body { margin: 0; display: flex; height: 100vh; overflow: hidden; background-color: #f4f4f9; }
.sidebar { width: 250px; background-color: #2c3e50; color: white; display: flex; flex-direction: column; overflow-y: auto; }
.sidebar h2 { text-align: center; padding: 20px 0; margin: 0; background-color: #1a252f; font-size: 24px; color: white; }
.menu-group { margin-bottom: 10px; }
.menu-label { font-size: 12px; color: #7f8c8d; font-weight: bold; letter-spacing: 1px; margin: 15px 20px 5px 20px; text-transform: uppercase; }
.sidebar a { display: block; color: #ecf0f1; padding: 12px 20px; text-decoration: none; border-left: 3px solid transparent; transition: all 0.3s; font-size: 15px; }
.sidebar a:hover, .sidebar a.active { background-color: #34495e; border-left: 3px solid #3498db; }
.logout-btn { margin-top: auto; background-color: #c0392b; text-align: center; font-weight: bold; cursor: pointer; border: none; padding: 15px; color: white; font-size: 16px; width: 100%; display: block; }
.logout-btn:hover { background-color: #a5281b; }
.main-wrapper { flex: 1; display: flex; flex-direction: column; }
.dashboard-header { display: flex; justify-content: space-between; align-items: center; background: white; border-bottom: 1px solid #ddd; padding: 15px 30px; }
.dashboard-header h1 { margin: 0; color: #333; font-size: 20px; }
.viewport-iframe { flex: 1; border: none; width: 100%; height: 100%; background-color: transparent; }
#app { display: none; width: 100%; }
#loading { display: flex; justify-content: center; align-items: center; height: 100vh; width: 100vw; font-size: 20px; color: #666; }