/* ============================================================
   TEMA PREMIUM: CETAM LIQUID GLASS V16 (FULLSCREEN PWA MOBILE & DESKTOP GRID)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

html, body {
    width: 100%; margin: 0; padding: 0;
    font-family: 'Inter', sans-serif;
    background-color: #f4f7f9 !important; 
    background-image: radial-gradient(circle at top left, #e0e7ff 0%, #f1f5f9 50%, #e2e8f0 100%) !important;
    color: #1e293b;
    transition: background 0.4s ease, color 0.4s ease;
    word-break: break-word;
    -webkit-tap-highlight-color: transparent;
}

/* Trava a rolagem global APENAS no Computador (para efeito SPA), 
   mas deixa livre no celular para que o Safari retraia as barras (Efeito Wikipedia) */
@media (min-width: 1024px) {
    html, body { overflow: hidden; height: 100%; }
}

/* MODO ESCURO */
html.dark, html.dark body {
    background-color: #0f172a !important; 
    background-image: radial-gradient(circle at top right, #1e293b 0%, #0f172a 60%, #020617 100%) !important;
    color: #f8fafc;
    color-scheme: dark; 
    -webkit-font-smoothing: antialiased; 
    -moz-osx-font-smoothing: grayscale;
}

header { padding-top: env(safe-area-inset-top) !important; min-height: calc(64px + env(safe-area-inset-top)) !important; }
#sidebar { padding-top: env(safe-area-inset-top) !important; padding-bottom: env(safe-area-inset-bottom) !important; }
#mobile-menu-overlay { padding-top: env(safe-area-inset-top) !important; }

/* PAINEIS CLAROS */
.glass-panel, .bg-white, #sidebar, header, .task-card, .ql-toolbar, .ql-container, #notif-dropdown {
    background: rgba(255, 255, 255, 0.85) !important; 
    backdrop-filter: blur(24px) !important; 
    -webkit-backdrop-filter: blur(24px) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 10px 30px -10px rgba(31, 38, 135, 0.15) !important;
}

/* PAINEIS ESCUROS */
.dark .glass-panel, .dark .bg-white, .dark #sidebar, .dark header, .dark .task-card, .dark .bg-slate-800, .dark .bg-slate-900, .dark .ql-toolbar, .dark .ql-container {
    background: rgba(30, 41, 59, 0.75) !important; 
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.06), 0 15px 35px -5px rgba(0, 0, 0, 0.6) !important;
}

#notif-dropdown { background: rgba(255, 255, 255, 0.95) !important; border: 1px solid rgba(0, 0, 0, 0.1) !important; }
.dark #notif-dropdown { background: rgba(15, 23, 42, 0.95) !important; border: 1px solid rgba(255, 255, 255, 0.1) !important; }
#notif-list li { transition: background 0.2s; background: transparent !important; border-bottom-color: rgba(0,0,0,0.05) !important; }
.dark #notif-list li { border-bottom-color: rgba(255,255,255,0.05) !important; }
#notif-list li:hover { background: rgba(0,0,0,0.05) !important; }
.dark #notif-list li:hover { background: rgba(255,255,255,0.05) !important; }

button.text-red-500, button.text-red-600, button.text-gray-700 { border: 1px solid currentColor !important; border-radius: 0.75rem !important; padding-left: 1rem !important; padding-right: 1rem !important; }
.dark button.text-gray-700 { border: 1px solid #94a3b8 !important; color: #94a3b8 !important; }
button.text-yellow-600 { background: #eab308 !important; color: white !important; border: none !important; }
.dark button.text-yellow-600 { background: #facc15 !important; color: #1e293b !important; }

/* ============================================================
   KANBAN MOBILE & DESKTOP RESPONSIVE TWEAKS 
   ============================================================ */
.kanban-scroll-container { 
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory; 
    scroll-behavior: smooth; 
    -webkit-overflow-scrolling: touch; 
    padding-bottom: 1rem;
    gap: 1rem;
}
.kanban-scroll-container::-webkit-scrollbar { display: none; }
.kanban-snap-item { 
    scroll-snap-align: center; 
    width: 85vw !important;
    max-width: 350px !important;
    flex-shrink: 0;
}

/* NO COMPUTADOR E TABLET: O KANBAN PREENCHE 100% DA TELA EM GRADE */
@media (min-width: 1024px) {
    .kanban-scroll-container {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        overflow-x: visible !important;
        padding-bottom: 0 !important;
    }
    .kanban-snap-item {
        width: 100% !important;
        max-width: none !important; /* Remove o limite de largura no PC para preencher a tela */
    }
}
/* ============================================================ */

.task-card { cursor: grab; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; width: 100%; box-sizing: border-box; }
.task-card:hover { transform: translateY(-2px); box-shadow: 0 12px 25px -5px rgba(0,0,0,0.15) !important; }
.dark .task-card:hover { box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08), 0 15px 30px -5px rgba(0,0,0,0.6) !important; border-color: rgba(255,255,255,0.15) !important; }
.task-card.is-dragging { opacity: 0.4; transform: scale(0.95); }

.kanban-column { min-height: 60px; transition: all 0.2s ease; border-radius: 1rem; padding: 4px; border: 2px solid transparent; }
.kanban-column.drag-over { background: rgba(59, 130, 246, 0.1) !important; border: 2px dashed #3b82f6 !important; }
.dark .kanban-column.drag-over { background: rgba(59, 130, 246, 0.2) !important; border: 2px dashed #60a5fa !important; }

.gantt-grid { display: grid; grid-template-columns: 280px repeat(48, minmax(24px, 1fr)); }
@media (min-width: 1024px) { .gantt-grid { grid-template-columns: 400px repeat(48, minmax(24px, 1fr)); } }

input, select, textarea { background: rgba(255,255,255, 0.5) !important; border: 1px solid rgba(0, 0, 0, 0.1) !important; color: #0f172a !important; transition: all 0.2s; }
.dark input, .dark select, .dark textarea { background: rgba(15, 23, 42, 0.6) !important; border: 1px solid rgba(255, 255, 255, 0.1) !important; color: #f8fafc !important; box-shadow: inset 0 2px 4px rgba(0,0,0,0.2) !important; }
input:focus, select:focus, textarea:focus { border-color: #3b82f6 !important; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important; outline: none !important; }
.dark input:focus, .dark select:focus, .dark textarea:focus { background: rgba(15, 23, 42, 0.9) !important; box-shadow: inset 0 2px 4px rgba(0,0,0,0.2), 0 0 0 3px rgba(59, 130, 246, 0.25) !important; }
.dark input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; filter: invert(0.8); }

.page-view { display: none; }
.page-view.active { display: flex; flex-direction: column; animation: fadeIn 0.3s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
main, .bg-gray-100, .bg-gray-50, #view-login { background: transparent !important; }

/* SKELETON LOADERS (ANIMAÇÃO) */
@keyframes skeleton-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.skeleton { background-color: rgba(203, 213, 225, 0.6); border-radius: 0.75rem; animation: skeleton-pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.dark .skeleton { background-color: rgba(51, 65, 85, 0.6); }

/* SCROLLBAR */
.custom-scrollbar::-webkit-scrollbar { width: 6px; height: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background-color: rgba(148, 163, 184, 0.6); border-radius: 10px; }
.dark .custom-scrollbar::-webkit-scrollbar-thumb { background-color: rgba(71, 85, 105, 0.6); }

#loading-overlay { display: flex; } body.loaded #loading-overlay { display: none !important; }
body.logged-out #main-interface { display: none !important; } body.logged-in #view-login { display: none !important; }

#custom-modal-overlay { animation: fadeIn 0.2s ease; }
#custom-modal-overlay.hidden { display: none !important; }
#custom-modal-box { animation: slideUp 0.25s ease; }
.dark #custom-modal-box { background: rgba(15,23,42,0.97) !important; border: 1px solid rgba(255,255,255,0.1) !important; box-shadow: inset 0 1px 1px rgba(255,255,255,0.05), 0 25px 50px -12px rgba(0,0,0,0.8) !important; }
.dark #custom-modal-title { color: #f8fafc !important; } .dark #custom-modal-message { color: #94a3b8 !important; }
.dark #custom-modal-input { background: rgba(0,0,0,0.3) !important; color: #f8fafc !important; border: 1px solid rgba(255,255,255,0.1) !important; }
@keyframes slideUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }

.toast-item { padding: 0.875rem 1.25rem; border-radius: 0.875rem; font-size: 0.85rem; font-weight: 700; display: flex; align-items: center; gap: 0.6rem; box-shadow: 0 10px 30px -5px rgba(0,0,0,0.25); animation: toastIn 0.3s ease; min-width: 220px; max-width: 340px; backdrop-filter: blur(12px); pointer-events: all; }
.toast-success { background: rgba(34,197,94,0.95); color: white; } .toast-error { background: rgba(239,68,68,0.95); color: white; } .toast-info { background: rgba(59,130,246,0.95); color: white; } .toast-warning { background: rgba(234,179,8,0.95); color: #1a1100; }
@keyframes toastIn { from { opacity:0; transform:translateX(60px); } to { opacity:1; transform:translateX(0); } }
@keyframes toastOut { from { opacity:1; transform:translateX(0); } to { opacity:0; transform:translateX(60px); } }

.btn-spinner { display: inline-block; width: 16px; height: 16px; border: 2.5px solid rgba(255,255,255,0.35); border-top-color: white; border-radius: 50%; animation: spin 0.7s linear infinite; margin-right: 8px; vertical-align: text-bottom; }
@keyframes spin { to { transform: rotate(360deg); } }

:focus-visible { outline: 2px solid #3b82f6 !important; outline-offset: 3px !important; border-radius: 4px; }
.task-card:focus-visible, li[role="button"]:focus-visible { box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.4) !important; border-color: #3b82f6 !important; outline: none !important; }