#routrell-board-details {
    padding: 20px;
    max-width: 1600px;
    margin: 0 auto;
}

.board-details-header {
    margin-bottom: 30px;
}

.board-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

.btn-open-trello:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.board-header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.board-title-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.board-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.board-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.board-status-badge.active {
    background: #d1fae5;
    color: #065f46;
}

.board-status-badge.archived {
    background: #fee2e2;
    color: #991b1b;
}

/* Dark mode */
[data-theme="dark"] .board-status-badge.active {
    background: #064e3b;
    color: #6ee7b7;
}

[data-theme="dark"] .board-status-badge.archived {
    background: #7f1d1d;
    color: #fca5a5;
}

/* ============================================
   SECTIONS
   ============================================ */

.board-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border);
}

.section-title i {
    color: var(--primary);
}

.section-loading,
.metrics-loading {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

.empty-message {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
    font-style: italic;
}

/* ============================================
   MÉTRICAS GRID
   ============================================ */

.board-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.metric-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: all 0.2s;
}

.metric-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.metric-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--primary);
    color: white;
    font-size: 24px;
}

.metric-icon.success {
    background: #10b981;
}

.metric-icon.danger {
    background: #ef4444;
}

.metric-icon.warning {
    background: #f59e0b;
}

.metric-icon.info {
    background: #3b82f6;
}

.metric-icon.primary {
    background: var(--primary);
}

.metric-content {
    flex: 1;
}

.metric-label {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 5px;
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

/* ============================================
   GRID LAYOUTS
   ============================================ */

.board-grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.board-grid-2col-wide {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* ============================================
   LISTAS
   ============================================ */

.board-lists-container {
    display: grid;
    gap: 12px;
}

.list-card {
    padding: 15px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.2s;
}

.list-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.list-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 10px 0;
}

.list-stats {
    display: flex;
    gap: 15px;
    font-size: 13px;
}

.list-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-light);
}

.list-stat.success {
    color: #10b981;
}

.list-stat i {
    font-size: 14px;
}

/* ============================================
   MEMBROS
   ============================================ */

.board-members-container {
    display: grid;
    gap: 12px;
}

.member-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.2s;
}

.member-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.member-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    font-weight: 700;
    font-size: 18px;
}

.member-info {
    flex: 1;
}

.member-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.member-stats {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: var(--text-light);
}

.member-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.member-activity {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--surface);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

/* ============================================
   CARDS
   ============================================ */

.section-header-with-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border);
}

.section-header-with-filters .section-title {
    margin: 0;
    padding: 0;
    border: none;
}

.cards-filters {
    display: flex;
    gap: 10px;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--background);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

.board-cards-container {
    max-height: 600px;
    overflow-y: auto;
}

.cards-list {
    display: grid;
    gap: 10px;
}

.card-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    background: var(--background);
    border: 1px solid var(--border);
    border-left: 4px solid var(--border);
    border-radius: 8px;
    transition: all 0.2s;
}

.card-item:hover {
    border-left-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.card-item.overdue {
    border-left-color: #ef4444;
}

.card-item.completed {
    border-left-color: #10b981;
    opacity: 0.7;
}

.card-status-indicator {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: var(--surface);
    flex-shrink: 0;
}

.card-item.overdue .card-status-indicator {
    background: #fee2e2;
    color: #ef4444;
}

.card-item.completed .card-status-indicator {
    background: #d1fae5;
    color: #10b981;
}

[data-theme="dark"] .card-item.overdue .card-status-indicator {
    background: #7f1d1d;
    color: #fca5a5;
}

[data-theme="dark"] .card-item.completed .card-status-indicator {
    background: #064e3b;
    color: #6ee7b7;
}

.card-info {
    flex: 1;
}

.card-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--text-light);
}

.card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cards-pagination {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
}

/* ============================================
   ATIVIDADE RECENTE
   ============================================ */

.board-activity-container {
    max-height: 600px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--surface);
    color: var(--primary);
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-text {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 4px;
}

.activity-text strong {
    font-weight: 600;
}

.activity-text em {
    color: var(--primary);
    font-style: normal;
}

.activity-time {
    font-size: 12px;
    color: var(--text-light);
}

/* ============================================
   PERFORMANCE CHART
   ============================================ */

.board-performance-container {
    padding: 20px;
    background: var(--background);
    border-radius: 8px;
}

#performance-chart {
    max-height: 300px;
}

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

@media (max-width: 1200px) {
    .board-grid-2col-wide {
        grid-template-columns: 1fr;
    }
    
    .board-section-wide {
        order: -1;
    }
}

@media (max-width: 768px) {
    #routrell-board-details {
        padding: 15px;
    }
    
    .board-title {
        font-size: 22px;
    }
    
    .board-grid-2col {
        grid-template-columns: 1fr;
    }
    
    .board-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .metric-card {
        flex-direction: column;
        text-align: center;
    }
    
    .cards-filters {
        flex-direction: column;
        width: 100%;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .section-header-with-filters {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .board-metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .board-header-top {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .btn-back,
    .btn-open-trello {
        width: 100%;
        justify-content: center;
    }
}