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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    min-height: 100vh;
    background: linear-gradient(to bottom right, #fff7ed, #fef2f2);
    padding: 1rem;
}

.container {
    max-width: 56rem;
    margin: 0 auto;
}

.main-card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.calendar-icon {
    color: #ea580c;
}

h1 {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1f2937;
}

@media (min-width: 640px) {
    h1 {
        font-size: 1.875rem;
    }
}

/* Pantalla de login */
.login-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.login-screen h2 {
    font-size: 1.5rem;
    color: #1f2937;
    margin-bottom: 1rem;
}

.login-screen p {
    color: #6b7280;
    margin-bottom: 2rem;
    max-width: 400px;
}

.login-form {
    width: 100%;
    max-width: 400px;
}

.key-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    outline: none;
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 500;
}

.key-input:focus {
    border-color: #ea580c;
}

.btn-login {
    width: 100%;
    background: #ea580c;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-login:hover {
    background: #c2410c;
}

.btn-login:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* Header con clave */
.header-with-key {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.key-badge {
    background: #fed7aa;
    color: #1f2937;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.btn-cambiar-clave {
    background: #6b7280;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-cambiar-clave:hover {
    background: #4b5563;
}

@media (min-width: 640px) {
    .header-with-key {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.platos-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #fff7ed;
    border-radius: 0.5rem;
}

.platos-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.75rem;
}

.input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.input-plato {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    outline: none;
}

.input-plato:focus {
    border-color: #ea580c;
}

.btn-añadir {
    background: #ea580c;
    color: white;
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-añadir:hover {
    background: #c2410c;
}

#listaPlatosContainer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.empty-message {
    color: #6b7280;
    font-style: italic;
    text-align: center;
    padding: 0.5rem;
    width: 100%;
}

.plato-tag {
    background: white;
    padding: 0.5rem 0.75rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid #e5e7eb;
}

.plato-tag span {
    color: #374151;
}

.btn-eliminar {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.btn-eliminar:hover {
    color: #b91c1c;
}

.dias-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dia-card {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    transition: border-color 0.2s;
}

.dia-card:hover {
    border-color: #fdba74;
}

.dia-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .dia-content {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.dia-info {
    flex: 1;
}

.dia-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.plato-asignado {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.plato-badge {
    color: #1f2937;
    background: #fed7aa;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
}

.sin-planificar {
    color: #9ca3af;
    font-style: italic;
}

.btn-elegir {
    background: #ea580c;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1rem;
    transition: background 0.2s;
    width: 100%;
}

@media (min-width: 640px) {
    .btn-elegir {
        width: auto;
    }
}

.btn-elegir:hover {
    background: #c2410c;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 50;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    max-width: 28rem;
    width: 100%;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1f2937;
}

.btn-cerrar {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    display: flex;
    transition: color 0.2s;
}

.btn-cerrar:hover {
    color: #374151;
}

.modal-platos {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 24rem;
    overflow-y: auto;
}

.modal-plato-btn {
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    background: white;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.modal-plato-btn:hover {
    background: #fff7ed;
    border-color: #fdba74;
}

.modal-empty {
    color: #6b7280;
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

.hidden {
    display: none;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}