:root {
    --primary-color: #002b5e;
    --secondary-color: #004080;
    --accent-color: #0066cc;
    --bg-color: #f5f5f5;
    --border-color: #000;
    --success-color: #388e3c;
    --danger-color: #d32f2f;
}

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

body {
    font-family: Arial, sans-serif;
    background-color: var(--bg-color);
    color: #000;
    line-height: 1.5;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 850px;
    margin: auto;
    background: white;
    padding: 40px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 15px;
    background-color: #f0f0f0;
    border-radius: 8px;
}

.user-info {
    color: #555;
}

.header-titles {
    text-align: center;
    margin-bottom: 30px;
}

h1, h2, h3, h4 {
    margin: 5px 0;
}

h1 {
    font-size: 1.2em;
    font-weight: bold;
}

h2 {
    font-size: 1.1em;
    font-weight: normal;
}

h3 {
    font-size: 1em;
    font-weight: normal;
    margin-bottom: 20px;
}

h4 {
    font-size: 1.1em;
    margin-top: 30px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.form-group label {
    font-weight: normal;
    margin-bottom: 5px;
}

input[type="text"],
input[type="date"],
textarea {
    padding: 8px;
    border: none;
    border-bottom: 1px solid var(--border-color);
    font-family: inherit;
    background-color: transparent;
    outline: none;
    font-size: 0.95em;
}

textarea {
    border: 1px solid #ccc;
    resize: vertical;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

th, td {
    padding: 10px;
    border: none;
    border-bottom: 1px solid #ddd;
}

th {
    font-weight: bold;
    text-align: left;
    background-color: var(--primary-color);
    color: white;
}

.data-table {
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
}

.data-table thead tr {
    background-color: var(--primary-color);
    color: #ffffff;
    text-align: left;
    font-weight: bold;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
}

.data-table tbody tr {
    border-bottom: 1px solid #dddddd;
}

.data-table tbody tr:nth-of-type(even) {
    background-color: #f3f3f3;
}

.data-table tbody tr:last-of-type {
    border-bottom: 2px solid var(--primary-color);
}

.data-table tbody tr:hover {
    background-color: #f1f7ff;
    transition: background-color 0.2s ease;
}

/* Badges */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
    text-transform: uppercase;
}

.badge-primary { background-color: var(--primary-color); color: white; }
.badge-secondary { background-color: #6c757d; color: white; }
.badge-success { background-color: var(--success-color); color: white; }
.badge-danger { background-color: var(--danger-color); color: white; }
.badge-info { background-color: #17a2b8; color: white; }

.actions {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85em;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.dimension-row {
    font-weight: bold;
    background-color: #fff;
    padding-top: 20px;
}

.indicator-title {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.indicator-desc {
    font-size: 0.9em;
    color: #333;
    display: block;
}

.radio-group {
    display: flex;
    justify-content: space-between;
    width: 140px;
    margin: auto;
}

.radio-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.desc-label {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

.desc-label strong {
    margin-left: 5px;
    display: inline;
}

.desc-label .sub-desc {
    margin-left: 25px;
    font-size: 0.9em;
    color: #444;
}

.small-table {
    width: 50%;
    border: 1px solid #000;
}

.small-table th,
.small-table td {
    border: 1px solid #000;
    padding: 5px;
    text-align: left;
}

.result-box {
    margin: 10px 0;
    font-size: 1.1em;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 1em;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.btn:hover {
    opacity: 0.9;
}

.btn-secondary {
    background-color: #666;
}

.btn-export {
    background-color: var(--success-color);
}

.btn-logout {
    background-color: var(--danger-color);
    padding: 8px 16px;
    font-size: 0.9em;
}

#databaseView {
    margin-top: 40px;
    border-top: 2px dashed #ccc;
    padding-top: 20px;
}

.record-card {
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
}

.record-header {
    font-size: 1.1em;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.record-body {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.record-detail {
    font-size: 0.9em;
    margin-top: 8px;
    color: #555;
}

.record-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.record-footer em {
    color: #888;
    font-size: 0.85em;
}

.btn-delete {
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.85em;
    border-radius: 4px;
}

.btn-delete:hover {
    background-color: #b71c1c;
}

.promedio-badge {
    background-color: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
}

.error {
    color: var(--danger-color);
    padding: 10px;
    background-color: #ffebee;
    border-radius: 4px;
}

@media (max-width: 600px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .record-body {
        flex-direction: column;
        gap: 5px;
    }
}
