/* ============================================
   ADMIN PANEL - SISTEMA DE VERIFICAÇÃO
   Premium Dark Mode Design — Professional Grade
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-primary: #050816;
    --bg-secondary: #0a1128;
    --bg-card: rgba(14, 21, 58, 0.85);
    --bg-card-hover: rgba(21, 30, 82, 0.9);
    --bg-input: #080d24;
    --accent: #00d4aa;
    --accent-glow: #00d4aa40;
    --accent-soft: #00d4aa15;
    --warning: #f0ad4e;
    --danger: #e74c3c;
    --success: #00d4aa;
    --text-primary: #f0f2ff;
    --text-secondary: #8b95c9;
    --text-muted: #5a6394;
    --border: #151d48;
    --border-light: #232e68;
    --sidebar-width: 260px;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-primary);
    background-image:
        radial-gradient(ellipse at 15% 10%, #0d1b5e22 0%, transparent 50%),
        radial-gradient(ellipse at 85% 90%, #0d1b5e18 0%, transparent 50%);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ==================== LOGIN ==================== */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background:
        radial-gradient(ellipse at 30% 20%, #0d1b5e30 0%, transparent 55%),
        radial-gradient(ellipse at 70% 80%, #0d1b5e20 0%, transparent 55%),
        var(--bg-primary);
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.login-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo svg {
    filter: drop-shadow(0 0 30px var(--accent-glow));
}

.login-logo h1 {
    font-size: 22px;
    font-weight: 700;
    margin-top: 12px;
    background: linear-gradient(135deg, var(--accent), #45B7D1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-logo p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 4px;
}

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 13px 16px;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.form-input::placeholder {
    color: var(--text-muted);
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b95c9' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

/* ==================== BUTTONS ==================== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #009e7f);
    color: var(--bg-primary);
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ==================== LAYOUT ==================== */
.app-container {
    display: none;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: var(--transition);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), #45B7D1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-header p {
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 4px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.nav-item:hover {
    background: var(--accent-soft);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    width: 3px;
    height: 32px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-user:hover {
    background: var(--accent-soft);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #45B7D1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--bg-primary);
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-info .name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info .email {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 32px;
    min-height: 100vh;
}

.page-header {
    margin-bottom: 28px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 6px;
}

/* ==================== STATS CARDS ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent)60, transparent);
    opacity: 0;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    border-color: var(--accent)30;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    opacity: 0.04;
    background: var(--accent);
}

.stat-card .stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.stat-card .stat-value {
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-card .stat-label {
    color: var(--text-secondary);
    font-size: 11px;
    margin-top: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* ==================== CARDS / PANELS ==================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: var(--transition);
}

.card:hover {
    border-color: var(--border-light);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 700;
}

/* ==================== TABLE ==================== */
.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

td {
    padding: 12px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

tr:hover td {
    background: var(--bg-card-hover);
}

.code-cell {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 1px;
    font-size: 12px;
}

/* ==================== BADGE ==================== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success {
    background: var(--success)20;
    color: var(--success);
}

.badge-warning {
    background: var(--warning)20;
    color: var(--warning);
}

.badge-danger {
    background: var(--danger)20;
    color: var(--danger);
}

.badge-info {
    background: #3498db20;
    color: #3498db;
}

/* ==================== PAGINATION ==================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    transition: var(--transition);
}

.pagination button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.pagination button.active {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
    font-weight: 600;
}

/* ==================== DROP ZONE ==================== */
.drop-zone {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-input);
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.drop-zone svg {
    margin-bottom: 12px;
    color: var(--text-muted);
}

.drop-zone h4 {
    color: var(--text-primary);
    font-size: 15px;
    margin-bottom: 4px;
}

.drop-zone p {
    color: var(--text-muted);
    font-size: 12px;
}

/* ==================== COLOR PICKER ==================== */
.color-picker-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-picker-group input[type="color"] {
    width: 42px;
    height: 42px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: none;
    cursor: pointer;
    padding: 2px;
}

.color-picker-group input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker-group input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 5px;
}

/* ==================== TABS ==================== */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 4px;
}

.tab-btn {
    padding: 10px 18px;
    background: none;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--accent);
    color: var(--bg-primary);
    font-weight: 600;
}

/* ==================== CODE BLOCK ==================== */
.code-block {
    background: #0a0e20;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 12px;
    line-height: 1.6;
    overflow-x: auto;
    color: #b4bfcc;
    position: relative;
    white-space: pre-wrap;
    word-break: break-all;
}

.code-block .copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 6px 14px;
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.code-block .copy-btn:hover {
    transform: scale(1.05);
}

/* ==================== PREVIEW ==================== */
.preview-container {
    background: #1a1a2e;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 24px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.preview-tab {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.preview-tab:hover {
    border-color: var(--accent);
}

.preview-tab.active {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
    font-weight: 600;
}

/* ==================== FORM GRID ==================== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.form-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.form-row>* {
    flex: 1;
}

/* ==================== TOAST ==================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    font-size: 13px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toast-in 0.3s ease;
    max-width: 380px;
    color: var(--text-primary);
}

.toast.success {
    border-left: 3px solid var(--success);
}

.toast.error {
    border-left: 3px solid var(--danger);
}

.toast.warning {
    border-left: 3px solid var(--warning);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==================== CHART ==================== */
.chart-container {
    width: 100%;
    height: 250px;
    position: relative;
}

.chart-bar-container {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 200px;
    padding-top: 20px;
}

.chart-bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    height: 100%;
    justify-content: flex-end;
}

.chart-bar {
    width: 100%;
    min-height: 4px;
    background: linear-gradient(180deg, var(--accent), var(--accent)80);
    border-radius: 4px 4px 0 0;
    transition: height 0.6s ease;
    max-width: 40px;
}

.chart-label {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
}

.chart-value {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ==================== SETTINGS SECTION ==================== */
.settings-section {
    margin-bottom: 28px;
}

.settings-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* ==================== MODAL ==================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
    animation: fade-in 0.2s ease;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px;
    max-width: 480px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: modal-in 0.3s ease;
}

.modal h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ==================== SECTION PAGES ==================== */
.page-section {
    display: none;
}

.page-section.active {
    display: block;
    animation: fade-in 0.3s ease;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 20px 16px;
    }

    .mobile-toggle {
        display: flex !important;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
    }
}

.mobile-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 101;
    width: 42px;
    height: 42px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h4 {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 13px;
}

/* ==================== LOADING ==================== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==================== SEARCH ==================== */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-bar .form-input {
    flex: 1;
}

/* ==================== LANGUAGE SELECTOR ==================== */
.lang-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    width: 100%;
}

.lang-option:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-1px);
}

.lang-option.selected {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 20px var(--accent-glow);
}

.lang-flag {
    font-size: 28px;
    line-height: 1;
}

.lang-label {
    font-weight: 600;
}