/* =========================================================================
   SISTEMA DE ESTILOS - TEMA SAAS PREMIUM CORPORATIVO
   Conceito: Soft Dark (Slate/Blue/Violet) com design system consistente.
   ========================================================================= */

:root {
    /* --- PALETA CORES (Slate/Inter) --- */
    --primary: #3B82F6; /* Blue 500 */
    --primary-hover: #2563EB; /* Blue 600 */
    --accent: #8B5CF6; /* Violet 500 */
    --accent-hover: #7C3AED;
    
    --bg-main: #0F172A; /* Slate 900 */
    --bg-surface: #1E293B; /* Slate 800 */
    --bg-surface-hover: #334155; /* Slate 700 */
    
    --text-primary: #F8FAFC; /* Slate 50 */
    --text-secondary: #94A3B8; /* Slate 400 */
    --text-muted: #64748B; /* Slate 500 */
    
    --border-light: rgba(255, 255, 255, 0.08); 
    --border-focus: rgba(59, 130, 246, 0.4);
    
    /* Semantic Colors */
    --success: #10B981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --danger: #EF4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --info: #0EA5E9;
    --info-bg: rgba(14, 165, 233, 0.15);

    /* --- ESPAÇAMENTOS E ESTRUTURA --- */
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1.25rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* --- MICRO-INTERAÇÕES --- */
    --shadow-sm: 0 1px 2px rgba(0,0,0, 0.4);
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-float: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================================================
   LIGHT THEME OVERRIDES
   ========================================================================= */
[data-theme="light"] {
    --bg-main: #F1F5F9; 
    --bg-surface: #FFFFFF; 
    --bg-surface-hover: #E2E8F0; 
    
    --text-primary: #0F172A; 
    --text-secondary: #475569; 
    --text-muted: #94A3B8; 
    
    --border-light: rgba(0, 0, 0, 0.1); 
    --border-focus: rgba(59, 130, 246, 0.4);

    --shadow-sm: 0 1px 2px rgba(0,0,0, 0.05);
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.05);
    --shadow-float: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .login-container { background: radial-gradient(circle at 15% 50%, #e2e8f0, #f1f5f9 60%); }
[data-theme="light"] .login-card { background: rgba(255, 255, 255, 0.8); }
[data-theme="light"] .login-header .logo { filter: none; }
[data-theme="light"] .sidebar-header .logo { filter: none; }
[data-theme="light"] .topbar { background-color: rgba(255, 255, 255, 0.8); }
[data-theme="light"] .stat-icon { color: white !important; }
[data-theme="light"] .btn-shortcut { background-color: #FFFFFF; }
[data-theme="light"] .btn-shortcut:hover { background-color: #F8FAFC; }
[data-theme="light"] .modal-overlay { background-color: rgba(15, 23, 42, 0.5); }
[data-theme="light"] .form-control:focus { background-color: #FFFFFF; }
[data-theme="light"] .modal-header, [data-theme="light"] .modal-footer { background-color: rgba(0,0,0,0.02); }

/* =========================================================================
   1. RESETS & BASE 
   ========================================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    overflow-x: hidden;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.2;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

ul {
    list-style: none;
}

/* Utilitários Typography */
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-center { text-align: center; }

/* Truncamento e Quebra de Linha de Texto */
.truncate-1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.truncate-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* View Management */
.screen { display: none; min-height: 100vh; }
.screen.view-active { display: block; animation: fadeIn 0.4s ease-out forwards; }
.content-section { display: none; animation: fadeIn 0.3s ease-out forwards; }
.content-section.section-active { display: block; }

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

@keyframes spin {
    to { transform: rotate(360deg); }
}
.ph-spin { animation: spin 1s linear infinite; }

/* =========================================================================
   2. UI COMPONENTS: BUTTONS, BADGES, INPUTS
   ========================================================================= */

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.6rem 1.2rem; font-size: 0.9rem; font-weight: 500; font-family: inherit;
    border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer;
    transition: var(--transition); text-align: center; outline: none; white-space: nowrap;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-block { width: 100%; }

.btn-primary { 
    background-color: var(--primary); color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}
.btn-primary:hover:not(:disabled) { 
    background-color: var(--primary-hover); transform: translateY(-1px); 
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35); 
}

.btn-outline { 
    background-color: transparent; border: 1px solid var(--border-light); 
    color: var(--text-secondary);
}
.btn-outline:hover:not(:disabled) { 
    background-color: var(--bg-surface-hover); color: var(--text-primary); border-color: var(--text-muted);
}

.btn-icon {
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: none; color: var(--text-secondary);
    width: 36px; height: 36px; border-radius: var(--radius-sm); cursor: pointer;
    transition: var(--transition); font-size: 1.25rem;
}
.btn-icon:hover { background-color: var(--bg-surface-hover); color: var(--text-primary); }

.btn-action { /* Botão pequeno para ações em cards/tabelas */
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    padding: 0.35rem 0.7rem; font-size: 0.8rem; font-weight: 500;
    border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer;
    transition: var(--transition); background: transparent; color: var(--text-secondary);
}
.btn-action.success { color: var(--success); border-color: rgba(16, 185, 129, 0.2); }
.btn-action.success:hover { background: rgba(16, 185, 129, 0.1); }
.btn-action.primary { color: var(--primary); border-color: rgba(59, 130, 246, 0.2); }
.btn-action.primary:hover { background: rgba(59, 130, 246, 0.1); }
.btn-action.danger { color: var(--danger); border-color: rgba(239, 68, 68, 0.2); }
.btn-action.danger:hover { background: rgba(239, 68, 68, 0.1); }
.btn-action.icon-only { width: 32px; height: 32px; padding: 0; }

/* Filter Pills */
.pill {
    padding: 0.4rem 1rem; font-size: 0.85rem; font-weight: 500; border-radius: 40px;
    border: 1px solid var(--border-light); background: transparent; color: var(--text-secondary);
    cursor: pointer; transition: var(--transition); outline: none;
}
.pill:hover { background: var(--bg-surface); color: var(--text-primary); }
.pill.active {
    background: var(--info-bg); color: var(--info); border-color: rgba(14, 165, 233, 0.3); font-weight: 600;
}

/* Badges */
.badge {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.25rem;
    padding: 0.2rem 0.6rem; font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
    border-radius: 4px; white-space: nowrap; line-height: 1; letter-spacing: 0.05em;
}
.badge-primary { background-color: rgba(59, 130, 246, 0.15); color: #60A5FA; border: 1px solid rgba(59,130,246,0.2); }
.badge-success { background-color: var(--success-bg); color: #34D399; border: 1px solid rgba(16,185,129,0.2); }
.badge-warning { background-color: var(--warning-bg); color: #FBBF24; border: 1px solid rgba(245,158,11,0.2); }
.badge-danger { background-color: var(--danger-bg); color: #F87171; border: 1px solid rgba(239,68,68,0.2); }
.badge-neutral { background-color: var(--bg-surface-hover); color: var(--text-primary); border: 1px solid var(--border-light); }

/* Forms & Inputs */
.form-group { display: flex; flex-direction: column; gap: var(--space-md); }
.input-block { display: flex; flex-direction: column; gap: 0.4rem; }
.input-block label { font-size: 0.8rem; font-weight: 500; color: var(--text-secondary); }

.form-control {
    width: 100%; padding: 0.65rem 1rem; font-size: 0.95rem; font-family: inherit; color: var(--text-primary);
    background-color: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--radius-sm);
    transition: var(--transition); outline: none;
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); background-color: rgba(30, 41, 59, 0.6); }

select.form-control { appearance: none; padding-right: 2.5rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%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-size: 1.2rem; background-position: right 0.8rem center; background-repeat: no-repeat; cursor: pointer; }
select.form-control option { background-color: var(--bg-surface); color: var(--text-primary); }
textarea.form-control { resize: vertical; min-height: 80px; }

/* Input wrapper for icons */
.input-wrapper { position: relative; display: flex; align-items: center; width: 100%; }
.input-wrapper i.icon-left { position: absolute; left: 1rem; color: var(--text-muted); font-size: 1.1rem; pointer-events: none;}
.input-wrapper .form-control.has-icon-left { padding-left: 2.6rem; }
.input-wrapper .btn-append { position: absolute; right: 0.5rem; }

/* Extensões Grid Helper */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-md); }

.access-permission-hint { font-size: 0.78rem; color: var(--text-muted); line-height: 1.4; }
.access-permission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.5rem;
}
.access-permission-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.84rem;
    cursor: pointer;
}
.access-permission-item input { width: 16px; height: 16px; accent-color: var(--primary); }

/* =========================================================================
   3. LOGIN SCREEN
   ========================================================================= */
.login-container {
    display: flex; align-items: center; justify-content: center; min-height: 100vh;
    padding: var(--space-md); position: relative; background: radial-gradient(circle at 15% 50%, #1e293b, #0f172a 60%);
}

.login-card {
    background: rgba(30, 41, 59, 0.7); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    width: 100%; max-width: 400px; padding: var(--space-xl) var(--space-lg);
    border-radius: var(--radius-lg); border: 1px solid var(--border-light); box-shadow: var(--shadow-float);
    z-index: 2; display: flex; flex-direction: column; gap: var(--space-lg);
}

.login-header { text-align: center; }
.login-header .logo { max-height: 40px; object-fit: contain; filter: brightness(0) invert(1); margin-bottom: 1rem; }
.login-header h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.2rem; }
.login-header p { font-size: 0.9rem; color: var(--text-secondary); }

.login-footer { margin-top: var(--space-sm); text-align: center; font-size: 0.85rem; color: var(--text-secondary); }
.login-footer a { font-weight: 500; margin-left: 0.2rem; }

/* Decoradores de Fundo Absolutos */
.bg-decor { position: absolute; border-radius: 50%; filter: blur(80px); z-index: 1; opacity: 0.3; pointer-events: none; }
.decor-1 { width: 300px; height: 300px; background-color: var(--primary); top: -50px; left: -50px; }
.decor-2 { width: 350px; height: 350px; background-color: var(--accent); bottom: -100px; right: -50px; }


/* =========================================================================
   4. LAYOUT PRINCIPAL (APP WRAPPER)
   ========================================================================= */
.main-layout { display: flex; width: 100%; min-height: 100vh; position: relative; overflow: hidden; }

/* Sidebar */
.sidebar {
    width: 260px; height: 100vh; position: sticky; top: 0;
    background-color: var(--bg-surface); border-right: 1px solid var(--border-light);
    display: flex; flex-direction: column; z-index: 40; transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1); flex-shrink: 0;
    overflow-x: hidden;
}

/* Sidebar Collapsed State */
.sidebar.collapsed { width: 80px; }
.sidebar.collapsed .logo { display: none; }
.sidebar.collapsed .nav-section-title { display: none; }
.sidebar.collapsed .sidebar-nav ul li a span { display: none; }
.sidebar.collapsed .sidebar-nav ul li a .nav-badge { display: none; }
.sidebar.collapsed .sidebar-nav ul li a { padding: 0.6rem; justify-content: center; margin: 0 var(--space-xs); border-radius: var(--radius-sm); border-left: none; }
.sidebar.collapsed .sidebar-nav ul li a i { font-size: 1.5rem; margin: 0; }
.sidebar.collapsed .user-info { display: none; }
.sidebar.collapsed .btn-toggle-sidebar i { transform: rotate(180deg); }
.sidebar.collapsed .sidebar-footer { padding: var(--space-md) var(--space-xs); justify-content: center; overflow: hidden; }
.sidebar.collapsed .user-profile { gap: 0; justify-content: center; }
.sidebar.collapsed .btn-logout { display: none; } /* Pode ser escondido ou substituído por ícone, mas no colapso já fica a inicial */

.sidebar-header {
    height: 70px; padding: 0 var(--space-md); border-bottom: 1px solid var(--border-light);
    display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; white-space: nowrap;
}
.sidebar-header .logo { max-height: 32px; filter: brightness(0) invert(1); transition: opacity 0.2s;}

.btn-toggle-sidebar {
    background: transparent; border: none; color: var(--text-secondary); width: 32px; height: 32px;
    border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: var(--transition); flex-shrink: 0;
}
.btn-toggle-sidebar:hover { background: var(--bg-surface-hover); color: var(--text-primary); }

.sidebar-nav { flex: 1; padding: var(--space-md) 0; overflow-y: auto; }
.nav-section-title {
    font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted);
    padding: 0 var(--space-lg); margin: var(--space-sm) 0 var(--space-xs);
}

.sidebar-nav ul li a {
    display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem var(--space-lg);
    color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; border-left: 3px solid transparent;
}
.sidebar-nav ul li a i { font-size: 1.25rem; color: var(--text-muted); transition: color 0.2s; }
.sidebar-nav ul li a .nav-badge { margin-left: auto; }
.sidebar-nav ul li a:hover { background-color: rgba(255, 255, 255, 0.03); color: var(--text-primary); }
.sidebar-nav ul li a:hover i { color: var(--text-secondary); }

.sidebar-nav ul li a.active {
    color: var(--primary);
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.1) 0%, transparent 100%);
    border-left-color: var(--primary);
}
.sidebar-nav ul li a.active i { color: var(--primary); }

.sidebar-footer { padding: var(--space-md); border-top: 1px solid var(--border-light); }
.user-profile { display: flex; align-items: center; gap: 0.75rem; }
.avatar-initial {
    width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary), var(--accent)); color: white;
    display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 1rem;
}
.user-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.user-info strong { font-size: 0.85rem; color: var(--text-primary); font-weight: 600; }
.user-info span { font-size: 0.75rem; color: var(--text-secondary); }
.user-profile .btn-logout { color: var(--text-muted); width: 32px; height: 32px; font-size: 1.1rem; border-radius: var(--radius-sm); border: none; background: transparent; cursor: pointer; transition: var(--transition); }
.user-profile .btn-logout:hover { color: var(--danger); background-color: var(--danger-bg); }

/* Main Content Area */
.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100vh; overflow-y: auto; }

/* Topbar */
.topbar {
    height: 70px; min-height: 70px; padding: 0 var(--space-lg);
    background-color: rgba(15, 23, 42, 0.8); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light); position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-md);
}

.topbar-left { display: flex; align-items: center; gap: var(--space-md); flex: 1; min-width: 0; }
.mobile-menu-toggle { display: none; }
.page-title { font-size: 1.15rem; font-weight: 600; color: var(--text-primary); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sync-status {
    display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.2rem 0.6rem; border-radius: 4px; border: 1px solid transparent;
    font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap;
}
.sync-status.online { background-color: var(--success-bg); color: var(--success); border-color: rgba(16, 185, 129, 0.2); }
.sync-status.syncing { background-color: var(--warning-bg); color: var(--warning); border-color: rgba(245, 158, 11, 0.2); }
.sync-status.offline { background-color: var(--danger-bg); color: var(--danger); border-color: rgba(239, 68, 68, 0.2); }

.topbar-right { display: flex; align-items: center; gap: var(--space-sm); justify-content: flex-end;}
.search-container { max-width: 300px; width: 100%; transition: var(--transition); }
.notification-btn { position: relative; }
.notification-dot { position: absolute; top: 6px; right: 8px; width: 8px; height: 8px; background-color: var(--danger); border-radius: 50%; border: 2px solid var(--bg-main); box-sizing: content-box; }

.notification-btn-ring {
    animation: notification-ring 1.2s ease-in-out 1;
}

@keyframes notification-ring {
    0% { transform: translateY(0) scale(1); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.35); }
    20% { transform: translateY(-1px) scale(1.06); box-shadow: 0 0 0 10px rgba(34, 197, 94, 0.0); }
    40% { transform: translateY(0) scale(1); }
    60% { transform: translateY(-1px) scale(1.04); }
    100% { transform: translateY(0) scale(1); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.0); }
}

.content-wrapper { padding: var(--space-lg); max-width: 1400px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: var(--space-lg); }

/* =========================================================================
   5. BENTO GRID & WIDGETS
   ========================================================================= */
.bento-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-md);
}

.panel {
    background-color: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm); overflow: hidden;
}
.panel-bento-wide { grid-column: span 2; }

/* Stat Widgets */
.stat-widget {
    display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md); 
    background-color: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg);
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-widget:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); border-color: rgba(255,255,255,0.15); }
.stat-icon {
    width: 48px; height: 48px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: white; flex-shrink: 0;
}
.stat-icon.blue { background: linear-gradient(135deg, #60A5FA, #3B82F6); box-shadow: 0 4px 10px rgba(59, 130, 246, 0.25); }
.stat-icon.green { background: linear-gradient(135deg, #34D399, #10B981); box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25); }
.stat-icon.purple { background: linear-gradient(135deg, #A78BFA, #8B5CF6); box-shadow: 0 4px 10px rgba(139, 92, 246, 0.25); }
.stat-icon.orange { background: linear-gradient(135deg, #FBBF24, #F59E0B); box-shadow: 0 4px 10px rgba(245, 158, 11, 0.25); }

.stat-content { display: flex; flex-direction: column; min-width: 0;}
.stat-label { font-size: 0.8rem; font-weight: 500; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--text-primary); line-height: 1.2; letter-spacing: -0.02em; }
.stat-value.text-sm { font-size: 1rem; margin-top: 0.2rem; }

/* Action Panel (Shortcuts) */
.action-panel { padding: var(--space-md); }
.action-header { margin-bottom: var(--space-md); display: flex; justify-content: space-between; align-items: center; }
.action-header h3 { font-size: 1rem; color: var(--text-primary); }

.dashboard-campaign-alert { margin-bottom: var(--space-md); }
.dashboard-campaign-alert.critical {
    display: flex; align-items: flex-start; gap: 0.85rem; padding: 0.95rem 1rem;
    border-radius: var(--radius-md); border: 1px solid rgba(239, 68, 68, 0.35);
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.55), rgba(69, 10, 10, 0.35));
    color: #fecaca;
}
.dashboard-campaign-alert.critical i { font-size: 1.3rem; color: #f87171; margin-top: 0.05rem; }
.dashboard-campaign-alert.critical strong { display: block; color: #fff; margin-bottom: 0.2rem; }

.dashboard-campaign-wall {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-sm);
}

.dashboard-campaign-card {
    background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border-light); border-radius: var(--radius-md);
    padding: 0.95rem; display: flex; flex-direction: column; gap: 0.7rem; min-height: 180px;
}
.dashboard-campaign-card.is-critical {
    border-color: rgba(239, 68, 68, 0.3);
    box-shadow: 0 12px 30px rgba(127, 29, 29, 0.18);
    background: linear-gradient(180deg, rgba(127, 29, 29, 0.18), rgba(255,255,255,0.02));
}
.dashboard-campaign-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; }
.dashboard-campaign-card-date { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }
.dashboard-campaign-card-title { font-size: 1rem; font-weight: 700; color: var(--text-primary); line-height: 1.35; }
.dashboard-campaign-card-desc { font-size: 0.84rem; color: var(--text-secondary); line-height: 1.5; }
.dashboard-campaign-card-meta { margin-top: auto; font-size: 0.78rem; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 0.5rem; }

.dashboard-scheduled-list { display: flex; flex-direction: column; gap: 0.75rem; }
.dashboard-scheduled-item {
    padding: 0.9rem 0.95rem; border: 1px solid var(--border-light); border-radius: var(--radius-md);
    background: rgba(255,255,255,0.02); display: flex; flex-direction: column; gap: 0.4rem;
}
.dashboard-scheduled-item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.dashboard-scheduled-item strong { color: var(--text-primary); font-size: 0.95rem; }
.dashboard-scheduled-item p { color: var(--text-secondary); font-size: 0.82rem; line-height: 1.45; }
.dashboard-scheduled-meta { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; color: var(--text-muted); font-size: 0.76rem; }

.dashboard-campaign-empty {
    width: 100%; min-height: 140px; display: flex; align-items: center; justify-content: center; gap: 0.6rem;
    padding: 1rem; border: 1px dashed var(--border-light); border-radius: var(--radius-md); color: var(--text-secondary);
    background: rgba(255,255,255,0.02); text-align: center;
}
.dashboard-campaign-empty i { font-size: 1.2rem; }

.suggestions-layout {
    display: grid;
    grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
    gap: var(--space-lg);
    align-items: start;
}

.suggestion-header-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(45, 212, 191, 0.2);
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.18), rgba(59, 130, 246, 0.12));
    color: #99f6e4;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.suggestion-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
    gap: var(--space-lg);
    padding: clamp(1.25rem, 2vw, 2rem);
    margin-bottom: var(--space-lg);
    border-radius: calc(var(--radius-xl) + 4px);
    border: 1px solid rgba(45, 212, 191, 0.16);
    background:
        radial-gradient(circle at top left, rgba(34, 197, 94, 0.16), transparent 32%),
        radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.18), transparent 34%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.88));
    box-shadow: 0 26px 60px rgba(2, 6, 23, 0.32);
    overflow: hidden;
}

.suggestion-hero::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -60px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(45, 212, 191, 0.12);
    filter: blur(14px);
    pointer-events: none;
}

.suggestion-hero-content,
.suggestion-hero-side {
    position: relative;
    z-index: 1;
}

.suggestion-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.9rem;
    color: #67e8f9;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.suggestion-hero h3 {
    max-width: 15ch;
    margin-bottom: 0.85rem;
    font-size: clamp(1.5rem, 2vw, 2rem);
    line-height: 1.08;
}

.suggestion-hero p {
    max-width: 62ch;
    color: var(--text-secondary);
    font-size: 0.96rem;
    line-height: 1.7;
}

.suggestion-hero-points {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.2rem;
}

.suggestion-hero-point {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 44px;
    padding: 0.8rem 0.95rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-size: 0.84rem;
    font-weight: 600;
}

.suggestion-hero-point i {
    color: #5eead4;
    font-size: 1rem;
}

.suggestion-hero-side {
    display: grid;
    gap: 0.85rem;
    align-content: center;
}

.suggestion-hero-metric {
    padding: 1rem 1.05rem;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(8px);
}

.suggestion-hero-metric strong {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.suggestion-hero-metric span {
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.6;
}

.suggestion-form-panel,
.suggestion-list-panel {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-lg);
}

.suggestion-form-panel {
    position: sticky;
    top: calc(70px + var(--space-lg));
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(30, 41, 59, 0.92));
    border-color: rgba(45, 212, 191, 0.12);
}

.suggestion-list-panel {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.82), rgba(30, 41, 59, 0.88));
}

.suggestion-panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.suggestion-panel-heading-inline {
    padding-bottom: 0.1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.suggestion-panel-kicker {
    display: inline-flex;
    margin-bottom: 0.45rem;
    color: #5eead4;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.suggestion-panel-heading h3 {
    font-size: 1.18rem;
    margin-bottom: 0.35rem;
}

.suggestion-panel-heading p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.6;
}

.suggestion-form-grid {
    gap: 0.95rem;
}

.suggestion-input-block {
    gap: 0.5rem;
}

.suggestion-input-block label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.suggestion-input-block .form-control {
    min-height: 52px;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    border-color: rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.suggestion-input-block textarea.form-control {
    min-height: 104px;
}

.suggestion-input-block-emphasis .form-control {
    border-color: rgba(45, 212, 191, 0.18);
    background: linear-gradient(180deg, rgba(13, 148, 136, 0.1), rgba(255, 255, 255, 0.02));
}

.suggestion-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
    margin-top: 0.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.suggestion-record-list {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
}

.suggestion-record {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.05rem;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(15, 23, 42, 0.08));
    transition: var(--transition);
}

.suggestion-record:hover {
    transform: translateY(-2px);
    border-color: rgba(45, 212, 191, 0.26);
    box-shadow: 0 18px 36px rgba(2, 6, 23, 0.22);
}

.suggestion-record.is-pending {
    border-style: dashed;
}

.suggestion-record-main {
    min-width: 0;
    flex: 1;
}

.suggestion-record-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.9rem;
}

.suggestion-record-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 0.45rem;
}

.suggestion-record-title {
    font-size: 1rem;
    line-height: 1.3;
}

.suggestion-record-preview {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.65;
    max-width: 72ch;
}

.suggestion-record-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-top: 0.85rem;
    color: var(--text-muted);
    font-size: 0.77rem;
}

.suggestion-record-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.suggestion-record-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
}

.suggestion-view-btn {
    min-width: 118px;
    min-height: 42px;
    border-radius: 12px;
}

.suggestion-sync-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(96, 165, 250, 0.22);
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
    font-size: 0.7rem;
    font-weight: 700;
}

.suggestion-view-modal {
    max-width: 840px;
}

.suggestion-view-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.suggestion-view-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.2rem;
    border-radius: 20px;
    border: 1px solid rgba(45, 212, 191, 0.18);
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.16), rgba(59, 130, 246, 0.12));
}

.suggestion-view-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.suggestion-view-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.suggestion-view-hero h3 {
    margin-bottom: 0.45rem;
    font-size: 1.3rem;
}

.suggestion-view-hero p {
    color: var(--text-secondary);
    line-height: 1.65;
}

.suggestion-view-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.suggestion-view-block {
    padding: 1rem 1.05rem;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.02);
}

.suggestion-view-block-full {
    grid-column: 1 / -1;
}

.suggestion-view-label {
    display: inline-block;
    margin-bottom: 0.55rem;
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.suggestion-view-text {
    color: var(--text-primary);
    line-height: 1.7;
    white-space: pre-wrap;
}

[data-theme="light"] .suggestion-header-chip {
    color: #0f766e;
    border-color: rgba(13, 148, 136, 0.18);
    background: linear-gradient(135deg, rgba(204, 251, 241, 0.9), rgba(219, 234, 254, 0.9));
}

[data-theme="light"] .suggestion-hero {
    border-color: rgba(13, 148, 136, 0.12);
    background:
        radial-gradient(circle at top left, rgba(45, 212, 191, 0.22), transparent 32%),
        radial-gradient(circle at bottom right, rgba(96, 165, 250, 0.2), transparent 34%),
        linear-gradient(135deg, #ffffff, #f8fafc);
}

[data-theme="light"] .suggestion-hero-point,
[data-theme="light"] .suggestion-form-panel,
[data-theme="light"] .suggestion-list-panel,
[data-theme="light"] .suggestion-record,
[data-theme="light"] .suggestion-view-block,
[data-theme="light"] .suggestion-view-hero,
[data-theme="light"] .suggestion-hero-metric {
    background: rgba(255, 255, 255, 0.82);
}

.shortcut-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: var(--space-sm); }
.btn-shortcut {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.75rem;
    padding: var(--space-md); background-color: rgba(255, 255, 255, 0.02); border: 1px solid var(--border-light); border-radius: var(--radius-md);
    color: var(--text-primary); cursor: pointer; transition: var(--transition); height: 100%;
}
.btn-shortcut i { font-size: 1.75rem; color: var(--text-secondary); transition: var(--transition); }
.btn-shortcut span { font-size: 0.8rem; font-weight: 500; text-align: center; }
.btn-shortcut:hover { background-color: var(--bg-surface-hover); border-color: rgba(255,255,255,0.15); transform: translateY(-2px); }
.btn-shortcut:hover i { color: var(--primary); transform: scale(1.1); }

/* =========================================================================
   6. LIBRARY & CARDS DE DADOS (Templates & Campanhas)
   ========================================================================= */

.section-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: var(--space-lg); flex-wrap: wrap; gap: var(--space-md); }
.section-title h2 { font-size: 1.5rem; margin-bottom: 0.2rem; }
.section-title p { color: var(--text-secondary); font-size: 0.9rem; }

.filter-actions { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); margin-bottom: var(--space-lg); flex-wrap: wrap; }
.filter-pills { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.section-subnav { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: var(--space-lg); }
.section-subnav-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
    padding: 0.8rem 1rem; border-radius: var(--radius-md); border: 1px solid var(--border-light);
    background-color: var(--bg-surface); color: var(--text-secondary); font-weight: 600; cursor: pointer;
    transition: var(--transition);
}
.section-subnav-btn:hover { border-color: rgba(59, 130, 246, 0.35); color: var(--text-primary); transform: translateY(-1px); }
.section-subnav-btn.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(139, 92, 246, 0.14));
    border-color: rgba(96, 165, 250, 0.45); color: var(--text-primary);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

.section-subview { width: 100%; }

.data-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--space-md); margin-bottom: var(--space-xl); }

.data-card {
    background-color: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg);
    padding: var(--space-md); display: flex; flex-direction: column; min-height: 200px;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; box-shadow: var(--shadow-sm); relative;
}
.data-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); border-color: rgba(59, 130, 246, 0.3); }

.card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.75rem; gap: 0.5rem; }
.card-badges { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.card-date { font-size: 0.8rem; color: var(--text-secondary); font-weight: 500; white-space: nowrap; }

.card-title { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); line-height: 1.3; margin-bottom: 0.5rem; word-break: break-word; }
.card-desc { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: auto; word-break: break-word; }

.card-meta { margin-top: var(--space-md); margin-bottom: var(--space-sm); font-size: 0.8rem; color: var(--text-primary); display: flex; align-items: center; gap: 0.4rem; }

.card-footer {
    border-top: 1px solid var(--border-light); margin-top: var(--space-sm); padding-top: var(--space-sm);
    display: flex; justify-content: space-between; align-items: center;
}
.card-actions-right { display: flex; gap: 0.5rem; }

/* Empty State */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--space-xl) var(--space-md); text-align: center; border: 1px dashed var(--border-light); border-radius: var(--radius-lg); background-color: rgba(255,255,255,0.01); }
.empty-icon { width: 80px; height: 80px; background-color: var(--bg-surface); border: 1px solid var(--border-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: var(--text-secondary); margin-bottom: var(--space-md); }
.empty-state h3 { font-size: 1.25rem; color: var(--text-primary); margin-bottom: 0.4rem; }
.empty-state p { color: var(--text-secondary); max-width: 400px; font-size: 0.95rem; line-height: 1.5; margin-bottom: var(--space-md); }

/* =========================================================================
   7. MODALS
   ========================================================================= */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: rgba(15, 23, 42, 0.8); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    z-index: 100; display: flex; align-items: center; justify-content: center; padding: var(--space-md);
    opacity: 0; visibility: hidden; transition: all 0.3s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
    background-color: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg);
    width: 100%; max-width: 600px; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7); transform: translateY(20px); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-overlay.active .modal { transform: translateY(0); }

.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: var(--space-md) var(--space-lg); border-bottom: 1px solid var(--border-light); background-color: rgba(255,255,255,0.02);
}
.modal-header h2 { font-size: 1.2rem; font-weight: 600; }
.modal-close { background: transparent; border: none; color: var(--text-secondary); font-size: 1.25rem; cursor: pointer; transition: color 0.2s; padding: 4px; display: flex; }
.modal-close:hover { color: var(--danger); }

.modal-body { padding: var(--space-lg); overflow-y: auto; flex: 1; min-height: 0; }
.modal-body::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-thumb { background-color: var(--border-light); border-radius: 10px; }

.modal-footer {
    display: flex; justify-content: flex-end; gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg); border-top: 1px solid var(--border-light); background-color: rgba(255,255,255,0.02); flex-wrap: wrap;
}

/* Modal Info View */
.info-row { display: flex; flex-direction: column; margin-bottom: var(--space-md); }
.info-label { font-size: 0.8rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 0.3rem; }
.info-value { font-size: 0.95rem; color: var(--text-primary); font-weight: 500; background: rgba(0,0,0,0.2); padding: 0.75rem; border-radius: var(--radius-sm); border: 1px solid var(--border-light); word-break: break-word;}

/* Simulador Mobile */
.phone-mockup {
    width: 320px; height: 550px; background-color: #0F172A; border: 12px solid #334155; border-radius: 40px;
    margin: 0 auto; display: flex; flex-direction: column; position: relative; box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}
.phone-mockup::before { content: ''; position: absolute; top: -1px; left: 50%; transform: translateX(-50%); width: 120px; height: 26px; background-color: #334155; border-bottom-left-radius: 16px; border-bottom-right-radius: 16px; }
.phone-header {text-align: center; margin-top: 2rem; margin-bottom: 1rem; color: var(--text-muted); font-size: 0.85rem; font-weight: 600; display:flex; align-items:center; justify-content:center; gap:0.4rem;}
.phone-message {
    background-color: #1E293B; border: 1px solid var(--border-light); color: var(--text-primary); font-size: 0.9rem;
    padding: 1rem; margin: auto 1rem; border-radius: 16px; border-bottom-left-radius: 4px; line-height: 1.5; word-break: break-word; max-height: 400px; overflow-y: auto;
}
*::-webkit-scrollbar { width: 6px; } *::-webkit-scrollbar-thumb { background-color: var(--bg-surface-hover); border-radius: 10px; }


/* =========================================================================
   8. RESPONSIVIDADE E BREAKPOINTS
   ========================================================================= */

@media (max-width: 1024px) {
    .bento-grid { grid-template-columns: repeat(2, 1fr); }
    .panel-bento-wide { grid-column: span 2; }
    .suggestion-hero { grid-template-columns: 1fr; }
    .suggestions-layout { grid-template-columns: 1fr; }
    .suggestion-form-panel { position: static; }
}

@media (max-width: 768px) {
    .main-layout { flex-direction: column; }
    
    /* Configuração Sidebar Drawer */
    .sidebar { position: fixed; left: -100%; top: 0; z-index: 50; width: 280px; box-shadow: 10px 0 30px rgba(0,0,0,0.5); transition: left 0.3s ease; }
    .sidebar.open { left: 0; transform: none; }
    .sidebar.collapsed { width: 280px; } /* Desativa collapse em mobile */
    .btn-toggle-sidebar { display: none; } /* Botão toggle some no mobile, usamos apenas o toggle topbar */
    
    .mobile-menu-toggle { display: flex; color: var(--text-primary); }
    
    .topbar { padding: 0 var(--space-md); }
    .page-title { font-size: 1rem; max-width: 130px; }
    .search-container { max-width: 180px; }
    
    .content-wrapper { padding: var(--space-md); gap: var(--space-md); }
    
    .bento-grid { grid-template-columns: 1fr; }
    .panel-bento-wide { grid-column: span 1; }
    
    .filter-actions { flex-direction: column; align-items: stretch; }
    .filter-pills { justify-content: center; }
    .search-container.local { max-width: 100%; }
    .section-subnav { width: 100%; }
    .section-subnav-btn { width: 100%; }
    .suggestion-header-chip { width: 100%; justify-content: center; }
    .suggestion-panel-heading,
    .suggestion-record,
    .suggestion-record-top,
    .suggestion-view-hero { flex-direction: column; }
    .suggestion-record-actions,
    .suggestion-view-btn { width: 100%; }
    .suggestion-view-grid { grid-template-columns: 1fr; }
    
    .section-header { flex-direction: column; align-items: flex-start; }
    .section-header button { width: 100%; }
    
    .modal { border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 95vh; align-self: flex-end; margin: 0; max-width: 100%; }
    .modal-overlay { padding: 0; align-items: flex-end; }
    .modal-footer { flex-direction: column-reverse; }
    .modal-footer .btn { width: 100%; }
}

@media (max-width: 480px) {
    .search-container { display: none; } /* Ocultar busca na topbar para mobile pequeno, se necessário. Na UI ele pede a Lupa */
    .mobile-search-btn { display: flex; } /* Botao auxilard para abrir input, (para ser injetado) */
    
    .data-grid { grid-template-columns: 1fr; }
    .suggestion-hero,
    .suggestion-form-panel,
    .suggestion-list-panel,
    .suggestion-record,
    .suggestion-view-hero,
    .suggestion-view-block { padding: var(--space-md); }
    
    .stat-widget { padding: var(--space-sm); gap: var(--space-sm); }
    .stat-icon { width: 40px; height: 40px; font-size: 1.25rem; }
    .stat-value { font-size: 1.5rem; }
}

/* =========================================================================
   KANBAN (GESTÃO DE DEMANDAS)
   ========================================================================= */

.kanban-board-container {
    flex-grow: 1;
    display: flex;
    align-items: stretch;
    min-height: 0;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.kanban-board-container::-webkit-scrollbar {
    height: 10px;
}
.kanban-board-container::-webkit-scrollbar-track {
    background: transparent;
}
.kanban-board-container::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.kanban-board {
    display: flex;
    align-items: stretch;
    gap: 1.25rem;
    padding-bottom: 1rem;
    height: 100%;
    min-height: 0;
}

.kanban-list {
    min-width: 320px;
    width: 320px;
    height: 100%;
    min-height: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.kanban-list-header {
    padding: 1rem 1rem 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-color);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.88));
    backdrop-filter: blur(12px);
}

.kanban-list-header h3 {
    margin: 0;
    font-size: 1rem;
}

.kanban-list-cards {
    padding: 0.5rem 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    min-height: 0;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    min-height: 50px;
}

.kanban-list-cards::-webkit-scrollbar {
    width: 6px;
}
.kanban-list-cards::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.kanban-card {
    background: #23262d;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 0;
    cursor: grab;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    user-select: none;
    position: relative;
    overflow: hidden;
}

.kanban-card:hover {
    box-shadow: var(--shadow-card);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
    z-index: 20;
}

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

.kanban-card-cover {
    height: 38px;
    border-radius: 16px 16px 0 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    flex: 0 0 auto;
}

.kanban-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.85rem 0.85rem 0.9rem 2.55rem;
    min-height: 62px;
}

.kanban-card-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: flex-start;
}

.kanban-card-label {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0.1rem 0.45rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
}

.kanban-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    border: 2px dashed var(--primary);
}

.kanban-card-title {
    font-size: 0.92rem;
    font-weight: 700;
    margin: 0;
    color: #dfe1e6;
    line-height: 1.25;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.kanban-card-meta-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.5rem;
}

.kanban-card-meta {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    min-width: 0;
    color: #8da2b5;
}

.kanban-card-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.78rem;
    line-height: 1;
}

.kanban-card-meta-item .ph {
    font-size: 0.92rem;
}

.kanban-card-meta-item.late {
    color: var(--danger);
}

.kanban-card-members {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    padding-left: 0.25rem;
}

.kanban-card-member-avatar {
    width: 30px;
    height: 30px;
    margin-left: -8px;
    border: 2px solid #23262d;
    border-radius: 999px;
    background: #5e4db2;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.kanban-card-member-avatar:first-child {
    margin-left: 0;
}

.kanban-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.kanban-card-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.kanban-add-card-btn {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    padding: 0.85rem 0.15rem 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
    background: transparent;
    border: none;
    text-align: left;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 3;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.0), rgba(15, 23, 42, 0.95));
    backdrop-filter: blur(10px);
}

.kanban-add-card-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
}

/* KANBAN MODAL GRID */
.kanban-card-grid {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 2rem;
    align-items: start;
}

.kanban-dark-modal {
    max-width: 1040px;
    height: 92vh;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    background: #28292d;
    color: #b6c2cf;
    border: 1px solid #3c454c;
    border-radius: 14px;
    overflow: hidden;
}

.kanban-dark-modal-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #3c454c;
    background: #24262a;
}

.kanban-dark-select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.kanban-dark-select-wrap i {
    position: absolute;
    right: 10px;
    color: #b6c2cf;
    pointer-events: none;
    font-size: 0.8rem;
}

.kanban-dark-select {
    appearance: none;
    min-width: 138px;
    padding: 7px 32px 7px 12px;
    border: 1px solid #4b5258;
    border-radius: 6px;
    background: #3a3d42;
    color: #f4f5f7;
    font-size: 0.9rem;
    font-weight: 600;
    outline: none;
}

.kanban-dark-select:focus {
    border-color: #579dff;
    box-shadow: 0 0 0 2px rgba(87, 157, 255, 0.25);
}

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

.kanban-dark-header-btn {
    padding: 8px 12px;
    font-size: 0.85rem;
    white-space: nowrap;
}

.kanban-dark-icon-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #9fadbc;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.kanban-dark-icon-btn:hover,
.kanban-dark-toolbar-btn:hover,
.kanban-dark-property-action:hover,
.kanban-dark-popover-close:hover {
    background: #384148;
    color: #f4f5f7;
}

.kanban-dark-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    align-items: stretch;
}

.kanban-dark-main {
    min-width: 0;
    min-height: 0;
}

.kanban-dark-main-scroll {
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
}

.kanban-dark-sidebar {
    background: #1f2124;
    border-left: 1px solid #3c454c;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
}

.kanban-dark-title-block,
.kanban-dark-section {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.kanban-dark-section-icon {
    width: 18px;
    color: #9fadbc;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 4px;
}

.kanban-dark-title-content,
.kanban-dark-section-body {
    flex: 1;
    min-width: 0;
}

.kanban-dark-title-input {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #f4f5f7;
    font-size: 2rem;
    font-weight: 700;
    outline: none;
}

.kanban-dark-title-input:focus,
.kanban-dark-input:focus,
.kanban-dark-textarea:focus {
    border-color: #579dff;
    box-shadow: 0 0 0 2px rgba(87, 157, 255, 0.2);
}

.kanban-dark-toolbar {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.kanban-dark-toolbar-btn,
.kanban-dark-property-action,
.kanban-dark-quiet-btn,
.kanban-dark-primary-btn,
.kanban-dark-danger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid #454b52;
    border-radius: 8px;
    background: #2d3035;
    color: #d0d4db;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.kanban-dark-toolbar-btn:focus-visible,
.kanban-dark-property-action:focus-visible,
.kanban-dark-quiet-btn:focus-visible,
.kanban-dark-primary-btn:focus-visible,
.kanban-dark-danger-btn:focus-visible,
.kanban-dark-icon-btn:focus-visible {
    outline: 2px solid rgba(87, 157, 255, 0.85);
    outline-offset: 2px;
}

.kanban-dark-property-action {
    padding: 6px 10px;
    font-size: 0.82rem;
}

.kanban-dark-primary-btn {
    background: #579dff;
    border-color: #579dff;
    color: #091e42;
}

.kanban-dark-primary-btn:hover {
    background: #85b8ff;
    border-color: #85b8ff;
    color: #091e42;
}

.kanban-dark-quiet-btn {
    background: transparent;
    border-color: transparent;
}

.kanban-dark-danger-btn {
    background: #55373a;
    border-color: #714248;
    color: #ffb3c1;
}

.kanban-dark-danger-btn:hover {
    background: #6d3d44;
    border-color: #8a5058;
}

.kanban-dark-popover-layer {
    position: relative;
}

.kanban-dark-popover {
    position: absolute;
    top: 14px;
    left: 0;
    z-index: 30;
    width: 304px;
    display: none;
    background: #2b2d31;
    border: 1px solid #3c454c;
    border-radius: 10px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.kanban-dark-popover-compact {
    width: 220px;
}

.kanban-dark-popover-right {
    left: auto;
    right: 20px;
}

.kanban-dark-popover-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #3c454c;
}

.kanban-dark-popover-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #dfe1e6;
}

.kanban-dark-popover-subtitle {
    font-size: 0.72rem;
    font-weight: 700;
    color: #9fadbc;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.kanban-dark-popover-close {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #9fadbc;
    cursor: pointer;
}

.kanban-dark-popover-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kanban-dark-menu-item {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #dfe1e6;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.kanban-dark-menu-item:hover {
    background: #36393f;
    border-color: #47515a;
}

.kanban-dark-menu-item-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #4b5258;
    border-radius: 8px;
    color: #d0d4db;
}

.kanban-dark-menu-item strong {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: #f4f5f7;
}

.kanban-dark-menu-item span {
    display: block;
    margin-top: 2px;
    font-size: 0.85rem;
    color: #9fadbc;
    line-height: 1.35;
}

.kanban-dark-input,
.kanban-dark-textarea,
.kanban-dark-popover select {
    width: 100%;
    border: 1px solid #4b5258;
    border-radius: 8px;
    background: #222428;
    color: #f4f5f7;
    font: inherit;
    outline: none;
}

.kanban-dark-input,
.kanban-dark-popover select {
    min-height: 42px;
    padding: 0 12px;
}

.kanban-dark-textarea {
    min-height: 76px;
    padding: 12px;
    resize: vertical;
}

.kanban-dark-properties {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    margin-top: 18px;
}

.kanban-dark-property-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kanban-dark-property-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #9fadbc;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.kanban-dark-property-values {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.kanban-dark-member {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    background: #2f3338;
    border: 1px solid #444b53;
    color: #f4f5f7;
    font-size: 0.85rem;
    font-weight: 600;
}

.kanban-dark-member-avatar {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #5e4db2;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
}

.kanban-dark-property-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
}

.kanban-dark-date-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border: 1px solid #444b53;
    border-radius: 8px;
    background: #2f3338;
    color: #dfe1e6;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.kanban-dark-date-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.kanban-dark-date-badge.warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f8c35d;
}

.kanban-dark-date-badge.danger {
    background: rgba(239, 68, 68, 0.2);
    color: #ff8f8f;
}

.kanban-dark-date-badge.success {
    background: rgba(34, 197, 94, 0.18);
    color: #86efac;
}

.kanban-dark-section-head,
.kanban-dark-sidebar-head,
.kanban-dark-checklist-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.kanban-dark-section-title,
.kanban-dark-sidebar-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: #dfe1e6;
    font-size: 1rem;
    font-weight: 700;
}

.kanban-dark-description {
    min-height: 86px;
}

.kanban-dark-description-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kanban-dark-description-view {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid #3c454c;
    border-radius: 12px;
    background: #222428;
}

.kanban-dark-description-view-content {
    min-width: 0;
    flex: 1;
    color: #f4f5f7;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.kanban-dark-description-view-content h1,
.kanban-dark-description-view-content h2,
.kanban-dark-description-view-content h3,
.kanban-dark-description-view-content h4,
.kanban-dark-description-view-content h5,
.kanban-dark-description-view-content h6 {
    margin: 0 0 0.35rem;
}

.kanban-dark-description-view-content p {
    margin: 0;
}

.kanban-dark-description-view-content blockquote {
    margin: 0;
    padding-left: 12px;
    border-left: 3px solid #579dff;
    color: #cfd7e3;
}

.kanban-dark-description-view-content ul,
.kanban-dark-description-view-content ol {
    margin: 0.35rem 0 0;
    padding-left: 20px;
}

.kanban-dark-description-view-content img {
    max-width: 100%;
    border-radius: 10px;
}

.kanban-dark-description-edit-btn,
.kanban-dark-description-add-btn {
    align-self: flex-start;
}

.kanban-dark-rich-editor {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kanban-dark-rich-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid #3c454c;
    border-radius: 12px;
    background: #222428;
    flex-wrap: wrap;
}

.kanban-dark-toolbar-icon-btn {
    min-height: 36px;
    padding: 7px 10px;
    border-radius: 8px;
    line-height: 1;
}

.kanban-dark-toolbar-separator {
    width: 1px;
    height: 24px;
    background: #3c454c;
    margin: 0 2px;
}

.kanban-dark-toolbar-spacer {
    flex: 1;
    min-width: 8px;
}

.kanban-dark-rich-editor-content {
    min-height: 180px;
    padding: 14px 16px;
    border: 1px solid #3c454c;
    border-radius: 12px;
    background: #222428;
    color: #f4f5f7;
    outline: none;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-y: auto;
}

.kanban-dark-rich-editor-content:focus {
    border-color: #579dff;
    box-shadow: 0 0 0 2px rgba(87, 157, 255, 0.2);
}

.kanban-dark-rich-editor-content:empty::before {
    content: attr(data-placeholder);
    color: #9fadbc;
    pointer-events: none;
}

.kanban-dark-rich-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.kanban-dark-progress-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.kanban-dark-progress {
    flex: 1;
    height: 8px;
    border-radius: 999px;
    background: #3c454c;
    overflow: hidden;
}

.kanban-dark-progress-fill {
    height: 100%;
    width: 0;
    background: #579dff;
    transition: width 0.25s ease;
}

.kanban-dark-checklist-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kanban-dark-checklist-new {
    margin-top: 10px;
}

.kanban-dark-checklist-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.kanban-dark-checklist-meta {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    color: #9fadbc;
    font-size: 0.88rem;
}

.kanban-dark-checklist-meta button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

#kanban-new-checklist-item {
    min-height: 44px;
    height: 44px;
    padding-top: 10px;
    padding-bottom: 10px;
    resize: vertical;
}

.kanban-dark-details {
    display: none;
    padding: 12px 14px;
    border: 1px solid #394048;
    border-radius: 10px;
    background: #24272b;
}

.kanban-dark-details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.kanban-dark-details-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.82rem;
}

.kanban-dark-details-row span:first-child {
    color: #9fadbc;
}

.kanban-dark-comment-box {
    min-height: 44px;
}

.kanban-dark-activity-feed {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 180px;
    overflow-y: auto;
    padding-right: 4px;
}

.kanban-dark-comment-card {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.kanban-dark-comment-body {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kanban-dark-comment-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.kanban-dark-comment-time {
    color: #579dff;
    font-size: 0.8rem;
    text-decoration: none;
}

.kanban-dark-comment-bubble {
    display: inline-flex;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 12px;
    background: #2a2d31;
    border: 1px solid #394048;
    color: #dfe1e6;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.kanban-dark-comment-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #9fadbc;
    font-size: 0.85rem;
}

.kanban-dark-comment-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: none;
    background: transparent;
    color: #9fadbc;
    cursor: pointer;
    padding: 0;
}

.kanban-dark-comment-action:hover {
    color: #f4f5f7;
}

.kanban-dark-comment-action.danger:hover {
    color: #ffb3c1;
}

.kanban-dark-comment-separator {
    color: #5f6b76;
}

.kanban-dark-comment-edit {
    min-height: 88px;
    resize: vertical;
}

.kanban-dark-comment-edit-actions {
    margin-top: 0;
}

.kanban-dark-activity-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.kanban-dark-activity-avatar {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
}

.kanban-dark-activity-avatar.comment {
    background: #5e4db2;
}

.kanban-dark-activity-avatar.activity {
    background: #0f766e;
}

.kanban-dark-activity-body {
    min-width: 0;
    font-size: 0.96rem;
    line-height: 1.35;
    color: #dfe1e6;
}

.kanban-dark-activity-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    font-size: 0.76rem;
    color: #8da2b5;
}

.kanban-dark-activity-remove {
    margin-left: auto;
    border: none;
    background: transparent;
    color: #9fadbc;
    cursor: pointer;
}

.kanban-dark-empty-state {
    padding: 20px 12px;
    text-align: center;
    color: #8da2b5;
    font-size: 0.88rem;
}

.kanban-dark-swatch-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.kanban-dark-swatch {
    height: 34px;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
}

.kanban-dark-swatch.active {
    border-color: #fff;
}

.kanban-dark-hidden-submit {
    display: none;
}

.kanban-dark-popover-note {
    font-size: 0.8rem;
    color: #9fadbc;
    line-height: 1.4;
}

.kanban-dark-inline-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
}

.kanban-dark-checklist-item-title {
    cursor: pointer;
}

.kanban-dark-checklist-item-title:hover {
    text-decoration: underline;
}

.kanban-dark-inline-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #24272b;
    border: 1px solid #394048;
    color: #dfe1e6;
    cursor: pointer;
}

.kanban-dark-inline-option .ph-pencil-simple {
    margin-left: auto;
    color: #9fadbc;
}

.kanban-dark-inline-option label {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    cursor: pointer;
}

.kanban-dark-inline-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #579dff;
}

.kanban-dark-inline-muted {
    font-size: 0.82rem;
    color: #9fadbc;
}

.kanban-dark-inline-split {
    display: grid;
    grid-template-columns: 1fr 110px;
    gap: 10px;
}

.kanban-dark-inline-actions {
    display: flex;
    gap: 10px;
}

@media (max-width: 960px) {
    .kanban-dark-modal {
        height: 95vh;
        max-height: 95vh;
    }

    .kanban-dark-form {
        grid-template-columns: 1fr;
    }

    .kanban-dark-sidebar {
        border-left: none;
        border-top: 1px solid #3c454c;
    }

    .kanban-dark-main-scroll,
    .kanban-dark-sidebar {
        height: auto;
        overflow-y: auto;
    }
}

@media (max-width: 768px) {
    .kanban-dark-modal-header,
    .kanban-dark-main-scroll,
    .kanban-dark-sidebar {
        padding-left: 16px;
        padding-right: 16px;
    }

    .kanban-dark-main-scroll {
        gap: 22px;
    }

    .kanban-dark-title-input {
        font-size: 1.5rem;
    }

    .kanban-dark-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .kanban-dark-toolbar-btn,
    .kanban-dark-property-action,
    .kanban-dark-primary-btn,
    .kanban-dark-quiet-btn,
    .kanban-dark-danger-btn {
        width: 100%;
        justify-content: flex-start;
    }

    .kanban-dark-header-actions {
        width: 100%;
    }

    .kanban-dark-header-btn {
        width: auto;
        justify-content: center;
    }

    .kanban-dark-popover {
        width: min(100%, 320px);
    }

    .kanban-dark-properties {
        flex-direction: column;
        gap: 16px;
    }

    .kanban-dark-checklist-meta {
        margin-left: 0;
        width: 100%;
        justify-content: space-between;
    }

    .kanban-dark-inline-split {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .kanban-card-grid {
        grid-template-columns: 1fr;
    }
}

.sidebar-btn {
    width: 100%;
    justify-content: flex-start;
    padding: 0.5rem 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    background: rgba(255,255,255,0.03);
    border: none;
}
.sidebar-btn:hover {
    background: rgba(255,255,255,0.1);
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: rgba(15,23,42,0.4);
    border-radius: 6px;
}
.checklist-item.done span {
    text-decoration: line-through;
    color: var(--text-muted);
}
/* Estilos Adicionais para Melhorias no Kanban */
.kanban-card {
    position: relative;
    overflow: visible;
    z-index: 0;
}

.kanban-card:hover,
.kanban-card:focus-within {
    z-index: 20;
}

.kanban-card-check {
    position: absolute;
    left: 0.9rem;
    top: 1rem;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-light);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    z-index: 10;
}

.kanban-card-check:hover {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.kanban-card.done .kanban-card-check {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.kanban-card.done .kanban-card-check::after {
    content: '\2713';
    font-size: 10px;
}

.kanban-card.done .kanban-card-title {
    text-decoration: line-through;
    opacity: 0.6;
}

.kanban-card.done {
    opacity: 0.9;
}

.kanban-card.done .kanban-card-cover {
    filter: saturate(0.75);
    opacity: 0.9;
}

.kanban-card.done .kanban-card-body {
    opacity: 0.9;
}

.kanban-card-menu-btn {
    position: absolute;
    right: 0.65rem;
    top: 0.65rem;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #dfe1e6;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: var(--transition);
    z-index: 10;
}

.kanban-card-menu-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.kanban-card-cover {
    height: 38px;
    border-radius: 16px 16px 0 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
}

.kanban-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding: 0.85rem 0.85rem 0.9rem 2.55rem;
    min-height: 62px;
}

.kanban-card-title {
    font-size: 0.92rem;
    font-weight: 700;
    margin: 0;
    color: #dfe1e6;
    line-height: 1.25;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.kanban-card-meta-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.5rem;
}

.kanban-card-meta {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    min-width: 0;
    color: #8da2b5;
}

.kanban-card-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.78rem;
    line-height: 1;
}

.kanban-card-meta-item .ph {
    font-size: 0.92rem;
}

.kanban-card-meta-item.late {
    color: var(--danger);
}

.kanban-card-members {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    padding-left: 0.25rem;
}

.kanban-card-member-avatar {
    width: 30px;
    height: 30px;
    margin-left: -8px;
    border: 2px solid #23262d;
    border-radius: 999px;
    background: #5e4db2;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.kanban-card-member-avatar:first-child {
    margin-left: 0;
}

.kanban-card-dropdown {
    position: absolute;
    right: 0.5rem;
    top: 2.5rem;
    background: #2b2d31;
    border: 1px solid #3c454c;
    border-radius: 14px;
    box-shadow: var(--shadow-float);
    z-index: 100;
    min-width: 230px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    padding: 0.35rem;
    gap: 0.15rem;
}

.kanban-card-dropdown.active {
    display: flex;
}

.kanban-card-dropdown button {
    background: rgba(255,255,255,0.02);
    border: none;
    padding: 0.65rem 0.85rem;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    font-size: 0.88rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 10px;
}

.kanban-card-dropdown button:hover {
    background: rgba(255, 255, 255, 0.06);
}

.kanban-card-dropdown button.danger {
    color: var(--danger);
}

.kanban-card-dropdown button.danger:hover {
    background: var(--danger-bg);
}

.kanban-card-dropdown button.action-accent {
    color: var(--primary);
}

.kanban-card-dropdown button.action-accent:hover {
    background: rgba(59, 130, 246, 0.08);
}

.archived-board {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: var(--space-lg);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-md);
    align-content: flex-start;
}

.archived-card {
    border: 1px solid var(--border-light);
    border-radius: 14px;
    background: var(--bg-surface);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: var(--shadow-sm);
}

.archived-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.archived-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
}

.archived-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.archived-card-body {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.45;
    min-height: 40px;
}

.archived-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.archived-card-actions .btn {
    flex: 1;
    min-width: 110px;
}

.archived-empty {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    border: 1px dashed var(--border-light);
    border-radius: 14px;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.02);
}

.kanban-inline-add-container {
    padding: 0.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.kanban-inline-add-input {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--primary);
    border-radius: 6px;
    padding: 0.75rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.kanban-inline-add-actions {
    display: flex;
    gap: 0.5rem;
}

/* Estilos para Listas no Kanban */
.kanban-list.dragging-list {
    opacity: 0.4;
    border: 2px dashed var(--primary) !important;
    background: rgba(59, 130, 246, 0.05) !important;
}

.kanban-list-header h3 {
    cursor: text;
    padding: 2px 4px;
    border-radius: 4px;
    transition: var(--transition);
    flex: 1;
    margin-right: 0.5rem;
}

.kanban-list-header h3:hover {
    background: rgba(255, 255, 255, 0.05);
}

.kanban-list-rename-input {
    background: var(--bg-surface-hover);
    border: 1px solid var(--primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    padding: 2px 4px;
    border-radius: 4px;
    width: 100%;
    outline: none;
}

.kanban-add-list-inline {
    min-width: 320px;
    width: 320px;
    background: rgba(15, 23, 42, 0.4);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: fit-content;
}

.kanban-add-list-inline input {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--primary);
    border-radius: 6px;
    padding: 0.75rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
}

/* =========================================================================
   AJUSTES RESPONSIVOS POR TIPO DE TELA
   Celular: ate 480px | Tablet: ate 768px | Notebook: ate 1024px
   Desktop: 1440px+ | TV: 1920px+
   ========================================================================= */

@media (max-width: 1024px) {
    .topbar {
        gap: 0.75rem;
    }

    .topbar-right {
        gap: 0.5rem;
    }

    .search-container {
        max-width: 220px;
    }

    .content-wrapper {
        max-width: 100%;
        padding: 1.5rem;
        gap: 1.5rem;
    }

    .data-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    .shortcut-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .kanban-list,
    .kanban-add-list-inline {
        min-width: 300px;
        width: 300px;
    }

    .kanban-dark-modal {
        width: min(100vw - 32px, 1120px);
    }

    .kanban-dark-modal-header,
    .kanban-dark-header-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .topbar {
        height: auto;
        min-height: 70px;
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        align-items: center;
    }

    .topbar-left,
    .topbar-right {
        width: 100%;
    }

    .topbar-right {
        justify-content: space-between;
    }

    .page-title {
        max-width: calc(100vw - 190px);
    }

    .content-wrapper {
        padding: 1rem;
        gap: 1rem;
    }

    .shortcut-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kanban-board {
        gap: 1rem;
    }

    .kanban-list,
    .kanban-add-list-inline {
        min-width: min(82vw, 320px);
        width: min(82vw, 320px);
    }

    .kanban-dark-header-actions {
        width: 100%;
        display: flex;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .topbar {
        padding: 0.75rem;
    }

    .topbar-left {
        gap: 0.75rem;
    }

    .topbar-right {
        gap: 0.35rem;
    }

    .btn-icon {
        width: 44px;
        height: 44px;
    }

    .page-title {
        max-width: 160px;
        font-size: 1rem;
    }

    .sync-status {
        font-size: 0.7rem;
        padding: 0.2rem 0.45rem;
    }

    .content-wrapper {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .section-title h2 {
        font-size: 1.35rem;
    }

    .shortcut-grid {
        grid-template-columns: 1fr;
    }

    .kanban-list,
    .kanban-add-list-inline {
        min-width: calc(100vw - 2rem);
        width: calc(100vw - 2rem);
    }

    .kanban-dark-header-actions,
    .kanban-dark-inline-actions {
        flex-direction: column;
    }

    .kanban-dark-header-btn {
        width: 100%;
    }
}

@media (min-width: 1441px) and (max-width: 1919px) {
    .content-wrapper {
        max-width: 1440px;
    }

    .data-grid {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    }

    .kanban-list,
    .kanban-add-list-inline {
        min-width: 340px;
        width: 340px;
    }
}

@media (min-width: 1920px) {
    body {
        font-size: 16px;
    }

    .sidebar {
        width: 300px;
    }

    .content-wrapper {
        max-width: 1760px;
        padding: 2.5rem;
        gap: 2.5rem;
    }

    .search-container {
        max-width: 420px;
    }

    .data-grid {
        grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
        gap: 1.5rem;
    }

    .shortcut-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    .kanban-list,
    .kanban-add-list-inline {
        min-width: 360px;
        width: 360px;
    }

    .kanban-dark-modal {
        width: min(1600px, 92vw);
    }
}

