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

:root {
    --primary-blue: #003DA5;
    --primary-yellow: #FFD700;
    --dark-blue: #001F5C;
    --light-bg: #f8f9fa;
    --text-dark: #1a1a1a;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--dark-blue) 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 8px rgba(0, 61, 165, 0.2);
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand-link {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.2s;
}

.navbar-logo:hover {
    transform: scale(1.05);
}

.login-logo {
    max-width: 400px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 1.5rem;
}

.form-logo {
    max-width: 400px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 1.5rem;
}

.navbar-menu {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.user-info {
    font-size: 0.9rem;
    color: #bdc3c7;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-link.logout {
    background-color: #e74c3c;
}

.nav-link.logout:hover {
    background-color: #c0392b;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--dark-blue) 100%);
    color: white;
    font-weight: 600;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--dark-blue) 0%, #000d3a 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 61, 165, 0.3);
}

.btn-secondary {
    background-color: var(--primary-yellow);
    color: var(--primary-blue);
    font-weight: 600;
}

.btn-secondary:hover {
    background-color: #ffc700;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
    display: block;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: inherit;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="email"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 61, 165, 0.1);
}

.radio-group {
    display: flex;
    gap: 1.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
}

.radio-label input[type="radio"] {
    cursor: pointer;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--dark-blue) 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.login-title {
    text-align: center;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.login-subtitle {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.login-form {
    margin-bottom: 1.5rem;
}

.login-footer {
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Form Page */
.form-page {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--dark-blue) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.form-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.form-box {
    background: white;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.form-box h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.form-subtitle {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 2rem;
}

.annotation-form {
    margin-bottom: 1.5rem;
}

.form-footer {
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Autocomplete */
.autocomplete-input {
    position: relative;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
}

.autocomplete-list li {
    padding: 0.8rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.autocomplete-list li:hover {
    background-color: #f0f0f0;
}

/* Messages */
.message {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    display: none;
}

.message-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Dashboard */
.dashboard-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filters-section {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.filters-form {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.filter-select {
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 200px;
}

/* Tables */
.employees-table {
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #495057;
}

table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #dee2e6;
}

.sort-link {
    color: #495057;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.sort-link:hover {
    color: #212529;
    text-decoration: underline;
}

.sort-arrow {
    font-size: 0.75rem;
}

.sort-arrow-inactive {
    opacity: 0.35;
}

table tbody tr:hover {
    background-color: #f8f9fa;
}

.text-center {
    text-align: center;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.pagination-current {
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--dark-blue) 100%);
    color: white;
    border-radius: 4px;
    font-weight: 600;
}

.results-info {
    color: #7f8c8d;
    font-size: 0.9rem;
    text-align: right;
}

/* Employee Detail */
.employee-detail {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.employee-photo-section {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--primary-yellow);
}

.employee-photo {
    max-width: 200px;
    max-height: 250px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 61, 165, 0.15);
    object-fit: cover;
}

.detail-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.detail-header h2 {
    color: #2c3e50;
    margin-top: 0.5rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Antigüedad */
.antiguedad-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.antiguedad-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--primary-yellow);
}

.antiguedad-header h2 {
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #7f8c8d;
    font-size: 0.95rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--dark-blue) 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.stat-card h4 {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0.5rem 0;
}

.stat-label {
    font-size: 0.85rem;
    opacity: 0.9;
}

.tables-grid {
    margin-bottom: 2rem;
}

.table-section h3 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--primary-yellow);
    padding-bottom: 0.5rem;
}

.antiguedad-table {
    width: 100%;
    border-collapse: collapse;
}

.antiguedad-table thead {
    background-color: var(--primary-blue);
}

.antiguedad-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    color: white;
}

.antiguedad-table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #eee;
}

.antiguedad-table .center {
    text-align: center;
}

.antiguedad-table .total-row {
    background-color: #f0f0f0;
    font-weight: bold;
}

.pension-section {
    margin-bottom: 2.5rem;
}

.pension-section h3 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--primary-yellow);
    padding-bottom: 0.5rem;
}

.pension-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.pension-card {
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid;
}

.pension-warning {
    background-color: #fff3cd;
    border-left-color: #ff9800;
}

.pension-eligible {
    background-color: #f8d7da;
    border-left-color: #dc3545;
}

.pension-card h4 {
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.pension-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
}

.pension-details span {
    padding: 0.25rem 0.5rem;
    background-color: rgba(0, 61, 165, 0.1);
    border-radius: 4px;
}

.pension-message {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-weight: 600;
    color: var(--primary-blue);
}

.no-data {
    color: #7f8c8d;
    font-style: italic;
    padding: 1rem;
    text-align: center;
}

@media (max-width: 768px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .pension-list {
        grid-template-columns: 1fr;
    }
}

.detail-section h3 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
    border-bottom: 3px solid var(--primary-yellow);
    padding-bottom: 0.5rem;
}

.detail-table {
    width: 100%;
}

.detail-table tr {
    border-bottom: 1px solid #eee;
}

.detail-table td {
    padding: 0.8rem 0.5rem;
}

.detail-table .label {
    font-weight: 600;
    color: #2c3e50;
    width: 40%;
}

/* Comments */
.comments-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.comments-section h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.category-comments {
    margin-bottom: 2rem;
}

.category-title {
    color: var(--primary-blue);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    background-color: rgba(255, 215, 0, 0.1);
    border-left: 4px solid var(--primary-yellow);
    font-weight: 600;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment {
    background-color: #f8f9fa;
    padding: 1rem;
    border-left: 4px solid var(--primary-blue);
    border-radius: 4px;
    border-top: 2px solid var(--primary-yellow);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.comment-author {
    font-weight: 600;
    color: #2c3e50;
}

.comment-date {
    color: #95a5a6;
}

.comment-body {
    color: #333;
    line-height: 1.6;
}

.no-comments {
    color: #7f8c8d;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-container {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .navbar-menu {
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
    }

    .filters-form {
        flex-direction: column;
    }

    .search-input,
    .filter-select {
        min-width: 100%;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }
}
