/* ====================================================
   LOLZ-STYLE THEME  — style.css
   ==================================================== */

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

/* ── Variables ───────────────────────────────────────── */
:root {
  --bg:           #1c1e22;
  --bg-2:         #222428;
  --bg-3:         #26292e;
  --bg-card:      #2d3036;
  --bg-input:     #1e2025;
  --bg-hover:     #2e3138;
  --border:       #2e3239;
  --border-2:     #353b45;
  --accent:       #3dba6f;
  --accent-hover: #35a862;
  --accent-dim:   rgba(61,186,111,0.12);
  --text:         #c8cdd8;
  --text-dim:     #5c6475;
  --text-head:    #4a5265;
  --text-light:   #e2e6ef;
  --text-muted:   #7a8499;
  --red:          #e05252;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Reset ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scrollbar-width: thin; scrollbar-color: #333 transparent; overflow-y: scroll; }
html { height: 100%; }
body { min-height: 100vh; }  /* overridden below */

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ── Layout ──────────────────────────────────────────── */
.nav-container {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 24px 20% 40px;
  max-width: 100%;
  flex: 1;
  /* Sidebar + content always same width; pushes footer to bottom */
  min-width: 0;
  box-sizing: border-box;
  flex: 1 0 auto;
}

.content-area {
  flex: 1;
  min-width: 0;
  color: var(--text);
}

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 5px 12px;
  width: 230px;
  min-width: 230px; /* always exactly 230px — prevents layout shift */
  flex-shrink: 0;
  position: sticky;
  top: 70px;
  height: fit-content;
  max-height: calc(100vh - 88px);
  overflow-y: auto;
}

.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Sidebar items */
.nav-header, .nav-subheader { display: none; }

.sidebar-group + .sidebar-group { margin-top: 2px; }

.sidebar-label {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-head);
  padding: 14px 13px 5px;
  user-select: none;
}

.sidebar ul, .nav.flex-column { list-style: none; margin: 0; padding: 0; }
.sidebar li, .nav-item { margin: 1px 0; }

.sidebar a,
.nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 13px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 400;
  transition: background .13s, color .13s;
  line-height: 1.4;
}

.sidebar a i,
.nav-link i {
  font-size: 14px;
  color: var(--text-dim);
  flex-shrink: 0;
  transition: color .13s;
  width: 16px;
  text-align: center;
}

.sidebar a:hover,
.nav-link:hover {
  background: var(--bg-hover);
  color: var(--text-light);
}

.sidebar a:hover i,
.nav-link:hover i { color: var(--text-muted); }

.sidebar a.active,
.nav-link.active {
  background: var(--bg-hover);
  color: var(--text-light);
}

.sidebar a.active i,
.nav-link.active i { color: var(--accent); }

/* ── Cards ───────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border) !important;
  border-radius: 10px;
  color: var(--text);
}

.card:hover { transform: none; box-shadow: none; }

.card-title { font-weight: 600; font-size: 15px; color: var(--text-light); margin-bottom: 12px; }

/* ── Buttons ─────────────────────────────────────────── */
.btn-primary {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
  font-weight: 500;
  border-radius: 7px;
}
.btn-primary:hover {
  background: var(--accent-hover) !important;
  border-color: var(--accent-hover) !important;
}
.btn-outline-primary {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  border-radius: 7px;
}
.btn-outline-primary:hover {
  background: var(--accent) !important;
  color: #fff !important;
}

/* ── Forms ───────────────────────────────────────────── */
.form-control, .form-select {
  background: var(--bg-input) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-light) !important;
  border-radius: 7px;
}
.form-control::placeholder { color: var(--text-dim) !important; }
.form-control:focus, .form-select:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(61,186,111,.15) !important;
}

/* ── Tables ──────────────────────────────────────────── */
.table { color: var(--text); }
.table th {
  background: rgba(255,255,255,.03);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  border-color: var(--border);
}
.table td { border-color: var(--border); font-size: 13px; }
.table tr:hover { background: rgba(255,255,255,.02); }

/* ── Accordion ───────────────────────────────────────── */
.accordion-item {
  background: var(--bg-3) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  margin-bottom: 6px;
  overflow: hidden;
}
.accordion-button {
  background: var(--bg-3) !important;
  color: var(--text-light) !important;
  font-size: 13.5px;
  border-radius: 8px !important;
}
.accordion-button:not(.collapsed) {
  color: var(--accent) !important;
  background: var(--bg-2) !important;
  box-shadow: none !important;
}
.accordion-button::after { filter: invert(1) brightness(0.6); }
.accordion-body { background: var(--bg-2) !important; color: var(--text); font-size: 13px; }

/* ── Badges ──────────────────────────────────────────── */
.badge.bg-success, .badge.bg-primary { background: var(--accent) !important; color: #fff !important; }

/* ── Footer ──────────────────────────────────────────── */
.footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 28px 20%;
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  gap: 48px;
  color: var(--text-muted);
  font-size: 13px;
}

.footer-brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.footer .logo {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
  font-size: 13px;
  flex-shrink: 0;
}

.footer .title { font-weight: 600; color: var(--text-light); font-size: 14px; }

.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  flex: 1;
}

.footer-nav .column { display: grid; gap: 6px; align-content: start; }
.footer-nav .heading { color: var(--text-light); font-weight: 600; margin-bottom: 4px; font-size: 12px; }
.footer a { color: var(--text-dim); font-size: 12px; transition: color .15s; }
.footer a:hover { color: var(--text); }

/* ── Misc ────────────────────────────────────────────── */
.empty {
  display: grid;
  justify-items: center;
  padding: 28px 16px;
  text-align: center;
  gap: 8px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--text-dim);
}

.divider { height: 1px; background: var(--border); margin: 12px 0; }
.muted { color: var(--text-muted); font-size: 12px; }

.dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; vertical-align: middle; }
.dot-green { background: var(--accent); box-shadow: 0 0 5px var(--accent); }
.dot-red   { background: var(--red); }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 1200px) {
  .nav-container { padding: 20px 5% 40px; }
  .footer { padding: 24px 5%; }
}

@media (max-width: 900px) {
  .nav-container { flex-direction: column; padding: 12px 16px 32px; }
  .sidebar { width: 100%; position: relative; top: 0; max-height: none; }
  .footer { padding: 20px 16px; gap: 24px; flex-wrap: wrap; }
  .footer-nav { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .footer-nav { grid-template-columns: 1fr; }
}

/* ====================================================
   FIXED LAYOUT — предотвращает прыжки при смене страниц
   ==================================================== */

/* Фиксируем ширину контента — sidebar всегда присутствует */
.nav-container {
  min-height: calc(100vh - 52px - 85px); /* header + footer */
}

/* Scrollbar всегда занимает место (не прыгает) */
html {
  overflow-y: scroll;
}

/* content-area фиксированная ширина, не сужается без скроллбара */
.content-area {
  min-height: 600px;
}

/* ====================================================
   ПЕРЕОПРЕДЕЛЕНИЕ СТИЛЕЙ СТРАНИЦ — единая тема
   ==================================================== */

/* -- Общие компоненты страниц -- */
.page-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 24px;
  margin-bottom: 16px;
}

.page-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
}

.page-section-header i { color: var(--accent); font-size: 15px; }

/* -- Карточки статистики (graphics) -- */
.stats-card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
  transition: border-color .15s !important;
}
.stats-card:hover {
  border-color: var(--border-2) !important;
  transform: none !important;
  box-shadow: none !important;
}
.stats-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

/* -- Онлайн-пользователи (clients) -- */
.online-users-container {
  --online-bg-primary:    var(--bg-3);
  --online-bg-secondary:  var(--bg-2);
  --online-bg-gradient:   var(--bg-card);
  --online-border-color:  var(--border);
  --online-text-primary:  var(--text-light);
  --online-text-secondary: var(--text-muted);
  --online-accent-blue:   #5b9cf6;
  --online-accent-green:  var(--accent);
  --online-accent-yellow: #e0a44a;
}
.online-users-container .online-block {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}
.online-users-container .online-header h3 { color: var(--text-light) !important; }
.online-users-container .online-count {
  background: var(--accent-dim) !important;
  color: var(--accent) !important;
  border: 1px solid rgba(61,186,111,.25) !important;
  border-radius: 20px;
}
.online-users-container .user-card {
  background: var(--bg-3) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  transition: border-color .13s !important;
}
.online-users-container .user-card:hover {
  border-color: var(--border-2) !important;
  transform: none !important;
  box-shadow: none !important;
}
.online-users-container .ip-address {
  background: var(--bg-input) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
}
.online-users-container .stats-bar {
  background: var(--bg-3) !important;
  border: 1px solid var(--border) !important;
}
.online-users-container .stat-value { color: var(--accent) !important; }
.online-users-container .refresh-btn {
  background: var(--accent) !important;
  border: none !important;
  border-radius: 7px !important;
  font-family: var(--font) !important;
}
.online-users-container .refresh-btn:hover {
  background: var(--accent-hover) !important;
  transform: none !important;
  box-shadow: none !important;
}
.online-users-container .online-header {
  border-bottom: 1px solid var(--border) !important;
}

/* -- Профиль (edit-profile, settings) -- */
.profile-container {
  --profile-bg-primary:   var(--bg-3);
  --profile-bg-secondary: var(--bg-input);
  --profile-bg-card:      var(--bg-card);
  --profile-bg-card-hover: var(--bg-hover);
  --profile-border-color: var(--border);
  --profile-text-primary: var(--text-light);
  --profile-text-secondary: var(--text-muted);
  --profile-accent-blue:  var(--accent);
  --profile-accent-purple: var(--accent);
  --profile-accent-gradient: var(--accent);
}
.profile-container .card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
  margin-bottom: 14px;
}
.profile-container .card:hover {
  background: var(--bg-card) !important;
  transform: none !important;
}
.profile-container .card-header {
  background: transparent !important;
  border-bottom: 1px solid var(--border) !important;
  color: var(--text-light) !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  padding: 14px 18px !important;
}
.profile-container .card-body { padding: 16px 18px !important; }
.profile-container .btn-primary {
  background: var(--accent) !important;
  border: none !important;
  border-radius: 7px !important;
  padding: .55rem 1.5rem !important;
  font-size: 13.5px !important;
  transform: none !important;
}
.profile-container .btn-primary:hover {
  background: var(--accent-hover) !important;
  transform: none !important;
  box-shadow: none !important;
}
.profile-container .btn-outline-secondary {
  border-color: var(--border) !important;
  color: var(--text-muted) !important;
  border-radius: 7px !important;
  padding: .55rem 1.5rem !important;
}
.profile-container .btn-outline-secondary:hover {
  background: var(--bg-hover) !important;
  color: var(--text-light) !important;
}
.profile-container .stats-value { color: var(--accent) !important; font-size: 1.7rem !important; }
.profile-container .activity-item { border-bottom: 1px solid var(--border) !important; }
.profile-container .activity-icon {
  background: var(--accent-dim) !important;
  color: var(--accent) !important;
  border-radius: 8px !important;
}
.profile-container .resource-item {
  background: var(--bg-3) !important;
  border-radius: 7px !important;
}
.profile-container .resource-value { color: var(--accent) !important; }
.profile-container .progress { background: var(--bg-input) !important; }
.profile-container .progress-bar { background: var(--accent) !important; }
.profile-container .badge-primary { background: var(--accent) !important; }
.profile-container .badge-success { background: var(--accent) !important; }
.profile-container .online-indicator {
  background: var(--accent) !important;
  border-color: var(--bg-card) !important;
  box-shadow: 0 0 8px rgba(61,186,111,.4) !important;
}

/* -- Тарифы (inbounds) -- */
.inbounds-wrap .card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
}

/* -- Лента / чат (lenta) -- */
.lenta-container .chat-area,
.lenta-container .sidebar-users,
.lenta-container .msg-bubble,
.chat-page [class*="chat"],
.chat-page [class*="msg"] {
  border-color: var(--border) !important;
  background-color: var(--bg-card) !important;
}

/* Убираем мусорные body/html переопределения из settings.php */


/* ====================================================
   LENTA / CHAT PAGE
   ==================================================== */

.chat-card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
  overflow: hidden;
}

.chat-layout {
  display: flex;
  height: 620px;
  min-height: 0;
}

.chat-sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--bg-2) !important;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
}

.chat-search {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.chat-search input {
  width: 100%;
  background: var(--bg-input) !important;
  border: 1px solid var(--border) !important;
  border-radius: 7px;
  padding: 7px 12px;
  font-size: 13px;
  color: var(--text-light) !important;
  outline: none;
  font-family: var(--font);
}

.chat-search input:focus { border-color: var(--accent) !important; }
.chat-search input::placeholder { color: var(--text-dim); }

.online-users {
  flex: 1;
  overflow-y: auto;
}
.online-users::-webkit-scrollbar { width: 3px; }
.online-users::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.chat-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background .12s;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.chat-user:hover { background: var(--bg-hover); }
.chat-user.active { background: var(--bg-hover); }

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #2e9659);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
  position: relative; /* нужно для status-dot */
}

/* img внутри аватарки — правильный размер */
.user-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* status-dot выходит за overflow:hidden — вынесен наружу через outline */
.user-avatar .status-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--bg-2);
  border-radius: 50%;
  background: var(--text-dim);
  z-index: 2;
}

.user-avatar .status-dot.online {
  background: var(--accent);
  box-shadow: 0 0 4px rgba(61,186,111,.6);
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13.5px; font-weight: 500; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-last-msg { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-dim); flex-shrink: 0;
}
.status-dot.online { background: var(--accent); box-shadow: 0 0 5px rgba(61,186,111,.5); }
.status-dot.status-off { background: var(--text-dim); }

.online-badge {
  font-size: 10.5px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(61,186,111,.2);
  padding: 1px 7px;
  border-radius: 10px;
}

.unread-badge {
  font-size: 10px;
  background: var(--accent);
  color: #fff;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
}

.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  animation: pulse-anim 2s infinite;
  flex-shrink: 0;
}

@keyframes pulse-anim {
  0%   { box-shadow: 0 0 0 0 rgba(61,186,111,.6); }
  70%  { box-shadow: 0 0 0 7px rgba(61,186,111,0); }
  100% { box-shadow: 0 0 0 0 rgba(61,186,111,0); }
}

/* Chat main area */
.chat-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-3) !important;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2) !important;
  flex-shrink: 0;
}

.chat-header-name { font-size: 14px; font-weight: 600; color: var(--text-light); }
.chat-header-status { font-size: 12px; color: var(--text-dim); margin-top: 1px; }

.chat-header-actions { display: flex; gap: 4px; }
.chat-actions .btn, .chat-header-actions .btn {
  background: transparent !important;
  border: none !important;
  color: var(--text-dim) !important;
  padding: 6px 8px !important;
  border-radius: 7px !important;
  font-size: 16px !important;
  transition: background .12s, color .12s !important;
}
.chat-actions .btn:hover, .chat-header-actions .btn:hover {
  background: var(--bg-hover) !important;
  color: var(--text-light) !important;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Messages */
.msg-row { display: flex; gap: 8px; margin-bottom: 2px; }
.msg-row.mine { flex-direction: row-reverse; }

.msg-avatar, .msg-avatar-spacer {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-hover);
  flex-shrink: 0;
  object-fit: cover; /* работает для <img>, игнорируется для <div> */
  display: block;
}

/* img-теги .msg-avatar */
img.msg-avatar {
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.msg-wrap { max-width: 65%; }

.bubble {
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.45;
  word-break: break-word;
}

.theirs .bubble {
  background: var(--bg-card) !important;
  color: var(--text-light);
  border-radius: 4px 12px 12px 12px;
  border: 1px solid var(--border);
}

.mine .bubble {
  background: rgba(61,186,111,.18) !important;
  color: var(--text-light);
  border-radius: 12px 4px 12px 12px;
  border: 1px solid rgba(61,186,111,.25);
}

.msg-meta, .msg-meta2 {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 3px;
  display: flex;
  gap: 4px;
  align-items: center;
}
.msg-row.mine .msg-meta, .msg-row.mine .msg-meta2 { justify-content: flex-end; }

.new-group {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-dim);
  margin: 10px 0;
}

.category-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-head);
  padding: 12px 14px 4px;
}

/* Empty chat */
.empty-chat, .empty-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 13px;
  gap: 10px;
}
.empty-chat i, .empty-messages i { font-size: 36px; opacity: .35; }

/* Chat input */
.chat-input-area {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg-2) !important;
  flex-shrink: 0;
}

.chat-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px;
  transition: border-color .13s;
}
.chat-input-wrap:focus-within { border-color: var(--accent); }

.chat-input {
  flex: 1;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: var(--text-light) !important;
  font-size: 13.5px;
  font-family: var(--font);
  resize: none;
  min-height: 24px;
  max-height: 120px;
}
.chat-input::placeholder { color: var(--text-dim); }

.emoji-picker {
  background: var(--bg-2) !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px;
}
.emoji-item { cursor: pointer; font-size: 20px; padding: 3px; border-radius: 5px; transition: background .12s; }
.emoji-item:hover { background: var(--bg-hover); }

/* ====================================================
   SETTINGS PAGE — profile-container extra
   ==================================================== */
.profile-container .nav-tabs {
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.profile-container .nav-tabs .nav-link {
  color: var(--text-dim);
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 16px;
  font-size: 13.5px;
  border-radius: 0;
  background: transparent;
}
.profile-container .nav-tabs .nav-link:hover { color: var(--text-light); }
.profile-container .nav-tabs .nav-link.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: transparent;
}

/* ====================================================
   CLIENTS PAGE — полные стили для .online-users-container
   ==================================================== */

.online-users-container .online-block {
  padding: 20px;
  max-width: 100%;
  margin: 0;
}

.online-users-container .online-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
}

.online-users-container .online-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.online-users-container .online-count {
  padding: 6px 14px;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.online-users-container .pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  background: var(--accent);
  animation: pulse-anim 2s infinite;
}

.online-users-container .user-card {
  padding: 14px;
  margin-bottom: 10px;
  transition: border-color .13s;
}

.online-users-container .user-info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.online-users-container .user-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
  object-fit: cover;
}

.online-users-container .user-details { flex: 1; min-width: 180px; }

.online-users-container .user-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 5px;
}

.online-users-container .user-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-muted);
}

.online-users-container .meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.online-users-container .meta-item i { color: var(--accent); font-size: 13px; }

.online-users-container .page-info { font-size: 12.5px; }

.online-users-container .status-badge {
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 500;
  display: inline-block;
}

.online-users-container .status-active {
  background: rgba(61,186,111,.12);
  color: var(--accent);
  border: 1px solid rgba(61,186,111,.25);
}

.online-users-container .status-idle {
  background: rgba(224,164,74,.1);
  color: #e0a44a;
  border: 1px solid rgba(224,164,74,.25);
}

.online-users-container .stats-bar {
  display: flex;
  gap: 14px;
  margin-top: 16px;
  padding: 14px;
  border-radius: 8px;
}

.online-users-container .stat-item {
  flex: 1;
  text-align: center;
}

.online-users-container .stat-value {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 3px;
}

.online-users-container .stat-label {
  font-size: 11.5px;
  color: var(--text-muted);
}

.online-users-container .refresh-btn {
  padding: 7px 14px;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  transition: background .13s;
  color: white;
}

/* ====================================================
   SETTINGS PAGE — полные стили
   ==================================================== */

/* Аватар в шапке профиля */
.profile-container .profile-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 8px;
}

.profile-container .profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #2e9659);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: white;
  position: relative;
  flex-shrink: 0;
}

.profile-container .profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.profile-container .online-indicator {
  position: absolute;
  bottom: 4px; right: 4px;
  width: 14px; height: 14px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

.profile-container .profile-info h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-light);
  margin: 0 0 6px;
}

/* Быстрые действия */
.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 8px;
  border-radius: 10px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background .13s, color .13s, border-color .13s;
  text-align: center;
}

.quick-action-btn i {
  font-size: 22px;
  color: var(--accent);
}

.quick-action-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-2);
  color: var(--text-light);
}

/* Статистические карточки (settings) */
.profile-container .stats-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 12px;
  text-align: center;
}

.profile-container .stats-card i {
  font-size: 20px;
  color: var(--accent);
  display: block;
  margin-bottom: 6px;
}

.profile-container .stats-value,
.stats-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 2px;
}

.profile-container .stats-label,
.stats-label {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Покупки */
.purchase-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.purchase-item:last-child { border-bottom: none; }

.purchase-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #2e9659);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.purchase-info { flex: 1; min-width: 0; }
.purchase-info h6 { margin: 0 0 2px; font-size: 13.5px; color: var(--text-light); font-weight: 500; }
.purchase-info small { font-size: 11.5px; color: var(--text-dim); }

/* Значки badge */
.profile-container .badge-primary,
.badge-primary {
  background: linear-gradient(135deg, var(--accent), #2e9659) !important;
  color: white;
}

.profile-container .badge-success,
.badge-success { background: var(--accent) !important; color: white; }

.profile-container .badge-info,
.badge-info { background: #4a8cf5 !important; color: white; }

.profile-container .badge-warning,
.badge-warning { background: #e0a44a !important; color: white; }

/* Ачивки */
.achievement-badge {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
  transition: border-color .13s;
}

.achievement-badge:hover { border-color: var(--border-2); }

.achievement-badge.locked { opacity: 0.45; filter: grayscale(1); }

.achievement-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #2e9659);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin: 0 auto 8px;
}

.achievement-title { font-size: 12.5px; font-weight: 600; color: var(--text-light); margin-bottom: 2px; }
.achievement-desc { font-size: 11px; color: var(--text-dim); }

/* Уведомления */
.notification-item {
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.notification-item:last-of-type { border-bottom: none; }

.notification-item h6 {
  margin: 0 0 3px;
  font-size: 13px;
  color: var(--text-light);
  font-weight: 500;
}

.notification-item small { font-size: 12px; color: var(--text-dim); }

.notification-item.unread h6::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 6px;
  vertical-align: middle;
}

/* Активность в профиле */
.profile-container .activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
}

.profile-container .activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
  font-size: 16px;
}

.profile-container .activity-content { flex: 1; }
.profile-container .activity-title { font-size: 13px; font-weight: 500; color: var(--text-light); margin-bottom: 2px; }
.profile-container .activity-time { font-size: 11.5px; color: var(--text-dim); }

/* Ресурсы */
.profile-container .resource-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 8px;
}

.profile-container .resource-name { font-size: 13px; font-weight: 500; }
.profile-container .resource-value { font-size: 14px; font-weight: 700; }

/* Прогресс-бар */
.profile-container .progress {
  height: 6px;
  border-radius: 4px;
  overflow: hidden;
}

.profile-container .progress-bar {
  border-radius: 4px;
  transition: width .8s ease;
}

/* form-label цвет */
.profile-container .form-label {
  color: var(--text-light);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 5px;
}

/* input-group-text тема */
.input-group-text {
  background: var(--bg-input) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-muted) !important;
}

/* breadcrumb */
.breadcrumb { margin-bottom: 16px; }
.breadcrumb-item { font-size: 13px; }
.breadcrumb-item a { color: var(--accent); }
.breadcrumb-item.active { color: var(--text-muted); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-dim); }

/* ====================================================
   LENTA PAGE — недостающие элементы
   ==================================================== */

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-dim);
  width: 32px;
  height: 32px;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: background .12s, color .12s;
  padding: 0;
}

.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--text-light);
}

/* card-header для chat */
.card-header {
  background: var(--bg-2) !important;
  border-bottom: 1px solid var(--border) !important;
  color: var(--text-light);
  font-size: 13.5px;
  font-weight: 600;
  padding: 12px 16px;
}

/* ====================================================
   PROFILE PAGE — XP-виджет переменные
   (дублируем в :root чтобы работали даже без inline style)
   ==================================================== */

:root {
  --p5-bg1: #0c0e14; --p5-bg2: #111420; --p5-bg3: var(--bg-3); --p5-bg4: var(--bg-hover);
  --p5-tx1: var(--text-light); --p5-tx2: var(--text-muted); --p5-brd: var(--border);
  --p5-a: #7c6cf8; --p5-b: #ec4899; --p5-g: var(--accent); --p5-y: #ffd60a;
  --p5-o: #ff6b35; --p5-c: #38bdf8;
  --p5-grad: linear-gradient(135deg, #7c6cf8, #ec4899);
}

/* XP widget card wrapper */
.xp-dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}


/* ====================================================
   PRODUCT CARDS — overview / plugin-card
   ==================================================== */

.plugin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: border-color .15s;
}

.plugin-card:hover {
  border-color: var(--border-2);
  transform: none;
  box-shadow: none;
}

/* Изображение */
.plugin-card-img {
  position: relative;
  height: 170px;
  overflow: hidden;
  background: var(--bg-3);
  flex-shrink: 0;
}

.plugin-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}

.plugin-card:hover .plugin-card-img img {
  transform: scale(1.04);
}

.plugin-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: var(--text-dim);
}

.plugin-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 5px;
  z-index: 1;
}

/* Тело карточки */
.plugin-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}

.plugin-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  line-height: 1.35;
}

.plugin-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
  /* 3 строки max */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Рейтинг + статы */
.plugin-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-dim);
}

.plugin-stars {
  display: flex;
  align-items: center;
  gap: 2px;
  color: #e0a44a;
  font-size: 11px;
}

.plugin-stars span {
  color: var(--text-muted);
  font-size: 11.5px;
  margin-left: 3px;
}

.plugin-stat {
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Футер карточки */
.plugin-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.plugin-price {
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}

.plugin-price span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.plugin-price del {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 400;
  margin-left: 4px;
}

.plugin-btns {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.plugin-btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .13s;
  font-family: var(--font);
}

.plugin-btn-primary:hover { background: var(--accent-hover); }

.plugin-btn-secondary {
  background: var(--bg-3);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: background .13s, color .13s;
}

.plugin-btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--text-light);
}


/* ====================================================
   ПОЛНАЯ АДАПТИВНОСТЬ — все устройства
   ==================================================== */

/* ── 1200px — большие планшеты/небольшие ноутбуки ── */
@media (max-width: 1200px) {
  .nav-container { padding: 20px 3% 40px; gap: 16px; }
  .footer        { padding: 24px 3%; }
}

/* ── 900px — планшеты ─────────────────────────────── */
@media (max-width: 900px) {
  .nav-container {
    flex-direction: column;
    padding: 16px 16px 32px;
    gap: 14px;
  }

  /* Sidebar уходит наверх как горизонтальная полоска */
  .sidebar {
    width: 100%;
    min-width: 0;
    position: relative;
    top: 0;
    max-height: none;
    padding: 6px 8px;
    overflow-x: auto;
    overflow-y: visible;
  }

  /* Группы в sidebar — в строку */
  .sidebar-group { display: inline-flex; align-items: center; gap: 0; }
  .sidebar-label { display: none; }
  .sidebar ul, .nav.flex-column { display: flex; flex-direction: row; flex-wrap: nowrap; }
  .sidebar li { margin: 0; }
  .sidebar a, .nav-link {
    padding: 6px 10px;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Скролл для горизонтального меню */
  .sidebar::-webkit-scrollbar { height: 3px; }
  .sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

  /* Footer */
  .footer { padding: 20px 16px; gap: 24px; flex-wrap: wrap; }
  .footer-nav { grid-template-columns: repeat(2, 1fr); }

  /* Cards — 2 в ряд вместо 4 */
  .col-lg-3 { width: 50% !important; }
  .col-md-6 { width: 50% !important; }

  /* Rightbar скрываем */
  .rightbar { display: none; }

  /* Chat layout на планшете */
  .chat-layout { height: 500px; }
  .chat-sidebar { width: 220px; min-width: 220px; }
}

/* ── 768px — маленькие планшеты / большие телефоны ── */
@media (max-width: 768px) {
  .nav-container { padding: 12px 14px 28px; }

  /* Sidebar полностью убираем — заменяется мобильным меню из header */
  .sidebar { display: none; }

  /* content-area занимает всю ширину */
  .content-area { min-height: 0; }

  /* Footer */
  .footer { padding: 18px 14px; gap: 20px; }
  .footer-brand { width: 100%; }

  /* Карточки — 2 колонки на телефоне */
  .col-lg-3 { width: 50% !important; }

  /* XP dashboard */
  .xp-dash { grid-template-columns: 1fr !important; }
  .xp-ring-side { border-right: none !important; border-bottom: 1px solid var(--border); }
  .xp-history    { border-right: none !important; border-bottom: 1px solid var(--border); }

  /* Profile container */
  .profile-container .col-lg-8,
  .profile-container .col-lg-4 { width: 100% !important; }

  /* Tables — горизонтальный скролл */
  .table-responsive-mobile { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table { min-width: 500px; }

  /* Clients page */
  .online-users-container .user-meta { gap: 6px; }
  .online-users-container .stats-bar { flex-wrap: wrap; gap: 8px; }
  .online-users-container .stat-item { flex: 1 0 80px; }

  /* Lenta/chat */
  .chat-layout { flex-direction: column; height: auto; }
  .chat-sidebar {
    width: 100%;
    min-width: 0;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .chat-main { min-height: 380px; }
  .chat-messages { max-height: 300px; }
}

/* ── 600px — смартфоны ────────────────────────────── */
@media (max-width: 600px) {
  .nav-container { padding: 10px 12px 24px; }

  /* Одна колонка для всех карточек */
  .col-lg-3, .col-md-6, .col-md-3, .col-6 { width: 100% !important; }

  /* Footer — одна колонка */
  .footer-nav { grid-template-columns: 1fr; }
  .footer { flex-direction: column; gap: 18px; }

  /* Plugin cards — полная ширина */
  .plugin-card-img { height: 140px; }

  /* Profile header */
  .profile-container .profile-header {
    flex-direction: column;
    text-align: center;
    gap: 14px;
  }

  /* Кнопки баланса */
  .balance-actions { flex-wrap: wrap; }
  .balance-btn { flex: 0 0 calc(50% - 3px); }

  /* Accordion */
  .accordion-button { font-size: 13px; padding: 12px 14px; }
  .accordion-body   { font-size: 12.5px; padding: 12px 14px; }

  /* Stats in settings */
  .stats-card { padding: 12px 8px; }
  .stats-value { font-size: 1.3rem !important; }

  /* Overview floating cart btn */
  .position-fixed.bottom-0 { display: none; }
}

/* ── 480px — маленькие смартфоны ─────────────────── */
@media (max-width: 480px) {
  body { font-size: 13.5px; }

  .nav-container { padding: 8px 10px 20px; }

  /* Форма входа (login.php) */
  .login-card { padding: 24px 18px !important; }

  /* Notification dropdown */
  .notif-dropdown { min-width: 280px; right: -70px; }

  /* Profile dropdown */
  .profile-dropdown { min-width: 210px; }

  /* Chat на маленьком экране */
  .chat-sidebar { max-height: 160px; }
  .chat-main { min-height: 320px; }
  .bubble { font-size: 13px; padding: 8px 11px; }

  /* Quick action buttons */
  .quick-action-btn { padding: 12px 6px; font-size: 11.5px; }
  .quick-action-btn i { font-size: 18px; }

  /* Breadcrumb */
  .breadcrumb { flex-wrap: wrap; gap: 4px; }
}

/* ── Touch improvements ───────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  /* Убираем hover-анимации на тач-устройствах */
  .plugin-card:hover { transform: none; }
  .plugin-card:hover .plugin-card-img img { transform: none; }

  /* Увеличиваем tap targets */
  .sidebar a, .nav-link { padding: 10px 13px; }
  .mobile-nav-link { padding: 13px 18px; }
  .chat-user { padding: 12px 14px; }
  .btn, button { min-height: 40px; }
  .plugin-btn-primary, .plugin-btn-secondary { padding: 9px 14px; }
}

/* ── Horizontal scroll prevention ─────────────────── */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; max-width: 100vw; }
  .row { margin-left: 0 !important; margin-right: 0 !important; }
  .container, .container-fluid { padding-left: 0 !important; padding-right: 0 !important; }
}


/* ====================================================
   КОРЗИНА
   ==================================================== */

/* Плавающая кнопка */
.cart-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 1500;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(61,186,111,.4);
  transition: background .15s, transform .15s;
}
.cart-fab:hover { background: var(--accent-hover); transform: scale(1.07); }

.cart-fab-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 19px;
  height: 19px;
  background: #e05252;
  border: 2px solid var(--bg);
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
}

/* Overlay */
.cart-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 1800;
  backdrop-filter: blur(2px);
}
.cart-overlay.open { display: block; }

/* Drawer */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 360px;
  max-width: 100vw;
  background: var(--bg-2);
  border-left: 1px solid var(--border);
  z-index: 1900;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
.cart-drawer.open { transform: translateX(0); }

.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  height: 54px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cart-drawer-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 8px;
}
.cart-drawer-title i { color: var(--accent); }
.cart-drawer-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  transition: background .13s, color .13s;
}
.cart-drawer-close:hover { background: var(--bg-hover); color: var(--text-light); }

/* Body */
.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}
.cart-drawer-body::-webkit-scrollbar { width: 4px; }
.cart-drawer-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Empty state */
.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  gap: 10px;
  text-align: center;
}
.cart-empty i { font-size: 48px; color: var(--border-2); }
.cart-empty p  { font-size: 15px; color: var(--text-muted); font-weight: 500; margin: 0; }
.cart-empty span { font-size: 13px; color: var(--text-dim); }

/* Items list */
.cart-items-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
  transition: background .12s, opacity .2s;
}
.cart-item:hover { background: var(--bg-hover); }

.cart-item-img {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-3);
}
.cart-item-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 18px;
}

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name  { font-size: 13.5px; font-weight: 500; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-price { font-size: 13px; color: var(--accent); font-weight: 600; margin-top: 3px; }

.cart-item-remove {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 5px;
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  transition: background .12s, color .12s;
}
.cart-item-remove:hover { background: rgba(224,82,82,.1); color: #e05252; }

/* Footer */
.cart-drawer-footer {
  padding: 16px 18px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
  color: var(--text-muted);
}
.cart-total-row strong { font-size: 20px; color: var(--accent); font-weight: 700; }

.cart-checkout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  background: var(--accent);
  color: #fff;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background .13s;
}
.cart-checkout-btn:hover { background: var(--accent-hover); color: #fff; }

.cart-clear-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all .13s;
  font-family: var(--font);
}
.cart-clear-btn:hover { border-color: #e05252; color: #e05252; background: rgba(224,82,82,.06); }

/* Add-to-cart button state */
.add-to-cart-btn.in-cart {
  background: var(--bg-hover);
  color: var(--accent);
  cursor: default;
}

/* Toast */
.cart-toast {
  position: fixed;
  bottom: 90px;
  right: 28px;
  z-index: 2000;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 13.5px;
  color: var(--text-light);
  box-shadow: 0 6px 24px rgba(0,0,0,.4);
  transform: translateY(10px);
  opacity: 0;
  pointer-events: none;
  transition: all .25s;
  max-width: 280px;
}
.cart-toast.show { opacity: 1; transform: translateY(0); }
.cart-toast.ok   { border-left: 3px solid var(--accent); }
.cart-toast.err  { border-left: 3px solid #e05252; }

/* Mobile cart */
@media (max-width: 480px) {
  .cart-drawer { width: 100vw; }
  .cart-fab { bottom: 20px; right: 20px; width: 48px; height: 48px; font-size: 18px; }
  .cart-toast { right: 14px; bottom: 80px; max-width: calc(100vw - 28px); }
}

/* ====================================================
   PRODUCT CARD — LIST VIEW
   ==================================================== */

.plugin-list-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color .15s;
}

.plugin-list-card:hover { border-color: var(--border-2); }

/* Изображение */
.plugin-list-img {
  width: 180px;
  min-width: 180px;
  height: 130px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  background: var(--bg-3);
}

.plugin-list-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}
.plugin-list-card:hover .plugin-list-img img { transform: scale(1.04); }

.plugin-list-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--text-dim);
}

/* Тело */
.plugin-list-body {
  flex: 1;
  min-width: 0;
  padding: 14px 0;
}

.plugin-list-top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.plugin-list-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-dim);
}

/* Действия */
.plugin-list-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 16px;
  flex-shrink: 0;
}

.plugin-list-btns {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  min-width: 140px;
}

.plugin-list-btns .plugin-btn-secondary,
.plugin-list-btns .plugin-btn-primary,
.plugin-list-btns .plugin-btn-order {
  width: 100%;
  justify-content: center;
}

/* Кнопка "Оформить заказ" — для обоих видов */
.plugin-btn-order {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--bg-3);
  color: var(--accent);
  border: 1px solid rgba(61,186,111,.35);
  border-radius: 7px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background .13s, border-color .13s;
  white-space: nowrap;
}

.plugin-btn-order:hover {
  background: var(--accent-dim);
  border-color: rgba(61,186,111,.6);
  color: var(--accent);
}

/* Grid card — "Оформить" под футером */
.plugin-card-body .plugin-btn-order {
  margin-top: 8px;
}

/* Responsive list */
@media (max-width: 768px) {
  .plugin-list-card { flex-wrap: wrap; }
  .plugin-list-img  { width: 100%; min-width: 0; height: 160px; }
  .plugin-list-body { padding: 0 14px; }
  .plugin-list-actions { width: 100%; align-items: stretch; padding: 0 14px 14px; }
  .plugin-list-btns { flex-direction: row; flex-wrap: wrap; min-width: 0; }
  .plugin-list-btns .plugin-btn-secondary,
  .plugin-list-btns .plugin-btn-primary,
  .plugin-list-btns .plugin-btn-order { width: auto; flex: 1; }
}
@media (max-width: 480px) {
  .plugin-list-actions { flex-direction: column; gap: 10px; }
  .plugin-price { font-size: 18px !important; }
}

