/* VIEW SWITCHER */
.view-switcher {
    display: flex;
    background: var(--surface-2);
    padding: 3px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.switch-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.switch-btn.active {
    background: var(--accent-primary);
    color: white;
}

/* CHECKBOX CUSTOM */
.checkbox-container {
    display: block;
    position: relative;
    cursor: pointer;
    user-select: none;
    width: 20px;
    height: 20px;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: transparent;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--accent-primary);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.task-title-cell {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.task-title-text.completed {
    text-decoration: line-through;
    color: var(--text-secondary);
}

/* STATUS BADGE */
.badge {
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.badge:hover {
    transform: scale(1.05);
}

.badge.todo {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.badge.progress {
    background: var(--accent-glow-sm);
    color: var(--accent-light);
}

.badge.done {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

/* STATUS BADGES ESPECÍFICOS */
.badge.idea {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}

.badge.grabado {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
}

.badge.edicion {
    background: var(--accent-glow-sm);
    color: var(--accent-light);
}

.badge.script {
    background: rgba(96, 165, 250, 0.12);
    color: #60a5fa;
}

.badge.revision {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge.publicado {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
}

/* BADGE DE TAREA VENCIDA */
.badge-overdue {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    padding: 2px 7px;
    border-radius: 6px;
    letter-spacing: 0.02em;
}

/* STYLED SELECT — TEAM & CHANNEL FILTER */
.team-select {
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 28px 6px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
}

.team-select:hover {
    background-color: var(--surface-3);
    border-color: var(--border-mid);
}

.team-select:focus {
    border-color: var(--accent-primary);
    background-color: rgba(0, 0, 0, 0.3);
    outline: none;
}

.team-select:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* DATE PICKER */
.date-picker {
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
}

.date-picker:hover {
    background-color: var(--surface-3);
    border-color: var(--border-mid);
}

.date-picker:focus {
    border-color: var(--accent-primary);
    background-color: rgba(0, 0, 0, 0.3);
    outline: none;
}

.date-picker:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* INLINE ADD TASK */
.inline-add-task {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--modal-bg);
    flex-shrink: 0;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
}

.inline-input {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 14px;
    outline: none;
    padding: 8px 4px;
}

.inline-input:focus-visible {
    outline: none;
    border-bottom: 1px solid var(--accent-primary);
}

.inline-input::placeholder {
    color: var(--text-secondary);
}

.add-task-btn {
    background: var(--text-main);
    color: var(--bg-color);
    border: none;
    padding: 8px 18px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.add-task-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

/* MODAL */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--modal-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    width: 450px;
    padding: 30px;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

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

.modal-title {
    font-size: 20px;
    font-weight: 700;
}

.close-modal {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: var(--text-main);
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-input {
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-main);
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.form-input:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.modal-action-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    padding: 14px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s ease;
    margin-top: 10px;
}

.modal-action-btn:hover {
    transform: translateY(-2px);
}

/* WIKI / SOPs VIEW */
.sop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.sop-card {
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    cursor: pointer;
    transition: border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.sop-card:hover {
    border-color: rgba(139, 92, 246, 0.4);
    background: rgba(139, 92, 246, 0.02);
    transform: translateY(-4px);
}

.sop-card i {
    font-size: 28px;
    color: var(--accent-primary);
    margin-bottom: 16px;
}

.sop-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.sop-card p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

/* TEAM VIEW */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.member-card {
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.member-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 16px;
    border: 3px solid var(--surface-2);
}

.member-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.member-role {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    background: var(--surface-2);
    padding: 4px 10px;
    border-radius: 12px;
}

.member-portfolio {
    font-size: 13px;
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.3s ease;
}

.member-portfolio:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* LOGIN OVERLAY */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 11, 15, 0.85);
    backdrop-filter: blur(25px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-overlay.active {
    display: flex;
}

.login-card {
    background: rgba(26, 26, 38, 0.5);
    border: 1px solid var(--border-color);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    border-radius: 24px;
    padding: 40px;
    width: 400px;
    max-width: 90%;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.4s ease-out;
}

.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--text-main) 30%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-brand i {
    color: var(--accent-primary);
    -webkit-text-fill-color: initial;
}

.login-card h2 {
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}

.login-card p {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* TOAST NOTIFICATIONS */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 2000;
    pointer-events: none;
}

.toast {
    background: rgba(18, 18, 28, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    width: 320px;
    max-width: 90vw;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toast-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.toast-body {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Ocultar elementos de navegación móvil por defecto en escritorio */
.mobile-nav-bar,
.mobile-bottom-sheet,
.mobile-bottom-sheet-overlay {
    display: none;
}

/* ===== TASK MODAL EXTENSIONS: LINKS, COMMENTS, LOGS ===== */

/* Fila de enlace URL dentro del modal de tarea */
.task-url-field {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 12px;
    transition: border-color 0.2s ease;
}

.task-url-field:focus-within {
    border-color: var(--accent-primary);
}

.task-url-field i {
    color: var(--text-secondary);
    font-size: 13px;
    flex-shrink: 0;
}

.task-url-field input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 13px;
    outline: none;
}

.task-url-field a.url-open-btn {
    font-size: 11px;
    color: var(--accent-primary);
    text-decoration: none;
    white-space: nowrap;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.task-url-field a.url-open-btn:hover {
    opacity: 1;
}

/* Separador de secciones dentro del modal */
.modal-section-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 12px 0;
}

.modal-section-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ---- COMENTARIOS ---- */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
    margin-bottom: 12px;
}

.comment-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.comment-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.comment-bubble {
    flex: 1;
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-main);
    line-height: 1.5;
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.comment-author {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-light);
}

.comment-date {
    font-size: 10px;
    color: var(--text-secondary);
}

.comment-delete-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
    padding: 0 2px;
}

.comment-item:hover .comment-delete-btn {
    opacity: 0.6;
}

.comment-delete-btn:hover {
    color: #ef4444;
    opacity: 1;
}

.comment-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.comment-input-row input {
    flex: 1;
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s ease;
}

.comment-input-row input:focus {
    border-color: var(--accent-primary);
}

.comment-send-btn {
    background: var(--accent-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    flex-shrink: 0;
}

.comment-send-btn:hover {
    background: var(--accent-secondary);
    transform: scale(1.03);
}

/* ---- LOG DE ACTIVIDAD ---- */
.activity-log-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 140px;
    overflow-y: auto;
}

.activity-log-item {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.activity-log-item i {
    color: var(--accent-primary);
    font-size: 10px;
    flex-shrink: 0;
}

.activity-log-item .log-member {
    font-weight: 600;
    color: var(--text-main);
}

.activity-log-item .log-date {
    margin-left: auto;
    font-size: 10px;
    white-space: nowrap;
}

/* SECCIONES COLAPSABLES PREMIUM PARA MODALES */
.modal-collapsible-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.modal-collapsible-section[open] {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(96, 165, 250, 0.4);
}

.modal-section-summary {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none;
    user-select: none;
}

.modal-section-summary::-webkit-details-marker {
    display: none;
}

.modal-section-summary i {
    transition: transform 0.3s ease;
}

.modal-collapsible-section[open] .toggle-icon {
    transform: rotate(180deg);
}

.modal-section-content {
    padding: 0 16px 16px 16px;
}

/* BUSCADOR GLOBAL */
.search-result-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(96, 165, 250, 0.3);
    transform: translateX(4px);
}

.search-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-result-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.search-result-meta {
    font-size: 11px;
    color: var(--text-secondary);
}

.search-result-tags {
    display: flex;
    gap: 8px;
    font-size: 10px;
    margin-top: 4px;
}

.search-result-tag {
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.search-result-tag.status {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}

.search-result-tag.assignee {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
}

/* TARJETAS DE LA SALA DE IDEAS */
.backlog-idea-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.backlog-idea-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(251, 191, 36, 0.4);
    transform: translateY(-2px);
}

.backlog-idea-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
}

.backlog-idea-notes {
    font-size: 11px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.backlog-idea-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.backlog-activate-btn {
    font-size: 10px;
    font-weight: 700;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.backlog-activate-btn:hover {
    background: rgba(251, 191, 36, 0.25);
    border-color: #fbbf24;
}

/* NOTIFICATIONS AND TOAST CARDS */
.notification-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
}

.notification-item:hover {
    background: rgba(139, 92, 246, 0.04);
    border-color: rgba(139, 92, 246, 0.25);
    transform: translateX(4px);
}

.notification-item.unread {
    background: rgba(139, 92, 246, 0.06);
    border-color: rgba(139, 92, 246, 0.15);
}

.notification-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
    flex-shrink: 0;
}

.notification-item.unread .notification-status-dot {
    background: var(--accent-primary);
    box-shadow: 0 0 8px var(--accent-primary);
}

.notification-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notification-message {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    line-height: 1.4;
}

.notification-date {
    font-size: 10px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

