/* Customização para o Admin Panel - QRAuth */

body.admin-page {
    background: #050508;
    color: var(--text-main);
}

.admin-container {
    max-width: 960px;
    padding: 24px 20px 60px 20px;
    margin: 0 auto;
}

/* Header Box com Fundo Chapado Preto e Logo Centralizado */
/* Header Box com Fundo Chapado Preto e Efeito LED */
.admin-header-box {
    background: #000000 !important;
    border: 1px solid rgba(138, 43, 226, 0.45) !important;
    border-radius: 24px !important;
    padding: 20px 28px 24px 28px !important;
    margin-bottom: 28px;
    box-shadow: 0 0 35px rgba(138, 43, 226, 0.4), 0 0 70px rgba(138, 43, 226, 0.18), 0 20px 50px rgba(0, 0, 0, 0.9) !important;
}

.admin-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-brand-tag {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-action-warning {
    background: rgba(255, 183, 3, 0.08);
    border: 1px solid rgba(255, 183, 3, 0.35);
    color: var(--warning);
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

.btn-action-warning:hover {
    background: rgba(255, 183, 3, 0.18);
    border-color: var(--warning);
    transform: translateY(-1px);
}

.btn-action-danger {
    background: rgba(255, 0, 60, 0.08);
    border: 1px solid rgba(255, 0, 60, 0.35);
    color: var(--error);
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

.btn-action-danger:hover {
    background: rgba(255, 0, 60, 0.18);
    border-color: var(--error);
    transform: translateY(-1px);
}

/* Área Central do Logo Perfeitamente Centralizado */
.admin-logo-centered {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 24px 0 12px 0;
    text-align: center;
}

.admin-logo-link {
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    margin: 0 auto;
}

.logo-img-admin-hero {
    max-width: 440px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    filter: none !important;
    transition: transform 0.25s ease;
}

.logo-img-admin-hero:hover {
    transform: scale(1.02);
}

/* Seções com Fundo Preto Chapado e Efeito LED */
.admin-section,
.history-section {
    background: #000000 !important;
    border: 1px solid rgba(138, 43, 226, 0.45) !important;
    border-radius: 24px !important;
    padding: 32px !important;
    margin-bottom: 28px;
    box-shadow: 0 0 35px rgba(138, 43, 226, 0.4), 0 0 70px rgba(138, 43, 226, 0.18), 0 20px 50px rgba(0, 0, 0, 0.9) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Input extra para a geração */
.generator-form input[type="number"] {
    width: 100%;
    background: #0a0a10;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 16px;
    color: #ffffff;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.generator-form input[type="number"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow), 0 0 15px rgba(138, 43, 226, 0.3);
    background: #0e0e18;
}

/* Data Table Constraints */
.table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    background: #08080d;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    color: var(--text-main);
    min-width: 860px;
}

.data-table th,
.data-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table th:last-child,
.data-table td:last-child {
    text-align: center;
    width: 170px;
    min-width: 160px;
    padding-right: 24px !important;
}

.data-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.02);
}

.data-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

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

/* Status Badges */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-virgem {
    background: rgba(0, 245, 255, 0.1);
    color: var(--success);
    border: 1px solid rgba(0, 245, 255, 0.25);
}

.badge-autenticado {
    background: rgba(255, 183, 3, 0.1);
    color: var(--warning);
    border: 1px solid rgba(255, 183, 3, 0.25);
}

/* Botões do Admin */
.btn-success {
    width: 100%;
    margin-top: 16px;
    background: var(--success);
    color: #000;
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.btn-success:hover {
    background: #00e5ff;
    box-shadow: 0 8px 16px rgba(0, 245, 255, 0.3);
    transform: translateY(-1px);
}

.btn-icon {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.icon-refresh {
    width: 20px;
    height: 20px;
}

/* Result Box Animada */
.result-box {
    margin-top: 24px;
    padding: 24px;
    background: rgba(0, 245, 255, 0.05);
    border: 1px solid rgba(0, 245, 255, 0.2);
    border-radius: 12px;
    text-align: center;
    animation: fadeIn 0.4s ease-out forwards;
}

.result-box p {
    color: var(--success);
    font-weight: 600;
    margin-bottom: 0;
}

.loader-small {
    width: 16px;
    height: 16px;
    border-width: 2px;
    border-top-color: #000;
    border-right-color: transparent;
    border-bottom-color: transparent;
    border-left-color: transparent;
}

.text-center {
    text-align: center;
}

.loading-text {
    color: var(--text-muted);
    font-style: italic;
}

@media (min-width: 768px) {
    .btn-success {
        width: auto;
        padding: 12px 24px;
    }
}

.btn-action-neutral {
    background: rgba(138, 43, 226, 0.1);
    border: 1px solid rgba(138, 43, 226, 0.4);
    color: #e2e8f0;
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

.btn-action-neutral:hover {
    background: rgba(138, 43, 226, 0.25);
    border-color: #8a2be2;
    transform: translateY(-1px);
}

/* Category Selection Controls */
.generator-grid-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 768px) {
    .generator-grid-form {
        grid-template-columns: 1fr 1fr auto;
        align-items: flex-end;
    }
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.form-label {
    font-size: 0.86rem;
    font-weight: 600;
    color: #cbd5e1;
}

.admin-select {
    width: 100%;
    background: #0d0d14;
    border: 1px solid rgba(138, 43, 226, 0.35);
    border-radius: 12px;
    padding: 14px 16px;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
    cursor: pointer;
}

.admin-select:focus {
    border-color: #00f5ff;
    box-shadow: 0 0 15px rgba(0, 245, 255, 0.3);
}

/* History Filter Bar & Retracted State */
.history-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.history-filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
}

.history-collapsed-msg {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    margin-top: 10px;
}

/* Settings Modal */
.admin-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.admin-modal-overlay.hidden {
    display: none !important;
}

.admin-modal-card {
    background: #000000;
    border: 1px solid rgba(138, 43, 226, 0.5);
    border-radius: 24px;
    width: 90%;
    max-width: 560px;
    padding: 28px;
    box-shadow: 0 0 45px rgba(138, 43, 226, 0.4), 0 25px 60px rgba(0, 0, 0, 0.95);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.admin-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.admin-modal-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.4rem;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-close-modal:hover {
    color: #ffffff;
}

.modal-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 10px;
}

.modal-tab-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-tab-btn.active {
    background: rgba(138, 43, 226, 0.2);
    color: #00f5ff;
    border: 1px solid rgba(0, 245, 255, 0.3);
}

.modal-tab-content {
    display: none;
}

.modal-tab-content.active {
    display: block;
}

/* Category List inside Modal */
.category-chips-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
}

.category-row-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 14px;
    border-radius: 10px;
}

.category-name-badge {
    font-weight: 600;
    color: #ffffff;
}

.category-count-badge {
    font-size: 0.78rem;
    background: rgba(138, 43, 226, 0.2);
    color: #d8b4fe;
    padding: 3px 8px;
    border-radius: 12px;
    margin-left: 8px;
}

.btn-del-cat {
    background: rgba(255, 0, 60, 0.15);
    border: 1px solid rgba(255, 0, 60, 0.4);
    color: #ff003c;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-del-cat:hover {
    background: rgba(255, 0, 60, 0.35);
}

.add-category-box {
    display: flex;
    gap: 10px;
}

.add-category-box input {
    flex: 1;
}

/* Export Buttons for Batch Generator */
.generate-export-actions {
    display: flex;
    flex-direction: row;
    gap: 16px;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.generate-export-actions #download-zip-btn,
.generate-export-actions #download-txt-btn {
    margin: 0 !important;
    height: 48px !important;
    padding: 0 24px !important;
    border-radius: 12px !important;
    font-family: inherit !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    cursor: pointer !important;
    transition: var(--transition) !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    width: auto !important;
    vertical-align: middle !important;
    line-height: 1 !important;
}

.generate-export-actions #download-zip-btn {
    background: #00f5ff !important;
    color: #000000 !important;
    border: 1.5px solid #00f5ff !important;
    box-shadow: 0 4px 16px rgba(0, 245, 255, 0.3) !important;
}

.generate-export-actions #download-zip-btn:hover {
    background: #50f8ff !important;
    border-color: #50f8ff !important;
    box-shadow: 0 6px 24px rgba(0, 245, 255, 0.5) !important;
    transform: translateY(-2px);
}

.generate-export-actions #download-txt-btn {
    background: rgba(0, 245, 255, 0.08) !important;
    border: 1.5px solid #00f5ff !important;
    color: #00f5ff !important;
    text-shadow: 0 0 10px rgba(0, 245, 255, 0.3) !important;
}

.generate-export-actions #download-txt-btn:hover {
    background: rgba(0, 245, 255, 0.22) !important;
    box-shadow: 0 6px 20px rgba(0, 245, 255, 0.35) !important;
    transform: translateY(-2px);
}

/* Category Quick Actions */
.history-category-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-filter-action {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-filter-action:hover {
    background: rgba(138, 43, 226, 0.25);
    border-color: #8a2be2;
    color: #ffffff;
}

/* Bulk Actions Toolbar */
.bulk-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(138, 43, 226, 0.12);
    border: 1px solid rgba(138, 43, 226, 0.4);
    padding: 12px 18px;
    border-radius: 12px;
    margin-bottom: 14px;
    animation: fadeIn 0.25s ease-out;
    flex-wrap: wrap;
    gap: 12px;
}

.bulk-count {
    font-size: 0.9rem;
    font-weight: 700;
    color: #e2e8f0;
}

.bulk-count span#bulk-selected-count {
    color: #00f5ff;
    font-size: 1.05rem;
}

.bulk-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-bulk-action {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-bulk-txt {
    background: rgba(0, 245, 255, 0.12);
    border: 1px solid rgba(0, 245, 255, 0.4);
    color: #00f5ff;
}

.btn-bulk-txt:hover {
    background: rgba(0, 245, 255, 0.25);
    box-shadow: 0 0 10px rgba(0, 245, 255, 0.3);
}

.btn-bulk-zip {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #4ade80;
}

.btn-bulk-zip:hover {
    background: rgba(34, 197, 94, 0.25);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}

.btn-bulk-delete {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
}

.btn-bulk-delete:hover {
    background: rgba(239, 68, 68, 0.25);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

/* Custom Checkbox */
.admin-checkbox {
    width: 17px;
    height: 17px;
    accent-color: #8a2be2;
    cursor: pointer;
    vertical-align: middle;
}

/* Table Action Buttons */
.actions-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-table-action {
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    box-sizing: border-box;
}

.btn-table-verify {
    height: 32px;
    padding: 0 14px;
    border-radius: 8px;
    background: rgba(0, 245, 255, 0.08);
    border: 1px solid rgba(0, 245, 255, 0.35);
    color: #00f5ff;
    font-size: 0.82rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-table-verify:hover {
    background: rgba(0, 245, 255, 0.22);
    border-color: #00f5ff;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(0, 245, 255, 0.3);
}

.btn-table-delete {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #f87171;
    font-size: 0.95rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-table-delete:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.45);
    transform: scale(1.06);
}

/* Barra de Paginação Dinâmica */
.history-pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
    padding: 14px 20px;
    background: rgba(14, 14, 24, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.pagination-info {
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 500;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.pagination-per-page {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.pagination-select {
    padding: 6px 12px !important;
    font-size: 0.88rem !important;
    background: #08080d !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px !important;
    color: var(--text-main) !important;
    cursor: pointer;
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-pg {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-pg:hover:not(:disabled) {
    background: rgba(0, 245, 255, 0.15);
    border-color: rgba(0, 245, 255, 0.4);
    color: var(--primary);
    transform: translateY(-1px);
}

.btn-pg:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pg-page-indicator {
    padding: 0 10px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
}

@media (max-width: 680px) {
    .history-pagination-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .pagination-controls {
        justify-content: space-between;
    }
}