@font-face { font-family: 'e-Ukraine'; src: url('../../fonts/e-Ukraine-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'e-Ukraine'; src: url('../../fonts/e-Ukraine-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'e-Ukraine'; src: url('../../fonts/e-Ukraine-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'e-UkraineHead'; src: url('../../fonts/e-UkraineHead-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'e-UkraineHead'; src: url('../../fonts/e-UkraineHead-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

:root { --paper: #F7F6F2; --surface: #FFFFFF; --surface-2: #EAE9E0; --glass: rgba(255,255,255,0.6); --ink: #191A2E; --ink-soft: #58596E; --ink-faint: #9393A8; --line: #E4E2DA; --line-strong: #C2C0AC; --ink-violet: #423C7D; --ink-violet-2: #5B4FB8; --ink-violet-deep: #2E2A5C; --primary: #423C7D; --primary-hover: #2E2A5C; --primary-soft: #E7E5F1; --gold: #C9962E; --gold-soft: #F5E9CF; --danger: #9C3230; --danger-soft: #F1DEDC; --warning: #93650C; --warning-soft: #F1E6CC; --success: #276B4A; --success-soft: #DEEAE1; --sky-soft: #E3EEF4; --radius-lg: 26px; --radius-md: 18px; --radius-sm: 12px; --shadow-sm: 0 10px 30px -12px rgba(46,42,92,0.14); --shadow-md: 0 20px 60px -20px rgba(46,42,92,0.25); --font-display: 'e-UkraineHead', 'e-Ukraine', -apple-system, sans-serif; --font-body: 'e-Ukraine', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; --sidebar-w: 248px; }

[data-theme="dark"] {
  --paper: #12121A;
  --surface: #1C1C26;
  --surface-2: #262633;
  --glass: rgba(28,28,38,0.7);
  --ink: #EDEEF2;
  --ink-soft: #9393A8;
  --ink-faint: #58596E;
  --line: #2E2E3D;
  --line-strong: #424257;
  --ink-violet: #7B71D6;
  --ink-violet-2: #8F85E5;
  --ink-violet-deep: #5C52B5;
  --primary: #7B71D6;
  --primary-hover: #5C52B5;
  --primary-soft: rgba(123, 113, 214, 0.15);
  --gold: #D6A438;
  --gold-soft: rgba(214, 164, 56, 0.15);
  --danger: #D44C49;
  --danger-soft: rgba(212, 76, 73, 0.15);
  --warning: #C28B1D;
  --warning-soft: rgba(194, 139, 29, 0.15);
  --success: #38996A;
  --success-soft: rgba(56, 153, 106, 0.15);
  --sky-soft: rgba(66, 142, 222, 0.15);
  --shadow-sm: 0 10px 30px -12px rgba(0,0,0,0.5);
  --shadow-md: 0 20px 60px -20px rgba(0,0,0,0.7);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; zoom: 0.8; }
body { margin: 0; font-family: var(--font-body); background: var(--paper); color: var(--ink); line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100dvh; position: relative; }

* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-soft); background-clip: padding-box; }
a { color: inherit; }
button { font-family: inherit; }
img { max-width: 100%; display: block; }

.blob-layer { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.3; pointer-events: none; }
.blob-1 { width: 420px; height: 420px; background: var(--ink-violet-2); top: -160px; right: -100px; }
.blob-2 { width: 340px; height: 340px; background: var(--gold); bottom: -120px; left: -140px; opacity: 0.16; }
.blob-3 { width: 380px; height: 380px; background: var(--ink-violet); top: 40%; right: 20%; opacity: 0.12; }

.shell { position: relative; z-index: 1; display: flex; min-height: 100dvh; }
.sidebar { width: var(--sidebar-w); flex-shrink: 0; background: var(--ink); color: #EDEEF2; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 60; transition: transform 0.25s ease; }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 22px 22px 18px; font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -0.1px; }
.sidebar-profile { display: flex; align-items: center; gap: 10px; padding: 22px 22px 18px; margin: 0 12px 8px; text-decoration: none; color: inherit; border-bottom: 1px solid rgba(237,238,242,0.12); }
.avatar { border-radius: 50%; background: var(--gold-soft); color: var(--ink); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; border: 1.5px solid var(--gold); }
.sidebar-profile .avatar { width: 34px; height: 34px; font-size: 14px; }
.sidebar-profile-name { font-size: 14px; font-weight: 600; color: #EDEEF2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-profile:hover .sidebar-profile-name { color: #fff; }
.sidebar-nav { flex: 1; padding: 10px 12px; overflow-y: auto; }
.sidebar-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-radius: 999px; font-size: 14.5px; font-weight: 500; text-decoration: none; color: rgba(237,238,242,0.66); margin-bottom: 2px; }
.sidebar-nav a ion-icon { font-size: 19px; flex-shrink: 0; }
.sidebar-nav a span:not(.sidebar-nav-badge) { flex: 1; }
.sidebar-nav-badge { flex-shrink: 0; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: rgba(237,238,242,0.14); color: #fff; font-size: 11.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.sidebar-nav a.active .sidebar-nav-badge { background: rgba(255,255,255,0.22); }
.sidebar-nav a:hover { background: rgba(237,238,242,0.07); color: #fff; }
.sidebar-nav a.active { background: rgba(123,113,214,0.32); color: #fff; }
.lang-pill { padding: 5px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; text-decoration: none; color: rgba(237,238,242,0.6); border: 1px solid rgba(237,238,242,0.16); }
.lang-pill:hover { color: #fff; }
.lang-pill.active { background: var(--gold); color: #211903; border-color: var(--gold); }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; }
.topbar { display: none; align-items: center; justify-content: space-between; padding: 14px 18px; background: rgba(247,246,242,0.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid rgba(66,60,125,0.1); position: sticky; top: 0; z-index: 40; }
.topbar-burger { width: 38px; height: 38px; border-radius: var(--radius-sm); border: 1px solid rgba(66,60,125,0.18); background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(15,18,28,0.45); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); z-index: 55; }

.page { padding: 32px 36px 60px; max-width: 1440px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-title { font-family: var(--font-display); font-size: 27px; font-weight: 700; letter-spacing: -0.2px; margin: 0 0 4px; }
.page-sub { color: var(--ink-soft); font-size: 14.5px; margin: 0; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 999px; font-size: 14px; font-weight: 700; border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s, box-shadow 0.15s; }
.btn ion-icon { font-size: 17px; }
.btn-primary { background: var(--ink-violet); color: #fff; box-shadow: 0 12px 26px -10px rgba(66,60,125,0.55); }
.btn-primary:hover { background: var(--ink-violet-deep); transform: translateY(-1px); }
.btn-outline { background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-color: rgba(66,60,125,0.2); color: var(--ink); }
.btn-outline:hover { border-color: var(--ink-violet); color: var(--ink-violet); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { color: var(--ink); background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; box-shadow: 0 12px 26px -10px rgba(156,50,48,0.5); }
.btn-danger:hover { background: #7E2827; }
.btn-sm { padding: 8px 16px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }

.card { background: rgba(255,255,255,0.72); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.7); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); position: relative; transition: background 0.25s, border-color 0.25s, box-shadow 0.25s; }
[data-theme="dark"] .card { background: rgba(28,28,38,0.72); border-color: rgba(255,255,255,0.05); }
.card:has(.custom-select-wrapper.is-open), .card.has-open-select { z-index: 45; }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); gap: 12px; flex-wrap: wrap; }
.card-head h3 { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-size: 16px; font-weight: 700; margin: 0; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.field { margin-bottom: 16px; }

/* Форм-таби — переиспользуемая навігація для форм з кількома розділами
   (турнір, і будь-де ще, де форма ділиться на логічні блоки). */
.form-tabs { display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 1.5px solid var(--line); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.form-tab-btn { display: flex; align-items: center; gap: 6px; padding: 12px 18px; background: none; border: none; border-bottom: 2.5px solid transparent; font-size: 13.5px; font-weight: 700; color: var(--ink-faint); cursor: pointer; white-space: nowrap; transition: color 0.15s, border-color 0.15s; flex-shrink: 0; }
.form-tab-btn:hover { color: var(--ink-soft); }
.form-tab-btn.active { color: var(--ink-violet); border-bottom-color: var(--ink-violet); }
.form-tab-btn ion-icon { font-size: 16px; }
.form-tab-panel { display: none; }
.form-tab-panel.active { display: block; animation: formTabFadeIn 0.18s ease; }
@keyframes formTabFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* Кастомний file-input — приховуємо стандартний вигляд, замінюємо на
   drag&drop-стилізовану зону з превʼю назви файлу/зображення. */
.file-drop-zone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 28px 16px; border: 1.5px dashed var(--line); border-radius: var(--radius-md); background: var(--paper); text-align: center; cursor: pointer; transition: border-color 0.15s, background 0.15s; min-height: 120px; }
.file-drop-zone:hover, .file-drop-zone.drag-over { border-color: var(--ink-violet); background: var(--sky-soft); }
.file-drop-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-drop-zone ion-icon { font-size: 30px; color: var(--ink-faint); }
.file-drop-zone .file-drop-text { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.file-drop-zone .file-drop-hint { font-size: 11.5px; color: var(--ink-faint); }
.file-drop-zone.has-file { border-style: solid; border-color: var(--ink-violet); background: var(--sky-soft); }
.file-drop-zone .file-drop-preview { width: 100%; max-height: 140px; object-fit: contain; border-radius: var(--radius-sm); margin-bottom: 4px; }
.file-drop-zone .file-drop-filename { font-size: 12.5px; font-weight: 700; color: var(--ink); word-break: break-all; padding: 0 8px; }
.file-drop-remove-btn { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 1.5px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--ink-soft); cursor: pointer; z-index: 1; }
.file-drop-remove-btn:hover { color: var(--danger); border-color: var(--danger); }

/* Динамічні блоки (мови положення, валюти) — акуратніші картки замість
   голого flex-рядка з inline-стилями. */
.dynamic-row-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); margin-top: 8px; }
.dynamic-row-card .input, .dynamic-row-card .file-drop-zone-inline { flex: 1; min-width: 0; }

/* Компактна inline-версія file-drop-zone — для рядків, де вона стоїть поруч
   із select'ом і кнопкою видалення (положення на кожну мову), а не як
   окремий великий блок (постер). Той самий принцип, менше місця. */
.file-drop-zone-inline { position: relative; display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1.5px dashed var(--line); border-radius: var(--radius-sm); background: #fff; cursor: pointer; transition: border-color 0.15s, background 0.15s; min-height: 40px; }
.file-drop-zone-inline:hover, .file-drop-zone-inline.drag-over { border-color: var(--ink-violet); background: var(--sky-soft); }
.file-drop-zone-inline input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-drop-zone-inline ion-icon { font-size: 18px; color: var(--ink-faint); flex-shrink: 0; }
.file-drop-zone-inline .file-drop-text { font-size: 12.5px; font-weight: 600; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-drop-zone-inline.has-file { border-style: solid; border-color: var(--ink-violet); background: var(--sky-soft); }
.file-drop-zone-inline.has-file ion-icon { color: var(--ink-violet); }
.file-drop-zone-inline.has-file .file-drop-text { color: var(--ink); }
.dynamic-row-remove-btn { flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; border: none; background: var(--surface-2); color: var(--ink-soft); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.dynamic-row-remove-btn:hover { background: var(--danger-soft); color: var(--danger); }
.dynamic-row-add-btn { margin-top: 10px; }

/* Таблиця цін по форматах — трохи охайніше за голу <table> без стилів. */
.pricing-table { width: 100%; border-collapse: collapse; }
.pricing-table th { text-align: left; padding: 8px 10px; font-size: 12px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.3px; border-bottom: 1.5px solid var(--line); }
.pricing-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.pricing-table td:first-child { font-weight: 700; font-size: 13.5px; }
.pricing-table input.input { width: 100px; }
[data-location-widget] { min-height: 288px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); margin-bottom: 7px; }
.input, .input-field { width: 100%; padding: 13px 15px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); font-size: 14.5px; font-family: inherit; background: var(--paper); color: var(--ink); transition: border-color 0.15s, background 0.15s; }
.input:focus, .input-field:focus { outline: none; border-color: var(--ink-violet); background: var(--surface); }
.input:-webkit-autofill, .input-field:-webkit-autofill { -webkit-text-fill-color: var(--ink); -webkit-box-shadow: 0 0 0px 1000px var(--paper) inset; transition: background-color 5000s ease-in-out 0s; }
.input:-webkit-autofill:focus, .input-field:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0px 1000px var(--surface) inset; }
.input-field.phone-valid { border-color: var(--ink-violet); background: var(--surface); }
.password-field-wrap { position: relative; }
.password-field-wrap .input-field { padding-right: 44px; }
.password-toggle-btn { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 34px; height: 34px; border: none; background: transparent; color: var(--ink-faint); display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: var(--radius-sm); font-size: 18px; }
.password-toggle-btn:hover { color: var(--ink-soft); background: var(--surface-2); }
.input-field.phone-invalid { border-color: #C24C43; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%2358596E' stroke-width='2' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
select.custom-select-native-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.custom-select-wrapper { position: relative; z-index: 1; }
.custom-select-wrapper.is-open { z-index: 50; }
.custom-select-trigger { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 13px 15px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); font-size: 14.5px; font-family: inherit; background: var(--paper); color: var(--ink); cursor: pointer; transition: border-color 0.15s; text-align: left; }
.custom-select-wrapper.is-open .custom-select-trigger { border-color: var(--ink-violet); background: #fff; }
.custom-select-wrapper.is-disabled .custom-select-trigger { cursor: not-allowed; opacity: 0.55; background: var(--surface-2); }
.custom-select-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.custom-select-chevron { width: 14px; height: 9px; margin-left: 10px; flex-shrink: 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%2358596E' stroke-width='2' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E"); background-repeat: no-repeat; transition: transform 0.15s; }
.custom-select-wrapper.is-open .custom-select-chevron { transform: rotate(180deg); }
.custom-select-panel { display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 100; max-height: 260px; overflow-y: auto; background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); padding: 6px; }
.custom-select-wrapper.is-open .custom-select-panel { display: block; }
.custom-select-search-wrap { padding: 4px; position: sticky; top: -6px; background: #fff; z-index: 2; margin: -6px -6px 6px -6px; border-bottom: 1.5px solid var(--paper); }
.custom-select-search { height: 32px; font-size: 13.5px; border: 1px solid var(--line); box-shadow: none; padding: 0 10px; background: var(--paper); }
.custom-select-search:focus { background: #fff; border-color: var(--primary); }
.custom-select-option { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; cursor: pointer; }
.custom-select-option:hover { background: var(--paper); }
.custom-select-option.is-selected { background: var(--primary-soft); color: var(--ink-violet); font-weight: 700; }

.cell-muted { color: var(--ink-soft); font-size: 13.5px; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.filter-badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 10.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.entries-badge { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; flex-shrink: 0; }
.entries-badge ion-icon { font-size: 14px; }
.entries-badge-active { background: var(--gold-soft); color: #8a5a00; }
.entries-badge-empty { background: var(--surface-2); color: var(--ink-faint); }
.tag-active { background: var(--success-soft); color: var(--success); }

.alert-list { display: flex; flex-direction: column; gap: 10px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { padding: 20px 22px; text-align: center; }
.stat-value { font-family: var(--font-display); font-size: 32px; font-weight: 700; color: var(--ink-violet); line-height: 1; }
.stat-label { font-size: 13px; color: var(--ink-soft); margin-top: 6px; }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.checkbox-item { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--paper); font-size: 13.5px; cursor: pointer; border: 1.5px solid transparent; transition: border-color 0.15s; }
.checkbox-item:has(input:checked) { border-color: var(--ink-violet); background: var(--primary-soft); }
.checkbox-item input { accent-color: var(--ink-violet); width: 16px; height: 16px; flex-shrink: 0; }

/* ---------- Акордеони (налаштування номінацій турніру) ---------- */
.accordion { display: flex; flex-direction: column; gap: 8px; }
.accordion-item { border: 1.5px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.accordion-item-nested { margin: 8px 0 8px 14px; border-color: var(--line); background: var(--paper); }
.accordion-header { display: flex; align-items: center; gap: 10px; width: 100%; padding: 13px 16px; background: var(--surface); border: none; font-size: 14px; font-weight: 700; text-align: left; color: var(--ink); }
.accordion-toggle-btn { display: flex; align-items: center; justify-content: center; background: none; border: none; padding: 2px; cursor: pointer; flex-shrink: 0; }
.accordion-item-nested > .accordion-header { background: transparent; font-size: 13px; font-weight: 600; padding: 10px 14px; }
.accordion-chevron { font-size: 15px; color: var(--ink-faint); transition: transform 0.2s ease; flex-shrink: 0; }
.accordion-item.open > .accordion-header .accordion-chevron { transform: rotate(90deg); }
.accordion-body { display: none; padding: 4px 14px 14px; }
.accordion-item.open > .accordion-body { display: block; }
.alert-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--paper); flex-wrap: wrap; }
.alert-item.alert-item-owner { background: var(--sky-soft); }
.alert-item.alert-item-trainer { background: var(--gold-soft); }
.alert-item.alert-item-member { background: var(--surface-2); opacity: 0.65; }
.alert-item ion-icon { font-size: 20px; color: var(--ink-violet); flex-shrink: 0; }
.alert-body { flex: 1; min-width: 160px; }
.alert-item > form { flex-shrink: 0; display: flex; }
.alert-title { font-weight: 600; font-size: 14px; }
.alert-meta { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 999px; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-md); z-index: 300; }

/* ---------- Header (гостьовий, з кнопкою входу) ---------- */
.guest-header { position: fixed; top: 0; left: 0; right: 0; z-index: 60; background: rgba(247,246,242,0.85); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid rgba(66,60,125,0.08); }
[data-theme="dark"] .guest-header { background: rgba(28,28,38,0.85); }
.guest-header .container { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; max-width: 1440px; margin: 0 auto; }
.guest-header .logo { display: flex; align-items: center; font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--ink); text-decoration: none; gap: 10px; }
.header-logo-icon { height: 28px; width: auto; transition: height 0.2s; }

.guest-header-nav { display: none; align-items: center; justify-content: flex-end; gap: 24px; margin: 0 32px; flex: 1; }
.nav-link { font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; transition: color 0.15s; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.nav-link:hover { color: var(--ink-violet); }
.nav-link ion-icon { font-size: 14px; color: var(--ink-faint); margin-top: 1px; }

.nav-dropdown { position: relative; display: flex; align-items: center; height: 100%; }
.nav-dropdown-btn { background: none; border: none; cursor: pointer; font-family: inherit; padding: 12px 0; }
.nav-dropdown-content { position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(10px); opacity: 0; visibility: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 8px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow-md); transition: all 0.2s; min-width: 220px; z-index: 100; }
.nav-dropdown:hover .nav-dropdown-content { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.nav-dropdown-content a { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13.5px; color: var(--ink); text-decoration: none; font-weight: 600; transition: background 0.15s; }
.nav-dropdown-content a:hover { background: var(--surface-2); color: var(--ink-violet); }

.guest-header-controls { display: none; }

@media (min-width: 1024px) {
  .guest-header-nav { display: flex; }
  .guest-header-burger { display: none !important; }
  .guest-header-controls { display: flex; align-items: center; gap: 16px; }
  .header-logo-icon { height: 36px; }
}
.guest-header-burger { display: flex; width: 40px; height: 40px; align-items: center; justify-content: center; background: none; border: none; font-size: 28px; color: var(--ink); cursor: pointer; padding: 0; margin-left: 12px; }
.guest-header-right { display: flex; align-items: center; gap: 10px; }

/* Mobile Fullscreen Menu */
.mobile-menu-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 100; opacity: 0; pointer-events: none; transition: opacity 0.25s; }
.mobile-menu-overlay.is-open { opacity: 1; pointer-events: auto; }

.mobile-menu { position: fixed; bottom: 0; left: 0; right: 0; top: 10dvh; background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0; z-index: 101; display: flex; flex-direction: column; transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.1, 0.7, 0.1, 1); box-shadow: 0 -10px 40px rgba(0,0,0,0.1); }
.mobile-menu.is-open { transform: translateY(0); }
.mobile-menu-drag-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 12px auto; opacity: 0.5; }
.mobile-menu-head { display: flex; justify-content: space-between; align-items: center; padding: 0 24px 16px; border-bottom: 1px solid var(--line); }
.mobile-menu-logo { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 6px; }
.mobile-menu-logo span { color: var(--gold); }
.mobile-menu-close { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); border: none; border-radius: 50%; color: var(--ink); font-size: 20px; cursor: pointer; }

.mobile-menu-body { flex: 1; overflow-y: auto; padding: 16px 24px; display: flex; flex-direction: column; gap: 8px; }
.mobile-menu-item { display: flex; align-items: center; padding: 10px 16px; border-radius: var(--radius-md); text-decoration: none; color: var(--ink); font-weight: 600; font-size: 15px; gap: 16px; transition: background 0.15s; }
.mobile-menu-item-icon { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); border-radius: 50%; font-size: 18px; color: var(--ink-soft); transition: color 0.15s, background 0.15s; }
.mobile-menu-item:hover { background: var(--surface-2); }
.mobile-menu-item-arrow { margin-left: auto; color: var(--ink-faint); font-size: 16px; }

/* The teammate search highlight from screenshot */
.mobile-menu-item.highlight { position: relative; }
.mobile-menu-item.highlight::before { content: ''; position: absolute; left: 16px; top: 6px; bottom: 6px; width: 48px; background: var(--gold); filter: blur(14px); opacity: 0.7; border-radius: 50%; z-index: -1; pointer-events: none; }

.mobile-menu-footer { padding: 24px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.theme-switch-group, .lang-switch-group { display: flex; background: var(--surface-2); padding: 4px; border-radius: 999px; gap: 2px; }
.theme-switch-btn, .lang-switch-btn { width: 44px; height: 36px; display: flex; align-items: center; justify-content: center; background: transparent; border: none; border-radius: 999px; color: var(--ink-faint); font-size: 18px; cursor: pointer; transition: color 0.15s, background 0.15s, box-shadow 0.15s; font-weight: 700; font-size: 12.5px; text-decoration: none; }
.theme-switch-btn.active, .lang-switch-btn.active { background: var(--surface); color: var(--gold); box-shadow: var(--shadow-sm); }
.theme-switch-btn:hover:not(.active), .lang-switch-btn:hover:not(.active) { color: var(--ink-soft); }

/* ---------- Modal / auth ---------- */
.modal-backdrop { display: flex; align-items: center; justify-content: center; padding: 16px; position: fixed; inset: 0; background: rgba(25,26,46,0.55); backdrop-filter: blur(6px); z-index: 200; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.25s ease, visibility 0s linear 0.25s, backdrop-filter 0.25s ease; }
.modal-backdrop.open { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity 0.25s ease, visibility 0s linear, backdrop-filter 0.25s ease; }
.modal { background: var(--surface); border-radius: var(--radius-lg); width: 100%; max-width: 420px; padding: 34px; position: relative; box-shadow: var(--shadow-md); transform: translateY(18px) scale(0.96); opacity: 0; transition: transform 0.32s cubic-bezier(0.34,1.56,0.64,1), opacity 0.22s ease; max-height: calc(100dvh - 32px); overflow-y: auto; }
.modal-backdrop.open .modal { transform: translateY(0) scale(1); opacity: 1; }
@media (prefers-reduced-motion: reduce) { .modal-backdrop, .modal { transition: opacity 0.15s ease, visibility 0s linear; transform: none !important; } }
.modal-close { position: absolute; top: 16px; right: 16px; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--ink-faint); line-height: 1; padding: 8px; border-radius: 50%; transition: background 0.15s, color 0.15s; z-index: 10; }
.modal-close:hover { background: var(--surface-2); color: var(--ink); }
.auth-tabs { display: flex; gap: 6px; background: var(--paper); border-radius: 999px; padding: 4px; margin-bottom: 22px; }
.auth-tab { flex: 1; text-align: center; padding: 9px; border-radius: 999px; font-size: 13.5px; font-weight: 700; cursor: pointer; border: none; background: none; color: var(--ink-soft); transition: background 0.15s, color 0.15s; }
.auth-tab.active { background: var(--surface); color: var(--ink-violet); box-shadow: 0 2px 8px rgba(66,60,125,0.12); }
.auth-panel { display: none; }
.auth-panel.active { display: block; }
.auth-methods { display: flex; gap: 6px; margin-bottom: 18px; }
.role-picker { display: flex; gap: 8px; }
.role-option { flex: 1; cursor: pointer; }
.role-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.role-option-card { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 12px 6px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--paper); font-size: 11.5px; font-weight: 700; color: var(--ink-soft); text-align: center; transition: border-color 0.15s, color 0.15s, background 0.15s; }
.role-option-card ion-icon { font-size: 20px; }
.role-option input:checked + .role-option-card { border-color: var(--ink-violet); color: var(--ink-violet); background: var(--primary-soft); }
.role-option input:focus-visible + .role-option-card { outline: 2px solid var(--gold); outline-offset: 2px; }
.auth-method-btn { flex: 1; padding: 8px 6px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--paper); font-size: 12px; font-weight: 700; color: var(--ink-soft); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; transition: border-color 0.15s, color 0.15s, background 0.15s; }
.auth-method-btn ion-icon { font-size: 18px; }
.auth-method-btn.active { border-color: var(--ink-violet); color: var(--ink-violet); background: var(--primary-soft); }
.auth-hint { font-size: 12px; color: var(--ink-faint); margin-top: 14px; text-align: center; }
.auth-support-block { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 18px; padding: 14px; border-radius: var(--radius-md); background: var(--gold-soft); text-align: left; }
.auth-support-text { width: 100%; }
.auth-support-text strong { display: block; font-size: 13px; color: var(--ink); margin-bottom: 2px; }
.auth-support-text p { margin: 0; font-size: 12px; color: var(--ink-soft); line-height: 1.4; }
.auth-support-block .btn { width: 100%; justify-content: center; }
.form-error { display: none; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; background: var(--danger-soft); border: 1px solid #E8ABA5; color: #8A2F27; margin-bottom: 14px; }
.stub-back { display: block; width: 100%; text-align: center; margin-top: 10px; background: none; border: none; color: var(--ink-violet); font-weight: 700; font-size: 13.5px; cursor: pointer; padding: 8px; }
.stub-back[disabled] { color: var(--ink-faint); cursor: not-allowed; }
.telegram-waiting { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: var(--radius-sm); background: var(--paper); font-size: 13.5px; color: var(--ink-soft); }
.telegram-waiting .spinner { width: 16px; height: 16px; border: 2px solid var(--line-strong); border-top-color: var(--ink-violet); border-radius: 50%; animation: spin 0.8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- Адаптив ---------- */
@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .main { margin-left: 0; }
  .topbar { display: flex; }
  .page { padding: 22px 16px 48px; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .modal { padding: 26px 20px; max-width: 100%; }
  .page-head { flex-direction: column; }
  .card-head { flex-direction: column; align-items: flex-start; }
}
/* iOS Safari: коректна висота viewport з урахуванням адресного рядка */
@supports (-webkit-touch-callout: none) {
  .shell { min-height: -webkit-fill-available; }
}

/* ---------- Турніри (публічна афіша на головній) ---------- */
.tour-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.tour-card { display: block; background: rgba(255,255,255,0.72); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.7); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); text-decoration: none; color: inherit; overflow: hidden; transition: transform 0.15s, box-shadow 0.15s, background 0.25s, border-color 0.25s; }
[data-theme="dark"] .tour-card { background: rgba(28,28,38,0.72); border-color: rgba(255,255,255,0.05); }
.tour-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.tour-card-poster { position: relative; width: 100%; aspect-ratio: 16/10; background-color: var(--surface-2); overflow: hidden; }
.tour-card-poster::before { content: ''; position: absolute; inset: 0; background-image: inherit; background-size: cover; background-position: center; filter: blur(18px) brightness(0.85); transform: scale(1.15); }
.tour-card-poster::after { content: ''; position: absolute; inset: 0; background-image: inherit; background-size: contain; background-repeat: no-repeat; background-position: center; }
.tour-card-poster-empty { display: flex; align-items: center; justify-content: center; font-size: 36px; color: var(--ink-faint); }
.tour-card-poster-empty::before, .tour-card-poster-empty::after { content: none; }
.tour-card-poster-empty ion-icon { position: relative; z-index: 1; }
.tour-card-body { padding: 16px 18px 18px; }
.tour-card-title { font-family: var(--font-display); font-weight: 700; font-size: 15.5px; margin-bottom: 8px; }
.tour-card-meta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-soft); margin-bottom: 3px; }
.tour-card-meta ion-icon { font-size: 14px; flex-shrink: 0; }
.tour-card-past { opacity: 0.72; }
.tour-card-past .tour-card-poster { filter: grayscale(100%); }
.tour-section-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; margin: 32px 0 16px; }

/* ---------- Універсальна модалка (форми редагування/додавання/видалення) ---------- */
/* Десктоп: центрована карточка. Мобілка (≤560px): fullscreen, без заокруглень і відступів. */
.dm-backdrop { display: flex; align-items: center; justify-content: center; padding: 16px; position: fixed; inset: 0; background: rgba(25,26,46,0.55); backdrop-filter: blur(6px); z-index: 300; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.25s ease, visibility 0s linear 0.25s, backdrop-filter 0.25s ease; }
.dm-backdrop.open { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity 0.25s ease, visibility 0s linear, backdrop-filter 0.25s ease; }
.dm-modal { background: var(--surface); border-radius: var(--radius-lg); width: 100%; max-width: 480px; padding: 30px; position: relative; box-shadow: var(--shadow-md); transform: translateY(18px) scale(0.96); opacity: 0; transition: transform 0.32s cubic-bezier(0.34,1.56,0.64,1), opacity 0.22s ease; max-height: calc(100dvh - 16px); overflow-y: auto; display: flex; flex-direction: column; }
.dm-backdrop.open .dm-modal { transform: translateY(0) scale(1); opacity: 1; }
.dm-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.dm-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; margin: 0; }
.dm-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--ink-faint); line-height: 1; padding: 4px; flex-shrink: 0; }
.dm-close:hover { color: var(--ink); }
.dm-body { flex: 1; }
.dm-footer { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.dm-footer .btn { flex: 1; justify-content: center; }
.dm-danger-text { color: var(--danger); font-size: 13px; background: var(--danger-soft); padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; }
.dm-archive-note { color: var(--warning); font-size: 13px; background: var(--warning-soft); padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; }
@media (prefers-reduced-motion: reduce) { .dm-backdrop, .dm-modal { transition: opacity 0.15s ease, visibility 0s linear; transform: none !important; } }
@media (max-width: 560px) { .dm-backdrop { padding: 0; align-items: stretch; } .dm-modal { max-width: 100%; max-height: calc(var(--real-vh, 1vh) * 100); height: calc(var(--real-vh, 1vh) * 100); border-radius: 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); } }
@media (max-width: 560px) { .dm-modal.dm-modal-compact { max-width: 420px; height: auto; max-height: calc(var(--real-vh, 1vh) * 100 - 32px); border-radius: var(--radius-lg); padding: 26px 20px; margin: auto; } }
.dm-link-btn { background: none; border: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: none; }
.dm-link-btn:hover { text-decoration: underline; }