/* webadmin/public/css/styles.css
   Светлая тема в стиле ragemp.pro. Минималистичная, без эмодзи.
   — Фон: #f7f8fa
   — Карточки: белые с тонкой рамкой #e5e7ec и radius 12px
   — Sidebar: белый, активный пункт — тёмно-синий #1e293b
   — Шрифт: Inter (Google Fonts)
   — Акцент: #2962ff (синий)
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* { box-sizing: border-box; }

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f7f8fa;
  color: #1e293b;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Sidebar ── */
aside {
  background: #ffffff !important;
  border-right: 1px solid #e5e7ec;
  width: 240px !important;
  display: flex;
  flex-direction: column;
}

aside .border-b {
  border-color: #e5e7ec !important;
  border-bottom: 1px solid #e5e7ec;
}

/* Логотип в шапке sidebar */
aside .logo-tile {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #1e293b;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
}

/* Группа в sidebar */
.nav-group-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  padding: 12px 16px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  color: #475569;
  text-decoration: none;
  font-weight: 500;
  font-size: 13.5px;
  margin: 0;
  border-radius: 0;
  transition: background 0.15s;
}

.nav-link:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.nav-link.active {
  background: #1e293b;
  color: #fff;
  border-radius: 8px;
  margin: 0 8px;
  padding: 8px 12px;
}

.nav-link.active::before { content: none; }

.nav-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}

/* ── Main area + Header ── */
main {
  background: #f7f8fa !important;
  padding: 0 !important;
}

.app-header {
  background: #fff;
  border-bottom: 1px solid #e5e7ec;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #64748b;
}
.breadcrumbs .crumb-current { color: #1e293b; font-weight: 500; }
.breadcrumbs .sep { color: #cbd5e1; }

.search-input {
  position: relative;
  width: 300px;
}
.search-input input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid #e5e7ec;
  border-radius: 8px;
  background: #f8f9fb;
  font-size: 13.5px;
  color: #1e293b;
  outline: none;
}
.search-input input:focus { border-color: #2962ff; background: #fff; }
.search-input::before {
  content: '';
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.35-4.35'/></svg>") center/contain no-repeat;
}
.kbd-hint {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 11px; color: #94a3b8;
  background: #f1f5f9;
  padding: 2px 6px; border-radius: 4px;
}

.view-area { padding: 24px; }

/* ── Cards ── */
.card {
  background: #fff;
  border: 1px solid #e5e7ec;
  border-radius: 12px;
  padding: 16px;
}

.card-title { font-size: 14px; font-weight: 600; color: #1e293b; }
.card-subtitle { font-size: 12px; color: #64748b; margin-top: 2px; }

/* KPI-карточка как на скриншоте */
.kpi {
  background: #fff;
  border: 1px solid #e5e7ec;
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 100px;
}
.kpi-label {
  font-size: 13px;
  color: #1e293b;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.kpi-value {
  font-size: 24px;
  font-weight: 600;
  color: #1e293b;
  margin-top: 8px;
  line-height: 1.2;
}
.kpi-sub {
  font-size: 12px;
  color: #94a3b8;
  margin-top: auto;
  padding-top: 8px;
}
.kpi-icon {
  width: 18px; height: 18px;
  color: #94a3b8;
  flex-shrink: 0;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  background: #fff;
  color: #1e293b;
  cursor: pointer;
  border: 1px solid #e5e7ec;
  transition: all 0.15s;
  font-family: inherit;
  text-decoration: none;
}
.btn:hover { background: #f8f9fb; border-color: #cbd5e1; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: #2962ff;
  border-color: #2962ff;
  color: #fff;
}
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }

.btn-danger {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}
.btn-danger:hover { background: #dc2626; border-color: #dc2626; }

.btn-success {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
}
.btn-success:hover { background: #059669; border-color: #059669; }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: #475569;
}
.btn-ghost:hover { background: #f1f5f9; color: #1e293b; }

/* ── Inputs ── */
.input,
input[type="text"], input[type="number"], input[type="password"],
input[type="email"], input[type="search"], input[type="color"],
input[type="date"], textarea, select {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  background: #fff;
  color: #1e293b;
  border: 1px solid #e5e7ec;
  outline: none;
  font-family: inherit;
  font-size: 13.5px;
}
.input:focus, input:focus, textarea:focus, select:focus {
  border-color: #2962ff;
  box-shadow: 0 0 0 3px rgba(41, 98, 255, 0.1);
}
input[type="checkbox"] { accent-color: #2962ff; width: 16px; height: 16px; }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e5e7ec;
}
.badge-red    { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.badge-green  { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.badge-amber  { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.badge-blue   { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }

/* ── Tables ── */
table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.tbl th, table.tbl td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
}
table.tbl th {
  font-weight: 500;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  background: #f8f9fb;
  border-bottom: 1px solid #e5e7ec;
}
table.tbl tr:hover td { background: #fafbfc; }

/* Цветные акценты в таблицах под светлую тему */
.text-rose-300, .text-rose-400 { color: #2962ff !important; font-weight: 500; }
.text-rose-400 { color: #dc2626 !important; }
.text-amber-400 { color: #d97706 !important; }
.text-emerald-400 { color: #10b981 !important; }
.text-blue-400 { color: #2962ff !important; }
.text-rose-300 { color: #2962ff !important; }

/* Slate-overrides для светлой темы */
.text-white\/30, .text-slate-500, .text-slate-600 { color: #94a3b8 !important; }
.text-white\/40, .text-slate-400 { color: #94a3b8 !important; }
.text-white\/50 { color: #64748b !important; }
.text-white\/60 { color: #475569 !important; }
.text-white\/70 { color: #334155 !important; }
.text-white\/80 { color: #1e293b !important; }

.bg-slate-900, .bg-slate-950, .bg-slate-800, .bg-slate-700 {
  background: transparent !important;
}
.ring-1, .ring-white\/5, .ring-white\/10 { box-shadow: none !important; }

/* Fix bg-black/30 etc — make them light */
[class*="bg-black"], .bg-white\/5, .bg-white\/10 {
  background: #f8f9fb !important;
}
.bg-rose-950\/40 { background: #fef2f2 !important; }
.bg-amber-950\/40, .bg-amber-950\/30 { background: #fffbeb !important; }
.bg-emerald-950\/40 { background: #f0fdf4 !important; }
.ring-rose-500\/20, .ring-amber-500\/20, .ring-amber-500\/30, .ring-emerald-500\/20 {
  box-shadow: none !important;
  border: 1px solid #e5e7ec;
}

/* Стрелки и сепараторы */
.divider {
  height: 1px;
  background: #e5e7ec;
  margin: 16px 0;
}

/* ── Spinner ── */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid #e5e7ec;
  border-top-color: #2962ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Scrollbars ── */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Утилиты ── */
code, pre { font-family: 'Monaco', 'Menlo', monospace; font-size: 12.5px; }
pre { background: #f8f9fb; padding: 8px 12px; border-radius: 6px; border: 1px solid #e5e7ec; }
hr { border-color: #e5e7ec; }

/* Headings */
h1 { font-size: 22px; font-weight: 600; color: #1e293b; }
h2 { font-size: 16px; font-weight: 600; color: #1e293b; }
h3 { font-size: 14px; font-weight: 600; color: #1e293b; }

/* Утилиты */
.hidden { display: none !important; }

/* Жёсткая блокировка размеров Chart.js */
.chart-box {
  position: relative;
  width: 100%;
  overflow: hidden;
}
.chart-box canvas {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  display: block;
}

/* Анимации появления */
.view-area > div { animation: fadeIn 0.2s ease-out; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(2px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Notification dropdown */
#notifDropdown {
  background: #fff !important;
  border: 1px solid #e5e7ec !important;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

/* Toast */
#toast {
  background: #1e293b;
  color: #fff;
  border-radius: 8px;
  font-size: 13.5px;
  padding: 10px 14px;
}

/* Logout button */
#logoutBtn {
  margin: 8px;
  background: transparent;
  color: #475569;
  border-top: 1px solid #e5e7ec;
  border-radius: 0;
  padding: 12px 16px;
  font-size: 13.5px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
#logoutBtn:hover { background: #f8f9fb; color: #ef4444; }

/* Bell button */
#notifBell { color: #64748b; }
#notifBell:hover { color: #1e293b; }
#notifBadge {
  background: #2962ff;
}

/* Sidebar footer with user info */
.sb-userinfo {
  border-top: 1px solid #e5e7ec;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sb-userinfo .avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #1e293b;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 13px;
}

/* Online status dot */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #10b981;
}
.status-dot-off { background: #cbd5e1; }

/* ────────── Бургер-меню (для мобилок) ────────── */
.sb-toggle {
  display: none;          /* по умолчанию скрыта на десктопе */
  position: fixed;
  top: 12px; left: 12px;
  width: 40px; height: 40px;
  background: #fff;
  border: 1px solid #e5e7ec;
  border-radius: 8px;
  color: #1e293b;
  cursor: pointer;
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.sb-toggle:hover { background: #f8f9fb; }

.sb-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 90;
}

/* ────────── РЕСПОНСИВ ────────── */

/* Планшет (≤ 1024px) */
@media (max-width: 1024px) {
  /* KPI 6→3 колонки */
  [style*="grid-template-columns:repeat(6,1fr)"],
  [style*="grid-template-columns: repeat(6,1fr)"],
  [style*="grid-template-columns:repeat(6, 1fr)"] {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  /* Грид 2x → 1 на планшете в карточке игрока */
  [style*="grid-template-columns:2fr 1fr"],
  [style*="grid-template-columns: 2fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Уменьшаем шапку */
  .app-header { padding: 10px 16px; }
  .search-input { width: 220px; }
  .view-area { padding: 16px; }
  h1 { font-size: 18px; }
}

/* Большой телефон / малый планшет (≤ 768px) */
@media (max-width: 768px) {
  /* Бургер появляется */
  .sb-toggle { display: flex; }

  /* Sidebar превращается в выезжающую панель */
  aside {
    position: fixed !important;
    top: 0; left: 0; bottom: 0;
    width: 260px !important;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 150;
    box-shadow: 2px 0 16px rgba(0,0,0,0.06);
  }
  aside.open { transform: translateX(0); }
  .sb-backdrop.show { display: block; }

  /* Шапка отступ для бургера */
  .app-header { padding-left: 60px; }

  /* KPI 3→2 */
  [style*="grid-template-columns:repeat(6,1fr)"],
  [style*="grid-template-columns: repeat(6,1fr)"],
  [style*="grid-template-columns:repeat(6, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Поиск глобальный — короче */
  .search-input { width: 160px; }
  .kbd-hint { display: none; }

  /* Хлебные крошки коротко */
  .breadcrumbs { font-size: 12px; }

  /* Большие KPI компактнее */
  .kpi-value { font-size: 20px; }
  .kpi { padding: 12px; min-height: 86px; }

  /* Таблицы — горизонтальный скролл */
  .card { padding: 12px; }
  table.tbl {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  /* Notification dropdown — фуллскрин */
  #notifDropdown {
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    top: 60px !important;
  }

  /* Все 4-колоночные сетки на планшете → 2 */
  .grid-cols-4, [style*="grid-template-columns:repeat(4,1fr)"] { grid-template-columns: repeat(2, 1fr) !important; }
  .md\\:grid-cols-4 { grid-template-columns: repeat(2, 1fr) !important; }
}

/* Телефон (≤ 480px) */
@media (max-width: 480px) {
  /* KPI в одну колонку */
  [style*="grid-template-columns:repeat(6,1fr)"],
  [style*="grid-template-columns: repeat(6,1fr)"],
  [style*="grid-template-columns:repeat(6, 1fr)"],
  [style*="grid-template-columns:repeat(4,1fr)"],
  [style*="grid-template-columns:repeat(3,1fr)"] {
    grid-template-columns: 1fr !important;
  }

  .grid-cols-2, .md\\:grid-cols-2, .grid-cols-3, .md\\:grid-cols-3 {
    grid-template-columns: 1fr !important;
  }

  .app-header {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    padding: 12px 16px 12px 60px;
  }
  .breadcrumbs { font-size: 11px; }
  .search-input { width: 100%; }

  .view-area { padding: 12px; }

  h1 { font-size: 16px; }
  h2 { font-size: 14px; }
  .kpi-value { font-size: 18px; }
  .kpi-label { font-size: 12px; }
  .kpi-sub { font-size: 11px; }

  .btn { padding: 6px 10px; font-size: 12.5px; }
  table.tbl th, table.tbl td { padding: 8px 10px; font-size: 12.5px; }

  /* Login-форма */
  .login-card { padding: 24px !important; }
}
