/* ========================================================================
   ACCESS CONTROL - DESIGN ELEGANTE E MODERNO
   ======================================================================== */

.access-container {
    padding: 30px 20px;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 80px);
}

/* ========================================================================
   BOAS-VINDAS - DESIGN MINIMALISTA
   ======================================================================== */

.welcome-section {
    text-align: center;
    padding: 50px 20px;
    margin-bottom: 40px;
}

.welcome-content {
    max-width: 600px;
    margin: 0 auto;
    color: rgb(0, 0, 0);
}

.welcome-badge {
    display: inline-block;
    padding: 8px 20px;
    background:#64626233 ;
    color: #000000;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.welcome-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 12px 0;
    line-height: 1.2;
}

.welcome-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0;
}

/* ========================================================================
   TÍTULOS DE SEÇÃO
   ======================================================================== */

.section-title {
    margin-bottom: 30px;
}

.section-title h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 8px 0;
}

.section-title p {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0;
}

/* ========================================================================
   ESTATÍSTICAS RÁPIDAS - DEV
   ======================================================================== */

.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-icon.coordinators {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.stat-icon.areas {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ========================================================================
   CARDS DE AÇÃO - LIMPO E ELEGANTE
   ======================================================================== */

.action-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.action-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.action-card:hover::before {
    transform: scaleY(1);
}

.action-card:hover {
    transform: translateX(4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.action-card.featured {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
    border-color: var(--primary-color);
}

.action-card-icon {
    width: 56px;
    height: 56px;
    background: var(--hover-bg);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.action-card.featured .action-card-icon {
    background: white;
}

.action-card-content {
    flex: 1;
}

.action-card-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 6px 0;
}

.action-card-content p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.action-card-arrow {
    font-size: 24px;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.action-card:hover .action-card-arrow {
    transform: translateX(4px);
    color: var(--primary-color);
}

/* ========================================================================
   RESUMO DO COORDENADOR
   ======================================================================== */

.coordinator-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

.summary-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.summary-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.summary-icon.areas {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.summary-icon.users {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.summary-icon.admins {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.summary-data {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1;
}

.summary-text {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ========================================================================
   BARRA DE CONTROLES
   ======================================================================== */

.control-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.search-container {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-input {
    width: 100%;
    padding: 10px 14px 10px 44px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    background: var(--card-bg);
    color: var(--text-color);
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.view-toggle {
    display: flex;
    gap: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 4px;
}

.toggle-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.toggle-btn:hover {
    background: var(--hover-bg);
    color: var(--text-color);
}

.toggle-btn.active {
    background: var(--primary-color);
    color: white;
}

/* ========================================================================
   GRID DE ÁREAS
   ======================================================================== */
/* ========================================================================
   GRID / QUICK ACCESS – NOVO LAYOUT
   ======================================================================== */

   .areas-quick-access,
   .areas-grid {
       display: grid;
       grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
       gap: 20px;
       margin-top: 20px;
   }
   
   @media (max-width: 900px) {
       .areas-quick-access,
       .areas-grid {
           grid-template-columns: 1fr;
       }
   }
   
   /* ========================================================================
      CARD DE ÁREA – VISUAL NOVO
      ======================================================================== */
   
   .area-card {
       position: relative;
       background:
           radial-gradient(circle at 0 0, rgba(59, 130, 246, 0.08), transparent 55%),
           var(--card-bg);
       border-radius: 18px;
       border: 1px solid var(--border-color);
       padding: 18px 18px 14px;
       display: flex;
       flex-direction: column;
       gap: 14px;
       box-shadow: 0 14px 35px rgba(15, 23, 42, 0.08);
       transition:
           transform 0.16s ease,
           box-shadow 0.16s ease,
           border-color 0.16s ease,
           background 0.16s ease;
   }
   
   .area-card:hover {
       transform: translateY(-3px);
       box-shadow: 0 20px 45px rgba(15, 23, 42, 0.16);
       border-color: rgba(59, 130, 246, 0.45);
       cursor: pointer;
   }
   
   /* Header */
   
   .area-card-header {
       display: flex;
       align-items: flex-start;
       gap: 14px;
       position: relative;
       padding-left: 10px;
   }
   
   .area-card-header::before {
       content: "";
       position: absolute;
       left: 0;
       top: 4px;
       bottom: 4px;
       width: 4px;
       border-radius: 999px;
       background: var(--area-color, #2563eb);
   }
   
   .area-color-bar {
       display: none; /* legado */
   }
   
   .area-header-content {
       flex: 1;
   }
   
   .area-title {
       font-size: 15px;
       font-weight: 700;
       color: var(--text-color);
       margin: 0 0 4px 0;
   }
   
   .area-meta-line {
       display: flex;
       flex-wrap: wrap;
       gap: 8px;
       align-items: center;
   }
   
   .area-code {
       font-size: 11px;
       text-transform: uppercase;
       letter-spacing: 0.08em;
       padding: 3px 8px;
       border-radius: 999px;
       background: var(--hover-bg);
       color: var(--text-secondary);
   }
   
   .area-coord {
       font-size: 12px;
       padding: 3px 8px;
       border-radius: 999px;
       background: rgba(59, 130, 246, 0.08);
       color: var(--text-color);
   }
   
   .area-coord--empty {
       background: rgba(148, 163, 184, 0.16);
       color: var(--text-secondary);
   }
   
   .area-status {
       font-size: 11px;
       text-transform: uppercase;
       letter-spacing: 0.08em;
       padding: 5px 10px;
       border-radius: 999px;
       align-self: flex-start;
       background: var(--hover-bg);
       color: var(--text-secondary);
   }
   
   .area-status.active {
       background: rgba(22, 163, 74, 0.12);
       color: #15803d;
   }
   
   .area-status.inactive {
       background: rgba(239, 68, 68, 0.10);
       color: #b91c1c;
   }
   
   /* Corpo */
   
   .area-card-body {
       padding-top: 2px;
   }
   
   .area-description {
       font-size: 13px;
       color: var(--text-secondary);
       margin: 0 0 10px 0;
   }
   
   .area-stats-grid {
       display: flex;
       gap: 10px;
   }
   
   .area-stat {
       flex: 1;
       padding: 10px 12px;
       border-radius: 14px;
       background: var(--hover-bg);
       display: flex;
       align-items: center;
       gap: 10px;
   }
   
   .stat-icon {
       width: 32px;
       height: 32px;
       border-radius: 999px;
       display: flex;
       align-items: center;
       justify-content: center;
       font-size: 18px;
       background: rgba(15, 23, 42, 0.06);
   }
   
   .stat-info {
       display: flex;
       flex-direction: column;
   }
   
   .stat-value {
       font-size: 18px;
       font-weight: 700;
       color: var(--text-color);
       line-height: 1.1;
   }
   
   .stat-label {
       font-size: 11px;
       text-transform: uppercase;
       letter-spacing: 0.06em;
       color: var(--text-secondary);
   }
   
   /* Rodapé / botões */
   
   .area-card-footer {
       margin-top: 4px;
       padding-top: 10px;
       border-top: 1px dashed var(--border-color);
       display: flex;
       gap: 10px;
   }
   
   .area-btn {
       flex: 1;
       height: 38px;
       border-radius: 999px;
       border: none;
       outline: none;
       font-size: 13px;
       font-weight: 600;
       display: inline-flex;
       align-items: center;
       justify-content: center;
       gap: 6px;
       cursor: pointer;
       transition:
           transform 0.12s ease,
           box-shadow 0.12s ease,
           background 0.12s ease,
           border-color 0.12s ease;
       white-space: nowrap;
   }
   
   .area-btn.primary {
       background: linear-gradient(135deg, #2563eb, #1d4ed8);
       color: #ffffff;
       box-shadow: 0 10px 25px rgba(37, 99, 235, 0.35);
   }
   
   .area-btn.primary:hover {
       transform: translateY(-1px);
       box-shadow: 0 14px 32px rgba(37, 99, 235, 0.5);
   }
   
   .area-btn.secondary {
       background: transparent;
       color: var(--text-secondary);
       border: 1px solid var(--border-color);
   }
   
   .area-btn.secondary:hover {
       background: var(--hover-bg);
   }
/* ========================================================================
   LISTA DE COORDENADORES - PAINEL DEV
   ======================================================================== */

.coordinators-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.coordinator-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.coordinator-card-header {
    padding: 20px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
}

.coordinator-avatar-large {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.coordinator-info {
    flex: 1;
}

.coordinator-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 4px 0;
}

.coordinator-email {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.coordinator-card-body {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.coordinator-stat {
    text-align: center;
    padding: 16px;
    background: var(--hover-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.coordinator-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 4px;
}

.coordinator-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.coordinator-areas-preview {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.areas-preview-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.areas-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.area-tag {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: var(--hover-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 6px;
}

.area-tag-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.coordinator-card-footer {
    padding: 16px 20px;
    background: var(--hover-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
}

.coord-action-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.coord-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.coord-action-btn.view {
    background: #ffffff;
    color: #4f46e5;
}

.coord-action-btn.view:hover {
    background: #4f46e5;
    color: white;
}

.coord-action-btn.edit {
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.coord-action-btn.edit:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.coord-action-btn svg {
    width: 16px;
    height: 16px;
}

/* ========================================================================
   MODAL - DESIGN LIMPO
   ======================================================================== */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal.show {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-dialog {
    background: var(--card-bg);
    border-radius: 16px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: start;
}

.modal-title-group h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 4px 0;
}

.modal-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.modal-close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--hover-bg);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: #fee2e2;
    color: #991b1b;
}

.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: var(--hover-bg);
    padding: 0 24px;
}

.modal-tab {
    padding: 14px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-tab:hover {
    color: var(--text-color);
}

.modal-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-count {
    padding: 2px 8px;
    background: var(--hover-bg);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.modal-tab.active .tab-count {
    background: var(--primary-color);
    color: white;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-tab-content {
    display: none;
}

.modal-tab-content.active {
    display: block;
}

/* ========================================================================
   LISTA DE MEMBROS NO MODAL
   ======================================================================== */

.members-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--hover-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.member-item:hover {
    background: var(--card-bg);
    border-color: var(--primary-color);
}

.member-item-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.member-item-avatar.admin {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.member-item-info {
    flex: 1;
}

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

.member-item-email {
    font-size: 13px;
    color: var(--text-secondary);
}

.member-item-badge {
    padding: 4px 10px;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.member-item-badge.user {
    background: #d1fae5;
    color: #065f46;
}

/* ========================================================================
   INFORMAÇÕES DA ÁREA
   ======================================================================== */

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    background: var(--hover-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.info-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.info-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
}

.color-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-box {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.color-code {
    font-family: monospace;
    font-size: 13px;
}

/* ========================================================================
   FORMULÁRIO DE CONFIGURAÇÃO NO MODAL
   ======================================================================== */

.config-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
}

.form-input,
.form-textarea,
.form-select {
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    background: var(--card-bg);
    color: var(--text-color);
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.color-picker-group {
    display: flex;
    gap: 10px;
}

.form-color-input {
    width: 60px;
    height: 44px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-color-input:hover {
    border-color: var(--primary-color);
}

.color-picker-group .form-input {
    flex: 1;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #4f46e5;
    color: white;
}

.btn-primary:hover {
    background: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

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

/* ========================================================================
   ESTADOS ESPECIAIS
   ======================================================================== */

.loading-container {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-container p {
    font-size: 14px;
    color: var(--text-secondary);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 72px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 10px 0;
}

.empty-state p {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0;
}

/* ========================================================================
   TOAST
   ======================================================================== */

.toast {
    position: fixed;
    bottom: -100px;
    right: 24px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    min-width: 320px;
    transition: bottom 0.3s ease;
}

.toast.show {
    bottom: 24px;
}

.toast-icon {
    width: 36px;
    height: 36px;
    background: #d1fae5;
    color: #065f46;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
}

.toast-close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.toast-close:hover {
    background: var(--hover-bg);
    color: var(--text-color);
}

/* ========================================================================
   RESPONSIVIDADE
   ======================================================================== */

@media (max-width: 768px) {
    .access-container {
        padding: 20px 16px;
    }

    .welcome-section {
        padding: 40px 16px;
    }

    .welcome-title {
        font-size: 26px;
    }

    .control-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-container {
        max-width: 100%;
    }

    .view-toggle {
        justify-content: center;
    }

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

    .quick-stats {
        grid-template-columns: 1fr;
    }

    .coordinator-summary {
        grid-template-columns: 1fr;
    }

    .action-cards {
        grid-template-columns: 1fr;
    }

    .modal-dialog {
        max-height: 95vh;
    }

    .modal-tabs {
        overflow-x: auto;
        padding: 0 16px;
    }

    .toast {
        right: 16px;
        left: 16px;
        min-width: auto;
    }

    .area-card-actions {
        flex-direction: column;
    }

    .area-action-btn {
        width: 100%;
    }

    .coordinator-card-body {
        grid-template-columns: 1fr;
    }

    .coordinator-card-footer {
        flex-direction: column;
    }

    .coord-action-btn {
        width: 100%;
    }

    .areas-tags {
        flex-direction: column;
    }

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

    .form-actions {
        flex-direction: column-reverse;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================================================
   ANIMAÇÕES SUTIS
   ======================================================================== */

.access-section {
    animation: fadeInUp 0.5s ease;
}

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

.area-card,
.action-card,
.stat-card,
.summary-item {
    animation: fadeInUp 0.4s ease backwards;
}

.area-card:nth-child(1),
.action-card:nth-child(1) { animation-delay: 0.05s; }
.area-card:nth-child(2),
.action-card:nth-child(2) { animation-delay: 0.1s; }
.area-card:nth-child(3),
.action-card:nth-child(3) { animation-delay: 0.15s; }
.area-card:nth-child(4),
.action-card:nth-child(4) { animation-delay: 0.2s; }
.area-card:nth-child(5),
.action-card:nth-child(5) { animation-delay: 0.25s; }
.area-card:nth-child(6),
.action-card:nth-child(6) { animation-delay: 0.3s; }


/* ========================================================================
   ACESSO RÁPIDO ÀS ÁREAS (DEV)
   ======================================================================== */

   .areas-quick-access {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.quick-area-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-left: 4px solid;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.quick-area-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.quick-area-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.quick-area-color {
    width: 12px;
    height: 40px;
    border-radius: 4px;
    flex-shrink: 0;
}

.quick-area-info {
    flex: 1;
}

.quick-area-info h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

.quick-area-code {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: monospace;
    background: var(--hover-bg);
    padding: 2px 8px;
    border-radius: 4px;
}

.quick-area-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.quick-area-badge.active {
    background: #d1fae5;
    color: #065f46;
}

.quick-area-badge.inactive {
    background: #fee2e2;
    color: #991b1b;
}

.quick-area-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

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

.quick-area-actions {
    display: flex;
    gap: 10px;
}

.btn-quick-crm {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-quick-crm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    filter: brightness(1.1);
}

/* ========================================================================
   LOADING STATE
   ======================================================================== */

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: 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%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================================================
   EMPTY STATE
   ======================================================================== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--card-bg);
    border-radius: 12px;
    border: 2px dashed var(--border-color);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 10px 0;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* ========================================================================
   RESPONSIVIDADE
   ======================================================================== */

@media (max-width: 768px) {
    .areas-quick-access {
        grid-template-columns: 1fr;
    }
    
    .quick-area-meta {
        flex-direction: column;
        gap: 8px;
    }
}

/* ========================================================================
   CONFIGURAÇÃO DE E-MAIL - COORDENADORES
   ======================================================================== */

/* Botão de E-mail no Card */
.area-action-btn {
    margin-top: 12px;
    padding: 10px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.area-action-btn:hover {
    border-color: var(--primary-color);
    background: var(--hover-bg);
    transform: translateY(-1px);
}

.email-config-btn {
    border-color: #3b82f6;
}

.email-config-btn:hover {
    border-color: #2563eb;
    background: rgba(59, 130, 246, 0.1);
}

/* Badge de Info da Área */
.area-info-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--hover-bg);
    border-radius: 8px;
    margin-bottom: 24px;
    border: 2px solid var(--border-color);
}

.area-icon {
    font-size: 32px;
}

.area-info-text strong {
    display: block;
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.area-info-text small {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Abas */
.email-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 24px;
}

.email-tab {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.email-tab:hover {
    color: var(--text-primary);
    background: var(--hover-bg);
}

.email-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.email-tab-content {
    display: none;
}

.email-tab-content.active {
    display: block;
}

/* Formulário */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.form-hint {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.required {
    color: #ef4444;
}

/* Senha com Toggle */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper .form-input {
    padding-right: 45px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.password-toggle:hover {
    opacity: 1;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-large {
    padding: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s;
}

.checkbox-large:hover {
    border-color: var(--primary-color);
    background: var(--hover-bg);
}

/* Alertas */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
}

.alert-icon {
    font-size: 20px;
}

.alert-content {
    flex: 1;
    font-size: 13px;
}

.alert-content strong {
    display: block;
    margin-bottom: 4px;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

/* Status de Conexão */
.connection-status {
    padding: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.connection-status.testing {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

.connection-status.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.connection-status.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.status-icon {
    font-size: 24px;
}

.status-content h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.status-content p {
    font-size: 13px;
}

/* Logs */
.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.logs-list {
    max-height: 400px;
    overflow-y: auto;
}

.log-item {
    padding: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 12px;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.log-subject {
    font-weight: 600;
    color: var(--text-primary);
}

.log-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.badge-error {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.log-details {
    font-size: 13px;
    color: var(--text-secondary);
}

.log-details p {
    margin: 4px 0;
}

/* Estado Vazio */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 16px;
    font-weight: 600;
    margin: 12px 0 4px;
}

.empty-state small {
    font-size: 13px;
}

/* Botões */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background: #16a34a;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--hover-bg);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

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