/* ========================================================================
   ADMIN COORDINATORS CSS - VERSÃO 2.0
   ======================================================================== */

/* ========================================
   VARIÁVEIS (herda de CRM.css)
   ======================================== */

/* ========================================
   LAYOUT DA PÁGINA
   ======================================== */

   .page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 40px;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Cabeçalho da Página */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.page-title-group {
    flex: 1;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.page-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0;
}

/* ========================================
   ESTATÍSTICAS
   ======================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.purple {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}

.stat-icon.cyan {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
}

.stat-icon.green {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ========================================
   CONTROLES
   ======================================== */

.controls-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-box .search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    background: var(--card-bg);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.filter-group {
    display: flex;
    gap: 10px;
}

.filter-select {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    background: var(--card-bg);
    color: var(--text-primary);
    cursor: pointer;
    min-width: 150px;
}

/* ========================================
   GRID DE COORDENADORES
   ======================================== */

.coordinators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 25px;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 60px 20px;
    grid-column: 1 / -1;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: var(--card-bg);
    border: 2px dashed var(--border-color);
    border-radius: 16px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 20px;
    color: var(--text-primary);
    margin: 0 0 10px 0;
}

.empty-state p {
    color: var(--text-secondary);
    margin: 0;
}

/* ========================================
   CARD DO COORDENADOR
   ======================================== */

.coordinator-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.coordinator-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.coordinator-card.inactive {
    opacity: 0.7;
}

.coordinator-card.inactive .coord-avatar {
    filter: grayscale(100%);
}

/* Header do Card */
.coord-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
    border-bottom: 1px solid var(--border-color);
}

.coord-avatar {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

.coord-info {
    flex: 1;
    min-width: 0;
}

.coord-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.coord-email {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.coord-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.coord-status.active {
    background: #d1fae5;
    color: #059669;
}

.coord-status.inactive {
    background: #fee2e2;
    color: #dc2626;
}

.dark-theme .coord-status.active {
    background: #064e3b;
    color: #34d399;
}

.dark-theme .coord-status.inactive {
    background: #450a0a;
    color: #f87171;
}

/* Body do Card */
.coord-body {
    padding: 20px;
}

/* Estatísticas do Card */
.coord-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.coord-stat {
    flex: 1;
    text-align: center;
    padding: 12px;
    background: var(--hover-bg);
    border-radius: 10px;
}

.coord-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.coord-stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Áreas do Card */
.coord-areas {
    margin-top: 15px;
}

.areas-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.area-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.area-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--hover-bg);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-primary);
}

.area-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.area-tag.more {
    background: var(--primary-color);
    color: white;
}

/* Footer do Card */
.coord-footer {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    background: var(--hover-bg);
    border-top: 1px solid var(--border-color);
}

.coord-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.coord-btn.view {
    background: #e0e7ff;
    color: #4f46e5;
    border-color: #c7d2fe;
}

.coord-btn.view:hover {
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

.coord-btn.edit {
    background: #fef3c7;
    color: #b45309;
    border-color: #fde68a;
}

.coord-btn.edit:hover {
    background: #f59e0b;
    color: white;
    border-color: #f59e0b;
}

.dark-theme .coord-btn.view {
    background: #1e1b4b;
    color: #a5b4fc;
    border-color: #3730a3;
}

.dark-theme .coord-btn.view:hover {
    background: #4f46e5;
    color: white;
}

.dark-theme .coord-btn.edit {
    background: #451a03;
    color: #fbbf24;
    border-color: #78350f;
}

.dark-theme .coord-btn.edit:hover {
    background: #f59e0b;
    color: black;
}

/* ========================================
   BOTÕES
   ======================================== */

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    padding: 12px 24px;
    background: var(--hover-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--border-color);
}

/* ========================================
   MODAIS
   ======================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-dialog {
    background: var(--card-bg);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.modal-dialog.modal-small {
    max-width: 450px;
}

.modal-dialog.modal-large {
    max-width: 700px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    background: var(--hover-bg);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

/* Tabs do Modal */
.modal-tabs {
    display: flex;
    gap: 5px;
    padding: 0 25px;
    border-bottom: 1px solid var(--border-color);
    background: var(--hover-bg);
}

.modal-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.modal-tab:hover {
    color: var(--text-primary);
}

.modal-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-count {
    padding: 2px 8px;
    background: var(--border-color);
    border-radius: 10px;
    font-size: 12px;
}

.modal-tab.active .tab-count {
    background: var(--primary-color);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ========================================
   FORMULÁRIOS
   ======================================== */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    background: var(--card-bg);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-hint {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* ========================================
   LISTA DE DETALHES
   ======================================== */

.details-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 5px 0 0 0;
}

.details-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--hover-bg);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.detail-item:hover {
    background: var(--border-color);
}

.detail-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.detail-info {
    flex: 1;
    min-width: 0;
}

.detail-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 3px;
}

/* ========================================
   TOAST
   ======================================== */

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(100px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 2000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.toast-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
}

.toast-success .toast-icon {
    background: #d1fae5;
    color: #059669;
}

.toast-error .toast-icon {
    background: #fee2e2;
    color: #dc2626;
}

.toast-warning .toast-icon {
    background: #fef3c7;
    color: #d97706;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.toast-close {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toast-close:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

/* ========================================
   RESPONSIVO
   ======================================== */

@media (max-width: 768px) {
    .page-container {
        padding: 20px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .coordinators-grid {
        grid-template-columns: 1fr;
    }
    
    .controls-bar {
        flex-direction: column;
    }
    
    .search-box {
        min-width: 100%;
    }
    
    .coord-footer {
        flex-wrap: wrap;
    }
    
    .coord-btn {
        flex: none;
        width: calc(50% - 5px);
    }
    
    .modal-dialog {
        max-width: 100%;
        margin: 10px;
    }
}