:root{
  --radius: 14px;
  --bg-white: #fff;    /* для совместимости со старым профилем */
  --text: #111;
  --muted: #6b7280;
  --shadow: 0 1px 4px rgba(0,0,0,.06);
  --danger: #dc3545;
  --ok: #16a34a;
  --warn: #f59e0b;
  --info: #0ea5e9;
  --brand: #111;
}

/* ---------------- Общие контейнеры ---------------- */
.container.profile{ margin-top:16px; }
.container.auth{ margin-top:16px; }
.u-center{ display:flex; justify-content:center; }
[hidden]{ display:none !important; }

/* ---------------- Заголовки ---------------- */
.section__header{ display:flex; align-items:center; margin:12px 0; }
.section__title{ margin:0; font:700 20px/1.2 'Comfortaa', system-ui, sans-serif; color:var(--text); }
.section__title--sm{ font-size:18px; }

/* Специфика auth-страниц (сохранение твоего большего кегля) */
.container.auth .section__header{ margin-bottom:16px; }
.container.auth .section__title{ font:700 22px/1.2 'Comfortaa', system-ui, sans-serif; }
@media (min-width:768px){
  .container.auth .section__title{ font-size:24px; }
}

/* ---------------- Сетки ---------------- */
.profile__grid{ display:grid; grid-template-columns:1fr; gap:12px; }
@media (min-width:980px){
  .profile__grid{ grid-template-columns:320px 1fr; align-items:start; }
}

.auth__grid{ display:grid; grid-template-columns:1fr; justify-items:center; }
.auth-card{ width:100%; max-width:420px; }

/* ---------------- Карточка ---------------- */
.card{
  background:var(--bg-white);              /* базовая */
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:16px;
}
/* Сохранить поведение «белого» профиля и больший паддинг на auth */
.container.profile .card{ background:var(--bg-white); }
.container.auth .card{ padding:18px; }

/* ---------------- Формы ---------------- */
.form{ display:grid; gap:14px; }
.field{ display:grid; gap:6px; }
.label{ font-weight:600; color:var(--text); font-size:14px; }
.input{
  width:100%; padding:10px 12px; border-radius:10px;
  border:1px solid var(--border); background:#f8f9fb; color:var(--text);
  outline:none; transition:border-color .15s, background .15s, box-shadow .15s;
}
.input:focus{ border-color:#c7cdd8; background:#fff; box-shadow:0 0 0 3px rgba(17,17,17,.06); }
.form-narrow{ display:grid; gap:8px; width:min(420px,100%); }
.helper-text{ margin-top:6px; font-size:12px; color:var(--muted); }

.error{ margin:0; color:var(--danger); font-size:13px; }
.link{ color:#0d6efd; text-decoration:none; }
.link:hover{ text-decoration:underline; }
.legal{ margin:6px 0 0; font-size:12px; color:var(--muted); }
.hint{ margin:14px 0 0; font-size:14px; text-align:center; color:var(--muted); }

.code-row{ display:grid; grid-template-columns:1fr auto; gap:10px; }
.code-input{ text-align:center; letter-spacing:.2em; font-weight:700; }
@media (max-width:480px){
  .code-row{ grid-template-columns:1fr; }
  .code-input{ text-align:center; }
}

/* ---------------- Профиль: инфо-рядки ---------------- */
.profile__box{ display:grid; gap:12px; }
.profile__row{ display:flex; justify-content:space-between; gap:8px; }
.profile__label{ color:var(--muted); }
.profile__value{ color:var(--text); font-weight:600; }

/* ---------------- Сайдбар ---------------- */
.sidebar__list{ list-style:none; margin:0; padding:0; display:grid; gap:4px; }
.sidebar__link{
  display:flex; align-items:center; gap:10px;
  padding:10px 12px; border-radius:var(--radius);
  color:var(--text); text-decoration:none; font-weight:500;
  transition:background .15s, color .15s;
}
.sidebar__link:hover{ background:#f5f6f8; }
.sidebar__link.is-active{ background:#111; color:#fff; }
.sidebar__icon{ width:18px; height:18px; stroke-width:2; }
.sidebar__logout{
  display:flex; align-items:center; gap:10px; margin-top:12px;
  padding:10px 12px; border-radius:var(--radius);
  background:var(--danger); color:#fff; text-decoration:none; font-weight:600;
  transition:opacity .15s;
}
.sidebar__logout:hover{ opacity:.9; }

/* ---------------- Карточки интеграций ---------------- */
.appcard{ display:grid; gap:12px; justify-items:start; margin-bottom: 12px;}
.appicon{
  width:48px; height:48px; border-radius:999px; display:grid; place-items:center;
  border:1px solid var(--border);
}
.appicon [data-lucide]{ width:20px; height:20px; }

/* ---------------- Бейджи ---------------- */
.badge{
  display:inline-flex; align-items:center; gap:6px;
  padding:4px 10px; border-radius:999px; font-size:12px; font-weight:600;
  background:#eef1f6; color:#111; border:1px solid var(--border);
}
.badge--ok{ background:#ecfdf5; color:#065f46; border-color:#bbf7d0; }
.badge--warn{ background:#fffbeb; color:#92400e; border-color:#fde68a; }
.badge--info{ background:#eff6ff; color:#1e40af; border-color:#bfdbfe; }
.badge--danger{ background:#fef2f2; color:#991b1b; border-color:#fecaca; }
.badge--muted{ background:#f4f5f7; color:#374151; }

/* ---------------- Заказы ---------------- */
.order{ display:grid; gap:12px; }
.order + .order{ margin-top:12px; }
.order__head{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.order__title{ margin:0; font-weight:700; color:var(--text); font-size:18px; }
.order__subhead{ font-weight:700; color:var(--text); margin-bottom:6px; }

.order__meta{ display:grid; gap:6px; }
.order__row{ display:flex; justify-content:space-between; gap:8px; }
.order__label{ color:var(--muted); }
.order__value{ color:var(--text); font-weight:600; }

.order-list{ list-style:none; margin:0; padding:0; display:grid; gap:6px; }
.order-list__item{
  display:grid; grid-template-columns:1fr auto auto; gap:8px; align-items:center;
  border:1px dashed var(--border); border-radius:10px; padding:8px 10px; background:#fafbfc;
}
.order-list__name{ min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.order-list__qty{ color:var(--muted); }
.order-list__price{ font-weight:700; }

.order__foot{ display:flex; align-items:flex-start; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.order__totals{ display:grid; gap:6px; min-width:240px; }

/* ---------------- История ---------------- */
.orders__history .order{ opacity:.9; }

/* ---------------- Модалка подтверждения ---------------- */
.overlay{ display:none; position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:1000; }
.overlay.is-open{ display:block; }
.overlay__content{
  position:absolute; top:50%; left:50%; transform:translate(-50%, -50%);
  width:min(92vw, 460px);
  background:#fff; border-radius:14px; border:1px solid var(--border); box-shadow:0 10px 30px rgba(0,0,0,.2);
  padding:18px;
}
.overlay__title{ margin:0 0 6px; font-weight:700; font-size:20px; color:var(--text); }
.overlay__text{ margin:0 0 12px; color:var(--muted); }
.overlay__actions{ display:flex; gap:10px; justify-content:flex-end; flex-wrap:wrap; }

/* ---------------- Аккордеон (универсальный) ---------------- */
.history-toggle{ display:inline-flex; align-items:center; gap:8px; }
.history-toggle__chev{ width:14px; height:14px; transform:rotate(0deg); transition:transform .2s; }
.history-toggle.is-open .history-toggle__chev{ transform:rotate(180deg); }

.collapsible{ overflow:hidden; height:0; transition:height .28s; will-change:height; display:none; }
.collapsible.is-open{ display:block; }

/* ---------------- Иконки в хедере/футере (если используешь Lucide) ---------------- */
.header__menu i[data-lucide],
.footerbar__btn i[data-lucide]{ width:24px; height:24px; stroke-width:2; }
.order__actions{ margin-top:auto;display:flex;gap:8px; }
@media (max-width:500px){
  .order__actions{ flex-wrap:wrap; }
}



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

.actions .btn {
  height: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.actions .link {       
  display: flex;
  align-items: center;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .actions {
    flex-direction: column;
    align-items: flex-start; 
  }

  .actions .btn {
    width: 100%;
  }

  .actions .link {
    width: auto;
    justify-content: flex-start;
  }
}