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

body {
    display: grid;
    grid-template-areas: 
        "header"
        "main"
        "footer";
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
    font-family: system-ui, -apple-system, sans-serif;
    background-color: #f0f2f5;
    color: #333;
}

header {
    grid-area: header;
    background-color: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 0.9rem;
}

.percent {
    background: #444;
    width: 150px;
    height: 8px;
    border-radius: 4px;
    display: inline-block;
    margin-left: 10px;
}

#activityBar {
    background: #2ecc71;
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s;
}

.dashboard-container {
    grid-area: main;
    display: flex;
    gap: 20px;
    padding: 20px;
    height: calc(100vh - 150px);
}

/* Estilo inicial: apenas usuários visíveis */
.dashboard-container {
    --col-users-display: flex;
    --col-tasks-display: none;
}

.column {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    overflow-y: auto;
}

#col-users {
    flex: 1.3;
}

#col-tasks {
    flex: 1;
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    display: none;
}

/* ===== CONTROLE DE VISIBILIDADE DE COLUNAS ===== */

#col-users {
    animation: slideIn 0.3s ease-out;
}

#col-tasks {
    animation: slideIn 0.3s ease-out;
}

#col-users.hidden-column {
    display: none;
    animation: slideOut 0.3s ease-out;
}

#col-tasks.hidden-column {
    display: none !important;
    animation: slideOut 0.3s ease-out;
}

#col-tasks:not(.hidden-column) {
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease-out;
}

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

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

.dashboard-container.single-view #col-users {
    flex: 1;
    border-left: none;
}

.dashboard-container.single-view #col-tasks {
    flex: 1;
    border-left: 4px solid #3498db;
}

h1 .icon {
    margin-right: 10px;
    font-style: normal;
}

.user-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 15px;
    list-style: none;
    margin-top: 20px;
}

.user-card {
    background: #fff;
    border: 2px solid #eee;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.user-card:hover {
    border-color: #3498db;
    transform: translateY(-3px);
}
.user-card.selected {
    border-color: #2ecc71;
    background-color: #f0fff4;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.2);
}

.user-id-badge {
    font-size: 0.7rem;
    background: #eee;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

.user-card h3 {
    font-size: 1rem;
    margin: 5px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-email {font-size: 0.85rem;
    color: #666;
}

.tasks-area {
    background: #e9ecef;
    padding: 8px;
    border-radius: 6px;
    text-align: center;
    font-size: 0.85rem;
}

#task-context-header {
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
}

.task-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-group, .select-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

input, select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

input:focus, select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.btnDelTask {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.2);
}

.btnDelTask:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
}

.btnDelTask:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.2);
}

button {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.2);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
    background: linear-gradient(135deg, #2980b9 0%, #1f618d 100%);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.2);
}

#taskList {
    list-style: none;
    margin-top: 15px;
    padding: 0;
}

.task-item {
    background: white;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-left: 5px solid #3498db;
    color: #333;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    width: 100%;
    box-sizing: border-box;
}

.erro {
    color: red;
    font-size: 0.85rem;
    margin-top: 5px;
    font-weight: bold;
}

.badge-cat, .badge-sub {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 5px;
    font-weight: bold;
    text-transform: uppercase;
}

.badge-cat { background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.badge-sub { background: #f3e5f5;
    color: #7b1fa2;
    border: 1px solid #e1bee7;
}

.badge-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    background-color: #eee;
}

.badge-status:contains("Concluída") {
    background-color: #d4edda;
    color: #155724;
}

.task-title {
    font-weight: 500;
    margin-left: 5px;
    display: block;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    margin-top: 5px;
}

.task-content {
    flex: 1;
    min-width: 0;
    padding-right: 10px;
}

.task-btns {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.btnEdit {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(243, 156, 18, 0.2);
}

.btnEdit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(243, 156, 18, 0.3);
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
}

.btnEdit:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(243, 156, 18, 0.2);
}

.task-item {
    padding: 12px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
}

.details-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    z-index: 1000;
    min-width: 300px;
}

.status-active {
    color: #2ecc71;
}
.status-inactive {
    color: #e74c3c;
}

.details-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.details-overlay.details-overlay-hidden {
    display: none !important;
}

.details-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    min-width: 300px;
    max-width: 500px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    position: relative;
    display: flex;
    flex-direction: column;
}

.details-card h2 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

#detailsContent {
    flex: 1;
    margin-bottom: 1.5rem;
}

#detailsContent p {
    margin: 0.8rem 0;
    font-size: 0.95rem;
}

.details-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.details-actions button {
    min-width: 150px;
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

#closeDetails {
    background-color: #95a5a6;
    color: white;
}

#closeDetails:hover {
    background-color: #7f8c8d;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

#btnRemoveUserFromModal {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

#btnRemoveUserFromModal:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
}

#btnRemoveUserFromModal:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.2);
}

#errorModal {
    margin: auto; 
    border: none;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-width: 90vw;
    width: 350px;
}

#errorModal::backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
}

#confirmModal::backdrop {
    background: rgba(0, 0, 0, 0.7);
}

#confirmModal {
    margin: auto;
    border: none;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
}

#taskModal {
    margin: auto;
    border: none;
    border-radius: 12px;
    padding: 24px;
    width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

#taskModal::backdrop {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 400px;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

#newTask {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#newTask:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

#btnCancelTask {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    padding: 9px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.2);
}

#btnCancelTask:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
}

#btnCancelTask:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.2);
}

#btnSaveTask {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    border: none;
    padding: 9px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(39, 174, 96, 0.2);
}

#btnSaveTask:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.3);
    background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
}

#btnSaveTask:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(39, 174, 96, 0.2);
}

#global-search-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    background-color: #fdfdfd;
    padding: 8px 15px;
    margin: 0 20px 15px 20px;
    border-radius: 6px;
    border: 1px solid #ddd;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

#global-search-panel h3 {
    width: auto;
    margin: 0 10px 0 0;
    color: #2c3e50;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

#global-search-panel .field {
    display: flex;
    align-items: center;
    gap: 6px;
}

#global-search-panel label {
    font-size: 0.75rem;
    color: #666;
    font-weight: 600;
}

#global-search-panel input, 
#global-search-panel select {
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.85rem;
    height: 28px;
    background: white;
}

#search-title { width: 160px; }
#search-user { width: 60px; }
#search-status { width: 120px; }

#global-search-panel input:focus, 
#global-search-panel select:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

#contadores-stats {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin: 4px 0 6px 0;
    min-height: 36px;
}

#counters-left, #counters-right { display:flex; align-items:center }

.counter-group { display:flex; gap:6px; align-items:center }
.counter-group.left { justify-content:flex-start }
.counter-group.right { justify-content:flex-end }

#contadores-stats .counter-block {
    background: rgba(255,255,255,0.95);
    padding: 4px 6px;
    border-radius: 5px;
    min-width: 56px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

#contadores-stats .counter-block .num {
    font-size: 0.9rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.2;
}

#contadores-stats .counter-block .label {
    display: block;
    font-size: 0.58rem;
    color: #7f8c8d;
    margin-top: 1px;
    line-height: 1;
}

.num-active { color: #27ae60 !important; }
.num-inactive { color: #e74c3c !important; }
.num-completed { color: #27ae60 !important; }
.num-total { color: #2c3e50 !important; }
.num-percentage { color: #8e44ad !important; }

.inline-filter { display:flex; align-items:center; gap:10px; padding:4px 8px; flex:1; background: #f4f4f4 !important; border-radius:5px !important; }
.inline-filter input, .inline-filter select { height:32px; padding:6px; font-size:0.85rem; }
.inline-filter .field input { width:140px }

#global-search-panel { padding: 10px 12px; gap:8px; }

#search-user { max-width: 160px; }

footer {
        grid-area: footer;
        background: #2c3e50;
        color: white;
        text-align: center;
        padding: 1rem;
        font-size: 0.8rem;
    }

#global-search-panel.inline-filter {
    background: #f4f4f4 !important;
    padding: 8px 15px !important;
    border-radius: 6px !important;
    display: flex !important;
    gap: 12px !important;
    align-items: center !important;
    margin: 10px 0 !important;
}

#global-search-panel label {
    font-weight: 700;
    font-size: 0.8rem;
    color: #2c3e50;
    white-space: nowrap;
    margin: 0;
}

.filter-field {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 1;
}

#search-title {
    padding: 5px;
    height: 28px;
    flex: 1;
    min-width: 100px;
}

#search-user,
#search-status {
    height: 28px;
    padding: 5px;
}

#search-user {
    flex: 0.8;
    min-width: 80px;
}

#search-status {
    flex: 0.7;
    min-width: 80px;
}

#role {
    cursor: pointer;
}

.input-group-modal {
    margin-top: 15px;
}

.input-group-modal label {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 5px;
}

#taskDeadline,
#assignSelect {
    width: 100%;
}

#assignSelect {
    min-height: 100px;
    padding: 5px;
}

.modal-buttons-custom {
    margin-top: 20px;
}

#tagFilterContainer {
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    display: none;
}

#tagFilterContainer span {
    font-size: 0.8rem;
    font-weight: bold;
    color: #666;
    margin-right: 10px;
}

#tagCloud {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 5px;
}

#btnClearFilter {
    margin-left: 10px;
    font-size: 0.75rem;
    cursor: pointer;
    border: none;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.2);
}

#btnClearFilter:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
}

#btnClearFilter:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.2);
}

#errorModal-inner {
    padding: 20px;
    text-align: center;
}

#confirmModal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

#btnConfirmAction {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    padding: 9px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.2);
}

#btnConfirmAction:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
}

#btnConfirmAction:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.2);
}

#stats-dashboard.counter-group.right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.stat-badge {
    background: #ffffff !important;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #2c3e50 !important;
    transition: transform 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-badge:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.15); }
.stat-badge strong { 
    font-size: 1.1rem; 
    color: #3498db; 
}
.stat-badge.bug { border-left: 4px solid #e74c3c !important; }
.stat-badge.global { border-left: 4px solid #f1c40f !important; }
.stat-badge.task { border-left: 4px solid #3498db !important; }

dialog { border: none; border-radius: 12px; padding: 25px; margin: auto; }
dialog::backdrop { background: rgba(0,0,0,0.6); backdrop-filter: blur(3px); }
#stats-dashboard .counter-block {
    min-width: 60px;
    border-bottom: 2px solid #3498db; 
}

#stats-dashboard .counter-block .num {
    color: #3498db;
}

@media (max-width: 1024px) {
    header {
        text-align: center;
    }

    header h1 {
        margin: 0 auto;
        text-align: center;
    }

    .dashboard-container {
        flex-direction: column;
        height: auto; 
    }

    .dashboard-container.single-view {
        flex-direction: column;
        height: auto;
    }

    .column {
        height: auto;
    }

    #contadores-stats {
        width: 100%;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        margin-bottom: 4px;
        gap: 4px;
        min-height: auto;
    }

    #counters-left, #counters-right {
        justify-content: center;
    }

    #contadores-stats .counter-block { min-width: 48px; padding: 3px 5px; font-size: 0.85rem; }
    .inline-filter { flex: 1; min-width: auto; margin:0; justify-content: center; }
    .inline-filter .field { flex: 1; }
    .inline-filter input { width: 100% !important; }

    .toggle-views {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        width: 100%;
        margin-bottom: 10px;
    }

    .toggle-btn {
        flex: 0 1 calc(50% - 4px);
        padding: 10px 12px;
        font-size: 0.8rem;
    }
}

/* ==================== ESTILOS PARA SISTEMA INFO & LOGS ==================== */

.btn-system-info {
    background: #34495e;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-right: 8px;
}

.btn-system-info:hover {
    background: #2c3e50;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-system-info:active {
    transform: translateY(0);
}

/* ===== BOTÕES DE TOGGLE USUÁRIOS/TAREFAS ===== */

.toggle-views {
    display: flex;
    gap: 5px;
    align-items: center;
}

.toggle-btn {
    padding: 8px 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.toggle-btn:hover {
    border-color: rgba(255, 255, 255, 0.6);
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.toggle-btn-active {
    background: #3498db;
    color: white;
    border-color: #3498db;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
}

.toggle-btn-active:hover {
    background: #2980b9;
    border-color: #2980b9;
}

#counters-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Modal de Informações do Sistema */
.system-info-panel {
    display: grid;
    gap: 20px;
    padding: 10px 0;
}

.info-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.info-section h3 {
    color: #2c3e50;
    margin-bottom: 12px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-section p {
    margin: 8px 0;
    color: #555;
    font-size: 0.95rem;
}

.info-section strong {
    color: #2c3e50;
    min-width: 120px;
    display: inline-block;
}

.info-section select {
    width: 100%;
    margin-top: 10px;
    padding: 8px;
}

.info-section button {
    margin-top: 10px;
    padding: 9px 16px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.2);
}

.info-section button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
    background: linear-gradient(135deg, #2980b9 0%, #1f618d 100%);
}

.info-section button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.2);
}

/* Modal Large (para logs) */
.modal-large {
    max-width: 800px;
    width: 90vw;
}

/* Controles de Logs */
.logs-controls {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 15px;
}

.logs-controls button {
    padding: 9px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.2);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
}

.btn-danger:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.2);
}

.logs-controls button:not(.btn-danger) {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.2);
}

.logs-controls button:not(.btn-danger):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
    background: linear-gradient(135deg, #2980b9 0%, #1f618d 100%);
}

.logs-controls button:not(.btn-danger):active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.2);
}

/* Painel de Logs */
.logs-panel {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 15px;
    border-radius: 6px;
    max-height: 500px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}

.logs-summary {
    background: #2d2d30;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    color: #3498db;
    font-weight: bold;
}

.log-entry {
    padding: 8px 12px;
    margin: 5px 0;
    border-left: 3px solid #555;
    background: #252526;
    border-radius: 3px;
    transition: all 0.2s;
}

.log-entry:hover {
    background: #2d2d30;
    border-left-color: #3498db;
    transform: translateX(3px);
}

.log-business {
    border-left-color: #9b59b6;
}

.log-stats {
    border-left-color: #3498db;
}

.log-task {
    border-left-color: #2ecc71;
}

.log-config {
    border-left-color: #f39c12;
}

.log-warning {
    border-left-color: #e74c3c;
    background: #3d2424;
}

.logs-empty {
    text-align: center;
    padding: 50px 20px;
    color: #999;
}

.logs-empty p {
    font-size: 1.2rem;
}

/* Scrollbar personalizada para o painel de logs */
.logs-panel::-webkit-scrollbar {
    width: 10px;
}

.logs-panel::-webkit-scrollbar-track {
    background: #1e1e1e;
}

.logs-panel::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 5px;
}

.logs-panel::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* ===== FIX: Botões Sistema / Logs sumindo ===== */

#global-search-panel {
    flex: 1;
    min-width: 260px;
}

.btn-system-info {
    white-space: nowrap;
    z-index: 2;
}

/* Responsividade para modais do sistema */
@media (max-width: 768px) {
    .modal-large {
        width: 95vw;
        max-width: none;
    }
    
    .logs-panel {
        max-height: 300px;
        font-size: 0.75rem;
    }
    
    .btn-system-info {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
    
    .info-section {
        padding: 12px;
    }
}

/* ===== PATCH FIX: Sistema / Logs invisíveis ===== */

.btn-system-info {
    white-space: nowrap;
    position: relative;
    z-index: 5;
}

/* ==================== NOVA ESTRUTURA - CONTADORES INLINE ==================== */

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #2c5f8d 0%, #1e3a5f 100%);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.section-header h2 {
    margin: 0;
    color: white;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.section-title-group small {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
}

/* Estatísticas inline (ao lado do título) */
.inline-stats {
    display: flex;
    gap: 15px;
    align-items: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 15px;
    border-radius: 6px;
    backdrop-filter: blur(10px);
    min-width: 70px;
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.stat-num {
    font-size: 1.4rem;
    font-weight: bold;
    color: white;
    line-height: 1;
}

.stat-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Cores específicas para diferentes tipos de stats */
.stat-active {
    color: #2ecc71 !important;
    text-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
}

.stat-inactive {
    color: #e74c3c !important;
    text-shadow: 0 0 10px rgba(231, 76, 60, 0.3);
}

.stat-completed {
    color: #3498db !important;
    text-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
}

.stat-percentage {
    color: #f39c12 !important;
    text-shadow: 0 0 10px rgba(243, 156, 18, 0.3);
}

/* Filtros relocados (agora dentro da section de tarefas) */
.inline-filter-relocated {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 15px;
    border-left: 4px solid #3498db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.inline-filter-relocated label {
    font-weight: 600;
    color: #2c3e50;
    min-width: 60px;
}

.inline-filter-relocated .filter-field {
    display: flex;
    gap: 10px;
    flex: 1;
}

.inline-filter-relocated input,
.inline-filter-relocated select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    flex: 1;
    transition: all 0.2s ease;
}

.inline-filter-relocated input:focus,
.inline-filter-relocated select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Esconder o input de searchTask antigo (substituído pelos filtros relocados) */
#search {
    display: none;
}

/* Ajustes no card de usuário (sem botão ativar/desativar) */
.user-card .card-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.user-card .card-actions .btnToggle {
    display: none !important;
}

.user-card .card-actions .btnRemoveUser {
    flex: 1;
    max-width: 100%;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    padding: 7px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.2);
}

.user-card .card-actions .btnRemoveUser:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
}

.user-card .card-actions .btnRemoveUser:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.2);
}

/* Ajustes nas sections - remover h2 antigos se necessário */
#col-users > h2:not(.section-header h2),
#col-tasks > #task-context-header {
    display: none;
}

/* Garantir que task-context-header não interfira */
#task-context-header {
    display: none;
}

/* Responsividade para tablets */
@media (max-width: 1024px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .inline-stats {
        width: 100%;
        justify-content: space-between;
        overflow-x: auto;
        padding-bottom: 5px;
    }

    .stat-item {
        min-width: 60px;
    }

    .stat-num {
        font-size: 1.2rem;
    }

    .stat-label {
        font-size: 0.65rem;
    }
}

/* Responsividade para mobile */
@media (max-width: 768px) {
    .section-header {
        padding: 12px 15px;
    }

    .section-header h2 {
        font-size: 1.1rem;
    }

    .inline-stats {
        gap: 8px;
        flex-wrap: wrap;
    }

    .stat-item {
        padding: 6px 10px;
        min-width: 55px;
        flex: 1 1 calc(25% - 8px);
    }

    .stat-num {
        font-size: 1rem;
    }

    .stat-label {
        font-size: 0.6rem;
    }

    .inline-filter-relocated {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 15px;
    }

    .inline-filter-relocated label {
        min-width: auto;
        margin-bottom: 5px;
    }

    .inline-filter-relocated .filter-field {
        flex-direction: column;
    }
}

/* Responsividade extra small */
@media (max-width: 480px) {
    .section-header {
        padding: 10px 12px;
    }

    .section-header h2 {
        font-size: 1rem;
    }

    .inline-stats {
        gap: 6px;
    }

    .stat-item {
        padding: 5px 8px;
        min-width: 50px;
        flex: 1 1 calc(50% - 6px);
    }

    .stat-num {
        font-size: 0.9rem;
    }

    .stat-label {
        font-size: 0.55rem;
    }
}

/* ==================== FIM DA NOVA ESTRUTURA ==================== */
/* ==================== MELHORIAS - CONTADORES GLOBAIS + ESPECÍFICOS ==================== */

/* Section header para tarefas globais */
.section-header-tasks-global {
    background: linear-gradient(135deg, #2c5f8d 0%, #1e3a5f 100%);
}

/* Header do usuário selecionado (nome + contadores específicos) */
.user-selected-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #2c5f8d 0%, #1e3a5f 100%);
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.user-selected-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.user-selected-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.user-selected-info h3 {
    margin: 0;
    color: white;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-icon {
    font-size: 1.3rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.user-selected-info small {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.75rem;
}

/* Contadores específicos do usuário (menores que os globais) */
.inline-stats-user {
    gap: 10px;
}

.stat-item-small {
    padding: 6px 12px;
    min-width: 60px;
    background: rgba(255, 255, 255, 0.2);
}

.stat-item-small .stat-num {
    font-size: 1.1rem;
}

.stat-item-small .stat-label {
    font-size: 0.65rem;
}

/* Animação quando usuário é selecionado */
@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-selected-header {
    animation: slideInFromTop 0.4s ease-out;
}

/* Estado quando nenhum usuário está selecionado */
.user-selected-header.no-user-selected {
    background: linear-gradient(135deg, #2c5f8d 0%, #1e3a5f 100%);
    opacity: 0.7;
}

.user-selected-header.no-user-selected:hover {
    transform: none;
}

/* Responsividade para tablets */
@media (max-width: 1024px) {
    .user-selected-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .inline-stats-user {
        width: 100%;
        justify-content: space-between;
    }

    .stat-item-small {
        min-width: 55px;
    }
}

/* Responsividade para mobile */
@media (max-width: 768px) {
    .user-selected-header {
        padding: 12px 15px;
    }

    .user-selected-info h3 {
        font-size: 1rem;
    }

    .user-icon {
        font-size: 1.1rem;
    }

    .inline-stats-user {
        gap: 8px;
        flex-wrap: wrap;
    }

    .stat-item-small {
        padding: 5px 10px;
        min-width: 50px;
        flex: 1 1 calc(25% - 8px);
    }

    .stat-item-small .stat-num {
        font-size: 0.95rem;
    }

    .stat-item-small .stat-label {
        font-size: 0.6rem;
    }
}

/* Responsividade extra small */
@media (max-width: 480px) {
    .user-selected-header {
        padding: 10px 12px;
    }

    .user-selected-info h3 {
        font-size: 0.9rem;
    }

    .inline-stats-user {
        gap: 6px;
    }

    .stat-item-small {
        padding: 4px 8px;
        min-width: 45px;
        flex: 1 1 calc(50% - 6px);
    }

    .stat-item-small .stat-num {
        font-size: 0.85rem;
    }

    .stat-item-small .stat-label {
        font-size: 0.55rem;
    }
}


.modal-buttons-custom {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

#btnCancelTask,
#btnSaveTask {
    min-width: 140px;
    padding: 12px 25px;
    font-weight: bold;
}

.user-selected-info h3 {
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stat-item-small {
    min-width: 65px;
    max-width: 65px;
    flex-shrink: 0;
}

/* ===== ESTILOS UNIFICADOS PARA BOTÕES - DESIGN SYSTEM ===== */

/* Classes auxiliares para diferentes tipos de botões */
.btn-primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 9px 16px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
    background: linear-gradient(135deg, #2980b9 0%, #1f618d 100%);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.2);
}

.btn-success {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 9px 16px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(39, 174, 96, 0.2);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.3);
    background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
}

.btn-success:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(39, 174, 96, 0.2);
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 9px 16px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(243, 156, 18, 0.2);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(243, 156, 18, 0.3);
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
}

.btn-warning:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(243, 156, 18, 0.2);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 9px 16px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.2);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
}

.btn-danger:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.2);
}

/* Botões pequenos - para espaços mais reduzidos */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Botões grandes - para ações principais */
.btn-lg {
    padding: 12px 20px;
    font-size: 1rem;
}

/* Desativar botões */
button:disabled,
.btn-primary:disabled,
.btn-success:disabled,
.btn-warning:disabled,
.btn-danger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Efeito de carregamento (opcional) */
button.loading {
    opacity: 0.7;
    cursor: wait;
}

/**
 * MENSAGEM CONDICIONAL DE URGÊNCIA DE TAREFAS
 */
.urgency-message {
    padding: 10px;
    margin: 10px 0;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border-left: 4px solid;
}

/* Status: Sem tarefas - Verde Claro */
.urgency-message[data-status="empty"] {
    background-color: #e8f8f5;
    color: #27ae60;
    border-left-color: #27ae60;
}

/* Status: Carga Controlada - Azul */
.urgency-message[data-status="low"] {
    background-color: #e3f2fd;
    color: #1976d2;
    border-left-color: #1976d2;
}

/* Status: Carga Aumentada - Laranja */
.urgency-message[data-status="medium"] {
    background-color: #fff3e0;
    color: #f57c00;
    border-left-color: #f57c00;
}

/* Status: Carga Crítica - Vermelho com Animação */
.urgency-message[data-status="high"] {
    background-color: #ffebee;
    color: #c62828;
    border-left-color: #c62828;
    animation: pulse-alert 2s infinite;
    font-size: 0.95rem;
}

/* Animação para alertas críticos */
@keyframes pulse-alert {
    0%, 100% {
        opacity: 1;
        background-color: #ffebee;
    }
    50% {
        opacity: 0.85;
        background-color: #ffcdd2;
    }
}
