/* admin.css - стилі для адмін-панелі */

body { background: #f8fafc; font-family: 'Inter', system-ui, sans-serif; padding: 25px; color: #1e293b; }
.container { max-width: 1200px; margin: 0 auto; }

.admin-tabs { display: flex; gap: 10px; margin-bottom: 30px; border-bottom: 1px solid #e2e8f0; padding-bottom: 10px; }
.tab-btn { padding: 12px 24px; background: none; border: none; font-size: 16px; font-weight: 600; color: #64748b; cursor: pointer; border-radius: 8px; transition: all 0.2s; }
.tab-btn:hover { background: #f1f5f9; color: #1e293b; }
.tab-btn.active { background: #3b82f6; color: white; }

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

.section-title {
    grid-column: 1 / -1;
    font-size: 22px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 25px; margin-top: 20px; }

.admin-card { 
    background: white; padding: 30px; border-radius: 24px; box-shadow: 0 4px 20px rgba(0,0,0,0.05); 
    border: 1px solid #e2e8f0; display: flex; flex-direction: column; align-items: center; text-align: center;
}

h1 { text-align: center; font-weight: 800; font-size: 32px; color: #0f172a; margin: 0; }

.card-title { font-size: 20px; font-weight: 700; margin-bottom: 15px; line-height: 1.2; }
.card-title span { display: block; font-size: 18px; color: #64748b; }

.btn-group { display: flex; gap: 10px; margin-top: 20px; width: 100%; }
.btn-main { flex: 2; padding: 14px; border: none; border-radius: 12px; color: white; font-weight: 600; cursor: pointer; transition: 0.3s; font-size: 15px; }
.btn-stop { flex: 1.2; padding: 14px; background: #ef4444; color: white; border: none; border-radius: 12px; font-weight: 600; cursor: pointer; display: none; }
.btn-log { 
    flex: 1; padding: 14px; background: #8b5cf6; color: white; border-radius: 12px; 
    text-decoration: none; text-align: center; font-size: 13px; font-weight: 600; 
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-log:hover { background: #7c3aed; }

.status-window { 
    margin-top: 20px; padding: 15px; background: #0f172a; color: #10b981; border-radius: 12px; 
    font-family: 'Fira Code', monospace; font-size: 12px; min-height: 40px; width: 100%; display: none;
    border: 1px solid #1e293b; line-height: 1.5; overflow: hidden; max-height: 300px; overflow-y: auto;
}

.badge { background: #dcfce7; color: #166534; font-size: 11px; padding: 4px 12px; border-radius: 20px; display: none; margin-bottom: 10px; }

.btn-back {
    background: white; color: #64748b; border: 1px solid #e2e8f0; padding: 10px 18px;
    border-radius: 12px; text-decoration: none; font-size: 14px; font-weight: 600; transition: 0.2s;
}
.btn-back:hover { background: #f8fafc; color: #0f172a; }

.stats-info { width: 100%; margin-top: 20px; border-top: 1px solid #f1f5f9; padding-top: 10px; }
.stats-row { display: flex; justify-content: space-between; padding: 8px 0; }

.settings-group { width: 100%; margin-bottom: 20px; text-align: left; }
.setting-item { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.setting-item label { font-size: 14px; color: #64748b; }
.setting-item input { width: 70px; padding: 8px; border: 1px solid #e2e8f0; border-radius: 8px; text-align: center; }

.pause-indicator { width: 100%; padding: 10px; border-radius: 8px; margin-bottom: 15px; font-weight: 600; }
.pause-active { background: #fee2e2; color: #b91c1c; }
.pause-inactive { background: #dcfce7; color: #166534; }

.books-pending { background: #fef9c3; color: #854d0e; padding: 8px; border-radius: 8px; margin-bottom: 15px; font-weight: 600; }

.users-table-container { overflow-x: auto; margin-top: 20px; }
.users-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.users-table th, .users-table td { padding: 12px 8px; text-align: left; border-bottom: 1px solid #e2e8f0; }
.users-table th { background: #f8fafc; font-weight: 600; color: #475569; position: sticky; top: 0; }
.users-table tr:hover { background: #f1f5f9; }

.role-badge { display: inline-block; padding: 4px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.role-admin { background: #fee2e2; color: #b91c1c; }
.role-pro-plus { background: #ede9fe; color: #6d28d9; }
.role-pro { background: #dcfce7; color: #166534; }
.role-free { background: #dbeafe; color: #1e40af; }
.role-user { background: #e2e8f0; color: #334155; }
.role-guest { background: #f1f5f9; color: #64748b; }

.loading-container { text-align: center; padding: 50px; }
.loading-spinner { width: 40px; height: 40px; border: 4px solid #e2e8f0; border-top-color: #3b82f6; border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 15px; }
@keyframes spin { to { transform: rotate(360deg); } }

.filter-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; justify-content: center; }
.filter-btn { padding: 8px 16px; border: 1px solid #e2e8f0; background: white; border-radius: 20px; cursor: pointer; font-size: 13px; font-weight: 500; transition: all 0.2s; }
.filter-btn:hover { background: #f1f5f9; }
.filter-btn.active { background: #3b82f6; border-color: #3b82f6; color: white; }

.btn-secondary { background: #8b5cf6; color: white; border: none; border-radius: 8px; padding: 10px 20px; cursor: pointer; font-weight: 600; font-size: 14px; transition: 0.2s; }
.btn-secondary:hover { background: #7c3aed; }

.geo-update-status { margin-top: 10px; font-size: 12px; color: #64748b; }

.page-input-group { display: flex; gap: 10px; align-items: center; justify-content: center; width: 100%; margin-bottom: 15px; }
.page-input-group input { width: 100px; padding: 10px; border: 1px solid #e2e8f0; border-radius: 8px; text-align: center; font-size: 14px; }
.page-input-group button { padding: 10px 20px; background: #8b5cf6; color: white; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; }
.page-input-group button:hover { background: #7c3aed; }

.stat-cards { display: flex; gap: 15px; flex-wrap: wrap; justify-content: center; width: 100%; margin-top: 15px; }
.stat-card-small { background: #f8fafc; padding: 10px 15px; border-radius: 12px; text-align: center; flex: 1; min-width: 100px; }
.stat-card-small .stat-value { font-size: 20px; font-weight: bold; color: #3b82f6; }
.stat-card-small .stat-label { font-size: 11px; color: #64748b; }

/* ===================================================== */
/* СТИЛІ ДЛЯ ВКЛАДКИ РЕКЛАМИ */
/* ===================================================== */

.ads-filters select,
.ads-filters button {
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.ads-filters select:hover,
.ads-filters button:hover {
    opacity: 0.9;
}

.kpi-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.chart-container {
    transition: box-shadow 0.2s ease;
}

.chart-container:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.ads-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ads-table th,
.ads-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.ads-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
}

.ads-table tr:hover {
    background: #f1f5f9;
}

/* Адаптація для мобільних пристроїв */
@media (max-width: 768px) {
    .ads-kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    
    .kpi-card {
        padding: 12px !important;
    }
    
    .kpi-card div:first-child {
        font-size: 20px !important;
    }
    
    .kpi-card div:last-child {
        font-size: 11px !important;
    }
    
    .ads-filters {
        flex-direction: column;
        align-items: stretch !important;
    }
    
    .ads-filters select,
    .ads-filters button {
        width: 100%;
    }
    
    .chart-container {
        margin-bottom: 15px;
    }
    
    .ads-table th,
    .ads-table td {
        padding: 8px 4px;
        font-size: 11px;
    }
}