/* Planning tab — minimal To-Do */
main.app-main--planning {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}

#tab-planning {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#tab-planning.hidden {
    display: none !important;
}

.planning-viewport {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: min(24rem, calc(100dvh - var(--app-header-height) - var(--mobile-nav-height) - 2rem));
    max-height: calc(100dvh - var(--app-header-height) - var(--mobile-nav-height) - env(safe-area-inset-bottom, 0px));
    width: 100%;
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
    background: transparent;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.planning-list-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 0 1.25rem;
}

.planning-empty {
    text-align: center;
    color: #9ca3af;
    font-size: 0.875rem;
    padding: 3rem 1rem;
}

.task-check {
    flex-shrink: 0;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
}

.task-check-ring {
    display: block;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 9999px;
    border: 1.5px solid #d1d5db;
    transition: border-color 0.15s, background 0.15s;
}

.task-item.is-done .task-check-ring {
    border-color: #9ca3af;
    background: #e5e7eb;
}

.task-item.is-done .task-check-ring::after {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    box-shadow: inset 0 0 0 3px #f9fafb;
}

.task-text {
    flex: 1;
    min-width: 0;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: #1f2937;
    cursor: grab;
    touch-action: pan-y;
    padding: 0.125rem 0;
}

.task-item.is-done .task-text {
    color: #9ca3af;
    text-decoration: line-through;
}

.task-delete {
    flex-shrink: 0;
    padding: 0.25rem;
    color: #d1d5db;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.15s;
    line-height: 0;
}

.task-delete:hover {
    color: #ef4444;
}

/* کادر ثبت وظیفه — ثابت، دقیقاً بالای تب‌های پایین */
#planning-input-bar {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 1.25rem);
    max-width: 26rem;
    z-index: 65;
    padding: 0.5rem 0.75rem 0.625rem;
    margin: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    bottom: calc(var(--mobile-nav-height) + 1.25rem + env(safe-area-inset-bottom, 0px));
    pointer-events: auto;
    touch-action: manipulation;
}

#planning-input-bar.hidden {
    display: none !important;
}

@media (min-width: 1024px) {
    #planning-input-bar {
        bottom: calc(var(--mobile-nav-height) + 0.75rem + env(safe-area-inset-bottom, 0px));
        max-width: min(28rem, calc(100vw - 1.25rem));
    }
}

main.app-main--planning .planning-list-scroll {
    padding-bottom: calc(
        var(--planning-input-height) + var(--mobile-nav-height) + 2.25rem + env(safe-area-inset-bottom, 0px)
    );
}

html.dark #planning-input-bar {
    background: transparent;
    border: none;
    box-shadow: none;
}

.planning-input-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff;
    border: none;
    border-radius: 9999px;
    padding: 0.375rem 0.375rem 0.375rem 1.25rem;
    margin: 0;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
}

.planning-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.9375rem;
    color: #1f2937;
    text-align: right;
    direction: rtl;
}

.planning-input::placeholder {
    color: #9ca3af;
}

.planning-send-btn {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 45%, #16a34a 100%);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
    transition: filter 0.15s, transform 0.1s, box-shadow 0.15s;
}

.planning-send-btn:hover {
    filter: brightness(1.05);
    box-shadow: 0 6px 18px rgba(22, 163, 74, 0.42);
}

.planning-send-btn:active {
    transform: scale(0.96);
}

html.dark .planning-input-row {
    background: #1f2937;
}

html.dark .planning-input {
    color: #f3f4f6;
}

html.dark .planning-input::placeholder {
    color: #9ca3af;
}

html.dark .planning-viewport {
    background: transparent;
}

html.dark .task-text {
    color: #e5e7eb;
}

html.dark .task-item.is-done .task-text {
    color: #6b7280;
}

html.dark .task-item.sortable-ghost {
    background: #374151;
}

.custom-select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 0.5rem center;
    background-size: 1em;
}

.modern-select {
    position: relative;
    flex: 1;
    min-width: 0;
}

.modern-select-native {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
    overflow: hidden;
}

.modern-select-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-family: inherit;
    color: #1e293b;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.modern-select-trigger:hover {
    border-color: #93c5fd;
    background: #f8fafc;
}

.modern-select.open .modern-select-trigger {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
    background: #ffffff;
}

.modern-select.open .modern-select-arrow {
    transform: rotate(180deg);
    color: #3b82f6;
}

.modern-select-arrow {
    transition: transform 0.25s ease, color 0.2s;
}

.modern-select-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 120;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 1rem;
    box-shadow: 0 20px 40px -12px rgba(15, 23, 42, 0.18), 0 8px 16px -8px rgba(15, 23, 42, 0.08);
    max-height: 260px;
    overflow-y: auto;
    padding: 0.375rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.98);
    transform-origin: top center;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.modern-select.open .modern-select-menu,
.modern-select-menu.is-open {
    opacity: 1;
    visibility: visible;
}

.modern-select.open .modern-select-menu:not(.modern-select-menu--portal) {
    transform: translateY(0) scale(1);
}

.modern-select-menu--portal {
    position: fixed;
    z-index: 10050;
    right: auto;
    transform: none !important;
    transform-origin: top center;
}

.modern-select-option {
    display: block;
    width: 100%;
    text-align: right;
    padding: 0.55rem 0.75rem;
    border: none;
    background: transparent;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    font-family: inherit;
    color: #334155;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.modern-select-option:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.modern-select-option.selected {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1d4ed8;
    font-weight: 600;
}

.modern-select-menu::-webkit-scrollbar {
    width: 5px;
}

.modern-select-menu::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

html.dark .modern-select-trigger {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

html.dark .modern-select-trigger:hover {
    background: #3f4f63;
    border-color: #60a5fa;
}

html.dark .modern-select.open .modern-select-trigger {
    background: #334155;
    border-color: #3b82f6;
}

html.dark .modern-select-menu {
    background: rgba(30, 41, 59, 0.97);
    border-color: #475569;
}

html.dark .modern-select-option {
    color: #cbd5e1;
}

html.dark .modern-select-option:hover {
    background: #475569;
    color: #f1f5f9;
}

html.dark .modern-select-option.selected {
    background: linear-gradient(135deg, #1e3a5f 0%, #1d4ed8 100%);
    color: #ffffff;
}

.auth-card {
    background: #fffef9;
    border-radius: 32px;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.1), inset 0 2px 4px rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.9);
    display: none;
}

.auth-globe {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ffffff, #e0f2fe, #bae6fd);
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.15);
    margin: 0 auto 1rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-msg {
    display: none;
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 0.75rem;
    margin-top: 4px;
    animation: fadeIn 0.2s ease-out;
}
.error-msg.show {
    display: block;
}

.filter-btn {
    padding: 6px 16px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
.filter-btn:hover {
    background: rgba(255, 255, 255, 0.65);
    color: var(--text-primary);
}
.filter-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 55%, #8b5cf6 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

