/* ========== GENERALES ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f5f5;
    overflow-x: hidden;
}

/* ========== CONTENEDOR PRINCIPAL ========== */
.app-container {
    min-height: 100vh;
    position: relative;
}

/* ===== MENÚ LATERAL ===== */
.sidebar {
    width: 280px;
    background: linear-gradient(135deg, #2c3e50, #4a6491);
    color: white;
    position: fixed;
    height: 100%;
    overflow-y: auto;
    z-index: 1000;
    right: 0;
    top: 0;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.2);
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.1);
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    flex: 1;
    text-align: center;
}

.close-menu {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-menu:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.sidebar-menu {
    padding: 20px 0;
}

.menu-item {
    padding: 16px 25px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    margin: 5px 15px;
    border-radius: 8px;
}

.menu-item:hover {
    background-color: rgba(255, 255, 255, 0.12);
    transform: translateX(-5px);
}

.menu-item.active {
    background-color: rgba(52, 152, 219, 0.2);
    border-left: 4px solid #3498db;
}

.menu-item i {
    margin-right: 18px;
    font-size: 1.3rem;
    width: 24px;
    text-align: center;
}

.menu-item span {
    font-size: 1.05rem;
    font-weight: 500;
}

/* ===== CONTENIDO PRINCIPAL ===== */
.main-content {
    padding: 20px;
    transition: filter 0.3s ease;
}

/* Header fijo (logo + nombre + botón menú) */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
    padding: 10px 20px;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Botón menú */
.menu-toggle {
    font-size: 1.8rem;
    background: linear-gradient(135deg, #3498db, #2c3e50);
    border: none;
    cursor: pointer;
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
}

.menu-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(52, 152, 219, 0.4);
}

/* Contenido “tarjeta” */
.content-area {
    background-color: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

/* Overlay menú */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    backdrop-filter: blur(3px);
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

.main-content.blur {
    filter: blur(3px);
}

/* ===== LOGIN ===== */
.login-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin: 0 auto;
    max-width: 400px;
    animation: fadeIn 0.5s ease-in;
}

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

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #2c3e50;
    font-size: 2rem;
    margin-bottom: 10px;
}

.login-header p {
    color: #7f8c8d;
    font-size: 1rem;
}

.login-form { margin-top: 20px; }

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 500;
    font-size: 0.95rem;
}

.input-group { position: relative; }

.input-group input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.input-group input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: #7f8c8d;
}

.login-btn {
    width: 100%;
    background: linear-gradient(135deg, #3498db, #2c3e50);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.login-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.login-footer a {
    color: #3498db;
    text-decoration: none;
    font-size: 0.9rem;
}

/* ===== APP CONTENT / LOGO ===== */
.app-content {
    animation: fadeIn 0.5s ease-in;
}

/* Logo + usuario */
.logo-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.logo-img {
    max-height: 55px;
    width: auto;
}

.user-name {
    font-weight: 700;
    color: #2c3e50;
    font-size: 1rem;
    margin-top: 5px;
}

@media (min-width: 992px) {
    .logo-img { max-height: 70px; }
}

@media (max-width: 768px) {
    .logo-img { max-height: 60px; }
    .user-name { font-size: 1rem; }
}

/* ===== TAREAS (estilo Google Tasks) ===== */
.task-section {
    margin-top: 10px;
}

/* HEADER de tareas: título a la izquierda, botones a la derecha */
.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 15px;
}

.task-title {
    margin: 0;
    padding: 0;
    font-size: 1.6rem;
    color: #2c3e50;
    font-weight: 700;
}

/* Wrapper de los botones del header */
.task-actions-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Botón agregar (+) */
.task-add-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #ecf0f1;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #2c3e50;
    font-size: 1.1rem;
    transition: 0.2s ease;
}

.task-add-btn:hover {
    background: #d5dce1;
}

/* Botón menú (⋮) */
.task-menu-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #ecf0f1;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: #2c3e50;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s ease;
}

.task-menu-btn:hover {
    background: #d5dce1;
}

/* Dropdown menú del header de tareas – estilo SASSER claro */
.task-actions-header {
    position: relative; /* ancla el menú al contenedor de los botones */
}

.task-menu {
    position: absolute;
    right: 0;
    top: 42px;
    width: 230px;
    background: #ffffff;
    color: #2c3e50;
    border-radius: 12px;
    padding: 8px 0;
    box-shadow: 0 10px 24px rgba(0,0,0,0.15);
    display: none;
    z-index: 100;
}

.task-menu.open {
    display: block;
}

.task-menu h4 {
    margin: 0;
    padding: 6px 16px 4px 16px;
    font-size: 0.8rem;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Botones del menú, uno debajo del otro */
.task-menu-item {
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 0.95rem;
    color: #2c3e50;
    transition: background 0.15s ease, color 0.15s ease;
}

.task-menu-item i {
    font-size: 1rem;
    opacity: 0.9;
}

/* Hover suave, claro, en tu estilo */
.task-menu-item:hover {
    background: #f3f5f7;
    color: #1f3b57;
}
@media (max-width: 768px) {
    .task-menu {
        right: 4px;
        width: 220px;
    }
}

/* Listado de tareas */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Tarjeta de tarea */
.task-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border-radius: 12px;
    padding: 15px 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    border: 1px solid #eaeaea;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.task-info h3 {
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 4px;
}

.task-time {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.task-label {
    display: inline-block;
    color: #2c3e50;
    font-size: 1rem;
    padding: 4px 10px;
    border-radius: 8px;
}

/* Botones de editar / completar */
.task-actions {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.task-btn {
    background: none;
    border: none;
    color: #2c3e50;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
}

.task-btn:hover {
    color: #3498db;
    transform: scale(1.1);
}

/* Sin resultados */
.no-results {
    text-align: center;
    color: #7f8c8d;
    padding: 20px;
    font-style: italic;
}

/* Responsive Tareas */
@media (max-width: 768px) {
    .task-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .task-btn {
        align-self: flex-end;
    }

    .task-header {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }
}

/* ===== LOADING OVERLAY ===== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-overlay.hidden {
  display: none;
}

.loading-box {
  background: white;
  padding: 14px 18px;
  border-radius: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

/* ===== MODAL EDITAR / CREAR TAREA ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  width: min(640px, 92vw);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.25);
  overflow: hidden;
  animation: modalIn .18s ease-out;
}

@keyframes modalIn {
  from { transform: translateY(10px); opacity: .6; }
  to   { transform: none; opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #eef0f3;
  background: #f8f9fa;
}

.modal-header h3 {
  margin: 0;
  color: #2c3e50;
}

.modal-close {
  background: none;
  border: 0;
  font-size: 1.6rem;
  cursor: pointer;
  color: #7f8c8d;
}

/*#editTaskForm {
  padding: 16px 18px 18px;
}*/

.form-row {
  display: flex;
  gap: 12px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.form-field label {
  font-size: .9rem;
  color: #7f8c8d;
}

.form-field input[type="datetime-local"],
.form-field select,
.form-field textarea {
  padding: 12px 12px;
  border-radius: 10px;
  border: 2px solid #e0e0e0;
  font-size: 1rem;
  outline: none;
  transition: .2s;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52,152,219,.12);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
}

.btn.cancel {
  background: #ecf0f1;
  color: #2c3e50;
}

.btn.save {
  background: linear-gradient(135deg,#3498db,#2c3e50);
  color: #fff;
}

@media (max-width: 640px) {
  .form-row { flex-direction: column; }
}
.task-type {
    display: inline-block;
    margin: 4px 0 6px 0;
    padding: 3px 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #2c3e50;
    background: #e9f0f7;
    border-radius: 6px;
    letter-spacing: 0.3px;
    text-transform: capitalize;
}

.modal-content form {
    padding: 16px 18px 18px !important;
}
