/* ========================================================
   VARIABLES & THEME
   ======================================================== */
:root {
    --bg-primary: #0f1115;
    --bg-secondary: #1a1d24;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --accent-color: #6366f1;
    --accent-hover: #4f46e5;
    --success: #22c55e;
    --error: #ef4444;
    --border-color: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(26, 29, 36, 0.6);
}

/* ── Toast Notifications ─────────────────────────────────────────────────────── */
@keyframes toastIn {
    from { opacity: 0; transform: translateX(110%); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(110%); }
}

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    border-radius: 10px;
    background: #1e2130;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
    animation: toastIn 0.3s ease;
    pointer-events: all;
    max-width: 340px;
    min-width: 240px;
}

.toast-success { border-left: 3px solid #22c55e; }
.toast-error   { border-left: 3px solid #ef4444; }
.toast-warning { border-left: 3px solid #f59e0b; }
.toast-info    { border-left: 3px solid #6366f1; }

.toast-icon { font-size: 1rem; flex-shrink: 0; }
.toast-message { flex: 1; line-height: 1.4; }

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0 2px;
    flex-shrink: 0;
    transition: color 0.15s;
}
.toast-close:hover { color: #fff; }


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(34, 197, 94, 0.05) 0%, transparent 20%);
}

/* ── Shell / Nav Layout ─────────────────────────────────────────────────────── */
.shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.shell-content {
    display: flex;
    flex: 1;
    min-width: 0;
    gap: 30px;
    padding: 40px 20px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.shell-content--full {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    padding: 40px 32px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ── Navigation Sidebar ─────────────────────────────────────────────────────── */
.app-nav {
    width: 220px;
    flex-shrink: 0;
    background: rgba(15, 17, 21, 0.95);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
}

.nav-links {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    position: relative;
}

.nav-item:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-main);
}

.nav-item.active {
    background: rgba(99,102,241,0.15);
    color: #818cf8;
    font-weight: 600;
}

.nav-item.active svg { stroke: #818cf8; }

.nav-badge {
    margin-left: auto;
    background: #f59e0b;
    color: #000;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
}

/* ── Nav Profile ── */
.nav-profile {
    padding: 14px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-profile-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.nav-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.nav-avatar-initials {
    background: linear-gradient(135deg, var(--accent-color), #818cf8);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-profile-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.nav-profile-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-profile-role {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-logout {
    color: var(--text-muted);
    transition: color 0.15s;
    flex-shrink: 0;
    display: flex;
}
.nav-logout:hover { color: #f87171; }

/* ── Page Layout ── */
.page-container {
    width: 100%;
    max-width: 1200px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title  { font-size: 1.8rem; color: #fff; margin-bottom: 4px; }
.page-subtitle { color: var(--text-muted); font-size: 0.95rem; }

/* ── Filters Bar ── */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    backdrop-filter: blur(12px);
}

.filters-bar input[type="text"],
.filters-bar select {
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.filters-bar input[type="text"] { flex: 1; min-width: 200px; }
.filters-bar select { min-width: 150px; }
.filters-bar input:focus,
.filters-bar select:focus { border-color: var(--accent-color); }

.btn-filter {
    padding: 8px 18px;
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-filter:hover { background: var(--accent-hover); }

.btn-reset {
    padding: 8px 14px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s;
}
.btn-reset:hover { color: #fff; }

/* ── Chips ── */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid transparent;
}
.chip-total { background: rgba(99,102,241,0.15); color: #818cf8; border-color: rgba(99,102,241,0.3); }

/* ── Leads Table Card ── */
.leads-table-card {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(12px);
}
.leads-table-card .table-container { overflow-x: auto; }
.leads-table-card table { min-width: 700px; }

.toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.2s;
}
.toggle-btn.sim { background: rgba(249,115,22,0.15); color: #fb923c; border: 1px solid rgba(249,115,22,0.3); }
.toggle-btn.nao { background: rgba(34,197,94,0.1); color: #4ade80; border: 1px solid rgba(34,197,94,0.2); }
.toggle-btn:hover { opacity: 0.8; transform: scale(1.03); }

/* ── Pagination ── */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 20px 0 8px;
    flex-wrap: wrap;
}
.page-btn {
    padding: 7px 13px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.88rem;
    transition: all 0.15s;
}
.page-btn:hover { background: rgba(255,255,255,0.12); }
.page-btn.active { background: var(--accent-color); border-color: var(--accent-color); color: #fff; font-weight: 700; }
.page-btn.disabled { opacity: 0.35; pointer-events: none; }

/* ── Usuários Grid ── */
.user-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.user-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.15s;
    background: rgba(255,255,255,0.03);
}
.user-tab:hover { background: rgba(255,255,255,0.08); color: #fff; }
.user-tab.active { background: rgba(99,102,241,0.15); color: #818cf8; border-color: rgba(99,102,241,0.4); font-weight: 600; }
.tab-count {
    background: rgba(255,255,255,0.12);
    border-radius: 20px;
    padding: 1px 8px;
    font-size: 0.75rem;
}
.tab-count.pending { background: rgba(245,158,11,0.25); color: #fbbf24; }

.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.user-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.user-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.user-avatar-initials {
    background: linear-gradient(135deg, var(--accent-color), #818cf8);
    color: #fff;
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.user-card-name { font-weight: 600; font-size: 0.95rem; color: #fff; }
.user-card-email { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card-date { font-size: 0.72rem; color: rgba(148,163,184,0.6); }

.user-quick-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-approve {
    padding: 8px 16px;
    background: rgba(34,197,94,0.15);
    color: #4ade80;
    border: 1px solid rgba(34,197,94,0.3);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-approve:hover { background: rgba(34,197,94,0.25); }

.btn-block {
    padding: 8px 16px;
    background: rgba(239,68,68,0.1);
    color: #f87171;
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-block:hover { background: rgba(239,68,68,0.2); }

.user-advanced summary {
    font-size: 0.82rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 0;
    user-select: none;
}
.user-advanced summary:hover { color: var(--text-main); }
.user-advanced-body { margin-top: 10px; }

.btn-sm-accent {
    padding: 6px 14px;
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-sm-accent:hover { background: var(--accent-hover); }

/* ── app-container (mantido para backward compat) ── */
.app-container {
    display: flex;
    gap: 30px;
    width: 100%;
    max-width: 1400px;
    padding: 40px 20px;
}


/* ========================================================
   CARDS & GLASS
   ======================================================== */
.card {
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.mt-4 { margin-top: 1.5rem; }

/* ========================================================
   SIDEBAR & FORMS
   ======================================================== */
.sidebar {
    width: 320px;
    flex-shrink: 0;
    padding: 24px;
    height: fit-content;
    position: sticky;
    top: 40px;
}

.sidebar h2 {
    font-size: 1.25rem;
    margin-bottom: 24px;
    color: #fff;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .half {
    width: 50%;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: 10px;
    font-size: 1rem;
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: translateY(2px); }
.btn-primary:disabled { background: #475569; cursor: not-allowed; opacity: 0.7; }

.action-buttons-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
    width: 100%;
    margin-top: 10px;
}

.action-buttons-row .btn-primary {
    flex: 1;
    margin-top: 0;
}

.btn-stop-square {
    width: 48px;
    background: rgba(255, 95, 86, 0.1);
    color: #ff5f56;
    border: 1px solid rgba(255, 95, 86, 0.3);
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.btn-stop-square:hover:not(:disabled) {
    background: rgba(255, 95, 86, 0.2);
    border-color: rgba(255, 95, 86, 0.8);
    transform: scale(1.05);
}

.btn-stop-square:disabled {
    opacity: 0.2;
    cursor: not-allowed;
    filter: grayscale(100%);
    border-color: transparent;
}

.btn-secondary {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-secondary:hover:not(:disabled) { background: rgba(255,255,255,0.15); }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-leads-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px;
    margin-top: 10px;
    background: rgba(99, 102, 241, 0.1);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: background 0.2s, border-color 0.2s, transform 0.1s;
}
.btn-leads-nav:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.6);
    transform: translateY(-1px);
}


/* ========================================================
   MAIN CONTENT & HEADER
   ======================================================== */
.main-content {
    flex: 1;
    min-width: 0;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
}

.header-title h1 {
    font-size: 2rem;
    color: #fff;
    margin-bottom: 8px;
}

.header-title p {
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* ── Profile Menu ── */
.profile-menu {
    position: relative;
    flex-shrink: 0;
}

.profile-trigger {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    width: 44px;
    height: 44px;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-trigger:hover {
    border-color: var(--accent-color);
    transform: scale(1.05);
}

.profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.profile-initials {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-color), #818cf8);
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 260px;
    background: #1e2130;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    z-index: 100;
}

.profile-menu.open .profile-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.profile-avatar-lg {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.profile-initials-lg {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent-color), #818cf8);
    color: white;
    font-weight: 700;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.profile-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.profile-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-email {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-role {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 20px;
    width: fit-content;
}

.role-admin  { background: rgba(99,102,241,0.2); color: #818cf8; border: 1px solid rgba(99,102,241,0.3); }
.role-member { background: rgba(34,197,94,0.15); color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.role-pending { background: rgba(251,191,36,0.15); color: #fbbf24; border: 1px solid rgba(251,191,36,0.3); }
.role-blocked { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }

.profile-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0 16px;
}

.profile-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #f87171;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 0 0 12px 12px;
    transition: background 0.15s;
}

.profile-logout:hover {
    background: rgba(239,68,68,0.1);
}


/* ========================================================
   TERMINAL
   ======================================================== */
.terminal-section {
    overflow: hidden;
}

.terminal-header {
    background: #111;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #333;
}

.terminal-header .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.dot.red    { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green  { background: #27c93f; }

.terminal-header .title {
    margin-left: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: monospace;
}

.terminal-body {
    background: #000;
    padding: 16px;
    height: 250px;
    min-height: 150px;
    max-height: 800px;
    overflow-y: auto;
    resize: vertical;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.9rem;
    color: #0f0;
}

.terminal-body::-webkit-scrollbar { width: 6px; }
.terminal-body::-webkit-scrollbar-track { background: #111; }
.terminal-body::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

.log-line {
    margin-bottom: 4px;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.log-error   { color: #ff5f56; }
.log-success { color: var(--success); }
.log-warning { color: #f97316; }
.log-info    { color: #58a6ff; }

/* ========================================================
   RESULTADOS & TABELA
   ======================================================== */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 24px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 12px;
}

.header-left-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.results-header h2 { font-size: 1.1rem; color: #fff; }

.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
}

th, td {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

tr:hover td { background: rgba(255, 255, 255, 0.03); }

.empty-state { text-align: center; color: var(--text-muted); padding: 40px !important; }

.badge-yes {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    border: 1px solid rgba(34, 197, 94, 0.3);
    white-space: nowrap;
}

.badge-no {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    border: 1px solid rgba(239, 68, 68, 0.3);
    white-space: nowrap;
}

.action-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}
.action-link:hover { text-decoration: underline; }

.wa-btn {
    display: inline-flex;
    align-items: center;
    background: #128c7e;
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s;
    white-space: nowrap;
}
.wa-btn:hover { background: #075e54; }

/* ========================================================
   ESTATÍSTICAS
   ======================================================== */
.stats-dashboard {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.stat-card {
    background: rgba(20, 20, 25, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 6px 12px;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

.stat-card .stat-label {
    font-size: 0.6rem;
    color: #8b949e;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-card .stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #e6edf3;
    font-family: 'Courier New', Courier, monospace;
}

.stat-card.highlight {
    border-color: rgba(46, 213, 115, 0.3);
    background: rgba(46, 213, 115, 0.05);
}
.stat-card.highlight .stat-value { color: var(--success); }

.stat-card.highlight-orange {
    border-color: rgba(249, 115, 22, 0.3);
    background: rgba(249, 115, 22, 0.05);
}
.stat-card.highlight-orange .stat-value { color: #f97316; }

/* ── Mobile Topbar Defaults ── */
.mobile-topbar { display: none; }
.nav-overlay { display: none; }

/* ========================================================
   RESPONSIVE — TABLET (≤ 900px)
   ======================================================== */
@media (max-width: 900px) {
    .shell { flex-direction: column; }

    /* Topbar Visível */
    .mobile-topbar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: rgba(15, 17, 21, 0.95);
        border-bottom: 1px solid var(--border-color);
        padding: 12px 20px;
        position: sticky;
        top: 0;
        z-index: 90;
        backdrop-filter: blur(10px);
    }
    
    .mobile-logo { display: flex; align-items: center; gap: 8px; font-weight: 700; color: #fff; }
    
    .hamburger-btn {
        background: none;
        border: none;
        color: var(--text-main);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 4px;
    }

    /* Sidebar Fora da Tela (Off-canvas) */
    .app-nav {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 250px;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 24px rgba(0,0,0,0.5);
    }

    .app-nav.open { transform: translateX(0); }

    .nav-profile-name { display: block; }
    .nav-profile-role { display: block; }
    .nav-logo, .nav-item span { display: flex; }

    /* Overlay escuro quando o menu estiver aberto */
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0,0,0,0.5);
        backdrop-filter: blur(2px);
        z-index: 95;
        opacity: 0;
        pointer-events: none;
        display: block; /* Mas invisível */
        transition: opacity 0.3s;
    }
    .nav-overlay.open { opacity: 1; pointer-events: all; }

    /* Resto do layout */
    .shell-content {
        max-width: 100%;
        padding: 20px 16px;
        flex-direction: column;
        gap: 20px;
    }

    .shell-content--full {
        padding: 20px 16px;
    }

    .sidebar { width: 100%; position: static; }

    .header-title h1 { font-size: 1.6rem; }
    .header-title p  { font-size: 0.95rem; margin-bottom: 20px; }

    .results-header { flex-direction: column; align-items: flex-start; gap: 16px; }
    .stats-dashboard { justify-content: flex-start; width: 100%; }

    .users-grid { grid-template-columns: 1fr; }
    
    .page-header { flex-direction: column; align-items: flex-start; }
}

/* ========================================================
   RESPONSIVE — MOBILE (≤ 600px)
   ======================================================== */
@media (max-width: 600px) {
    .shell-content, .shell-content--full { padding: 16px 12px; gap: 16px; }

    /* Itens estéticos adaptados */

    .sidebar { padding: 18px; }
    .sidebar h2 { font-size: 1.1rem; }

    .header-title h1, .page-title { font-size: 1.4rem; }
    .header-title p, .page-subtitle { font-size: 0.88rem; margin-bottom: 16px; }

    .terminal-body { height: 180px; font-size: 0.8rem; }

    th, td { padding: 10px 12px; font-size: 0.85rem; }

    .stat-card { padding: 5px 8px; }
    .stat-card .stat-value { font-size: 0.95rem; }

    .btn-primary { font-size: 0.95rem; padding: 11px; }

    .filters-bar { flex-direction: column; }
    .filters-bar input[type="text"], .filters-bar select { width: 100%; }

    /* Tabela em formato de Cards no Mobile */
    table.responsive-mobile, 
    table.responsive-mobile thead, 
    table.responsive-mobile tbody, 
    table.responsive-mobile th, 
    table.responsive-mobile td, 
    table.responsive-mobile tr { 
        display: block; 
    }
    table.responsive-mobile thead { display: none; }
    
    table.responsive-mobile {
        min-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    table.responsive-mobile tr { 
        border: 1px solid var(--border-color);
        border-radius: 12px;
        margin-bottom: 16px;
        background: rgba(20,20,25,0.4);
        padding: 5px;
    }
    
    table.responsive-mobile td { 
        border: none;
        border-bottom: 1px solid rgba(255,255,255,0.05); 
        position: relative;
        padding-left: 35% !important; 
        padding-right: 12px !important;
        padding-top: 12px !important;
        padding-bottom: 12px !important;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        text-align: left;
        white-space: normal;
        word-break: break-word;
    }
    table.responsive-mobile td:last-child { border-bottom: 0; }
    
    table.responsive-mobile td::before { 
        content: attr(data-label);
        position: absolute;
        top: 50%;
        left: 12px;
        transform: translateY(-50%);
        width: 30%; 
        padding-right: 10px; 
        white-space: normal; /* allow label to wrap if needed */
        word-break: break-word; /* allow label to wrap if needed */
        text-align: left;
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
        font-size: 0.75rem;
    }
}
