/* ═══════════════════════════════════════════════════
   МедЗапас — Стили для Админ-панели
═══════════════════════════════════════════════════ */

/* ─── КАРТОЧКА ДЕТАЛИ ЛЕКАРСТВА ─── */
.medicine-detail-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--glass-border);
}
.medicine-detail-section:last-child { border-bottom: none; }
.detail-section-title {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px;
}

/* ─── ДЕТАЛЬНАЯ СТРАНИЦА ЛЕКАРСТВА ─── */
.med-detail-actions {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px;
}
.ingredient-tag {
  display: inline-block; background: rgba(74,222,128,0.12);
  color: var(--accent); border-radius: 20px;
  padding: 3px 12px; font-size: 0.8rem; font-weight: 500;
  border: 1px solid rgba(74,222,128,0.2);
}
.prescription-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--danger-bg); color: var(--danger);
  border-radius: 20px; padding: 4px 10px; font-size: 0.8rem;
}

/* ─── DRAG & DROP ДЕРЕВО ─── */
.tree-node.drag-over > .tree-header {
  background: var(--accent-glow);
  border-radius: var(--r-md);
  outline: 2px dashed var(--accent);
}
.tree-node[draggable="true"] { cursor: grab; }
.tree-node[draggable="true"]:active { cursor: grabbing; opacity: 0.7; }

/* ─── СУПЕРАДМИН ПАНЕЛЬ ─── */
.superadmin-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, rgba(245,158,11,0.2), rgba(239,68,68,0.2));
  border: 1px solid rgba(245,158,11,0.4);
  color: var(--warn); border-radius: var(--r-md);
  padding: 6px 14px; font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.05em; margin-bottom: 20px;
}

/* Таблица лицензий */
.license-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.license-table th {
  text-align: left; padding: 10px 14px;
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-muted);
  border-bottom: 1px solid var(--glass-border);
}
.license-table td { padding: 12px 14px; font-size: 0.875rem; border-bottom: 1px solid rgba(255,255,255,0.04); }
.license-table tr:hover td { background: rgba(255,255,255,0.03); }

.license-key {
  font-family: 'Courier New', monospace; font-size: 0.85rem;
  color: var(--accent); letter-spacing: 0.05em;
}
.license-status-active {
  display: inline-block; padding: 2px 10px; border-radius: 20px;
  background: var(--ok-bg); color: var(--accent); font-size: 0.75rem; font-weight: 600;
}
.license-status-inactive {
  display: inline-block; padding: 2px 10px; border-radius: 20px;
  background: rgba(255,255,255,0.07); color: var(--text-muted); font-size: 0.75rem;
}
.license-status-expired {
  display: inline-block; padding: 2px 10px; border-radius: 20px;
  background: var(--danger-bg); color: var(--danger); font-size: 0.75rem; font-weight: 600;
}

/* ─── УВЕДОМЛЕНИЯ (НОТИФИКАЦИИ) ─── */
.notification-card {
  background: var(--bg-card); border: 1px solid var(--glass-border);
  border-radius: var(--r-md); padding: 12px 16px;
  display: flex; gap: 12px; align-items: flex-start; margin-bottom: 8px;
}
.notification-icon { font-size: 1.3rem; flex-shrink: 0; }
.notification-title { font-weight: 600; font-size: 0.9rem; }
.notification-msg { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }
.notification-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; }

/* ─── ВЗАИМОДЕЙСТВИЕ ЛЕКАРСТВ ─── */
.interaction-card {
  border-radius: var(--r-md); padding: 14px; margin-bottom: 10px;
  border: 1px solid var(--glass-border);
}
.interaction-safe { border-color: rgba(74,222,128,0.25); background: rgba(74,222,128,0.06); }
.interaction-warning { border-color: rgba(245,158,11,0.35); background: rgba(245,158,11,0.08); }
.interaction-danger { border-color: rgba(239,68,68,0.35); background: rgba(239,68,68,0.08); }
.interaction-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.interaction-severity { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; padding: 2px 8px; border-radius: 20px; }
.sev-safe { background: var(--ok-bg); color: var(--accent); }
.sev-warning { background: var(--warn-bg); color: var(--warn); }
.sev-danger { background: var(--danger-bg); color: var(--danger); }
.interaction-meds { font-weight: 600; font-size: 0.9rem; }
.interaction-desc { font-size: 0.8rem; color: var(--text-secondary); margin-top: 4px; }

/* ─── ПРОФИЛЬ ПОЛЬЗОВАТЕЛЯ ─── */
.profile-header {
  text-align: center; padding: 24px;
  border-bottom: 1px solid var(--glass-border); margin-bottom: 20px;
}
.profile-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--accent); color: #0f1923;
  font-size: 2rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.profile-name { font-size: 1.3rem; font-weight: 700; }
.profile-role { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* ─── ДЕСКТОП СЕТКА ─── */
@media (min-width: 900px) {
  #page-admin .admin-content {
    display: grid; grid-template-columns: 260px 1fr;
    gap: 24px; align-items: start;
  }
  .admin-tabs {
    flex-direction: column; gap: 4px;
    background: var(--bg-card); border-radius: var(--r-lg);
    padding: 8px;
  }
  .tab-btn { text-align: left; justify-content: flex-start; }
}

/* ─── ДЕМО-РЕЖИМ ─── */
.btn-demo {
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 13px 20px;
  box-shadow: 0 4px 20px rgba(245,158,11,0.3);
  position: relative; overflow: hidden;
}
.btn-demo::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0; transition: opacity 280ms ease;
}
.btn-demo:hover::before { opacity: 1; }
.btn-demo:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(245,158,11,0.4); }
.btn-demo:active { transform: translateY(0); }
.btn-demo-icon { font-size: 1.25rem; }
.btn-demo-hint { font-size: 0.75rem; font-weight: 400; opacity: 0.85; margin-left: auto; }

.demo-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0 16px; color: rgba(255,255,255,0.3); font-size: 0.8rem;
}
.demo-divider::before, .demo-divider::after {
  content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.08);
}

.demo-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px;
  background: linear-gradient(90deg, rgba(245,158,11,0.18), rgba(239,68,68,0.12));
  border-bottom: 1px solid rgba(245,158,11,0.25);
  font-size: 0.82rem; flex-wrap: wrap;
  animation: bannerIn 0.4s ease;
}
@keyframes bannerIn {
  from { opacity: 0; transform: translateY(-100%); }
  to   { opacity: 1; transform: translateY(0); }
}
.demo-banner-icon { font-size: 1rem; flex-shrink: 0; }
.demo-banner-text { color: rgba(255,255,255,0.6); flex: 1; min-width: 0; }
.demo-banner-link {
  color: #f59e0b; font-weight: 600; text-decoration: none; white-space: nowrap; flex-shrink: 0;
}
.demo-banner-link:hover { text-decoration: underline; }
.demo-banner-close {
  background: none; border: none; color: rgba(255,255,255,0.35);
  cursor: pointer; font-size: 0.95rem; padding: 0 2px; flex-shrink: 0; transition: color 200ms;
}
.demo-banner-close:hover { color: #fff; }
