/* ════════════════════════════════════════
   ХАБ Платформа — hub.css
   Все общие стили
════════════════════════════════════════ */

:root {
  --green-dark:   #1e6b1e;
  --green-mid:    #2d9e2d;
  --green-main:   #4caf50;
  --green-light:  #a8d8a8;
  --green-pale:   #e8f5e8;
  --green-pale2:  #f2faf2;
  --gold:         #c8a820;
  --gold-light:   #f0d060;
  --gold-pale:    #fdf6d8;
  --text:         #1a3a1a;
  --text-mid:     #3a5a3a;
  --text-muted:   #7a9a7a;
  --white:        #ffffff;
  --bg:           #f7fbf7;
  --border:       rgba(76,175,80,0.18);
  --border-mid:   rgba(76,175,80,0.32);
  --shadow-sm:    0 2px 12px rgba(30,107,30,0.08);
  --shadow-md:    0 4px 24px rgba(30,107,30,0.12);
  --shadow-lg:    0 8px 40px rgba(30,107,30,0.16);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Golos Text', sans-serif; background: var(--bg); color: var(--text); overflow-x: hidden; }

/* ════════════════════════════════════════
   LOGIN SCREEN
════════════════════════════════════════ */
#screen-login {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #edf7ed 0%, #f7fbf7 55%, #fff9e6 100%);
  position: relative; overflow: hidden;
}
.login-bg-circle { position: absolute; border-radius: 50%; pointer-events: none; }
.login-bg-circle.c1 {
  width: 600px; height: 600px; top: -150px; right: -100px;
  background: radial-gradient(circle, rgba(76,175,80,.15) 0%, transparent 70%);
  animation: breathe 8s ease-in-out infinite;
}
.login-bg-circle.c2 {
  width: 400px; height: 400px; bottom: -80px; left: 10%;
  background: radial-gradient(circle, rgba(200,168,32,.12) 0%, transparent 70%);
  animation: breathe 10s ease-in-out infinite reverse;
}
@keyframes breathe { 0%,100%{transform:scale(1)} 50%{transform:scale(1.07)} }

.login-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 24px; padding: 48px 44px;
  width: 420px; max-width: 95vw;
  box-shadow: var(--shadow-lg);
  position: relative; z-index: 1;
  animation: slideUp .4s ease;
}
@keyframes slideUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }

.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
.login-logo-badge {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(135deg, var(--green-main), var(--green-dark));
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.login-logo-badge svg { width: 26px; height: 26px; }

/* ─────────────────────────────────
   OTP-инпут (6 отдельных ячеек)
───────────────────────────────── */
.otp-input {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin: 24px 0 20px 0;
}
.otp-digit {
  width: 100%;
  aspect-ratio: 1 / 1.1;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  font-family: 'Golos Text', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--green-dark);
  text-align: center;
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
  padding: 0;
}
.otp-digit:focus {
  border-color: var(--green-main);
  box-shadow: 0 0 0 3px rgba(76,175,80,.15);
  background: var(--white);
}
.otp-digit:not(:placeholder-shown),
.otp-digit:valid:not(:empty) {
  background: var(--white);
  border-color: var(--border-mid);
}

/* ─────────────────────────────────
   Футер-действия на экране кода
───────────────────────────────── */
.login-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  gap: 8px;
}
.login-link {
  background: none;
  border: none;
  color: var(--text-mid);
  font-family: 'Golos Text', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 2px;
  transition: color .15s;
}
.login-link:hover:not(:disabled) {
  color: var(--green-dark);
}
.login-link:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}
.login-logo-name { font-family: 'Unbounded', sans-serif; font-size: 14px; font-weight: 700; color: var(--green-dark); letter-spacing: -0.3px; line-height: 1.2; }
.login-logo-sub { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-top: 2px; }
.login-title { font-family: 'Unbounded', sans-serif; font-size: 22px; font-weight: 900; color: var(--green-dark); line-height: 1.2; margin-bottom: 8px; }
.login-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 32px; line-height: 1.6; }
.login-hint { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 16px; }

/* ════════════════════════════════════════
   ОБЩИЕ ФОРМЫ
════════════════════════════════════════ */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-mid); margin-bottom: 7px; }
.form-input {
  width: 100%; padding: 13px 16px;
  border: 1.5px solid var(--border); border-radius: 12px;
  font-family: 'Golos Text', sans-serif;
  font-size: 14px; color: var(--text); background: var(--bg);
  outline: none; transition: border-color .18s, box-shadow .18s;
}
.form-input:focus { border-color: var(--green-main); box-shadow: 0 0 0 3px rgba(76,175,80,.15); background: var(--white); }
.form-input::placeholder { color: var(--text-muted); }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-select {
  width: 100%; padding: 13px 16px;
  border: 1.5px solid var(--border); border-radius: 12px;
  font-family: 'Golos Text', sans-serif;
  font-size: 14px; color: var(--text); background: var(--bg);
  outline: none; transition: border-color .18s; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a9a7a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}
.form-select:focus { border-color: var(--green-main); box-shadow: 0 0 0 3px rgba(76,175,80,.15); }
.form-section-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin: 16px 0 10px; }

.flags-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.flag-toggle {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid var(--border); background: var(--bg);
  cursor: pointer; transition: all .15s;
}
.flag-toggle:hover { border-color: var(--green-main); background: var(--green-pale2); }
.flag-toggle input[type=checkbox] { accent-color: var(--green-main); width: 15px; height: 15px; flex-shrink: 0; cursor: pointer; }
.flag-toggle-label { font-size: 12px; font-weight: 600; color: var(--text-mid); line-height: 1.3; }
.flag-toggle-sub { font-size: 10px; color: var(--text-muted); margin-top: 1px; }

/* ════════════════════════════════════════
   КНОПКИ
════════════════════════════════════════ */
.btn-login {
  width: 100%; padding: 15px;
  background: linear-gradient(135deg, var(--green-main), var(--green-dark));
  color: var(--white); border: none; border-radius: 14px;
  font-family: 'Golos Text', sans-serif; font-size: 15px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: opacity .18s, transform .18s; margin-top: 8px;
}
.btn-login:hover { opacity: .92; transform: translateY(-1px); }

.topbar-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 20px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .15s; border: none; font-family: 'Golos Text', sans-serif;
}
.topbar-btn-ghost { background: transparent; color: var(--text-mid); border: 1.5px solid var(--border-mid); }
.topbar-btn-ghost:hover { background: var(--green-pale); color: var(--green-dark); }
.topbar-btn-primary {
  background: linear-gradient(135deg, var(--green-main), var(--green-dark));
  color: var(--white); box-shadow: 0 4px 14px rgba(45,158,45,.3);
}
.topbar-btn-primary:hover { opacity: .92; transform: translateY(-1px); }

.modal-btn {
  padding: 11px 22px; border-radius: 12px; font-size: 14px; font-weight: 600;
  cursor: pointer; border: none; transition: all .15s; font-family: 'Golos Text', sans-serif;
}
.modal-btn-ghost { background: var(--bg); color: var(--text-mid); border: 1.5px solid var(--border-mid); }
.modal-btn-ghost:hover { background: var(--green-pale); }
.modal-btn-primary { background: linear-gradient(135deg, var(--green-main), var(--green-dark)); color: var(--white); box-shadow: 0 4px 14px rgba(45,158,45,.3); }
.modal-btn-primary:hover { opacity: .92; transform: translateY(-1px); }

.bc-btn { flex: 1; padding: 7px; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s; border: none; font-family: 'Golos Text', sans-serif; text-align: center; }
.bc-btn-ghost { background: var(--bg); color: var(--text-mid); border: 1px solid var(--border); }
.bc-btn-ghost:hover { background: var(--green-pale); color: var(--green-dark); }
.bc-btn-danger { background: #fff0f0; color: #c0392b; border: 1px solid #f0c0c0; }
.bc-btn-add {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 1.5rem; border: 2px dashed var(--border-mid);
  border-radius: 16px; background: transparent; cursor: pointer;
  color: var(--text-muted); font-size: 13px; font-weight: 600;
  transition: all .15s; font-family: 'Golos Text', sans-serif; width: 100%;
}
.bc-btn-add:hover { border-color: var(--green-main); color: var(--green-dark); background: var(--green-pale2); }

/* ════════════════════════════════════════
   LAYOUT — HUB INTERFACE
════════════════════════════════════════ */
#screen-hub { display: none; min-height: 100vh; }
.hub-layout { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: 240px; min-width: 240px;
  background: var(--white); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
}
.sidebar-top { padding: 20px 20px 16px; border-bottom: 1px solid var(--border); }
.sidebar-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.sidebar-badge {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--green-main), var(--green-dark));
  display: flex; align-items: center; justify-content: center;
}
.sidebar-badge svg { width: 18px; height: 18px; }
.sidebar-name { font-family: 'Unbounded', sans-serif; font-size: 12px; font-weight: 700; color: var(--green-dark); line-height: 1.2; }
.sidebar-ver { font-size: 10px; color: var(--text-muted); font-weight: 500; }
.sidebar-consolidator {
  display: flex; align-items: center; gap: 8px;
  background: var(--green-pale2); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 12px; margin-top: 12px;
}
.sidebar-con-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-main); flex-shrink: 0; animation: blink 2.5s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }
.sidebar-con-name { font-size: 12px; font-weight: 600; color: var(--text-mid); }
.sidebar-con-role { font-size: 10px; color: var(--text-muted); margin-top: 1px; }
.sidebar-nav { flex: 1; padding: 12px; overflow-y: auto; }

.nav-section-label {
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 12px 8px 6px; font-family: 'Unbounded', sans-serif;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px;
  font-size: 13px; font-weight: 500; color: var(--text-mid);
  cursor: pointer; transition: all .15s; margin-bottom: 2px;
  position: relative; text-decoration: none;
}
.nav-item:hover { background: var(--green-pale); color: var(--green-dark); }
.nav-item.active { background: var(--green-pale); color: var(--green-dark); font-weight: 600; }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px; border-radius: 2px; background: var(--green-main);
}
.nav-icon {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.nav-item:hover .nav-icon,
.nav-item.active .nav-icon { background: rgba(76,175,80,.15); }
.nav-icon svg { width: 16px; height: 16px; }
.nav-badge {
  margin-left: auto; background: var(--green-main); color: var(--white);
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 10px;
  font-family: 'Unbounded', sans-serif;
}
.nav-badge-gold { background: var(--gold); }
.nav-soon { margin-left: auto; background: var(--gold-pale); color: var(--gold); font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 10px; }

.sidebar-bottom { padding: 12px; border-top: 1px solid var(--border); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; transition: background .15s; }
.sidebar-user:hover { background: var(--green-pale); }
.sidebar-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--green-main), var(--green-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--white); font-family: 'Unbounded', sans-serif;
}
.sidebar-user-name { font-size: 12px; font-weight: 600; color: var(--text-mid); }
.sidebar-user-role { font-size: 10px; color: var(--text-muted); }
.sidebar-logout {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; border-radius: 10px; cursor: pointer;
  font-size: 12px; color: var(--text-muted); margin-top: 4px; transition: all .15s;
}
.sidebar-logout:hover { background: #fff0f0; color: #c0392b; }

/* ── Main ── */
.hub-main { flex: 1; margin-left: 240px; display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* ── Topbar ── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.96); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar-breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.bc-parent { color: var(--text-muted); }
.bc-sep { color: var(--text-muted); font-size: 12px; }
.bc-current { font-weight: 600; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 10px; }

/* ── Pages ── */
.hub-page { display: none; flex: 1; padding: 2rem; overflow-y: auto; }
.hub-page.active { display: block; }

/* ── Page header ── */
.page-header { margin-bottom: 2rem; }
.page-title { font-family: 'Unbounded', sans-serif; font-size: 22px; font-weight: 900; color: var(--green-dark); margin-bottom: 6px; }
.page-sub { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* ════════════════════════════════════════
   DASHBOARD
════════════════════════════════════════ */
.dash-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }
.dash-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 16px; padding: 1.25rem;
  transition: box-shadow .15s, transform .15s;
}
.dash-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.dash-card-icon { width: 40px; height: 40px; border-radius: 10px; margin-bottom: 12px; display: flex; align-items: center; justify-content: center; }
.dash-card-icon.green { background: var(--green-pale); }
.dash-card-icon.gold  { background: var(--gold-pale); }
.dash-card-icon.blue  { background: #e8f0fa; }
.dash-card-icon svg { width: 20px; height: 20px; }
.dash-card-val { font-family: 'Unbounded', sans-serif; font-size: 28px; font-weight: 900; color: var(--green-dark); line-height: 1; }
.dash-card-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
.dash-card-delta { font-size: 11px; color: var(--green-mid); margin-top: 6px; font-weight: 600; }

/* ── Multi-параметр карточки (Заказы / Доставка / Сборы / Участники) ── */
.dash-card-multi { display: flex; flex-direction: column; padding: 1rem 1.1rem; }
.dash-card-multi .dash-card-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.dash-card-multi .dash-card-icon {
  width: 32px; height: 32px; margin-bottom: 0; border-radius: 8px;
}
.dash-card-multi .dash-card-icon svg { width: 16px; height: 16px; }
.dash-card-multi .dash-card-title {
  font-family: 'Unbounded', sans-serif; font-size: 13px; font-weight: 700;
  color: var(--green-dark);
}
.dash-card-rows { display: flex; flex-direction: column; gap: 6px; }
.dash-card-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; min-width: 0;
}
.dash-card-row-label {
  font-size: 11px; color: var(--text-muted); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-card-row-val {
  font-family: 'Unbounded', sans-serif; font-size: 15px; font-weight: 700;
  color: var(--green-dark); line-height: 1.2; white-space: nowrap;
}

/* ── Селектор Месяц + Год в подвале карточки «Выдано за период» ── */
.dash-card-period {
  display: flex; gap: 6px; margin-top: 12px; padding-top: 10px;
  border-top: 1px solid var(--border);
}
.dash-period-wrap { position: relative; flex: 1; }
.dash-period-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 6px 10px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  font: inherit; font-size: 12px; font-weight: 600; color: var(--text);
  cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.dash-period-btn:hover { border-color: var(--border-mid); background: var(--white); }
.dash-period-btn.active { border-color: var(--green-main); background: var(--white); }
.dash-period-btn svg { color: var(--text-muted); flex-shrink: 0; }

.dash-period-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 50;
  background: var(--white); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-md);
  max-height: 240px; overflow-y: auto;
  display: none; padding: 4px;
}
.dash-period-dropdown.open { display: block; }
.dash-period-option {
  padding: 7px 10px; font-size: 12px; color: var(--text);
  border-radius: 6px; cursor: pointer;
  transition: background .12s ease;
}
.dash-period-option:hover { background: var(--green-pale2); }
.dash-period-option.selected {
  background: var(--green-pale); color: var(--green-dark); font-weight: 600;
}
.dash-bots-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 2rem; }
.dash-section-title { font-family: 'Unbounded', sans-serif; font-size: 13px; font-weight: 700; color: var(--green-dark); margin-bottom: 1rem; }
.bot-list { display: flex; flex-direction: column; gap: 8px; }
.bot-item { display: flex; align-items: center; gap: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.bot-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.bot-dot.online { background: var(--green-main); animation: blink 3s infinite; }
.bot-dot.offline { background: #e57373; }
.bot-name { font-size: 13px; font-weight: 600; color: var(--text-mid); flex: 1; }
.bot-url { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.bot-type-badge { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 8px; }
.bot-type-opt    { background: var(--gold-pale); color: var(--gold); }
.bot-type-retail { background: var(--green-pale); color: var(--green-dark); }

/* ════════════════════════════════════════
   BOTS PAGE
════════════════════════════════════════ */
.bots-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.bots-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.bot-card { background: var(--white); border: 1px solid var(--border); border-radius: 16px; padding: 1.25rem; transition: box-shadow .15s, transform .15s; }
.bot-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.bot-card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.bot-card-icon { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, var(--green-main), var(--green-dark)); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bot-card-icon svg { width: 22px; height: 22px; }
.bot-card-status { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; }
.bot-card-status.on { color: var(--green-mid); }
.bot-card-status.off { color: #e57373; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; }
.status-dot.on { background: var(--green-main); }
.status-dot.off { background: #e57373; }
.bot-card-name { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.bot-card-url { font-size: 11px; color: var(--text-muted); margin-bottom: 12px; font-family: monospace; }
.bot-card-flags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.flag { font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 6px; }
.flag-on  { background: var(--green-pale); color: var(--green-dark); }
.flag-off { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.bot-card-divider { height: 1px; background: var(--border); margin: 12px 0; }
.bot-card-actions { display: flex; gap: 8px; }

/* ════════════════════════════════════════
   STUB PAGES
════════════════════════════════════════ */
.stub-page { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.stub-card { text-align: center; max-width: 400px; padding: 3rem; background: var(--white); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-sm); }
.stub-icon-wrap { width: 72px; height: 72px; border-radius: 20px; margin: 0 auto 20px; display: flex; align-items: center; justify-content: center; }
.stub-icon-wrap.green { background: var(--green-pale); }
.stub-icon-wrap.gold  { background: var(--gold-pale); }
.stub-icon-wrap.blue  { background: #e8f0fa; }
.stub-icon-wrap svg { width: 36px; height: 36px; }
.stub-title { font-family: 'Unbounded', sans-serif; font-size: 16px; font-weight: 900; color: var(--green-dark); margin-bottom: 10px; }
.stub-desc { font-size: 14px; color: var(--text-muted); line-height: 1.7; margin-bottom: 20px; }
.stub-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 16px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.stub-badge.in-dev { background: var(--gold-pale); color: var(--gold); }
.stub-badge.ready  { background: var(--green-pale); color: var(--green-dark); }

/* ════════════════════════════════════════
   MODAL
════════════════════════════════════════ */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.35); z-index: 200;
  align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--white); border-radius: 24px; border: 1px solid var(--border);
  padding: 36px; width: 480px; max-width: 95vw;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,.2); animation: slideUp .25s ease;
}
.modal-head { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.modal-head-icon { width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0; background: linear-gradient(135deg, var(--green-main), var(--green-dark)); display: flex; align-items: center; justify-content: center; }
.modal-head-icon svg { width: 24px; height: 24px; }
.modal-head-title { font-family: 'Unbounded', sans-serif; font-size: 17px; font-weight: 900; color: var(--green-dark); }
.modal-head-sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.modal-footer { display: flex; gap: 10px; margin-top: 24px; justify-content: flex-end; }

/* ════════════════════════════════════════
   TOAST
════════════════════════════════════════ */
.toast {
  position: fixed; bottom: 2rem; right: 2rem;
  background: var(--text); color: var(--white);
  padding: 12px 20px; border-radius: 12px; font-size: 13px; font-weight: 500;
  opacity: 0; transform: translateY(10px);
  transition: all .22s; z-index: 300; pointer-events: none;
  box-shadow: 0 8px 32px rgba(0,0,0,.2); max-width: 340px;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .hub-main { margin-left: 0; }
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .bots-grid { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════
   DASHBOARD — ФИЛЬТРЫ И ТАБЛИЦА
════════════════════════════════════════ */
.dash-grid { grid-template-columns: repeat(6, 1fr); }

.dash-filters {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 1rem; flex-wrap: wrap;
}

.dash-filter-wrap { position: relative; }

.dash-filter-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 8px; font-size: 12px; font-weight: 600;
  cursor: pointer; border: 1.5px solid var(--border-mid);
  background: var(--white); color: var(--text-mid);
  font-family: 'Golos Text', sans-serif; transition: all .15s;
  white-space: nowrap;
}
.dash-filter-btn:hover { border-color: var(--green-main); color: var(--green-dark); background: var(--green-pale2); }
.dash-filter-btn.active { border-color: var(--green-main); color: var(--green-dark); background: var(--green-pale); }

.dash-filter-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); left: 0;
  background: var(--white); border: 1px solid var(--border-mid);
  border-radius: 12px; z-index: 50; min-width: 220px;
  box-shadow: var(--shadow-md); overflow: hidden;
}
.dash-filter-dropdown.open { display: block; }

.dash-filter-search { padding: 10px 12px 6px; border-bottom: 1px solid var(--border); }
.dash-filter-search input {
  width: 100%; padding: 7px 10px; border: 1.5px solid var(--border);
  border-radius: 8px; font-size: 12px; color: var(--text);
  background: var(--bg); outline: none; font-family: 'Golos Text', sans-serif;
}
.dash-filter-search input:focus { border-color: var(--green-main); }

.dash-filter-list { max-height: 240px; overflow-y: auto; padding: 6px 0; }

.dash-filter-option {
  padding: 8px 14px; font-size: 13px; color: var(--text-mid);
  cursor: pointer; transition: background .1s; display: flex; align-items: center; gap: 8px;
}
.dash-filter-option:hover { background: var(--green-pale2); color: var(--green-dark); }
.dash-filter-option.selected { color: var(--green-dark); font-weight: 600; }
.dash-filter-option input[type=checkbox] { accent-color: var(--green-main); width: 14px; height: 14px; flex-shrink: 0; }

.dash-filter-divider { height: 1px; background: var(--border); margin: 4px 0; }

.dash-filter-footer {
  display: flex; gap: 12px; padding: 8px 14px;
  border-top: 1px solid var(--border);
}
.dash-filter-link {
  font-size: 12px; color: var(--green-mid); cursor: pointer; font-weight: 600;
}
.dash-filter-link:hover { color: var(--green-dark); text-decoration: underline; }

.dash-date-input {
  border: 1.5px solid var(--border); border-radius: 6px;
  padding: 5px 8px; font-size: 11px; color: var(--text);
  background: var(--bg); outline: none; font-family: 'Golos Text', sans-serif;
  flex: 1;
}
.dash-date-input:focus { border-color: var(--green-main); }

.dash-filter-apply {
  margin-top: 8px; width: 100%; padding: 7px;
  background: linear-gradient(135deg, var(--green-main), var(--green-dark));
  color: var(--white); border: none; border-radius: 6px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: 'Golos Text', sans-serif;
}

/* Фото партнёра (Фича B): мультиселект ботов-источников (отдельное окно) */
.pps-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 11px 14px; background: var(--bg);
  border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer;
  font-size: 13px; color: var(--text-mid); font-family: 'Golos Text', sans-serif;
  text-align: left; transition: border-color .15s ease;
}
.pps-toggle:hover { border-color: var(--border-mid); }
.pps-toggle-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pps-caret { color: var(--text-muted); flex-shrink: 0; font-size: 15px; }

.pps-search { margin-bottom: 6px; }
.pps-search input {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--border);
  border-radius: 10px; font-size: 13px; color: var(--text);
  background: var(--bg); outline: none; font-family: 'Golos Text', sans-serif;
}
.pps-search input:focus { border-color: var(--green-main); }

.pps-list {
  max-height: 320px; overflow-y: auto; padding: 4px 0;
  border: 1px solid var(--border); border-radius: 12px;
}
.pps-empty { padding: 18px; font-size: 12px; color: var(--text-muted); text-align: center; }

.pps-option {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  font-size: 13px; color: var(--text); cursor: pointer; transition: background .1s;
}
.pps-option:hover { background: var(--green-pale2); }
.pps-option input[type=checkbox] { accent-color: var(--green-main); width: 16px; height: 16px; flex-shrink: 0; }
.pps-option-main { flex: 1; min-width: 0; }
.pps-option-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pps-option-tags { display: flex; gap: 8px; margin-top: 2px; }
.pps-tag-nophoto  { font-size: 10px; color: #f59e0b; font-weight: 600; }
.pps-tag-inactive { font-size: 10px; color: #ef4444; font-weight: 600; }

.dash-refresh-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 8px; font-size: 12px; font-weight: 600;
  cursor: pointer; border: 1.5px solid var(--border-mid);
  background: var(--white); color: var(--text-muted);
  font-family: 'Golos Text', sans-serif; transition: all .15s; margin-left: auto;
}
.dash-refresh-btn:hover { color: var(--green-dark); border-color: var(--green-main); }

/* ── Таблица ── */
.dash-table-wrap {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; overflow-x: auto;
}
.dash-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  min-width: 600px;
}
.dash-table thead tr {
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.dash-table thead th {
  padding: 10px 14px; text-align: left;
  font-size: 11px; font-family: 'Unbounded', sans-serif;
  font-weight: 700; color: var(--text-muted);
  letter-spacing: 0.05em; text-transform: uppercase;
  white-space: nowrap; border-right: 1px solid var(--border);
}
.dash-table thead th:last-child { border-right: none; }
.dash-table thead th.col-num { text-align: right; }

.dash-table tbody tr {
  border-bottom: 1px solid var(--border); transition: background .1s;
}
.dash-table tbody tr:last-child { border-bottom: none; }
.dash-table tbody tr:hover { background: var(--green-pale2); }
.dash-table tbody tr.row-error { opacity: .6; }

.dash-table td {
  padding: 11px 14px; color: var(--text-mid); vertical-align: middle;
  border-right: 1px solid var(--border);
}
.dash-table td:last-child { border-right: none; }
.dash-table td.col-num { text-align: right; font-family: 'Golos Text', sans-serif; font-weight: 600; }
.dash-table td.col-name { font-weight: 600; color: var(--text); }

.dash-table tfoot tr {
  background: var(--green-pale2); border-top: 2px solid var(--border-mid);
}
.dash-table tfoot td {
  padding: 10px 14px; font-weight: 700; color: var(--green-dark);
  border-right: 1px solid var(--border);
}
.dash-table tfoot td:last-child { border-right: none; }
.dash-table tfoot td.col-num { text-align: right; }

.bot-status-dot {
  display: inline-block; width: 7px; height: 7px;
  border-radius: 50%; margin-right: 7px; flex-shrink: 0;
}
.bot-status-dot.ok { background: var(--green-main); }
.bot-status-dot.err { background: #e57373; }

/* SIDEBAR — сворачивание: в разработке */

/* ════════════════════════════════════════
   NAV ACCORDION
════════════════════════════════════════ */
.nav-item-accordion { cursor: pointer; }
.nav-accordion-arrow {
  margin-left: auto; flex-shrink: 0;
  transition: transform .2s ease;
  color: var(--text-muted);
}
.nav-item-accordion.open .nav-accordion-arrow {
  transform: rotate(90deg);
}

.nav-submenu {
  display: none;
  padding-left: 12px;
  margin-bottom: 2px;
}
.nav-submenu.open { display: block; }

.nav-subitem {
  padding: 7px 10px 7px 14px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex; align-items: center; gap: 8px;
}
.nav-subitem:hover { color: var(--green-dark); background: var(--green-pale); }
.nav-subitem.active { color: var(--green-dark); font-weight: 600; background: var(--green-pale); }
.nav-subitem.active::before { display: none; }

.nav-subitem-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--text-muted); flex-shrink: 0;
  transition: background .15s;
}
.nav-subitem:hover .nav-subitem-dot,
.nav-subitem.active .nav-subitem-dot { background: var(--green-main); }

/* ════════════════════════════════════════
   BOT CARD — СТАТУС БД
════════════════════════════════════════ */
.bot-card-db-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
.db-status {
  font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: 6px; white-space: nowrap;
}
.db-status-unknown  { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.db-status-checking { background: #fff9e6; color: var(--gold); border: 1px solid rgba(200,168,32,.3); }
.db-status-ok       { background: var(--green-pale); color: var(--green-dark); border: 1px solid rgba(76,175,80,.3); }
.db-status-error    { background: #fff0f0; color: #c0392b; border: 1px solid #f0c0c0; cursor: help; }

/* ════════════════════════════════════════
   SETTINGS MODAL — ВКЛАДКИ
════════════════════════════════════════ */
.settings-tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.settings-tab {
  padding: 8px 16px; font-size: 13px; font-weight: 600;
  color: var(--text-muted); background: transparent;
  border: none; border-bottom: 2px solid transparent;
  cursor: pointer; font-family: 'Golos Text', sans-serif;
  transition: all .15s; margin-bottom: -1px;
}
.settings-tab:hover { color: var(--green-dark); }
.settings-tab.active { color: var(--green-dark); border-bottom-color: var(--green-main); }

/* Toggle switch */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #ccc; border-radius: 24px; transition: .2s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; left: 3px; bottom: 3px;
  background: white; border-radius: 50%; transition: .2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--green-main); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Дни недели */
.weekdays-grid { display: flex; gap: 6px; }
.weekday-btn { cursor: pointer; }
.weekday-btn input { display: none; }
.weekday-btn span {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px;
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  border: 1.5px solid var(--border); background: var(--bg);
  transition: all .15s; cursor: pointer;
}
.weekday-btn input:checked + span {
  background: var(--green-pale); color: var(--green-dark);
  border-color: var(--green-main);
}

/* Группы */
.group-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--border);
  margin-bottom: 8px;
}
.group-item-info { flex: 1; }
.group-item-name { font-size: 13px; font-weight: 600; color: var(--text-mid); }
.group-item-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.group-item-actions { display: flex; gap: 6px; }

.group-item-inactive {
  background: #fff5f5;
  border-color: #f0c0c0;
}
.group-item-inactive .group-item-name {
  color: #c0392b;
}


/* ════════════════════════════════════════
   СТРАНИЦА: ПОЛЬЗОВАТЕЛИ
════════════════════════════════════════ */
.users-table-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.users-table thead th {
  background: var(--green-pale2);
  color: var(--text-mid);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.users-table tbody td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
.users-table tbody tr:last-child td {
  border-bottom: none;
}
.users-table tbody tr:hover {
  background: var(--green-pale2);
}
.user-row-inactive {
  opacity: 0.55;
}
.user-row-inactive:hover {
  opacity: 0.75;
}
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green-main), var(--green-dark));
  color: var(--white);
  font-family: 'Unbounded', sans-serif;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user-status {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-block;
}
.user-status-active {
  background: var(--green-pale);
  color: var(--green-dark);
}
.user-status-inactive {
  background: #fdeded;
  color: #c0392b;
}
.user-role-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--gold-pale);
  color: #7a6418;
  font-size: 12px;
  font-weight: 600;
}


/* ════════════════════════════════════════
   КОМПОНЕНТ: ВЫБОР БОТОВ (модалка пользователя)
════════════════════════════════════════ */

/* Кнопка-поле в модалке юзера (показывает выбор, открывает модалку выбора) */
.bot-picker-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
  text-align: left;
}
.bot-picker-button:hover {
  border-color: var(--border-mid);
}
.bot-picker-button-icon {
  flex: 0 0 18px;
  color: var(--green-mid);
  display: flex;
  align-items: center;
}
.bot-picker-button-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bot-picker-button-text.empty {
  color: var(--text-muted);
}
.bot-picker-button-arrow {
  flex: 0 0 12px;
  color: var(--text-muted);
}

/* Модалка выбора ботов: поиск, список, футер */
.bp-modal-search {
  margin-bottom: 14px;
}
.bp-modal-search input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
  outline: none;
  transition: border-color .15s ease;
}
.bp-modal-search input:focus {
  border-color: var(--green-main);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(76,175,80,.15);
}
.bp-modal-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  margin-bottom: 14px;
}
.bp-modal-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s ease;
  user-select: none;
}
.bp-modal-item:hover {
  background: var(--green-pale2);
}
.bp-modal-item-checkbox {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-mid);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  transition: all .12s ease;
}
.bp-modal-item.checked .bp-modal-item-checkbox {
  background: var(--green-main);
  border-color: var(--green-main);
}
.bp-modal-item-checkbox svg {
  display: none;
  width: 14px;
  height: 14px;
  color: var(--white);
}
.bp-modal-item.checked .bp-modal-item-checkbox svg {
  display: block;
}
.bp-modal-item-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.bp-modal-item-type {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  letter-spacing: 0.02em;
}
.bp-modal-item-type.opt {
  background: var(--gold-pale);
  color: #7a6418;
}
.bp-modal-item-type.retail {
  background: var(--green-pale);
  color: var(--green-dark);
}
.bp-modal-empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}
.bp-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.bp-modal-info {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.bp-modal-actions {
  display: flex;
  gap: 8px;
}

/* Стек модалок: модалка выбора ботов поверх модалки юзера */
#modal-bot-picker {
  z-index: 1100;
}

/* ════════════════════════════════════════
   КОЛОНКА В ТАБЛИЦЕ: ДОСТУП К БОТАМ
════════════════════════════════════════ */
.bot-access-cell {
  position: relative;
  display: inline-block;
}
.bot-access-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  background: var(--green-pale);
  color: var(--green-dark);
  cursor: pointer;
  transition: background .12s ease;
  border: none;
  font-family: inherit;
}
.bot-access-badge:hover {
  background: var(--green-pale2);
}
.bot-access-badge.all {
  background: var(--gold-pale);
  color: #7a6418;
  cursor: default;
}
.bot-access-badge.empty {
  background: var(--bg);
  color: var(--text-muted);
  cursor: default;
}
.bot-access-popover {
  position: fixed;
  background: var(--white);
  border: 1.5px solid var(--border-mid);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  padding: 8px 0;
  min-width: 180px;
  max-width: 280px;
  z-index: 2000;
  display: none;
}
.bot-access-popover.open {
  display: block;
}
.bot-access-popover-item {
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bot-access-popover-item::before {
  content: '•';
  color: var(--green-mid);
  font-weight: bold;
  margin-right: 8px;
}


/* ════════════════════════════════════════
   СТРАНИЦА: РОЛИ
════════════════════════════════════════ */
.role-system-badge {
  display: inline-block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--gold);
  background: var(--gold-pale);
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.03em;
}
.role-perm-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  max-width: 420px;
}
.role-perm-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--green-pale);
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.role-perm-badge-all {
  background: var(--green-dark);
  color: var(--white);
}
.role-perm-badge-more {
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.role-perms-category {
  margin-top: 18px;
}
.role-perms-category-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.role-perms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* У чекбоксов role-perm специальное поведение disabled */
.role-perm:disabled + div {
  opacity: 0.7;
}
.flag-toggle:has(input.role-perm:disabled) {
  background: var(--green-pale2);
  border-color: var(--green-light);
  cursor: not-allowed;
}
