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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f7f7f7;
    color: #333;
    line-height: 1.6;
    padding-top: 60px;
    padding-bottom: 55px;
}

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

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #1a1a1a;
    color: #fff;
    padding: 15px 0;
}

.nav-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: #ffd700;
    font-size: 1.4rem;
    text-decoration: none;
    font-weight: bold;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: #ffd700;
}

.perfil-header {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}

.foto-enlace {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.foto-perfil {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffd700;
    background: #444;
    transition: opacity 0.2s;
}

.foto-enlace:hover .foto-perfil {
    opacity: 0.8;
}

.foto-vacia {
    background: #666;
}

.foto-vacia::before {
    content: '+';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffd700;
    font-size: 1.4rem;
    font-weight: bold;
}

.nombre-usuario {
    font-weight: 600;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
}

.main {
    padding: 30px 20px;
}

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #1a1a1a;
    color: #fff;
    text-align: center;
    padding: 15px 0;
    font-size: 0.9rem;
}

h1, h2, h3 {
    margin-bottom: 15px;
    color: #1a1a1a;
}

.btn {
    display: inline-block;
    padding: 8px 14px;
    background: #1a1a1a;
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn:hover {
    background: #333;
}

.btn-primary {
    background: #d4af37;
    color: #1a1a1a;
    font-weight: bold;
}

.btn-primary:hover {
    background: #b89628;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.85rem;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.grid-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.table th, .table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background: #1a1a1a;
    color: #fff;
}

.table tr:hover {
    background: #f9f9f9;
}

.card {
    background: #fff;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.alert {
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

.login-box {
    max-width: 400px;
    margin: 80px auto;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.login-box h1 {
    text-align: center;
    color: #d4af37;
}

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

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

.summary .card h3 {
    font-size: 2rem;
    color: #d4af37;
}

.recibo {
    background: #fff;
    padding: 30px;
    border: 1px solid #ddd;
    max-width: 700px;
    margin: 0 auto;
}

.recibo-header {
    text-align: center;
    border-bottom: 2px solid #d4af37;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }

    .ocultar-movil {
        display: none;
    }

    .nav-flex {
        flex-wrap: nowrap;
        align-items: center;
        gap: 10px;
    }

    .menu-toggle {
        display: block;
        order: 2;
    }

    .perfil-header {
        order: 1;
        margin-left: auto;
        gap: 5px;
    }

    .perfil-header .foto-perfil {
        width: 32px;
        height: 32px;
    }

    .nombre-usuario {
        display: block;
        font-size: 0.75rem;
        max-width: 70px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #1a1a1a;
        padding: 15px 20px;
        z-index: 999;
        gap: 0;
        box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: 10px 0;
        border-bottom: 1px solid #333;
    }

    .nav-links li:last-child a {
        border-bottom: none;
    }

    .main {
        padding: 20px 15px;
    }

    .table, .table thead, .table tbody, .table th, .table td, .table tr {
        display: block;
    }

    .table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .table tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 6px;
        background: #fff;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }

    .table td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding: 10px 10px 10px 50%;
        white-space: normal;
        text-align: right;
    }

    .table td:before {
        content: attr(data-label);
        position: absolute;
        top: 10px;
        left: 10px;
        width: 45%;
        font-weight: 600;
        color: #1a1a1a;
        text-align: left;
    }

    .table td:last-child {
        border-bottom: none;
    }

    .recibo {
        padding: 20px;
        max-width: 100%;
    }

    .login-box {
        margin: 40px 15px;
        padding: 20px;
    }

    h1, h2, h3 {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.2rem;
    }

    .nav-links {
        gap: 10px;
    }

    .nav-links a {
        font-size: 0.85rem;
    }

    .btn {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
}

@media print {
    .navbar, .footer, .no-print {
        display: none;
    }
    .main {
        padding: 0;
    }
    .recibo {
        border: none;
    }
}
