:root {
    --color-todo: #ffffff;
    --color-progress: #ffff99;
    --color-done: #90ee90;
    --color-border: #d0d0d0;
    --color-hover: #f5f5f5;
    --color-header: #f8f9fa;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-danger: #dc3545;

    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 24px;

    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-size-base: 14px;
    --font-size-sm: 12px;
    --font-size-lg: 16px;

    --border-radius: 4px;
    --transition-speed: 0.2s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--color-text);
    background-color: white;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overflow-x: auto;
}

.container {
    width: 100%;
    margin: 0;
    padding: 0;
    background-color: white;
    min-height: 100vh;
    position: relative;
}

/* Drag and Drop Styles */
.container.drag-over {
    background-color: #f0f8ff;
    outline: 2px dashed #007bff;
}

.drag-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 123, 255, 0.1);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    pointer-events: none;
}

.drag-message {
    background-color: white;
    border: 3px dashed #007bff;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 123, 255, 0.3);
    max-width: 400px;
    animation: dragPulse 2s ease-in-out infinite;
}

.drag-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: dragBounce 1.5s ease-in-out infinite;
}

.drag-message h3 {
    color: #007bff;
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 600;
}

.drag-message p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

@keyframes dragPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes dragBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

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

.header h1 {
    font-size: 24px;
    color: var(--color-text);
    font-weight: 500;
}

.actions {
    display: flex;
    gap: var(--spacing-sm);
}

.btn {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--color-border);
    background-color: white;
    color: var(--color-text);
    font-size: var(--font-size-base);
    font-weight: 500;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-family: var(--font-family);
    position: relative;
}


.btn:hover {
    background-color: #f8f9fa;
}

.btn:active {
    background-color: #e9ecef;
}

.btn svg {
    width: 20px;
    height: 20px;
}

.btn--import {
    background-color: white;
    color: #667eea;
    border-color: #d0d0d0;
}

.btn--import:hover {
    background-color: #f8f9fa;
}

.btn--export {
    background-color: white;
    color: #f5576c;
    border-color: #d0d0d0;
}

.btn--export:hover {
    background-color: #f8f9fa;
}

.btn--save {
    background-color: #28a745;
    color: white;
    border-color: #28a745;
}

.btn--save:hover {
    background-color: #218838;
    border-color: #218838;
}

.btn-icon {
    font-size: 16px;
}

.main-content {
    min-height: 400px;
    padding: var(--spacing-lg);
}

.table-container {
    overflow-x: auto;
    overflow-y: visible;
    margin-bottom: var(--spacing-xl);
    border: 1px solid var(--color-border);
    border-radius: 0;
    background-color: white;
    position: relative;
}

.task-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    position: relative;
}

.task-table thead {
    background-color: var(--color-header);
    position: sticky;
    top: 0;
    z-index: 10;
}

.task-table th {
    padding: var(--spacing-md);
    text-align: left;
    font-weight: 600;
    color: var(--color-text);
    border-bottom: 2px solid var(--color-border);
    border-right: 1px solid var(--color-border);
    font-size: var(--font-size-base);
    position: relative;
    user-select: none;
    cursor: move;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-table th.dragging {
    opacity: 0.5;
    background-color: #e0e0e0;
}

.task-table th.drag-over {
    background-color: #d0e5ff;
}

.column-resizer {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    cursor: col-resize;
    background-color: transparent;
    transition: background-color 0.2s;
}

.column-resizer:hover {
    background-color: #4a90e2;
}

.column-resizer.resizing {
    background-color: #2563eb;
}

.task-table th:last-child {
    border-right: none;
}

.task-table td {
    padding: 2px 4px;
    border: 1px solid #d0d0d0;
    vertical-align: middle;
    height: 28px;
    background-color: white;
}

.task-table td:last-child {
    border-right: none;
}

/* Status column (1st) */
.task-table th:nth-child(1),
.task-table td:nth-child(1) {
    min-width: 40px;
    width: 40px;
    max-width: 40px;
}

/* Documento column (2nd) */
.task-table th:nth-child(2),
.task-table td:nth-child(2) {
    min-width: 150px;
    width: 150px;
}

/* Link column (3rd) */
.task-table th:nth-child(3),
.task-table td:nth-child(3) {
    min-width: 100px;
    width: 100px;
}

/* Assunto column (4th) */
.task-table th:nth-child(4),
.task-table td:nth-child(4) {
    min-width: 250px;
    width: 250px;
}

/* Servidor column (5th) */
.task-table th:nth-child(5),
.task-table td:nth-child(5) {
    min-width: 200px;
    width: 200px;
}

/* Matrícula column (6th) */
.task-table th:nth-child(6),
.task-table td:nth-child(6) {
    min-width: 100px;
    width: 100px;
}

/* Situação column (7th) */
.task-table th:nth-child(7),
.task-table td:nth-child(7) {
    min-width: 150px;
    width: 150px;
}

/* Obs column (8th) */
.task-table th:nth-child(8),
.task-table td:nth-child(8) {
    min-width: 200px;
    width: 200px;
}

/* Ações column (9th) */
.task-table th:nth-child(9),
.task-table td:nth-child(9) {
    min-width: 80px;
    width: 80px;
}

.new-task-row {
    background-color: #f0f8ff;
}

.new-task-row td {
    padding: 2px 4px;
    border: 1px solid #4a90e2;
    border-bottom: 2px solid #4a90e2;
}

.task-input {
    width: 100%;
    padding: 2px 4px;
    border: none;
    background: transparent;
    font-size: var(--font-size-base);
    font-family: var(--font-family);
}

.task-input:focus {
    outline: none;
}

.task-select {
    width: 100%;
    padding: 2px 4px;
    border: none;
    background: transparent;
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    cursor: pointer;
}

.task-select:focus {
    outline: none;
}

.task-field {
    padding: 2px 4px;
    min-height: 24px;
    display: flex;
    align-items: center;
    word-break: break-word;
}

.task-field:focus {
    outline: none;
    background-color: white;
}


.task-row:hover td {
    background-color: var(--color-hover);
}

.task-row--done:hover td {
    background-color: var(--color-hover);
    color: rgba(51, 51, 51, 0.7);
}

.task-row--todo td {
    background-color: var(--color-todo);
}

.task-row--progress td {
    background-color: var(--color-progress);
    font-weight: 600;
}

.task-row--done td {
    background-color: var(--color-done);
    color: rgba(51, 51, 51, 0.6);
}

.task-row--done .task-link {
    color: rgba(0, 102, 204, 0.6);
}

.task-link {
    color: #0066cc;
    text-decoration: none;
    font-size: var(--font-size-base);
    display: inline-block;
    padding: 2px 6px;
}

.task-link:hover {
    background-color: rgba(0, 102, 204, 0.1);
    border-radius: 3px;
}

.link-field {
    text-align: center;
    min-height: 24px;
    font-size: var(--font-size-base);
}

.link-field[contenteditable]:focus {
    text-align: left;
}

.status-column {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    text-align: center;
    padding: 0 !important;
}

.status-select {
    width: 100%;
    padding: 2px;
    border: none;
    background: transparent;
    font-size: 18px;
    font-family: var(--font-family);
    cursor: pointer;
    text-align: center;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.status-select:focus {
    outline: none;
    background-color: rgba(74, 144, 226, 0.1);
}

.status-select:hover {
    background-color: rgba(74, 144, 226, 0.05);
}

.actions-column {
    text-align: center;
    width: 80px;
}

.btn-add {
    background-color: #28a745;
    color: white;
    border: none;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 16px;
    transition: all var(--transition-speed);
}

.btn-add:hover {
    background-color: #218838;
    transform: scale(1.1);
}

.btn-delete {
    background-color: transparent;
    color: var(--color-danger);
    border: none;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all var(--transition-speed);
}

.btn-delete:hover {
    background-color: var(--color-danger);
    color: white;
    border-radius: 2px;
}

.task-row {
    cursor: move;
    transition: opacity 0.2s;
}

.task-row.drag-over-row {
    background-color: #e3f2fd !important;
    border-top: 2px solid #2196f3;
}


@media (max-width: 768px) {
    .container {
        padding: 0;
    }

    .header {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }

    .actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    .task-table {
        font-size: var(--font-size-sm);
    }

    .task-table th,
    .task-table td {
        padding: var(--spacing-xs);
    }

    .btn {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: var(--font-size-sm);
    }
}
