/* 
  SYSTEM PAGE STYLES — Premium Glassmorphism Redesign
  Targeting High-End Admin Experience
*/

:root {
    --sys-glass-bg: rgba(15, 23, 42, 0.6);
    --sys-glass-border: rgba(255, 255, 255, 0.08);
    --sys-accent-gradient: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    --sys-gold-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --sys-danger-gradient: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    --sys-text:   #f1f5f9;
    --sys-text2:  #cbd5e1;
    --sys-text3:  #94a3b8;
}

/* ── СВЕТЛЫЕ ТЕМЫ: карточки светлые, текст тёмный ── */
.light .system-container,
.theme-beige .system-container,
.theme-pink .system-container,
.theme-sage .system-container {
    --sys-glass-bg:    #ffffff;
    --sys-glass-border: #e2e8f0;
    --sys-text:   #0f172a;
    --sys-text2:  #334155;
    --sys-text3:  #64748b;
}

.light .sys-card,
.light .sys-table-wrap,
.light .sys-panel,
.light .h-card,
.light .health-section,
.light .system-tabs,
.light .logs-toolbar-glass,
.theme-beige .sys-card,
.theme-beige .sys-table-wrap,
.theme-beige .sys-panel,
.theme-beige .h-card,
.theme-beige .health-section,
.theme-beige .system-tabs,
.theme-beige .logs-toolbar-glass,
.theme-pink .sys-card,
.theme-pink .sys-table-wrap,
.theme-pink .sys-panel,
.theme-pink .h-card,
.theme-pink .health-section,
.theme-pink .system-tabs,
.theme-pink .logs-toolbar-glass,
.theme-sage .sys-card,
.theme-sage .sys-table-wrap,
.theme-sage .sys-panel,
.theme-sage .h-card,
.theme-sage .health-section,
.theme-sage .system-tabs,
.theme-sage .logs-toolbar-glass {
    backdrop-filter: none;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

/* Hover-тень для светлых карточек */
.light .sys-card:hover,
.theme-beige .sys-card:hover,
.theme-pink .sys-card:hover,
.theme-sage .sys-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

/* Таблица в светлой теме */
.light .sys-table th,
.theme-beige .sys-table th,
.theme-pink .sys-table th,
.theme-sage .sys-table th {
    background: #f8fafc;
    border-bottom-color: #e2e8f0;
}

.light .sys-table tr:hover td,
.theme-beige .sys-table tr:hover td,
.theme-pink .sys-table tr:hover td,
.theme-sage .sys-table tr:hover td {
    background: #f1f5f9;
}

/* Кнопки в светлой теме */
.light .btn-ghost,
.theme-beige .btn-ghost,
.theme-pink .btn-ghost,
.theme-sage .btn-ghost {
    background: rgba(0,0,0,0.04);
    border-color: #e2e8f0;
    color: #334155;
}

.light .btn-ghost:hover,
.theme-beige .btn-ghost:hover,
.theme-pink .btn-ghost:hover,
.theme-sage .btn-ghost:hover {
    background: var(--sys-accent-gradient);
    border-color: transparent;
    color: #fff;
}

.light .btn-sys-action,
.theme-beige .btn-sys-action,
.theme-pink .btn-sys-action,
.theme-sage .btn-sys-action {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #334155;
}

.light .btn-sys-action:hover,
.theme-beige .btn-sys-action:hover,
.theme-pink .btn-sys-action:hover,
.theme-sage .btn-sys-action:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.light .btn-refresh,
.theme-beige .btn-refresh,
.theme-pink .btn-refresh,
.theme-sage .btn-refresh {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #334155;
}

/* Tabs */
.light .system-tabs,
.theme-beige .system-tabs,
.theme-pink .system-tabs,
.theme-sage .system-tabs {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.light .sys-tab,
.theme-beige .sys-tab,
.theme-pink .sys-tab,
.theme-sage .sys-tab {
    color: #64748b;
}

.light .sys-tab:hover,
.theme-beige .sys-tab:hover,
.theme-pink .sys-tab:hover,
.theme-sage .sys-tab:hover {
    color: #0f172a;
    background: rgba(0,0,0,0.04);
}

.light .sys-tab.active,
.theme-beige .sys-tab.active,
.theme-pink .sys-tab.active,
.theme-sage .sys-tab.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Лог-items в светлой теме */
.light .log-mini-item,
.theme-beige .log-mini-item,
.theme-pink .log-mini-item,
.theme-sage .log-mini-item {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.light .log-mini-item:hover,
.theme-beige .log-mini-item:hover,
.theme-pink .log-mini-item:hover,
.theme-sage .log-mini-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

/* field-glass-mini в светлой теме */
.light .field-glass-mini,
.theme-beige .field-glass-mini,
.theme-pink .field-glass-mini,
.theme-sage .field-glass-mini {
    background: #ffffff;
    border-color: #e2e8f0;
}

.light .field-glass-mini select,
.light .field-glass-mini input,
.theme-beige .field-glass-mini select,
.theme-beige .field-glass-mini input,
.theme-pink .field-glass-mini select,
.theme-pink .field-glass-mini input,
.theme-sage .field-glass-mini select,
.theme-sage .field-glass-mini input {
    color: #0f172a;
    background: transparent;
}

/* toolbar в светлой теме */
.light .logs-toolbar-glass,
.theme-beige .logs-toolbar-glass,
.theme-pink .logs-toolbar-glass,
.theme-sage .logs-toolbar-glass {
    background: #f8fafc;
    border-color: #e2e8f0;
}

/* Принудительно используем переменные цветов на тёмных темах */
.system-container,
.system-container .sys-card,
.system-container .sys-table,
.system-container .h-card,
.system-container .health-section,
.system-container .sys-panel,
.system-container .sys-modal {
    color: var(--sys-text);
}

.system-container {
  padding: 40px;
  max-width: 1400px;
  margin: 0 auto;
  opacity: 0;
  animation: sys-fade-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes sys-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.system-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.system-header h1 {
  font-size: 36px;
  font-weight: 800;
  margin: 0 0 8px 0;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #ffffff 30%, #cbd5e1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #ffffff; /* fallback для старых браузеров */
}

/* В светлых темах заголовок тёмный */
.light .system-header h1,
.theme-beige .system-header h1,
.theme-pink .system-header h1,
.theme-sage .system-header h1 {
  background: none;
  -webkit-text-fill-color: #0f172a;
  color: #0f172a;
}

.system-header p {
  color: var(--sys-text3);
  font-size: 16px;
  margin: 0;
}

/* --- TABS DESIGN --- */
.system-tabs {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--sys-glass-border);
  margin-bottom: 40px;
  width: fit-content;
  backdrop-filter: blur(10px);
}

.sys-tab {
  padding: 10px 28px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--sys-text3);
}

.sys-tab:hover {
  color: var(--sys-text);
  background: rgba(255, 255, 255, 0.05);
}

.sys-tab.active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
}

/* --- STATS GRID & GLASS CARDS --- */
.sys-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.sys-card {
  padding: 30px;
  border-radius: 24px;
  background: var(--sys-glass-bg);
  border: 1px solid var(--sys-glass-border);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  gap: 24px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.sys-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.sys-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(255,255,255,0.05), transparent);
    pointer-events: none;
}

.sc-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: inset 0 0 20px rgba(255,255,255,0.05);
}

.sc-icon.blue   { background: rgba(59, 131, 246, 0.15); color: #60a5fa; }
.sc-icon.green  { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.sc-icon.purple { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.sc-icon.gold   { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

.sc-label { color: var(--sys-text3); font-size: 14px; font-weight: 600; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.sc-value { font-size: 32px; font-weight: 800; color: var(--sys-text); line-height: 1; }
.sc-sub { font-size: 13px; color: var(--sys-text3); margin-top: 8px; opacity: 0.7; }

/* --- PREMIUM TABLE --- */
.sys-table-wrap {
  background: var(--sys-glass-bg);
  border-radius: 24px;
  border: 1px solid var(--sys-glass-border);
  backdrop-filter: blur(20px);
  overflow: hidden;
  margin-top: 30px;
}

.sys-table { width: 100%; border-collapse: collapse; }

.sys-table th {
  text-align: left;
  padding: 20px 24px;
  background: rgba(255,255,255,0.02);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--sys-text3);
  font-weight: 700;
  border-bottom: 1px solid var(--sys-glass-border);
}

.sys-table td {
  padding: 18px 24px;
  transition: background 0.2s;
  color: var(--sys-text2);
}

.sys-table tr:hover td { background: rgba(255,255,255,0.02); }

.badge-plan.partner { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.2); }

.c-cell { display: flex; flex-direction: column; gap: 4px; }
.c-date { font-size: 11px; color: var(--sys-text3); opacity: 0.8; }
.c-inn { font-size: 12px; color: var(--sys-text3); font-family: var(--font-mono); }
.c-owner { display: flex; flex-direction: column; gap: 4px; }
.co-name { font-size: 14px; color: var(--sys-text); }
.co-contacts { display: flex; flex-direction: column; font-size: 11px; color: var(--sys-text3); gap: 2px; }
.co-contacts span { display: flex; align-items: center; gap: 6px; }

.c-usage { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--sys-text2); }
.c-usage span { display: flex; align-items: center; gap: 8px; font-weight: 600; }

/* --- BUTTONS & ACTIONS --- */
.sys-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: fit-content;
}

.btn-ghost {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--sys-text);
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-ghost:hover {
  background: var(--sys-accent-gradient);
  border-color: transparent;
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(59, 131, 246, 0.4);
}

.btn-sys-action {
  width: 100%;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--sys-glass-border);
  background: rgba(255,255,255,0.03);
  color: var(--sys-text);
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-sys-action:hover {
  background: rgba(255,255,255,0.08);
  transform: translateX(8px);
  border-color: rgba(255,255,255,0.2);
}

.btn-refresh {
    background: var(--sys-glass-bg);
    border: 1px solid var(--sys-glass-border);
    color: var(--sys-text);
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-refresh:hover {
    background: rgba(255,255,255,0.08);
    box-shadow: 0 0 20px rgba(255,255,255,0.05);
}

/* --- PANELS --- */
.sys-row { display: flex; gap: 24px; margin-top: 30px; }
.sys-panel { 
    background: var(--sys-glass-bg); 
    padding: 30px; 
    border-radius: 24px; 
    border: 1px solid var(--sys-glass-border); 
    backdrop-filter: blur(20px);
}
.sys-panel.main { flex: 2; }
.sys-panel.side { flex: 1; }
.sys-panel h3 { font-size: 20px; font-weight: 700; margin-bottom: 24px; opacity: 0.9; }

/* --- PREMIUM MODALS --- */
.sys-modal {
    background: #0f172a;
    background-image: radial-gradient(circle at top right, rgba(59, 131, 246, 0.1), transparent);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 32px;
    padding: 40px;
    width: 100%;
    max-width: 550px;
    position: relative;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    animation: sys-modal-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes sys-modal-pop {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.sys-modal h3 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sys-modal p {
    color: var(--sys-text3);
    margin-bottom: 30px;
    line-height: 1.6;
}

.sys-form textarea,
.sys-form input[type="text"],
.sys-form input[type="number"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px;
    color: #fff;
    font-size: 15px;
    transition: all 0.3s;
    margin-bottom: 20px;
}

.sys-form textarea:focus,
.sys-form input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 4px rgba(59, 131, 246, 0.1);
}

.sf-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--sys-text3);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sf-features {
    background: rgba(255, 255, 255, 0.03);
    padding: 24px;
    border-radius: 20px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sf-features h4 {
    margin-bottom: 20px;
    font-size: 14px;
    text-transform: uppercase;
    color: var(--sys-text3);
}

.sf-features label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    font-weight: 600;
    color: var(--sys-text, #f1f5f9);
    transition: color 0.2s;
}

.sf-features label:hover { color: var(--accent); }

.sf-features input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
}

.sys-modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.sys-modal-header .sc-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 20px;
}

.sys-modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--sys-text3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.sys-modal-close:hover {
    background: var(--sys-danger-gradient);
    color: #fff;
    border-color: transparent;
    transform: rotate(90deg);
}

.sf-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.sf-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sf-actions .btn-primary {
    width: 100%;
    padding: 18px;
    border-radius: 18px;
    background: var(--sys-accent-gradient);
    border: none;
    color: #fff;
    font-weight: 800;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 25px rgba(59, 131, 246, 0.3);
}

.sf-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(59, 131, 246, 0.4);
    filter: brightness(1.1);
}

.sf-actions .btn-ghost {
    width: 100%;
    height: auto;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px;
    border-radius: 16px;
    font-weight: 600;
}

.sf-actions .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: none;
    box-shadow: none;
}

/* --- ENHANCED MINI LOGS --- */
.sys-logs-mini {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.log-mini-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.log-mini-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
    cursor: copy;
}

.log-mini-item:hover .lmi-copy-hint {
    opacity: 1;
    transform: translateX(0);
}

.lmi-copy-hint {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    opacity: 0;
    transition: all 0.3s ease;
    color: var(--accent);
    font-size: 16px;
    background: rgba(59, 131, 246, 0.1);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.lmi-status {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.lmi-status.info  { background: rgba(59, 131, 246, 0.1); color: #60a5fa; box-shadow: 0 0 15px rgba(59, 131, 246, 0.1); }
.lmi-status.warn  { background: rgba(245, 158, 11, 0.1); color: #fbbf24; box-shadow: 0 0 15px rgba(245, 158, 11, 0.1); }
.lmi-status.error { background: rgba(239, 68, 68, 0.1); color: #f87171; box-shadow: 0 0 15px rgba(239, 68, 68, 0.1); }

.lmi-body { flex: 1; min-width: 0; }
.lmi-msg {
    font-size: 14px;
    color: var(--sys-text2);
    line-height: 1.4;
    margin-bottom: 6px;
    word-break: break-word;
}

.lmi-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lmi-time {
    font-size: 11px;
    font-weight: 600;
    color: var(--sys-text3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lmi-tag {
    font-size: 10px;
    font-family: var(--font-mono);
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    color: var(--sys-text3);
}

.log-mini-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-text-glass {
    background: none;
    border: none;
    color: #60a5fa;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-text-glass:hover {
    background: rgba(59, 131, 246, 0.05);
    color: #93c5fd;
}

.log-mini-error {
    padding: 30px;
    text-align: center;
    color: var(--sys-text3);
    opacity: 0.8;
}

.log-mini-error i { font-size: 24px; margin-bottom: 12px; display: block; }
.log-mini-error p { font-size: 13px; margin: 0; }

.animate-slide-in {
    animation: slide-in 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes slide-in {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* --- LOG TABLE ENHANCEMENTS --- */
.log-row-hover:hover {
    background: rgba(255, 255, 255, 0.02) !important;
}

.log-msg-cell {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.log-msg {
    font-size: 14px;
    color: var(--sys-text2);
    line-height: 1.4;
    word-break: break-all;
}

.btn-copy-mini {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--accent);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    flex-shrink: 0;
}

.log-row-hover:hover .btn-copy-mini {
    opacity: 1;
}

.btn-copy-mini:hover {
    background: var(--accent);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(59, 131, 246, 0.3);
}

.log-time { 
    font-family: var(--font-mono); 
    font-size: 13px; 
    color: var(--sys-text3); 
    white-space: nowrap;
}

/* --- HEALTH MONITORING STYLES --- */
.health-dashboard {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.h-card {
    background: var(--sys-glass-bg);
    border: 1px solid var(--sys-glass-border);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.h-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.hc-icon {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.hc-icon.blue { background: rgba(59, 131, 246, 0.15); color: #60a5fa; }
.hc-icon.green { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.hc-icon.purple { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }

.hc-label { font-size: 13px; font-weight: 700; color: var(--sys-text3); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.hc-value { font-size: 24px; font-weight: 800; color: var(--sys-text); }
.hc-sub { font-size: 12px; color: var(--sys-text3); margin-top: 4px; }

.health-section {
    background: var(--sys-glass-bg);
    border: 1px solid var(--sys-glass-border);
    backdrop-filter: blur(20px);
    border-radius: 32px;
    padding: 30px;
}

.hs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.hs-header h3 { margin: 0; font-size: 20px; font-weight: 700; }

.hs-legend { display: flex; gap: 16px; font-size: 12px; font-weight: 600; color: var(--sys-text3); }
.l-item { display: flex; align-items: center; gap: 6px; }

.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-dot.online { background: #10b981; box-shadow: 0 0 10px #10b981; }
.status-dot.offline { background: #ef4444; }

.svc-cell { display: flex; align-items: center; gap: 14px; }
.svc-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
}
.svc-icon.whatsapp { background: #25d36622; color: #25d366; border: 1px solid #25d36644; }
.svc-icon.telegram { background: #0088cc22; color: #0088cc; border: 1px solid #0088cc44; }

.svc-name-wrap { display: flex; flex-direction: column; }
.svc-sub { font-size: 10px; color: var(--sys-text3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

.status-pill-glass {
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.5px;
}

.status-pill-glass.success { background: rgba(16, 185, 129, 0.1); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.2); }
.status-pill-glass.warning { background: rgba(245, 158, 11, 0.1); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.2); }
.status-pill-glass.danger { background: rgba(239, 68, 68, 0.1); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.2); }

.status-dot-pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 10px currentColor;
    animation: pulse-dot 1.5s infinite ease-in-out;
}

@keyframes pulse-dot {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

/* --- LOGS TOOLBAR GLASS --- */
.logs-toolbar-glass {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.03);
    padding: 16px 24px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    margin-bottom: 24px;
}

.lt-filters {
    display: flex;
    gap: 12px;
}

.field-glass-mini {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0 16px;
    height: 42px;
    transition: all 0.3s;
}

.field-glass-mini i {
    color: var(--sys-text3);
    font-size: 14px;
    margin-right: 12px;
}

.field-glass-mini select,
.field-glass-mini input {
    background: transparent;
    border: none;
    color: var(--sys-text);
    font-size: 14px;
    font-weight: 600;
    outline: none;
    height: 100%;
}

.field-glass-mini:focus-within {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(59, 131, 246, 0.1);
}

.lt-actions {
    display: flex;
    gap: 12px;
}

.btn-primary-glass.mini,
.btn-danger-glass.mini {
    padding: 8px 16px;
    font-size: 13px;
    height: 42px;
}

/* ═══════════════════════════════════════════════════
   BROADCAST MODAL — Глобальная рассылка
   ═══════════════════════════════════════════════════ */

.modal-content-glass {
    background: var(--bg2, #1e293b);
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    border-radius: 28px;
    padding: 0;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.4);
    animation: sys-modal-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.modal-header-glass {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px 20px;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
    background: rgba(255,255,255,0.02);
}

.modal-header-glass .header-main {
    display: flex;
    align-items: center;
    gap: 14px;
}

.modal-header-glass .header-icon {
    width: 44px;
    height: 44px;
    background: rgba(59,130,246,0.15);
    color: #60a5fa;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.modal-header-glass h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text, #f1f5f9);
    margin: 0 0 4px;
}

.modal-header-glass p {
    font-size: 12px;
    color: var(--text3, #94a3b8);
    margin: 0;
}

.btn-close-glass {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text3, #94a3b8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-close-glass:hover {
    background: rgba(239,68,68,0.15);
    border-color: rgba(239,68,68,0.3);
    color: #f87171;
    transform: rotate(90deg);
}

.broadcast-body {
    padding: 24px 28px 28px;
}

/* field-glass — полноразмерное поле */
.field-glass {
    margin-bottom: 20px;
}

.field-glass label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text3, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

.field-glass textarea,
.field-glass select,
.field-glass input {
    width: 100%;
    background: var(--bg3, rgba(255,255,255,0.05));
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    border-radius: 14px;
    padding: 14px 16px;
    color: var(--text, #f1f5f9);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.25s;
    resize: vertical;
    box-sizing: border-box;
}

.field-glass textarea:focus,
.field-glass select:focus,
.field-glass input:focus {
    outline: none;
    border-color: var(--accent, #3b82f6);
    background: rgba(255,255,255,0.08);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.field-glass select option {
    background: var(--bg2, #1e293b);
    color: var(--text, #f1f5f9);
}

/* Light theme overrides for broadcast modal */
.light .modal-content-glass,
.theme-beige .modal-content-glass,
.theme-pink .modal-content-glass,
.theme-sage .modal-content-glass {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.light .modal-header-glass,
.theme-beige .modal-header-glass,
.theme-pink .modal-header-glass,
.theme-sage .modal-header-glass {
    background: #f8fafc;
    border-bottom-color: #e2e8f0;
}

.light .modal-header-glass h2,
.theme-beige .modal-header-glass h2,
.theme-pink .modal-header-glass h2,
.theme-sage .modal-header-glass h2 { color: #0f172a; }

.light .modal-header-glass p,
.theme-beige .modal-header-glass p,
.theme-pink .modal-header-glass p,
.theme-sage .modal-header-glass p { color: #64748b; }

.light .btn-close-glass,
.theme-beige .btn-close-glass,
.theme-pink .btn-close-glass,
.theme-sage .btn-close-glass {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #64748b;
}

.light .field-glass textarea,
.light .field-glass select,
.light .field-glass input,
.theme-beige .field-glass textarea,
.theme-beige .field-glass select,
.theme-beige .field-glass input,
.theme-pink .field-glass textarea,
.theme-pink .field-glass select,
.theme-pink .field-glass input,
.theme-sage .field-glass textarea,
.theme-sage .field-glass select,
.theme-sage .field-glass input {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #0f172a;
}

.light .field-glass label,
.theme-beige .field-glass label,
.theme-pink .field-glass label,
.theme-sage .field-glass label { color: #64748b; }

.light .field-glass select option,
.theme-beige .field-glass select option,
.theme-pink .field-glass select option,
.theme-sage .field-glass select option {
    background: #ffffff;
    color: #0f172a;
}

/* Preview info */
.broadcast-preview-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(59,130,246,0.08);
    border: 1px solid rgba(59,130,246,0.2);
    border-radius: 12px;
    font-size: 13px;
    color: #60a5fa;
    margin-bottom: 24px;
}

.broadcast-preview-info i { flex-shrink: 0; }

/* Modal action buttons */
.modal-actions-glass {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-primary-glass {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    border: none;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    padding: 14px 24px;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s;
    box-shadow: 0 8px 20px rgba(59,130,246,0.3);
}

.btn-primary-glass:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(59,130,246,0.4);
    filter: brightness(1.08);
}

.btn-primary-glass.wide,
.btn-ghost-glass.wide {
    width: 100%;
}

.btn-ghost-glass {
    background: transparent;
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    color: var(--text3, #94a3b8);
    font-weight: 600;
    font-size: 14px;
    padding: 12px 24px;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-ghost-glass:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text, #f1f5f9);
    border-color: rgba(255,255,255,0.2);
}

.light .btn-ghost-glass,
.theme-beige .btn-ghost-glass,
.theme-pink .btn-ghost-glass,
.theme-sage .btn-ghost-glass {
    border-color: #e2e8f0;
    color: #64748b;
}

.light .btn-ghost-glass:hover,
.theme-beige .btn-ghost-glass:hover,
.theme-pink .btn-ghost-glass:hover,
.theme-sage .btn-ghost-glass:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
}

/* ═══════════════════════════════════════════════════
   KB MANAGER — Управление эталонами КВ
   ═══════════════════════════════════════════════════ */

.modal-content-glass.wide {
    max-width: 720px;
}

.modal-content-glass.full-height {
    max-width: 960px;
    height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
}

/* Body */
.kb-manager-body {
    padding: 20px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.kb-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.kb-toolbar .btn-primary-glass {
    padding: 10px 20px;
    font-size: 13px;
}

/* Blocks grid */
.kb-blocks-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Empty state */
.kb-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    gap: 12px;
}

.kb-empty-state .empty-icon {
    font-size: 48px;
    line-height: 1;
}

.kb-empty-state p {
    font-size: 14px;
    color: var(--text3, #94a3b8);
    margin: 0;
}

/* Block card */
.kb-block-card {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--bg3, rgba(255,255,255,0.04));
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: 16px;
    padding: 16px 16px 16px 0;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
}

.kb-block-card:hover {
    background: rgba(59,130,246,0.07);
    border-color: rgba(59,130,246,0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.kbc-color {
    width: 5px;
    min-height: 56px;
    border-radius: 0 4px 4px 0;
    margin-right: 16px;
    flex-shrink: 0;
}

.kbc-main {
    flex: 1;
    min-width: 0;
}

.kbc-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text, #f1f5f9);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kbc-desc {
    font-size: 12px;
    color: var(--text3, #94a3b8);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kbc-meta {
    display: flex;
    gap: 14px;
}

.kbc-meta span {
    font-size: 11px;
    color: var(--text3, #94a3b8);
    display: flex;
    align-items: center;
    gap: 4px;
}

.kbc-actions {
    flex-shrink: 0;
    margin-left: 12px;
}

.btn-icon-glass {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text3, #94a3b8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon-glass.mini {
    width: 30px;
    height: 30px;
    font-size: 12px;
    border-radius: 8px;
}

.btn-icon-glass:hover {
    background: rgba(239,68,68,0.12);
    border-color: rgba(239,68,68,0.3);
    color: #f87171;
}

/* Editor modal */
.kb-editor-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.kb-editor-sidebar {
    width: 240px;
    flex-shrink: 0;
    border-right: 1px solid var(--border, rgba(255,255,255,0.08));
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.eb-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text3, #94a3b8);
    padding: 16px 16px 10px;
    flex-shrink: 0;
}

.eb-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 8px;
}

.eb-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
}

.eb-item:hover { background: var(--bg3, rgba(255,255,255,0.05)); }
.eb-item.active {
    background: rgba(59,130,246,0.15);
    color: #60a5fa;
}

.eb-item-title {
    font-size: 13px;
    color: var(--text, #f1f5f9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.eb-item.active .eb-item-title { color: #60a5fa; }

.eb-item-del {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: var(--text3, #94a3b8);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0;
    transition: all 0.15s;
}

.eb-item:hover .eb-item-del { opacity: 1; }
.eb-item-del:hover { background: rgba(239,68,68,0.15); color: #f87171; }

.btn-add-article {
    margin: 10px 8px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(59,130,246,0.08);
    border: 1px dashed rgba(59,130,246,0.3);
    color: #60a5fa;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-add-article:hover {
    background: rgba(59,130,246,0.15);
    border-color: rgba(59,130,246,0.5);
}

.kb-editor-main#kbEditorMainContent {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.no-selection {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text3, #94a3b8);
    font-style: italic;
}

.kb-article-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.kb-article-form .field-glass textarea {
    min-height: 300px;
}

/* Back button for editor */
.btn-back-glass {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    color: var(--text3, #94a3b8);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-back-glass:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text, #f1f5f9);
}

/* Light theme overrides */
.light .kb-block-card,
.theme-beige .kb-block-card,
.theme-pink .kb-block-card,
.theme-sage .kb-block-card {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.light .kb-block-card:hover,
.theme-beige .kb-block-card:hover,
.theme-pink .kb-block-card:hover,
.theme-sage .kb-block-card:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.light .kbc-title,
.theme-beige .kbc-title,
.theme-pink .kbc-title,
.theme-sage .kbc-title { color: #0f172a; }

.light .kbc-desc,
.theme-beige .kbc-desc,
.theme-pink .kbc-desc,
.theme-sage .kbc-desc,
.light .kbc-meta span,
.theme-beige .kbc-meta span,
.theme-pink .kbc-meta span,
.theme-sage .kbc-meta span { color: #64748b; }

.light .kb-editor-sidebar,
.theme-beige .kb-editor-sidebar,
.theme-pink .kb-editor-sidebar,
.theme-sage .kb-editor-sidebar { border-color: #e2e8f0; }

.light .eb-item-title,
.theme-beige .eb-item-title,
.theme-pink .eb-item-title,
.theme-sage .eb-item-title { color: #0f172a; }

.light .btn-icon-glass,
.theme-beige .btn-icon-glass,
.theme-pink .btn-icon-glass,
.theme-sage .btn-icon-glass {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #64748b;
}

.light .btn-back-glass,
.theme-beige .btn-back-glass,
.theme-pink .btn-back-glass,
.theme-sage .btn-back-glass {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #64748b;
}

/* ═══════════════════════════════════════════════════
   BILLING — Биллинг и оплаты компаний
   ═══════════════════════════════════════════════════ */

.bl-wrap {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Stats */
.bl-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
}

.bl-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    background: var(--bg2, rgba(255,255,255,0.03));
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.bl-stat:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.15); }

.bl-stat-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.bl-stat.blue .bl-stat-icon   { background: rgba(59,130,246,0.15); color: #60a5fa; }
.bl-stat.green .bl-stat-icon  { background: rgba(16,185,129,0.15); color: #34d399; }
.bl-stat.orange .bl-stat-icon { background: rgba(245,158,11,0.15); color: #fbbf24; }
.bl-stat.red .bl-stat-icon    { background: rgba(239,68,68,0.15);  color: #f87171; }
.bl-stat.cyan .bl-stat-icon   { background: rgba(14,165,233,0.15); color: #38bdf8; }
.bl-stat.gold .bl-stat-icon   { background: rgba(234,179,8,0.15);  color: #facc15; }

.bl-stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text, #f1f5f9);
    line-height: 1.1;
}
.bl-stat-label {
    font-size: 12px;
    color: var(--text3, #94a3b8);
    margin-top: 4px;
}

/* Toolbar */
.bl-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.bl-filters { display: flex; gap: 10px; flex: 1; flex-wrap: wrap; }
.bl-actions { display: flex; gap: 10px; }

.bl-input {
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    background: var(--bg3, rgba(255,255,255,0.04));
    color: var(--text, #f1f5f9);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}
.bl-input:focus { border-color: var(--accent, #3b82f6); }

#bl-search { min-width: 260px; flex: 1; max-width: 380px; }
#bl-status-filter { min-width: 160px; cursor: pointer; }

/* Table */
.bl-table-wrap {
    background: var(--bg2, rgba(255,255,255,0.02));
    border: 1px solid var(--border, rgba(255,255,255,0.06));
    border-radius: 16px;
    overflow: hidden;
}

.bl-table { width: 100%; border-collapse: collapse; }
.bl-table th {
    text-align: left;
    padding: 14px 18px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text3, #94a3b8);
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
}
.bl-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.04));
    color: var(--text, #f1f5f9);
    font-size: 13px;
}
.bl-table tr:last-child td { border-bottom: none; }
.bl-row { cursor: pointer; transition: background 0.15s; }
.bl-row:hover { background: rgba(59,130,246,0.05); }

.bl-co strong { color: var(--text, #f1f5f9); font-weight: 600; }
.bl-plan {
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(99,102,241,0.12);
    color: #818cf8;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bl-badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    display: inline-block;
}

.bl-days { font-size: 11px; color: var(--text3, #94a3b8); margin-left: 6px; }
.bl-days.red { color: #f87171; font-weight: 600; }
.bl-days.orange { color: #fbbf24; font-weight: 600; }

.bl-actions-cell { white-space: nowrap; }
.bl-btn-icon {
    width: 30px; height: 30px;
    border-radius: 8px;
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    background: rgba(255,255,255,0.04);
    color: var(--text3, #94a3b8);
    cursor: pointer;
    margin: 0 2px;
    transition: all 0.15s;
    font-size: 11px;
}
.bl-btn-icon:hover { background: rgba(59,130,246,0.15); color: #60a5fa; border-color: rgba(59,130,246,0.3); }
.bl-btn-icon.green:hover { background: rgba(16,185,129,0.15); color: #34d399; border-color: rgba(16,185,129,0.3); }
.bl-btn-icon.orange:hover { background: rgba(245,158,11,0.15); color: #fbbf24; border-color: rgba(245,158,11,0.3); }
.bl-btn-icon.red:hover { background: rgba(239,68,68,0.15); color: #f87171; border-color: rgba(239,68,68,0.3); }

.bl-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--text3, #94a3b8);
}
.bl-empty i { font-size: 48px; opacity: 0.4; margin-bottom: 12px; display: block; }
.bl-empty p { margin: 0; font-size: 14px; }

/* Details modal */
.bl-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.bl-detail-cell {
    display: flex;
    gap: 12px;
    padding: 14px;
    background: var(--bg3, rgba(255,255,255,0.04));
    border: 1px solid var(--border, rgba(255,255,255,0.06));
    border-radius: 12px;
}
.bl-detail-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: rgba(59,130,246,0.12);
    color: #60a5fa;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.bl-detail-label {
    font-size: 11px;
    color: var(--text3, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.bl-detail-value {
    font-size: 13px;
    color: var(--text, #f1f5f9);
    font-weight: 600;
}

.bl-notes {
    padding: 12px 16px;
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.2);
    border-radius: 12px;
    color: var(--text2, #cbd5e1);
    font-size: 13px;
    margin-bottom: 20px;
}
.bl-notes strong { color: #fbbf24; }

.bl-detail-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.bl-detail-actions .btn-primary-glass,
.bl-detail-actions .btn-ghost-glass {
    flex: 1;
    min-width: 140px;
    padding: 12px 16px;
    font-size: 13px;
}

/* Comments */
.bl-comments-section h4 {
    font-size: 14px;
    color: var(--text, #f1f5f9);
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.bl-comments-section h4 i { color: var(--text3, #94a3b8); }

.bl-comment-form {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    align-items: stretch;
}
.bl-comment-form textarea {
    flex: 1;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    background: var(--bg3, rgba(255,255,255,0.04));
    color: var(--text, #f1f5f9);
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
}
.bl-comment-form textarea:focus { outline: none; border-color: var(--accent, #3b82f6); }
.bl-comment-form .btn-primary-glass {
    padding: 0 18px;
    align-self: stretch;
}

.bl-comments-list {
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.bl-comment {
    padding: 12px 14px;
    background: var(--bg3, rgba(255,255,255,0.03));
    border: 1px solid var(--border, rgba(255,255,255,0.05));
    border-radius: 10px;
}
.bl-comment-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
    gap: 10px;
}
.bl-comment-head strong { font-size: 13px; color: var(--text, #f1f5f9); }
.bl-comment-date { font-size: 11px; color: var(--text3, #94a3b8); }
.bl-comment-text { font-size: 13px; color: var(--text2, #cbd5e1); line-height: 1.5; white-space: pre-wrap; }

.bl-no-comments {
    text-align: center;
    padding: 24px;
    color: var(--text3, #94a3b8);
    font-size: 13px;
    font-style: italic;
}

/* Light theme */
.light .bl-stat, .theme-beige .bl-stat, .theme-pink .bl-stat, .theme-sage .bl-stat {
    background: #ffffff;
    border-color: #e2e8f0;
}
.light .bl-stat-value, .theme-beige .bl-stat-value,
.theme-pink .bl-stat-value, .theme-sage .bl-stat-value { color: #0f172a; }
.light .bl-stat-label, .theme-beige .bl-stat-label,
.theme-pink .bl-stat-label, .theme-sage .bl-stat-label { color: #64748b; }

.light .bl-input, .theme-beige .bl-input, .theme-pink .bl-input, .theme-sage .bl-input {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #0f172a;
}

.light .bl-table-wrap, .theme-beige .bl-table-wrap,
.theme-pink .bl-table-wrap, .theme-sage .bl-table-wrap {
    background: #ffffff;
    border-color: #e2e8f0;
}
.light .bl-table th, .theme-beige .bl-table th,
.theme-pink .bl-table th, .theme-sage .bl-table th {
    background: #f8fafc;
    color: #64748b;
    border-bottom-color: #e2e8f0;
}
.light .bl-table td, .theme-beige .bl-table td,
.theme-pink .bl-table td, .theme-sage .bl-table td {
    color: #0f172a;
    border-bottom-color: #f1f5f9;
}
.light .bl-row:hover, .theme-beige .bl-row:hover,
.theme-pink .bl-row:hover, .theme-sage .bl-row:hover { background: #eff6ff; }

.light .bl-btn-icon, .theme-beige .bl-btn-icon,
.theme-pink .bl-btn-icon, .theme-sage .bl-btn-icon {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #64748b;
}

.light .bl-detail-cell, .theme-beige .bl-detail-cell,
.theme-pink .bl-detail-cell, .theme-sage .bl-detail-cell {
    background: #f8fafc;
    border-color: #e2e8f0;
}
.light .bl-detail-value, .theme-beige .bl-detail-value,
.theme-pink .bl-detail-value, .theme-sage .bl-detail-value { color: #0f172a; }
.light .bl-detail-label, .theme-beige .bl-detail-label,
.theme-pink .bl-detail-label, .theme-sage .bl-detail-label { color: #64748b; }

.light .bl-comment, .theme-beige .bl-comment,
.theme-pink .bl-comment, .theme-sage .bl-comment {
    background: #f8fafc;
    border-color: #e2e8f0;
}
.light .bl-comment-head strong, .theme-beige .bl-comment-head strong,
.theme-pink .bl-comment-head strong, .theme-sage .bl-comment-head strong { color: #0f172a; }
.light .bl-comment-text, .theme-beige .bl-comment-text,
.theme-pink .bl-comment-text, .theme-sage .bl-comment-text { color: #475569; }

.light .bl-comment-form textarea, .theme-beige .bl-comment-form textarea,
.theme-pink .bl-comment-form textarea, .theme-sage .bl-comment-form textarea {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #0f172a;
}

/* Responsive */
@media (max-width: 768px) {
    .bl-stats { grid-template-columns: repeat(2, 1fr); }
    .bl-detail-grid { grid-template-columns: 1fr; }
    .bl-table th:nth-child(3), .bl-table td:nth-child(3),
    .bl-table th:nth-child(5), .bl-table td:nth-child(5) { display: none; }
}

/* ── Управление пользователями: кнопка удаления и поповер ── */

.su-row { border-bottom: 1px solid rgba(255,255,255,0.03); transition: background 0.15s; }
.su-row:hover { background: var(--surface2); }

.su-company-id {
  padding: 5px 10px;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: monospace;
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, color 0.15s;
}
.su-company-id:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.su-delete-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(239,68,68,0.35);
  background: rgba(239,68,68,0.08);
  color: #ef4444;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.su-delete-btn:hover { background: rgba(239,68,68,0.18); border-color: rgba(239,68,68,0.6); }

.su-delete-confirm {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  margin-left: 8px;
  background: var(--surface2);
  border: 1px solid rgba(239,68,68,0.4);
  border-radius: 10px;
  font-size: 12px;
  color: var(--text2);
  animation: fadeIn 0.15s ease;
}
.su-confirm-yes {
  padding: 4px 12px;
  border-radius: 6px;
  border: none;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.su-confirm-yes:hover { background: #dc2626; }
.su-confirm-no {
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface3);
  color: var(--text2);
  font-size: 12px;
  cursor: pointer;
}
.su-confirm-no:hover { background: var(--surface2); }

/* ══════════════════════════════════════════════════════
   SYSTEM_SUBSCRIPTIONS — Subscription Management Modal
   ══════════════════════════════════════════════════════ */

/* Tab bar */
.subs-tabs {
  display: flex;
  gap: 4px;
  padding: 0 20px;
  border-bottom: 1px solid var(--sys-glass-border, rgba(255,255,255,0.08));
  overflow-x: auto;
  flex-wrap: nowrap;
}
.subs-tab {
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--sys-text3, #94a3b8);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.subs-tab:hover { color: var(--sys-text, #f1f5f9); }
.subs-tab.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}

/* Sections */
.subs-section {
  margin-bottom: 16px;
}
.subs-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sys-text3, #94a3b8);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--sys-glass-border, rgba(255,255,255,0.08));
}

/* Row: label + value */
.subs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  gap: 12px;
  font-size: 13px;
}
.subs-label {
  color: var(--sys-text3, #94a3b8);
  flex-shrink: 0;
  min-width: 120px;
}
.subs-value {
  color: var(--sys-text, #f1f5f9);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Inline row for form groups */
.subs-row-inline {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.subs-group {
  flex: 1;
  min-width: 120px;
  margin-bottom: 8px;
}
.subs-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--sys-text3, #94a3b8);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Inputs */
.subs-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--sys-glass-border, rgba(255,255,255,0.12));
  background: rgba(255,255,255,0.05);
  color: var(--sys-text, #f1f5f9);
  font-size: 13px;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.subs-input:focus {
  outline: none;
  border-color: #3b82f6;
}
.subs-input option {
  background: #1e293b;
  color: #f1f5f9;
}

/* Light theme overrides */
.light .subs-input,
.theme-beige .subs-input,
.theme-pink .subs-input,
.theme-sage .subs-input {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #0f172a;
}
.light .subs-input option,
.theme-beige .subs-input option,
.theme-pink .subs-input option,
.theme-sage .subs-input option {
  background: #fff;
  color: #0f172a;
}

/* Progress bar */
.subs-bar-wrap {
  display: inline-block;
  width: 80px;
  height: 5px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
  vertical-align: middle;
}
.subs-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* Plans grid */
.subs-plans-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.subs-plan-card {
  flex: 1;
  min-width: 100px;
  border: 2px solid var(--sys-glass-border, rgba(255,255,255,0.1));
  border-radius: 10px;
  padding: 10px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(255,255,255,0.03);
}
.subs-plan-card:hover {
  border-color: #3b82f6;
  background: rgba(59,130,246,0.08);
}
.subs-plan-card.active {
  border-color: #22c55e;
  background: rgba(34,197,94,0.08);
}
.subs-plan-card.selected {
  border-color: #3b82f6;
  background: rgba(59,130,246,0.15);
}
.subs-plan-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--sys-text, #f1f5f9);
  margin-bottom: 4px;
}
.subs-plan-price {
  font-size: 11px;
  color: var(--sys-text3, #94a3b8);
}
.subs-plan-current {
  font-size: 10px;
  color: #22c55e;
  font-weight: 600;
  margin-top: 4px;
}

/* Feature toggles (checkbox + track) */
.subs-features-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.subs-feat-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.subs-feat-toggle input[type="checkbox"] {
  display: none;
}
.subs-toggle-track {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: rgba(255,255,255,0.12);
  flex-shrink: 0;
  position: relative;
  transition: background 0.2s;
}
.subs-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.subs-feat-toggle input:checked + .subs-toggle-track {
  background: #3b82f6;
}
.subs-feat-toggle input:checked + .subs-toggle-track::after {
  transform: translateX(16px);
}
.subs-feat-label {
  font-size: 13px;
  color: var(--sys-text, #f1f5f9);
}

/* Feature pills on status tab */
.subs-features-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 0;
}
.subs-feat-pill {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.subs-feat-pill.on {
  background: rgba(34,197,94,0.15);
  color: #22c55e;
  border: 1px solid rgba(34,197,94,0.3);
}
.subs-feat-pill.off {
  background: rgba(255,255,255,0.05);
  color: var(--sys-text3, #94a3b8);
  border: 1px solid var(--sys-glass-border, rgba(255,255,255,0.08));
}

/* History tags */
.subs-hist-tag {
  display: inline-block;
  background: rgba(59,130,246,0.12);
  color: #93c5fd;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10px;
  margin: 1px 2px 1px 0;
}

/* Action buttons */
.subs-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.subs-btn {
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  background: rgba(255,255,255,0.08);
  color: var(--sys-text, #f1f5f9);
}
.subs-btn:hover { background: rgba(255,255,255,0.14); }
.subs-btn.primary {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
}
.subs-btn.primary:hover { opacity: 0.88; }
.subs-btn.danger {
  background: rgba(239,68,68,0.15);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.3);
}
.subs-btn.danger:hover { background: rgba(239,68,68,0.25); }

/* Error message */
.subs-err {
  color: #f87171;
  font-size: 13px;
  padding: 16px 0;
  text-align: center;
}
