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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
}


.header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

a {
    text-decoration: none;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo {
    color: #6366f1;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.back-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: #64748b;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.back-button:hover {
    background: #f1f5f9;
    color: #6366f1;
}

.header-right {
    display: flex;
    align-items: center;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
}

.user-menu:hover {
    background: #f1f5f9;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #6366f1;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.user-name {
    font-size: 15px;
    font-weight: 500;
    color: #374151;
}

.dropdown-icon {
    font-size: 12px;
    color: #64748b;
}


.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    min-width: 160px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    color: #1e293b;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s ease;
    border-radius: 6px;
    margin: 4px;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
}

.dropdown-item:hover {
    background-color: #f1f5f9;
}

.dropdown-item.logout:hover {
    color: #dc2626;
}

.dropdown-icon-item {
    font-size: 16px;
}

.dropdown-divider {
    height: 1px;
    background-color: #e2e8f0;
    margin: 8px 0;

    font-size: 12px;
    color: #64748b;
}


.main-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 32px 24px;
}

.form-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    overflow: hidden;
}


.form-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 32px 32px 24px;
    border-bottom: 1px solid #f1f5f9;
}

.form-icon {
    font-size: 48px;
    flex-shrink: 0;
}

.form-title {
    font-size: 32px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.form-subtitle {
    font-size: 16px;
    color: #64748b;
}


.task-form {
    padding: 32px;
}

.form-section {
    margin-bottom: 32px;
}

.form-section:last-of-type {
    margin-bottom: 0;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
}

.section-icon {
    font-size: 20px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}


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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-label {
    display: block;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.required {
    color: #ef4444;
}


.input-wrapper {
    position: relative;
}

.char-counter {
    position: absolute;
    right: 12px;
    top: 12px;
    font-size: 12px;
    color: #94a3b8;
    pointer-events: none;
}

.form-textarea+.char-counter {
    bottom: 12px;
    top: auto;
}


.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    color: #374151;
    background: white;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
    padding-right: 60px;
}

.form-input[type="date"],
.form-input[type="time"] {
    cursor: pointer;
}


.radio-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    min-width: 120px;
}

.radio-item:hover {
    border-color: #c7d2fe;
    background: #f8fafc;
}

.radio-item.active {
    border-color: #6366f1;
    background: #eff6ff;
}

.radio-item input[type="radio"] {
    display: none;
}

.radio-icon {
    font-size: 18px;
}

.radio-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}


.priority-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.priority-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    min-width: 100px;
}

.priority-item:hover {
    border-color: #c7d2fe;
    background: #f8fafc;
}

.priority-item.active {
    border-color: #6366f1;
    background: #eff6ff;
}

.priority-item input[type="radio"] {
    display: none;
}

.priority-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.priority-color.alta {
    background: #ef4444;
}

.priority-color.media {
    background: #f59e0b;
}

.priority-color.baja {
    background: #10b981;
}

.priority-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}


.form-actions {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
    padding-top: 24px;
    border-top: 1px solid #f1f5f9;
    margin-top: 32px;
}

.btn-secondary,
.btn-primary {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary {
    background: #f8fafc;
    color: #64748b;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.btn-primary {
    background: #6366f1;
    color: white;
}

.btn-primary:hover {
    background: #5856eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}


@media (max-width: 768px) {
    .main-content {
        padding: 16px;
    }

    .header {
        padding: 12px 16px;
    }

    .header-left {
        gap: 16px;
    }

    .form-container {
        border-radius: 12px;
    }

    .form-header {
        padding: 24px 20px 20px;
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .form-icon {
        font-size: 40px;
    }

    .form-title {
        font-size: 28px;
    }

    .task-form {
        padding: 24px 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .radio-group,
    .priority-group {
        flex-direction: column;
        gap: 12px;
    }

    .radio-item,
    .priority-item {
        justify-content: center;
        min-width: auto;
    }

    .form-actions {
        flex-direction: column-reverse;
        gap: 12px;
    }

    .btn-secondary,
    .btn-primary {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .back-button span:last-child {
        display: none;
    }

    .form-header {
        padding: 20px 16px 16px;
    }

    .task-form {
        padding: 20px 16px;
    }

    .section-header {
        margin-bottom: 20px;
    }

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


.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 41, 59, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-box {
    background: white;
    padding: 24px;
    border-radius: 12px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.3s ease;
}

.modal-box p {
    font-size: 16px;
    margin-bottom: 16px;
}

.modal-box.success p {
    color: #065f46;
}

.modal-box.error p {
    color: #000000;
}

.modal-box.success button {
    background: #6366f1;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.modal-box.error button {
    background: #c20000;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.modal-box.success button:hover {
    background: #5856eb;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-box.error button:hover {
    background: #940000;
}

/* Estilos para modales de tipo warning con botones diferenciados */
.modal-box.warning .modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-box.warning button:first-child {
    background: #ef4444; /* Rojo para acción destructiva */
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.modal-box.warning button:last-child {
    background: white; /* Blanco para cancelar */
    color: #374151;
    border: 1px solid #d1d5db; /* Borde gris */
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.modal-box.warning button:first-child:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.modal-box.warning button:last-child:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}


.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 12px;
}