/* ═══════════════════════════════════════════
   NORDIC CUTS — Admin Panel Styles
   Светлая тема с золотым акцентом
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Переменные ─────────────────────────── */
:root {
  --a-primary:    #C9A84C;
  --a-primary-h:  #A07830;
  --a-primary-lt: rgba(201,168,76,0.12);
  --a-bg:         #F4F4F5;
  --a-surface:    #FFFFFF;
  --a-surface2:   #F9F9FA;
  --a-text:       #18181B;
  --a-text-muted: #71717A;
  --a-border:     #E4E4E7;
  --a-shadow:     0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.04);
  --a-shadow-md:  0 4px 20px rgba(0,0,0,0.1);
  --a-radius:     10px;
  --a-sidebar-w:  240px;
  --a-topbar-h:   60px;
  --a-success:    #22c55e;
  --a-danger:     #ef4444;
  --a-warning:    #f59e0b;
  --a-info:       #3b82f6;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--a-bg);
  color: var(--a-text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ══════════════════════════════════════════
   ЭКРАН ВХОДА
══════════════════════════════════════════ */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0A0A0A;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(201,168,76,0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(201,168,76,0.05) 0%, transparent 40%);
}

.login-card {
  background: #141414;
  border: 1px solid #2A2520;
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.login-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--a-primary);
  margin-bottom: 6px;
  font-family: 'Playfair Display', 'Georgia', serif;
  letter-spacing: 0.02em;
}

.login-subtitle {
  font-size: 0.85rem;
  color: #6B6560;
  margin-bottom: 36px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-input {
  width: 100%;
  background: #1E1E1E;
  border: 1.5px solid #2A2520;
  border-radius: 10px;
  color: #F5F0E8;
  padding: 14px 16px;
  font-size: 0.95rem;
  outline: none;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}
.login-input:focus { border-color: var(--a-primary); }
.login-input::placeholder { color: #5A5550; }

.login-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--a-primary), #D4AF6A);
  color: #0A0A0A;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  margin-top: 4px;
  letter-spacing: 0.04em;
}
.login-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.login-btn:active { transform: translateY(0); }

.login-error {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--a-danger);
  min-height: 20px;
}

/* ── Кнопки языка на экране входа ── */
.login-lang {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}
.login-lang-btn {
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  background: #1E1E1E;
  border: 1.5px solid #2A2520;
  color: #6B6560;
  cursor: pointer;
  transition: all 0.2s;
}
.login-lang-btn:hover {
  border-color: var(--a-primary);
  color: var(--a-primary);
  background: rgba(201,168,76,0.08);
}
.login-lang-btn.active {
  background: var(--a-primary);
  border-color: var(--a-primary);
  color: #0A0A0A;
}

/* ══════════════════════════════════════════
   LAYOUT
══════════════════════════════════════════ */
#admin-app { display: none; min-height: 100vh; }
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* ══════════════════════════════════════════
   САЙДБАР
══════════════════════════════════════════ */
.sidebar {
  width: var(--a-sidebar-w);
  background: var(--a-surface);
  border-right: 1px solid var(--a-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 200;
  transition: transform 0.3s cubic-bezier(0.19,1,0.22,1);
  overflow: hidden;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--a-border);
  flex-shrink: 0;
}
.sidebar-logo-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--a-primary);
  letter-spacing: 0.02em;
}
.sidebar-logo-sub {
  font-size: 0.72rem;
  color: var(--a-text-muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--a-border) transparent;
}

.sidebar-group { margin-bottom: 2px; }
.sidebar-group-label {
  padding: 8px 16px 4px;
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--a-text-muted);
  opacity: 0.7;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: var(--a-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  border-radius: 0;
}
.sidebar-link:hover {
  background: var(--a-bg);
  color: var(--a-text);
}
.sidebar-link.active {
  background: var(--a-primary-lt);
  color: var(--a-primary);
  font-weight: 600;
}
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--a-primary);
  border-radius: 0 2px 2px 0;
}
.sidebar-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.sidebar-link.active svg,
.sidebar-link:hover svg { opacity: 1; }

.sidebar-badge {
  margin-left: auto;
  background: var(--a-danger);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
  line-height: 1.4;
}

/* ── Футер сайдбара ── */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--a-border);
  flex-shrink: 0;
}

/* ── Кнопки языка в сайдбаре ── */
.sidebar-lang {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
}
.sidebar-lang-btn {
  flex: 1;
  padding: 6px 4px;
  border-radius: 7px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--a-text-muted);
  background: var(--a-bg);
  border: 1.5px solid var(--a-border);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.sidebar-lang-btn:hover {
  border-color: var(--a-primary);
  color: var(--a-primary);
  background: var(--a-primary-lt);
}
.sidebar-lang-btn.active {
  background: var(--a-primary);
  color: #0A0A0A;
  border-color: var(--a-primary);
  font-weight: 700;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--a-text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--a-border);
  background: none;
  transition: all 0.15s;
}
.sidebar-logout:hover {
  background: #FEF2F2;
  color: var(--a-danger);
  border-color: #FECACA;
}
.sidebar-logout svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ══════════════════════════════════════════
   ТОПБАР
══════════════════════════════════════════ */
.topbar {
  position: fixed;
  top: 0;
  left: var(--a-sidebar-w);
  right: 0;
  height: var(--a-topbar-h);
  background: var(--a-surface);
  border-bottom: 1px solid var(--a-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  gap: 12px;
}
.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--a-text);
  flex: 1;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.topbar-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--a-text-muted);
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--a-success);
  animation: topStatusPulse 2s ease infinite;
}
@keyframes topStatusPulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

.topbar-hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.topbar-hamburger span {
  display: block;
  width: 20px; height: 2px;
  background: var(--a-text);
  border-radius: 2px;
  transition: all 0.2s;
}

/* ══════════════════════════════════════════
   ОСНОВНОЙ КОНТЕНТ
══════════════════════════════════════════ */
.main-content {
  margin-left: var(--a-sidebar-w);
  margin-top: var(--a-topbar-h);
  padding: 24px;
  min-height: calc(100vh - var(--a-topbar-h));
  flex: 1;
}

/* ══════════════════════════════════════════
   СЕКЦИИ
══════════════════════════════════════════ */
.admin-section { display: none; }
.admin-section.active {
  display: block;
  animation: adminFadeIn 0.25s ease both;
}
@keyframes adminFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ══════════════════════════════════════════
   DASHBOARD — КАРТОЧКИ СТАТИСТИКИ
══════════════════════════════════════════ */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--a-surface);
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  padding: 20px;
  box-shadow: var(--a-shadow);
  transition: box-shadow 0.15s;
}
.stat-card:hover { box-shadow: var(--a-shadow-md); }
.stat-card-label {
  font-size: 0.75rem;
  color: var(--a-text-muted);
  margin-bottom: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat-card-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--a-text);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-card-sub {
  font-size: 0.75rem;
  color: var(--a-text-muted);
}
.stat-card.highlight .stat-card-value { color: var(--a-primary); }

/* ══════════════════════════════════════════
   КАРТОЧКИ
══════════════════════════════════════════ */
.card {
  background: var(--a-surface);
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  box-shadow: var(--a-shadow);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--a-border);
  gap: 12px;
}
.card-title {
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--a-text);
}
.card-body { padding: 20px; }

/* ══════════════════════════════════════════
   ТАБЛИЦЫ
══════════════════════════════════════════ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--a-radius);
  border: 1px solid var(--a-border);
}
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--a-surface);
}
thead { background: var(--a-bg); }
th {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--a-text-muted);
  border-bottom: 1px solid var(--a-border);
  white-space: nowrap;
}
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--a-border);
  font-size: 0.875rem;
  color: var(--a-text);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.1s; }
tbody tr:hover { background: var(--a-bg); }

/* ══════════════════════════════════════════
   СТАТУСЫ ЗАПИСЕЙ
══════════════════════════════════════════ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.status-new       { background: #EFF6FF; color: var(--a-info); }
.status-done      { background: #F0FDF4; color: var(--a-success); }
.status-cancelled { background: #FEF2F2; color: var(--a-danger); }
.status-paid      { background: #F0FDF4; color: var(--a-success); }
.status-unpaid    { background: #FFFBEB; color: var(--a-warning); }

/* ══════════════════════════════════════════
   КНОПКИ
══════════════════════════════════════════ */
.a-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1.4;
}
.a-btn-primary {
  background: var(--a-primary);
  color: #0A0A0A;
  font-weight: 600;
}
.a-btn-primary:hover { background: var(--a-primary-h); }
.a-btn-primary:active { transform: translateY(1px); }

.a-btn-outline {
  border-color: var(--a-border);
  background: var(--a-surface);
  color: var(--a-text);
}
.a-btn-outline:hover { border-color: var(--a-primary); color: var(--a-primary); }

.a-btn-danger {
  border-color: #FECACA;
  background: #FEF2F2;
  color: var(--a-danger);
}
.a-btn-danger:hover { background: var(--a-danger); color: #fff; border-color: var(--a-danger); }

.a-btn-ghost {
  background: none;
  border-color: transparent;
  color: var(--a-text-muted);
  padding: 6px 10px;
}
.a-btn-ghost:hover { color: var(--a-text); background: var(--a-bg); }

.a-btn-sm { padding: 5px 10px; font-size: 0.78rem; }
.a-btn-icon { padding: 7px; border-radius: 7px; }

/* ══════════════════════════════════════════
   ФИЛЬТРЫ И ПОИСК
══════════════════════════════════════════ */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.a-input, .a-select {
  padding: 8px 12px;
  border: 1px solid var(--a-border);
  border-radius: 8px;
  font-size: 0.85rem;
  background: var(--a-surface);
  color: var(--a-text);
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}
.a-input:focus, .a-select:focus { border-color: var(--a-primary); }
.a-input-search {
  padding-left: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2371717A' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
}

/* ══════════════════════════════════════════
   ВКЛАДКИ
══════════════════════════════════════════ */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--a-bg);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
  border: 1px solid var(--a-border);
  flex-wrap: wrap;
}
.tab-btn {
  flex: 1;
  min-width: 80px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--a-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  font-family: inherit;
  white-space: nowrap;
}
.tab-btn.active {
  background: var(--a-surface);
  color: var(--a-text);
  box-shadow: var(--a-shadow);
  font-weight: 600;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ══════════════════════════════════════════
   МОДАЛЬНОЕ ОКНО
══════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open {
  display: flex;
  animation: adminFadeIn 0.2s ease both;
}
.modal {
  background: var(--a-surface);
  border-radius: 14px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--a-shadow-md);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--a-border);
  flex-shrink: 0;
}
.modal-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--a-text);
}
.modal-close {
  width: 30px; height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--a-text-muted);
  font-size: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
}
.modal-close:hover { background: var(--a-bg); color: var(--a-text); }
.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--a-border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Поля формы в модале ── */
.a-form-group { margin-bottom: 14px; }
.a-form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--a-text-muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.a-form-input,
.a-form-textarea,
.a-form-select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--a-border);
  border-radius: 8px;
  font-size: 0.875rem;
  background: var(--a-surface);
  color: var(--a-text);
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}
.a-form-input:focus,
.a-form-textarea:focus,
.a-form-select:focus { border-color: var(--a-primary); }
.a-form-textarea { resize: vertical; min-height: 80px; }
.a-form-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.a-form-tab {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--a-bg);
  border: 1px solid var(--a-border);
  color: var(--a-text-muted);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.a-form-tab.active {
  background: var(--a-primary);
  color: #fff;
  border-color: var(--a-primary);
}

/* ══════════════════════════════════════════
   ДИЗАЙН — ЦВЕТОВОЙ ПИКЕР
══════════════════════════════════════════ */
.color-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
.color-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
.color-swatch {
  width: 48px; height: 48px;
  border-radius: 10px;
  border: 2px solid var(--a-border);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
  overflow: hidden;
}
.color-swatch:hover { transform: scale(1.08); box-shadow: var(--a-shadow-md); }
.color-swatch input[type="color"] {
  position: absolute;
  inset: -4px;
  width: calc(100% + 8px);
  height: calc(100% + 8px);
  opacity: 0;
  cursor: pointer;
  border: none;
  padding: 0;
}
.color-label {
  font-size: 0.67rem;
  color: var(--a-text-muted);
  text-align: center;
  line-height: 1.3;
}
.themes-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.theme-btn {
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  border: 1.5px solid var(--a-border);
  background: var(--a-surface);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.theme-btn:hover { border-color: var(--a-primary); color: var(--a-primary); }

/* ══════════════════════════════════════════
   TOGGLE / SWITCH
══════════════════════════════════════════ */
.a-toggle {
  position: relative;
  width: 40px; height: 22px;
  flex-shrink: 0;
  display: inline-block;
}
.a-toggle input {
  opacity: 0;
  width: 0; height: 0;
  position: absolute;
}
.a-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--a-border);
  border-radius: 999px;
  transition: background 0.2s;
  cursor: pointer;
}
.a-toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  top: 3px; left: 3px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.a-toggle input:checked + .a-toggle-slider { background: var(--a-primary); }
.a-toggle input:checked + .a-toggle-slider::before { transform: translateX(18px); }

.a-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--a-border);
  gap: 16px;
}
.a-toggle-row:last-child { border-bottom: none; }
.a-toggle-info { flex: 1; }
.a-toggle-info .a-toggle-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--a-text);
}
.a-toggle-info .a-toggle-desc {
  font-size: 0.78rem;
  color: var(--a-text-muted);
  margin-top: 2px;
}

/* ══════════════════════════════════════════
   РАСПИСАНИЕ — ДНИ
══════════════════════════════════════════ */
.days-selector {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.day-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--a-border);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--a-text-muted);
  background: none;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}
.day-btn:hover { border-color: var(--a-primary); color: var(--a-primary); }
.day-btn.active {
  background: var(--a-primary);
  color: #0A0A0A;
  border-color: var(--a-primary);
}

/* ══════════════════════════════════════════
   TOAST УВЕДОМЛЕНИЯ
══════════════════════════════════════════ */
.a-toasts {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.a-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--a-surface);
  border: 1px solid var(--a-border);
  box-shadow: var(--a-shadow-md);
  min-width: 240px;
  max-width: 340px;
  pointer-events: all;
  animation: toastSlideIn 0.35s cubic-bezier(0.19,1,0.22,1) both;
}
.a-toast.hiding { animation: toastSlideOut 0.25s ease both; }

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: none; }
}
@keyframes toastSlideOut {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateX(20px); }
}

.a-toast.success { border-left: 3px solid var(--a-success); }
.a-toast.error   { border-left: 3px solid var(--a-danger); }
.a-toast.info    { border-left: 3px solid var(--a-info); }
.a-toast-icon { font-size: 1rem; flex-shrink: 0; }
.a-toast.success .a-toast-icon { color: var(--a-success); }
.a-toast.error   .a-toast-icon { color: var(--a-danger); }
.a-toast.info    .a-toast-icon { color: var(--a-info); }

/* ══════════════════════════════════════════
   CONFIRM DIALOG
══════════════════════════════════════════ */
.confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.confirm-overlay.open {
  display: flex;
  animation: adminFadeIn 0.2s ease both;
}
.confirm-box {
  background: var(--a-surface);
  border-radius: 14px;
  padding: 28px 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: var(--a-shadow-md);
}
.confirm-icon { font-size: 2rem; margin-bottom: 12px; }
.confirm-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--a-text);
}
.confirm-text {
  font-size: 0.875rem;
  color: var(--a-text-muted);
  margin-bottom: 24px;
}
.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* ══════════════════════════════════════════
   МАСТЕРА — КАРТОЧКИ В АДМИНКЕ
══════════════════════════════════════════ */
.master-admin-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.master-admin-card {
  background: var(--a-surface);
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  overflow: hidden;
  box-shadow: var(--a-shadow);
  transition: box-shadow 0.15s, transform 0.15s;
}
.master-admin-card:hover {
  box-shadow: var(--a-shadow-md);
  transform: translateY(-2px);
}
.master-admin-photo {
  width: 100%; height: 160px;
  object-fit: cover;
  display: block;
  background: var(--a-bg);
}
.master-admin-body { padding: 14px; }
.master-admin-name {
  font-weight: 600;
  font-size: 0.925rem;
  margin-bottom: 3px;
  color: var(--a-text);
}
.master-admin-role {
  font-size: 0.78rem;
  color: var(--a-text-muted);
  margin-bottom: 10px;
}
.master-admin-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

/* ══════════════════════════════════════════
   УСЛУГИ — КАРТОЧКИ В АДМИНКЕ
══════════════════════════════════════════ */
.services-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.service-admin-card {
  background: var(--a-surface);
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  overflow: hidden;
  box-shadow: var(--a-shadow);
  transition: box-shadow 0.15s;
}
.service-admin-card:hover { box-shadow: var(--a-shadow-md); }
.service-admin-img {
  width: 100%; height: 120px;
  object-fit: cover;
  display: block;
  background: var(--a-bg);
}
.service-admin-body { padding: 14px; }
.service-admin-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
  color: var(--a-text);
}
.service-admin-price {
  color: var(--a-primary);
  font-weight: 700;
  font-size: 1rem;
}
.service-admin-dur {
  font-size: 0.75rem;
  color: var(--a-text-muted);
}
.service-admin-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  justify-content: flex-end;
}

/* ══════════════════════════════════════════
   ГАЛЕРЕЯ В АДМИНКЕ
══════════════════════════════════════════ */
.gallery-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.gallery-admin-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--a-border);
  aspect-ratio: 1;
  background: var(--a-bg);
}
.gallery-admin-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}
.gallery-admin-item:hover img { transform: scale(1.05); }
.gallery-admin-actions {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.2s;
}
.gallery-admin-item:hover .gallery-admin-actions { opacity: 1; }

/* ══════════════════════════════════════════
   ОВЕРЛЕЙ МОБИЛЬНОГО МЕНЮ
══════════════════════════════════════════ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 199;
}
.sidebar-overlay.open { display: block; }

/* ══════════════════════════════════════════
   АДАПТИВ
══════════════════════════════════════════ */
@media (max-width: 1200px) {
  .stats-cards { grid-template-columns: repeat(2, 1fr); }
  .color-grid  { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 1024px) {
  .stats-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .sidebar.mobile-open {
    transform: none;
    box-shadow: var(--a-shadow-md);
  }
  .topbar {
    left: 0;
  }
  .topbar-hamburger { display: flex; }
  .main-content {
    margin-left: 0;
    padding: 16px;
  }
  .stats-cards { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .color-grid  { grid-template-columns: repeat(3, 1fr); }
  .master-admin-cards { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .filters-bar { flex-direction: column; align-items: stretch; }
  .a-input, .a-select { width: 100%; }
  .tabs { flex-wrap: wrap; }
  .tab-btn { flex: none; }
}

@media (max-width: 480px) {
  .stats-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card-value { font-size: 1.6rem; }
  .color-grid { grid-template-columns: repeat(3, 1fr); }
  .master-admin-cards { grid-template-columns: 1fr 1fr; }
  .services-admin-grid { grid-template-columns: 1fr; }
  .login-card { padding: 36px 24px; }
  .modal { max-width: 100%; border-radius: 14px 14px 0 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }
/* ══════════════════════════════════════════
   HEX ИНПУТЫ В ПИКЕРЕ ЦВЕТА
══════════════════════════════════════════ */
.hex-input {
  width: 100%;
  font-size: 0.68rem !important;
  padding: 4px 6px !important;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 6px !important;
}

/* ══════════════════════════════════════════
   СКРОЛЛБАР
══════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--a-border);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: var(--a-text-muted); }

/* ══════════════════════════════════════════
   СПИННЕР
══════════════════════════════════════════ */
.a-spinner {
  width: 28px; height: 28px;
  border: 2px solid var(--a-border);
  border-top-color: var(--a-primary);
  border-radius: 50%;
  animation: aSpin 0.7s linear infinite;
  margin: 32px auto;
}
@keyframes aSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ══════════════════════════════════════════
   ПУСТЫЕ СОСТОЯНИЯ
══════════════════════════════════════════ */
.a-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--a-text-muted);
}
.a-empty-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.5; }
.a-empty-text { font-size: 0.9rem; }

/* ══════════════════════════════════════════
   SHAKE АНИМАЦИЯ (неверный пароль)
══════════════════════════════════════════ */
@keyframes aShake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-8px); }
  40%     { transform: translateX(8px); }
  60%     { transform: translateX(-5px); }
  80%     { transform: translateX(5px); }
}
.shake { animation: aShake 0.4s ease both; }

/* ══════════════════════════════════════════
   БЛОКИРОВКА ДАТ — ТЕГИ
══════════════════════════════════════════ */
.blocked-date-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--a-bg);
  border: 1px solid var(--a-border);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 0.8rem;
  color: var(--a-text);
  transition: border-color 0.15s;
}
.blocked-date-tag:hover { border-color: var(--a-danger); }
.blocked-date-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--a-text-muted);
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
  transition: color 0.15s;
  font-family: inherit;
}
.blocked-date-remove:hover { color: var(--a-danger); }

/* ══════════════════════════════════════════
   PERIOD БЛОКИ
══════════════════════════════════════════ */
.period-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--a-bg);
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid var(--a-border);
  gap: 12px;
  transition: border-color 0.15s;
}
.period-item:hover { border-color: var(--a-primary); }
.period-item-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--a-text);
}
.period-item-dates {
  font-size: 0.78rem;
  color: var(--a-text-muted);
  margin-top: 2px;
}

/* ══════════════════════════════════════════
   МАСТЕР — РАСПИСАНИЕ КАРТОЧКА
══════════════════════════════════════════ */
.master-schedule-card {
  background: var(--a-bg);
  border: 1px solid var(--a-border);
  border-radius: 10px;
  padding: 16px;
  transition: border-color 0.15s;
}
.master-schedule-card:hover { border-color: var(--a-primary); }
.master-schedule-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--a-text);
}
.master-schedule-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--a-border);
  flex-shrink: 0;
  background: var(--a-border);
}
.master-schedule-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.master-schedule-time-label {
  font-size: 0.68rem;
  color: var(--a-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

/* ══════════════════════════════════════════
   STRIPE СЕКЦИЯ
══════════════════════════════════════════ */
.stripe-info-box {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 0.85rem;
  color: #92400E;
  line-height: 1.6;
  margin-top: 16px;
}
.stripe-info-box a { color: var(--a-primary); text-decoration: underline; }
.stripe-info-box strong { font-weight: 600; }

/* ══════════════════════════════════════════
   SEO — БЛОКИ ЯЗЫКОВ
══════════════════════════════════════════ */
.seo-lang-block {
  background: var(--a-bg);
  border: 1px solid var(--a-border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
}
.seo-lang-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--a-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.seo-lang-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--a-border);
}

/* ══════════════════════════════════════════
   НАСТРОЙКИ — КАРТОЧКА ПРОЕКТА
══════════════════════════════════════════ */
.project-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--a-border);
  font-size: 0.875rem;
}
.project-info-row:last-child { border-bottom: none; }
.project-info-key { color: var(--a-text-muted); }
.project-info-val {
  font-weight: 500;
  color: var(--a-text);
}

/* ══════════════════════════════════════════
   БЫСТРЫЕ ДЕЙСТВИЯ DASHBOARD
══════════════════════════════════════════ */
.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid var(--a-border);
  background: var(--a-surface);
  color: var(--a-text);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  width: 100%;
  font-family: inherit;
}
.quick-action-btn:hover {
  border-color: var(--a-primary);
  color: var(--a-primary);
  background: var(--a-primary-lt);
}
.quick-action-icon { font-size: 1rem; flex-shrink: 0; }

/* ══════════════════════════════════════════
   СТАТУС СИСТЕМА DASHBOARD
══════════════════════════════════════════ */
.system-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--a-border);
  font-size: 0.85rem;
}
.system-status-row:last-child { border-bottom: none; }
.system-status-key { color: var(--a-text-muted); }
.system-status-ok  { color: var(--a-success); font-weight: 500; }
.system-status-warn{ color: var(--a-warning); font-weight: 500; }
.system-status-val { color: var(--a-text); font-weight: 500; }

/* ══════════════════════════════════════════
   ОТЗЫВЫ — ЗВЁЗДЫ
══════════════════════════════════════════ */
.review-stars-display {
  color: #F59E0B;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

/* ══════════════════════════════════════════
   TELEGRAM ТЕСТ КНОПКА
══════════════════════════════════════════ */
.tg-test-result {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  display: none;
}
.tg-test-result.ok    { background: #F0FDF4; color: var(--a-success); border: 1px solid #BBF7D0; }
.tg-test-result.error { background: #FEF2F2; color: var(--a-danger);  border: 1px solid #FECACA; }
.tg-test-result.show  { display: block; }

/* ══════════════════════════════════════════
   ПРЕВЬЮ ФОТО В ФОРМЕ
══════════════════════════════════════════ */
.photo-preview {
  width: 100%;
  max-height: 140px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 8px;
  border: 1px solid var(--a-border);
  display: none;
}
.photo-preview.show { display: block; }

/* ══════════════════════════════════════════
   ЧЕКБОКСЫ МАСТЕРОВ В УСЛУГАХ
══════════════════════════════════════════ */
.masters-check-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: var(--a-bg);
  border-radius: 8px;
  border: 1px solid var(--a-border);
}
.masters-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--a-text);
  padding: 3px 0;
  cursor: pointer;
}
.masters-check-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--a-primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════
   ВАЛЮТА — SELECT СТИЛЬ
══════════════════════════════════════════ */
.currency-select {
  padding: 9px 8px;
  font-size: 1rem;
  text-align: center;
  font-weight: 700;
  color: var(--a-primary);
}

/* ══════════════════════════════════════════
   РАЗДЕЛИТЕЛЬ
══════════════════════════════════════════ */
.a-divider {
  height: 1px;
  background: var(--a-border);
  margin: 16px 0;
}
.a-divider-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--a-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 16px 0;
}
.a-divider-label::before,
.a-divider-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--a-border);
}

/* ══════════════════════════════════════════
   BADGE АКТИВНОСТИ
══════════════════════════════════════════ */
.active-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--a-success);
  margin-right: 5px;
  flex-shrink: 0;
}
.inactive-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--a-text-muted);
  margin-right: 5px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════
   TOOLTIP
══════════════════════════════════════════ */
[data-tooltip] {
  position: relative;
  cursor: help;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #18181B;
  color: #fff;
  font-size: 0.72rem;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 100;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ══════════════════════════════════════════
   PRINT
══════════════════════════════════════════ */
@media print {
  .sidebar, .topbar, .a-toasts,
  .confirm-overlay, .modal-overlay { display: none !important; }
  .main-content { margin: 0 !important; padding: 0 !important; }
  .admin-section { display: block !important; }
}
}