/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--tap); padding: 0.7rem 1.35rem;
  border-radius: var(--radius); border: 1px solid var(--line-strong);
  background: transparent; color: var(--text);
  font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; letter-spacing: 0;
  text-decoration: none; white-space: normal; text-align: center; max-width: 100%;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn:hover { border-color: var(--text); color: var(--text); background: rgba(245,238,228,0.06); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn-danger { border-color: #F2B544; color: #F2B544; }
.btn-danger:hover { background: rgba(242,181,68,0.14); color: var(--text); border-color: #F2B544; }
.btn-ghost { border-color: transparent; padding-inline: 0.9rem; }
.btn-ghost:hover { border-color: var(--line-strong); }
.btn-sm { min-height: 36px; padding: 0.35rem 0.9rem; font-size: 0.8rem; }
.btn-block { width: 100%; }
.btn .spin { display: none; }
.btn.is-loading .spin { display: inline-block; }
.btn.is-loading > .label { opacity: 0.6; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; border-right-color: currentColor; opacity: 0.5; } }

/* ---------- Мітки / статуси ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 0.4em;
  padding: 0.35rem 0.75rem; border-radius: 6px;
  border: 0; background: var(--surface);
  font-size: var(--fs-0); font-weight: 500; letter-spacing: 0; color: var(--text-2);
  white-space: nowrap;
}
.tag-gold { background: var(--accent); color: #fff; font-weight: 600; }
.tag .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status { display: inline-flex; align-items: center; gap: 0.45em; font-size: var(--fs-0); font-weight: 600; letter-spacing: 0.03em; }
.status::before { content: ""; width: 10px; height: 10px; flex: none; }
.status-open { color: var(--gold); }
.status-open::before { background: var(--accent); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.status-full, .status-closed { color: var(--text-2); }
.status-full::before, .status-closed::before { background: var(--text-3); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.status-paused { color: var(--warn); }
.status-paused::before { background: var(--warn); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.status-cancelled { color: #F2B544; }
.status-cancelled::before { background: linear-gradient(135deg, transparent 42%, #F2B544 42% 58%, transparent 58%), linear-gradient(45deg, transparent 42%, #F2B544 42% 58%, transparent 58%); }
.status-completed { color: var(--text-3); }
.status-completed::before { background: var(--text-3); border-radius: 50%; }

/* ---------- Картки ---------- */
.card {
  background: var(--surface); border: 1px solid transparent; border-radius: var(--radius-lg);
  padding: var(--sp-5);
}
.card-interactive { cursor: pointer; transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease); }
.card-interactive:hover, .card-interactive.is-active { border-color: var(--accent); background: var(--surface-2); }
.card-interactive:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.card-title { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-2); margin: 0; letter-spacing: -0.01em; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; font-size: 0.95rem; }
.kv dt { color: var(--text-3); margin: 0; }
.kv dd { margin: 0; }

/* ---------- Форми ---------- */
.field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: var(--sp-4); }
.field label, .field .label { font-weight: 500; font-size: 0.95rem; }
.field .hint { font-size: var(--fs-0); color: var(--text-3); }
.req::after { content: " *"; color: var(--gold); }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 0.7rem 0.9rem;
  background: var(--surface); border: 1px solid transparent; border-radius: var(--radius);
  color: var(--text); font-size: 1rem; line-height: 1.3;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); background: var(--surface-2); box-shadow: 0 0 0 3px var(--accent-soft); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"] { border-color: #F2B544; }
.textarea { min-height: 110px; resize: vertical; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2.2rem; }
.select option { background: var(--surface); color: var(--text); }
.error { color: #F2B544; font-size: var(--fs-0); min-height: 1em; }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 0.7rem; align-items: start; margin-bottom: var(--sp-3); font-size: 0.95rem; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 0.1rem 0 0; accent-color: var(--gold); cursor: pointer; }
.form-row { display: grid; gap: 0 var(--sp-4); grid-template-columns: 1fr; }
@media (min-width: 560px) { .form-row { grid-template-columns: 1fr 1fr; } }
.form-note { font-size: var(--fs-0); color: var(--text-3); }
.hp { position: absolute; left: -9999px; top: -9999px; height: 0; width: 0; overflow: hidden; }

/* ---------- Повідомлення ---------- */
.alert { padding: var(--sp-4) var(--sp-5); border-radius: var(--radius-lg); border: 1px solid var(--line-strong); background: rgba(255,248,235,0.04); }
.alert-ok { border-color: rgba(127,198,164,0.5); }
.alert-warn { border-color: rgba(240,179,94,0.6); background: rgba(240,179,94,0.08); }
.alert-err { border-color: rgba(242,181,68,0.6); background: rgba(242,181,68,0.10); }
.alert-gold { border-color: transparent; background: var(--accent); color: #fff; }
.alert-gold a { color: #fff; }
.banner { background: var(--accent); color: #fff; text-align: center; padding: var(--sp-3) var(--sp-4); font-weight: 500; }
.banner-warn { background: var(--warn); color: var(--ink); }

/* ---------- Діалог ---------- */
.dialog {
  position: fixed; inset: 0; z-index: 100; display: none; align-items: flex-end; justify-content: center;
  padding: 0; background: rgba(6, 10, 20, 0.72); backdrop-filter: blur(6px);
}
.dialog.is-open { display: flex; }
.dialog-panel {
  width: 100%; max-width: 720px; max-height: 92vh; overflow: auto;
  background: var(--bg); border: 1px solid var(--line); border-radius: 18px 18px 0 0;
  padding: var(--sp-6) var(--sp-5) var(--sp-7); box-shadow: var(--shadow-card);
  animation: rise var(--dur) var(--ease);
}
@media (min-width: 720px) {
  .dialog { align-items: center; padding: var(--sp-5); }
  .dialog-panel { border-radius: var(--radius-lg); padding: var(--sp-7); }
}
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-4); margin-bottom: var(--sp-5); }
.dialog-close { flex: none; width: var(--tap); height: var(--tap); border-radius: 50%; border: 1px solid var(--line-strong); background: transparent; color: var(--text); font-size: 1.3rem; line-height: 1; display: grid; place-items: center; }
.dialog-close:hover { border-color: var(--gold); color: var(--gold); }

/* ---------- Навігація ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(27,25,24,0.86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; text-decoration: none; letter-spacing: -0.01em; }
.brand svg { width: 26px; height: 26px; }
.nav-links { display: none; gap: var(--sp-5); list-style: none; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; font-size: 0.9rem; color: var(--text-2); }
.nav-links a:hover { color: var(--text); }
@media (min-width: 960px) { .nav-links { display: flex; } }
.nav-cta { display: none; }
@media (min-width: 640px) { .nav-cta { display: inline-flex; } }
.nav-burger { width: var(--tap); height: var(--tap); border: 1px solid var(--line-strong); background: transparent; border-radius: 50%; display: grid; place-items: center; }
@media (min-width: 960px) { .nav-burger { display: none; } }
.nav-burger span { display: block; width: 16px; height: 1.5px; background: var(--text); box-shadow: 0 -5px 0 var(--text), 0 5px 0 var(--text); }
.nav-sheet { display: none; border-top: 1px solid var(--line); padding: var(--sp-4) 0 var(--sp-5); }
.nav-sheet.is-open { display: block; }
.nav-sheet ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.2rem; }
.nav-sheet a { display: block; padding: 0.7rem 0; text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: 1rem; border-bottom: 1px solid var(--line); }
.mobile-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: var(--sp-3) var(--sp-4) calc(var(--sp-3) + env(safe-area-inset-bottom)); background: linear-gradient(180deg, transparent, rgba(27,25,24,0.95) 35%); display: flex; justify-content: center; }
.mobile-cta .btn { width: min(100%, 420px); }
@media (min-width: 640px) { .mobile-cta { display: none; } }
body.has-mobile-cta { padding-bottom: 84px; }
body.is-locked .mobile-cta { display: none; }

/* ---------- Таблиці / списки ---------- */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td { text-align: left; padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: var(--fs-0); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); font-weight: 600; background: rgba(255,248,235,0.03); position: sticky; top: 0; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: rgba(255,248,235,0.025); }

/* ---------- Skeleton ---------- */
.skeleton { background: linear-gradient(90deg, rgba(255,248,235,0.05), rgba(255,248,235,0.1), rgba(255,248,235,0.05)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--radius); min-height: 1em; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* ---------- Вкладки ---------- */
.tabs { display: flex; gap: var(--sp-2); border-bottom: 1px solid var(--line); overflow-x: auto; margin-bottom: var(--sp-5); }
.tab { padding: 0.75rem 1rem; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-2); font-family: var(--font-display); font-weight: 600; font-size: 0.9rem; white-space: nowrap; margin-bottom: -1px; }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tab:hover { color: var(--text); }

/* ---------- Зірка-іконка ---------- */
.star-icon { width: 1em; height: 1em; fill: currentColor; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; background: var(--surface-2); border: 1px solid var(--line-strong); padding: 0.8rem 1.2rem; border-radius: 999px; box-shadow: var(--shadow-card); font-size: 0.95rem; max-width: calc(100% - 2rem); }
