/* =========================================================
   Royera — фирменная золотая тема
   Палитра вдохновлена шапкой группы vk.com/royera
   ========================================================= */

:root {
    --gold:        #C9A14A;
    --gold-light:  #E8C875;
    --gold-dark:   #9E7B2C;
    --gold-grad:   linear-gradient(135deg, #E8C875 0%, #C9A14A 50%, #9E7B2C 100%);

    --bg:          #FAF7F0;
    --bg-card:     #FFFFFF;
    --bg-dark:     #1A1A1A;
    --bg-dark-2:   #232323;

    --text:        #2B2B2B;
    --text-muted:  #6B6B6B;
    --text-on-dark:#F2E7C8;

    --border:      #ECE3CB;
    --shadow-sm:   0 2px 6px rgba(40, 30, 0, .06);
    --shadow-md:   0 6px 18px rgba(40, 30, 0, .10);
    --radius:      10px;
}

/* ---------- Базовое ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font: 15px/1.5 "Inter", "Segoe UI", system-ui, sans-serif;
    color: var(--text);
    background: var(--bg);
}
a { color: var(--gold-dark); text-decoration: none; }
a:hover { color: var(--gold); }
img { max-width: 100%; display: block; }

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}
.muted { color: var(--text-muted); }

/* ---------- Кнопки ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text);
    font: inherit; font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
    white-space: nowrap;
}
.btn-primary {
    background: var(--gold-grad);
    color: #1a1300;
    border-color: var(--gold-dark);
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover { filter: brightness(1.05); box-shadow: var(--shadow-md); }
.btn-ghost {
    background: transparent;
    color: var(--text-on-dark);
    border-color: rgba(232, 200, 117, .5);
}
.btn-ghost:hover { background: rgba(232, 200, 117, .1); color: var(--gold-light); }
.btn-sm  { padding: 6px 12px; font-size: 13px; }
.btn-lg  { padding: 12px 22px; font-size: 16px; }
.btn-block { display: flex; width: 100%; }

/* ---------- Шапка ---------- */
.site-header {
    background: var(--bg-dark);
    border-bottom: 2px solid var(--gold);
    color: var(--text-on-dark);
}
.header-inner {
    display: flex; align-items: center; gap: 24px;
    height: 68px;
}
.logo {
    display: flex; align-items: center; gap: 10px;
    color: var(--gold-light);
    font-weight: 800; letter-spacing: .12em;
}
.logo:hover { color: var(--gold); }
.logo-mark {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--gold-grad);
    color: #1a1300; font-weight: 900;
    display: grid; place-items: center;
    box-shadow: 0 0 0 2px rgba(232, 200, 117, .25);
}
.logo-text { font-size: 18px; }
.logo--sm .logo-mark { width: 28px; height: 28px; }
.logo--sm .logo-text { font-size: 14px; }

.main-nav { display: flex; gap: 22px; margin-left: 12px; }
.main-nav a { color: var(--text-on-dark); font-weight: 500; }
.main-nav a:hover { color: var(--gold-light); }

.header-tools {
    margin-left: auto;
    display: flex; gap: 10px; align-items: center;
}
.select-lang, .select-cur {
    background: var(--bg-dark-2);
    color: var(--text-on-dark);
    border: 1px solid rgba(232, 200, 117, .25);
    border-radius: var(--radius);
    padding: 7px 10px;
    font: inherit;
}

/* ---------- Основная сетка (sidebar + catalog) ---------- */
.main-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    padding-top: 24px;
    padding-bottom: 40px;
}
@media (max-width: 900px) {
    .main-grid { grid-template-columns: 1fr; }
}

/* ---------- Сайдбар ---------- */
.sidebar .panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}
.panel-title {
    margin: 0 0 12px;
    font-size: 16px; color: var(--gold-dark);
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list li + li { margin-top: 4px; }
.cat-list a {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 10px; border-radius: 8px;
    color: var(--text);
}
.cat-list a:hover { background: rgba(201, 161, 74, .08); color: var(--gold-dark); }
.cat-count { font-size: 12px; color: var(--text-muted); }

/* ---------- Каталог ---------- */
.catalog-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px;
}
.catalog-head h1 {
    margin: 0; font-size: 22px;
    background: var(--gold-grad);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.catalog-sort select {
    padding: 8px 12px;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--bg-card);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    display: flex; flex-direction: column;
}
.card:hover {
    transform: translateY(-2px);
    border-color: var(--gold);
    box-shadow: var(--shadow-md);
}
.card-img {
    display: block; aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, #f6efd9, #ece3cb);
    overflow: hidden;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title {
    font-weight: 600; color: var(--text);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-seller { font-size: 12px; color: var(--text-muted); }
.card-bottom {
    margin-top: auto;
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 8px;
}
.card-price {
    font-weight: 700; color: var(--gold-dark);
}

.catalog-more {
    margin-top: 24px;
    text-align: center;
}

/* ---------- Подвал ---------- */
.site-footer {
    margin-top: 40px;
    background: var(--bg-dark);
    color: var(--text-on-dark);
    border-top: 2px solid var(--gold);
}
.footer-inner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    padding: 30px 20px;
}
.footer-col h4 {
    margin: 0 0 10px; color: var(--gold-light); font-size: 14px;
    text-transform: uppercase; letter-spacing: .08em;
}
.footer-col a {
    display: block; color: var(--text-on-dark); padding: 3px 0;
}
.footer-col a:hover { color: var(--gold-light); }
.footer-bottom {
    padding: 14px 20px;
    border-top: 1px solid rgba(232, 200, 117, .15);
    color: var(--text-muted);
    font-size: 13px;
}
@media (max-width: 720px) {
    .footer-inner { grid-template-columns: 1fr 1fr; }
}

/* ---------- Модалки ---------- */
.modal {
    position: fixed; inset: 0;
    background: rgba(15, 15, 15, .65);
    display: grid; place-items: center;
    z-index: 100;
    padding: 20px;
}
.modal[hidden] { display: none; }
.modal-dialog {
    background: var(--bg-card);
    border: 1px solid var(--gold);
    border-radius: var(--radius);
    width: 100%; max-width: 420px;
    padding: 24px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .4);
}
.modal-dialog h2 {
    margin: 0 0 16px;
    background: var(--gold-grad);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.modal-close {
    position: absolute; top: 10px; right: 12px;
    background: transparent; border: 0;
    font-size: 24px; cursor: pointer; color: var(--text-muted);
}
.modal-close:hover { color: var(--gold-dark); }

/* ---------- Формы ---------- */
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-muted); }
.form input {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font: inherit; color: var(--text);
    background: #fff;
}
.form input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 161, 74, .18);
}
.form-foot { font-size: 13px; color: var(--text-muted); text-align: center; }

/* ---------- 404 ---------- */
.error-page {
    grid-column: 1 / -1;
    text-align: center; padding: 80px 20px;
}
.error-page h1 {
    font-size: 96px; margin: 0;
    background: var(--gold-grad);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Меню пользователя ---------- */
.user-menu { position: relative; }
.user-menu-btn {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-dark-2);
    color: var(--text-on-dark);
    border: 1px solid rgba(232, 200, 117, .25);
    border-radius: var(--radius);
    padding: 5px 12px 5px 5px;
    cursor: pointer;
    font: inherit;
}
.user-menu-btn:hover { border-color: var(--gold); }
.user-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--gold-grad); color: #1a1300;
    display: grid; place-items: center; font-weight: 800; font-size: 13px;
}
.user-login { font-weight: 600; }
.user-caret { font-size: 11px; color: var(--gold-light); }
.user-menu-drop {
    position: absolute; right: 0; top: calc(100% + 6px);
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 6px;
    z-index: 50;
}
.user-menu-drop[hidden] { display: none; }
.user-menu-drop a,
.user-menu-logout button {
    display: block; width: 100%; text-align: left;
    padding: 8px 12px; border-radius: 8px;
    color: var(--text); background: transparent; border: 0;
    font: inherit; cursor: pointer;
}
.user-menu-drop a:hover,
.user-menu-logout button:hover {
    background: rgba(201, 161, 74, .12); color: var(--gold-dark);
}
.user-menu-logout { margin: 4px 0 0; border-top: 1px solid var(--border); padding-top: 4px; }

/* ---------- Алерты и тосты ---------- */
.alert {
    padding: 10px 14px; border-radius: var(--radius);
    margin-bottom: 12px; font-size: 14px;
    border: 1px solid transparent;
}
.alert ul { margin: 0; padding-left: 18px; }
.alert-error   { background: #fdecec; color: #8e1a1a; border-color: #f1c1c1; }
.alert-success { background: #ecf7e9; color: #2a6a1a; border-color: #c3e3b8; }

.toast {
    position: fixed; right: 20px; bottom: 20px;
    background: var(--bg-dark); color: var(--gold-light);
    border: 1px solid var(--gold);
    border-radius: var(--radius);
    padding: 12px 18px;
    box-shadow: var(--shadow-md);
    z-index: 200;
    transition: opacity .4s ease, transform .4s ease;
    cursor: pointer;
}
.toast-success { border-color: var(--gold); }
.toast-hide { opacity: 0; transform: translateY(10px); }

/* ---------- Узкая форма (страницы forgot/reset) ---------- */
.auth-page {
    grid-column: 1 / -1;
    max-width: 460px; margin: 40px auto;
    background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 28px; box-shadow: var(--shadow-sm);
}
.auth-page h1 {
    margin: 0 0 8px;
    background: var(--gold-grad);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.form-narrow { margin-top: 16px; }

/* ---------- Каталог: метаданные карточки ---------- */
.card-meta {
    display: flex; gap: 10px; flex-wrap: wrap;
    font-size: 12px; color: var(--text-muted);
}
.card-sold {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 999px;
    background: rgba(201,161,74,.10); color: var(--gold-dark);
    font-weight: 600;
}
.cat-icon { margin-right: 6px; }

/* ---------- Хлебные крошки ---------- */
.breadcrumbs {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--text-muted);
    margin-bottom: 14px;
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--gold-dark); }
.breadcrumbs .sep { opacity: .5; }

/* ---------- Страница товара ---------- */
.product-page { display: block; }
.product-grid-single {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 1.2fr;
    gap: 24px;
}
@media (max-width: 768px) {
    .product-grid-single { grid-template-columns: 1fr; }
}
.product-media {
    background: linear-gradient(135deg, #f6efd9, #ece3cb);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 4 / 3;
}
.product-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-info h1 {
    margin: 0 0 12px; font-size: 26px;
    background: var(--gold-grad);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.product-meta {
    display: flex; gap: 16px; flex-wrap: wrap;
    font-size: 13px; color: var(--text-muted);
    margin-bottom: 18px;
}
.product-seller { font-weight: 600; color: var(--gold-dark); }
.product-stat strong { color: var(--text); }
.product-buy {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    padding: 16px; border-radius: var(--radius);
    background: var(--bg-card); border: 1px solid var(--border);
    margin-bottom: 20px;
}
.product-price {
    font-size: 26px; font-weight: 700; color: var(--gold-dark);
}
.product-stock { font-size: 12px; color: var(--text-muted); }
.product-description h3 {
    margin: 0 0 8px; font-size: 16px; color: var(--gold-dark);
}
.product-description-text { line-height: 1.6; color: var(--text); }

/* ---------- Пагинация ---------- */
.pagination {
    display: flex; gap: 6px; flex-wrap: wrap;
    margin-top: 24px; justify-content: center;
}
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 10px;
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--bg-card); color: var(--text);
    text-decoration: none;
}
.pagination a:hover { border-color: var(--gold); color: var(--gold-dark); }
.pagination .page-cur {
    background: var(--gold-grad); color: #fff; border-color: transparent;
    font-weight: 700;
}

/* ---------- Пустое состояние ---------- */
.empty {
    padding: 40px 20px; text-align: center;
    color: var(--text-muted);
    background: var(--bg-card); border: 1px dashed var(--border);
    border-radius: var(--radius);
}

/* ---------- Личный кабинет ---------- */
.cabinet-sidebar .panel { padding: 16px; }
.cabinet-userbox {
    display: flex; align-items: center; gap: 12px;
    padding-bottom: 14px; margin-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.user-avatar.lg {
    width: 48px; height: 48px; font-size: 20px;
}
.cabinet-username { font-weight: 700; color: var(--text); }
.cabinet-userrole { font-size: 12px; color: var(--gold-dark); }

.cabinet-nav { list-style: none; padding: 0; margin: 0; }
.cabinet-nav li + li { margin-top: 2px; }
.cabinet-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 8px;
    color: var(--text);
}
.cabinet-nav a:hover { background: rgba(201,161,74,.10); color: var(--gold-dark); }
.cabinet-nav .is-active a {
    background: var(--gold-grad); color: #fff;
}
.cabinet-nav .cab-ico {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 6px;
    background: rgba(201,161,74,.15); color: var(--gold-dark);
    font-size: 12px;
}
.cabinet-nav .is-active .cab-ico {
    background: rgba(255,255,255,.20); color: #fff;
}

.cabinet-main { display: block; }
.cabinet-title {
    margin: 0 0 18px; font-size: 24px;
    background: var(--gold-grad);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}

.cabinet-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px; margin-bottom: 24px;
}
.stat-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px;
    display: flex; flex-direction: column; gap: 8px;
}
.stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 22px; font-weight: 700; color: var(--gold-dark); }

.cabinet-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px; margin-bottom: 20px;
}
.cabinet-card h3 {
    margin: 0 0 16px; font-size: 16px; color: var(--gold-dark);
    padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.cabinet-card.empty { text-align: center; padding: 40px 20px; }

.balance-big {
    font-size: 32px; font-weight: 700; color: var(--gold-dark);
    margin: 8px 0 12px;
}

.cabinet-quick h3 { margin-top: 20px; }
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Формы ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.form-row input, .form-row select {
    padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
    background: #fff; color: var(--text); font: inherit;
}
.form-row input:focus, .form-row select:focus {
    outline: none; border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201,161,74,.15);
}
.form-row input:disabled { background: #f5f3ec; color: var(--text-muted); }
.form-row-2 {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.form-row-2 > div { display: flex; flex-direction: column; gap: 6px; }
.form-hint { font-size: 12px; color: var(--text-muted); }
.form-error { font-size: 12px; color: #c0392b; }
.form-actions { margin-top: 6px; }

.alert {
    padding: 10px 14px; border-radius: 8px;
    margin-bottom: 16px; font-size: 14px;
}
.alert-success {
    background: rgba(46, 160, 67, .10);
    color: #1f7a33;
    border: 1px solid rgba(46, 160, 67, .25);
}

/* ============================================================
   Мои товары (ЛК продавца)
   ============================================================ */
.cabinet-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.cabinet-head .cabinet-title { margin: 0; }

.status-card {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.status-card .form-hint { width: 100%; }

.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
    border: 1px solid transparent;
}
.status-draft         { background: #2a2a30; color: #b8b8c0; border-color: #3a3a44; }
.status-on_moderation { background: #3a2f10; color: #e7c25c; border-color: #6c5818; }
.status-active        { background: #14361f; color: #6ee29a; border-color: #1f6437; }
.status-rejected      { background: #401818; color: #ff8b8b; border-color: #6b1f1f; }
.status-archived      { background: #1c1c22; color: #888; border-color: #2c2c34; }

.seller-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: var(--bg-card);
}
.seller-table th,
.seller-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    text-align: left;
    color: var(--text);
}
.seller-table th {
    font-weight: 600;
    color: var(--gold-dark);
    background: #FAF3DF;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.seller-table tbody tr { transition: background-color .12s ease; }
.seller-table tbody tr:hover td { background: #FBF5E4; }
.seller-table .t-right { text-align: right; }

.seller-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 220px;
}
.seller-cover {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    background: #0d0d12;
}
.seller-slug {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}
.seller-slug a { color: var(--text-muted); text-decoration: none; }
.seller-slug a:hover { color: var(--gold-dark); }

.seller-stats {
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 12px;
}
.seller-stats span { margin-right: 10px; }

.seller-actions {
    white-space: nowrap;
}
.seller-actions .btn { margin-left: 4px; }
.inline-form { display: inline-block; margin: 0; }

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}
.btn-danger {
    background: #7a1f1f;
    color: #fff;
    border-color: #7a1f1f;
}
.btn-danger:hover { background: #962a2a; border-color: #962a2a; }

.alert-error {
    background: #401818;
    color: #ff8b8b;
    border: 1px solid #6b1f1f;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.form textarea {
    width: 100%;
    padding: 10px 12px;
    background: #0d0d12;
    border: 1px solid #2a2a30;
    color: #e0e0e8;
    border-radius: 6px;
    font: inherit;
    resize: vertical;
}

@media (max-width: 720px) {
    .seller-table { font-size: 13px; }
    .seller-table th:nth-child(6),
    .seller-table td:nth-child(6) { display: none; }
}

/* ============================================================
   Финансы (ЛК)
   ============================================================ */
.finance-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 16px;
    margin-bottom: 16px;
}
@media (max-width: 860px) {
    .finance-grid { grid-template-columns: 1fr; }
}

.finance-balance .balance-big {
    margin: 8px 0 14px;
}
.finance-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.finance-actions .btn[disabled] {
    opacity: .5;
    cursor: not-allowed;
}

.finance-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.finance-stat { padding: 4px 0; }
.finance-stat .stat-value {
    font-size: 18px;
    font-weight: 600;
    margin-top: 4px;
}
.finance-stat .stat-value.pos { color: #6ee29a; }
.finance-stat .stat-value.neg { color: #ff8b8b; }

.tx-type {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #2a2a30;
    color: #c0c0cc;
    border: 1px solid #3a3a44;
}
.tx-deposit  { background: #14361f; color: #6ee29a; border-color: #1f6437; }
.tx-sale     { background: #14361f; color: #6ee29a; border-color: #1f6437; }
.tx-purchase { background: #401818; color: #ff8b8b; border-color: #6b1f1f; }
.tx-withdraw { background: #401818; color: #ff8b8b; border-color: #6b1f1f; }
.tx-refund   { background: #3a2f10; color: #e7c25c; border-color: #6c5818; }
.tx-adjust   { background: #1c2840; color: #8ab4f8; border-color: #2a4170; }

.tx-amount.pos { color: #6ee29a; font-weight: 600; }
.tx-amount.neg { color: #ff8b8b; font-weight: 600; }
.tx-comment { color: #888; font-size: 13px; }

/* ========== Stage 5: Orders & Delivery ========== */
.order-pending,
.status-pending   { background: #2a2a30; color: #b8b8c0; border-color: #3a3a44; }
.order-paid       { background: #14323e; color: #6fc8e2; border-color: #1f5972; }
.order-delivered  { background: #14361f; color: #6ee29a; border-color: #1f6437; }
.order-completed  { background: #1a3a2a; color: #9fe7b8; border-color: #2a6446; }
.order-disputed   { background: #3a2f10; color: #e7c25c; border-color: #6c5818; }
.order-refunded   { background: #401818; color: #ff8b8b; border-color: #6b1f1f; }

.order-summary { display: grid; gap: 12px; }
.order-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 16px;
    padding: 8px 0;
    border-bottom: 1px dashed #23232c;
}
.order-row:last-child { border-bottom: none; }

.order-payload {
    background: #0f0f14;
    color: #e0e0e8;
    border: 1px solid #2a2a34;
    border-radius: 8px;
    padding: 14px 16px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 8px 0;
}

.buy-form { display: inline-block; margin: 0; }
.global-flash { margin-bottom: 16px; }

.cabinet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.seller-cover {
    width: 36px; height: 36px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

/* ========== Stage 7: Admin Panel ========== */
.admin-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid #23232c;
}
.admin-brand-mark {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #c9a55a, #e0c071);
    color: #16161c;
    font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    font-size: 18px;
}
.admin-brand-title { font-weight: 700; color: #e0e0e8; }
.admin-brand-user { font-size: 12px; color: #888; }

.admin-nav .admin-badge {
    background: #c9a55a;
    color: #16161c;
    font-weight: 700;
    border-radius: 999px;
    padding: 1px 8px;
    font-size: 11px;
    margin-left: auto;
}
.admin-back { margin-top: 16px; width: 100%; text-align: center; }

.admin-main { display: block; }

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s;
}
a.stat-card:hover { border-color: #c9a55a; }
.stat-value { font-size: 28px; font-weight: 700; color: #e0e0e8; }
.stat-sub { color: #888; font-size: 12px; }

.admin-filters {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.admin-filters input[type="search"] { min-width: 240px; }

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}
.admin-form-inline {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.admin-edit-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    padding: 10px 0;
}
.admin-edit-form input,
.admin-edit-form select { padding: 7px 10px; }
.form-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #a8a8b4;
    cursor: pointer;
}

.role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid transparent;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.role-user            { background: #1c1c22; color: #a8a8b4; border-color: #2c2c34; }
.role-vip             { background: #2a2a30; color: #e7c25c; border-color: #6c5818; }
.role-verified_seller { background: #14361f; color: #6ee29a; border-color: #1f6437; }
.role-moderator       { background: #14323e; color: #6fc8e2; border-color: #1f5972; }
.role-admin           { background: #401818; color: #ff8b8b; border-color: #6b1f1f; }

.seller-table tr.is-banned td { opacity: .55; }
.btn-danger {
    background: #401818;
    color: #ffb8b8;
    border-color: #6b1f1f;
}
.btn-danger:hover { background: #531b1b; }
code.muted { color: #6f6f7a; font-size: 11px; }

.link-toggle {
    color: var(--gold, #c9a55a);
    text-decoration: none;
    border-bottom: 1px dashed currentColor;
    cursor: pointer;
}

/* ========== Stage 6: Payments / Deposit ========== */
.deposit-form { max-width: 640px; }
.deposit-amount-row {
    display: flex;
    align-items: stretch;
    gap: 0;
    max-width: 320px;
}
.deposit-amount-row .form-input {
    flex: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
    font-size: 18px;
    font-weight: 600;
}
.deposit-currency {
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    background: #1f1f28;
    border: 1px solid var(--border, #2c2c34);
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    color: #c9a55a;
    font-weight: 600;
    letter-spacing: .04em;
}

.gateway-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}
.gateway-option { cursor: pointer; }
.gateway-option input[type="radio"] { display: none; }
.gateway-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    background: #1c1c22;
    border: 1px solid #2c2c34;
    border-radius: 10px;
    transition: border-color .15s, background .15s;
}
.gateway-option:hover .gateway-card { border-color: #4a4a5a; }
.gateway-option input[type="radio"]:checked + .gateway-card {
    border-color: #c9a55a;
    background: #23201a;
    box-shadow: 0 0 0 1px #c9a55a inset;
}
.gateway-name { font-weight: 700; color: #e0e0e8; }
.gateway-desc { color: #888; font-size: 12px; }

.form-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

/* ========== Static pages (terms / privacy) ========== */
.static-page { max-width: 860px; margin: 32px auto 64px; padding: 0 16px; }
.static-title { font-size: 32px; font-weight: 700; margin-bottom: 4px; color: #e0e0e8; }
.static-subtitle { color: #888; margin: 0 0 24px; font-style: italic; }
.static-content { color: #c8c8d0; line-height: 1.65; font-size: 15px; }
.static-content h2 { margin: 32px 0 12px; font-size: 22px; color: #e0e0e8; border-bottom: 1px solid #2c2c34; padding-bottom: 8px; }
.static-content h3 { margin: 20px 0 8px; font-size: 17px; color: #c9a55a; }
.static-content p  { margin: 0 0 10px; }
.static-content ul { margin: 8px 0 14px 22px; padding: 0; }
.static-content li { margin: 4px 0; }
.static-content a  { color: #c9a55a; text-decoration: none; border-bottom: 1px dashed currentColor; }
.static-content a:hover { color: #e0c071; }
.static-content strong { color: #e0e0e8; }
.static-requisites {
    background: #1c1c22;
    border: 1px solid #2c2c34;
    border-left: 3px solid #c9a55a;
    border-radius: 8px;
    padding: 14px 18px;
    margin-top: 12px;
}
.static-requisites p { margin: 4px 0; }

/* ========== Footer T-Bank / T-Pay badge ========== */
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.footer-tbank {
    display: inline-flex;
    line-height: 0;
    border-radius: 8px;
    transition: transform .15s, box-shadow .15s;
}
.footer-tbank:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(255, 221, 45, 0.25);
}
.footer-tbank img { display: block; height: 40px; width: auto; }

/* ========== Cover upload preview ========== */
.cover-preview {
    margin-bottom: 8px;
    max-width: 220px;
    border: 1px solid var(--border, #ECE3CB);
    border-radius: 8px;
    overflow: hidden;
    background: #FAF7F0;
}
.cover-preview img { display: block; width: 100%; height: auto; }
.form input[type="file"] {
    padding: 8px;
    background: var(--bg-card, #fff);
    border: 1px dashed var(--border, #ECE3CB);
    border-radius: 6px;
    width: 100%;
    cursor: pointer;
}
.form input[type="file"]:hover { border-color: var(--gold, #C9A14A); }

/* ========== Admin product actions ========== */
.admin-row-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
}
.admin-row-actions .admin-form-inline { padding: 0; margin: 0; }
.btn.btn-sm { padding: 5px 10px; font-size: 12px; }
.status-card {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
