/* Общие стили страниц поверх theme-dark */

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: var(--nav-height);
}

@media (min-width: 769px) {
  body { padding-bottom: 16px; }
}

.container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
}

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  font-size: 14px;
}

.btn-primary {
  background: var(--gradient-blue);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--primary-light);
  border: 1px solid var(--border-color);
}

.btn:hover { filter: brightness(1.06); }

/* Карточки / секции */
.card, .profile-section, .section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

/* Таблицы */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  font-size: 13px;
}

th {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Формы */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 14px;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Алерты */
.alert, .alert-success, .alert-danger, .alert.ok, .alert.err {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  margin: 12px 0;
  font-size: 14px;
}

.alert-success, .alert.ok {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.alert-danger, .alert.err {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

/* Заголовки страниц */
.page-title, .title, h1.title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 16px;
}

/* Табы */
.tabs, .tab-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.tab, .tab-btn {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.tab.active, .tab-btn.active {
  color: var(--primary-light);
  border-bottom-color: var(--primary-color);
}

/* Бейджи */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.badge-success { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-warning { background: rgba(245,158,11,0.15); color: #fbbf24; }
.badge-neutral { background: var(--bg-elevated); color: var(--text-secondary); }

/* Купон — общие стили */
.coupon-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.coupon-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.coupon-fab {
  position: fixed;
  bottom: 72px;
  right: 16px;
  width: 56px;
  height: 56px;
  background: var(--gradient-blue);
  color: #fff;
  border: none;
  border-radius: 50%;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  cursor: pointer;
}

.coupon-fab-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger-color);
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
}

/* Принудительно тёмная тема даже при светлой системной теме */
@media (prefers-color-scheme: light) {
  :root {
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --bg-body: #0f172a;
    --bg-light: #0f172a;
    --bg-card: #1e293b;
    --border-color: #334155;
  }

  body {
    background-color: var(--bg-body);
    color: var(--text-primary);
  }
}
