:root {
    --bg: var(--tg-theme-bg-color, #edf3ff);
    --text: var(--tg-theme-text-color, #10233e);
    --hint: var(--tg-theme-hint-color, #5f7594);
    --link: var(--tg-theme-link-color, #2563eb);
    --btn: var(--tg-theme-button-color, #2c6bed);
    --btn-text: var(--tg-theme-button-text-color, #ffffff);
    --secondary-bg: var(--tg-theme-secondary-bg-color, rgba(255, 255, 255, 0.52));
    --destructive: var(--tg-theme-destructive-text-color, #dc2626);

    --surface: rgba(255, 255, 255, 0.58);
    --surface-2: rgba(255, 255, 255, 0.36);
    --surface-3: rgba(255, 255, 255, 0.72);
    --border: rgba(152, 173, 200, 0.28);
    --brand: var(--btn);
    --focus-ring: rgba(44, 107, 237, 0.22);
    --danger-soft: rgba(220, 38, 38, 0.12);
    --shadow-sm: 0 18px 44px rgba(77, 102, 136, 0.12);
    --shadow-md: 0 28px 68px rgba(77, 102, 136, 0.18);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --glass-glow: radial-gradient(circle at top left, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0) 62%);
    --glass-overlay: linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.22));
}

@media (prefers-color-scheme: dark) {
    :root {
        --border: rgba(148, 163, 184, 0.28);
        --focus-ring: rgba(96, 165, 250, 0.25);
        --danger-soft: rgba(248, 113, 113, 0.16);
        --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.22);
        --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.35);
    }
}

body.tg-dark {
    --bg: var(--tg-theme-bg-color, #0b1220);
    --text: var(--tg-theme-text-color, #edf4ff);
    --hint: var(--tg-theme-hint-color, #9cafc7);
    --link: var(--tg-theme-link-color, #7fb2ff);
    --btn: var(--tg-theme-button-color, #4f8dff);
    --btn-text: var(--tg-theme-button-text-color, #f8fbff);
    --secondary-bg: var(--tg-theme-secondary-bg-color, rgba(17, 24, 39, 0.72));
    --destructive: var(--tg-theme-destructive-text-color, #ff7c7c);
    --surface: rgba(12, 19, 34, 0.68);
    --surface-2: rgba(18, 27, 47, 0.62);
    --surface-3: rgba(24, 34, 58, 0.82);
    --border: rgba(151, 178, 219, 0.18);
    --focus-ring: rgba(96, 165, 250, 0.28);
    --danger-soft: rgba(255, 107, 107, 0.16);
    --shadow-sm: 0 22px 56px rgba(2, 6, 23, 0.4);
    --shadow-md: 0 34px 86px rgba(2, 6, 23, 0.54);
    --glass-glow: radial-gradient(circle at top left, rgba(162, 195, 255, 0.14), rgba(162, 195, 255, 0) 58%);
    --glass-overlay: linear-gradient(180deg, rgba(20, 30, 52, 0.82), rgba(10, 18, 34, 0.56));
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.not-ready {
    opacity: 0;
}

body {
    font-family: "SF Pro Display", "SF Pro Text", "Segoe UI", system-ui, sans-serif;
    background:
        radial-gradient(circle at 12% 12%, rgba(119, 181, 255, 0.46), transparent 23%),
        radial-gradient(circle at 84% 8%, rgba(255, 255, 255, 0.96), transparent 22%),
        radial-gradient(circle at 86% 42%, rgba(203, 226, 255, 0.3), transparent 26%),
        radial-gradient(circle at 50% 120%, rgba(184, 212, 255, 0.22), transparent 40%),
        linear-gradient(180deg, #fdfefe 0%, #f4f8ff 22%, var(--bg) 56%, #edf3ff 100%);
    color: var(--text);
    line-height: 1.45;
    min-height: 100vh;
    transition: opacity 0.2s ease;
    padding-top: 10px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
    position: relative;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: auto;
    width: 280px;
    height: 280px;
    border-radius: 999px;
    filter: blur(54px);
    opacity: 0.56;
    pointer-events: none;
    z-index: -1;
}

body::before {
    top: 64px;
    left: -28px;
    background: rgba(122, 186, 255, 0.5);
}

body::after {
    top: 120px;
    right: -56px;
    background: rgba(255, 255, 255, 0.72);
}

body.tg-dark {
    background:
        radial-gradient(circle at 12% 10%, rgba(60, 130, 255, 0.24), transparent 24%),
        radial-gradient(circle at 88% 8%, rgba(92, 124, 250, 0.16), transparent 22%),
        radial-gradient(circle at 82% 42%, rgba(79, 172, 255, 0.12), transparent 28%),
        linear-gradient(180deg, #07101f 0%, #0b1427 26%, var(--bg) 58%, #08111f 100%);
}

body.tg-dark::before {
    background: rgba(44, 125, 255, 0.18);
    opacity: 0.62;
}

body.tg-dark::after {
    background: rgba(164, 197, 255, 0.08);
    opacity: 0.48;
}

button,
input,
select {
    font: inherit;
}

input[type="checkbox"] {
    accent-color: var(--brand);
}

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.hidden {
    display: none !important;
}

/* ── Tabs ──────────────────────────────── */
.tabs {
    display: flex;
    gap: 6px;
    position: sticky;
    top: 10px;
    z-index: 30;
    max-width: 580px;
    width: calc(100% - 20px);
    margin: 0 auto 10px;
    padding: 7px;
    background: rgba(255, 255, 255, 0.34);
    backdrop-filter: blur(28px) saturate(165%);
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 26px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.tabs::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.08));
    pointer-events: none;
}

.admin-fab {
    position: fixed;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-3);
    backdrop-filter: blur(20px) saturate(140%);
    color: var(--text);
    font-size: 20px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    z-index: 35;
}

.tab {
    flex: 1;
    position: relative;
    min-height: 42px;
    border: 1px solid rgba(255, 255, 255, 0);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(39, 61, 98, 0.72);
    font-size: 0.86rem;
    font-weight: 640;
    cursor: pointer;
    transition: all 0.22s ease;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.28);
    color: var(--text);
}

.tab.active {
    color: #17325e;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(216, 232, 255, 0.62));
    border-color: rgba(255, 255, 255, 0.84);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.94),
        0 16px 34px rgba(73, 113, 189, 0.18),
        0 0 0 1px rgba(123, 166, 239, 0.16);
}

/* ── Tab Content ───────────────────────── */
.tab-content {
    display: none;
    max-width: 580px;
    margin: 0 auto;
    padding: 8px 10px 14px;
    animation: fadeIn 0.18s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Toolbar ───────────────────────────── */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 22px;
    position: relative;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(248, 251, 255, 0.28));
    backdrop-filter: blur(30px) saturate(170%);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.toolbar::before,
.settings-section::before,
.wish-card::before,
.loading::before,
.empty::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.58), transparent 46%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.05));
    pointer-events: none;
}

.toolbar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.toolbar-copy {
    flex: 1;
}

.toolbar-copy h2 {
    font-size: 1.08rem;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.toolbar-copy p {
    color: var(--hint);
    font-size: 0.92rem;
    line-height: 1.4;
}

.btn-add {
    width: auto;
    min-width: 56px;
    height: 40px;
    border-radius: 999px;
    padding: 0 14px;
    font-size: 0.84rem;
    font-weight: 680;
    line-height: 1.1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ── Buttons ───────────────────────────── */
.btn-primary,
.btn-secondary,
.btn-danger {
    min-height: 42px;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn-primary {
    background: linear-gradient(180deg, rgba(82, 136, 241, 0.96), rgba(56, 112, 229, 0.92));
    color: var(--btn-text);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 12px 30px rgba(69, 112, 198, 0.22);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.54);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.52);
    backdrop-filter: blur(22px) saturate(155%);
}

.btn-secondary:hover {
    filter: brightness(0.98);
}

.btn-danger {
    background: var(--danger-soft);
    color: var(--destructive);
    border: 1px solid rgba(220, 38, 38, 0.4);
}

.btn-danger:hover:not(:disabled) {
    background: rgba(220, 38, 38, 0.2);
}

.btn-primary:active,
.btn-secondary:active,
.btn-danger:active {
    transform: translateY(0);
}

.btn-primary:disabled,
.btn-danger:disabled {
    opacity: 0.45;
    cursor: default;
    box-shadow: none;
}

/* ── Wish Cards ────────────────────────── */
.wish-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wish-card {
    position: relative;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(248, 251, 255, 0.24));
    backdrop-filter: blur(28px) saturate(165%);
    border-radius: 20px;
    padding: 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.wish-card .wish-info {
    flex: 1;
    cursor: pointer;
}

.wish-card .wish-info h3 {
    font-size: 1rem;
    margin-bottom: 5px;
    word-break: break-word;
    letter-spacing: -0.01em;
}

.wish-card .wish-info p {
    font-size: 0.8rem;
    color: var(--hint);
    word-break: break-word;
}

.wish-meta {
    margin-bottom: 6px;
}

.wish-preview {
    color: var(--text) !important;
    opacity: 0.86;
}

.wish-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
}

.wish-card .btn-edit,
.btn-delete-inline {
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.54);
    border-radius: 12px;
    color: var(--text);
    min-width: 72px;
    min-height: 36px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.btn-delete-inline {
    color: var(--destructive);
    border-color: rgba(220, 38, 38, 0.28);
    background: rgba(220, 38, 38, 0.08);
}

.wish-card .btn-edit:hover,
.btn-delete-inline:hover {
    filter: brightness(0.98);
}

/* ── Modal ─────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: env(safe-area-inset-bottom);
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.5);
    backdrop-filter: blur(2px);
}

.modal-body {
    position: relative;
    background: rgba(249, 252, 255, 0.82);
    backdrop-filter: blur(34px) saturate(170%);
    border: 1px solid var(--border);
    border-radius: 24px 24px 0 0;
    padding: 22px;
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
}

.modal-body h2 {
    margin-bottom: 16px;
    font-size: 1.06rem;
}

.modal-body-compact {
    max-width: 420px;
    border-radius: 24px;
    margin: 0 14px 18px;
    padding: 20px;
}

.modal-message {
    color: var(--text);
    font-size: 0.96rem;
    line-height: 1.5;
}

.field {
    margin-bottom: 14px;
}

.field label {
    display: block;
    font-size: 0.83rem;
    color: var(--hint);
    margin-bottom: 6px;
    font-weight: 600;
}

.field input,
.field select,
.settings-field input,
.settings-field select {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field input[type="checkbox"],
.field input[type="radio"] {
    width: auto;
    min-height: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
}

.field input:focus,
.field select:focus,
.settings-field input:focus,
.settings-field select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--focus-ring);
    background: var(--surface-2);
    outline: none;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.modal-actions button {
    flex: 1;
}

/* ── Settings ──────────────────────────── */
.settings-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settings-section {
    position: relative;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(248, 251, 255, 0.26));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(30px) saturate(170%);
}

.hero-card {
    padding: 20px;
    overflow: hidden;
    position: relative;
}

.hero-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--glass-glow);
    pointer-events: none;
}

.hero-kicker {
    position: relative;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--hint);
    margin-bottom: 10px;
}

.hero-title {
    position: relative;
    font-size: 1.36rem;
    line-height: 1.08;
    margin-bottom: 10px;
    letter-spacing: -0.03em;
}

.hero-text {
    position: relative;
    color: var(--hint);
    font-size: 0.96rem;
    max-width: 32rem;
    line-height: 1.45;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 12px;
    margin-bottom: 14px;
}

.section-heading h3 {
    font-size: 1rem;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.section-heading p {
    color: var(--hint);
    font-size: 0.85rem;
}

.settings-shell {
    padding-bottom: 16px;
}

.settings-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-actions {
    display: flex;
}

.settings-actions .btn-save-settings {
    width: 100%;
}

.inline-note strong {
    display: block;
    margin-bottom: 6px;
    font-size: 0.92rem;
}

.inline-note p {
    color: var(--hint);
    font-size: 0.86rem;
}

.status-pill-row {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: var(--text);
    font-size: 0.83rem;
    font-weight: 600;
}

.status-pill-premium {
    background: rgba(44, 107, 237, 0.12);
    border-color: rgba(44, 107, 237, 0.2);
}

.store-grid {
    display: grid;
    gap: 12px;
}

.offer-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.offer-card-primary {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(231, 241, 255, 0.62));
}

.offer-copy h4 {
    font-size: 1rem;
    margin-bottom: 6px;
}

.offer-copy p {
    color: var(--hint);
    font-size: 0.88rem;
}

.offer-kicker {
    display: inline-block;
    margin-bottom: 6px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--hint);
}

.offer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.offer-actions-wide .btn-buy {
    flex: 1;
}

.benefit-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.benefit-item {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.56);
    font-size: 0.88rem;
    font-weight: 600;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.faq-item p {
    color: var(--hint);
    font-size: 0.86rem;
}

.settings-section > h3 {
    font-size: 0.78rem;
    margin-bottom: 12px;
    color: var(--hint);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.settings-field {
    margin-bottom: 12px;
}

.settings-field:last-child {
    margin-bottom: 0;
}

.settings-field label {
    display: block;
    font-size: 0.83rem;
    color: var(--hint);
    margin-bottom: 6px;
    font-weight: 600;
}

.settings-field .info-value {
    min-height: 42px;
    padding: 10px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--hint);
}

.timezone-row {
    display: flex;
    gap: 8px;
}

.timezone-row .btn-detect-tz {
    min-width: 44px;
    padding: 0;
}

.toggle-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toggle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.toggle-item span {
    font-size: 0.9rem;
}

.toggle-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(148, 163, 184, 0.35);
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-item input[type="checkbox"]::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
    transition: transform 0.2s ease;
}

.toggle-item input[type="checkbox"]:checked {
    background: var(--brand);
    border-color: var(--brand);
}

.toggle-item input[type="checkbox"]:checked::after {
    transform: translateX(18px);
}

.btn-save-settings {
    margin-top: 4px;
}

.btn-buy {
    justify-content: center;
}

.admin-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.admin-kpi {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-kpi span {
    color: var(--hint);
    font-size: 0.8rem;
}

.admin-kpi strong {
    font-size: 1rem;
}

.admin-generated {
    margin-top: 10px;
    color: var(--hint);
    font-size: 0.82rem;
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid var(--border);
    padding: 8px;
    text-align: left;
    font-size: 0.82rem;
}

.admin-table th {
    color: var(--hint);
    font-weight: 700;
}

.admin-table-actions {
    width: 128px;
}

.admin-inline-btn {
    width: 100%;
    justify-content: center;
}

.admin-activity-row.hidden {
    display: none;
}

.admin-inline-panel,
.admin-inline-empty {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-2);
    padding: 12px;
}

.admin-inline-empty {
    color: var(--hint);
    text-align: center;
}

.admin-activity-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-activity-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    padding: 12px;
}

.admin-activity-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
}

.admin-activity-title {
    font-weight: 700;
    margin-bottom: 2px;
}

.admin-activity-source,
.admin-activity-time,
.admin-log-summary {
    color: var(--hint);
    font-size: 0.8rem;
}

.admin-activity-time {
    white-space: nowrap;
}

.admin-activity-props {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.admin-activity-prop {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    font-size: 0.77rem;
}

.admin-log-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-log-days {
    max-width: 120px;
}

.admin-log-days span {
    display: block;
    margin-bottom: 6px;
    color: var(--hint);
    font-size: 0.82rem;
}

.admin-log-filter-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-log-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-2);
    font-size: 0.82rem;
}

.admin-log-actions {
    display: flex;
}

.admin-log-actions .btn-secondary {
    width: 100%;
    justify-content: center;
}

.admin-log-results {
    margin-top: 12px;
}

.admin-log-summary {
    margin-bottom: 10px;
}

.admin-log-table {
    min-width: 760px;
}

.admin-log-message {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.admin-log-details {
    margin-top: 8px;
}

.admin-log-details summary {
    cursor: pointer;
    color: var(--link);
}

.admin-log-details pre {
    margin-top: 8px;
    padding: 10px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 0.77rem;
}

.admin-level-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    border: 1px solid var(--border);
    background: var(--surface-2);
}

.admin-level-error,
.admin-level-critical {
    color: #b91c1c;
    background: rgba(220, 38, 38, 0.12);
    border-color: rgba(220, 38, 38, 0.18);
}

.admin-level-warning {
    color: #b45309;
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.2);
}

.admin-level-information {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.18);
}

.admin-level-debug,
.admin-level-trace {
    color: var(--hint);
}

/* ── Utility ───────────────────────────── */
.loading,
.empty {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    text-align: center;
    color: var(--hint);
    padding: 44px 18px;
    font-size: 0.95rem;
    line-height: 1.45;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    border: 1px solid rgba(255, 255, 255, 0.58);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(248, 251, 255, 0.24));
    backdrop-filter: blur(26px) saturate(165%);
    box-shadow: var(--shadow-sm);
}

@media (min-width: 640px) {
    .modal {
        align-items: center;
        padding: 16px;
    }

    .modal-body {
        border-radius: 20px;
        max-height: min(85vh, 720px);
    }

    .tab-content {
        padding: 16px;
    }

    .store-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

body.tg-dark .tabs,
body.tg-dark .toolbar,
body.tg-dark .wish-card,
body.tg-dark .settings-section,
body.tg-dark .loading,
body.tg-dark .empty,
body.tg-dark .modal-body,
body.tg-dark .admin-fab {
    border-color: rgba(156, 186, 230, 0.18);
    background: linear-gradient(180deg, rgba(21, 31, 54, 0.82), rgba(11, 18, 35, 0.62));
    backdrop-filter: blur(30px) saturate(145%);
    box-shadow: var(--shadow-sm);
}

body.tg-dark .tabs::before,
body.tg-dark .toolbar::before,
body.tg-dark .settings-section::before,
body.tg-dark .wish-card::before,
body.tg-dark .loading::before,
body.tg-dark .empty::before {
    background:
        radial-gradient(circle at top left, rgba(150, 190, 255, 0.16), transparent 48%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
}

body.tg-dark .tab {
    color: rgba(220, 231, 249, 0.78);
    background: rgba(255, 255, 255, 0.02);
}

body.tg-dark .tab:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

body.tg-dark .tab.active {
    color: #f3f8ff;
    background: linear-gradient(180deg, rgba(58, 102, 182, 0.48), rgba(34, 62, 118, 0.72));
    border-color: rgba(156, 194, 255, 0.24);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 16px 32px rgba(9, 14, 28, 0.42),
        0 0 0 1px rgba(103, 149, 236, 0.18);
}

body.tg-dark .toolbar-copy p,
body.tg-dark .wish-card .wish-info p,
body.tg-dark .section-heading p,
body.tg-dark .hero-text,
body.tg-dark .inline-note p,
body.tg-dark .faq-item p,
body.tg-dark .settings-field label,
body.tg-dark .field label,
body.tg-dark .settings-section > h3,
body.tg-dark .admin-kpi span,
body.tg-dark .admin-generated,
body.tg-dark .loading,
body.tg-dark .empty {
    color: var(--hint);
}

body.tg-dark .btn-secondary,
body.tg-dark .wish-card .btn-edit,
body.tg-dark .status-pill,
body.tg-dark .benefit-item,
body.tg-dark .settings-field .info-value,
body.tg-dark .toggle-item,
body.tg-dark .admin-kpi,
body.tg-dark .field input,
body.tg-dark .field select,
body.tg-dark .settings-field input,
body.tg-dark .settings-field select {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(164, 189, 230, 0.18);
    color: var(--text);
}

body.tg-dark .field input::placeholder,
body.tg-dark .settings-field input::placeholder {
    color: rgba(172, 187, 212, 0.72);
}

body.tg-dark .offer-card-primary {
    background: linear-gradient(180deg, rgba(29, 49, 84, 0.82), rgba(14, 26, 47, 0.68));
}

body.tg-dark .status-pill-premium {
    background: rgba(79, 141, 255, 0.16);
    border-color: rgba(102, 160, 255, 0.24);
}

body.tg-dark .btn-delete-inline,
body.tg-dark .btn-danger {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 125, 125, 0.28);
    color: var(--destructive);
}

body.tg-dark .modal-backdrop {
    background: rgba(1, 4, 10, 0.68);
    backdrop-filter: blur(6px);
}

body.tg-dark .admin-table th,
body.tg-dark .admin-table td {
    border-bottom-color: rgba(148, 163, 184, 0.16);
}

@media (prefers-color-scheme: dark) {
    body:not(.tg-light) {
        --bg: #0b1220;
        --text: #edf4ff;
        --hint: #9cafc7;
        --link: #7fb2ff;
        --btn: #4f8dff;
        --btn-text: #f8fbff;
        --secondary-bg: rgba(17, 24, 39, 0.72);
        --destructive: #ff7c7c;
        --surface: rgba(12, 19, 34, 0.68);
        --surface-2: rgba(18, 27, 47, 0.62);
        --surface-3: rgba(24, 34, 58, 0.82);
        --border: rgba(151, 178, 219, 0.18);
        --focus-ring: rgba(96, 165, 250, 0.28);
        --danger-soft: rgba(255, 107, 107, 0.16);
        --shadow-sm: 0 22px 56px rgba(2, 6, 23, 0.4);
        --shadow-md: 0 34px 86px rgba(2, 6, 23, 0.54);
        --glass-glow: radial-gradient(circle at top left, rgba(162, 195, 255, 0.14), rgba(162, 195, 255, 0) 58%);
        --glass-overlay: linear-gradient(180deg, rgba(20, 30, 52, 0.82), rgba(10, 18, 34, 0.56));
        background:
            radial-gradient(circle at 12% 10%, rgba(60, 130, 255, 0.24), transparent 24%),
            radial-gradient(circle at 88% 8%, rgba(92, 124, 250, 0.16), transparent 22%),
            radial-gradient(circle at 82% 42%, rgba(79, 172, 255, 0.12), transparent 28%),
            linear-gradient(180deg, #07101f 0%, #0b1427 26%, var(--bg) 58%, #08111f 100%);
    }

    body:not(.tg-light)::before {
        background: rgba(44, 125, 255, 0.18);
        opacity: 0.62;
    }

    body:not(.tg-light)::after {
        background: rgba(164, 197, 255, 0.08);
        opacity: 0.48;
    }

    body:not(.tg-light) .tabs,
    body:not(.tg-light) .toolbar,
    body:not(.tg-light) .wish-card,
    body:not(.tg-light) .settings-section,
    body:not(.tg-light) .loading,
    body:not(.tg-light) .empty,
    body:not(.tg-light) .modal-body,
    body:not(.tg-light) .admin-fab {
        border-color: rgba(156, 186, 230, 0.18);
        background: linear-gradient(180deg, rgba(21, 31, 54, 0.82), rgba(11, 18, 35, 0.62));
        backdrop-filter: blur(30px) saturate(145%);
        box-shadow: var(--shadow-sm);
    }

    body:not(.tg-light) .tabs::before,
    body:not(.tg-light) .toolbar::before,
    body:not(.tg-light) .settings-section::before,
    body:not(.tg-light) .wish-card::before,
    body:not(.tg-light) .loading::before,
    body:not(.tg-light) .empty::before {
        background:
            radial-gradient(circle at top left, rgba(150, 190, 255, 0.16), transparent 48%),
            linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
    }

    body:not(.tg-light) .tab {
        color: rgba(220, 231, 249, 0.78);
        background: rgba(255, 255, 255, 0.02);
    }

    body:not(.tg-light) .tab:hover {
        background: rgba(255, 255, 255, 0.06);
        color: var(--text);
    }

    body:not(.tg-light) .tab.active {
        color: #f3f8ff;
        background: linear-gradient(180deg, rgba(58, 102, 182, 0.48), rgba(34, 62, 118, 0.72));
        border-color: rgba(156, 194, 255, 0.24);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.12),
            0 16px 32px rgba(9, 14, 28, 0.42),
            0 0 0 1px rgba(103, 149, 236, 0.18);
    }

    body:not(.tg-light) .toolbar-copy p,
    body:not(.tg-light) .wish-card .wish-info p,
    body:not(.tg-light) .section-heading p,
    body:not(.tg-light) .hero-text,
    body:not(.tg-light) .inline-note p,
    body:not(.tg-light) .faq-item p,
    body:not(.tg-light) .settings-field label,
    body:not(.tg-light) .field label,
    body:not(.tg-light) .settings-section > h3,
    body:not(.tg-light) .admin-kpi span,
    body:not(.tg-light) .admin-generated,
    body:not(.tg-light) .loading,
    body:not(.tg-light) .empty {
        color: var(--hint);
    }

    body:not(.tg-light) .btn-secondary,
    body:not(.tg-light) .wish-card .btn-edit,
    body:not(.tg-light) .status-pill,
    body:not(.tg-light) .benefit-item,
    body:not(.tg-light) .settings-field .info-value,
    body:not(.tg-light) .toggle-item,
    body:not(.tg-light) .admin-kpi,
    body:not(.tg-light) .field input,
    body:not(.tg-light) .field select,
    body:not(.tg-light) .settings-field input,
    body:not(.tg-light) .settings-field select {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(164, 189, 230, 0.18);
        color: var(--text);
    }

    body:not(.tg-light) .field input::placeholder,
    body:not(.tg-light) .settings-field input::placeholder {
        color: rgba(172, 187, 212, 0.72);
    }

    body:not(.tg-light) .offer-card-primary {
        background: linear-gradient(180deg, rgba(29, 49, 84, 0.82), rgba(14, 26, 47, 0.68));
    }

    body:not(.tg-light) .status-pill-premium {
        background: rgba(79, 141, 255, 0.16);
        border-color: rgba(102, 160, 255, 0.24);
    }

    body:not(.tg-light) .btn-delete-inline,
    body:not(.tg-light) .btn-danger {
        background: rgba(255, 107, 107, 0.1);
        border-color: rgba(255, 125, 125, 0.28);
        color: var(--destructive);
    }

    body:not(.tg-light) .modal-backdrop {
        background: rgba(1, 4, 10, 0.68);
        backdrop-filter: blur(6px);
    }

    body:not(.tg-light) .admin-table th,
    body:not(.tg-light) .admin-table td {
        border-bottom-color: rgba(148, 163, 184, 0.16);
    }
}
