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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow-x: hidden;
}

/* Kanban Columns */
.kanban-column {
    min-height: 500px;
    transition: background-color 0.2s;
}

.kanban-column.drag-over {
    background-color: rgba(59, 130, 246, 0.1);
}

.drag-over-task {
    border-top: 3px solid #3b82f6;
    margin-top: -3px;
}

/* Task Cards */
.task-card {
    cursor: grab;
    transition: all 0.2s;
}

.task-card:active {
    cursor: grabbing;
}

.task-card.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

/* Priority Borders */
.priority-high { 
    border-left: 4px solid #ef4444; 
}

.priority-medium { 
    border-left: 4px solid #f59e0b; 
}

.priority-low { 
    border-left: 4px solid #10b981; 
}

/* Category Badges */
.category-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 600;
}

/* Stat Cards Gradients */
.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card-2 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-card-3 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-card-4 {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

/* Modal */
.modal-overlay {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

/* Timeline Bar */
.timeline-bar {
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

/* Progress Ring */
.progress-ring {
    transform: rotate(-90deg);
}

/* Animations */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

/* Smooth Scrolling */
.scroll-smooth {
    scroll-behavior: smooth;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Dark Mode Scrollbar RIMOSSO */
/*
.dark {
    color-scheme: dark;
}

.dark ::-webkit-scrollbar-track {
    background: #1f2937;
}

.dark ::-webkit-scrollbar-thumb {
    background: #4b5563;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}
*/

/* Text Truncation */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Responsive Tables */
@media (max-width: 768px) {
    .kanban-column {
        min-height: 300px;
    }
    
    table {
        font-size: 0.875rem;
    }
    
    .stat-card {
        padding: 1rem !important;
    }
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.2s, box-shadow 0.2s;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Button Styles */
button {
    transition: all 0.2s ease;
}

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

/* Focus Styles */
*:focus {
    outline: none;
}

input:focus,
textarea:focus,
select:focus,
div[contenteditable="true"]:focus {
    --tw-ring-color: rgb(147 51 234);
    --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
    /* Ho cambiato 2px in 1px per un contorno più sottile */
    --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
    box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
    /* --- MODIFICA QUI --- */
    /* Ho rimosso la riga 'border-color: rgb(147 51 234);' per evitare il doppio bordo */
}


/* Loading Animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Slide In Animation */
@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Card Shadows */
.card-shadow {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.card-shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Backdrop Blur */
.backdrop-blur {
    backdrop-filter: blur(8px);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Custom Checkbox */
input[type="checkbox"] {
    cursor: pointer;
    accent-color: #667eea;
}

/* Select Dropdown Arrow */
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23666'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25em 1.25em;
    padding-right: 2.5rem;
}

/* RIMOSSO dark select
.dark select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ccc'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
}
*/

select::-ms-expand {
    display: none;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
    }
    
    .task-card {
        break-inside: avoid;
    }
}

/* ================== */
/* Stili WYSIWYG      */
/* ================== */

/* Placeholder per contentEditable */
.simple-wysiwyg-editor:empty::before {
    content: attr(data-placeholder);
    color: #9ca3af; /* text-gray-400 */
    cursor: text;
}

/* NUOVA REGOLA: Stili per i link *dentro* l'editor */
.simple-wysiwyg-editor a {
    color: #2563eb; /* text-blue-600 */
    text-decoration: underline;
}


/* Stili per il contenuto renderizzato */
.wysiwyg-content p {
    margin: 0;
    padding: 0;
}

.wysiwyg-content a {
    color: #2563eb; /* text-blue-600 */
    text-decoration: underline;
}

/* Pulisce i margini di default per p, ul, ol dentro l'editor */
.simple-wysiwyg-editor p,
.simple-wysiwyg-editor ul,
.simple-wysiwyg-editor ol,
.wysiwyg-content p,
.wysiwyg-content ul,
.wysiwyg-content ol {
    margin: 0;
}

.simple-wysiwyg-editor ul,
.simple-wysiwyg-editor ol,
.wysiwyg-content ul,
.wysiwyg-content ol {
    padding-left: 1.5rem; /* pl-6 */
}

/* Stili per la lista subtask nella card */
.task-card-subtasks input[type="checkbox"]:disabled {
    opacity: 0.7;
    cursor: default;
}