/* ============================================================
   ADMIN PAGES — analytics, users, giveaway mgmt, blog mgmt
   ============================================================ */

/* ---- Tables ---- */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.admin-table th,
.admin-table td {
    padding: 11px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(184,134,11,0.12);
    font-size: 0.88rem;
}

.admin-table th {
    color: #FFD700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---- Admin form ---- */
.admin-form {
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.admin-form label {
    color: #FFD700;
    font-weight: bold;
    font-size: 0.9rem;
}

.admin-form input,
.admin-form select {
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid rgba(255,215,0,0.3);
    background: #2D323B;
    color: white;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.admin-form input:focus,
.admin-form select:focus {
    outline: none;
    border-color: #FFD700;
}

.admin-form button {
    padding: 11px 28px;
    background: linear-gradient(135deg, #FFD700, #B8860B);
    color: #0F1115;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 8px;
    align-self: flex-start;
}

/* ---- Buttons ---- */
.edit-btn {
    background: rgba(255,215,0,0.12);
    color: #FFD700;
    padding: 5px 14px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.82rem;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    display: inline-block;
}
.edit-btn:hover { background: rgba(255,215,0,0.25); }

.save-btn {
    background: rgba(255,215,0,0.12);
    color: #FFD700;
    padding: 6px 14px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.82rem;
    white-space: nowrap;
}
.save-btn:hover { background: rgba(255,215,0,0.25); }

.delete-btn {
    background: rgba(220,53,69,0.18);
    color: #dc3545;
    padding: 5px 14px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.82rem;
}
.delete-btn:hover { background: rgba(220,53,69,0.35); }

.ban-btn {
    background: rgba(220,53,69,0.18);
    color: #ff6b6b;
    padding: 6px 16px;
    border-radius: 4px;
    border: 1px solid rgba(220,53,69,0.3);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
}
.ban-btn:hover { background: rgba(220,53,69,0.35); }

.unban-btn {
    background: rgba(40,167,69,0.18);
    color: #28a745;
    padding: 6px 16px;
    border-radius: 4px;
    border: 1px solid rgba(40,167,69,0.3);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
}
.unban-btn:hover { background: rgba(40,167,69,0.35); }

.btn-cancel {
    padding: 10px 20px;
    background: rgba(108,117,125,0.25);
    color: #aaa;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
}

/* ---- Pagination ---- */
.pagination {
    display: flex;
    gap: 6px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.page-btn {
    padding: 6px 12px;
    background: rgba(45,50,59,0.6);
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.88rem;
    transition: background 0.2s;
}

.page-btn:hover   { background: rgba(255,215,0,0.15); }
.page-btn.active  { background: #FFD700; color: #0F1115; font-weight: bold; }

/* ---- Status badges ---- */
.status-badge {
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: bold;
}
.status-active   { background: rgba(40,167,69,0.2);    color: #28a745; }
.status-upcoming { background: rgba(255,215,0,0.2);    color: #FFD700; }
.status-ended    { background: rgba(108,117,125,0.25); color: #888;    }

/* ---- Edit panel (users / giveaway manage) ---- */
.edit-panel {
    background: rgba(45,50,59,0.6);
    padding: 25px;
    border-radius: 12px;
    border: 2px solid rgba(255,215,0,0.2);
    margin-bottom: 25px;
}

.edit-panel h3 {
    color: #FFD700;
    margin: 0 0 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.edit-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.edit-section {
    background: rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 8px;
}

.edit-section h4 {
    color: #aaa;
    margin: 0 0 12px;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ---- Form inputs (users page) ---- */
.role-select {
    background: #2D323B;
    color: white;
    border: 1px solid rgba(255,215,0,0.3);
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 0.82rem;
}

.pass-input {
    background: #2D323B;
    color: white;
    border: 1px solid rgba(255,215,0,0.3);
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 0.85rem;
    width: 200px;
}

/* ---- Analytics ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
    margin: 20px 0 30px;
}

.stat-box {
    background: rgba(45,50,59,0.6);
    padding: 20px 15px;
    border-radius: 12px;
    border: 2px solid rgba(184,134,11,0.3);
    text-align: center;
}

.stat-num   { font-size: 1.9rem; font-weight: bold; color: #FFD700; }
.stat-label { color: #aaa; font-size: 0.8rem; margin-top: 6px; }

.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.chart-full { grid-column: 1 / -1; }

.chart-box {
    background: rgba(45,50,59,0.6);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid rgba(184,134,11,0.3);
    min-width: 0;
}

.chart-box h3         { color: #FFD700; margin: 0 0 15px; font-size: 1rem; }
.chart-box canvas     { width: 100% !important; }

/* ---- Blog editor (Quill) ---- */
.blog-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.blog-form label {
    color: #FFD700;
    font-weight: bold;
    font-size: 0.9rem;
}

.blog-form input[type=text] {
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid rgba(255,215,0,0.3);
    background: #2D323B;
    color: white;
    font-size: 1rem;
}

.blog-form input[type=text]:focus {
    outline: none;
    border-color: #FFD700;
}

.blog-form button {
    padding: 12px 30px;
    background: linear-gradient(135deg, #FFD700, #B8860B);
    color: #0F1115;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    align-self: flex-start;
    margin-top: 10px;
}

#editor                  { background: #2D323B; color: white; font-size: 1rem; border-radius: 0 0 6px 6px; }
.ql-toolbar.ql-snow      { background: #1e2229; border: 1px solid rgba(255,215,0,0.3) !important; border-radius: 6px 6px 0 0; }
.ql-container.ql-snow    { border: 1px solid rgba(255,215,0,0.3) !important; border-top: none !important; border-radius: 0 0 6px 6px; }
.ql-editor               { min-height: 400px; color: white; }
.ql-snow .ql-stroke      { stroke: #aaa !important; }
.ql-snow .ql-fill        { fill: #aaa !important; }
.ql-snow .ql-picker      { color: #aaa !important; }
.ql-snow .ql-picker-options { background: #2D323B; border-color: rgba(255,215,0,0.3); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .chart-grid    { grid-template-columns: 1fr; }
    .chart-full    { grid-column: auto; }
}

@media (max-width: 600px) {
    .stats-grid    { grid-template-columns: 1fr 1fr; }
    .edit-actions  { grid-template-columns: 1fr; }
    .pass-input    { width: 100%; }
}
