:root {
    --primary-color: #015768;
    --primary-dark: #014351;
    --accent-color: #FF5A5A;
    --text-color: #4D4D4D;
    --bg-color: #fcebeb;
    /* Slight tint or white */
    --white: #FFFFFF;
    --gray-light: #f4f6f8;
    --sidebar-width: 260px;
}

body {
    background-color: var(--gray-light);
    overflow-x: hidden;
}

/* Auth Pages (Login) - Keeping existing styles */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, #00404d 100%);
    padding: 1rem;
}

.login-box {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
    transition: transform 0.3s;
}

.login-logo {
    max-width: 150px;
    margin-bottom: 1.5rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.login-title {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group {
    margin-bottom: 1.2rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.password-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-container input {
    padding-right: 40px;
}

.toggle-password {
    position: absolute;
    right: 10px;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-color);
    opacity: 0.6;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
}

.btn {
    display: inline-block;
    padding: 0.9rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
    width: 100%;
}

.btn:hover {
    background-color: #00404d;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.alert {
    padding: 0.8rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    display: none;
}

.alert-error {
    background-color: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* Dashboard Layout */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--primary-color);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
    transition: width 0.3s ease;
}

.sidebar-brand {
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand img {
    max-width: 80%;
    height: auto;
    background-color: white;
    padding: 0.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.sidebar-user {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.1);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

* {
    box-sizing: border-box;
}

.user-info h4 {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1rem;
}

.user-info small {
    opacity: 0.8;
    font-size: 0.8rem;
}

.sidebar-menu {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-menu ul {
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 4px solid transparent;
}

.nav-link .icon {
    margin-right: 10px;
    font-size: 1.2rem;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border-left-color: var(--accent-color);
}

.nav-link.logout {
    color: #ffcccc;
}

.nav-link.logout:hover {
    background: #c0392b;
    color: white;
}

.mt-auto {
    margin-top: auto;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    width: calc(100% - var(--sidebar-width));
    transition: margin-left 0.3s ease, width 0.3s ease;
}

.top-bar {
    background: var(--white);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.page-title {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.content-area {
    padding: 2rem;
    flex: 1;
}

/* Cards & Tables */
.card {
    background: var(--white);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background-color: #f8f9fa;
    color: var(--primary-color);
    font-weight: 600;
}

.data-table tr:hover {
    background-color: #f1f1f1;
}

.btn-action {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    margin-right: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    color: white;
}

.btn-edit {
    background-color: var(--primary-color);
}

.btn-delete {
    background-color: #dc2626;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 0;
        overflow: hidden;
        transition: width 0.3s;
    }

    .sidebar.active {
        width: var(--sidebar-width);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    #sidebarToggle {
        display: block !important;
        font-size: 1.8rem;
        /* Mas grande */
        padding: 0.5rem 1rem;
    }

    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 1rem;
    }

    .date-display {
        font-size: 0.85rem;
        /* Mas pequeña */
        color: #777;
        margin-left: 0.5rem;
    }
}

/* Dashboard Widgets */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.dash-card {
    height: 100%;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.btn-mini {
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    background-color: var(--gray-light);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-mini:hover {
    background-color: var(--primary-color);
    color: white;
}

.mini-table {
    width: 100%;
    border-collapse: collapse;
}

.mini-table td {
    padding: 0.6rem 0;
    border-bottom: 1px solid #f9f9f9;
    font-size: 0.95rem;
}

.text-right {
    text-align: right;
}

.highlight {
    color: var(--accent-color);
    font-weight: bold;
}

.dash-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dash-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f9f9f9;
}

.badge {
    background: var(--primary-color);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
}

/* Responsive Tables */
@media (max-width: 768px) {

    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table thead {
        display: none;
    }

    .data-table tr {
        background: white;
        margin-bottom: 1rem;
        border-radius: 8px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
        border: 1px solid #eee;
    }

    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.8rem;
        border-bottom: 1px solid #f0f0f0;
        font-size: 0.95rem;
        text-align: right;
    }

    .data-table td:last-child {
        border-bottom: none;
        justify-content: flex-end;
    }

    .data-table td::before {
        content: attr(data-label);
        font-weight: bold;
        color: var(--primary-color);
        margin-right: 1rem;
        text-align: left;
    }
}

.history-item {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.history-item small {
    color: #999;
    font-size: 0.75rem;
}