/* ============================================================
   АДМИН-ПАНЕЛЬ + БАННЕР ЗАЯВОК
   ============================================================ */

/* Вкладки */
.admin-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 14px;
}
.admin-tab {
  padding: 10px 8px;
  border: none;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.15s;
  position: relative;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.admin-tab.active {
  background: var(--accent);
  color: #fff;
}
.admin-tab .tab-badge {
  position: absolute;
  top: 4px;
  right: 6px;
  background: var(--danger);
  color: #fff;
  border-radius: 8px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: bold;
  min-width: 16px;
  display: none;
}
.admin-tab .tab-badge.show { display: inline-block; }

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

/* Пользователи */
.admin-user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
  margin-bottom: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.admin-user-item:active { background: var(--bg-tertiary); }
.admin-user-item .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 15px;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.admin-user-item .info { flex: 1; min-width: 0; }
.admin-user-item .name {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 2px;
}
.admin-user-item .rank {
  font-size: 12px;
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-user-item .marks {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  font-size: 14px;
}

/* Заявки */
.pending-item {
  padding: 12px;
  border-radius: 10px;
  background: var(--bg);
  margin-bottom: 8px;
  border-left: 3px solid var(--warn);
}
.pending-item .pending-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.pending-item .pending-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--warn);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 15px;
  flex-shrink: 0;
}
.pending-item .pending-info { flex: 1; min-width: 0; }
.pending-item .pending-name {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 2px;
}
.pending-item .pending-time {
  font-size: 12px;
  color: var(--text-muted);
}
.pending-item .pending-actions {
  display: flex;
  gap: 8px;
}
.pending-item .pending-btn {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.pending-item .pending-btn:active { opacity: 0.7; }
.pending-item .pending-btn.approve {
  background: var(--ok);
  color: #fff;
}
.pending-item .pending-btn.reject {
  background: rgba(224,74,74,0.2);
  color: var(--danger);
}

/* Статистика */
.stats-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.stats-card {
  padding: 12px;
  background: var(--bg);
  border-radius: 10px;
  text-align: center;
}
.stats-card .stats-value {
  font-size: 22px;
  font-weight: bold;
  color: var(--accent);
  margin-bottom: 4px;
}
.stats-card .stats-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.stats-section-title {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 14px 0 8px;
}
.stats-user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 10px;
  margin-bottom: 6px;
  cursor: pointer;
}
.stats-user-item:active { background: var(--bg-tertiary); }
.stats-user-item .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.stats-user-item .info { flex: 1; min-width: 0; }
.stats-user-item .name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stats-user-item .meta {
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stats-user-item .count {
  font-size: 18px;
  font-weight: bold;
  color: var(--accent);
  flex-shrink: 0;
}

.login-history-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 4px;
  font-size: 12px;
  gap: 8px;
}
.login-history-item .when {
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.login-history-item .device {
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Настройки */
.admin-section {
  padding: 14px;
  background: var(--bg);
  border-radius: 12px;
  margin-bottom: 10px;
}
.admin-section h4 {
  font-size: 14px;
  margin-bottom: 10px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.admin-section input[type="text"] {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 15px;
  outline: none;
  margin-bottom: 8px;
}
.admin-section button {
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  font-size: 14px;
  width: 100%;
}
.admin-section button.secondary {
  background: var(--bg-tertiary);
  color: var(--text);
}
.admin-section button + button {
  margin-top: 8px;
}

.admin-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}

/* Бейдж в пункте «Админ-панель» профиля */
.admin-item-badge {
  display: none;
  background: var(--danger);
  color: #fff;
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: bold;
  margin-left: 8px;
  vertical-align: middle;
}

/* ============================================================
   БАННЕР О НОВОЙ ЗАЯВКЕ (появляется поверх экрана)
   ============================================================ */

.pending-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top));
  background: linear-gradient(135deg, #f5a623, #e68900);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  animation: slideDownBanner 0.35s ease;
}
@keyframes slideDownBanner {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.pending-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 700px;
  margin: 0 auto;
}
.pending-banner-icon {
  font-size: 26px;
  flex-shrink: 0;
  animation: bellShake 1s infinite;
}
@keyframes bellShake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-15deg); }
  75% { transform: rotate(15deg); }
}
.pending-banner-text {
  flex: 1;
  min-width: 0;
  color: #fff;
}
.pending-banner-title {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 2px;
}
.pending-banner-sub {
  font-size: 12px;
  opacity: 0.95;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pending-banner-btn {
  padding: 8px 16px;
  background: rgba(255,255,255,0.25);
  border: 1px solid rgba(255,255,255,0.5);
  color: #fff;
  border-radius: 8px;
  font-weight: bold;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.pending-banner-btn:active { background: rgba(255,255,255,0.4); }

.pending-banner-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  flex-shrink: 0;
  opacity: 0.8;
}
.pending-banner-close:active { opacity: 1; }