:root {
    --primary-color: #7734eb;
    --secondary-color: #4a00e0;
    --accent-color: #8e65ff;
    --background-color: #121212;
    --surface-color: #1e1e1e;
    --text-color: #e0e0e0;
    --text-secondary: #adadad;
    --success-color: #4caf50;
    --error-color: #f44336;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* Header and Logo Styles - Refactored */
header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
    text-align: center;
}

.logo-wrapper {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible;
}

.logo-image {
    width: 160%;
    height: 160%;
    object-fit: contain;
    border-radius: 0;
    display: block;
}

/* Reset any potential circular styles for all images in header */
header img {
    border-radius: 0;
}

h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--accent-color);
}

h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

main {
    background-color: var(--surface-color);
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.info-section {
    margin-bottom: 30px;
}

.info-section p, .consent-text p {
    margin-bottom: 15px;
}

.info-section ul {
    margin-left: 30px;
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

input[type="text"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #444;
    border-radius: 5px;
    background-color: #2a2a2a;
    color: var(--text-color);
    font-family: inherit;
    font-size: 1rem;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(119, 52, 235, 0.3);
}

.radio-group {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

input[type="radio"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

.authorization-options {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    margin-top: 25px;
    margin-bottom: 25px;
}

.authorization-options p {
    margin-bottom: 15px;
    font-weight: 500;
}

.form-actions {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

button {
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

/* Styles for download link */
#downloadPdfLink {
    text-decoration: none;
    display: inline-block;
}

#downloadPdfLink button {
    margin-top: 10px;
    background-color: var(--accent-color);
}

footer {
    text-align: center;
    padding: 20px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.admin-link {
    color: var(--accent-color);
    text-decoration: none;
    margin-top: 10px;
    display: inline-block;
}

.admin-link:hover {
    text-decoration: underline;
}

.hidden {
    display: none !important;
}

#confirmation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.confirmation-content {
    background-color: var(--surface-color);
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
}

.fa-check-circle {
    font-size: 4rem;
    color: var(--success-color);
    margin-bottom: 20px;
}

#closeConfirmation {
    margin-top: 20px;
    background-color: #555;
}

#closeConfirmation:hover {
    background-color: #444;
}

/* Estilos para el panel de administración */
.admin-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: var(--surface-color);
    padding: 20px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
}

.main-content {
    flex: 1;
    padding: 20px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.sidebar-logo img {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    border-radius: 0; /* Explicitly reset border-radius for sidebar logo */
}

.sidebar-logo h3 {
    font-size: 1.2rem;
    margin-bottom: 0;
}

.nav-links {
    list-style: none;
}

.nav-links li {
    margin-bottom: 10px;
}

.nav-links a {
    display: flex;
    align-items: center;
    color: var(--text-color);
    text-decoration: none;
    padding: 10px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.nav-links a:hover, .nav-links a.active {
    background-color: rgba(119, 52, 235, 0.2);
}

.nav-links i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--surface-color);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: var(--surface-color);
    border-radius: 10px;
    overflow: hidden;
}

.data-table th, .data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #333;
}

.data-table th {
    background-color: rgba(119, 52, 235, 0.1);
    color: var(--primary-color);
    font-weight: 500;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.actions-cell {
    display: flex;
    gap: 10px;
}

.btn-action {
    padding: 6px 10px;
    font-size: 0.9rem;
}

.btn-view {
    background-color: var(--accent-color);
}

.btn-download {
    background-color: #4caf50;
}

.filters {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-item {
    min-width: 200px;
}

.export-buttons {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.auth-status {
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: 500;
}

.auth-yes {
    background-color: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.auth-no {
    background-color: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.login-container {
    max-width: 400px;
    margin: 100px auto;
    background-color: var(--surface-color);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo img {
    width: 80px;
    height: 80px;
    border-radius: 0; /* Explicitly reset border-radius for login logo */
}

.login-title {
    text-align: center;
    margin-bottom: 30px;
}

/* Fix para imágenes circulares - Asegura que ninguna imagen del sistema tenga border-radius */
img[class*="logo"],
.logo-image,
header img,
.sidebar-logo img,
.login-logo img {
    border-radius: 0 !important;
    -webkit-border-radius: 0 !important;
    -moz-border-radius: 0 !important;
}

@media (max-width: 768px) {
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .admin-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        margin-bottom: 20px;
    }
    
    .data-table {
        display: block;
        overflow-x: auto;
    }
}