/* ============================================================
   Bot Manager - Estilo Customizado
   ============================================================ */

:root {
    --sidebar-width: 250px;
    --sidebar-bg: #1a1d29;
    --sidebar-hover: #262a3a;
    --sidebar-active: #2d3250;
    --sidebar-text: #a0a5b8;
    --sidebar-text-active: #ffffff;
    --accent: #4f8cff;
    --accent-hover: #3a7bff;
    --topbar-bg: #ffffff;
    --content-bg: #f5f7fb;
    --card-bg: #ffffff;
    --border-color: #e8ecf1;
    --text-primary: #1a1d29;
    --text-secondary: #6b7280;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --table-hover: #f8fafc;
    --table-header: #f8fafc;
    --input-bg: #ffffff;
    --pre-bg: #f8fafc;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

body.dark-mode {
    --sidebar-bg: #0f1117;
    --sidebar-hover: #1a1d29;
    --sidebar-active: #262a3a;
    --sidebar-text: #8890a8;
    --sidebar-text-active: #e8ecf1;
    --topbar-bg: #16181f;
    --content-bg: #0d0e14;
    --card-bg: #16181f;
    --border-color: #262a3a;
    --text-primary: #e8ecf1;
    --text-secondary: #8890a8;
    --table-hover: #1a1d29;
    --table-header: #1a1d29;
    --input-bg: #1a1d29;
    --pre-bg: #1a1d29;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--content-bg);
    color: var(--text-primary);
    font-size: 0.875rem;
    overflow-x: hidden;
}

/* ============================================================
   LAYOUT
   ============================================================ */

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */

.sidebar-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo {
    font-size: 1.75rem;
    color: var(--accent);
}

.sidebar-brand {
    font-size: 1.125rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.sidebar-nav {
    list-style: none;
    padding: 0.75rem 0;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    margin: 2px 0;
}

.nav-item .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-item .nav-link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.nav-item.active .nav-link {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
    border-left-color: var(--accent);
}

.nav-item .nav-link i {
    width: 1.25rem;
    text-align: center;
    font-size: 1rem;
}

.nav-sub-list .nav-sub-item .nav-link {
    color: var(--sidebar-text);
    font-size: 0.8rem;
    padding: 0.3rem 0;
    border-left: 2px solid transparent;
}
.nav-sub-list .nav-sub-item .nav-link:hover {
    color: var(--sidebar-text-active);
}
.nav-sub-list .nav-sub-item.active .nav-link {
    color: var(--sidebar-text-active);
    border-left-color: var(--accent);
}

/* Sub-navigation inside sidebar */
.nav-sub {
    list-style: none;
    padding: 0.25rem 0 0.25rem 1.5rem;
    margin: 0;
}
.nav-sub li {
    margin: 1px 0;
}
.nav-sub li a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 400;
    border-left: 2px solid transparent;
    transition: all 0.2s ease;
    border-radius: 0 0.25rem 0.25rem 0;
}
.nav-sub li a:hover {
    color: var(--sidebar-text-active);
    background: var(--sidebar-hover);
}
.nav-sub li.active a {
    color: var(--sidebar-text-active);
    border-left-color: var(--accent);
    background: var(--sidebar-active);
}
.nav-sub li a i {
    width: 1rem;
    text-align: center;
    font-size: 0.8rem;
}

.nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 0.5rem 1.5rem;
}

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 0.5rem 0;
}

.sidebar-footer .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.5rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-footer .nav-link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.sidebar-footer .nav-link.text-danger {
    color: var(--danger) !important;
}

.sidebar-footer .nav-link.text-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171 !important;
}

.sidebar-footer .footer-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1.5rem 0.25rem;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.25);
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}
.sidebar-footer .footer-label:hover {
    color: rgba(255,255,255,0.5);
}
.sidebar-footer .footer-label .chevron {
    font-size: 0.5rem;
    transition: transform 0.2s ease;
}
.sidebar-footer .footer-group.open .footer-label .chevron {
    transform: rotate(90deg);
}
.sidebar-footer .footer-group .footer-items {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
}
.sidebar-footer .footer-group.open .footer-items {
    max-height: 300px;
}

/* ============================================================
   TOP BAR
   ============================================================ */

.top-bar {
    background: var(--topbar-bg);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-title-display {
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-toggle {
    color: var(--text-primary);
    font-size: 1.25rem;
    padding: 0;
    margin-right: 1rem;
}

/* ============================================================
   CONTENT AREA
   ============================================================ */

.content-area {
    flex: 1;
    padding: 1.5rem;
}

.footer-bar {
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--topbar-bg);
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.25rem;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 1.25rem;
}

/* ============================================================
   TABLES
   ============================================================ */

.table-container {
    overflow-x: auto;
}

.table {
    margin-bottom: 0;
    font-size: 0.8125rem;
    color: var(--text-primary);
}

.table thead th {
    background: var(--table-header);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.6875rem;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
}

.table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background: var(--table-hover);
}

/* ============================================================
   STATUS BADGES
   ============================================================ */

.status-active { color: var(--success); }
.status-invalid { color: var(--danger); }
.status-warning { color: var(--warning); }
.status-expired { color: var(--text-secondary); }
.status-unknown { color: var(--text-secondary); }

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-status::before {
    content: '';
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
}

.badge-status.active {
    background: #ecfdf5;
    color: #065f46;
}
.badge-status.active::before { background: var(--success); }

.badge-status.invalid {
    background: #fef2f2;
    color: #991b1b;
}
.badge-status.invalid::before { background: var(--danger); }

.badge-status.warning {
    background: #fffbeb;
    color: #92400e;
}
.badge-status.warning::before { background: var(--warning); }

.badge-status.expired {
    background: #f3f4f6;
    color: #4b5563;
}
.badge-status.expired::before { background: #9ca3af; }

.badge-status.unknown {
    background: #f3f4f6;
    color: #4b5563;
}
.badge-status.unknown::before { background: #9ca3af; }

/* ============================================================
   STATS CARDS
   ============================================================ */

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-icon.blue { background: #eff6ff; color: #2563eb; }
.stat-icon.green { background: #ecfdf5; color: #059669; }
.stat-icon.purple { background: #f5f3ff; color: #7c3aed; }
.stat-icon.orange { background: #fff7ed; color: #ea580c; }
.stat-icon.teal { background: #f0fdfa; color: #0d9488; }

.stat-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.stat-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

/* ============================================================
   FORMS
   ============================================================ */

.form-label {
    font-weight: 600;
    font-size: 0.8125rem;
    margin-bottom: 0.375rem;
    color: var(--text-primary);
}

.form-control, .form-select {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    background: var(--input-bg);
    color: var(--text-primary);
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.12);
}

textarea.form-control {
    font-family: 'Courier New', monospace;
    font-size: 0.8125rem;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
    font-weight: 600;
    font-size: 0.8125rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
}
.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-sm {
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
}

.btn-icon {
    padding: 0.375rem 0.5rem;
    line-height: 1;
}

.btn-group-actions {
    display: flex;
    gap: 0.25rem;
}

/* ============================================================
   CONSOLE / LOGS
   ============================================================ */

.console-container {
    background: #1a1d29;
    border-radius: 0.75rem;
    overflow: hidden;
}

.console-header {
    background: #262a3a;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.console-header h6 {
    color: #fff;
    margin: 0;
    font-size: 0.8125rem;
}

.console-body {
    padding: 1rem;
    height: 60vh;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    line-height: 1.6;
    color: #a0a5b8;
}

.console-body .log-entry {
    padding: 2px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    white-space: pre-wrap;
    word-break: break-all;
}

.console-body .log-entry .timestamp {
    color: #6b7280;
}

.console-body .log-entry .level-info { color: #60a5fa; }
.console-body .log-entry .level-warn { color: #fbbf24; }
.console-body .log-entry .level-error { color: #f87171; }
.console-body .log-entry .level-success { color: #34d399; }

/* ============================================================
   PLACEHOLDER LIST
   ============================================================ */

.placeholder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}

.placeholder-item {
    background: #f8fafc;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: var(--accent);
}

.placeholder-item small {
    display: block;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 0.6875rem;
    margin-top: 0.125rem;
}

/* ============================================================
   HEALTH BADGE
   ============================================================ */

#healthBadge {
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 767px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .content-area {
        padding: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-icon {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }

    .stat-info h3 {
        font-size: 1.25rem;
    }
}

/* ============================================================
   UTILITIES
   ============================================================ */

.text-muted { color: var(--text-secondary) !important; }
.fw-600 { font-weight: 600; }
.gap-2 { gap: 0.5rem; }

/* Botão flutuante de ação */
.floating-action {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 999;
}

.floating-action .btn {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(79, 140, 255, 0.4);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.empty-state h5 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Status card para servidor MC */
.mc-online { color: var(--success); }
.mc-offline { color: var(--danger); }

/* ============================================================
   DARK MODE OVERRIDES
   ============================================================ */

body.dark-mode .stat-icon.blue { background: #1e2a4a; color: #60a5fa; }
body.dark-mode .stat-icon.green { background: #0f2a22; color: #34d399; }
body.dark-mode .stat-icon.purple { background: #221a3d; color: #a78bfa; }
body.dark-mode .stat-icon.orange { background: #2a1f14; color: #fb923c; }
body.dark-mode .stat-icon.teal { background: #0f2a28; color: #2dd4bf; }

body.dark-mode .badge-status.active { background: #0f2a22; color: #6ee7b7; }
body.dark-mode .badge-status.invalid { background: #2a1414; color: #fca5a5; }
body.dark-mode .badge-status.warning { background: #2a2214; color: #fcd34d; }
body.dark-mode .badge-status.expired { background: #1a1d29; color: #9ca3af; }
body.dark-mode .badge-status.unknown { background: #1a1d29; color: #9ca3af; }

body.dark-mode .placeholder-item {
    background: #1a1d29;
}

body.dark-mode .table {
    --bs-table-color: var(--text-primary);
    --bs-table-bg: transparent;
    --bs-table-hover-bg: var(--table-hover);
}

body.dark-mode .nav-item.nav-section {
    padding: 0.5rem 1.2rem 0.2rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted, #666);
    cursor: default;
}

.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 10px;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 99999;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
.toast-notification.toast-success { background: #2ed573; }
.toast-notification.toast-danger { background: #ff4757; }
.toast-notification.toast-info { background: #4facfe; }

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes toastOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.table > :not(caption) > * > * {
    background: transparent;
    color: var(--text-primary);
}

body.dark-mode .table thead th {
    color: var(--text-secondary);
}

body.dark-mode .table tbody tr:hover {
    background: var(--table-hover);
}

body.dark-mode .card-header {
    color: var(--text-primary);
}

body.dark-mode .card-body {
    color: var(--text-primary);
}

body.dark-mode .accordion-item {
    color: var(--text-primary);
}

body.dark-mode .form-label {
    color: var(--text-primary);
}

body.dark-mode .btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border-color);
}
body.dark-mode .btn-outline-secondary:hover {
    background: var(--sidebar-hover);
    color: var(--text-primary);
}

body.dark-mode .btn-light {
    background: #1a1d29;
    border-color: var(--border-color);
    color: var(--text-primary);
}
body.dark-mode .btn-light:hover {
    background: var(--sidebar-hover);
}

body.dark-mode code {
    color: #f472b6;
}

body.dark-mode .alert-info {
    background: #1e2a4a;
    border-color: #2d3a6a;
    color: #93c5fd;
}

body.dark-mode .alert-danger {
    background: #2a1414;
    border-color: #3a1a1a;
    color: #fca5a5;
}

body.dark-mode .dropdown-menu {
    background: #1a1d29;
    border-color: var(--border-color);
}
body.dark-mode .dropdown-item {
    color: var(--text-primary);
}
body.dark-mode .dropdown-item:hover {
    background: var(--sidebar-hover);
}

body.dark-mode .modal-content {
    background: #16181f;
    border-color: var(--border-color);
}
body.dark-mode .modal-header {
    border-bottom-color: var(--border-color);
}
body.dark-mode .modal-footer {
    border-top-color: var(--border-color);
}

body.dark-mode .list-group-item {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.dark-mode .page-link {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--accent);
}
body.dark-mode .page-item.disabled .page-link {
    background: var(--content-bg);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

body.dark-mode .progress {
    background: #1a1d29;
}

body.dark-mode .text-muted {
    color: var(--text-secondary) !important;
}

body.dark-mode .text-dark {
    color: var(--text-primary) !important;
}

body.dark-mode .bg-light {
    background: #262a3a !important;
}

body.dark-mode ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
body.dark-mode ::-webkit-scrollbar-track {
    background: #0d0e14;
}
body.dark-mode ::-webkit-scrollbar-thumb {
    background: #262a3a;
    border-radius: 4px;
}
body.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: #3a3f55;
}

/* ============================================================
   COOKIE CONSENT BANNER
   ============================================================ */

.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    z-index: 9999;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    display: none;
    animation: cookieSlideUp 0.4s ease;
}

@keyframes cookieSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.cookie-consent.show {
    display: block;
}

.cookie-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.cookie-text {
    flex: 1;
    min-width: 280px;
}

.cookie-text p {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.cookie-text strong {
    color: var(--text-primary);
}

.cookie-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    align-items: center;
}

.cookie-actions .btn {
    font-size: 0.8125rem;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
}

.cookie-preferences {
    margin-top: 1rem;
    display: none;
}

.cookie-preferences.show {
    display: block;
}

.cookie-pref-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    max-width: 1100px;
    margin: 0 auto 1rem;
}

.cookie-pref-item {
    background: var(--content-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    flex: 1;
    min-width: 200px;
}

.cookie-pref-item label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.8125rem;
    cursor: pointer;
}

.cookie-pref-item label small {
    font-weight: 400;
    color: var(--text-secondary);
    display: block;
    margin-top: 0.25rem;
}

.cookie-pref-item input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--accent);
}

.cookie-pref-item input[type="checkbox"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

body.dark-mode .cookie-consent {
    box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
}

/* ============================================================
   Service Layout (dedicated pages without sidebar)
   ============================================================ */

.service-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--border-color);
}

.service-content {
    margin-top: 56px;
    min-height: calc(100vh - 96px);
    padding: 24px;
    background: var(--content-bg);
}

.service-footer {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    background: var(--topbar-bg);
}

body.dark-mode .service-topbar {
    background: var(--sidebar-bg);
    border-color: var(--sidebar-hover);
}

body.dark-mode .service-content {
    background: var(--sidebar-bg);
}

body.dark-mode .service-footer {
    background: var(--sidebar-bg);
    border-color: var(--sidebar-hover);
}

/* Responsivo */
@media (max-width: 767px) {
    .service-content { padding: 12px; }
    .content-area { padding: 12px; }
}

@media (max-width: 575px) {
    .service-content { padding: 8px; }
    .content-area { padding: 8px; }
    .service-topbar { padding: 0 10px; }
    .service-topbar .page-title-sep { display: none; }
    #toastContainer { right: 8px; top: 8px; max-width: calc(100vw - 16px); }
}

/* ============================================================
   MOBILE RESPONSIVE FIXES FOR HOME & PUBLIC PAGES
   ============================================================ */

@media (max-width: 767px) {
    .service-content {
        padding: 12px !important;
    }
}

@media (max-width: 575px) {
    .home-hero {
        padding: 16px !important;
        border-radius: 10px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .home-hero h1 {
        font-size: 1.2rem !important;
    }
    .home-hero .hero-avatar,
    .home-hero .hero-avatar-placeholder {
        width: 40px !important;
        height: 40px !important;
        font-size: 1rem !important;
        margin-bottom: 8px !important;
    }
    .home-hero .d-flex.align-items-center.gap-3 {
        gap: 10px !important;
    }
    .home-stats {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 4px !important;
    }
    .home-stat {
        padding: 8px 4px !important;
        border-radius: 8px !important;
    }
    .home-stat .stat-value {
        font-size: 0.95rem !important;
    }
    .home-stat .stat-label {
        font-size: 0.6rem !important;
    }
    .home-stat .stat-icon {
        font-size: 0.85rem !important;
        margin-bottom: 0 !important;
    }
    .home-txn-table {
        font-size: 0.7rem !important;
    }
    .home-txn-table th,
    .home-txn-table td {
        padding: 5px 6px !important;
    }
    .home-row {
        margin-bottom: 16px !important;
    }
    .home-card {
        flex: 0 0 200px !important;
    }
    .home-card .card-icon {
        height: 80px !important;
        font-size: 1.8rem !important;
    }
    .home-card .card-body {
        padding: 10px !important;
    }
    .home-card .card-body h5 {
        font-size: 0.8rem !important;
    }
    .home-card .card-body p {
        font-size: 0.7rem !important;
    }
    .home-section-title {
        font-size: 0.9rem !important;
        margin-bottom: 10px !important;
    }
    .card.mt-2 {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .card.mt-2 .card-header {
        padding: 10px 12px !important;
        font-size: 0.8rem !important;
    }
    .card.mt-2 .card-header .btn-sm {
        font-size: 0.7rem !important;
        padding: 0.2rem 0.5rem !important;
    }
}

@media (max-width: 400px) {
    .home-stats {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 4px !important;
    }
    .home-stat {
        padding: 8px 4px !important;
    }
    .home-stat .stat-value {
        font-size: 0.95rem !important;
    }
    .home-stat .stat-label {
        font-size: 0.6rem !important;
    }
    .home-card {
        flex: 0 0 160px !important;
    }
}

/* Landing page (not logged in) mobile */
@media (max-width: 575px) {
    .landing-hero {
        padding: 30px 16px 24px !important;
    }
    .landing-hero h1 {
        font-size: 1.8rem !important;
    }
    .landing-hero p {
        font-size: 0.95rem !important;
    }
    .landing-hero .btn-group-hero {
        flex-direction: column !important;
        align-items: center !important;
    }
    .landing-hero .btn-group-hero .btn {
        width: 100% !important;
        max-width: 280px !important;
    }
    .landing-section {
        margin-bottom: 28px !important;
    }
    .landing-section h2 {
        font-size: 1.2rem !important;
    }
    .landing-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    .landing-card {
        padding: 16px 14px !important;
    }
    .landing-card .lc-icon {
        font-size: 1.5rem !important;
        margin-bottom: 8px !important;
    }
    .landing-card h5 {
        font-size: 0.85rem !important;
    }
    .landing-card p {
        font-size: 0.8rem !important;
    }
    .faq-list {
        max-width: 100% !important;
    }
    .faq-item .faq-question {
        font-size: 0.85rem !important;
        padding: 12px 14px !important;
    }
    .faq-item .faq-answer {
        font-size: 0.8rem !important;
        padding: 0 14px 12px !important;
    }
}

/* About page mobile */
@media (max-width: 575px) {
    .about-hero {
        padding: 24px 16px 20px !important;
    }
    .about-hero h1 {
        font-size: 1.4rem !important;
    }
    .about-hero p {
        font-size: 0.85rem !important;
    }
    .about-section h2 {
        font-size: 1.2rem !important;
    }
    .about-grid {
        grid-template-columns: 1fr !important;
    }
    .about-card {
        padding: 20px 16px !important;
    }
    .about-story {
        padding: 20px !important;
    }
    .about-features {
        grid-template-columns: 1fr !important;
    }
}

/* FAQ page mobile */
@media (max-width: 575px) {
    .faq-hero {
        padding: 24px 16px 20px !important;
    }
    .faq-hero h1 {
        font-size: 1.4rem !important;
    }
    .faq-hero p {
        font-size: 0.85rem !important;
    }
    .faq-wrapper {
        max-width: 100% !important;
        padding: 0 !important;
    }
    .faq-category {
        font-size: 0.95rem !important;
    }
    .faq-contact {
        padding: 16px !important;
    }
    .faq-contact h5 {
        font-size: 0.95rem !important;
    }
}

/* Public layout mobile */
@media (max-width: 575px) {
    .public-topbar {
        padding: 0 12px !important;
    }
    .public-topbar .btn {
        font-size: 0.75rem !important;
        padding: 0.35rem 0.75rem !important;
    }
    .footer-bar {
        flex-direction: column !important;
        align-items: center !important;
        gap: 6px !important;
        padding: 10px 12px !important;
        font-size: 0.7rem !important;
    }
}

/* Cookie consent mobile */
@media (max-width: 575px) {
    .cookie-content {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }
    .cookie-text {
        min-width: 0 !important;
    }
    .cookie-actions {
        flex-wrap: wrap !important;
        justify-content: center !important;
    }
    .cookie-actions .btn {
        font-size: 0.75rem !important;
        padding: 0.4rem 1rem !important;
        flex: 1 !important;
        min-width: 100px !important;
    }
    .cookie-pref-grid {
        flex-direction: column !important;
    }
}

/* Toast mobile */
@media (max-width: 575px) {
    #toastContainer {
        top: 10px !important;
        right: 10px !important;
        left: 10px !important;
        max-width: calc(100vw - 20px) !important;
    }
}

.service-topbar .user-dropdown-text {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .service-topbar .user-dropdown-text {
        max-width: 80px;
    }
    .service-topbar .user-dropdown-icon {
        display: none;
    }
}

/* Service page card improvements */
.service-card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}

.service-card:hover {
    box-shadow: var(--shadow-md);
}

.service-card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    font-weight: 600;
}

.service-card .card-body {
    padding: 20px;
}

/* Responsive balance */
.balance-display {
    font-size: clamp(1.5rem, 6vw, 2.5rem);
    font-weight: 800;
    line-height: 1.2;
}

/* Action grid for banking */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

@media (max-width: 575px) {
    .action-grid {
        grid-template-columns: 1fr;
    }
}

.action-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    transition: box-shadow 0.2s;
}

.action-card:hover {
    box-shadow: var(--shadow-sm);
}

/* Responsive table card */
@media (max-width: 767px) {
    .table-card-view .table-row {
        display: block;
        padding: 12px 16px;
        border-bottom: 1px solid var(--border-color);
    }
    .table-card-view .table-row:last-child {
        border-bottom: none;
    }
    .table-card-view .table-cell-label {
        font-size: 0.7rem;
        color: var(--text-secondary);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 2px;
    }
}

/* Format list for yt */
.format-list-item {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    margin-bottom: 4px;
    cursor: pointer;
    transition: background 0.15s;
    word-break: break-word;
}

.format-list-item:hover {
    background: var(--table-hover);
}

.format-list-item.active {
    border-color: var(--accent);
    background: rgba(79, 140, 255, 0.08);
}

/* Category card for shop hub */
.category-card {
    border: 2px solid transparent;
    transition: all 0.25s ease;
    cursor: pointer;
}
.category-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.category-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--table-hover);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Product card improvements */
.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card .card-img-top {
    height: 140px;
    object-fit: contain;
    padding: 12px;
    background: var(--table-hover);
}

@media (max-width: 575px) {
    .product-card .card-img-top {
        height: 100px;
    }
}

.product-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card .card-body .mt-auto {
    margin-top: auto;
}

/* Placeholder responsive */
.placeholder-chave {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 767px) {
    .placeholder-chave {
        max-width: 100%;
    }
}

/* ============================================================
   NEONBANK
   ============================================================ */

.nb-hero {
    background: linear-gradient(135deg, var(--nb-primary, #0d6efd), var(--nb-purple, #6610f2));
    border-radius: 16px;
    padding: 28px 32px;
    color: #fff;
    margin-bottom: 20px;
}

.nb-hero .balance {
    font-size: clamp(2rem, 7vw, 3rem);
    font-weight: 800;
    line-height: 1.1;
}

.nb-hero .info {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.nb-hero .info span {
    font-size: 0.8rem;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nb-hero .info i { font-size: 0.7rem; }

.nb-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 4px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

.nb-tab {
    flex: 1;
    min-width: 90px;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    white-space: nowrap;
}

.nb-tab i { display: block; margin-bottom: 4px; font-size: 1rem; }

.nb-tab:hover { color: var(--text-primary); background: var(--table-hover); }

.nb-tab.active {
    background: var(--nb-primary, #0d6efd);
    color: #fff;
}

.nb-section { display: none; }
.nb-section.active { display: block; }

/* Quick actions */
.qactions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.qaction {
    flex: 1;
    min-width: 120px;
    padding: 18px 14px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    text-align: center;
    cursor: pointer;
    transition: all 0.25s;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.qaction:hover {
    border-color: var(--nb-primary, #0d6efd);
    box-shadow: 0 6px 20px rgba(13,110,253,0.12);
    transform: translateY(-3px);
}

.qaction i { font-size: 1.4rem; display: block; margin-bottom: 6px; }
.qaction.deposit i { color: #10b981; }
.qaction.withdraw i { color: #f59e0b; }
.qaction.transfer i { color: #0ea5e9; }

/* Modal overlay */
.txn-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.txn-overlay.active { display: flex; }

.txn-modal {
    background: var(--card-bg);
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    overflow: hidden;
}

.txn-modal-header {
    padding: 24px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.txn-modal-header h5 { font-weight: 700; margin: 0; }

.txn-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.txn-modal-close:hover { background: var(--border-color); }

.txn-modal-body { padding: 20px 24px; }
.txn-modal-footer { padding: 0 24px 24px; display: flex; gap: 8px; justify-content: flex-end; }

.steps { display: flex; gap: 6px; padding: 20px 24px 0; }

.step-dot {
    flex: 1; height: 4px; border-radius: 2px;
    background: var(--border-color); transition: background 0.3s;
}

.step-dot.active { background: var(--nb-primary, #0d6efd); }
.step-dot.done { background: #10b981; }
.step-dot.error { background: #ef4444; }

.txn-result { text-align: center; padding: 8px 0; }
.txn-result-icon { font-size: 3rem; margin-bottom: 12px; }
.txn-result-icon.success { color: #10b981; }
.txn-result-icon.error { color: #ef4444; }
.txn-result h5 { font-weight: 700; margin-bottom: 4px; }
.txn-result p { font-size: 0.85rem; color: var(--text-secondary); margin: 0; }

.txn-spinner {
    width: 44px; height: 44px;
    border: 4px solid var(--border-color);
    border-top-color: var(--nb-primary, #0d6efd);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Virtual Card */
.vcard {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 14px;
    padding: 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.vcard.debit { background: linear-gradient(135deg, #0f3443 0%, #34e89e 100%); }
.vcard.credit { background: linear-gradient(135deg, #434343 0%, #667db6 100%); }

.vcard .chip {
    width: 40px; height: 30px;
    background: linear-gradient(135deg, #ffd700 0%, #ffb300 100%);
    border-radius: 4px;
    margin-bottom: 20px;
}

.vcard .number {
    font-size: 1.3rem;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    word-spacing: 6px;
}

.vcard .footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.vcard .footer small {
    opacity: 0.7;
    font-size: 0.65rem;
}

.vcard .footer .brand {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -1px;
}

/* PIX */
.pix-key {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 8px;
    transition: background 0.15s;
}

.pix-key:hover { background: var(--table-hover); }

.pix-key .key-value {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    font-weight: 600;
}

.pix-key .key-type {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

/* Loan */
.loan-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: box-shadow 0.2s;
}

.loan-card:hover { box-shadow: var(--shadow-sm); }

.loan-card .amount {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--nb-primary, #0d6efd);
}

.loan-card .terms { font-size: 0.8rem; color: var(--text-secondary); }

/* Invoice / Cobrança */
.invoice-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: background 0.15s;
}
.invoice-card:hover { background: var(--table-hover); }
.invoice-card .inv-info { flex: 1; min-width: 0; }
.invoice-card .inv-title { font-weight: 600; font-size: 0.9rem; }
.invoice-card .inv-meta { font-size: 0.75rem; color: var(--text-secondary); }
.invoice-card .inv-amount { font-weight: 700; font-size: 1rem; white-space: nowrap; }
.invoice-card .inv-status { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 1px; padding: 2px 10px; border-radius: 20px; }
.inv-status.pending { background: #fef3c7; color: #92400e; }
.inv-status.paid { background: #d1fae5; color: #065f46; }
.inv-status.cancelled { background: #fee2e2; color: #991b1b; }
.dark-mode .inv-status.pending { background: #78350f; color: #fde68a; }
.dark-mode .inv-status.paid { background: #064e3b; color: #a7f3d0; }
.dark-mode .inv-status.cancelled { background: #7f1d1d; color: #fca5a5; }

/* Loan tracking */
.loan-track-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 10px;
}
.loan-track-card .loan-progress {
    display: flex; gap: 6px; margin: 8px 0;
}
.loan-track-card .parcel-dot {
    width: 24px; height: 24px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6rem; font-weight: 700;
    background: var(--border-color); color: var(--text-secondary);
}
.loan-track-card .parcel-dot.paid { background: #10b981; color: #fff; }
.loan-track-card .parcel-dot.active { background: var(--nb-primary, #0d6efd); color: #fff; }

/* Receipt modal */
.receipt-box {
    text-align: center;
    padding: 16px 0;
}
.receipt-box .receipt-id {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}
.receipt-box .receipt-divider {
    border: none;
    border-top: 1px dashed var(--border-color);
    margin: 16px 0;
}
.receipt-box .receipt-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.85rem;
}
.receipt-box .receipt-row .label { color: var(--text-secondary); }
.receipt-box .receipt-row .value { font-weight: 600; }
.receipt-box .receipt-total {
    font-size: 1.2rem;
    font-weight: 800;
    padding: 8px 0;
}

/* Table actions */
.txn-actions { display: flex; gap: 4px; }
.txn-actions .btn-icon-sm {
    width: 28px; height: 28px;
    padding: 0; font-size: 0.65rem;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px;
}



/* ============================================================
   RESPONSIVO — Call Temporária e Dashboard (telas pequenas)
   ============================================================ */

/* Telas pequenas (celular) */
@media (max-width: 575px) {
    /* Header da página empilha título e badge */
    .d-flex.align-items-center.justify-content-between.mb-4.flex-wrap {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem;
    }

    /* Botões de ação do formulário empilham */
    #tcForm .d-flex.gap-2,
    .card-body > .d-flex.gap-2 {
        flex-direction: column;
    }
    #tcForm .d-flex.gap-2 .btn,
    .card-body > .d-flex.gap-2 .btn {
        width: 100%;
    }

    /* "Como Funciona" e "Controles do Painel": 2 colunas em vez de 1 */
    .card-body .row.g-3 .col-md-3,
    .card-body .row.g-3 .col-md-4 {
        flex: 0 0 auto;
        width: 50%;
    }

    /* Reduz padding dos cards em telas pequenas */
    .card-body {
        padding: 1rem;
    }

    /* Item de servidor configurado: empilha badge abaixo do nome se necessário */
    .server-item {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Selects e inputs ocupam toda a largura (já fazem, reforço p/ evitar overflow) */
    .form-select, .form-control {
        font-size: 16px; /* evita zoom automático no iOS */
    }
}

/* Telas médias-pequenas (tablet em pé) */
@media (max-width: 767px) {
    .content-area {
        padding: 0.75rem;
    }

    /* Cards de stats da dashboard: garante 2 colunas */
    .stat-card {
        padding: 0.875rem;
    }

    /* Card de servidores configurados ocupa largura total */
    #serverList .server-item {
        padding: 0.75rem;
    }

    /* Título da página menor */
    .fw-700.mb-1 {
        font-size: 1.15rem;
    }
}

/* Telas muito estreitas */
@media (max-width: 400px) {
    .card-body .row.g-3 .col-md-3,
    .card-body .row.g-3 .col-md-4 {
        width: 100%;
    }
}

/* Backdrop do sidebar em telas pequenas */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
}
@media (min-width: 768px) {
    .sidebar-backdrop { display: none !important; }
}

/* Subdashboard Cards */
.subdash-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    border: 1px solid var(--border-color);
}
.subdash-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.subdash-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: transform 0.2s ease;
}
.subdash-card:hover .subdash-icon {
    transform: scale(1.1);
}
/* Sidebar section link */
.nav-section a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
}
.nav-section a:hover {
    color: var(--sidebar-text-active);
}
