/* DISTRIBUIDOR AMO APTAS - Estilos */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background-color: #141E33;
    color: white;
    min-height: 100vh;
}

.table-card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Barra superior */
.topnav {
    background-color: #141E33;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid #2D3958;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.15rem;
    font-weight: 400;
    color: #cdd6f4;
    letter-spacing: 0.2px;
}

.logo-text strong {
    font-weight: 700;
    color: white;
    margin-left: 4px;
}

.logo-circle {
    width: 30px;
    height: 30px;
    background-color: #9A3B95;
    border-radius: 50%;
    margin-right: 10px;
}

.logo-img {
    height: 36px;
    width: auto;
    margin-right: 12px;
    object-fit: contain;
}

/* Layout principal */
.main-layout {
    display: flex;
    padding: 20px;
    gap: 20px;
    min-height: calc(100vh - 80px);
}

.sidebar {
    flex: 0 0 300px;
}

.main-content {
    flex: 1;
}

/* Cards */
.side-card {
    background-color: #1B2640;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.section-header {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 10px;
}

/* Formulários */
select, input[type="text"] {
    background-color: #1B2640;
    color: white;
    border: 1px solid #2D3958;
    border-radius: 5px;
    padding: 10px;
    width: 100%;
    margin-bottom: 10px;
}

button {
    background-color: #6B50A3;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #7B60B3;
}

.status-button {
    margin: 5px;
    padding: 8px 16px;
}

.status-button.disponivel {
    background-color: #4CAF50;
}

.status-button.indisponivel {
    background-color: #FF3B3B;
}

.update-button {
    width: 100%;
    background-color: #1B2640;
    border: 1px solid #2D3958;
    margin-top: 10px;
}

/* Estatísticas */
.stats-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 10px 0;
}

.progress-container {
    width: 100%;
    background-color: #2D3958;
    border-radius: 5px;
    height: 8px;
    margin: 5px 0;
}

.progress-bar {
    height: 100%;
    border-radius: 5px;
    transition: width 0.3s ease;
}

.progress-disponivel {
    background-color: #4CAF50;
}

.progress-indisponivel {
    background-color: #9A3B95;
}

/* Tabela */
.data-table {
    width: 100%;
    background-color: #1B2640;
    border-collapse: collapse;
    border-radius: 10px;
    overflow: hidden;
}

.data-table th {
    background-color: #141E33;
    color: #8B93A7;
    text-align: left;
    padding: 12px;
    font-weight: bold;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #2D3958;
}

.data-table tr:hover {
    background-color: #2D3958;
}

/* Status badges */
.status-badge {
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    text-align: center;
    display: inline-block;
    min-width: 120px;
}

.status-badge.disponivel {
    background-color: #4CAF50;
}

.status-badge.indisponivel {
    background-color: #FF3B3B;
}

/* Tipo badges */
.tipo-badge {
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    text-align: center;
    display: inline-block;
    min-width: 80px;
}

.tipo-badge.geral {
    background-color: #9A3B95;
}

.tipo-badge.clt {
    background-color: #6B50A3;
}

.tipo-badge.aptas {
    background-color: #4CAF50;
}

.tipo-badge.mix {
    background-color: #FF9800;
}

/* Frente badges */
.frente-badge {
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    text-align: center;
    display: inline-block;
    min-width: 80px;
}

.frente-badge.sede {
    background-color: #2196F3;
}

.frente-badge.sede-filial {
    background-color: #00BCD4;
}

/* Container de tipo */
.tipo-container {
    position: relative;
    display: inline-block;
    overflow: visible;
    z-index: 1;
}

/* Container de frente */
.frente-container {
    position: relative;
    display: inline-block;
    overflow: visible;
    z-index: 1;
}

/* Menu dropdown de tipo */
.tipo-menu {
    background-color: #1B2640;
    border: 1px solid #2D3958;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 120px;
    overflow: visible;
    animation: menuSlideDown 0.2s ease-out;
    display: block;
}

/* Menu dropdown de frente */
.frente-menu {
    background-color: #1B2640;
    border: 1px solid #2D3958;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 140px;
    overflow: visible;
    animation: menuSlideDown 0.2s ease-out;
    display: block;
}

@keyframes menuSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tipo-menu-item {
    padding: 10px 15px;
    cursor: pointer;
    font-weight: bold;
    text-align: center;
    transition: all 0.2s ease;
    border-bottom: 1px solid #2D3958;
}

.tipo-menu-item:last-child {
    border-bottom: none;
}

.tipo-menu-item:hover {
    background-color: #2D3958;
    transform: scale(1.02);
}

.tipo-menu-item.active {
    background-color: rgba(154, 59, 149, 0.3);
    border-left: 3px solid #9A3B95;
}

.tipo-menu-item.geral {
    color: #9A3B95;
}

.tipo-menu-item.geral:hover {
    background-color: rgba(154, 59, 149, 0.2);
}

.tipo-menu-item.clt {
    color: #6B50A3;
}

.tipo-menu-item.clt:hover {
    background-color: rgba(107, 80, 163, 0.2);
}

.tipo-menu-item.aptas {
    color: #4CAF50;
}

.tipo-menu-item.aptas:hover {
    background-color: rgba(76, 175, 80, 0.2);
}

.tipo-menu-item.mix {
    color: #FF9800;
}

.tipo-menu-item.mix:hover {
    background-color: rgba(255, 152, 0, 0.2);
}

/* Frente menu items */
.frente-menu-item {
    padding: 10px 15px;
    cursor: pointer;
    font-weight: bold;
    text-align: center;
    transition: all 0.2s ease;
    border-bottom: 1px solid #2D3958;
}

.frente-menu-item:last-child {
    border-bottom: none;
}

.frente-menu-item:hover {
    background-color: #2D3958;
    transform: scale(1.02);
}

.frente-menu-item.active {
    background-color: rgba(33, 150, 243, 0.3);
    border-left: 3px solid #2196F3;
}

.frente-menu-item.sede {
    color: #2196F3;
}

.frente-menu-item.sede:hover {
    background-color: rgba(33, 150, 243, 0.2);
}

.frente-menu-item.sede-filial {
    color: #00BCD4;
}

.frente-menu-item.sede-filial:hover {
    background-color: rgba(0, 188, 212, 0.2);
}

/* Tipo buttons */
.tipo-button {
    margin: 5px;
    padding: 8px 16px;
}

.tipo-button.geral {
    background-color: #9A3B95;
}

.tipo-button.geral:hover {
    background-color: #8A2B85;
}

.tipo-button.clt {
    background-color: #6B50A3;
}

.tipo-button.clt:hover {
    background-color: #5B4093;
}

.tipo-button.aptas {
    background-color: #4CAF50;
}

.tipo-button.aptas:hover {
    background-color: #3B9F40;
}

.tipo-button.mix {
    background-color: #FF9800;
}

.tipo-button.mix:hover {
    background-color: #E68900;
}

/* Frente buttons */
.frente-button {
    margin: 5px;
    padding: 8px 16px;
}

.frente-button.sede {
    background-color: #2196F3;
}

.frente-button.sede:hover {
    background-color: #1976D2;
}

.frente-button.sede-filial {
    background-color: #00BCD4;
}

.frente-button.sede-filial:hover {
    background-color: #00ACC1;
}

/* Badges clicáveis */
.clickable-badge {
    transition: all 0.2s ease;
    user-select: none;
}

.clickable-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.2);
}

.clickable-badge.highlighted {
    animation: pulse 0.5s ease;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.8);
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Mensagens */
.message {
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
}

.success {
    background-color: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border: 1px solid #4CAF50;
}

.error {
    background-color: rgba(255, 59, 59, 0.2);
    color: #FF3B3B;
    border: 1px solid #FF3B3B;
}

.loading {
    text-align: center;
    color: #8B93A7;
    padding: 20px;
}

.main-header {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 20px;
}

.last-update {
    background-color: #1B2640;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 0.9rem;
    margin-bottom: 20px;
    border: 1px solid #2D3958;
}

/* Login Popup */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.login-popup {
    background-color: #1B2640;
    border-radius: 15px;
    padding: 40px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid #2D3958;
    animation: loginSlideIn 0.3s ease-out;
}

@keyframes loginSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 15px;
}

.login-logo-circle {
    width: 40px;
    height: 40px;
    background-color: #9A3B95;
    border-radius: 50%;
    margin-right: 15px;
}

.login-logo-img {
    height: 72px;
    width: auto;
    object-fit: contain;
}

.login-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    margin: 0;
}

.login-subtitle {
    color: #8B93A7;
    font-size: 0.9rem;
    margin-top: 5px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-input {
    background-color: #141E33;
    color: white;
    border: 2px solid #2D3958;
    border-radius: 8px;
    padding: 15px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.login-input:focus {
    outline: none;
    border-color: #9A3B95;
    box-shadow: 0 0 0 3px rgba(154, 59, 149, 0.1);
}

.login-input::placeholder {
    color: #8B93A7;
}

.login-button {
    background: linear-gradient(135deg, #9A3B95, #6B50A3);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 15px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.login-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #8A2B85, #5B4093);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(154, 59, 149, 0.3);
}

.login-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.login-message {
    text-align: center;
    padding: 10px;
    border-radius: 5px;
    margin-top: 15px;
    font-size: 14px;
}

.login-message.error {
    background-color: rgba(255, 59, 59, 0.2);
    color: #FF3B3B;
    border: 1px solid #FF3B3B;
}

.login-message.success {
    background-color: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border: 1px solid #4CAF50;
}

/* Blur do conteúdo principal quando login está ativo */
.content-blurred {
    filter: blur(5px);
    pointer-events: none;
}

/* Botão de logout */
.logout-button {
    background-color: transparent;
    color: #8B93A7;
    border: 1px solid #2D3958;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.logout-button:hover {
    background-color: #2D3958;
    color: white;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #8B93A7;
    font-size: 0.9rem;
}

/* ===== Abas (gestor) ===== */
.tabs {
    display: flex;
    gap: 4px;
    padding: 0 20px;
    border-bottom: 1px solid #2D3958;
    background-color: #141E33;
}

.tab {
    background: transparent;
    color: #8B93A7;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: -1px;
}

.tab:hover {
    color: #cdd6f4;
}

.tab.active {
    color: white;
    border-bottom-color: #9A3B95;
}

/* ===== Tela de Acessos ===== */
.admin-help {
    color: #8B93A7;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

#acessosTable td {
    vertical-align: middle;
}

.access-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.access-badge.ativo {
    background-color: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border: 1px solid #4CAF50;
}

.access-badge.semacesso {
    background-color: rgba(139, 147, 167, 0.2);
    color: #8B93A7;
    border: 1px solid #8B93A7;
}

.admin-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-btn {
    background-color: #2D3958;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 6px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.admin-btn:hover {
    background-color: #3D496B;
}

.admin-btn-primary {
    background: linear-gradient(135deg, #9A3B95, #6B50A3);
}

.admin-btn-primary:hover {
    background: linear-gradient(135deg, #8A2B85, #5B4093);
}

.admin-btn-danger {
    background-color: transparent;
    color: #FF6B6B;
    border: 1px solid #FF6B6B;
}

.admin-btn-danger:hover {
    background-color: rgba(255, 107, 107, 0.15);
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    padding: 20px;
}

.modal-content {
    background-color: #1B2640;
    border: 1px solid #2D3958;
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.modal-header h3 {
    color: white;
    margin: 0;
    font-size: 1.2rem;
}

.modal-close {
    background: transparent;
    color: #8B93A7;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 6px;
}

.modal-close:hover {
    color: white;
}

.modal-subtitle {
    color: #8B93A7;
    font-size: 0.9rem;
    margin-bottom: 18px;
}

#accessModalForm label {
    display: block;
    color: #cdd6f4;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 12px 0 6px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.modal-btn-primary,
.modal-btn-secondary {
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn-primary {
    background: linear-gradient(135deg, #9A3B95, #6B50A3);
    color: white;
}

.modal-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #8A2B85, #5B4093);
}

.modal-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.modal-btn-secondary {
    background-color: transparent;
    color: #8B93A7;
    border: 1px solid #2D3958;
}

.modal-btn-secondary:hover {
    background-color: #2D3958;
    color: white;
}

/* ============================================================================
   NOVA LAYOUT v2 — Dashboard sem sidebar
   ============================================================================ */

.dashboard-view {
    padding: 24px 32px;
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.dashboard-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: white;
    margin: 0;
}

.dashboard-meta {
    display: flex;
    align-items: center;
    gap: 16px;
}

.last-update {
    background-color: #1B2640;
    color: #cdd6f4;
    border: 1px solid #2D3958;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.9rem;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    height: 38px;
    box-sizing: border-box;
}

.dashboard-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.refresh-btn-icon {
    background-color: transparent;
    color: #cdd6f4;
    border: 1px solid #2D3958;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    transition: all 0.2s ease;
}

.refresh-btn-icon:hover {
    background-color: #1B2640;
    color: white;
    border-color: #3D496B;
}

.refresh-btn-icon::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
}

.refresh-btn-icon.loading::before {
    animation: spin 0.8s linear infinite;
}

.refresh-btn:hover {
    background-color: #2D3958;
    color: white;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================================================
   Stats cards horizontais
   ============================================================================ */

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background-color: #1B2640;
    border: 1px solid #2D3958;
    border-radius: 12px;
    padding: 20px 24px;
    transition: border-color 0.2s ease;
}

.stat-card:hover {
    border-color: #3D496B;
}

.stat-total { border-left: 4px solid #6B50A3; }
.stat-disponivel { border-left: 4px solid #4CAF50; }
.stat-indisponivel { border-left: 4px solid #FF3B3B; }

.stat-label {
    color: #8B93A7;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: white;
    line-height: 1;
    margin-bottom: 6px;
}

.stat-progress {
    width: 100%;
    background-color: #2D3958;
    border-radius: 4px;
    height: 6px;
    margin-top: 8px;
    overflow: hidden;
}

.stat-progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.stat-progress-bar.disponivel { background-color: #4CAF50; }
.stat-progress-bar.indisponivel { background-color: #FF3B3B; }

.stat-percent {
    text-align: right;
    color: #cdd6f4;
    font-size: 0.85rem;
    margin-top: 4px;
}

/* ============================================================================
   Tabela melhorada — zebra, sort, hover
   ============================================================================ */

.table-card {
    background-color: #1B2640;
    border: 1px solid #2D3958;
    border-radius: 12px;
    padding: 20px;
}

.search-input {
    background-color: #141E33 !important;
    color: white;
    border: 1px solid #2D3958 !important;
    border-radius: 8px;
    padding: 12px 16px !important;
    width: 100%;
    margin-bottom: 16px !important;
    font-size: 0.95rem;
}

.search-input::placeholder { color: #8B93A7; }
.search-input:focus { outline: none; border-color: #9A3B95 !important; }

.data-table tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 26px;
}

.data-table th.sortable:hover { color: white; }

.data-table th.sortable::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 6px solid currentColor;
    opacity: 0.35;
}

.data-table th.sortable.sort-asc::after {
    border-top: none;
    border-bottom: 6px solid #9A3B95;
    opacity: 1;
}

.data-table th.sortable.sort-desc::after {
    border-top: 6px solid #9A3B95;
    opacity: 1;
}

/* ============================================================================
   Topnav role badge
   ============================================================================ */

.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.role-badge.gestor {
    background-color: rgba(154, 59, 149, 0.25);
    color: #d68bd1;
    border: 1px solid #9A3B95;
}

.role-badge.colaborador {
    background-color: rgba(33, 150, 243, 0.2);
    color: #7ebef5;
    border: 1px solid #2196F3;
}

/* ============================================================================
   Status menu (clone do tipo-menu)
   ============================================================================ */

.status-menu {
    background-color: #1B2640;
    border: 1px solid #2D3958;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 150px;
    overflow: visible;
    animation: menuSlideDown 0.2s ease-out;
}

.status-menu-item {
    padding: 10px 15px;
    cursor: pointer;
    font-weight: bold;
    text-align: center;
    transition: all 0.2s ease;
    border-bottom: 1px solid #2D3958;
}

.status-menu-item:last-child { border-bottom: none; }

.status-menu-item:hover {
    background-color: #2D3958;
    transform: scale(1.02);
}

.status-menu-item.active {
    background-color: rgba(154, 59, 149, 0.3);
    border-left: 3px solid #9A3B95;
}

.status-menu-item.disponivel { color: #4CAF50; }
.status-menu-item.disponivel:hover { background-color: rgba(76, 175, 80, 0.2); }
.status-menu-item.indisponivel { color: #FF6B6B; }
.status-menu-item.indisponivel:hover { background-color: rgba(255, 107, 107, 0.2); }

/* ============================================================================
   Mensagens (com close button + persistente em erro)
   ============================================================================ */

.messages-area {
    margin-bottom: 16px;
}

.message {
    background-color: #1B2640;
    color: white;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    animation: msgSlide 0.25s ease-out;
}

@keyframes msgSlide {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.message.success {
    background-color: rgba(76, 175, 80, 0.15);
    border-left: 3px solid #4CAF50;
}

.message.error {
    background-color: rgba(255, 59, 59, 0.15);
    border-left: 3px solid #FF3B3B;
}

.message-close {
    background: transparent;
    color: inherit;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.6;
    padding: 0 4px;
    line-height: 1;
}

.message-close:hover { opacity: 1; }

/* ============================================================================
   View Colaborador (enriquecida)
   ============================================================================ */

.colab-card {
    background-color: #1B2640;
    border: 1px solid #2D3958;
    border-radius: 16px;
    max-width: 520px;
    margin: 0 auto;
    padding: 40px 32px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.colab-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 24px;
}

.colab-status-wrap {
    margin-bottom: 28px;
}

.colab-status {
    font-size: 1rem !important;
    padding: 10px 24px !important;
    min-width: 160px;
}

.colab-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
    justify-content: space-around;
    padding: 16px;
    background-color: #141E33;
    border-radius: 12px;
}

.colab-stat {
    flex: 1;
    text-align: center;
}

.colab-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
}

.colab-stat-label {
    font-size: 0.75rem;
    color: #8B93A7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.colab-action-btn {
    width: 100%;
    padding: 14px !important;
    font-size: 1rem !important;
}

.colab-msg {
    color: #8B93A7;
    margin-top: 20px;
    font-size: 0.9rem;
}

/* ============================================================================
   Topnav — espaçamento ajustado
   ============================================================================ */

.user-info {
    gap: 12px;
}

/* ============================================================================
   Mobile responsive
   ============================================================================ */

@media (max-width: 900px) {
    .stats-row {
        grid-template-columns: 1fr;
    }
    .dashboard-view {
        padding: 16px;
    }
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .dashboard-meta {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 600px) {
    .topnav {
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .logo {
        font-size: 1.1rem;
    }
    .logo-img {
        height: 28px;
    }
    .user-info {
        font-size: 0.8rem;
        flex-wrap: wrap;
    }
    .role-badge {
        font-size: 0.65rem;
        padding: 3px 8px;
    }
    .tabs {
        padding: 0 12px;
        overflow-x: auto;
    }
    .tab {
        padding: 10px 16px;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .data-table {
        font-size: 0.85rem;
    }
    .data-table th,
    .data-table td {
        padding: 8px 6px;
    }
    .status-badge,
    .tipo-badge,
    .frente-badge {
        min-width: auto;
        padding: 4px 10px;
        font-size: 0.75rem;
    }

    .colab-card {
        padding: 28px 20px;
    }
    .colab-stats {
        flex-direction: column;
        gap: 14px;
    }

    .modal-content {
        max-width: 100%;
        padding: 20px;
    }
    .modal-actions {
        flex-direction: column-reverse;
    }
    .modal-btn-primary,
    .modal-btn-secondary {
        width: 100%;
    }

    .admin-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ============================================================================
   Modal de novo vendedor
   ============================================================================ */

.modal-wide {
    max-width: 560px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-top: 4px;
}

.form-row.form-row-2 {
    grid-template-columns: 140px 1fr;
}

.form-row.form-row-single {
    grid-template-columns: 1fr;
}

.inline-role-badge {
    margin-left: 10px;
    vertical-align: middle;
    font-size: 0.62rem !important;
    padding: 2px 8px !important;
}

/* Remove as setinhas do input type=number */
.no-spinner::-webkit-outer-spin-button,
.no-spinner::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.no-spinner {
    -moz-appearance: textfield;
    appearance: textfield;
}

.form-col {
    display: flex;
    flex-direction: column;
}

.form-divider {
    height: 1px;
    background-color: #2D3958;
    margin: 24px 0 16px;
}

#newAgentForm select.login-input,
#newAgentForm input.login-input {
    background-color: #141E33;
    color: white;
    border: 2px solid #2D3958;
    border-radius: 8px;
    padding: 12px;
    font-size: 0.95rem;
    width: 100%;
}

#newAgentForm select.login-input {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238B93A7' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

#newAgentForm select.login-input:focus,
#newAgentForm input.login-input:focus {
    outline: none;
    border-color: #9A3B95;
}

.new-agent-btn {
    padding: 10px 18px !important;
    font-size: 0.9rem !important;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   Acessibilidade — focus visível
   ============================================================================ */

button:focus-visible,
input:focus-visible,
.clickable-badge:focus-visible,
.tab:focus-visible {
    outline: 2px solid #9A3B95;
    outline-offset: 2px;
}
