body.admin { background:#f5f6f8; }
.login-box { max-width:380px; margin:12vh auto 0; }

.inv-admin-card { overflow:hidden; }
.inv-thumb { height:120px; background-size:cover; background-position:center; position:relative; }
.inv-thumb .badge { position:absolute; top:10px; left:10px; }
.inv-thumb .badge + .badge { left:auto; right:10px; }

/* Цветове на темите – миниатюри и избор на тема */
.theme-elegant { background-color:#d9c3a0; }
.theme-floral { background-color:#f0c4ca; }
.theme-modern { background-color:#2a2b31; }
.theme-nature { background-color:#b7c9a8; }
.theme-kids { background-color:#ffc59e; }

.theme-picker { display:flex; flex-direction:column; gap:6px; }
.theme-option { display:flex; align-items:center; gap:10px; padding:6px 8px; border:1px solid #dee2e6; border-radius:8px; cursor:pointer; }
.theme-option:has(input:checked) { border-color:#0d6efd; background:#f0f6ff; }
.theme-option input { margin:0; }
.swatch { width:26px; height:26px; border-radius:50%; flex-shrink:0; border:1px solid rgba(0,0,0,.1); }

.extra { padding:12px 0; border-bottom:1px solid #f0f0f0; }
.extra:first-child { padding-top:0; }
.extra-body { margin:10px 0 0 2.5rem; }

.gallery-admin { display:grid; grid-template-columns:repeat(auto-fill,minmax(110px,1fr)); gap:8px; }
.gallery-admin-item { display:block; border:1px solid #dee2e6; border-radius:8px; overflow:hidden; cursor:pointer; font-size:12px; }
.gallery-admin-item img { width:100%; aspect-ratio:1; object-fit:cover; display:block; }
.gallery-admin-item span { display:block; padding:4px 6px; }
.gallery-admin-item:has(input:checked) { border-color:#dc3545; opacity:.6; }

.stat b { font-size:26px; line-height:1.1; display:block; }
.stat span { font-size:13px; }
.rsvp-msg { background:#f8f9fa; border-left:3px solid #198754; padding:6px 10px; border-radius:4px; font-style:italic; }
.link-item code { word-break:break-all; }

/* Съвместимост: проектът ползва Bootstrap 5.1, а класовете text-bg-* / *-subtle са от 5.2+. */
.text-bg-success { color: #fff !important; background-color: #198754 !important; }
.text-bg-danger { color: #fff !important; background-color: #dc3545 !important; }
.text-bg-secondary { color: #fff !important; background-color: #6c757d !important; }
.text-bg-warning { color: #000 !important; background-color: #ffc107 !important; }
.text-bg-info { color: #000 !important; background-color: #0dcaf0 !important; }
.text-bg-dark { color: #fff !important; background-color: #212529 !important; }
.text-bg-warning-subtle { background-color: #fff3cd !important; }
.border-warning-subtle { border-color: #ffe69c !important; }
.text-warning-emphasis { color: #664d03 !important; }
.text-bg-light { color: #000 !important; background-color: #f8f9fa !important; }

/* Админ → Фонове: прегледи „компютър“ (16:10) и „телефон“ (9:19.5) */
.bg-prev-desktop, .bg-prev-phone { position: relative; background: #e9ecef center / cover no-repeat; border: 6px solid #212529; display: grid; place-items: center; overflow: hidden; }
.bg-prev-desktop { width: 320px; aspect-ratio: 16 / 10; border-radius: 10px; }
.bg-prev-phone { width: 120px; aspect-ratio: 9 / 19.5; border-radius: 18px; }
.bg-prev-desktop.sm { width: 190px; border-width: 4px; }
.bg-prev-phone.sm { width: 64px; border-width: 4px; border-radius: 12px; }
.bg-prev-desktop span, .bg-prev-phone span { font: 600 15px/1.2 'Cormorant Garamond', serif; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.6); text-align: center; padding: 4px; }
.bg-prev-phone span { font-size: 12px; }

/* Генериране на линкове – отделно поле за всяко име */
.name-list { display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow-y: auto; padding-right: 2px; }
.name-row { display: flex; align-items: center; gap: 6px; }
.name-num { flex: 0 0 22px; text-align: right; font-size: 12px; color: #6c757d; }
.name-row .name-del { flex: 0 0 auto; padding: 0 6px; font-size: 18px; line-height: 1; text-decoration: none; }

/* Клиенти: графика на регистрациите */
.reg-chart { display:flex; align-items:flex-end; gap:4px; height:160px; padding-top:18px; }
.reg-bar { flex:1; height:100%; display:flex; flex-direction:column; justify-content:flex-end; align-items:center; position:relative; min-width:0; }
.reg-bar i { display:block; width:100%; max-width:22px; min-height:2px; background:linear-gradient(#5aa77a,#2f8f5b); border-radius:4px 4px 0 0; }
.reg-n { font-size:11px; font-weight:600; color:#2f8f5b; line-height:1.2; }
.reg-d { position:absolute; bottom:-18px; font-size:10px; color:#6c757d; white-space:nowrap; }
.reg-chart + * { margin-top:22px; }
.client-line { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* Посещения: потвърдените хора – по-тъмната част на стълбчето */
.reg-bar i { position:relative; overflow:hidden; }
.reg-bar i .reg-h { position:absolute; left:0; right:0; bottom:0; display:block; background:linear-gradient(#3b7ddd,#1f5fbf); }
.reg-key { display:inline-block; width:10px; height:10px; border-radius:2px; background:#5aa77a; vertical-align:-1px; }
.reg-key.h { background:#1f5fbf; }

/* =====================================================================================================
   Нов вид на панела: странично меню (компютър) / чекмедже + долна лента (телефон), в цветовете на InviteBG
   ===================================================================================================== */
.admin {
  --ink: #2b2326; --gold: #b8925a; --gold-d: #8a6a3a;
  --bg: #f6f3ee; --line: #ebe5dc; --muted: #7a6f68; --side: 252px;
  background: var(--bg); color: #2b2326; font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 14.5px;
}
.admin h1, .admin .h1, .admin .h3 { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 600; letter-spacing: .01em; }
.admin h1.h3, .admin .h3 { font-size: 30px; }
.admin a:not(.btn):not(.an-link):not(.dropdown-item):not(.nav-link):not(.badge) { color: #6d4f2a; }
.admin a:not(.btn):not(.an-link):not(.dropdown-item):not(.nav-link):not(.badge):hover { color: var(--ink); }
.admin .btn-dark, .admin .btn-primary, .admin .btn-dark:hover, .admin .btn-primary:hover { color: #fff; }

/* ---------- оформление ---------- */
.admin-shell .an-main { padding: 26px 32px 60px; margin-left: var(--side); max-width: calc(1320px + var(--side)); }
.admin:not(.admin-shell) .an-main { padding: 24px 16px; }
.an-side { position: fixed; top: 0; bottom: 0; left: 0; width: var(--side); z-index: 1040; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #2b2326, #241d20); color: #e9e1d8; overflow-y: auto; }
.an-brand { display: flex; align-items: center; justify-content: space-between; padding: 22px 20px 14px; }
.an-logo { display: inline-flex; align-items: baseline; gap: 1px; text-decoration: none; color: #fff !important; font: 600 26px/1 'Cormorant Garamond', Georgia, serif; }
.an-logo b { color: var(--gold); font-weight: 600; }
.an-logo small { margin-left: 8px; font: 600 10px/1 'Inter', sans-serif; letter-spacing: .18em; text-transform: uppercase; color: #a89a8e; }
.an-logo.sm { font-size: 22px; color: var(--ink) !important; }
.an-close { display: none; border: 0; background: rgba(255, 255, 255, .08); color: #fff; width: 36px; height: 36px; border-radius: 10px; }
.an-nav { flex: 1; padding: 4px 12px 12px; }
.an-group { margin: 16px 10px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #8f8178; }
.an-link { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; margin: 1px 0; border: 0; border-radius: 10px; background: none;
  color: #e9e1d8 !important; text-decoration: none; font-size: 14px; font-weight: 500; text-align: left; transition: background .15s, color .15s; }
.an-link:hover { background: rgba(255, 255, 255, .07); color: #fff !important; }
.an-link.active { background: linear-gradient(90deg, rgba(184, 146, 90, .3), rgba(184, 146, 90, .12)); color: #fff !important; box-shadow: inset 3px 0 0 var(--gold); }
.an-link > span:not(.an-badge) { flex: 1; }
.ai { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.an-link .ai { opacity: .85; }
.an-badge { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #d9534f; color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; }
.an-badge.plus { background: #3f9b6a; }
.an-foot { padding: 10px 12px 18px; border-top: 1px solid rgba(255, 255, 255, .08); }

.an-top { position: sticky; top: 0; z-index: 1030; margin-left: var(--side); display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 32px;
  background: rgba(246, 243, 238, .86); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.an-title { flex: 1; font: 600 15px/1.2 'Inter', sans-serif; color: var(--muted); letter-spacing: .02em; }
.an-burger, .an-top .an-logo.sm { display: none; }
.an-top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.an-scrim { display: none; }
.an-bottom { display: none; }

/* ---------- компоненти ---------- */
.admin .card { border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 1px 2px rgba(43, 35, 38, .04), 0 8px 24px -16px rgba(43, 35, 38, .25); }
.admin .card-header { background: #fff; border-bottom: 1px solid var(--line); border-radius: 16px 16px 0 0 !important; padding: 14px 18px; font-weight: 600; }
.admin .card-footer { background: #fff; border-top: 1px solid var(--line); border-radius: 0 0 16px 16px !important; }
.admin .card-body { padding: 18px; }
.admin .list-group-item { border-color: var(--line); }
.admin .btn { border-radius: 10px; font-weight: 500; }
.admin .btn-sm { border-radius: 9px; padding: 5px 12px; }
.admin .btn-primary { background: var(--ink); border-color: var(--ink); }
.admin .btn-primary:hover, .admin .btn-primary:focus { background: #45383d; border-color: #45383d; }
.admin .btn-outline-primary { color: var(--ink); border-color: #cfc3b6; }
.admin .btn-outline-primary:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.admin .btn-outline-secondary, .admin .btn-outline-dark { color: #4d4246; border-color: #d8cfc4; background: #fff; }
.admin .btn-outline-secondary:hover, .admin .btn-outline-dark:hover { background: #f1ebe2; color: var(--ink); border-color: #cbbfb1; }
.admin .btn-dark { background: var(--ink); border-color: var(--ink); }
.admin .btn-light { background: #f3eee6; border-color: #f3eee6; }
.admin .btn.an-new { background: var(--gold); border-color: var(--gold); color: #fff; font-weight: 600; box-shadow: 0 6px 14px -8px rgba(138, 106, 58, .8); }
.admin .btn.an-new:hover { background: var(--gold-d); border-color: var(--gold-d); }
.admin .form-control, .admin .form-select { border-radius: 10px; border-color: #dcd3c8; }
.admin .form-control:focus, .admin .form-select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184, 146, 90, .18); }
.admin .form-check-input:checked { background-color: var(--ink); border-color: var(--ink); }
.admin .nav-tabs { border-bottom-color: var(--line); }
.admin .nav-tabs .nav-link { border-radius: 10px 10px 0 0; color: #6d6166; }
.admin .nav-tabs .nav-link.active { border-color: var(--line) var(--line) #fff; color: var(--ink); }
.admin .table { --bs-table-hover-bg: #faf6f0; }
.admin .table > :not(caption) > * > * { border-bottom-color: var(--line); }
.admin .dropdown-menu { border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px -18px rgba(43, 35, 38, .45); padding: 6px; }
.admin .dropdown-item { border-radius: 8px; padding: 7px 12px; }
.admin .dropdown-item.active, .admin .dropdown-item:active { background: var(--ink); }
.admin .alert { border-radius: 12px; }
.admin .alert-success { background: #edf7f0; border-color: #cfe9d7; color: #23633f; }
.admin .badge { font-weight: 600; letter-spacing: .01em; }
.admin .stat { padding: 16px 18px; }
.admin .stat b { font-size: 28px; font-weight: 700; color: inherit; }
.admin .stat span { color: var(--muted); font-size: 12.5px; }
/* „← Всички покани“ – менюто вече го прави */
.admin-shell a.small.text-decoration-none[href="/admin"] { display: none; }

/* филтри като чипове (на телефон – ред, който се плъзга) */
.an-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.an-chips .btn { border-radius: 999px; padding: 5px 14px; white-space: nowrap; }
.an-chips .btn-dark { box-shadow: 0 4px 10px -6px rgba(43, 35, 38, .7); }

/* търсачка над поканите */
.an-search { position: relative; max-width: 360px; flex: 1; }
.an-search input { padding-left: 38px; height: 40px; background: #fff; }
.an-search .ai { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #9a8d82; width: 17px; height: 17px; }

/* картите на поканите */
.inv-admin-card { overflow: hidden; transition: transform .15s, box-shadow .15s; }
.inv-admin-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(43, 35, 38, .05), 0 18px 34px -20px rgba(43, 35, 38, .4); }
.inv-thumb { height: 132px; }
.inv-admin-card .card-body h2 { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 600; font-size: 22px; }
.inv-admin-card .card-footer { gap: 6px !important; }

/* ---------- Ред на главната: телефончетата, както ги вижда клиентът ---------- */
.ho-sec { margin-bottom: 34px; }
.ho-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.ho-head h2 { margin: 0; font: 600 24px/1.2 'Cormorant Garamond', Georgia, serif; }
.ho-head span { font-size: 12.5px; color: var(--muted); }
.ho-jump { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 18px; }
.ho-jump a { padding: 4px 11px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 12.5px; text-decoration: none; color: inherit; }
.ho-jump a:hover { border-color: var(--gold-d); }
.ho-jump b { margin-left: 3px; font-weight: 600; color: var(--gold-d); }
.ho-cat { scroll-margin-top: 80px; margin-bottom: 28px; padding: 14px 14px 18px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255, 255, 255, .55); }
.ho-cat h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font: 600 21px/1.2 'Cormorant Garamond', Georgia, serif; }
.ho-cat h3 small { font: 600 11.5px/1 Montserrat, sans-serif; padding: 4px 9px; border-radius: 999px; background: #f6eee2; color: var(--gold-d); }
.ho-cat-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #f6eee2; color: var(--gold-d); }
.ho-cat-ico svg { width: 19px; height: 19px; }
.ho-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 22px 18px; }
.ho-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 10px 10px; border-radius: 18px;
  background: #fff; border: 1px solid var(--line); box-shadow: 0 8px 22px -18px rgba(43, 35, 38, .35); cursor: grab; transition: box-shadow .15s, opacity .15s; }
.ho-card:hover { box-shadow: 0 14px 30px -18px rgba(43, 35, 38, .5); }
.ho-card.dragging { opacity: .35; }
.ho-num { position: absolute; top: 8px; left: 8px; z-index: 3; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; background: var(--ink); color: #fff;
  font-size: 12px; font-weight: 700; line-height: 26px; text-align: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.ho-phone { position: relative; width: 158px; aspect-ratio: 9 / 19.2; border-radius: 26px; padding: 6px; background: #1f1a1c; box-shadow: 0 10px 22px -10px rgba(0, 0, 0, .55); }
.ho-notch { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 46px; height: 12px; border-radius: 0 0 9px 9px; background: #1f1a1c; z-index: 2; }
.ho-screen { position: relative; width: 100%; height: 100%; border-radius: 21px; overflow: hidden; background: linear-gradient(135deg, #efe7da, #d9cbb6); }
.ho-screen iframe { position: absolute; left: 0; top: 0; width: 390px; border: 0; transform-origin: 0 0; pointer-events: none; opacity: 0; transition: opacity .4s; }
.ho-screen.on iframe { opacity: 1; }
.ho-grip { position: absolute; inset: 0; z-index: 2; border-radius: 26px; }
.ho-kicker { margin-top: 4px; font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-d); text-align: center; }
.ho-name { font: 600 19px/1.15 'Cormorant Garamond', Georgia, serif; text-align: center; }
.ho-card .form-control { font-size: 12px; text-align: center; }
.ho-move { display: flex; gap: 6px; }
.ho-move .btn { min-width: 38px; }
.ho-save { position: sticky; bottom: 16px; z-index: 5; display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 6px; }
.ho-save .btn { padding: 10px 24px; box-shadow: 0 10px 24px -10px rgba(43, 35, 38, .7); }
#order-form.dirty .ho-save .small { padding: 6px 12px; border-radius: 999px; background: #fff3cd; color: #7a5a00; }

/* ---------- телефон и таблет ---------- */
@media (max-width: 991.98px) {
  .admin { --side: 0px; }
  .admin-shell .an-main { margin-left: 0; padding: 16px 14px calc(88px + env(safe-area-inset-bottom)); }
  .an-side { width: min(84vw, 300px); transform: translateX(-102%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); box-shadow: 20px 0 50px rgba(0, 0, 0, .25); }
  .an-nav-open .an-side { transform: none; }
  .an-close { display: grid; place-items: center; }
  .an-scrim { display: block; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1035; background: rgba(20, 15, 17, .45); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .an-nav-open .an-scrim { opacity: 1; pointer-events: auto; }
  .an-nav-open { overflow: hidden; }
  .an-top { margin-left: 0; height: 56px; padding: 0 12px; }
  .an-burger { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 12px; background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
  .an-top .an-logo.sm { display: inline-flex; }
  .an-title { display: none; }
  .an-bottom { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .96); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -18px rgba(43, 35, 38, .5); }
  .an-bottom a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border-radius: 12px;
    color: #8a7f78 !important; text-decoration: none; font-size: 10.5px; font-weight: 600; }
  .an-bottom a .ai { width: 22px; height: 22px; }
  .an-bottom a.active { color: var(--ink) !important; background: #f3ece1; }
  .an-bottom .an-badge { position: absolute; top: 0; left: 52%; min-width: 18px; height: 18px; line-height: 18px; font-size: 10px; padding: 0 5px; }
  .admin h1.h3, .admin .h3 { font-size: 26px; }
  .an-chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px; padding: 2px 14px 6px; scrollbar-width: none; }
  .an-chips::-webkit-scrollbar { display: none; }
  .admin .card-body { padding: 14px; }
  .an-search { max-width: none; }
  .admin .nav-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .admin .nav-tabs .nav-link { white-space: nowrap; padding: 8px 12px; }
  /* бутоните най-горе в редактора – ред, който се плъзга */
  .an-actions { flex-wrap: nowrap !important; overflow-x: auto; margin: 0 -14px; padding: 2px 14px 6px; scrollbar-width: none; }
  .an-actions::-webkit-scrollbar { display: none; }
  .an-actions > * { flex: none; }
  .an-actions .btn { white-space: nowrap; font-size: 13px; padding: 6px 12px; }
  /* Ред на главната: по 2 телефончета на ред, бутонът „Запази“ над долната лента */
  .ho-grid { grid-template-columns: repeat(2, 1fr); gap: 14px 10px; }
  .ho-card { cursor: default; padding: 10px 6px 8px; }
  .ho-phone { width: 100%; max-width: 150px; }
  .ho-name { font-size: 17px; }
  .ho-save { bottom: calc(78px + env(safe-area-inset-bottom)); }
}

/* поканите на телефон – компактни редове: снимка вляво, текст вдясно, бутоните отдолу */
@media (max-width: 575.98px) {
  .inv-admin-card { display: grid; grid-template-columns: 92px 1fr; grid-template-areas: "thumb body" "foot foot"; }
  .inv-admin-card .inv-thumb { grid-area: thumb; height: auto; min-height: 100%; }
  .inv-admin-card .inv-thumb .badge { position: static; display: block; margin: 6px 6px 0; font-size: 9.5px; white-space: normal; text-align: left; }
  .inv-admin-card .card-body { grid-area: body; padding: 10px 12px; }
  .inv-admin-card .card-body h2 { font-size: 19px; line-height: 1.15; }
  .inv-admin-card .card-footer { grid-area: foot; padding: 8px 10px; }
  .inv-admin-card .card-footer .btn { font-size: 12.5px; padding: 5px 10px; }
  .inv-admin-card .card-body .d-flex.gap-3 { gap: 6px 10px !important; font-size: 12px; }
}
