:root {
    --primary: #3D4D7A;
    --primary-hover: #4D5D8A;
    --bg-app: #f8fafc;
    --sidebar-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --white: #ffffff;
    --glass: rgba(255, 255, 255, 0.7);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-app);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 40px;
}

.nav-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-muted);
    padding: 12px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-menu a:hover {
    background-color: #f1f5f9;
    color: var(--primary);
}

.nav-menu a.active {
    background-color: #e0e7ff;
    color: var(--primary);
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    height: 70px;
    background-color: var(--glass);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
}

.search-bar {
    position: relative;
    width: 400px;
}

.search-bar i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-bar input {
    width: 100%;
    padding: 10px 16px 10px 48px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background-color: #f1f5f9;
    outline: none;
    transition: all 0.2s;
}

.search-bar input:focus {
    background-color: var(--white);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.actions {
    display: flex;
    gap: 12px;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border);
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-muted);
}

/* Kanban Area */
.kanban-area {
    padding: 40px;
    flex: 1;
    overflow-y: auto;
}

/* Custom Tabs / Segmented Control */
.tabs-nav {
    display: flex;
    background: #f1f5f9;
    padding: 6px;
    border-radius: 14px;
    margin-bottom: 30px;
    gap: 4px;
    align-self: flex-start;
}

.tab-btn {
    border: none;
    padding: 10px 24px;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.tab-btn i { font-size: 16px; }

.tab-btn.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: var(--shadow);
}

.tab-btn:hover:not(.active) {
    background: #e2e8f0;
    color: var(--text-main);
}

/* ==========================================================
   MOBILE RESPONSIVE
   ========================================================== */

/* Hamburger button — hidden on desktop */
#mobileMenuBtn {
    display: none;
}

/* Sidebar overlay — hidden by default */
#sidebarOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 999;
    backdrop-filter: blur(2px);
}
#sidebarOverlay.open {
    display: block;
}

@media (max-width: 768px) {
    /* Layout base */
    body { overflow: auto; }

    .app-container { flex-direction: column; }

    /* Sidebar becomes a slide-in drawer */
    .sidebar {
        position: fixed;
        top: 0; left: 0;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-280px);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 6px 0 24px rgba(0, 0, 0, 0.18);
    }

    /* Hamburger button */
    #mobileMenuBtn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px; height: 40px;
        border: none;
        background: transparent;
        color: var(--primary);
        font-size: 20px;
        cursor: pointer;
        border-radius: 8px;
        flex-shrink: 0;
        transition: background 0.2s;
    }
    #mobileMenuBtn:hover { background: #f1f5f9; }

    /* Main content takes full width */
    .main-content { width: 100%; }

    /* Top bar */
    .top-bar { padding: 0 14px; gap: 10px; height: 60px; }

    /* Search bar */
    .search-bar { width: 100%; max-width: none; flex: 1; }

    /* Main area padding */
    .kanban-area { padding: 14px; }

    /* Kanban columns: horizontal scroll, each column min-width */
    .kanban-board { -webkit-overflow-scrolling: touch; }
    .column { min-width: 280px; width: 280px; }

    /* Modals: full-screen style */
    .modal-content {
        width: 96vw !important;
        max-width: 96vw !important;
        max-height: 88vh;
        overflow-y: auto;
        margin: 6vh auto;
        padding: 20px 16px !important;
    }

    /* Tables: horizontal scroll */
    .data-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Inline form grids inside modals: 1 column */
    .modal-content [style*="grid-template-columns: 1fr 1fr"],
    .modal-content [style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Header toolbar stacks vertically */
    .header-tools {
        flex-direction: column !important;
        gap: 10px !important;
        align-items: stretch !important;
    }
    .view-toggle { align-self: flex-end; }

    /* Tabs nav stretches full width */
    .tabs-nav { width: 100%; }
    .tab-btn { flex: 1; justify-content: center; padding: 10px 10px; font-size: 13px; }
    .tab-btn i { font-size: 14px; }

    /* Action buttons in modal header — stack on mobile */
    .modal-content > div[style*="flex-end"] {
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* ==========================================================
   ULTRAPRECISION PRINT & PDF EXPORT
   ========================================================== */
@media print {
    /* Reset layout for full-page expansion */
    html, body {
        height: auto !important;
        overflow: visible !important;
        background: #fff !important;
        margin: 0 !important;
        padding: 0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .app-container {
        display: block !important;
        height: auto !important;
        width: 100% !important;
        overflow: visible !important;
    }

    /* Hide UI noise */
    .sidebar, 
    .top-bar, 
    .tabs-nav, 
    .modal,
    button:not(.btn-print-only) {
        display: none !important;
    }

    /* Expand main content */
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
        overflow: visible !important;
        display: block !important;
        width: 100% !important;
    }

    .kanban-area {
        padding: 10mm !important;
        height: auto !important;
        overflow: visible !important;
        display: block !important;
    }

    /* Show ALL 3 Sectors in Dashboard Export */
    .sector-container {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        margin-bottom: 20mm !important;
        page-break-before: always;
    }

    .sector-container:first-child {
        page-break-before: avoidance;
    }

    .sector-header {
        border-bottom: 2px solid #000 !important;
        padding-bottom: 5mm !important;
        margin-bottom: 8mm !important;
    }

    .sector-header h2 {
        color: #000 !important;
        font-size: 24pt !important;
    }

    /* Kanban Stack Optimization for A4 */
    .kanban-board {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }

    .column {
        width: 100% !important;
        min-width: 100% !important;
        margin-bottom: 10mm !important;
        background: #f8fafc !important;
        border: 1px solid #cbd5e1 !important;
        page-break-inside: avoid;
        display: block !important;
        min-height: auto !important;
    }

    .column-header {
        background: #e2e8f0 !important;
        padding: 4mm !important;
        border-radius: 8px 8px 0 0 !important;
    }

    .column-title {
        color: #000 !important;
        font-size: 14pt !important;
    }

    /* Card Clarity */
    .task-card {
        border: 1px solid #cbd5e1 !important;
        box-shadow: none !important;
        page-break-inside: avoid;
        margin-bottom: 4mm !important;
    }

    .task-title {
        color: #000 !important;
        font-size: 12pt !important;
    }

    /* Status Badges visibility sync */
    .status-badge {
        border: 1px solid currentColor !important;
    }
}

/* Sector Sectioning */
.sector-container {
    display: none;
}

.sector-container.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

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

.sector-header {
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.kanban-board {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 20px;
    align-items: flex-start;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.kanban-board::-webkit-scrollbar {
    height: 8px;
}

.kanban-board::-webkit-scrollbar-track {
    background: transparent;
}

.kanban-board::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 20px;
}

.column {
    background-color: #f1f5f9;
    border-radius: 16px;
    padding: 16px;
    min-height: 500px;
    width: 320px;
    min-width: 320px;
    flex-shrink: 0;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 4px;
}

.column-title {
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.column-count {
    background-color: #e2e8f0;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
    min-height: 100px;
    transition: background 0.2s;
    border-radius: 8px;
}

.task-list.drag-over {
    background-color: rgba(99, 102, 241, 0.1);
    outline: 2px dashed var(--primary);
}

.btn-add-card {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-add-card:hover {
    background: #e2e8f0;
    border-color: var(--text-muted);
    color: var(--text-main);
}

.task-card {
    background-color: var(--white);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid transparent;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.task-tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    display: inline-block;
}

.tag-producao-conteudo { background: #dcfce7; color: #166534; }
.tag-institucional { background: #e0e7ff; color: #3730a3; }
.tag-evento { background: #fef9c3; color: #854d0e; }

.task-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 12px;
    line-height: 1.4;
}

.task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
}

.task-avatars {
    display: flex;
}

.task-avatars img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid white;
    margin-left: -8px;
}

.task-avatars img:first-child { margin-left: 0; }

.task-due {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: var(--white);
    margin: 50px auto;
    padding: 30px 40px;
    border-radius: 24px;
    width: 600px;
    max-width: 95%;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    position: relative;
    scrollbar-width: thin;
}

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

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

/* Tables & Data Lists */
.data-container {
    background: var(--white);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 16px;
    color: var(--text-muted);
    font-size: 13px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 20px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-active { background: #dcfce7; color: #166534; }
.status-pending { background: #fef9c3; color: #854d0e; }
.status-overdue { background: #fee2e2; color: #991b1b; }
.status-briefing { background: #e0e7ff; color: #3730a3; }
.status-roteiro { background: #fef9c3; color: #854d0e; }
.status-captação { background: #dcfce7; color: #166534; }

/* Team Grid */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.member-card {
    background: var(--white);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.member-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.btn-edit-mini:hover {
    color: var(--primary) !important;
}

.member-card:hover { transform: translateY(-5px); }

.member-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 16px;
}

.member-name { font-weight: 700; font-size: 18px; margin-bottom: 4px; }
.member-role { color: var(--text-muted); font-size: 14px; margin-bottom: 16px; }

/* Schedule/Calendar */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.calendar-day {
    background: var(--white);
    min-height: 120px;
    padding: 12px;
}

.day-header { font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }

/* View Toggle Buttons */
.view-toggle {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 8px;
    gap: 2px;
}

.btn-toggle {
    border: none;
    background: transparent;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.btn-toggle.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* List View Styles */
.list-view-container {
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.list-table {
    width: 100%;
    border-collapse: collapse;
}

.list-table th {
    text-align: left;
    padding: 12px 20px;
    background: #f8fafc;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.list-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}

.list-table tr:last-child td {
    border-bottom: none;
}

.list-table tr:hover {
    background: #f8fafc;
}

/* Reports */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--white);
    padding: 24px;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.stat-label { color: var(--text-muted); font-size: 14px; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--primary); }

.chart-placeholder {
    height: 300px;
    background: #f1f5f9;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border: 2px dashed var(--border);
}

/* Login Page Styles */
.login-body {
    background: linear-gradient(135deg, #3D4D7A 0%, #1e293b 100%);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    width: 400px;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.login-header {
    margin-bottom: 32px;
}

.login-header .logo {
    justify-content: center;
    margin-bottom: 12px;
    font-size: 28px;
}

.login-header h1 {
    font-size: 20px;
    color: var(--text-main);
    font-weight: 600;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
}

.login-form .form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

.login-form input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    outline: none;
    transition: all 0.2s;
}

.login-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(61, 77, 122, 0.1);
}

.btn-login {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
}

.btn-login:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.login-error {
    background-color: #fee2e2;
    color: #991b1b;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
}
