/* 
  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;
    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;
}
