@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --bg-main: #0b0f19;
    --bg-card: #111827;
    --card-bg: #111827;
    --bg-card-hover: #1f2937;
    --bg-sidebar: #0f172a;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.25);
    --secondary: #10b981;
    --accent: #f59e0b;
    --danger: #ef4444;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #1e293b;
    --border-light: #334155;
    --radius: 0px;
    --radius-sm: 0px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    font-size: 0.85rem;
    line-height: 1.45;
}

/* =========================================
   ADMIN LOGIN STYLES
   ========================================= */
.admin-login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(circle at 50% 20%, #1e1b4b 0%, #0b0f19 80%);
}

.admin-login-container {
    width: 100%;
    max-width: 420px;
}

.admin-login-card {
    background: rgba(17, 24, 39, 0.9);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-light);
    border-radius: 0px;
    padding: 32px 28px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.admin-login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #ec4899);
}

.admin-badge-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #ffffff;
    border-radius: 0px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    box-shadow: 0 6px 14px var(--primary-glow);
}

.admin-badge-icon svg {
    width: 24px;
    height: 24px;
}

.admin-header {
    text-align: center;
    margin-bottom: 22px;
}

.admin-header h1 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

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

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 5px;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    pointer-events: none;
}

.input-icon svg {
    width: 16px;
    height: 16px;
}

.form-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 5px;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: 0px;
    font-size: 0.825rem;
    color: #f8fafc;
    background-color: #0b0f19;
    font-family: inherit;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
    background-color: #0f172a;
}

.form-control::placeholder {
    color: #64748b;
    font-size: 0.8rem;
}

select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    padding-right: 36px;
    cursor: pointer;
}

select.form-control option {
    background-color: #0f172a;
    color: #f8fafc;
    padding: 8px;
}

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

input[type="file"].form-control {
    padding: 6px 10px;
    cursor: pointer;
}

input[type="file"].form-control::file-selector-button {
    background: #1e293b;
    border: 1px solid var(--border-light);
    color: #cbd5e1;
    padding: 4px 10px;
    border-radius: 0px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

input[type="file"].form-control::file-selector-button:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.form-control-dark {
    width: 100%;
    padding: 9px 12px 9px 38px;
    border: 1px solid var(--border-light);
    border-radius: 0px;
    font-size: 0.825rem;
    color: var(--text-main);
    background-color: #0b0f19;
    transition: all 0.2s ease;
}

.form-control-dark:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.btn-admin-primary {
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #ffffff;
    border: none;
    border-radius: 0px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-admin-primary:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    box-shadow: 0 6px 16px var(--primary-glow);
    transform: translateY(-1px);
}

.credenciais-info {
    margin-top: 18px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px dashed var(--border-light);
    border-radius: 0px;
    padding: 10px 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.credenciais-info strong {
    color: #e2e8f0;
}

.credenciais-info code {
    background: #0f172a;
    padding: 2px 5px;
    border-radius: 0px;
    color: #38bdf8;
    font-size: 0.75rem;
}

.admin-footer-link {
    margin-top: 20px;
    text-align: center;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
}

.admin-footer-link a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.admin-footer-link a:hover {
    color: var(--primary);
}

/* =========================================
   DASHBOARD LAYOUT
   ========================================= */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 18px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.sidebar-logo-icon svg {
    width: 18px;
    height: 18px;
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
}

.sidebar-title span {
    color: var(--primary);
}

.sidebar-nav {
    padding: 14px 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    padding: 6px 10px 2px 10px;
    letter-spacing: 0.05em;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 0px;
    font-size: 0.825rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.nav-item svg {
    width: 17px;
    height: 17px;
    color: #64748b;
    transition: color 0.2s;
    flex-shrink: 0;
}

.nav-item:hover {
    background-color: rgba(99, 102, 241, 0.1);
    color: #fff;
}

.nav-item:hover svg {
    color: var(--primary);
}

.nav-item.active {
    background-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.nav-item.active svg {
    color: #fff;
}

.sidebar-footer {
    padding: 12px 14px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(11, 15, 25, 0.5);
}

.admin-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.admin-avatar {
    width: 28px;
    height: 28px;
    background: #334155;
    border-radius: 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: #f8fafc;
    flex-shrink: 0;
}

.admin-details {
    overflow: hidden;
}

.admin-name {
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-role {
    font-size: 0.7rem;
    color: var(--primary);
    font-weight: 600;
}

.btn-logout {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 6px;
    border-radius: 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

/* =========================================
   MAIN CONTENT AREA
   ========================================= */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: var(--bg-main);
}

.top-navbar {
    height: 56px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.top-search {
    display: flex;
    align-items: center;
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 0px;
    padding: 6px 12px;
    gap: 8px;
    width: 260px;
}

.top-search input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 0.8rem;
    width: 100%;
}

.top-search svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.badge-status {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 3px 8px;
    border-radius: 0px;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background-color: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.content-area {
    padding: 24px;
    flex: 1;
}

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

.page-header h1 {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.page-header p {
    color: var(--text-muted);
    font-size: 0.825rem;
    margin-top: 2px;
}

/* =========================================
   METRIC STATS CARDS
   ========================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-light);
}

.stat-info h3 {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 6px;
}

.stat-info .stat-number {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}

.stat-info .stat-sub {
    font-size: 0.72rem;
    color: #10b981;
    margin-top: 3px;
    font-weight: 600;
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.primary { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.stat-icon.success { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.stat-icon.warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.stat-icon.danger { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.stat-icon svg {
    width: 22px;
    height: 22px;
}

/* =========================================
   TABLE & RECENT ACTIVITY
   ========================================= */
.card-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0px;
    overflow: hidden;
    margin-bottom: 24px;
}

.card-section-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-section-header h2 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-table th {
    background-color: rgba(15, 23, 42, 0.6);
    padding: 10px 18px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.admin-table td {
    padding: 11px 18px;
    font-size: 0.8rem;
    border-bottom: 1px solid var(--border);
    color: #cbd5e1;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

.badge-tag {
    padding: 3px 8px;
    border-radius: 0px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: capitalize;
    display: inline-block;
}

.badge-tag.concluido { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-tag.pendente { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-tag.cancelado { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.alerta-admin {
    padding: 11px 15px;
    border-radius: 0px;
    font-size: 0.825rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alerta-admin-sucesso {
    background-color: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.alerta-admin-erro {
    background-color: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alerta-admin-aviso {
    background-color: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fde047;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

/* =========================================
   CONFIGURAÇÕES & MERCADO PAGO UI
   ========================================= */
.settings-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 1100px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

.mp-header-card {
    background: linear-gradient(135deg, rgba(0, 158, 227, 0.15) 0%, rgba(17, 24, 39, 0.95) 100%);
    border: 1px solid rgba(0, 158, 227, 0.3);
    border-radius: 0px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.mp-brand-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mp-logo-badge {
    width: 44px;
    height: 44px;
    background: #009ee3;
    border-radius: 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 158, 227, 0.4);
}

.mp-title-group h2 {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
}

.mp-title-group p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.card-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0px;
    padding: 20px;
    margin-bottom: 20px;
}

.card-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.card-box-header h3 {
    font-size: 0.925rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-box-header h3 svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

/* Switches Modernos */
.switch-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 0px;
    margin-bottom: 10px;
}

.switch-label-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.switch-title {
    font-size: 0.825rem;
    font-weight: 600;
    color: #f8fafc;
}

.switch-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #334155;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .slider {
    background-color: #10b981;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Environment Selection Cards */
.env-selector-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.env-option {
    position: relative;
    cursor: pointer;
}

.env-option input {
    position: absolute;
    opacity: 0;
}

.env-card {
    border: 2px solid var(--border);
    background: rgba(15, 23, 42, 0.6);
    border-radius: 0px;
    padding: 12px 14px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.env-option input:checked + .env-card {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.env-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.env-name {
    font-weight: 700;
    font-size: 0.875rem;
    color: #fff;
}

.env-tag {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 0px;
    text-transform: uppercase;
}

.env-tag.sandbox {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.env-tag.prod {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.env-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.35;
}

/* Inputs com Ações (Ver senha / Copiar) */
.input-action-group {
    display: flex;
    align-items: stretch;
    position: relative;
}

.input-action-group .form-control-dark {
    padding-right: 74px;
}

.input-btns-right {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 4px;
}

.btn-icon-input {
    background: #1e293b;
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon-input:hover {
    background: #334155;
    color: #fff;
}

/* Box de Webhook & Cópia */
.copy-box {
    display: flex;
    align-items: center;
    background: #090d16;
    border: 1px solid var(--border-light);
    border-radius: 0px;
    padding: 8px 12px;
    gap: 8px;
}

.copy-box code {
    flex: 1;
    font-family: monospace;
    font-size: 0.78rem;
    color: #38bdf8;
    word-break: break-all;
}

.btn-copy {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    padding: 5px 10px;
    border-radius: 0px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.btn-copy:hover {
    background: var(--primary);
    color: #fff;
}

/* Box Informativo / Guia */
.guide-box {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--border);
    border-radius: 0px;
    padding: 16px;
    font-size: 0.8rem;
    color: #cbd5e1;
}

.guide-box h4 {
    color: #fff;
    font-size: 0.875rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.guide-box ol {
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.guide-box ol li strong {
    color: #fff;
}

.guide-box a {
    color: #38bdf8;
    text-decoration: underline;
}

.guide-box a:hover {
    color: #7dd3fc;
}

/* Status do Teste de Conexão */
#test-result-box {
    margin-top: 12px;
    padding: 11px 14px;
    border-radius: 0px;
    font-size: 0.8rem;
    display: none;
    animation: fadeIn 0.3s ease;
}

#test-result-box.success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
    display: block;
}

#test-result-box.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    display: block;
}

#test-result-box.loading {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #c7d2fe;
    display: flex;
    align-items: center;
    gap: 8px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.btn-secondary-dark {
    background: #1e293b;
    border: 1px solid var(--border-light);
    color: #e2e8f0;
    padding: 9px 14px;
    border-radius: 0px;
    font-size: 0.825rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-secondary-dark:hover {
    background: #334155;
    color: #fff;
}

/* =========================================
   PRODUTOS & CHECKOUT LINKS UI
   ========================================= */
.product-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-thumb {
    width: 40px;
    height: 40px;
    border-radius: 0px;
    object-fit: cover;
    background-color: #1e293b;
    border: 1px solid var(--border-light);
    flex-shrink: 0;
}

.product-thumb-fallback {
    width: 40px;
    height: 40px;
    border-radius: 0px;
    background: linear-gradient(135deg, #334155, #1e293b);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    flex-shrink: 0;
}

.product-thumb-fallback svg {
    width: 20px;
    height: 20px;
}

.product-info-name {
    font-weight: 700;
    color: #fff;
    font-size: 0.85rem;
    line-height: 1.3;
}

.product-info-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.delivery-badge {
    padding: 3px 8px;
    border-radius: 0px;
    font-size: 0.7rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.delivery-badge.pdf {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.delivery-badge.link {
    background: rgba(14, 165, 233, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(14, 165, 233, 0.3);
}

.checkout-link-cell {
    display: flex;
    align-items: center;
    background: #090d16;
    border: 1px solid var(--border-light);
    border-radius: 0px;
    padding: 4px 6px;
    gap: 6px;
    max-width: 300px;
}

.checkout-link-cell input {
    background: transparent;
    border: none;
    outline: none;
    color: #38bdf8;
    font-family: monospace;
    font-size: 0.75rem;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-mini-copy {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    padding: 3px 6px;
    border-radius: 0px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-mini-copy:hover {
    background: var(--primary);
    color: #fff;
}

.btn-mini-open {
    background: #1e293b;
    border: 1px solid var(--border-light);
    color: #94a3b8;
    padding: 3px 5px;
    border-radius: 0px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-mini-open:hover {
    background: #334155;
    color: #fff;
}

.product-action-btns {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-table-action {
    width: 28px;
    height: 28px;
    border-radius: 0px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-light);
    background: #1e293b;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-table-action:hover {
    background: #334155;
    color: #fff;
}

.btn-table-action.edit:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
    color: #a5b4fc;
}

.btn-table-action.delete:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--danger);
    color: #fca5a5;
}

/* Image Upload Preview Box */
.image-upload-zone {
    border: 2px dashed var(--border-light);
    border-radius: 0px;
    padding: 20px;
    text-align: center;
    background: rgba(15, 23, 42, 0.4);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.image-upload-zone:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.image-upload-preview {
    max-width: 200px;
    max-height: 200px;
    border-radius: 0px;
    object-fit: cover;
    border: 2px solid var(--border-light);
    display: none;
    margin: 0 auto 10px auto;
    box-shadow: var(--shadow);
}

.payment-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-top: 6px;
}

.payment-checkbox-card {
    border: 2px solid var(--border);
    background: rgba(15, 23, 42, 0.6);
    border-radius: 0px;
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.payment-checkbox-card input {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

.payment-checkbox-card:hover {
    border-color: var(--border-light);
}

.payment-checkbox-card.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

/* Banner de Link Gerado após Cadastro */
.new-checkout-banner {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(16, 185, 129, 0.15) 100%);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 0px;
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    animation: fadeIn 0.4s ease;
}

.new-checkout-banner-info h3 {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.new-checkout-banner-info p {
    font-size: 0.8rem;
    color: #cbd5e1;
}

.new-checkout-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #0b0f19;
    border: 1px solid var(--border-light);
    border-radius: 0px;
    padding: 6px 10px;
    min-width: 360px;
}

.new-checkout-input-group input {
    background: transparent;
    border: none;
    outline: none;
    color: #34d399;
    font-family: monospace;
    font-size: 0.825rem;
    font-weight: 700;
    width: 100%;
}

@media (max-width: 900px) {
    .admin-layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
    }
    .top-navbar {
        padding: 0 16px;
    }
    .content-area {
        padding: 16px;
    }
    .new-checkout-input-group {
        min-width: 100%;
    }
}

/* =========================================
   GESTÃO DE USUÁRIOS & PRODUTOS VINCULADOS
   ========================================= */
.user-avatar-initials {
    width: 32px;
    height: 32px;
    border-radius: 0px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    color: #fff;
    flex-shrink: 0;
    text-transform: uppercase;
}

.role-badge {
    padding: 2px 6px;
    border-radius: 0px;
    font-size: 0.68rem;
    font-weight: 700;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.role-badge.admin {
    background: rgba(99, 102, 241, 0.18);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.35);
}

.role-badge.cliente {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.user-products-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 300px;
}

.user-product-tag {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--border-light);
    color: #cbd5e1;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 0px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-product-tag .dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #38bdf8;
}

.user-product-tag.pdf .dot {
    background: #c084fc;
}

/* Grade de Seleção de Produtos no Formulário */
.product-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
    margin-top: 6px;
}

.product-select-card {
    background: rgba(15, 23, 42, 0.6);
    border: 2px solid var(--border);
    border-radius: 0px;
    padding: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    user-select: none;
}

.product-select-card:hover {
    border-color: var(--border-light);
}

.product-select-card input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.product-select-card.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.product-select-info {
    flex: 1;
    overflow: hidden;
}

.product-select-title {
    font-size: 0.825rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-select-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}
