/* --- DESIGN SYSTEM (CSS VARIABLES) --- */
:root {
    --font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;

    /* Cores Modo Claro */
    --bg-body: #e3e9ff;
    --bg-sidebar: #2c3e50;
    --bg-sidebar-dark: #1a252f;
    --bg-sidebar-hover: #3b536b;
    --text-sidebar: #ffffff;
    --text-sidebar-muted: #ecf0f1;

    --bg-board: #e3e9ff;
    --bg-col: #f1f2f6;
    --bg-card: #ffffff;

    --text-main: #2c3e50;
    --text-secondary: #4b5563;
    --text-muted: #95a5a6;

    --border-color: #cbd5e0;
    --accent-primary: #4a90e2;
    --accent-primary-hover: #357abd;
    --accent-success: #27ae60;
    --accent-danger: #e74c3c;
    --accent-warning: #f39c12;

    /* Sombras e Bordas */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
    --shadow-hover: 0 8px 20px rgba(74, 144, 226, 0.15);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-pill: 50px;

    /* Altura Dinâmica */
    --default-col-height: calc(100dvh - 220px);
}

/* --- MODO ESCURO (DARK MODE) --- */
body.dark-mode {
    --bg-body: #121212;
    --bg-sidebar: #1e1e1e;
    --bg-sidebar-dark: #121212;
    --bg-sidebar-hover: #2c2c2c;

    --bg-board: #121212;
    --bg-col: #1e1e1e;
    --bg-card: #2c2c2c;

    --text-main: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-muted: #757575;

    --border-color: #333333;

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 8px 20px rgba(0, 0, 0, 0.6);
}

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

/* --- LAYOUT GLOBAL --- */
body {
    font-family: var(--font-family);
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    display: flex;
    height: 100dvh;
    overflow: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- ESTILOS DA SIDEBAR EXPANSÍVEL --- */
.sidebar {
    width: 70px;
    background-color: var(--bg-sidebar);
    color: var(--text-sidebar);
    flex-shrink: 0;
    height: 100dvh;
    overflow: hidden;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.15);
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), background-color 0.3s, right 0.3s ease;
    z-index: 1000;
}

.sidebar:hover {
    width: 280px;
}

.sidebar-inner {
    width: 280px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sidebar-top {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-top::-webkit-scrollbar {
    width: 6px;
}

.sidebar-top::-webkit-scrollbar-thumb {
    background: var(--bg-sidebar-dark);
    border-radius: 4px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px;
    background-color: var(--bg-sidebar-dark);
    height: 30px;
    transition: background-color 0.3s;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

#sidebarCollapseIcon {
    font-size: 1.2rem;
    color: var(--text-sidebar-muted);
    cursor: pointer;
    transition: color 0.2s ease;
}

#sidebarCollapseIcon:hover {
    color: var(--accent-primary);
}

#sidebarTitle {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-sidebar-muted);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    font-weight: 600;
}

.sidebar:hover #sidebarTitle {
    opacity: 1;
    pointer-events: auto;
}

.btn-new-page {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s, color 0.2s;
    opacity: 0;
    pointer-events: none;
}

.sidebar:hover .btn-new-page {
    opacity: 1;
    pointer-events: auto;
}

.btn-new-page:hover {
    color: var(--accent-primary-hover);
    transform: scale(1.1);
}

/* Listagem de Páginas */
.pages-list {
    padding: 15px 0;
    min-height: 50px;
}

.page-item {
    margin-bottom: 0px;
    padding: 0 10px;
}

.page-item.subpage-item {
    margin-bottom: 0;
    padding: 0;
}

.page-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.95rem;
    white-space: nowrap;
    position: relative;
}

.link-content {
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: none;
}

.link-content i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.page-link:hover {
    background-color: var(--bg-sidebar-hover);
}

.page-link.active {
    background-color: var(--accent-primary);
    font-weight: 600;
}

/* Nova Estrutura de Subpáginas com Expand/Collapse */
.subpage-list {
    margin-left: 20px;
    padding-left: 5px;
    border-left: 2px solid var(--accent-primary);
    margin-top: 0;
    display: none;
    flex-direction: column;
    gap: 0;
}

.subpage-list.expanded {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.toggle-wrapper {
    position: absolute;
    left: -2px;
    top: 0;
    bottom: 0;
    width: 20px;
    opacity: 0;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar:hover .toggle-wrapper {
    opacity: 1;
    pointer-events: auto;
}

.toggle-btn {
    cursor: pointer;
    padding: 4px;
    color: var(--text-sidebar-muted);
    font-size: 0.8rem;
    transition: color 0.2s;
    pointer-events: auto;
    width: 14px;
    text-align: center;
}

.toggle-btn:hover {
    color: var(--accent-primary);
}

.btn-add-sub {
    background: transparent;
    border: none;
    color: #bdc3c7;
    cursor: pointer;
    font-size: 1rem;
    padding: 0 10px;
    opacity: 0;
    pointer-events: none;
}

.sidebar:hover .btn-add-sub {
    opacity: 1;
    pointer-events: auto;
}

.btn-add-sub:hover {
    color: var(--text-sidebar-muted);
}

.sidebar .link-content span {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sidebar:hover .link-content span {
    opacity: 1;
}

.sidebar-footer {
    padding: 10px;
    background-color: var(--bg-sidebar-dark);
    border-top: 1px solid var(--bg-sidebar-hover);
    transition: background-color 0.3s;
}

/* Indicadores de Drag Drop Sidebar */
.page-item.dragging-page>.page-link {
    opacity: 0.5;
    background-color: var(--bg-sidebar-hover);
}

.drop-indicator-before>.page-link {
    border-top: 2px solid var(--accent-primary) !important;
    border-radius: 0;
}

.drop-indicator-after>.page-link {
    border-bottom: 2px solid var(--accent-primary) !important;
    border-radius: 0;
}

.drop-indicator-inside>.page-link {
    background-color: rgba(74, 144, 226, 0.3) !important;
    border-left: 4px solid var(--accent-primary);
    border-radius: 0;
}

/* --- ESTILOS DO CONTEÚDO PRINCIPAL --- */
.main-content {
    flex-grow: 1;
    padding: 0 30px 30px 30px;
    overflow-y: auto;
    background-color: var(--bg-board);
    position: relative;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s;
    height: 100dvh;
}

.header {
    text-align: center;
    margin-bottom: 8px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    background-color: var(--bg-board);
    z-index: 50;
    padding: 10px 0;
    transition: background-color 0.3s;
    min-height: 52px; /* Evita colapso no estado vazio */
}

.page-title-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 8px;
    position: relative;
    min-height: 48px; /* Altura do ícone de login + margens */
}

h1 {
    color: var(--text-main);
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    transition: color 0.3s;
}

#pageTitleWrapper {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
    order: 1;
}

.header-logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    flex-shrink: 0;
}

.header-logo-container .logo-text {
    font-size: 0.9rem;
    font-weight: 700;
    color: transparent;
    letter-spacing: 1px;
    margin: 0;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-success));
    -webkit-background-clip: text;
    background-clip: text;
    text-transform: uppercase;
    white-space: nowrap;
}

#currentPageTitle {
    cursor: pointer;
    transition: color 0.2s;
    white-space: normal;
    word-break: break-word;
    font-size: 1.45rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 0 1 auto;
    max-width: 100%;
    text-align: left;
    margin: 0;
    color: var(--text-main);
}

#currentPageTitle:hover {
    color: var(--accent-primary);
}

#currentPageTitle[contenteditable="true"] {
    border-bottom: 2px dashed var(--accent-primary);
    outline: none;
}

#mobileToolsWrapper {
    display: none;
}

.btn-mobile-menu,
.btn-mobile-tools {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
    position: absolute;
}

/* --- CONTROLES DE TAREFAS --- */
.new-task-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 0;
    flex: 0 0 auto;
    order: 2;
}

input:not(.modal-input):not(.task-color-picker):not([type="checkbox"]) {
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 350px;
    font-size: 1rem;
    outline: none;
    background: var(--bg-card);
    color: var(--text-main);
    transition: border-color 0.2s, background-color 0.3s;
    font-family: var(--font-family);
}

input:not(.task-color-picker):not([type="checkbox"]):focus {
    border-color: var(--accent-primary);
}

button {
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-family: var(--font-family);
    transition: transform 0.1s, opacity 0.2s, background-color 0.2s;
    flex-shrink: 0;
}

button:active {
    transform: scale(0.95);
}

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

.btn-add:hover {
    background-color: var(--accent-primary-hover);
}

.btn-add-col {
    background-color: var(--accent-success);
    color: white;
}

.btn-task-options {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-task-options:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.task-color-picker {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 44px;
    height: 44px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    padding: 0;
    background-color: transparent;
    flex-shrink: 0;
    outline: none;
    transition: border-color 0.2s;
}

.task-color-picker::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.task-color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.task-color-picker::-moz-color-swatch {
    border: none;
    border-radius: 4px;
}

.task-color-picker:hover,
.task-color-picker:focus {
    border-color: var(--accent-primary);
}

/* --- AÇÕES DO CABEÇALHO --- */
.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    flex: 0 1 auto;
    min-width: 0;
    order: 3;
    margin-left: auto;
}

.btn-icon,
.btn-delete-page {
    background: transparent;
    border: 2px solid var(--accent-primary);
    color: var(--accent-primary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-text {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    display: inline-block;
    transition: max-width 0.3s ease, opacity 0.2s ease, margin-left 0.3s ease;
}

.btn-icon:hover .action-text,
.btn-delete-page:hover .action-text {
    max-width: 100px;
    opacity: 1;
    margin-left: 8px;
}

.btn-icon:hover {
    background: var(--accent-primary);
    color: white;
}

.btn-delete-page {
    border-color: var(--text-muted);
    color: var(--text-muted);
}

.btn-delete-page:hover {
    background: var(--text-muted);
    color: white;
    border-color: var(--text-muted);
}

.export-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content,
.mobile-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 5px;
    background-color: var(--bg-card);
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    z-index: 200;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.dropdown-content.show,
.mobile-dropdown-content.show {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.dropdown-content a,
.mobile-dropdown-content a,
.mobile-dropdown-content button {
    color: var(--text-main);
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    transition: background 0.2s;
    text-align: left;
    background: none;
    border: none;
    width: 100%;
    cursor: pointer;
    font-family: var(--font-family);
    font-weight: 500;
}

.dropdown-content a:hover,
.mobile-dropdown-content a:hover,
.mobile-dropdown-content button:hover {
    background-color: var(--bg-col);
    color: var(--accent-primary);
}

/* --- ESTILOS DO QUADRO E BLOCOS --- */
.board {
    position: relative;
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
    padding-bottom: 20px;
    flex-grow: 1;
    flex-wrap: wrap;
}

.row-resizer-line {
    display: none;
    position: absolute;
    left: 30px;
    right: 30px;
    height: 16px;
    background-color: transparent;
    cursor: row-resize;
    z-index: 100;
    transform: translateY(-50%);
}

.row-resizer-line::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background-color: rgba(74, 144, 226, 0.3);
    border-radius: 2px;
    transform: translateY(-50%);
    transition: background-color 0.2s;
}

.row-resizer-line:hover::after,
.row-resizer-line.active::after {
    background-color: rgba(74, 144, 226, 0.8);
}

.column {
    background-color: var(--bg-col);
    border-radius: var(--radius-lg);
    width: 350px;
    height: var(--default-col-height);
    max-height: var(--default-col-height);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    padding: 15px;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
    transition: background-color 0.3s;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.drag-handle {
    cursor: grab;
    color: var(--text-muted);
    padding: 5px;
    font-size: 1.2rem;
    transition: color 0.2s;
}

.drag-handle:hover {
    color: var(--accent-primary);
}

.column-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
    flex-grow: 1;
    margin-left: 10px;
    transition: color 0.3s;
}

.column-header h2[contenteditable="true"] {
    border-bottom: 1px dashed var(--accent-primary);
    outline: none;
}

.btn-delete-col {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0 5px;
    transition: color 0.2s;
}

.btn-delete-col:hover {
    color: var(--accent-danger);
}

.column-content {
    flex: 1;
    overflow-y: auto;
    min-height: 50px;
    padding-right: 5px;
    padding-bottom: 40px;
}

.column-content::-webkit-scrollbar {
    width: 6px;
}

.column-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

/* --- CARTÕES --- */
.card {
    position: relative;
    background-color: var(--bg-card);
    padding: 12px 15px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    cursor: grab;
    animation: fadeIn 0.3s ease;
    word-break: break-word;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: box-shadow 0.2s, transform 0.2s, background-color 0.3s;
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card-color-tag {
    height: 6px;
    width: 48px;
    border-radius: 3px;
    margin-bottom: 2px;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.95rem;
    color: var(--text-main);
}

.card-tabs {
    display: flex;
    gap: 10px;
    border-top: 1px solid var(--border-color);
    margin-top: 6px;
    padding-top: 8px;
}

.card-tab {
    font-size: 0.8rem;
    font-weight: normal;
    color: var(--text-muted);
    padding-bottom: 0px;
    cursor: pointer;
    transition: color 0.2s;
    border-bottom: none;
}

.card-tab.active {
    color: var(--text-main);
    font-weight: bold;
    border-bottom-color: transparent;
}

.card-tab-content {
    display: none;
    flex-direction: column;
    gap: 4px;
}

.card-tab-content.active {
    display: flex;
    animation: fadeIn 0.2s;
}

.card-comment-text {
    font-style: italic;
    color: var(--text-secondary);
    background: var(--bg-col);
    padding: 8px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.task-line {
    display: flex;
    align-items: flex-start;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.task-check {
    margin-top: 4px;
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--accent-primary);
}

.task-text {
    flex: 1;
    outline: none;
    transition: opacity 0.2s;
    line-height: 1.4;
}

.task-text.strike-through {
    text-decoration: line-through;
    opacity: 0.6;
}

.card-badges {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
    flex-wrap: wrap;
}

.task-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    background-color: var(--bg-col);
    color: var(--text-secondary);
}

.task-badge.overdue {
    background-color: #fee2e2;
    color: var(--accent-danger);
}

body.dark-mode .task-badge.overdue {
    background-color: rgba(231, 76, 60, 0.2);
}

.card-actions-bar {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
    background-color: var(--bg-card);
    padding: 2px;
    border-radius: var(--radius-sm);
}

.card:hover .card-actions-bar {
    opacity: 1;
}

.btn-card-action {
    background: transparent;
    border: none;
    padding: 4px 6px;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.btn-card-action:hover {
    background: var(--bg-col);
    color: var(--accent-primary);
}

.btn-card-action.delete:hover {
    color: var(--accent-danger);
}

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

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

.column.dragging {
    opacity: 0.2;
    border: 3px dashed var(--accent-primary);
    pointer-events: none;
}

.card.dragging-card {
    opacity: 0.5;
    transform: scale(0.95);
}

.card-drop-indicator {
    height: 4px;
    background-color: var(--accent-primary);
    border-radius: 2px;
    margin: 4px 0;
    pointer-events: none;
}

/* --- SISTEMA DE JANELAS (MODALS) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
    animation: fadeIn 0.2s ease;
}

.modal-box {
    background-color: var(--bg-card);
    padding: 25px;
    border-radius: var(--radius-lg);
    width: 400px;
    max-width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    position: relative;
    animation: modalSlideUp 0.3s ease;
    max-height: 90dvh;
    overflow-y: auto;
    color: var(--text-main);
    transition: background-color 0.3s;
}

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

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

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.modal-box h3 {
    margin-top: 0;
    color: var(--text-main);
    font-size: 1.3rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.modal-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
    margin-top: 0;
}

.modal-input,
.modal-textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-main);
    border-radius: var(--radius-md);
    box-sizing: border-box;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
    resize: vertical;
    max-height: 400px;
}

.modal-input:focus,
.modal-textarea:focus {
    border-color: var(--accent-primary);
}

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

.btn-modal-cancel {
    background-color: var(--bg-col);
    color: var(--text-secondary);
}

.btn-modal-confirm {
    background-color: var(--accent-primary);
    color: white;
}

.btn-modal-confirm:hover {
    background-color: var(--accent-primary-hover);
}

.pill-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.pill-btn {
    background-color: var(--bg-col);
    color: var(--text-secondary);
    padding: 6px 14px;
    font-size: 0.85rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

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

.hidden-field {
    display: none;
    animation: fadeIn 0.2s;
}

.blocks-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.block-manage-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: var(--bg-col);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-weight: 600;
    color: var(--text-main);
}

.block-manage-actions {
    display: flex;
    gap: 5px;
}

.block-manage-actions button {
    padding: 5px 10px;
    background: var(--bg-body);
    color: var(--accent-primary);
    border-radius: 4px;
    font-size: 1rem;
    border: none;
    cursor: pointer;
}

/* =========================================
    MEDIA QUERIES (MODO MOBILE HYBRID)
    ========================================= */
@media (min-width: 769px) {
    #mobileFab {
        display: none !important;
    }

    /* Oculta as subpáginas sempre que o mouse não estiver em cima da sidebar no PC */
    .sidebar:not(:hover) .subpage-list {
        display: none !important;
    }
}

@media (max-width: 1250px) and (min-width: 769px) {
    .header-logo-container {
        display: none;
    }

    #pageTitleWrapper {
        flex: 1 1 auto;
    }

    #headerActions {
        order: 2;
        flex: 0 0 auto;
    }

    #taskControls {
        order: 3;
        flex: 1 1 100%;
        justify-content: center;
        margin-top: 5px;
        width: 100%;
    }
}

@media (max-width: 768px) {

    /* Bloquear scroll vertical e aumentar espaçamento header */
    .main-content {
        padding: 0 10px 0 10px;
        overflow-y: hidden !important;
    }

    .header {
        padding-top: 20px;
        margin-bottom: 25px;
    }

    .mobile-sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100dvh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 990;
    }

    .sidebar {
        position: fixed;
        right: -300px;
        left: auto;
        width: 280px;
        height: 100dvh;
        z-index: 1000;
        transition: right 0.3s ease;
        box-shadow: none;
    }

    .sidebar.sidebar-open {
        right: 0;
        box-shadow: -2px 0 15px rgba(0, 0, 0, 0.3);
    }

    .sidebar:hover {
        width: 280px;
    }

    .sidebar-inner {
        width: 100%;
    }

    #sidebarTitle {
        opacity: 1;
        pointer-events: auto;
    }

    .btn-new-page {
        opacity: 1;
        pointer-events: auto;
    }

    .subpage-list {
        margin-left: 15px;
        border-left: 2px solid var(--accent-primary);
    }

    .toggle-wrapper {
        opacity: 1;
        left: 2px;
    }

    .sidebar .link-content span {
        opacity: 1;
    }

    #mobileToolsWrapper {
        display: block;
        position: absolute;
        left: 15px;
        top: 15px;
        z-index: 100;
    }

    .btn-mobile-tools {
        display: block;
        position: relative;
        left: auto;
        top: auto;
    }

    .page-title-container {
        flex-direction: column;
        align-items: center;
        border-bottom: none;
        padding-bottom: 10px;
        margin-bottom: 5px;
    }

    .btn-mobile-menu {
        display: block;
        right: 15px;
        left: auto;
        top: 15px;
    }

    #pageTitleWrapper {
        margin: 0 45px;
        width: calc(100% - 90px);
        max-width: 100%;
        flex: 1 1 auto;
        justify-content: center;
        text-align: center;
    }

    .header-logo-container {
        display: none;
    }

    #currentPageTitle {
        flex: 0 1 auto;
        text-align: center;
        white-space: nowrap;
        text-overflow: ellipsis;
        -webkit-line-clamp: unset;
        line-clamp: unset;
        max-width: none;
    }

    .header-actions {
        display: none !important;
    }

    #taskControls {
        display: none !important;
    }

    .drag-handle {
        display: none !important;
    }

    .card-actions-bar {
        display: none !important;
    }

    /* FAB e Rótulos Animados Otimizados */
    #mobileFab {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 900;
    }

    .fab-menu {
        display: none;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 15px;
        align-items: center;
        animation: fadeIn 0.2s;
    }

    .fab-menu.show {
        display: flex;
    }

    .fab-action::before {
        content: attr(title);
        position: absolute;
        right: 65px;
        top: 50%;
        transform: translateY(-50%);
        background-color: var(--bg-sidebar);
        color: white;
        padding: 6px 12px;
        border-radius: 6px;
        font-size: 0.85rem;
        font-weight: 600;
        white-space: nowrap;
        pointer-events: none;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        box-shadow: var(--shadow-sm);
        z-index: 10;
    }

    .fab-menu.show-labels .fab-action::before {
        opacity: 1;
        visibility: visible;
        right: 55px;
    }

    .fab-menu.hide-labels .fab-action::before {
        opacity: 0;
        visibility: hidden;
        right: 65px;
    }

    .fab-btn {
        width: 55px;
        height: 55px;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
        border: none;
        cursor: pointer;
        color: white;
        transition: transform 0.2s;
    }

    .fab-main {
        background-color: var(--accent-primary);
        font-size: 1.5rem;
        z-index: 2;
    }

    .fab-action {
        background-color: var(--bg-col);
        color: var(--text-main);
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
        position: relative;
    }

    /* Ajustes para Scroll e Posicionamento Exato */
    .board {
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        justify-content: flex-start;
        padding-bottom: 10px;
        scroll-behavior: smooth;
    }

    .board::-webkit-scrollbar {
        display: none;
    }

    .column {
        width: 85vw;
        flex-shrink: 0;
        scroll-snap-align: center;
        margin: 0 2.5vw;
        height: calc(100dvh - 210px) !important;
        max-height: calc(100dvh - 210px) !important;
    }

    /* Margens exatas para focar a coluna na tela do celular perfeitamente sem ficar travada entre elas */
    .column:first-child {
        margin-left: 7.5vw;
    }

    .column:last-child {
        margin-right: 7.5vw;
    }

    .modal-box {
        width: 95%;
        padding: 15px;
    }
}

#emptyState {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    padding: 0 20px;
    margin-top: 25px;
    max-height: 100%;
    overflow: hidden;
    animation: emptyStateReveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    position: relative;
}

.btn-empty-login {
    background-color: var(--bg-card);
    color: var(--accent-primary);
    border: 2px solid var(--accent-primary);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.btn-empty-login:hover {
    background-color: var(--accent-primary);
    color: white;
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

@keyframes emptyStateReveal {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

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

#emptyState .empty-logo-wrapper {
    cursor: pointer;
    padding: 25px;
    position: relative;
}

#emptyState .empty-cta {
    margin-top: 30px;
    font-size: 1.15rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Premium Empty Logo Animation - RESPONSIVE */
.premium-empty-logo {
    height: 260px;
    /* Default for Desktop */
    width: auto;
    max-width: 90vw;
    object-fit: contain;
    border-radius: 12px;
    filter: drop-shadow(0 15px 30px rgba(74, 144, 226, 0.3));
    animation: floatPremiumLogo 5s ease-in-out infinite;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.4s ease;
    margin-bottom: 30px;
}

.premium-empty-logo:hover {
    transform: scale(1.08) translateY(-10px);
    filter: drop-shadow(0 25px 50px rgba(74, 144, 226, 0.5));
}

.premium-empty-logo-icon {
    font-size: 280px;
    filter: drop-shadow(0 15px 30px rgba(74, 144, 226, 0.3));
    animation: floatPremiumLogo 5s ease-in-out infinite;
    transition: transform 0.4s ease, filter 0.4s ease;
}

@keyframes floatPremiumLogo {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* Tablet Responsiveness */
@media (max-width: 1024px) {
    .premium-empty-logo {
        height: 240px;
        margin-bottom: 25px;
    }

    .premium-empty-logo-icon {
        font-size: 200px;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .premium-empty-logo {
        height: 160px;
        margin-bottom: 20px;
        animation: floatPremiumLogoMobile 4s ease-in-out infinite;
    }

    .premium-empty-logo-icon {
        font-size: 140px;
        animation: floatPremiumLogoMobile 4s ease-in-out infinite;
    }
}

@keyframes floatPremiumLogoMobile {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* --- SKELETON LOADER --- */
.skeleton-loader {
    display: flex;
    gap: 20px;
    padding: 20px;
    overflow-x: auto;
    background-color: var(--bg-body);
    height: calc(100dvh - 150px);
    width: 100%;
    box-sizing: border-box;
}

.skeleton-col {
    background-color: var(--bg-col);
    border-radius: var(--radius-lg);
    width: 350px;
    flex-shrink: 0;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: var(--shadow-sm);
}

.skeleton-card {
    background-color: var(--bg-card);
    height: 100px;
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.skeleton-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* --- PASSWORD VISIBILITY TOGGLE --- */
.password-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 10px;
}

.password-wrapper .modal-input {
    margin-bottom: 0 !important;
    padding-right: 45px !important;
}

.toggle-password-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent !important;
    border: none !important;
    color: var(--text-muted) !important;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 8px;
    z-index: 10;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
    width: auto;
    margin: 0;
    box-shadow: none !important;
}

.toggle-password-btn:hover {
    color: var(--accent-primary) !important;
}

.toggle-password-btn:active {
    transform: translateY(-50%) scale(0.9) !important;
}
