
/* ===== Botão YouTube / Música (inferior esquerdo) ===== */
.youtube-music-fab {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    z-index: 1400;
    border: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.youtube-music-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 34px rgba(225, 29, 72, 0.45);
}

.youtube-music-fab:active {
    transform: translateY(0);
}

.ai-chat-fab {
    position: fixed;
    bottom: 24px;
    left: 88px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    z-index: 1400;
    border: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ai-chat-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 34px rgba(37, 99, 235, 0.45);
}

.ai-chat-fab:active {
    transform: translateY(0);
}

.ai-chat-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: transparent;
    display: none;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 0 0 90px 88px;
    pointer-events: none;
}

.ai-chat-overlay.is-open {
    display: flex;
}

.ai-chat-overlay .ai-chat-box {
    pointer-events: auto;
}

.ai-chat-box {
    width: 420px;
    max-width: calc(100vw - 32px);
    height: 460px;
    max-height: 70vh;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ai-chat-box.is-mini {
    width: 360px;
    height: 250px;
}

.ai-chat-box.is-expanded {
    width: 90%;
    max-width: 960px;
    height: 50vh;
    max-height: 600px;
}

.ai-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-chat-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e2e8f0;
}

.ai-chat-mode-indicator {
    font-size: 0.76rem;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid transparent;
    margin-left: 10px;
    line-height: 1.4;
    white-space: nowrap;
}

.ai-chat-mode-indicator.is-general {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(148, 163, 184, 0.35);
    color: #cbd5e1;
}

.ai-chat-mode-indicator.is-project {
    background: rgba(37, 99, 235, 0.2);
    border-color: rgba(59, 130, 246, 0.55);
    color: #bfdbfe;
}

.ai-chat-project-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #cbd5e1;
    font-size: 0.8rem;
    margin-left: auto;
    margin-right: 10px;
}

.ai-chat-project-toggle input {
    width: 14px;
    height: 14px;
}

.ai-chat-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-chat-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.ai-chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-chat-message {
    display: flex;
}

.ai-chat-message-user {
    justify-content: flex-end;
}

.ai-chat-message-assistant {
    justify-content: flex-start;
}

.ai-chat-bubble {
    max-width: 90%;
    border-radius: 12px;
    padding: 8px 10px;
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: pre-wrap;
}

.ai-chat-message-user .ai-chat-bubble {
    background: #2563eb;
    color: #fff;
}

.ai-chat-message-assistant .ai-chat-bubble {
    background: rgba(30, 41, 59, 0.9);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-chat-form {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-chat-task-results {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 10px;
    max-height: 230px;
    overflow-y: auto;
    background: rgba(2, 6, 23, 0.5);
}

.ai-chat-task-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    color: #e2e8f0;
    font-size: 0.85rem;
}

.ai-chat-task-results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-chat-input {
    flex: 1;
    min-height: 38px;
    max-height: 120px;
    resize: vertical;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(30, 41, 59, 0.8);
    color: #e2e8f0;
    font-size: 0.9rem;
}

.ai-chat-input::placeholder {
    color: var(--muted);
}

/* ===== Box suspenso YouTube ===== */
.youtube-box-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: transparent;
    display: none;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 0 0 90px 24px;
    pointer-events: none;
}

.youtube-box-overlay.is-open {
    display: flex;
}

.youtube-box-overlay .youtube-box {
    pointer-events: auto;
}

.youtube-box {
    width: 90%;
    max-width: 960px;
    height: 50vh;
    max-height: 600px;
    min-height: 320px;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0;
    transition: height 0.25s ease, width 0.25s ease, max-height 0.25s ease;
}

.youtube-box-overlay.fullscreen-active {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
}

.youtube-box.is-fullscreen {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    min-height: 100vh;
    border-radius: 0;
    border: none;
    box-shadow: none;
}

.youtube-box.is-fullscreen .youtube-box-sidebar {
    display: none;
}

.youtube-box.is-fullscreen .youtube-box-main {
    padding: 0;
}

.youtube-box.is-fullscreen .youtube-player-wrap {
    border-radius: 0;
}

.youtube-box.size-medium {
    height: 40vh;
    max-height: 480px;
}

.youtube-box.size-small {
    height: 30vh;
    max-height: 360px;
}

.youtube-box.is-mini {
    width: 400px;
    max-width: 90vw;
    height: 280px;
    min-height: 200px;
    max-height: 320px;
}

.youtube-box.is-mini .youtube-box-body {
    flex: 1;
}

.youtube-box.is-mini .youtube-box-sidebar,
.youtube-box.is-mini .youtube-results-wrap {
    display: none !important;
}

.youtube-box.is-mini .youtube-box-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.youtube-box.is-mini .youtube-player-wrap {
    flex: 1;
    min-height: 0;
}

.youtube-box-header {
    flex-shrink: 0;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
}

.youtube-box-header-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.youtube-search-input {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(30, 41, 59, 0.8);
    color: #e2e8f0;
    font-size: 0.95rem;
}

.youtube-search-input::placeholder {
    color: var(--muted);
}

.youtube-box-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.youtube-search-settings-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 12px;
    width: min(360px, calc(100vw - 36px));
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    padding: 10px;
    z-index: 30;
}

.youtube-search-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    color: #e2e8f0;
    font-size: 0.9rem;
}

.youtube-search-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.youtube-search-settings-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: #cbd5e1;
    font-size: 0.78rem;
}

.youtube-search-settings-field select {
    padding: 8px 10px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(30, 41, 59, 0.85);
    color: #e2e8f0;
    font-size: 0.85rem;
}

.youtube-search-settings-tip {
    margin: 8px 0 0 0;
    color: #94a3b8;
    font-size: 0.78rem;
}

.youtube-search-settings-toggle {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #cbd5e1;
    font-size: 0.8rem;
}

.youtube-search-settings-toggle input {
    width: 14px;
    height: 14px;
}

.youtube-box-body {
    flex: 1;
    display: flex;
    min-height: 0;
    gap: 0;
}

.youtube-box-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    overflow: hidden;
    position: relative;
}

.youtube-player-wrap {
    flex: 1;
    min-height: 0;
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.youtube-player-wrap .youtube-player-iframe,
.youtube-player-wrap .youtube-player-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.youtube-results-wrap {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 10;
    background: rgba(15, 23, 42, 0.97);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.youtube-player-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.youtube-player-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.9rem;
    background: rgba(15, 23, 42, 0.95);
}

.youtube-player-wrap.has-video .youtube-player-placeholder {
    display: none;
}

.youtube-results-wrap {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 10;
    background: rgba(15, 23, 42, 0.97);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.youtube-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.youtube-results-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e2e8f0;
}

.youtube-results-close-btn {
    padding: 4px;
    color: rgba(255, 255, 255, 0.7);
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.youtube-results-close-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.youtube-results-wrap .youtube-results-hint {
    padding: 12px;
}

.youtube-results-hint {
    color: var(--muted);
    font-size: 0.85rem;
    margin: 0;
    padding: 8px 0;
}

.youtube-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.youtube-results-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 4px;
    transition: background 0.15s;
}

.youtube-results-list li:hover {
    background: rgba(255, 255, 255, 0.08);
}

.youtube-results-list li img {
    width: 120px;
    height: 68px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.youtube-results-list .yt-result-title {
    font-size: 0.9rem;
    color: #e2e8f0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.youtube-results-list .yt-result-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.youtube-results-list .yt-result-meta {
    font-size: 0.75rem;
    color: #94a3b8;
}

.youtube-results-list .yt-result-add-btn {
    flex-shrink: 0;
    align-self: center;
}

.youtube-box-sidebar {
    width: 260px;
    flex-shrink: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.youtube-playlist-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.youtube-playlist-select {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(30, 41, 59, 0.8);
    color: #e2e8f0;
    font-size: 0.9rem;
}

.youtube-playlist-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.youtube-playlist-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 2px;
    font-size: 0.85rem;
    color: #cbd5e1;
    transition: background 0.15s;
}

.youtube-playlist-list li.is-dragging {
    opacity: 0.45;
}

.youtube-playlist-list li.is-playing {
    background: rgba(37, 99, 235, 0.22);
    border: 1px solid rgba(59, 130, 246, 0.6);
}

.youtube-playlist-list li:hover {
    background: rgba(255, 255, 255, 0.08);
}

.youtube-playlist-list li .yt-pl-thumb {
    width: 64px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.youtube-playlist-list li .yt-pl-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.youtube-playlist-list li .yt-pl-playing-badge {
    display: none;
    flex-shrink: 0;
    font-size: 0.68rem;
    line-height: 1.2;
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.7);
    background: rgba(37, 99, 235, 0.2);
    color: #bfdbfe;
}

.youtube-playlist-list li.is-playing .yt-pl-playing-badge {
    display: inline-flex;
    align-items: center;
}

/* ===== Ferramentas rápidas (URL/JSON) ===== */
.tools-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    left: auto;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    z-index: 1400;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.floating-task-btn {
    position: fixed;
    bottom: 24px;
    right: 88px;
    width: 52px;
    height: 52px;
    left: auto;
    border-radius: 50%;
    background: #22c55e;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    z-index: 1400;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border: none;
}

.floating-task-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.4);
}

.floating-task-btn:active {
    transform: translateY(0);
}

.tools-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.4);
}

.tools-fab:active {
    transform: translateY(0);
}

.tools-menu {
    position: fixed;
    bottom: 90px;
    right: 24px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    z-index: 1400;
    min-width: 220px;
}

.tools-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: none;
    background: transparent;
    color: #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s ease, transform 0.12s ease;
}

.tools-menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.tools-menu-item:active {
    transform: translateY(1px);
}

.tools-menu-icon {
    width: 18px;
    height: 18px;
}

.tools-menu-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tools-menu-text small {
    color: var(--muted);
    font-size: 12px;
}

.tools-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1400;
}

.tools-modal-content {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    width: min(720px, 92vw);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tools-modal-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.tools-modal-header h3 {
    margin: 0;
    font-size: 16px;
}

.tools-modal-close {
    background: transparent;
    border: none;
    color: #e2e8f0;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
}

.tools-modal-close:hover {
    background: rgba(255, 255, 255, 0.05);
}

.tools-modal-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
}

.tools-input-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
}

.tools-textarea,
.tools-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: #e2e8f0;
    min-height: 60px;
    resize: vertical;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
}

.tools-textarea:focus,
.tools-input:focus {
    outline: 2px solid var(--accent);
    border-color: var(--accent);
}

.tools-result-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tools-result-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
}

.tools-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.tools-result-header label {
    font-weight: 600;
    color: #e2e8f0;
}

.tools-copy-btn {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: #e2e8f0;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tools-copy-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.tools-result-content {
    font-family: 'Fira Code', monospace;
    white-space: pre-wrap;
    word-break: break-word;
    color: #e2e8f0;
}

.tools-result-content.json-formatted {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.02);
}

.json-punctuation { color: var(--muted); }
.json-key { color: #93c5fd; }
.json-string { color: #a5f3fc; }
.json-number { color: #facc15; }
.json-boolean { color: #f472b6; }
.json-null { color: #f97316; }

@media (max-width: 640px) {
    .tools-menu {
        right: 14px;
        bottom: 66px;
        width: calc(100% - 28px);
    }
    .tools-modal-content {
        width: calc(100% - 24px);
    }
}
.mobile-settings-btn {
    display: none;
}

@media (max-width: 640px) {
    .mobile-settings-btn {
        display: inline-flex;
    }
}
:root {
    --bg: #0f172a;
    --card: #1f2937;
    --muted: #94a3b8;
    --accent: #2563eb;
    --accent-soft: rgba(37, 99, 235, 0.2);
    --border: #334155;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --radius: 16px;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    margin: 0;
    background: #020617;
    color: #e2e8f0;
    min-height: 100vh;
    overflow-x: hidden;
}

@media (min-width: 641px) {
    html {
        font-size: 15px;
    }
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.auth-view {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    background: #0f172a;
    padding: 32px;
    border-radius: var(--radius);
    width: min(420px, 100%);
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.7);
}

.logo {
    margin: 0 0 8px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    margin: 0 0 24px;
    color: var(--muted);
}

.login-form label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 0.95rem;
}

input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
textarea,
select {
    background: rgba(11, 18, 32, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 16px;
    color: #e2e8f0;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
    outline: none;
}

select option {
    background: #0f172a;
    color: #e2e8f0;
}

input[type="text"]:hover,
input[type="search"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="number"]:hover,
input[type="date"]:hover,
input[type="time"]:hover,
input[type="datetime-local"]:hover,
textarea:hover,
select:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

input[type="text"]:focus,
input[type="search"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
    opacity: 0.7;
}

input:disabled,
textarea:disabled,
select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.primary-btn {
    border: none;
    background: linear-gradient(120deg, #2563eb, #7c3aed);
    color: #fff;
    padding: 12px 20px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.primary-btn.small {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.ghost-btn,
.icon-btn {
    border: 1px solid var(--border);
    background: transparent;
    color: inherit;
    padding: 8px 16px;
    border-radius: 999px;
    cursor: pointer;
}

.ghost-btn.small {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.ghost-btn.full-width {
    width: 100%;
}


.icon-btn {
    padding: 6px 10px;
    border-radius: 12px;
}

.primary-btn {
    background: linear-gradient(135deg, var(--accent) 0%, #2563eb 100%);
    border: none;
    color: #fff;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
    opacity: 1;
}

.primary-btn:active {
    transform: translateY(0);
}

.primary-btn:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.5);
    outline-offset: 2px;
}

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.ghost-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ghost-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    opacity: 1;
}

.ghost-btn:active {
    transform: translateY(0);
}

.ghost-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.ghost-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    color: #fff;
    opacity: 1;
}

.icon-btn:active {
    transform: scale(0.95);
}

.icon-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.icon-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.form-feedback {
    color: var(--danger);
    min-height: 1em;
}

.form-feedback.is-loading {
    color: var(--muted);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.20);
    background: rgba(148, 163, 184, 0.10);
}

.form-feedback.is-error {
    color: #f87171; /* Vermelho com bom contraste */
    background: rgba(220, 38, 38, 0.15);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.form-feedback.is-success {
    color: #4ade80; /* Verde com bom contraste */
    background: rgba(22, 163, 74, 0.15);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(22, 163, 74, 0.35);
}

.top-bar {
    padding: 12px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

.top-text {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    min-width: 0;
}

.top-title {
    font-size: 1.2rem;
    margin: 0;
    font-weight: 700;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.top-text .current-tab-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-text .current-tab-title:empty {
    display: none;
}

.top-text .current-tab-context {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    max-width: 220px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(74, 222, 128, 0.18);
    color: #bbf7d0;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-text .current-tab-context:empty {
    display: none;
}

.top-caption {
    margin: 4px 0 0;
    color: var(--muted);
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-actions .icon-btn,
.top-actions .user-link:not(.install-btn) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.top-actions .icon-btn {
    background: rgba(15, 23, 42, 0.38);
}

.top-actions .user-link:not(.install-btn) {
    background: rgba(15, 23, 42, 0.26);
}

.top-actions .icon-btn .feather-icon,
.top-actions .icon-btn svg,
.top-actions .user-link:not(.install-btn) .feather-icon,
.top-actions .user-link:not(.install-btn) svg {
    width: 14px !important;
    height: 14px !important;
    min-width: 14px;
    min-height: 14px;
}

.top-actions .icon-btn:hover,
.top-actions .user-link:not(.install-btn):hover {
    border-color: rgba(255, 255, 255, 0.14);
}

.user-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: opacity 0.2s ease;
    border-radius: 50%;
}

.user-chip:hover {
    opacity: 0.9;
}

.user-chip:active {
    opacity: 0.8;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--accent);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
}

.user-email {
    color: var(--muted);
    font-size: 0.85rem;
}



.mobile-user-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: none !important;
}

.mobile-user-backdrop[aria-hidden="false"] {
    display: block !important;
}

.mobile-user-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(320px, 85vw);
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 201;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: none !important;
    overflow-y: auto;
}

.mobile-user-panel[aria-hidden="false"] {
    transform: translateX(0);
    display: block !important;
}

.mobile-user-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.close-mobile-user-panel {
    align-self: flex-end;
}

.mobile-user-info {
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-user-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 4px;
    color: #e2e8f0;
}

.mobile-user-email {
    font-size: 0.9rem;
    color: var(--muted);
    margin: 0;
}

.mobile-user-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-user-link {
    width: 100%;
    justify-content: flex-start;
}

.mobile-user-panel .mobile-user-link {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
    height: 40px;
    padding: 0 12px;
    gap: 10px;
    border-radius: 10px;
}

.mobile-user-panel .mobile-user-link .btn-label {
    display: inline-flex;
    align-items: center;
    color: #e2e8f0;
    font-size: 0.92rem;
}

@media (min-width: 641px) {
    .mobile-user-backdrop,
    .mobile-user-panel {
        display: none !important;
    }
    
    .mobile-user-backdrop[aria-hidden="false"],
    .mobile-user-panel[aria-hidden="false"] {
        display: none !important;
    }
}
.content {
    flex: 1;
    padding: 0 16px 32px;
}

.tab-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 8px;
    margin-bottom: 8px;
    position: relative;
}

.tab-section > * {
    align-self: center;
}

.tab-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.tab-actions .primary-btn,
.tab-actions .ghost-btn,
.tab-actions .icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
}

.tab-actions .new-task-bar-btn {
    padding: 8px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    background: #22c55e;
    border: none;
    color: #fff;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
}

.tab-actions .new-task-bar-btn:hover {
    background: #16a34a;
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.4);
}

.tab-actions .new-task-bar-btn:active {
    background: #15803d;
}

.tab-bar-abas-btn {
    min-height: 36px;
    box-sizing: border-box;
}

.tab-bar-compact {
    padding: 8px 8px 12px;
    margin-bottom: 4px;
}

.tab-bar-popover-anchor {
    position: relative;
    flex-shrink: 0;
    min-width: max-content;
}

.tab-section {
    max-width: 100%;
    overflow: hidden;
}

.tab-bar-main {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

@media (min-width: 641px) {
    .tab-section.tab-bar-compact {
        overflow: visible;
    }
    .tab-section.tab-bar-compact .tab-bar-main,
    .tab-bar-popover-anchor {
        overflow: visible;
    }
}

.tab-bar-predefined {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.tab-bar-sep {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.tab-bar-quick-access-wrap {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.tab-bar-quick-access {
    padding: 4px 0;
    gap: 6px;
}

.tab-bar-abas-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    min-width: 0;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(15, 23, 42, 0.85);
    color: #cbd5e1;
    font-weight: 500;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.tab-bar-abas-btn:hover {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(255, 255, 255, 0.25);
    color: #e2e8f0;
}

.tab-bar-abas-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.tab-bar-abas-label {
    white-space: nowrap;
}

@media (max-width: 640px) {
    .tab-bar-abas-label {
        display: none;
    }
    .tab-bar-sep {
        display: none;
    }
    .tab-bar-popover-anchor {
        flex-shrink: 0;
    }
    .tab-bar-abas-btn {
        padding: 8px 10px;
    }
}

.tab-abas-popover {
    min-width: 280px;
    max-width: 400px;
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    padding: 12px;
    margin-top: 4px;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: visibility 0.2s, opacity 0.2s, transform 0.2s;
    box-sizing: border-box;
}

/* Fechado: fora da viewport (visibility:hidden ainda conta no overflow do documento) */
.tab-abas-popover:not(.is-open):not(.tab-abas-popover--preparing) {
    position: fixed !important;
    left: -9999px !important;
    top: 0 !important;
    right: auto !important;
    bottom: auto !important;
    width: 0 !important;
    height: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border-width: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: none !important;
    transition: none !important;
}

/* Posição ajustada via JS (fixed) para não ultrapassar a viewport */
.tab-abas-popover.tab-abas-popover--viewport-clamped {
    position: fixed;
    margin-top: 0;
    transform: none;
    right: auto;
}

.tab-abas-popover.is-open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.tab-abas-popover.is-open.tab-abas-popover--viewport-clamped {
    transform: none;
}

/* Abertura/fechamento: invisível durante troca absolute ↔ fixed (evita salto visível) */
.tab-abas-popover.tab-abas-popover--preparing {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: none !important;
}

.tab-abas-popover-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tab-abas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.tab-abas-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tab-abas-header-actions .icon-btn {
    flex-shrink: 0;
}

.tab-abas-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #e2e8f0;
}

.tab-abas-popover-inner .tab-abas-header,
.tab-abas-sheet-inner .tab-abas-header {
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tab-abas-sections {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tab-abas-section {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
}

.tab-abas-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(30, 41, 59, 0.5);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.tab-abas-section-header:hover {
    background: rgba(30, 41, 59, 0.8);
}

.tab-abas-section-header .section-name {
    font-weight: 500;
    color: #e2e8f0;
}

.tab-abas-section-header .section-chevron {
    transition: transform 0.2s;
}

.tab-abas-section.is-expanded .section-chevron {
    transform: rotate(180deg);
}

.tab-abas-section-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px;
}

.tab-abas-section.collapsed .tab-abas-section-tabs {
    display: none;
}

.tab-abas-pill {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(15, 23, 42, 0.85);
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.tab-abas-pill:hover {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(255, 255, 255, 0.25);
}

.tab-abas-pill.active {
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--accent) 0%, #3b82f6 100%);
    color: #fff;
}

.tab-abas-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.2s, opacity 0.2s;
}

.tab-abas-sheet-backdrop.is-open {
    visibility: visible;
    opacity: 1;
}

.tab-abas-sheet {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 60vh;
    background: rgba(15, 23, 42, 0.98);
    border-radius: 16px 16px 0 0;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4);
}

.tab-abas-sheet.is-open {
    display: block;
    animation: tab-abas-sheet-slide 0.3s ease;
}

@keyframes tab-abas-sheet-slide {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.tab-abas-sheet-handle {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin: 12px auto;
}

.tab-abas-sheet-inner {
    padding: 0 16px 24px;
    max-height: calc(60vh - 40px);
    overflow-y: auto;
}

@media (min-width: 769px) {
    .tab-abas-sheet,
    .tab-abas-sheet-backdrop {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .tab-abas-popover {
        display: none !important;
    }
}

.tabs-scroll-wrapper {
    flex: 1;
    min-width: 0;
    position: relative;
    overflow: hidden;
}

.tabs-scroll {
    display: flex;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    gap: 8px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-left: 4px;
    padding-right: 4px;
}

.tabs-scroll::-webkit-scrollbar {
    display: none;
}

.tab-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.85);
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.tab-nav-btn svg {
    width: 18px;
    height: 18px;
}

.tab-nav-btn:hover:not(:disabled) {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(255, 255, 255, 0.25);
    color: #e2e8f0;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tab-nav-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.tab-nav-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.tab-nav-btn:disabled {
    opacity: 0.25;
    cursor: default;
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(255, 255, 255, 0.08);
}

@media (max-width: 640px) {
    .tab-nav-btn {
        display: none;
    }
}

.tab-pill {
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(15, 23, 42, 0.85);
    padding: 10px 18px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #e2e8f0;
    font-weight: 500;
    position: relative;
    overflow: visible;
    min-width: fit-content;
    flex-shrink: 0;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tab-pill::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
    pointer-events: none;
}

.tab-pill:hover::before {
    opacity: 0;
}

.tab-pill:hover {
    background: rgba(15, 23, 42, 0.85);
    border-color: rgba(255, 255, 255, 0.15);
    transform: none;
    box-shadow: none;
}

.tab-pill:active {
    transform: none;
}

.tab-pill:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.tab-pill.active {
    border-color: var(--accent);
    border-width: 2px;
    background: linear-gradient(135deg, var(--accent) 0%, #3b82f6 100%);
    color: #fff;
    transform: none;
    box-shadow: none;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.tab-pill.active::before {
    opacity: 0;
}

.tab-pill.predefined.active {
    border-color: var(--accent);
    border-width: 2px;
    background: linear-gradient(135deg, var(--accent) 0%, #3b82f6 100%);
    color: #fff;
    font-weight: 600;
}

.tab-pill.predefined.active::before {
    opacity: 0;
}

.tab-pill-content {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 1;
}

.tab-pill-favorites .tab-pill-label,
.tab-pill-all .tab-pill-label,
.tab-pill-health .tab-pill-label {
    display: none;
}

.tab-pill-health {
    padding-left: 12px;
    padding-right: 12px;
}

.tab-pill-assinaturas {
    padding-left: 12px;
    padding-right: 12px;
}

.tab-pill-dogs {
    padding-left: 12px;
    padding-right: 12px;
}

.tab-pill-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

.tab-pill-badge,
.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #0f172a;
    margin-left: 6px;
    flex-shrink: 0;
}

.count-badge-overdue {
    background: #dc2626;
    color: #fff;
}

.count-badge-today {
    background: #0ea5e9;
    color: #fff;
}

.count-badge-favorites {
    background: #eab308;
    color: #0f172a;
}

.count-badge-assinaturas {
    background: #a855f7;
    color: #fff;
}

.count-badge-reminders {
    background: #14b8a6;
    color: #042f2e;
}

.count-badge.hidden {
    display: none;
}

.overdue-dropdown-anchor,
.reminder-dropdown-anchor {
    position: relative;
}

.overdue-tasks-btn {
    position: relative;
}

.reminder-tasks-btn {
    position: relative;
}

.overdue-tasks-btn .count-badge-overdue {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 0.65rem;
}

.reminder-tasks-btn .count-badge-reminders {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 0.65rem;
}

.overdue-dropdown-panel {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    min-width: 320px;
    max-width: 90vw;
    max-height: 70vh;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    z-index: 200;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.reminder-dropdown-panel {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    min-width: 360px;
    max-width: min(92vw, 420px);
    max-height: 70vh;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    z-index: 200;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.overdue-dropdown-panel.hidden {
    display: none;
}

.reminder-dropdown-panel.hidden {
    display: none;
}

.overdue-dropdown-header {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.reminder-dropdown-header {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.overdue-dropdown-title {
    font-weight: 600;
    font-size: 0.95rem;
    display: block;
    margin-bottom: 10px;
}

.reminder-dropdown-title {
    font-weight: 600;
    font-size: 0.95rem;
    display: block;
}

.reminder-dropdown-subtitle {
    font-size: 0.8rem;
    color: var(--muted);
}

.reminder-toggle-future {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--muted);
    cursor: pointer;
}

.reminder-toggle-future input {
    margin: 0;
}

.overdue-toggle-next3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--muted);
    cursor: pointer;
}

.overdue-toggle-next3 input {
    margin: 0;
}

.overdue-dropdown-list {
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reminder-dropdown-list {
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.overdue-dropdown-list .task-card {
    flex-shrink: 0;
}

.overdue-dropdown-list .task-card-overdue-dropdown {
    cursor: pointer;
}

.overdue-loading,
.overdue-empty,
.overdue-error,
.reminder-loading,
.reminder-empty,
.reminder-error {
    padding: 16px;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

.task-reminder-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-reminder-section-title {
    margin: 0;
    padding: 0 2px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.task-reminder-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.72);
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.task-reminder-item:hover {
    border-color: rgba(20, 184, 166, 0.4);
    background: rgba(15, 23, 42, 0.9);
    transform: translateY(-1px);
}

.task-reminder-item.is-viewed {
    border-color: rgba(148, 163, 184, 0.16);
}

.task-reminder-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.task-reminder-main {
    min-width: 0;
    flex: 1;
}

.task-reminder-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #99f6e4;
}

.task-reminder-date.is-past {
    color: #fbbf24;
}

.task-reminder-date.is-future {
    color: #93c5fd;
}

.task-reminder-title {
    margin: 4px 0 0;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
    color: #e2e8f0;
    word-break: break-word;
}

.task-reminder-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--muted);
}

.task-reminder-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.task-reminder-status.is-today {
    color: #99f6e4;
    background: rgba(20, 184, 166, 0.16);
}

.task-reminder-status.is-pending {
    color: #fde68a;
    background: rgba(245, 158, 11, 0.18);
}

.task-reminder-status.is-future {
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.18);
}

.task-reminder-status.is-viewed {
    color: #cbd5e1;
    background: rgba(148, 163, 184, 0.15);
}

.task-reminder-notes {
    margin: 0;
    color: #cbd5e1;
    font-size: 0.88rem;
    line-height: 1.55;
    white-space: pre-wrap;
}

.task-reminder-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.task-reminder-actions .ghost-btn.small,
.task-reminder-actions .primary-btn.small {
    padding: 7px 10px;
}

.task-reminder-task-label {
    margin: 0 0 4px;
}

.task-action-btn.create-reminder-btn:hover {
    background: rgba(20, 184, 166, 0.16);
    color: #99f6e4;
}

.task-action-btn.create-reminder-btn.has-reminder {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.45);
    color: #fbbf24;
}

.task-action-btn.create-reminder-btn.has-reminder .task-action-icon .feather-icon,
.task-action-btn.create-reminder-btn.has-reminder .task-action-icon svg,
.task-action-btn.create-reminder-btn.has-reminder .task-action-icon svg * {
    color: #fbbf24 !important;
    stroke: #fbbf24 !important;
}

.task-action-btn.create-reminder-btn.has-reminder:hover {
    background: rgba(245, 158, 11, 0.22);
    border-color: rgba(245, 158, 11, 0.68);
    color: #fde68a;
}

.task-action-btn.create-reminder-btn.has-reminder:hover .task-action-icon .feather-icon,
.task-action-btn.create-reminder-btn.has-reminder:hover .task-action-icon svg,
.task-action-btn.create-reminder-btn.has-reminder:hover .task-action-icon svg * {
    color: #fde68a !important;
    stroke: #fde68a !important;
}

.task-card-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    transition: opacity 0.2s ease;
}

.task-card-modal-overlay.is-open {
    display: flex;
}

.task-card-modal-overlay.hidden {
    display: none !important;
}

.task-card-modal-box {
    position: relative;
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    background: rgba(15, 23, 42, 0.98);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.task-card-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    background: rgba(15, 23, 42, 0.9);
    border-radius: 50%;
}

.task-card-modal-content {
    overflow-y: auto;
    padding: 16px;
    flex: 1;
    min-height: 0;
}

.task-card-modal-content .task-card {
    max-width: 100%;
}

.task-card-modal-content .task-card.task-card-in-modal {
    margin: 0;
}

/* Modal de descrição em tela cheia */
.task-description-modal-box {
    max-width: min(920px, 92vw);
    padding: 24px;
    box-sizing: border-box;
}

.task-description-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 48px 16px 0;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.task-description-modal-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    flex: 1;
    min-width: 0;
}

.task-description-modal-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.task-description-modal-body {
    flex: 1;
    min-height: 200px;
    overflow-y: auto;
    padding: 16px 0;
}

.task-description-modal-view {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.65;
}

.task-description-modal-view p {
    margin: 0 0 0.5em 0;
}

.task-description-modal-view p:last-child {
    margin-bottom: 0;
}

.task-description-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 16px;
    margin-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.filters-card {
    background: rgba(15, 23, 42, 0.8);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 8px 0 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.search-wrapper {
    position: relative;
}

.search-wrapper input {
    width: 100%;
    padding-right: 40px;
    transition: all 0.2s ease;
}

.search-wrapper input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-wrapper .icon-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.filter-row {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (min-width: 768px) {
    .filter-row {
        flex-direction: row;
    }
}

.filter-block {
    flex: 1;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    padding: 14px;
    background: rgba(15, 23, 42, 0.7);
    transition: all 0.2s ease;
}

.filter-block:hover {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.8);
}

.filter-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.group-by-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
}

.group-by-label {
    margin: 0;
    font-size: 0.8rem;
    color: var(--muted);
}

.group-by-select {
    font-size: 0.8rem;
    height: 32px;
    padding: 4px 10px;
}

.filter-title {
    margin: 0 0 12px;
    font-weight: 600;
    color: var(--muted);
}

.tag-chip-list,
.pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-chip,
.pill {
    border-radius: 999px;
    border: 1px solid var(--border);
    padding: 6px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    background: rgba(148, 163, 184, 0.08);
    color: #e2e8f0;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.tag-chip.active,
.pill.active {
    border-color: var(--accent);
    background: var(--accent);
    color: #0f172a;
}

.filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin: 0;
}

.toggle input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.toggle span {
    flex: 1;
    user-select: none;
}

.filter-actions .toggle span {
    font-size: 0.82rem;
    color: var(--muted);
}

.filter-toggle-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-toggle {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.filter-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.filter-toggle:active {
    transform: translateY(0);
}

.filter-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.filter-toggle.active,
.filter-toggle[aria-pressed="true"] {
    background: linear-gradient(135deg, var(--accent) 0%, #3b82f6 100%);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    font-weight: 600;
}

.sort-compact {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    padding: 4px 6px;
    transition: all 0.2s ease;
}

.sort-compact:hover {
    background: rgba(148, 163, 184, 0.15);
    border-color: rgba(148, 163, 184, 0.3);
}

.sort-compact:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.sort-compact select {
    border: none;
    background: transparent;
    color: inherit;
    font-size: 0.85rem;
    padding: 4px 2px;
}

.sort-compact select:focus {
    outline: none;
    box-shadow: none;
}

.sort-compact .icon-btn {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    max-width: 30px;
    max-height: 30px;
    padding: 0;
    flex: 0 0 30px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.sort-compact .icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.sort-compact .icon-btn:active {
    transform: scale(0.95);
}

.sort-direction-btn .sort-direction-icon {
    font-size: 0.7rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
}

.view-toggle-group {
    display: flex;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 2px;
    background: rgba(15, 23, 42, 0.5);
    transition: all 0.2s ease;
}

.view-toggle-group:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.view-toggle-btn {
    padding: 6px 8px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}

.view-toggle-btn:active {
    transform: scale(0.95);
}

.view-toggle-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.view-toggle-btn.active {
    background: linear-gradient(135deg, var(--accent) 0%, #3b82f6 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.view-toggle-btn svg {
    display: block;
}

.tag-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tag-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tag-chip-list.collapsed {
    max-height: 0;
    overflow: hidden;
    padding: 0;
    border: none;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.tag-chip-list:not(.collapsed) {
    max-height: 500px;
    padding: 8px 0 0;
}

.task-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    animation: fadeIn 0.3s ease;
}

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



.task-list.list-view {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-list.list-view .task-card {
    display: grid;
    grid-template-columns: 4px 1fr auto;
    grid-template-rows: auto 1fr;
    gap: 0;
    padding: 0;
    align-items: start;
    min-height: 56px;
}

/* Quando não expandido, só precisa de uma linha */
.task-list.list-view .task-card:not(.expanded) {
    grid-template-rows: auto;
}

/* Quando expandido, reorganizar para 2 colunas */
.task-list.list-view .task-card.expanded {
    grid-template-columns: 4px 1fr 1fr;
    grid-template-rows: auto;
    align-items: start;
}

.task-list.list-view .task-card::before {
    grid-column: 1;
    grid-row: 1 / -1;
    width: 4px;
    height: 100%;
    border-radius: var(--radius) 0 0 var(--radius);
    top: 0;
    left: 0;
    right: auto;
    bottom: 0;
}

/* Header compacto - primeira linha */
.task-list.list-view .task-header {
    grid-column: 2;
    grid-row: 1;
    padding: 10px 14px 8px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    position: relative;
    z-index: 1;
}

/* Quando expandido, header fica na primeira coluna */
.task-list.list-view .task-card.expanded .task-header {
    grid-column: 2;
}

.task-list.list-view .task-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: nowrap;
    margin: 0;
    min-height: 32px;
}

.task-list.list-view .task-time-chip {
    font-size: 0.72rem;
    padding: 3px 8px;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.5;
    display: inline-flex;
    align-items: center;
}

.task-list.list-view .task-controls {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    align-items: center;
    position: relative;
    z-index: 2;
}

/* Quando expandido no modo lista, reorganizar elementos */
.task-list.list-view .task-card.expanded .task-header {
    grid-row: 1;
    position: relative;
}

/* Tags: esconder do header quando expandido, mostrar na coluna esquerda abaixo da data */
.task-list.list-view .task-card.expanded .task-tags {
    display: none;
}

.task-list.list-view .task-card.expanded .task-list-expanded-left .task-tags-expanded {
    display: flex;
    margin: 4px 0 0 0;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
}

.task-list.list-view .task-card.expanded .task-list-expanded-left .task-tags-expanded span {
    font-size: 0.7rem;
    padding: 3px 7px;
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
}

/* Manter controles e ações visíveis ao expandir no modo lista
   (layout unificado não usa mais colunas duplicadas) */
.task-list.list-view .task-card.expanded .task-controls {
    display: flex !important;
}

.task-list.list-view .task-card.expanded .task-extra-row {
    display: block !important;
}

.task-list.list-view .task-card.expanded .progress-bar {
    display: block !important;
}

.task-list.list-view .task-card.expanded .task-actions {
    display: flex !important;
}

/* Mostrar esses elementos na coluna esquerda quando expandido */
.task-list.list-view .task-card.expanded .task-list-expanded-left .task-extra-row,
.task-list.list-view .task-card.expanded .task-list-expanded-left .progress-bar {
    display: block !important;
}

.task-list.list-view .task-card.expanded .task-list-expanded-left .task-actions-expanded {
    display: flex !important;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    font-size: 0.8rem;
}

/* Botão de favoritar: sempre visível no canto inferior direito do card */
.task-list.list-view .task-footer-actions {
    position: absolute;
    bottom: 10px;
    right: 14px;
    margin: 0;
    z-index: 10;
}

.task-list.list-view .task-card.expanded .task-footer-actions {
    display: flex;
    position: absolute;
    bottom: 10px;
    right: 14px;
    margin: 0;
    z-index: 10;
}

/* Quando expandido, o botão de favoritar fica no canto inferior direito do card inteiro */
.task-list.list-view .task-card.expanded {
    position: relative;
}

/* Botão de favoritar: sempre visível no canto inferior direito */
.task-list.list-view .task-footer-actions {
    position: absolute;
    bottom: 10px;
    right: 14px;
    margin: 0;
    z-index: 10;
}

.task-list.list-view .task-card.expanded .task-footer-actions {
    display: flex;
    position: absolute;
    bottom: 10px;
    right: 14px;
    margin: 0;
    z-index: 10;
}

/* Quando expandido, o botão de favoritar fica no canto inferior direito do card inteiro */
.task-list.list-view .task-card.expanded {
    position: relative;
}

.task-list.list-view .task-action-btn {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    max-width: 30px;
    max-height: 30px;
    padding: 0;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.task-list.list-view .task-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

/* Título - maior e mais importante */
.task-list.list-view .task-title {
    font-size: 0.95rem;
    line-height: 1.4;
    margin: 0 0 4px 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-weight: 500;
    color: #e2e8f0;
}

/* Datas - menor, abaixo do título */
.task-list.list-view .task-dates {
    font-size: 0.8rem;
    margin: 0 0 4px 0;
    white-space: nowrap;
    flex-shrink: 0;
    color: var(--muted);
    line-height: 1.4;
}

/* Tags - linha separada, abaixo das datas */
.task-list.list-view .task-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 4px 0 0 0;
    align-items: center;
    position: relative;
    z-index: 1;
    clear: both;
    grid-column: 2;
}

/* Quando expandido, tags ficam na primeira coluna */
.task-list.list-view .task-card.expanded .task-tags {
    grid-column: 2;
}

.task-list.list-view .task-tags span {
    font-size: 0.7rem;
    padding: 3px 7px;
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* Actions e footer actions - alinhados corretamente, não sobrepostos */
.task-list.list-view .task-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    font-size: 0.8rem;
    margin: 4px 0 0 0;
    position: relative;
    z-index: 1;
    clear: both;
    grid-column: 2;
}

.task-list.list-view .task-footer-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    margin: 4px 0 0 0;
    position: relative;
    z-index: 1;
    clear: both;
    grid-column: 2;
}

/* Quando expandido, actions ficam na primeira coluna */
.task-list.list-view .task-card.expanded .task-actions,
.task-list.list-view .task-card.expanded .task-footer-actions {
    grid-column: 2;
}

.task-list.list-view .task-favorite-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.task-list.list-view .task-favorite-btn .task-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Progress bar e extra row */
.task-list.list-view .progress-bar {
    margin: 4px 0 0 0;
    position: relative;
    z-index: 1;
}

.task-list.list-view .task-extra-row {
    margin: 4px 0 0 0;
    position: relative;
    z-index: 1;
}

/* Container de 2 colunas para modo lista expandido - escondido inicialmente */
.task-list.list-view .task-list-expanded-wrapper {
    display: none !important;
}

.task-list.list-view .task-card.expanded .task-list-expanded-wrapper {
    grid-column: 2 / 4;
    grid-row: 1;
    display: grid !important;
    grid-template-columns: 1fr 1.2fr;
    gap: 24px;
    align-items: start;
    padding: 12px 14px 14px 14px;
    margin: 0;
    border: none;
    position: relative;
    z-index: 0;
}

/* Coluna esquerda - todas as informações da tarefa */
.task-list.list-view .task-list-expanded-left {
    display: none;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.task-list.list-view .task-card.expanded .task-list-expanded-left {
    display: flex !important;
}

/* Header na coluna esquerda */
.task-list.list-view .task-header-expanded {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0;
    margin: 0;
}

.task-list.list-view .task-header-expanded .task-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: nowrap;
    margin: 0;
    min-height: 32px;
}

.task-list.list-view .task-header-expanded .task-controls-expanded {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    align-items: center;
}

.task-list.list-view .task-header-expanded .task-title {
    font-size: 0.95rem;
    line-height: 1.4;
    margin: 0 0 4px 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-weight: 500;
    color: #e2e8f0;
}

.task-list.list-view .task-header-expanded .task-dates {
    font-size: 0.8rem;
    margin: 0 0 4px 0;
    white-space: nowrap;
    flex-shrink: 0;
    color: var(--muted);
    line-height: 1.4;
}

/* Tags na coluna esquerda */
.task-list.list-view .task-tags-expanded {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 4px 0 0 0;
    align-items: center;
}

.task-list.list-view .task-tags-expanded span {
    font-size: 0.7rem;
    padding: 3px 7px;
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
}

/* Outros elementos na coluna esquerda */
.task-list.list-view .task-extra-row-expanded {
    margin: 4px 0 0 0;
}

.task-list.list-view .task-actions-expanded {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    font-size: 0.8rem;
    margin: 4px 0 0 0;
}

.task-list.list-view .task-footer-actions-expanded {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    margin: 4px 0 0 auto;
    position: absolute;
    bottom: 0;
    right: 0;
}

.task-list.list-view .task-list-expanded-left {
    padding-bottom: 50px;
}

/* Reordenar elementos na coluna esquerda: tags primeiro (logo após header), depois o resto */
.task-list.list-view .task-card.expanded .task-list-expanded-left .task-tags-expanded {
    order: 1;
}

.task-list.list-view .task-card.expanded .task-list-expanded-left .task-extra-row {
    order: 2;
}

.task-list.list-view .task-card.expanded .task-list-expanded-left .progress-bar {
    order: 3;
}

.task-list.list-view .task-card.expanded .task-list-expanded-left .task-actions {
    order: 4;
}

.task-list.list-view .task-card.expanded .task-list-expanded-left .task-meta {
    order: 5;
}

.task-list.list-view .task-card.expanded .task-list-expanded-left .task-attachments {
    order: 5;
}

.task-list.list-view .task-card.expanded .task-list-expanded-left .task-links {
    order: 6;
}

/* Coluna direita - subtarefas (task-expanded) */
.task-list.list-view .task-list-expanded-right {
    display: none;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.task-list.list-view .task-card.expanded .task-list-expanded-right {
    display: flex !important;
}

/* Conteúdo expandido tradicional (modo grid ou lista não expandido) */
.task-list.list-view .task-expanded:not(.task-list-expanded-right) {
    grid-column: 2 / -1;
    grid-row: 3;
    padding: 12px 14px 14px 14px;
    margin-top: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    z-index: 0;
}

/* Quando expandido no modo lista, ajustar grid do card */
.task-list.list-view .task-card.expanded {
    grid-template-rows: auto 1fr;
    position: relative;
}

/* Type badge menor */
.task-list.list-view .task-type-badge {
    font-size: 0.68rem;
    padding: 2px 6px;
    margin-bottom: 3px;
    display: inline-block;
}

/* Progress bar menor */
.task-list.list-view .progress-bar {
    height: 5px;
    margin-top: 3px;
}

/* Completion chip e flags menores */
.task-list.list-view .completion-chip {
    font-size: 0.7rem;
    padding: 2px 6px;
}

.task-list.list-view .icon-flag {
    font-size: 0.7rem;
}

/* Task extra row (finance badges) */
.task-list.list-view .task-extra-row {
    display: inline-flex;
    gap: 6px;
    margin: 2px 0 0 0;
    align-items: center;
}

.task-list.list-view .task-finance-chip {
    font-size: 0.7rem;
    padding: 2px 6px;
}

/* Garantir que elementos inline fiquem na mesma linha quando possível */
.task-list.list-view .task-header > h3.task-title {
    display: inline;
    vertical-align: baseline;
}

.task-list.list-view .task-header > p.task-dates {
    display: inline;
    vertical-align: baseline;
}

.task-list.list-view .task-header > .task-tags {
    display: inline-flex;
    vertical-align: middle;
}

.task-list.list-view .task-header > .task-actions {
    display: inline-flex;
    vertical-align: middle;
}

/* Conteúdo expandido - elementos mais compactos e organizados */
.task-list.list-view .task-expanded .task-content-left,
.task-list.list-view .task-expanded .task-content-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-list.list-view .task-expanded .task-meta {
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
    color: var(--muted);
}

.task-list.list-view .task-expanded .task-links,
.task-list.list-view .task-expanded .task-attachments {
    font-size: 0.85rem;
    margin: 0;
}

.task-list.list-view .task-expanded .task-links-header,
.task-list.list-view .task-expanded .task-attachments-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.task-list.list-view .task-expanded .task-links-title,
.task-list.list-view .task-expanded .task-attachments-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #e2e8f0;
}

.task-list.list-view .task-expanded .task-links ul,
.task-list.list-view .task-expanded .task-attachments ul {
    margin: 0;
    padding-left: 0;
    font-size: 0.85rem;
    list-style: none;
}

.task-list.list-view .task-expanded .task-links li,
.task-list.list-view .task-expanded .task-attachments li {
    margin: 6px 0;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-list.list-view .task-expanded .task-links a,
.task-list.list-view .task-expanded .task-attachments a {
    color: var(--accent);
    text-decoration: none;
    flex: 1;
}

.task-list.list-view .task-expanded .task-links a:hover,
.task-list.list-view .task-expanded .task-attachments a:hover {
    text-decoration: underline;
}

.task-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: var(--muted);
}

/* Botões de ação na coluna esquerda */
.task-list.list-view .task-expanded-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.task-list.list-view .task-expanded-controls {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.task-list.list-view .task-expanded-controls .task-action-btn {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    max-width: 30px;
    max-height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.task-list.list-view .task-expanded-footer {
    display: flex;
    gap: 6px;
    align-items: center;
}

.task-list.list-view .task-expanded-footer .task-favorite-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.subtask-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 600;
    color: #e2e8f0;
    padding: 0;
    margin: 0 0 8px 0;
}

.subtask-header .add-subtask {
    margin-left: 10px;
}

.task-list.list-view .task-expanded .subtask-header {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #e2e8f0;
}

.task-list.list-view .task-expanded .subtask-header .ghost-btn.small {
    font-size: 0.75rem;
    padding: 4px 10px;
    margin-left: 10px;
}

.task-list.list-view .task-expanded .subtasks {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Sprint info box (acima do contador de tarefas) */
.sprint-info-box {
    padding: 12px 18px;
    margin: 0 0 12px;
    background: rgba(15, 23, 42, 0.6);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.85rem;
    color: var(--muted);
    width: 100%;
    box-sizing: border-box;
}

.sprint-info-box.hidden {
    display: none;
}

.sprint-info-inner {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sprint-info-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.sprint-info-dates {
    margin: 0;
    font-size: 0.9rem;
    color: #e2e8f0;
}

.sprint-info-days {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
    text-align: right;
    flex-shrink: 0;
}

.sprint-progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
}

.sprint-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent, #3b82f6), #60a5fa);
    transition: width 0.3s ease;
}

.sprint-progress-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.sprint-progress-group {
    flex: 1;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sprint-progress-label {
    font-size: 0.8rem;
    color: var(--muted);
}

.sprint-progress-hours-wrap {
    position: relative;
}

.sprint-progress-bar-hours {
    cursor: pointer;
    outline: none;
}

.sprint-progress-bar-hours:focus-visible {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.45);
}

.sprint-hours-tooltip {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    width: min(360px, calc(100vw - 42px));
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(2, 6, 23, 0.96);
    box-shadow: 0 12px 28px rgba(2, 6, 23, 0.5);
    z-index: 25;
    display: none;
}

.sprint-progress-hours-wrap:hover .sprint-hours-tooltip,
.sprint-progress-hours-wrap:focus-within .sprint-hours-tooltip {
    display: block;
}

.sprint-hours-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 18px;
    width: 10px;
    height: 10px;
    border-left: 1px solid rgba(148, 163, 184, 0.35);
    border-top: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(2, 6, 23, 0.96);
    transform: rotate(45deg);
}

.sprint-hours-tooltip-title {
    margin: 0;
    color: #e2e8f0;
    font-size: 0.78rem;
    font-weight: 700;
}

.sprint-hours-tooltip-summary {
    margin: 2px 0 8px;
    color: #94a3b8;
    font-size: 0.72rem;
}

.sprint-hours-tooltip-meta {
    margin: 0 0 8px;
    color: #cbd5e1;
    font-size: 0.7rem;
}

.sprint-hours-tooltip-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 180px;
    overflow: auto;
}

.sprint-hours-tooltip-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.74rem;
}

.sprint-hours-tooltip-item-title {
    color: #e2e8f0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sprint-hours-tooltip-item-right {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.sprint-hours-tooltip-item-badge {
    font-size: 0.62rem;
    line-height: 1.2;
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.9);
}

.sprint-hours-tooltip-item.is-counted .sprint-hours-tooltip-item-badge {
    border-color: rgba(34, 197, 94, 0.45);
    color: #bbf7d0;
    background: rgba(6, 78, 59, 0.4);
}

.sprint-hours-tooltip-item.is-not-counted .sprint-hours-tooltip-item-badge {
    border-color: rgba(234, 179, 8, 0.4);
    color: #fde68a;
    background: rgba(120, 53, 15, 0.35);
}

.sprint-hours-tooltip-item-hours {
    color: #e2e8f0;
    font-size: 0.72rem;
}

.sprint-hours-tooltip-empty {
    margin: 0;
    color: #94a3b8;
    font-size: 0.74rem;
}

.sprint-hours-tooltip-footer {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.72rem;
    color: #cbd5e1;
}

.sprint-hours-tooltip-footer strong {
    color: #e2e8f0;
}

@media (max-width: 640px) {
    .sprint-progress-row {
        flex-direction: column;
        gap: 12px;
    }
    .sprint-progress-group {
        min-width: 100%;
    }
    .sprint-hours-tooltip {
        left: auto;
        right: 0;
        width: min(320px, calc(100vw - 30px));
    }
    .sprint-hours-tooltip::before {
        left: auto;
        right: 14px;
    }
}

.tab-sprint-dates-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.tab-sprint-dates-block.hidden {
    display: none;
}

.tab-badge.sprint {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

.task-counter {
    padding: 12px 18px;
    margin: 0 0 16px;
    background: rgba(15, 23, 42, 0.6);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.9rem;
    color: var(--muted);
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
}

.task-counter-text {
    color: var(--muted);
    white-space: nowrap;
}

.task-counter strong {
    color: #e2e8f0;
    font-weight: 600;
}

.overdue-toggle {
    margin-left: 10px;
}
@media (max-width: 640px) {
    .task-list {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1200px) {
    .task-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1600px) {
    .task-list {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.task-card {
    background: rgba(15, 23, 42, 0.9);
    padding: 18px;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.task-card::before {
    content: '';
    position: absolute;
    left: -1px;
    right: -1px;
    top: -1px;
    height: 8px;
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
    background: var(--priority-color, transparent);
    z-index: 1;
}

.task-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 0;
}

.task-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(15, 23, 42, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.task-card:hover::after {
    opacity: 1;
}

.task-card:active {
    transform: translateY(0);
}

/* Card em andamento: degradê esverdeado em movimento */
@keyframes task-card-in-progress-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.task-card.in-progress {
    border-color: rgba(34, 197, 94, 0.35);
}

.task-card.in-progress::after {
    opacity: 1;
    background: linear-gradient(
        120deg,
        rgba(22, 163, 74, 0.18) 0%,
        rgba(34, 197, 94, 0.12) 25%,
        rgba(74, 222, 128, 0.15) 50%,
        rgba(34, 197, 94, 0.12) 75%,
        rgba(22, 163, 74, 0.18) 100%
    );
    background-size: 200% 200%;
    animation: task-card-in-progress-shift 4s ease infinite;
}

.task-card.completed {
    border-color: #16a34a;
    opacity: 0.6;
}

.task-card.completed::before {
    background: #16a34a;
}

.task-card.completed:hover {
    opacity: 0.95;
}

.task-card.favorited {
    border-color: #fbbf24;
}

.task-card.favorited::before {
    background: #fbbf24;
}

/* Cartões da aba Assinaturas (resumo + detalhes ao expandir) */
.subscription-task-card {
    border-color: rgba(168, 85, 247, 0.22);
    background: linear-gradient(165deg, rgba(88, 28, 135, 0.12) 0%, rgba(15, 23, 42, 0.92) 48%);
}

.subscription-task-header {
    padding-bottom: 0;
    /* O .task-toggle-btn é absolute no canto superior direito do card; evita sobrepor editar/favoritar/excluir */
    padding-right: 42px;
    box-sizing: border-box;
}

.subscription-task-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.subscription-task-title {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.35;
}

.subscription-task-controls {
    flex-shrink: 0;
}

.task-list.list-view .subscription-task-card .subscription-task-header {
    padding-right: 42px;
}

.subscription-subsummary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
    gap: 10px 14px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.subscription-subsummary-empty {
    margin: 12px 0 0;
    font-size: 0.85rem;
}

.subscription-subsummary-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.subscription-subsummary-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    font-weight: 600;
}

.subscription-subsummary-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e2e8f0;
    word-break: break-word;
}

.subscription-subsummary-amount .subscription-subsummary-value {
    color: #c4b5fd;
    font-variant-numeric: tabular-nums;
}

.subscription-task-expanded {
    gap: 14px;
}

.subscription-detail-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subscription-detail-block .subscription-detail-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    font-weight: 600;
}

.subscription-detail-value-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.subscription-detail-value {
    font-size: 0.9rem;
    color: #e2e8f0;
    word-break: break-all;
}

.subscription-login-value {
    margin-bottom: 4px;
}

.subscription-password-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
    width: 100%;
}

.subscription-password-row .task-secret-inline {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.subscription-url-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.subscription-url-link {
    color: #a5b4fc;
    text-decoration: underline;
    text-underline-offset: 2px;
    word-break: break-all;
    font-size: 0.9rem;
}

.subscription-url-link:hover {
    color: #c7d2fe;
}

.subscription-description-wrap {
    margin-top: 0;
}

.task-action-btn.task-in-progress-btn.active {
    background: rgba(34, 197, 94, 0.25);
    color: #86efac;
}

.task-action-btn.task-in-progress-btn.active:hover {
    background: rgba(34, 197, 94, 0.35);
    color: #bbf7d0;
}

.task-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.task-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.task-time-chip {
    background: rgba(37, 99, 235, 0.15);
    color: #bfdbfe;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.task-time-chip:hover {
    background: rgba(37, 99, 235, 0.2);
    transform: scale(1.05);
}

.task-time-chip.muted {
    background: rgba(148, 163, 184, 0.15);
    color: var(--muted);
}

.task-time-chip.task-due-chip.due-overdue {
    background: rgba(220, 38, 38, 0.15);
}

.task-time-chip.task-due-chip.due-warning {
    background: rgba(245, 158, 11, 0.15);
}

.task-time-chip.task-due-chip.due-ok {
    background: rgba(56, 189, 248, 0.15);
}

.task-controls {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex-shrink: 0;
}

.task-title {
    margin: 0;
    font-size: 0.95rem;
    transition: color 0.2s ease;
    cursor: pointer;
}

.task-title:hover {
    color: #cbd5e1;
}

.task-title-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--accent);
    border-radius: 10px;
    padding: 8px 12px;
    color: #e2e8f0;
    font: inherit;
    outline: none;
}

.task-title-input:focus {
    box-shadow: 0 0 0 1px var(--accent-soft);
}

.task-time-editor {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.task-time-editor input {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px 8px;
    color: #e2e8f0;
    font: inherit;
}

.task-time-editor input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-soft);
    outline: none;
}

.task-dates {
    font-size: 0.8rem;
    color: var(--muted);
    margin: 0;
}

.task-created-at {
    font-size: 8px;
    color: var(--muted);
    margin: 2px 0 0 0;
    line-height: 1.2;
    width: 100%;
    flex-basis: 100%;
}

.task-action-btn {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    max-width: 30px;
    max-height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0 !important;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.task-action-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.task-action-btn:active {
    transform: scale(0.95);
}

.task-action-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.task-action-btn.complete-btn.done {
    background: rgba(22, 163, 74, 0.25);
    border-color: rgba(22, 163, 74, 0.5);
    color: #4ade80;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.2);
}

.task-action-btn.complete-btn.done:hover {
    background: rgba(22, 163, 74, 0.35);
    border-color: rgba(22, 163, 74, 0.6);
    box-shadow: 0 4px 16px rgba(22, 163, 74, 0.3);
}

.task-action-btn.complete-btn:hover {
    background: rgba(22, 163, 74, 0.25);
    border-color: rgba(34, 197, 94, 0.5);
}

.task-action-btn.task-delete-btn {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.45);
    background: rgba(248, 113, 113, 0.08);
}

.task-action-btn.task-delete-btn:hover {
    background: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.7);
}

.task-action-btn.task-delete-btn:active {
    background: rgba(248, 113, 113, 0.2);
}

.task-action-btn.task-ai-chat-btn {
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.45);
    background: rgba(37, 99, 235, 0.1);
}

.task-action-btn.task-ai-chat-btn:hover {
    background: rgba(37, 99, 235, 0.2);
    border-color: rgba(59, 130, 246, 0.7);
}

.task-ai-chat-text-btn {
    width: auto;
    min-width: 48px;
    padding: 0 8px;
    gap: 4px;
}

.task-ai-chat-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
}

.task-toggle-btn.spaced-toggle {
    margin-left: 12px;
}

/* Botão alternar detalhes: posição absoluta no canto superior direito, sem borda/fundo */
.task-card .task-toggle-btn.toggle-task {
    position: absolute;
    top: 12px;
    right: 6px;
    z-index: 5;
    margin-left: 0;
    border: none;
    background: transparent;
    width: 26px;
    height: 26px;
    padding: 0;
    min-width: 26px;
    min-height: 26px;
    transform: none;
}

.task-card .task-toggle-btn.toggle-task:hover {
    background: transparent;
    border: none;
    transform: none;
}

.task-card .task-toggle-btn.toggle-task:active {
    background: transparent;
    border: none;
    transform: none;
}

.task-card .task-toggle-btn.toggle-task .toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}

.task-card .task-toggle-btn.toggle-task .toggle-icon svg,
.task-card .task-toggle-btn.toggle-task .toggle-icon .feather-icon {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    min-height: 18px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.task-card.expanded .task-toggle-btn.toggle-task .toggle-icon svg,
.task-card.expanded .task-toggle-btn.toggle-task .toggle-icon .feather-icon {
    transform: rotate(180deg);
}

.task-action-btn .toggle-icon {
    font-size: 0.85rem;
    line-height: 1;
}

.task-action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.task-ai-context-panel {
    display: none;
    margin-top: 8px;
    background: rgba(2, 6, 23, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 10px;
    padding: 10px;
    width: 100%;
}

.task-ai-context-panel.open {
    display: block;
}

.task-ai-context-label {
    display: block;
    font-size: 0.75rem;
    color: #cbd5e1;
    margin-bottom: 6px;
}

.task-ai-context-input {
    width: 100%;
    min-height: 54px;
    resize: vertical;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.9);
    color: #e2e8f0;
    padding: 8px 10px;
    font-size: 0.85rem;
}

.task-ai-context-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.task-ai-context-response {
    margin: 8px 0 0;
    font-size: 0.8rem;
    color: #cbd5e1;
}

.task-action-icon .feather-icon,
.task-action-icon svg {
    color: #e2e8f0 !important;
    stroke: #e2e8f0 !important;
    fill: none !important;
    display: block !important;
    width: 12px !important;
    height: 12px !important;
    flex-shrink: 0;
    visibility: visible !important;
    opacity: 1 !important;
}

.task-action-icon svg * {
    stroke: #e2e8f0 !important;
    fill: none !important;
}

.task-action-btn:hover .feather-icon,
.task-action-btn:hover svg {
    color: #fff !important;
    stroke: #fff !important;
}

.task-action-btn:hover svg * {
    stroke: #fff !important;
}

.toggle-icon .feather-icon,
.toggle-icon svg[data-feather],
.tag-toggle-icon.feather-icon,
.tag-toggle-icon svg[data-feather] {
    color: #e2e8f0;
    stroke: currentColor;
    fill: none;
    display: block;
    transition: transform 0.3s ease;
}

.tab-notes-toggle[aria-expanded="true"] .toggle-icon .feather-icon,
.tab-notes-toggle[aria-expanded="true"] .toggle-icon svg[data-feather] {
    transform: rotate(180deg);
}

/* Estilos gerais para SVGs do Feather Icons */
svg[data-feather],
svg.feather {
    display: block;
    stroke: currentColor;
    fill: none;
}

/* SVGs dentro de containers específicos devem respeitar o tamanho do container */
.task-action-icon svg {
    width: 12px !important;
    height: 12px !important;
}

.feather-icon {
    display: inline-block;
}

/* Garantir que os SVGs dentro de .task-action-icon sejam visíveis */
.task-action-icon svg {
    width: 12px !important;
    height: 12px !important;
    flex-shrink: 0;
    min-width: 12px;
    min-height: 12px;
    visibility: visible !important;
    opacity: 1 !important;
    stroke: #e2e8f0 !important;
}

.task-action-icon svg polyline,
.task-action-icon svg path,
.task-action-icon svg line,
.task-action-icon svg circle,
.task-action-icon svg rect {
    stroke: #e2e8f0 !important;
    fill: none !important;
}

.tag-toggle-btn[aria-expanded="true"] .tag-toggle-icon {
    transform: rotate(180deg);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.task-title {
    margin: 0;
    font-size: 1rem;
}

.task-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.task-title-inline {
    margin: 0;
    font-size: 1rem;
}

.task-secret-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.task-secret-text {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    letter-spacing: 0.08em;
}

.task-secret-actions-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.icon-btn.xs-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 8px;
}

.icon-btn.xs-btn .task-action-icon svg {
    width: 14px;
    height: 14px;
}
.task-meta {
    color: var(--muted);
    font-size: 0.85rem;
}

.task-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.task-tags span {
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.75rem;
}

.task-tags.inline {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-left: 8px;
    align-items: center;
}

.task-tags.inline span {
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-size: 0.72rem;
    color: var(--muted);
}

.task-type-badge.inline-badge {
    display: inline-flex;
    align-items: center;
    padding: 0 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #fbbf24;
    margin-left: 4px;
    font-size: 0.72rem;
    font-weight: 600;
}

.task-links-inline {
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.task-attachments-inline {
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.task-links {
    font-size: 0.9rem;
    margin: 8px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.task-links .task-links-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.task-links .task-links-title {
    font-weight: 600;
    color: #e2e8f0;
}

.task-links ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-links li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    line-height: 1.5;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.task-links a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.task-links a:hover {
    text-decoration: underline;
}

.task-link-item-main {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.task-link-item-icon {
    color: #93c5fd;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.task-link-copy-btn {
    flex-shrink: 0;
}

#task-links-modal .modal-body {
    gap: 0;
}

.task-links-modal {
    margin: 0;
}

.task-attachments {
    font-size: 0.9rem;
    margin: 8px 0 0;
}

.task-attachments .task-attachments-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.task-attachments .task-attachments-title {
    font-weight: 600;
    color: #e2e8f0;
}

.task-attachments ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.task-attachments li {
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.5;
}

.task-attachments a {
    color: var(--accent);
    text-decoration: none;
    flex: 1;
}

.task-attachments a:hover {
    text-decoration: underline;
}

.task-attachment-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: var(--muted);
    flex-shrink: 0;
}

.task-attachment-size {
    color: var(--muted);
    font-size: 0.85rem;
    margin-left: auto;
}

.task-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: var(--muted);
}

.task-inline-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
}

.task-progress-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.task-description {
    display: none;
    margin-top: 10px;
    padding: 8px 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.6;
    word-wrap: break-word;
}

.task-description-wrapper {
    display: none;
    position: relative;
    margin-top: 10px;
}

.task-card.expanded .task-description-wrapper {
    display: block;
}

.task-description-wrapper .task-description {
    margin-right: 0;
}

.task-description-fullscreen-btn {
    position: absolute;
    top: 0;
    right: 0;
}

.task-card:not(.expanded) .task-description-fullscreen-btn {
    display: none !important;
}

.task-description p {
    margin: 0 0 0.5em 0;
}

.task-description p:last-child {
    margin-bottom: 0;
}

.task-description ul,
.task-description ol {
    margin: 0.25em 0 0.5em 1.2em;
    padding: 0;
}

.task-description li {
    margin: 0.2em 0;
}

.task-description a {
    color: var(--accent);
    text-decoration: none;
}

.task-description a:hover {
    text-decoration: underline;
}

.task-description br {
    line-height: 1.6;
}

.task-card.expanded .task-description {
    display: block;
}

/* Garantir que a descrição apareça no modo lista também */
.task-list.list-view .task-card.expanded .task-description {
    display: block;
}

.progress-bar.flex {
    flex: 1;
}

.progress-percent {
    min-width: 42px;
    text-align: right;
    font-size: 0.85rem;
    color: #e2e8f0;
}

.task-favorite-btn.favorite .task-action-icon svg {
    fill: #fbbf24 !important;
    stroke: #fbbf24 !important;
}

.task-favorite-btn.favorite .task-action-icon svg * {
    fill: #fbbf24 !important;
    stroke: #fbbf24 !important;
}

.task-favorite-btn.favorite .task-action-icon svg path,
.task-favorite-btn.favorite .task-action-icon svg polyline,
.task-favorite-btn.favorite .task-action-icon svg line,
.task-favorite-btn.favorite .task-action-icon svg circle,
.task-favorite-btn.favorite .task-action-icon svg rect {
    fill: #fbbf24 !important;
    stroke: #fbbf24 !important;
}

.task-favorite-btn.favorite:hover .task-action-icon svg,
.task-favorite-btn.favorite:hover .task-action-icon svg * {
    fill: #fbbf24 !important;
    stroke: #fbbf24 !important;
}

.task-favorite-btn.favorite:hover .task-action-icon svg path,
.task-favorite-btn.favorite:hover .task-action-icon svg polyline,
.task-favorite-btn.favorite:hover .task-action-icon svg line,
.task-favorite-btn.favorite:hover .task-action-icon svg circle,
.task-favorite-btn.favorite:hover .task-action-icon svg rect {
    fill: #fbbf24 !important;
    stroke: #fbbf24 !important;
}

.task-favorite-btn.favorite {
    color: #fbbf24;
    border-color: rgba(255, 255, 255, 0.2);
}

.task-inline-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.progress-fill {
    height: 100%;
    border-radius: inherit;
}

.task-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

.icon-flag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.task-expanded {
    display: none;
    flex-direction: column;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Task-expanded tradicional (modo grid) */
.task-card.expanded .task-expanded:not(.task-list-expanded-right) {
    display: flex;
}

/* Task-expanded no modo lista - sempre escondido, exceto quando dentro do wrapper visível */
.task-list.list-view .task-expanded {
    display: none !important;
}

.task-list.list-view .task-card.expanded .task-list-expanded-wrapper .task-expanded.task-list-expanded-right {
    display: flex !important;
    padding-top: 0;
    border-top: none;
}

.subtasks {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subtasks .subtask-row:last-child {
    border-bottom: none;
}

/* ==== Overrides finais para modo lista (2 colunas) ==== */
/* Não mostrar task-expanded por padrão */
.task-card .task-expanded { display: none; }
.task-card.expanded .task-expanded { display: flex; }

/* Layout base list-view */
.task-list.list-view .task-card {
    display: grid;
    grid-template-columns: 4px 1fr;
    grid-template-rows: auto auto;
    align-items: start;
    padding: 0;
    position: relative;
}

/* Layout expandido: 2 colunas (conteúdo na 2, subtarefas na 3) */
.task-list.list-view .task-card.expanded {
    grid-template-columns: 4px 1fr 1fr;
    grid-template-rows: auto;
    align-items: start;
}

/* Coluna 2: tudo da tarefa */
.task-list.list-view .task-header,
.task-list.list-view .task-tags,
.task-list.list-view .task-extra-row,
.task-list.list-view .task-progress-row,
.task-list.list-view .task-description,
.task-list.list-view .progress-bar,
.task-list.list-view .task-actions,
.task-list.list-view .task-footer-actions,
.task-list.list-view .task-meta,
.task-list.list-view .task-links,
.task-list.list-view .task-attachments {
    grid-column: 2;
}

.task-list.list-view .task-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.task-list.list-view .task-progress-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-list.list-view .task-actions,
.task-list.list-view .task-footer-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Favoritar no canto inferior direito */
.task-list.list-view .task-footer-actions {
    display: none;
}

/* Coluna 3: subtarefas */
.task-list.list-view .task-expanded {
    display: none !important;
}
.task-list.list-view .task-card.expanded .task-expanded {
    display: flex !important;
    grid-column: 3;
    grid-row: 1;
    padding-left: 14px;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    align-self: start;
}

.subtask-row {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 8px;
    align-items: flex-start;
    padding: 10px 0;
    position: relative;
    z-index: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.subtask-info {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-width: 0;
    width: 100%;
}

.subtask-check-icon {
    font-size: 1rem;
    color: #10b981;
    font-weight: bold;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    line-height: 1;
    width: 18px;
    height: 18px;
}

.subtask-info strong {
    font-size: 0.85rem;
    font-weight: 500;
    color: #e2e8f0;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    flex: 1;
    min-width: 0;
}

.subtask-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    justify-content: flex-end;
    width: 100%;
}

.subtask-weight {
    font-size: 0.75rem;
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    line-height: 1.4;
}

.subtask-inline-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.subtask-inline-actions .icon-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.subtask-toggle-btn {
    font-size: 0.8rem;
    padding: 5px 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Ajustes específicos para modo lista */
.task-list.list-view .subtask-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    grid-template-columns: unset;
    grid-template-rows: unset;
    padding: 6px 0;
    gap: 10px;
}

.task-list.list-view .subtask-actions {
    width: auto;
    justify-content: flex-end;
}

.task-list.list-view .subtask-info {
    gap: 6px;
}

.task-list.list-view .subtask-info strong {
    font-size: 0.8rem;
}

.task-list.list-view .subtask-weight {
    font-size: 0.7rem;
}

.task-list.list-view .subtask-actions {
    gap: 8px;
}

.task-list.list-view .subtask-toggle-btn {
    font-size: 0.75rem;
    padding: 4px 10px;
}

.task-list.list-view .subtask-inline-actions .icon-btn {
    width: 26px;
    height: 26px;
}

/* Subtarefas compactas no modo grade */
.task-list:not(.list-view) .subtask-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    grid-template-columns: unset;
    grid-template-rows: unset;
    padding: 5px 0;
}

.task-list:not(.list-view) .subtask-info {
    gap: 5px;
    width: auto;
    flex: 1;
    min-width: 0;
}

.task-list:not(.list-view) .subtask-info strong {
    font-size: 0.72rem;
    line-height: 1.2;
}

.task-list:not(.list-view) .subtask-weight {
    font-size: 0.66rem;
    line-height: 1;
}

.task-list:not(.list-view) .subtask-actions {
    width: auto;
    gap: 3px;
}

.task-list:not(.list-view) .subtask-inline-actions {
    gap: 2px;
}

.task-list:not(.list-view) .subtask-toggle-btn,
.task-list:not(.list-view) .subtask-inline-actions .icon-btn {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    padding: 0;
    border-radius: 7px;
}

.task-list:not(.list-view) .subtask-actions .task-action-icon svg,
.task-list:not(.list-view) .subtask-actions .task-action-icon .feather-icon {
    width: 12px !important;
    height: 12px !important;
    min-width: 12px !important;
    min-height: 12px !important;
}

.task-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    margin: 24px 0 12px;
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: var(--radius);
}

.task-group-header:first-child {
    margin-top: 0;
}

.task-group-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #93c5fd;
}

.task-group-count {
    font-size: 0.85rem;
    color: var(--muted);
}

.task-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.task-group-content {
    display: block;
    transition: opacity 0.2s ease, max-height 0.3s ease;
}

.task-group-content.collapsed {
    display: none;
}

.task-group-header.collapsed {
    opacity: 0.7;
}

.subtask-toggle-btn {
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: inherit;
}

.subtask-toggle-btn.done {
    background: rgba(22, 163, 74, 0.15);
    color: #4ade80;
    border-color: rgba(22, 163, 74, 0.4);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 200;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.modal-overlay.visible {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    width: min(640px, 100%);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.95) translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.visible .modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.modal.large {
    width: min(860px, 100%);
}

.modal.small {
    width: min(420px, 100%);
}


.modal-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.5);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #e2e8f0;
}

.modal-header .icon-btn {
    transition: all 0.2s ease;
}

.modal-header .icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.modal-header .icon-btn:active {
    transform: scale(0.95);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
    min-height: 0;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.3);
}

.two-columns {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.two-columns > label {
    flex: 1;
}

.date-field-row {
    display: flex;
    gap: 8px;
    width: 100%;
}

.date-field-row input,
.date-field-row select {
    flex: 1;
}

.time-select {
    min-width: 110px;
}

.modal-body label input,
.modal-body label textarea,
.modal-body label select {
    width: 100%;
}

.form-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Campos adicionais (tags): espaçamento entre rótulos e entre campos */
#conditional-fields-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#conditional-fields-container .conditional-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
}

#conditional-fields-container .conditional-field > span:first-child {
    font-size: 0.88rem;
    font-weight: 500;
    color: #cbd5e1;
    line-height: 1.35;
}

#conditional-fields-container .conditional-field-input {
    margin-top: 0;
}

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

.new-tag-row {
    display: flex;
    gap: 8px;
}

#subtask-list,
#link-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subtask-item,
.link-item {
    display: grid;
    gap: 12px;
    grid-template-columns: 2fr 1fr auto;
    align-items: center;
    padding: 8px 0;
}

.link-item {
    grid-template-columns: 1fr 1.5fr auto;
}

.subtask-item .subtask-title,
.link-item .link-label,
.link-item .link-url {
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.subtask-item .subtask-title:focus,
.link-item .link-label:focus,
.link-item .link-url:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(15, 23, 42, 0.8);
}

.subtask-item .subtask-title::placeholder,
.link-item .link-label::placeholder,
.link-item .link-url::placeholder {
    color: var(--muted);
}

.weight-control {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 4px 8px;
}

.weight-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #e2e8f0;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.weight-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.weight-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.weight-value {
    min-width: 30px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: #e2e8f0;
    flex-shrink: 0;
}

.subtask-item .icon-btn,
.link-item .icon-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 4px;
}

.load-more {
    text-align: center;
    padding: 20px;
    color: var(--muted);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.load-more:hover {
    color: #e2e8f0;
}

.load-more.loading {
    opacity: 0.7;
}

.load-more button {
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(37, 99, 235, 0.3);
    color: var(--accent);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.load-more button:hover {
    background: rgba(37, 99, 235, 0.25);
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.load-more button:active {
    transform: translateY(0);
}

.tabs-modal-body {
    padding-top: 8px;
}

.tabs-modal-grid {
    display: grid;
    grid-template-columns: minmax(380px, 1.05fr) minmax(360px, 1fr);
    gap: 16px;
    align-items: flex-start;
}

@media (max-width: 1024px) {
    .tabs-modal-grid {
        grid-template-columns: 1fr;
    }
}

.tabs-modal-panel {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 14px;
}

.tabs-modal-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.tabs-modal-search {
    flex: 1 1 220px;
}

.tabs-modal-search input[type="search"] {
    width: 100%;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: #e2e8f0;
}

.tabs-modal-filter select {
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: #e2e8f0;
}

.tabs-count {
    color: var(--muted);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.tab-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 65vh;
    overflow: auto;
    padding: 2px;
}

.tab-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.tab-row:hover {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
}

.tab-row.drag-over {
    border-color: var(--accent);
    background: rgba(37, 99, 235, 0.08);
}

.tab-row.is-hidden {
    opacity: 0.7;
}

.tab-drag-handle {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: #e2e8f0;
    border-radius: 10px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
}

.tab-row-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.tab-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap;
}

.tab-row-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
    justify-content: flex-start;
    order: 1;
}

.tab-color-circle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: inline-flex;
}

.tab-name {
    font-weight: 600;
    color: #f1f5f9;
}

.tab-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
}

.tab-badge.info {
    border-color: rgba(37, 99, 235, 0.35);
    background: rgba(37, 99, 235, 0.15);
    color: #bfdbfe;
}

.tab-badge.muted {
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(148, 163, 184, 0.15);
    color: var(--muted);
}

.tab-badge.quick {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.15);
}

.tab-badge.section-count {
    border-color: rgba(14, 165, 233, 0.35);
    background: rgba(14, 165, 233, 0.12);
    color: #bae6fd;
}

.tab-badge.section-expanded {
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.12);
    color: #bbf7d0;
}

.tab-badge.health {
    border-color: rgba(34, 197, 94, 0.4);
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
}

.tab-section-icon {
    display: inline-flex;
    align-items: center;
    color: var(--muted);
}

.tab-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    margin-left: auto;
    flex-shrink: 0;
    order: 2;
}

.tab-hide-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--muted);
}

.tab-row-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tab-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
}

.tab-chip {
    display: inline;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    font-size: 0.65rem;
    color: var(--muted);
}

.tab-chip.muted {
    color: var(--muted);
}

.top-text .current-tab-title[data-tab] {
    margin-left: 10px;
}

.tab-pill.predefined {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
    color: #e2e8f0;
}

.tabs-modal-form-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tabs-modal-subtitle {
    margin: 0;
    color: var(--muted);
    font-weight: 600;
}

.tabs-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.tab-type-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tab-type-field select {
    max-width: 100%;
}

.field-hint {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 4px;
}

.color-picker-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.color-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-inputs input[type="text"] {
    max-width: 110px;
}

.toggle-list.compact {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 4px 0 8px;
}

.form-block.compact {
    margin: 0;
}

.form-block .block-header.tight {
    margin-bottom: 6px;
}

.pill-list.dense {
    gap: 6px;
}

.form-feedback:empty {
    display: none;
    padding: 0;
    border: none;
    background: transparent;
}

.new-tag-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.ghost-btn.xsmall {
    padding: 6px 10px;
    font-size: 0.78rem;
}

.modal-footer.compact {
    margin-top: 8px;
}

.hidden {
    display: none !important;
}

.task-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--muted);
    background: rgba(15, 23, 42, 0.3);
    border-radius: var(--radius);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    margin: 24px 0;
}

.task-empty::before {
    content: '📋';
    display: block;
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.task-empty p {
    margin: 8px 0;
    font-size: 1rem;
}

.modal-hint {
    margin: 0 0 12px 0;
    color: var(--muted, rgba(255, 255, 255, 0.6));
    font-size: 0.9rem;
}

.admin-panel .panel-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.table-wrapper {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.admin-table th,
.admin-table td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-table th {
    color: var(--muted);
    font-weight: 500;
    font-size: 0.85rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
    font-weight: 500;
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.badge:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.badge.success {
    background: rgba(22, 163, 74, 0.2);
    color: #4ade80;
    border-color: rgba(22, 163, 74, 0.3);
}

.badge.error {
    background: rgba(220, 38, 38, 0.2);
    color: #f87171;
    border-color: rgba(220, 38, 38, 0.3);
}

.badge.warning {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.3);
}

.badge.info {
    background: rgba(37, 99, 235, 0.2);
    color: var(--accent);
    border-color: rgba(37, 99, 235, 0.3);
}

.cell-actions {
    display: flex;
    gap: 8px;
}

/* Botão e campo de busca mobile (ocultos no desktop) */
.mobile-search-btn,
.mobile-search-inline {
    display: none;
}

@media (min-width: 641px) {
    .mobile-search-btn,
    .mobile-search-inline {
        display: none !important;
    }
}

@media (max-width: 640px) {
    .top-bar {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        min-height: 48px;
        padding: 10px 13px;
        gap: 8px;
    }

    .top-text {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        flex-direction: row;
        align-items: center;
    }

    .top-title {
        display: none;
    }

    .top-text .current-tab-title {
        font-size: 1.15rem;
        font-weight: 700;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .top-actions {
        flex: 0 0 auto;
        flex-wrap: nowrap;
        justify-content: flex-end;
        gap: 5px;
        align-items: center;
    }

    .mobile-search-btn {
        display: inline-flex;
        min-width: 32px;
        width: 32px;
        height: 32px;
        padding: 0;
    }

    .mobile-search-inline {
        display: none;
        align-items: center;
        gap: 6px;
        flex: 1;
        min-width: 0;
        max-width: 200px;
    }

    .mobile-search-inline.is-open {
        display: flex;
    }

    .mobile-search-inline input {
        flex: 1;
        min-width: 0;
        height: 32px;
        padding: 6px 10px;
        font-size: 13px;
        background: rgba(11, 18, 32, 0.8);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        color: #e2e8f0;
    }

    .mobile-search-inline input::placeholder {
        color: var(--muted);
    }

    .mobile-search-close {
        flex-shrink: 0;
        width: 32px;
        height: 32px;
        padding: 0;
    }

    .filters-card .search-wrapper {
        display: none;
    }

    .user-link .btn-label {
        display: none;
    }

    .user-link {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 32px;
        width: 32px;
        height: 32px;
        padding: 0;
    }

    .user-link .feather-icon,
    .user-link svg {
        width: 14px;
        height: 14px;
        min-width: 14px;
        min-height: 14px;
        flex-shrink: 0;
    }

    .top-actions .mobile-account-action {
        display: none !important;
    }

    .mobile-user-panel .mobile-user-link {
        width: 100%;
        min-width: 0;
        height: 40px;
        padding: 0 12px;
        justify-content: flex-start;
        gap: 10px;
    }

    .mobile-user-panel .mobile-user-link .btn-label {
        display: inline-flex;
    }

    .user-chip {
        width: auto;
        min-width: 0;
        justify-content: center;
        padding: 0;
    }

    .top-bar .avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .subtask-item,
    .link-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .subtask-item .subtask-title,
    .link-item .link-label,
    .link-item .link-url {
        width: 100%;
    }

    .weight-control {
        width: 100%;
        justify-content: center;
    }
}

/* Estilos mobile para filtros */
.mobile-filter-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.floating-filter-btn {
    display: none !important;
}

.floating-task-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.mobile-filter-backdrop {
    display: none !important;
}

@media (min-width: 641px) {
    .floating-filter-btn {
        display: none !important;
    }
    
    .mobile-filter-backdrop {
        display: none !important;
    }
}

body.show-mobile-filters {
    overflow: hidden;
}

/* Portal do filter-panel no app-shell - acima do top-bar */
.filter-overlay-portal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    pointer-events: none;
}

body.show-mobile-filters .filter-overlay-portal {
    pointer-events: auto;
}

@media (max-width: 640px) {
    .filters-card {
        margin-bottom: 12px;
    }

    .modal {
        width: 100%;
        max-height: 100vh;
        border-radius: var(--radius) var(--radius) 0 0;
        margin-top: auto;
    }

    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .modal-header {
        padding: 20px;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-footer {
        padding: 16px 20px;
    }

    .filters-card .filter-row {
        display: none;
    }

    .mobile-filter-header {
        display: flex;
    }

    .floating-filter-btn {
        position: fixed;
        bottom: 24px;
        left: 24px;
        right: auto;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--accent) 0%, #2563eb 100%);
        border: none;
        box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        color: #fff;
        font-size: 1.5rem;
    }

    .floating-filter-btn:hover {
        transform: scale(1.1) translateY(-2px);
        box-shadow: 0 12px 32px rgba(37, 99, 235, 0.5);
    }

    .floating-filter-btn:active {
        transform: scale(0.95);
    }


    .floating-filter-btn[aria-expanded="true"] {
        background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
        box-shadow: 0 8px 24px rgba(220, 38, 38, 0.4);
    }

    .floating-filter-btn:focus-visible {
        outline: 3px solid rgba(255, 255, 255, 0.5);
        outline-offset: 4px;
    }


    .mobile-filter-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(2, 6, 23, 0.65);
        backdrop-filter: blur(2px);
        z-index: 1500;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    body.show-mobile-filters .mobile-filter-backdrop {
        opacity: 1;
        pointer-events: auto;
        display: block;
    }

    body.show-mobile-filters .filter-overlay-portal .filter-block {
        background: rgba(15, 23, 42, 0.95);
    }

    #close-mobile-filters {
        display: inline-flex;
    }
}

/* Finance summary */
.finance-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    padding: 16px;
    background: rgba(15, 23, 42, 0.7);
    margin: 0 0 24px;
}

.finance-chip {
    flex: 1;
    min-width: 180px;
    background: rgba(37, 99, 235, 0.15);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.finance-chip .finance-label {
    font-size: 0.85rem;
    color: var(--muted);
}

.finance-chip strong {
    font-size: 1.1rem;
    color: #fff;
}


/* ========== ANOTAÇÕES DE ABAS ========== */
/* ===== Módulo Saúde (aba com tab_type = health) ===== */
.health-view {
    margin-bottom: 24px;
    padding: 20px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
}

.health-view.hidden {
    display: none !important;
}

.health-view-header {
    margin-bottom: 16px;
}

.health-view-title {
    margin: 0 0 8px;
    font-size: 1.35rem;
    font-weight: 600;
    color: #e2e8f0;
}

.health-view-intro {
    margin: 0;
    font-size: 0.95rem;
    color: var(--muted);
    line-height: 1.5;
}

.health-view-no-tags-warning {
    margin: 12px 0;
    padding: 12px 16px;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.35);
    border-radius: 8px;
    font-size: 0.9rem;
    color: #fcd34d;
}

.health-view-no-tags-warning.hidden {
    display: none !important;
}

.health-view-no-tags-warning p {
    margin: 0;
    line-height: 1.5;
}

.health-view-tasks-block {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.health-view-tasks-title {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 600;
    color: #cbd5e1;
}

.health-view-tasks-desc {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.health-profile-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    flex-wrap: wrap;
}

.health-profile-select {
    min-width: 180px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card);
    color: #e2e8f0;
    flex: 1 1 220px;
    max-width: 360px;
}

.health-view-no-profiles {
    margin: 20px 0;
    padding: 24px;
    background: rgba(15, 23, 42, 0.6);
    border-radius: var(--radius);
    text-align: center;
}

.health-view-no-profiles.hidden {
    display: none !important;
}

.health-view-no-profiles p {
    margin: 0 0 16px;
    color: var(--muted);
}

.health-dashboard {
    margin-top: 16px;
}

.health-dashboard.hidden {
    display: none !important;
}

.health-dashboard-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 640px) {
    .health-dashboard-row {
        grid-template-columns: 1fr;
    }
}

.health-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.health-card-title {
    margin: 0 0 12px;
    font-size: 1rem;
    font-weight: 600;
    color: #cbd5e1;
}

.health-chart-wrap {
    height: 200px;
    margin: 8px 0;
}

.health-card-hint {
    margin: 8px 0 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.health-action-buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.health-action-btn {
    width: 100%;
    min-height: 116px;
    aspect-ratio: 1 / 1;
    padding: 14px 10px;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    white-space: normal;
    line-height: 1.25;
    background:
        linear-gradient(180deg, rgba(30, 41, 59, 0.78) 0%, rgba(15, 23, 42, 0.92) 100%);
    border: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.health-action-btn:hover {
    border-color: rgba(96, 165, 250, 0.36);
    background:
        linear-gradient(180deg, rgba(37, 99, 235, 0.16) 0%, rgba(15, 23, 42, 0.94) 100%);
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(2, 6, 23, 0.22);
}

.health-action-btn .health-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(59, 130, 246, 0.14);
    color: #93c5fd;
}

.health-action-btn .health-action-icon .feather-icon,
.health-action-btn .health-action-icon svg {
    width: 24px !important;
    height: 24px !important;
    stroke-width: 2.2;
}

.health-action-btn .health-action-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #e2e8f0;
    letter-spacing: -0.01em;
    max-width: 100%;
}

.health-list-empty {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.health-reminder-list,
.health-done-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.health-reminder-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.health-reminder-item:last-child {
    border-bottom: none;
}

.health-reminder-title {
    flex: 1;
}

.health-reminder-area {
    font-size: 0.85rem;
    color: var(--muted);
}

.health-due {
    font-size: 0.85rem;
    color: #fbbf24;
}

.health-reminder-done-btn {
    padding: 4px;
    color: #4ade80;
}

/* Fluxograma de lembretes e passos */
.health-flow-card {
    grid-column: 1 / -1;
}

.health-flow-hint {
    margin: 0 0 16px;
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.4;
}

.health-flow-container {
    overflow: visible;
    padding: 8px 0;
}

.health-flow-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.health-flow-item {
    background:
        linear-gradient(180deg, rgba(30, 41, 59, 0.24) 0%, rgba(15, 23, 42, 0.12) 100%),
        rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 16px;
    padding: 16px 16px 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.health-flow-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 2px 12px;
    margin-bottom: 2px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.health-flow-item-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #e2e8f0;
    letter-spacing: 0.01em;
    line-height: 1.3;
}

.health-flow-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 2px 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(96, 165, 250, 0.35) rgba(15, 23, 42, 0.18);
}

.health-flow-scroll::-webkit-scrollbar {
    height: 8px;
}

.health-flow-scroll::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.18);
    border-radius: 999px;
}

.health-flow-scroll::-webkit-scrollbar-thumb {
    background: rgba(96, 165, 250, 0.35);
    border-radius: 999px;
}

.health-flow-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(96, 165, 250, 0.5);
}

.health-flow-diagram {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 0;
    padding: 12px 0;
    min-width: max-content;
}

.health-flow-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 168px;
    max-width: 220px;
    flex: 0 0 auto;
}

.health-flow-node-inner {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.96) 0%, rgba(15, 23, 42, 0.92) 100%);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    padding: 12px 14px;
    text-align: center;
    position: relative;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    box-shadow: 0 12px 30px rgba(2, 6, 23, 0.22);
}

.health-flow-node-inner:hover {
    border-color: rgba(148, 163, 184, 0.42);
    box-shadow: 0 16px 32px rgba(2, 6, 23, 0.28);
    transform: translateY(-1px);
}

.health-flow-node.reminder-node .health-flow-node-inner {
    background: linear-gradient(180deg, rgba(29, 78, 216, 0.28) 0%, rgba(30, 41, 59, 0.96) 100%);
    border-color: rgba(96, 165, 250, 0.46);
}

.health-flow-node.step-node.done .health-flow-node-inner {
    background: linear-gradient(180deg, rgba(22, 101, 52, 0.3) 0%, rgba(15, 23, 42, 0.92) 100%);
    border-color: rgba(74, 222, 128, 0.38);
}

.health-flow-node-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: #e2e8f0;
    word-break: break-word;
    line-height: 1.3;
}

.health-flow-node-meta {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 6px;
    line-height: 1.35;
}

.health-flow-node-actions {
    display: flex;
    gap: 4px;
    margin-top: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.health-flow-node-actions .icon-btn {
    padding: 4px 6px;
    font-size: 0.75rem;
    min-width: 24px;
    min-height: 24px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.42);
}

.health-flow-reminder-wrap,
.health-flow-step-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    flex: 0 0 auto;
}

.health-flow-cell-top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: nowrap;
}

.health-flow-add-btns {
    flex-shrink: 0;
}

.health-flow-add-btns .health-flow-add-step-btn,
.health-flow-add-step-parallel {
    padding: 5px 9px;
    font-size: 0.74rem;
    border-radius: 999px;
    white-space: nowrap;
}

.health-flow-connector {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 22px 8px 0;
    flex-shrink: 0;
}

.health-flow-connector svg {
    width: 24px;
    height: 24px;
    color: rgba(148, 163, 184, 0.38);
}

.health-flow-parallel {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    flex: 0 0 auto;
}

.health-flow-roots-parallel {
    align-self: flex-start;
}

.health-flow-parallel-row {
    display: flex;
    align-items: flex-start;
    gap: 0;
    flex-wrap: nowrap;
    width: max-content;
    min-width: max-content;
}

/* Formulário - próximos passos ao criar lembrete */
.health-steps-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.health-steps-section h4 {
    margin: 0 0 6px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #cbd5e1;
}

.health-steps-hint {
    margin: 0 0 12px;
    font-size: 0.85rem;
    color: var(--muted);
}

.health-steps-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.health-step-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px 14px;
}

.health-step-row .health-step-fields {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.health-step-row .health-step-fields label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.health-step-row .health-step-fields label span {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--muted);
}

.health-step-row .health-step-fields input,
.health-step-row .health-step-fields textarea {
    width: 100%;
    min-width: 0;
}

.health-step-row .health-step-fields textarea {
    resize: vertical;
    min-height: 48px;
}

.health-step-row .health-step-remove,
.health-step-row .health-step-remove-add {
    flex-shrink: 0;
}

.health-parallel-toggle {
    margin-bottom: 16px;
}

/* Detalhes do lembrete */
.health-reminder-detail {
    padding: 0 4px;
}

.health-detail-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 16px;
    margin: 0 0 20px;
}

.health-detail-list dt {
    font-weight: 600;
    color: var(--muted);
}

.health-detail-list dd {
    margin: 0;
}

.health-detail-notes {
    white-space: pre-wrap;
}

.health-detail-steps {
    margin: 0;
    padding-left: 20px;
}

.health-detail-steps li {
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.health-detail-steps li.done {
    color: var(--muted);
    text-decoration: line-through;
}

.health-detail-step-notes {
    color: var(--muted);
    font-size: 0.85rem;
}

.health-profiles-intro {
    margin: 0 0 16px;
    color: var(--muted);
    line-height: 1.5;
}

.health-profiles-list-wrap {
    margin-bottom: 16px;
}

.health-profiles-list-title {
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #cbd5e1;
}

.health-profiles-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
}

.health-profiles-list-empty {
    margin: 0;
    padding: 8px 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.health-profiles-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.health-profiles-list-item:last-child {
    border-bottom: none;
}

.health-profiles-list-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.health-profiles-list-name {
    font-weight: 600;
    color: #e2e8f0;
}

.health-profiles-list-meta {
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.4;
}

.health-profiles-list-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.health-profile-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(148, 163, 184, 0.12);
    color: #cbd5e1;
}

.health-profile-badge.primary {
    border-color: rgba(59, 130, 246, 0.28);
    background: rgba(59, 130, 246, 0.14);
    color: #bfdbfe;
}

.health-profile-badge.current {
    border-color: rgba(34, 197, 94, 0.26);
    background: rgba(34, 197, 94, 0.14);
    color: #bbf7d0;
}

.health-profile-form-wrap {
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.health-profile-form-wrap.hidden {
    display: none !important;
}

.health-add-steps-hint {
    margin: 0 0 16px;
    font-size: 0.9rem;
    color: var(--muted);
}

.modal.modal-wide {
    max-width: 560px;
}

.health-done-list li {
    padding: 4px 0;
    font-size: 0.9rem;
}

/* Próximas consultas */
.health-consultations-timeline {
    margin-top: 8px;
}

.health-consultations-timeline-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.health-consultation-card {
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.health-consultation-card:hover {
    border-color: rgba(148, 163, 184, 0.4);
}

.health-consultation-card-inner {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    padding: 12px 14px;
    position: relative;
}

.health-consultation-card.health-consultation-closest .health-consultation-card-inner {
    background: rgba(59, 130, 235, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.health-consultation-card.health-consultation-past .health-consultation-card-inner {
    opacity: 0.75;
}

.health-consultation-badge {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgb(34, 197, 94);
    background: rgba(34, 197, 94, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
}

.health-consultation-date {
    font-weight: 600;
    font-size: 0.95rem;
    color: #e2e8f0;
    margin-bottom: 4px;
}

.health-consultation-area {
    font-size: 0.9rem;
    color: #cbd5e1;
}

.health-consultation-spec {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 2px;
}

.health-consultation-detail-btn {
    margin-top: 10px;
    font-size: 0.8rem;
}

.health-consultation-detail-actions {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.health-consultation-proximity-bar {
    height: 4px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 2px;
    margin-bottom: 8px;
    position: relative;
    overflow: visible;
}

.health-consultation-proximity-fill {
    height: 100%;
    background: rgba(148, 163, 184, 0.5);
    border-radius: 2px;
    transition: width 0.3s;
}

.health-consultation-card.health-consultation-closest .health-consultation-proximity-fill {
    background: rgba(59, 130, 246, 0.6);
}

.health-consultation-proximity-today {
    position: absolute;
    top: -2px;
    width: 2px;
    height: 8px;
    background: rgb(34, 197, 94);
    border-radius: 1px;
    margin-left: -1px;
}

.health-consultation-card.health-consultation-done .health-consultation-card-inner {
    opacity: 0.65;
    background: rgba(30, 41, 59, 0.4);
}

.health-consultation-badge-done {
    background: rgba(34, 197, 94, 0.25);
    color: rgb(134, 239, 172);
}

.health-badge-done {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(34, 197, 94, 0.2);
    color: rgb(134, 239, 172);
    border-radius: 4px;
    font-size: 0.8rem;
}

.health-consultation-attachments-section {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.health-consultation-attachments-section strong {
    display: block;
    margin-bottom: 8px;
}

.health-attachments-list {
    list-style: none;
    margin: 0 0 10px 0;
    padding: 0;
}

.health-attachment-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.health-attachment-link {
    color: var(--accent-color, #3b82f6);
    text-decoration: none;
}

.health-attachment-link:hover {
    text-decoration: underline;
}

.health-attachment-thumb {
    max-width: 48px;
    max-height: 48px;
    object-fit: cover;
    border-radius: 4px;
}

.health-attachments-empty {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    margin: 0 0 8px 0;
}

.health-consultation-upload-label {
    display: inline-block;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.health-consultation-upload-label:hover {
    background: rgba(255, 255, 255, 0.08);
}

.health-areas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.health-area-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.health-area-card-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 4px;
}

.health-area-card-score {
    font-size: 1.1rem;
    color: #86efac;
    margin-bottom: 8px;
}

.health-area-card-meta {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 4px;
}

.health-areas-intro {
    margin: 0 0 16px;
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.5;
}

.health-areas-list-wrap {
    margin-bottom: 16px;
}

.health-areas-list-title {
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #cbd5e1;
}

.health-areas-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
}

.health-areas-list-empty {
    margin: 0;
    padding: 8px 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.health-areas-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.health-areas-list-item:last-child {
    border-bottom: none;
}

.health-areas-list-name {
    flex: 1;
}

.health-area-form-wrap {
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.health-area-form-wrap.hidden {
    display: none !important;
}

.modal-footer.compact {
    margin-top: 12px;
    padding-top: 12px;
}

.tab-notes {
    background: rgba(15, 23, 42, 0.5);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.tab-notes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: rgba(15, 23, 42, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.tab-notes-header:hover {
    background: rgba(15, 23, 42, 0.85);
}

.tab-notes-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #e2e8f0;
}

.tab-notes-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.tab-notes-toggle {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.tab-notes-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.tab-notes-toggle:active {
    transform: scale(0.95);
}

.tab-notes-toggle .toggle-icon {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
    color: var(--muted);
}

.tab-notes-toggle[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

.tab-notes-edit-btn,
.tab-notes-save-btn {
    width: 32px;
    height: 32px;
    color: var(--muted);
    transition: all 0.2s ease;
    border-radius: 8px;
}

.tab-notes-edit-btn:hover,
.tab-notes-save-btn:hover {
    color: var(--accent);
    background: rgba(37, 99, 235, 0.15);
    transform: scale(1.1);
}

.tab-notes-edit-btn:active,
.tab-notes-save-btn:active {
    transform: scale(0.95);
}

.tab-notes-save-btn {
    display: none;
}

.tab-notes-content {
    padding: 18px;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, padding 0.3s ease;
    overflow: hidden;
}

.tab-notes-content.collapsed {
    max-height: 0;
    padding: 0 18px;
    opacity: 0;
    overflow: hidden;
}

/* Modo visualização */
.tab-notes-view {
    min-height: 80px;
    padding: 16px;
    background: rgba(11, 18, 32, 0.6);
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 0.95rem;
    line-height: 1.7;
    word-wrap: break-word;
    transition: all 0.2s ease;
}

.tab-notes-view:hover {
    background: rgba(11, 18, 32, 0.7);
}

.tab-notes-view-hidden {
    display: none !important;
}

.tab-notes-view img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 12px 0;
    display: block;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tab-notes-view img:hover {
    opacity: 0.9;
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.tab-notes-view h1,
.tab-notes-view h2,
.tab-notes-view h3,
.tab-notes-view h4 {
    margin: 16px 0 10px;
    font-weight: 600;
    color: #e2e8f0;
}

.tab-notes-view h1 {
    font-size: 1.6rem;
}

.tab-notes-view h2 {
    font-size: 1.35rem;
}

.tab-notes-view h3 {
    font-size: 1.15rem;
}

.tab-notes-view h4 {
    font-size: 1rem;
}

.tab-notes-view p {
    margin: 10px 0;
}

.tab-notes-view ul,
.tab-notes-view ol {
    padding-left: 28px;
    margin: 10px 0;
}

.tab-notes-view li {
    margin: 4px 0;
}

.tab-notes-view a {
    color: #60a5fa;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.tab-notes-view a:hover {
    color: #93c5fd;
}

.tab-notes-view blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 16px;
    margin: 12px 0;
    color: var(--muted);
    font-style: italic;
}

.tab-notes-view code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Courier New', monospace;
}

.tab-notes-view pre {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 12px 0;
}

.tab-notes-view pre code {
    background: transparent;
    padding: 0;
}

/* Modo edição */
.tab-notes-editor-hidden {
    display: none !important;
}

#tab-notes-editor.tab-notes-editor-hidden,
#tab-notes-editor.tab-notes-editor-hidden .ql-toolbar,
#tab-notes-editor.tab-notes-editor-hidden .ql-container,
#tab-notes-editor.tab-notes-editor-hidden .ql-editor {
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

#tab-notes-editor {
    background: rgba(11, 18, 32, 0.6);
    border-radius: 10px;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

#tab-notes-editor:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

#tab-notes-editor .ql-toolbar {
    background: rgba(15, 23, 42, 0.7) !important;
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 10px 10px 0 0 !important;
    padding: 10px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    box-sizing: border-box !important;
}

#tab-notes-editor .ql-toolbar .ql-formats {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    margin: 0 !important;
}

#tab-notes-editor .ql-toolbar button {
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    cursor: pointer !important;
    border-radius: 6px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    transition: all 0.2s ease !important;
    color: var(--muted) !important;
}

#tab-notes-editor .ql-toolbar button:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #e2e8f0 !important;
    transform: scale(1.1) !important;
}

#tab-notes-editor .ql-toolbar button.ql-active {
    background: rgba(37, 99, 235, 0.25) !important;
    color: var(--accent) !important;
}

#tab-notes-editor .ql-container {
    background: rgba(11, 18, 32, 0.6) !important;
    border: none !important;
    border-radius: 0 0 10px 10px !important;
    font-family: inherit !important;
    box-sizing: border-box !important;
}

#tab-notes-editor .ql-editor {
    min-height: 150px !important;
    max-height: 400px !important;
    overflow-y: auto !important;
    color: #e2e8f0 !important;
    font-size: 0.95rem !important;
    line-height: 1.7 !important;
    padding: 16px !important;
    box-sizing: border-box !important;
}

#tab-notes-editor .ql-editor.ql-blank::before {
    color: var(--muted) !important;
    font-style: italic !important;
}

#tab-notes-editor .ql-editor::-webkit-scrollbar {
    width: 8px;
}

#tab-notes-editor .ql-editor::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

#tab-notes-editor .ql-editor::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

#tab-notes-editor .ql-editor::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tab-notes-save-status {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 8px;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
    transition: all 0.2s ease;
}

.tab-notes-save-status.saving {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
}

.tab-notes-save-status.saved {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
}

.tab-notes-save-status.error {
    color: var(--danger);
    background: rgba(220, 38, 38, 0.1);
}

/* Editor de descrição da tarefa (texto rico) */
.task-description-label {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#task-description-editor .ql-toolbar {
    background: rgba(15, 23, 42, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 10px 10px 0 0 !important;
    padding: 8px !important;
}

#task-description-editor .ql-toolbar .ql-formats {
    margin: 0 !important;
}

#task-description-editor .ql-toolbar button {
    color: var(--muted) !important;
}

#task-description-editor .ql-toolbar button:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #e2e8f0 !important;
}

#task-description-editor .ql-toolbar button.ql-active {
    background: rgba(37, 99, 235, 0.25) !important;
    color: var(--accent) !important;
}

#task-description-editor .ql-container {
    background: rgba(11, 18, 32, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-top: none !important;
    border-radius: 0 0 10px 10px !important;
}

#task-description-editor .ql-editor {
    min-height: 100px !important;
    max-height: 280px !important;
    overflow-y: auto !important;
    color: #e2e8f0 !important;
    font-size: 0.95rem !important;
    padding: 12px !important;
}

#task-description-editor .ql-editor.ql-blank::before {
    color: var(--muted) !important;
    font-style: italic !important;
}

@media (max-width: 640px) {
    .tab-notes-header {
        padding: 10px 13px;
    }

    .tab-notes-content {
        padding: 13px;
    }

    .tab-notes-view {
        padding: 10px;
        font-size: 0.72rem;
    }

    #tab-notes-editor .ql-editor {
        min-height: 96px !important;
        max-height: 240px !important;
        padding: 10px !important;
    }
}

/* ========== ELEMENTOS GERAIS ========== */

/* Estados vazios */
.task-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--muted);
    background: rgba(15, 23, 42, 0.3);
    border-radius: var(--radius);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    margin: 24px 0;
}

.task-empty::before {
    content: '📋';
    display: block;
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.task-empty p {
    margin: 8px 0;
    font-size: 1rem;
}

/* Load More */
.load-more {
    text-align: center;
    padding: 20px;
    color: var(--muted);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.load-more:hover {
    color: #e2e8f0;
}

.load-more.loading {
    opacity: 0.7;
}

.load-more button {
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(37, 99, 235, 0.3);
    color: var(--accent);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.load-more button:hover {
    background: rgba(37, 99, 235, 0.25);
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.load-more button:active {
    transform: translateY(0);
}

/* Toast Notifications */
.toast-stack {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px 20px;
    min-width: 300px;
    max-width: 400px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    color: #e2e8f0;
    font-size: 0.9rem;
    line-height: 1.5;
    pointer-events: auto;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: toastSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes toastSlideIn {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

.toast.hide {
    animation: toastSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes toastSlideOut {
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast.success {
    border-left: 4px solid #4ade80;
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.warning {
    border-left: 4px solid #fbbf24;
}

.toast.info {
    border-left: 4px solid var(--accent);
}

.toast-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

/* Floating Filter Button - apenas mobile */
.floating-filter-btn {
    display: none !important;
}

@media (max-width: 640px) {
    .youtube-music-fab,
    .ai-chat-fab {
        bottom: 14px;
        width: 45px;
        height: 45px;
    }

    .youtube-music-fab {
        left: 14px;
    }

    .ai-chat-fab {
        left: 64px;
    }

    .ai-chat-overlay {
        padding: 0 0 66px 14px;
    }

    .ai-chat-box {
        width: calc(100vw - 28px);
        max-width: calc(100vw - 28px);
        height: 55vh;
    }

    .ai-chat-box.is-expanded {
        width: calc(100vw - 28px);
        max-width: calc(100vw - 28px);
        height: 70vh;
        max-height: 70vh;
    }

    .floating-filter-btn {
        position: fixed;
        bottom: 19px;
        left: 19px;
        right: auto;
        width: 45px;
        height: 45px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--accent) 0%, #2563eb 100%);
        border: none;
        box-shadow: 0 6px 19px rgba(37, 99, 235, 0.4);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        color: #fff;
        font-size: 1.2rem;
    }

    .floating-task-btn {
        right: 64px;
        left: auto;
        bottom: 14px;
        width: 45px;
        height: 45px;
    }

    .tools-fab {
        right: 14px;
        left: auto;
        bottom: 14px;
        width: 45px;
        height: 45px;
    }

    .tools-menu {
        right: 14px;
        bottom: 66px;
    }

    .floating-filter-btn:hover {
        transform: scale(1.1) translateY(-2px);
        box-shadow: 0 12px 32px rgba(37, 99, 235, 0.5);
    }

    .floating-task-btn:hover {
        transform: scale(1.1) translateY(-2px);
        box-shadow: 0 12px 32px rgba(34, 197, 94, 0.45);
    }

    .floating-filter-btn:active {
        transform: scale(0.95);
    }

    .floating-task-btn:active {
        transform: scale(0.95);
    }

    .floating-filter-btn[aria-expanded="true"] {
        background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
        box-shadow: 0 8px 24px rgba(220, 38, 38, 0.4);
    }

    .floating-filter-btn:focus-visible {
        outline: 3px solid rgba(255, 255, 255, 0.5);
        outline-offset: 4px;
    }

    .floating-task-btn:focus-visible {
        outline: 3px solid rgba(255, 255, 255, 0.5);
        outline-offset: 4px;
    }
}

/* Links genéricos */
a {
    color: var(--accent);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: #60a5fa;
    text-decoration: underline;
}

a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Inputs e selects melhorados */
input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
textarea,
select {
    background: rgba(11, 18, 32, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 16px;
    color: #e2e8f0;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

input[type="text"]:hover,
input[type="search"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="number"]:hover,
input[type="date"]:hover,
input[type="time"]:hover,
input[type="datetime-local"]:hover,
textarea:hover,
select:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

input[type="text"]:focus,
input[type="search"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
    opacity: 0.7;
}

input:disabled,
textarea:disabled,
select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Badges melhorados */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
    font-weight: 500;
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.badge:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.badge.success {
    background: rgba(22, 163, 74, 0.2);
    color: #4ade80;
    border-color: rgba(22, 163, 74, 0.3);
}

.badge.error {
    background: rgba(220, 38, 38, 0.2);
    color: #f87171;
    border-color: rgba(220, 38, 38, 0.3);
}

.badge.warning {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.3);
}

.badge.info {
    background: rgba(37, 99, 235, 0.2);
    color: var(--accent);
    border-color: rgba(37, 99, 235, 0.3);
}

/* Botões genéricos melhorados */
.primary-btn {
    background: linear-gradient(135deg, var(--accent) 0%, #2563eb 100%);
    border: none;
    color: #fff;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.primary-btn:active {
    transform: translateY(0);
}

.primary-btn:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.5);
    outline-offset: 2px;
}

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.ghost-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ghost-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.ghost-btn:active {
    transform: translateY(0);
}

.ghost-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.ghost-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Icon buttons melhorados */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.5);
    color: #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Nos cards, os botões de ação devem sobrescrever o tamanho base de .icon-btn */
.task-card .task-action-btn,
.task-card .icon-btn.task-action-btn {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    max-width: 30px;
    max-height: 30px;
    padding: 0;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    color: #fff;
}

.icon-btn:active {
    transform: scale(0.95);
}

.icon-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.icon-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

@media (min-width: 641px) {
    .top-actions .mobile-search-btn,
    .top-actions .mobile-search-inline {
        display: none !important;
    }
}

/* Scrollbars globais */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsividade para elementos gerais */
@media (max-width: 640px) {
    .toast-stack {
        top: 13px;
        right: 13px;
        left: 13px;
    }

    .toast {
        min-width: auto;
        max-width: 100%;
    }

    .task-empty {
        padding: 26px 13px;
    }

    .load-more {
        padding: 13px;
    }

    .primary-btn,
    .ghost-btn {
        padding: 8px 16px;
        font-size: 0.72rem;
    }
}

/* ========== RESPONSIVIDADE E MOBILE ========== */

/* Touch targets - reduzidos ~20% em mobile (valores fixos) */
@media (max-width: 640px) {
    /* Ajustar tamanhos de fonte para mobile */
    body {
        font-size: 12px;
    }

    h1, h2, h3, h4, h5, h6 {
        font-size: calc(1em + 0.16vw);
    }

    /* Botões e controles */
    button,
    .icon-btn,
    .tab-pill,
    .filter-toggle,
    .view-toggle-btn,
    .task-action-btn {
        min-height: 35px;
        min-width: 35px;
        padding: 8px 13px;
    }

    /* Scroll da área de conteúdo no mobile */
    .app-shell {
        height: 100vh;
        overflow: hidden;
    }

    .content {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0 10px 19px;
    }

    .tab-section {
        padding: 10px 5px;
        gap: 6px;
    }

    .filters-card {
        display: none !important;
    }

    .task-card {
        padding: 11px;
        gap: 8px;
    }

    /* Melhorar legibilidade em mobile */
    .task-title {
        font-size: 0.8rem;
        line-height: 1.5;
    }

    .task-meta {
        font-size: 0.68rem;
    }

    /* Ajustar grid de tarefas */
    .task-list {
        gap: 10px;
    }

    /* Melhorar navegação de abas em mobile - scroll horizontal para ver todas */
    .tab-bar-main {
        align-items: center;
        gap: 6px;
        overflow: visible;
    }

    .tab-section.tab-bar-compact {
        overflow: visible;
    }

    .tab-bar-popover-anchor {
        position: relative;
        margin-left: 2px;
        z-index: 4;
        flex-shrink: 0;
    }

    .tab-bar-predefined {
        flex: 0 1 46%;
        max-width: 46%;
        min-width: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .tab-bar-predefined::-webkit-scrollbar {
        display: none;
    }

    .tabs-scroll {
        padding-left: 6px;
        padding-right: 6px;
        gap: 5px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }

    .tab-bar-quick-access-wrap {
        min-width: 0;
        overflow: hidden;
    }

    .tab-pill {
        padding: 5px 10px;
        font-size: 0.62rem;
        white-space: nowrap;
        min-height: 0;
        flex-shrink: 0;
    }

    .tab-pill .tab-pill-icon {
        width: 12px;
        height: 12px;
    }

    .tab-pill .tab-pill-icon .feather-icon,
    .tab-pill .tab-pill-icon svg {
        width: 12px !important;
        height: 12px !important;
    }

    .tab-actions .new-task-bar-btn {
        display: none !important;
    }

    /* Ajustar botões de ação */
    .task-controls {
        gap: 5px;
    }

    .task-action-btn {
        width: 30px;
        height: 30px;
        min-width: 30px;
        min-height: 30px;
        max-width: 30px;
        max-height: 30px;
        padding: 0;
    }

    /* ===== YouTube Box mobile: priorizar área de vídeo ===== */
    .youtube-box-overlay {
        padding: 0 8px 66px 8px;
        align-items: flex-end;
        justify-content: center;
    }

    .youtube-box {
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
        height: 78vh;
        max-height: 78vh;
        min-height: 420px;
        border-radius: 12px;
    }

    .youtube-box-header {
        padding: 8px 10px;
    }

    .youtube-box-header-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .youtube-search-input {
        order: 1;
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
        padding: 9px 10px;
    }

    .youtube-box-header-actions {
        order: 2;
        width: 100%;
        justify-content: flex-end;
    }

    .youtube-search-settings-panel {
        right: 8px;
        left: 8px;
        width: auto;
    }

    .youtube-search-settings-grid {
        grid-template-columns: 1fr;
    }

    .youtube-box-body {
        flex-direction: column;
        min-height: 0;
    }

    .youtube-box-main {
        flex: 1 1 auto;
        min-height: 0;
        padding: 8px;
    }

    .youtube-player-wrap {
        min-height: 220px;
    }

    .youtube-box-sidebar {
        width: 100%;
        max-height: 36%;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        padding: 8px;
    }

    .youtube-playlist-list {
        max-height: 140px;
    }

    .youtube-box.is-mini {
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
        height: 44vh;
        min-height: 240px;
        max-height: 44vh;
    }

    /* Melhorar modais em mobile */
    .modal {
        max-height: 95vh;
        border-radius: 13px 13px 0 0;
    }

    .modal-header {
        padding: 14px 13px;
        position: sticky;
        top: 0;
        background: rgba(15, 23, 42, 0.98);
        z-index: 10;
    }

    .modal-body {
        padding: 13px;
        max-height: calc(95vh - 112px);
        overflow-y: auto;
    }

    .modal-footer {
        padding: 11px 13px;
        position: sticky;
        bottom: 0;
        background: rgba(15, 23, 42, 0.98);
        z-index: 10;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    /* Melhorar inputs em mobile */
    input[type="text"],
    input[type="search"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    input[type="datetime-local"],
    textarea,
    select {
        font-size: 13px;
        padding: 11px 13px;
        min-height: 38px;
    }

    /* Melhorar painel de filtros mobile - acima do top-bar */
    .mobile-filter-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(2, 6, 23, 0.85);
        backdrop-filter: blur(4px);
        z-index: 1500;
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }

    body.show-mobile-filters .mobile-filter-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .filter-overlay-portal .filter-row {
        display: flex;
        flex-direction: column;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 16px 16px 0 0;
        padding: 16px 13px;
        max-height: 80vh;
        overflow-y: auto;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 2001;
        box-shadow: 0 -6px 26px rgba(0, 0, 0, 0.4);
    }

    body.show-mobile-filters .filter-overlay-portal .filter-row {
        transform: translateY(0);
    }

    .mobile-filter-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 13px;
        padding-bottom: 13px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .mobile-filter-header p {
        font-size: 0.88rem;
        font-weight: 600;
        color: #e2e8f0;
        margin: 0;
    }

    /* Melhorar painel de usuário mobile */
    .mobile-user-panel {
        width: min(288px, 90vw);
        box-shadow: -3px 0 19px rgba(0, 0, 0, 0.3);
    }

    .mobile-user-card {
        padding: 16px;
    }

    /* Melhorar top bar em mobile - uma linha, altura mínima, título com ellipsis */
    .top-bar {
        padding: 10px 13px;
        gap: 8px;
        flex-wrap: nowrap;
        min-height: 48px;
        align-items: center;
        z-index: 50;
    }

    .top-text {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: row;
        align-items: center;
        overflow: hidden;
    }

    .top-title {
        display: none;
    }

    .top-text .current-tab-title {
        font-size: 1.15rem;
        font-weight: 700;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .top-text .current-tab-context {
        max-width: 140px;
        padding: 3px 8px;
        font-size: 0.68rem;
    }

    .top-text .current-tab-title:empty {
        display: none;
    }

    .health-action-buttons {
        gap: 8px;
    }

    .health-action-btn {
        min-height: 96px;
        padding: 10px 6px;
        border-radius: 14px;
        gap: 8px;
    }

    .health-action-btn .health-action-icon {
        width: 36px;
        height: 36px;
        border-radius: 12px;
    }

    .health-action-btn .health-action-icon .feather-icon,
    .health-action-btn .health-action-icon svg {
        width: 20px !important;
        height: 20px !important;
    }

    .health-action-btn .health-action-label {
        font-size: 0.68rem;
        line-height: 1.2;
    }

    /* Melhorar contador de tarefas */
    .task-counter {
        padding: 10px 13px;
        font-size: 0.7rem;
        margin: 10px 0 13px;
        gap: 8px;
    }

    /* Melhorar anotações em mobile */
    .tab-notes {
        margin-bottom: 10px;
    }

    .tab-notes-header {
        padding: 10px 11px;
    }

    .tab-notes-content {
        padding: 11px;
    }

    /* Melhorar seção de abas */
    .tab-actions {
        width: 100%;
        justify-content: stretch;
        align-self: center;
    }

    /* Melhorar chips e badges */
    .tag-chip,
    .badge {
        min-height: 29px;
        padding: 6px 11px;
        font-size: 0.68rem;
    }

    /* Melhorar scroll horizontal de abas */
    .tabs-scroll-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .tabs-scroll-wrapper::-webkit-scrollbar {
        display: none;
    }

    /* Prevenir scroll horizontal indesejado */
    body {
        overflow-x: hidden;
    }

    /* Melhorar espaçamento entre seções */
    section {
        margin-bottom: 16px;
    }

    /* Ajustar view toggle em mobile */
    .view-toggle-group {
        gap: 5px;
    }

    .view-toggle-btn {
        width: 35px;
        height: 35px;
    }

    /* Ícones menores em mobile */
    .icon-btn .feather-icon,
    .icon-btn svg,
    .close-mobile-user-panel .feather-icon,
    #close-mobile-filters .feather-icon,
    .mobile-user-panel .feather-icon,
    .mobile-filter-header .feather-icon {
        width: 14px !important;
        height: 14px !important;
        min-width: 14px !important;
        min-height: 14px !important;
    }

    .floating-task-btn .feather-icon,
    .floating-task-btn svg,
    .tools-fab .feather-icon,
    .tools-fab svg,
    .floating-filter-btn .feather-icon,
    .floating-filter-btn svg {
        width: 18px !important;
        height: 18px !important;
    }

    .task-action-icon .feather-icon,
    .task-action-icon svg {
        width: 12px !important;
        height: 12px !important;
        min-width: 12px !important;
        min-height: 12px !important;
    }
}

/* Tablet - 641px a 1023px */
@media (min-width: 641px) and (max-width: 1023px) {
    .content {
        padding: 0 20px 32px;
    }

    .task-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .tab-section {
        padding: 16px 12px;
    }
}

/* Desktop pequeno - 1024px a 1199px */
@media (min-width: 1024px) and (max-width: 1199px) {
    .task-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Desktop médio - 1200px a 1599px */
@media (min-width: 1200px) and (max-width: 1599px) {
    .task-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Desktop grande - 1600px+ */
@media (min-width: 1600px) {
    .content {
        max-width: 1800px;
        margin: 0 auto;
    }

    .task-list {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

/* Melhorias de acessibilidade touch */
@media (hover: none) and (pointer: coarse) {
    /* Dispositivos touch */
    button:hover,
    .icon-btn:hover,
    .tab-pill:hover {
        transform: none;
    }

    button:active,
    .icon-btn:active,
    .tab-pill:active {
        transform: scale(0.95);
        opacity: 0.8;
    }
}

/* Prevenir zoom em inputs no iOS */
@media screen and (max-width: 640px) {
    input[type="text"],
    input[type="search"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    input[type="datetime-local"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* ========== ACESSIBILIDADE ========== */

/* Skip links para navegação por teclado */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent);
    color: #fff;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 4px 0;
    font-weight: 600;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Screen reader only - elementos visuais apenas para leitores de tela */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Melhorar contraste e foco visível */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Remover outline padrão e usar apenas focus-visible */
*:focus:not(:focus-visible) {
    outline: none;
}

/* Foco visível melhorado para botões */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3);
}

/* Foco para elementos interativos customizados */
.tab-pill:focus-visible,
.filter-toggle:focus-visible,
.view-toggle-btn:focus-visible,
.task-action-btn:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3);
}

/* Estados de foco para modais */
.modal:focus-visible {
    outline: none;
}

.modal-header .icon-btn:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Melhorar contraste de texto */
body {
    color: #e2e8f0; /* Contraste mínimo 4.5:1 com fundo escuro */
}

/* Texto com melhor contraste */
h1, h2, h3, h4, h5, h6 {
    color: #f1f5f9; /* Contraste mínimo 7:1 */
}

/* Links com melhor contraste */
a {
    color: #60a5fa; /* Contraste mínimo 4.5:1 */
}

a:hover,
a:focus {
    color: #93c5fd; /* Contraste melhorado no hover */
}

/* Botões com melhor contraste */
.primary-btn {
    color: #fff;
    background: linear-gradient(135deg, var(--accent) 0%, #2563eb 100%);
}

.ghost-btn {
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.3);
}

.ghost-btn:hover,
.ghost-btn:focus {
    color: #f1f5f9;
    border-color: rgba(255, 255, 255, 0.4);
}

/* Estados de erro com melhor contraste */
.form-feedback {
    color: #f87171; /* Vermelho com bom contraste */
    background: rgba(220, 38, 38, 0.15);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(220, 38, 38, 0.3);
}

/* Feedback do login: neutro por padrão (não "parecer erro" antes da tentativa) */
.auth-feedback {
    color: var(--muted);
    background: transparent;
    padding: 0;
    border-radius: 6px;
    border: 1px solid transparent;
    min-height: 0;
}

.auth-feedback:empty {
    display: none;
}

.auth-feedback.is-loading {
    color: var(--muted);
    background: rgba(148, 163, 184, 0.10);
    padding: 8px 12px;
    border: 1px solid rgba(148, 163, 184, 0.20);
}

.auth-feedback.is-error {
    color: #f87171; /* Vermelho com bom contraste */
    background: rgba(220, 38, 38, 0.15);
    padding: 8px 12px;
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.auth-feedback.is-success {
    color: #4ade80; /* Verde com bom contraste */
    background: rgba(22, 163, 74, 0.15);
    padding: 8px 12px;
    border: 1px solid rgba(22, 163, 74, 0.35);
}

/* Estados de sucesso com melhor contraste */
.badge.success {
    color: #4ade80; /* Verde com bom contraste */
    background: rgba(22, 163, 74, 0.2);
    border-color: rgba(22, 163, 74, 0.4);
}

/* Estados de aviso com melhor contraste */
.badge.warning {
    color: #fbbf24; /* Amarelo com bom contraste */
    background: rgba(251, 191, 36, 0.2);
    border-color: rgba(251, 191, 36, 0.4);
}

/* Estados de erro com melhor contraste */
.badge.error {
    color: #f87171; /* Vermelho com bom contraste */
    background: rgba(220, 38, 38, 0.2);
    border-color: rgba(220, 38, 38, 0.4);
}

/* Melhorar contraste de texto muted */
:root {
    --muted: #94a3b8; /* Contraste mínimo 4.5:1 */
}

/* Navegação por teclado - indicadores visuais */
.tab-pill[aria-selected="true"]:focus-visible,
.filter-toggle[aria-pressed="true"]:focus-visible,
.view-toggle-btn.active:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3), 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Melhorar acessibilidade de modais */
/* Modal overlay e animações já estão implementadas */

/* Acessibilidade para elementos ocultos */
/* NOTA: Não aplicamos display: none em todos os elementos com aria-hidden="true"
   porque isso esconderia ícones decorativos que devem ser visíveis visualmente
   mas ocultos apenas dos leitores de tela. Aplicamos display: none apenas em
   elementos específicos que realmente precisam estar ocultos (painéis, modais, etc.) */

/* Aplicar display: none apenas em elementos específicos que precisam estar ocultos */
.mobile-user-backdrop[aria-hidden="true"],
.mobile-user-panel[aria-hidden="true"],
.modal-overlay[aria-hidden="true"],
.filter-panel[aria-hidden="true"] {
    display: none !important;
}

/* Mostrar elementos quando aria-hidden="false" */
.mobile-user-backdrop[aria-hidden="false"],
.mobile-user-panel[aria-hidden="false"],
.modal-overlay[aria-hidden="false"],
.filter-panel[aria-hidden="false"] {
    display: block !important;
}

/* Melhorar acessibilidade de toasts */
.toast[role="alert"] {
    border-left-width: 4px;
}

.toast[role="status"] {
    border-left-width: 4px;
}

/* Acessibilidade para imagens */
/* Imagens devem ter atributo alt apropriado no HTML */

/* Melhorar acessibilidade de formulários */
label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #e2e8f0;
}

input[required],
select[required],
textarea[required] {
    border-left: 3px solid var(--accent);
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

input[aria-invalid="true"]:focus,
select[aria-invalid="true"]:focus,
textarea[aria-invalid="true"]:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.25);
}

/* Acessibilidade para elementos com aria-live */
/* aria-live="polite" já está implementado no HTML */

/* Melhorar acessibilidade de botões de ação */
.task-action-btn[aria-label]:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

/* Acessibilidade para elementos expandíveis */
[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

[aria-expanded="false"] .toggle-icon {
    transform: rotate(0deg);
}

/* Task toggle usa rotação apenas no SVG, não no wrapper (evita giro duplo) */
.task-card .task-toggle-btn.toggle-task .toggle-icon {
    transform: none;
}

/* Melhorar contraste de texto em cards */
.task-card {
    color: #e2e8f0;
}

.task-title {
    color: #f1f5f9;
}

.task-meta {
    color: #cbd5e1;
}

/* Acessibilidade para elementos desabilitados */
button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

button:disabled:focus-visible,
input:disabled:focus-visible,
select:disabled:focus-visible,
textarea:disabled:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.3);
    outline-offset: 2px;
}

/* Redução de movimento para usuários que preferem */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Alto contraste para usuários que preferem */
@media (prefers-contrast: high) {
    * {
        border-color: currentColor !important;
    }

    button,
    .primary-btn,
    .ghost-btn {
        border: 2px solid currentColor !important;
    }
}

/* Modo escuro/claro - já está implementado com tema escuro */

/* Acessibilidade para elementos de navegação */
/* Roles e landmarks já estão implementados no HTML */

/* Acessibilidade para modais */
/* Roles e aria-modal já estão implementados no HTML */

/* Acessibilidade para alertas */
[role="alert"] {
    color: var(--danger);
    font-weight: 600;
}

[role="status"] {
    color: var(--accent);
}

/* Melhorar acessibilidade de tabelas */
table {
    border-collapse: collapse;
}

th {
    font-weight: 600;
    text-align: left;
}

td,
th {
    padding: 12px;
}

/* Acessibilidade para elementos de lista */
/* Roles já estão implementados no HTML quando necessário */

/* Acessibilidade para elementos de progresso */
/* Roles e aria-valuenow já estão implementados quando necessário */

/* Melhorar acessibilidade em mobile */
@media (max-width: 640px) {
    /* Melhorar foco visível em mobile */
    *:focus-visible {
        outline-width: 2px;
        outline-offset: 3px;
    }
}
