/* RUSTMAX.EU Admin — в цветах и стилях сайта */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-body: #0a0a0c;
    --bg-sidebar: rgb(20, 29, 37);
    --bg-card: rgb(20, 29, 37);
    --bg-input: #0d1117;
    --border: #232b36;
    --border-focus: #f2c034;
    --text: #e6edf3;
    --text-muted: #888;
    --accent: #f2c034;
    --accent-hover: #f5d040;
    --success: #3fb950;
    --error: #f85149;
    --sidebar-width: 240px;
    --topbar-height: 56px;
}

body {
    font-family: 'Montserrat', Arial, sans-serif;
    background: var(--bg-body);
    color: var(--text);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
}

/* ——— Страницы без сайдбара (логин, setup) ——— */
.admin-auth,
body:not(.admin-dashboard) {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.admin-auth .wrap,
body:not(.admin-dashboard) .wrap {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
}
.admin-auth h1,
body:not(.admin-dashboard) h1 {
    color: var(--accent);
    font-size: 1.35rem;
    margin-bottom: 1.5rem;
}
.admin-auth .msg, body:not(.admin-dashboard) .msg { margin-bottom: 1rem; }
.admin-auth form label, body:not(.admin-dashboard) form label { margin-top: 1rem; }
.admin-auth form label:first-of-type, body:not(.admin-dashboard) form label:first-of-type { margin-top: 0; }
.admin-auth a, body:not(.admin-dashboard) a { color: var(--accent); }
.admin-auth a:hover, body:not(.admin-dashboard) a:hover { color: var(--accent-hover); }
.admin-auth p, body:not(.admin-dashboard) p { margin-top: 1rem; color: var(--text-muted); }

/* ——— Дашборд: сайдбар + контент ——— */
.admin-dashboard {
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    box-shadow: 0 0 8px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}
.sidebar-brand {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
}
.sidebar-brand a {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}
.sidebar-brand a span { color: var(--accent); }
.sidebar-brand a:hover { color: var(--accent); }

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
    overflow-y: auto;
}
.sidebar-nav .nav-item,
.sidebar-footer .nav-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1.25rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.15s, background 0.15s;
}
.sidebar-nav .nav-item:hover,
.sidebar-footer .nav-item:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.sidebar-nav .nav-item:active,
.sidebar-footer .nav-item:active { background: rgba(255,255,255,0.08); }
.sidebar-nav .nav-item.active { color: var(--accent); background: rgba(242,192,52,0.12); }
.nav-icon { opacity: 0.8; font-size: 0.85rem; }
.sidebar-footer {
    padding: 0.75rem 0;
    border-top: 1px solid var(--border);
}
.sidebar-footer .logout { color: var(--text-muted); }
.sidebar-footer .logout:hover { color: var(--error); }

.main-wrap {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.topbar {
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    background: var(--bg-body);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
}
.content {
    flex: 1;
    padding: 1.5rem;
}

/* ——— Блоки (карточки) ——— */
.section {
    scroll-margin-top: calc(var(--topbar-height) + 1rem);
}
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}
.card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.card-body { }

/* ——— Формы ——— */
label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}
input[type=text],
input[type=email],
input[type=password],
input[type=number],
input[type=url] {
    width: 100%;
    max-width: 480px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.95rem;
    transition: border-color 0.15s;
}
textarea {
    width: 100%;
    max-width: 100%;
    padding: 0.5rem 0.75rem;
    margin-bottom: 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.95rem;
    transition: border-color 0.15s;
    min-height: 80px;
    resize: vertical;
}
input:focus, textarea:focus {
    outline: none;
    border-color: var(--border-focus);
}
.form-row { margin-bottom: 1rem; }
.form-actions { margin-top: 1rem; }
.form-hint { margin-bottom: 0.75rem; font-size: 0.9rem; }
.form-hint a { color: var(--accent); }
.form-hint.small { font-size: 0.85rem; opacity: 0.9; }
.form-row label { display: block; margin-bottom: 0.35rem; font-size: 0.9rem; color: var(--text-muted); font-weight: 600; }
.form-row .form-input,
.form-row input { max-width: 100%; }
.card-divider { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }

button, .btn {
    background: var(--accent);
    color: #0a0e14;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.15s;
}
button:hover, .btn:hover { background: var(--accent-hover); }
.btn-danger {
    background: transparent;
    color: var(--error);
    border: 1px solid var(--error);
}
.btn-danger:hover { background: rgba(248,81,73,0.15); }
.table-wrap .btn + .btn { margin-left: 0.5rem; }

/* ——— Сообщения ——— */
.msg {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}
.msg.ok { background: rgba(63,185,80,0.15); color: var(--success); }
.msg.err { background: rgba(248,81,73,0.15); color: var(--error); }

/* ——— Таблицы ——— */
.table-wrap { overflow-x: auto; margin-top: 0.75rem; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
th, td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
}
tr:hover td { background: rgba(255,255,255,0.02); }
td code {
    background: var(--bg-input);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
}
td .btn, td .btn-danger {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
}

/* ——— Пустые состояния ——— */
.empty { color: var(--text-muted); font-size: 0.9rem; padding: 0.5rem 0; }

/* ——— Пользователи: поиск ——— */
.users-search-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.users-search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-input);
    color: var(--text);
    font-size: 0.95rem;
}
.users-search-input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(242, 192, 52, 0.2);
}
.btn-search {
    padding: 0.5rem 1.25rem;
}
.btn-edit {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(242, 192, 52, 0.2);
    color: var(--accent);
    border: 1px solid rgba(242, 192, 52, 0.4);
}
.btn-edit:hover {
    background: rgba(242, 192, 52, 0.35);
    color: var(--accent-hover);
}
.btn-edit i { font-size: 0.9rem; }
.btn-copy {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
    border: 1px solid rgba(52, 152, 219, 0.4);
}
.btn-copy:hover {
    background: rgba(52, 152, 219, 0.35);
    color: #5dade2;
}
.btn-copy i { font-size: 0.9rem; }
.btn-eye {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    text-decoration: none;
    border: 1px solid transparent;
}
.btn-eye i { font-size: 0.9rem; }
.btn-eye-visible {
    background: rgba(46, 204, 113, 0.25);
    color: #2ecc71;
    border-color: rgba(46, 204, 113, 0.45);
}
.btn-eye-visible:hover {
    background: rgba(46, 204, 113, 0.4);
    color: #3be381;
}
.btn-eye-hidden {
    background: rgba(231, 76, 60, 0.2);
    color: rgba(231, 76, 60, 0.85);
    border-color: rgba(231, 76, 60, 0.35);
}
.btn-eye-hidden:hover {
    background: rgba(231, 76, 60, 0.35);
    color: #e74c3c;
}

/* ——— Модальное окно пользователя ——— */
.user-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}
.user-modal.open {
    opacity: 1;
    visibility: visible;
}
.user-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer;
}
.user-modal-box {
    position: relative;
    width: 100%;
    max-width: 980px;
    max-height: 90vh;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transform-style: preserve-3d;
    transition: transform 0.4s ease;
}
.user-modal-box.flipped {
    transform: rotateY(180deg);
}
.user-modal-inner {
    padding: 1.5rem;
    backface-visibility: hidden;
    width: 100%;
    box-sizing: border-box;
}
.user-modal-inner form {
    width: 100%;
}
.user-modal-fields {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem 1.25rem;
    align-items: center;
    margin-bottom: 0.5rem;
}
.user-modal-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    margin: 0;
}
.user-modal-fields .user-modal-input {
    margin: 0;
}
.user-modal-history,
.user-modal-basket {
    position: absolute;
    inset: 0;
    padding: 1.5rem;
    transform: rotateY(180deg);
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.user-modal-box.flipped[data-panel="history"] .user-modal-basket { display: none; }
.user-modal-box.flipped[data-panel="basket"] .user-modal-history { display: none; }
.user-modal-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}
.user-modal-title {
    flex: 1;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent);
}
.user-modal-close,
.user-modal-back-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}
.user-modal-close:hover,
.user-modal-back-btn:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
}
.user-modal-back-btn {
    font-size: 1.1rem;
    margin-right: 0.25rem;
}
.user-modal-input {
    width: 100%;
    max-width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-input);
    color: var(--text);
    font-size: 0.95rem;
    box-sizing: border-box;
}
.user-modal-input:focus {
    outline: none;
    border-color: var(--border-focus);
}
.user-modal-input[readonly] {
    opacity: 0.85;
    cursor: default;
}
.user-modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    gap: 0.75rem;
}
.btn-history,
.btn-basket {
    background: transparent !important;
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-history:hover,
.btn-basket:hover {
    background: transparent !important;
    color: var(--text-muted);
    border-color: var(--accent);
}
.btn-primary {
    background: var(--accent);
    color: #0a0e14;
    margin-left: auto;
}
.user-modal-history-content {
    flex: 1;
    overflow: auto;
    min-height: 0;
}
.user-history-table-wrap {
    overflow-x: auto;
    margin-bottom: 0.75rem;
}
.user-history-table { font-size: 0.75rem; }
.user-history-table th,
.user-history-table td { padding: 0.35rem 0.5rem; white-space: nowrap; }
.user-history-table td:nth-child(5) { white-space: nowrap; }
.user-history-empty,
.user-basket-empty {
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 0.5rem 0;
}
.user-modal-basket-content {
    flex: 1;
    overflow: auto;
    min-height: 0;
}
.user-basket-table-wrap {
    overflow-x: auto;
    margin-bottom: 0.75rem;
}
.user-basket-table { font-size: 0.85rem; }
.user-basket-table th,
.user-basket-table td { padding: 0.45rem 0.6rem; white-space: nowrap; }
.user-basket-table td:nth-child(2) { white-space: normal; max-width: 320px; }
.user-basket-table .btn-danger { padding: 0.3rem 0.65rem; font-size: 0.8rem; }
.history-type {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}
.history-type.type-topup { background: rgba(33, 150, 243, 0.2); color: #64b5f6; }
.history-type.type-purchase { background: rgba(156, 39, 176, 0.2); color: #ce93d8; }
.history-type.type-admin { background: rgba(255, 193, 7, 0.2); color: #ffca28; }

/* ——— Мониторинг сервера: список + модалка ——— */
.server-section .card-body { display: flex; flex-direction: column; gap: 1.25rem; }
.server-list-wrap { overflow-x: auto; }
.server-table { width: 100%; border-collapse: collapse; }
.server-table th, .server-table td { padding: 0.65rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
.server-table th { color: var(--text-muted); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.server-table .server-name { font-weight: 500; }
.server-table code { font-size: 0.85rem; background: rgba(255,255,255,0.06); padding: 0.25rem 0.5rem; border-radius: 4px; }
.server-table .th-actions, .server-table .td-actions { width: 1%; white-space: nowrap; text-align: right; }
.server-table .td-actions .btn { padding: 0.4rem 0.6rem; margin-left: 0.25rem; }
.server-table .td-actions .btn i { font-size: 0.85rem; }
.server-empty { color: var(--text-muted); padding: 1.5rem; text-align: center; }
.server-actions .server-add-btn { display: inline-flex; align-items: center; gap: 0.5rem; }
.server-extra { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.server-wipe-form { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.server-wipe-label { margin: 0; font-size: 0.9rem; color: var(--text-muted); }
.server-wipe-input { width: 140px; margin: 0; padding: 0.4rem 0.6rem; }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.85rem; }

.server-modal {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
    opacity: 0; visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}
.server-modal.open { opacity: 1; visibility: visible; }
.server-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer;
}
.server-modal-box {
    position: relative;
    width: 100%;
    max-width: 720px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    overflow: hidden;
}
.server-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.server-modal-title { margin: 0; font-size: 1.1rem; font-weight: 700; color: var(--accent); }
.server-modal-close {
    width: 36px; height: 36px; padding: 0; border: none;
    background: transparent; color: var(--text-muted);
    cursor: pointer; font-size: 1.5rem; line-height: 1;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}
.server-modal-close:hover { color: var(--text); background: rgba(255,255,255,0.08); }
.server-modal-form { padding: 1.25rem 1.5rem 1.5rem; }
.server-modal-fields {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 0.6rem 1.25rem;
    align-items: center;
    margin-bottom: 0.75rem;
}
.server-modal-fields label {
    margin: 0; font-size: 0.9rem; color: var(--text-muted);
}
.server-modal-fields input {
    margin: 0; padding: 0.5rem 0.65rem;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: 6px; color: var(--text);
    font-size: 0.95rem;
}
.server-modal-fields input:focus {
    outline: none; border-color: var(--border-focus);
}
.server-modal-hint {
    margin: 0 0 1rem 0; font-size: 0.8rem; color: var(--text-muted); line-height: 1.4;
}
.server-modal-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.server-modal-actions .btn-accent { display: inline-flex; align-items: center; gap: 0.4rem; }
.server-modal-cancel { background: rgba(255,255,255,0.08); color: var(--text-muted); }
.server-modal-cancel:hover { background: rgba(255,255,255,0.12); color: var(--text); }

/* ——— Магазин: список товаров + модалки ——— */
.shop-section .card-body { display: flex; flex-direction: column; gap: 1.25rem; }
.admin-shop-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.admin-shop-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 260px;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: rgba(13, 17, 23, 0.9);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.admin-shop-tab:hover {
    border-color: rgba(242, 192, 52, 0.6);
    color: var(--text);
}
.admin-shop-tab--active {
    background: rgba(242, 192, 52, 0.16);
    border-color: rgba(242, 192, 52, 0.85);
    color: #f2c034;
    box-shadow: 0 0 0 2px rgba(242, 192, 52, 0.18);
}
.shop-list-wrap { overflow-x: auto; }
.shop-table { width: 100%; border-collapse: collapse; }
.shop-table tr:hover td { background: transparent; }
.shop-table th, .shop-table td { padding: 0.65rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.shop-table th { color: var(--text-muted); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.shop-table .th-id { width: 56px; text-align: center; }
.shop-table .th-check { width: 42px; text-align: center; }
.shop-check-cell { text-align: center; width: 42px; }
.shop-table .shop-id-cell { text-align: center; color: var(--text-muted); font-variant-numeric: tabular-nums; font-weight: 500; }
.shop-table .th-thumb { width: 64px; }
.shop-table .th-actions, .shop-table .td-actions { width: 1%; white-space: nowrap; text-align: right; }
.shop-thumb { width: 64px; }
.shop-thumb img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; display: block; background: var(--bg-input); }
.shop-noimg { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; background: var(--bg-input); border-radius: 6px; color: var(--text-muted); font-size: 1.2rem; }
.shop-name-link { background: none !important; border: none; color: var(--text); cursor: pointer; padding: 0; font-size: inherit; font-weight: 600; text-align: left; text-decoration: none; }
.shop-name-link:hover,
.shop-name-link:focus { background: none !important; color: #e74c3c; outline: none; }
.shop-price-cell { font-weight: 500; white-space: nowrap; }
.currency-coin-icon { height: 1.1em; width: auto; vertical-align: middle; margin: 0 2px; }
.shop-table .td-actions .btn { padding: 0.4rem 0.6rem; margin-left: 0.25rem; }
.admin-pagination { margin-top: 1rem; }
.admin-pagination-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.admin-pagination-info { font-size: 0.9rem; color: var(--text-muted); }
.shop-empty { color: var(--text-muted); padding: 1.5rem; text-align: center; }
.shop-actions .shop-add-btn { display: inline-flex; align-items: center; gap: 0.5rem; }
.shop-bulk-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(13, 17, 23, 0.75);
}
.shop-bulk-check-all,
.shop-bulk-filter-all {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-muted);
    font-size: 0.88rem;
}
.shop-bulk-select {
    min-width: 220px;
    padding: 0.45rem 0.65rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.9rem;
}

.shop-item-modal .shop-preview-box { max-width: 520px; }
.shop-preview-body { display: flex; gap: 1.25rem; padding: 1rem 1.25rem; align-items: flex-start; }
.shop-preview-image { flex-shrink: 0; width: 200px; min-height: 200px; border-radius: 8px; overflow: hidden; background: var(--bg-input); display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); }
.shop-preview-image img { max-width: 100%; max-height: 200px; object-fit: contain; }
.shop-preview-image .shop-noimg { width: 200px; height: 200px; font-size: 2rem; }
.shop-preview-info { flex: 1; min-width: 0; }
.shop-preview-title { margin: 0 0 0.5rem 0; font-size: 1.2rem; font-weight: 700; color: var(--accent); }
.shop-preview-price { font-size: 1.1rem; font-weight: 600; color: var(--text); }
.shop-preview-desc { padding: 0 1.25rem 1.25rem; font-size: 0.9rem; line-height: 1.5; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 1rem; margin-top: 0; }
.shop-preview-desc p { margin: 0 0 0.5rem 0; }
.shop-preview-desc p.muted { color: var(--text-muted); font-style: italic; }

.shop-form-desc-wrap { margin-bottom: 0.75rem; }
.shop-form-desc-wrap label { display: block; margin-bottom: 0.25rem; font-size: 0.9rem; color: var(--text-muted); }
.shop-form-desc-wrap textarea { width: 100%; min-height: 72px; padding: 0.5rem 0.65rem; background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 0.95rem; resize: vertical; }
.shop-form-desc-wrap textarea:focus { outline: none; border-color: var(--border-focus); }

/* Модалка добавления/редактирования товара — шире, слева картинка */
.shop-form-modal .shop-form-modal-box {
    max-width: 1000px;
    width: 96%;
    max-height: 90vh;
    overflow-y: auto;
}
.shop-form-layout {
    display: flex;
    gap: 2rem;
    padding: 1.25rem;
    align-items: flex-start;
}
.shop-form-left {
    flex-shrink: 0;
    width: 280px;
}
.shop-form-preview-wrap {
    margin-bottom: 1rem;
}
.shop-form-preview {
    width: 260px;
    height: 260px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-input);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}
.shop-form-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.shop-form-noimg {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.shop-form-upload-btn {
    display: block;
    margin-bottom: 0.5rem;
    cursor: pointer;
}
.shop-form-upload-btn .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    justify-content: center;
    padding: 0.6rem 1rem;
}
.shop-form-upload-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0 0 0.35rem 0;
}
.shop-form-url-input {
    width: 100%;
    padding: 0.45rem 0.6rem;
    font-size: 0.85rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
}
.shop-form-url-input:focus { outline: none; border-color: var(--border-focus); }
.shop-form-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.shop-form-right .server-modal-fields select[name="server_id"] {
    width: 100%;
    max-width: 480px;
    padding: 0.45rem 0.65rem;
    margin: 0;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.95rem;
}
.shop-form-right .server-modal-fields select[name="server_id"]:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(242, 192, 52, 0.2);
}
.shop-form-right .shop-form-desc-wrap textarea {
    min-height: 240px;
    resize: vertical;
    font-size: 0.95rem;
    line-height: 1.5;
}
.shop-form-right .shop-form-desc-wrap textarea.shop-form-commands {
    min-height: 0;
    height: auto;
    resize: vertical;
}
.shop-form-right .server-modal-actions {
    margin-top: 0.5rem;
}

/* ——— Транзакции: фильтры и пагинация ——— */
.transactions-filters { margin-bottom: 1.25rem; }
.transactions-filters .filters-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.transactions-filters .filter-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.transactions-filters .filter-select {
    min-width: 160px;
    padding: 0.45rem 0.65rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.95rem;
}
.transactions-filters .filter-input {
    min-width: 180px;
    padding: 0.45rem 0.65rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.95rem;
}
.transactions-filters .filter-input:focus,
.transactions-filters .filter-select:focus {
    outline: none;
    border-color: var(--border-focus);
}
.transactions-table-wrap { margin-top: 0.5rem; }
.transactions-table .tx-desc { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-nick-link.btn-link {
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    color: var(--accent);
    cursor: pointer;
    text-decoration: none;
}
.tx-nick-link.btn-link:hover,
.tx-nick-link.btn-link:focus { text-decoration: underline; color: #f16b7c; outline: none; }
.pagination-wrap {
    margin-top: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.pagination { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 0.25rem; }
.pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); background: rgba(233, 69, 96, 0.08); }
.pagination a.active { background: var(--accent); border-color: var(--accent); color: #fff; pointer-events: none; }
.pagination-info { font-size: 0.9rem; color: var(--text-muted); }
.transactions-orders-block { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.transactions-orders-block .card-subtitle { margin-bottom: 0.75rem; font-size: 1rem; }

/* ——— Адаптив: сайдбар в колонку на узких экранах ——— */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        min-width: 100%;
        height: auto;
        position: relative;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
    }
    .sidebar-brand { border-bottom: none; padding: 0.75rem 1rem; }
    .sidebar-nav {
        display: flex;
        flex: 1;
        flex-wrap: wrap;
        gap: 0.25rem;
        padding: 0.5rem 1rem;
    }
    .sidebar-nav .nav-item { padding: 0.4rem 0.6rem; }
    .sidebar-footer {
        display: flex;
        border-top: none;
        padding: 0.5rem 1rem;
    }
    .main-wrap { margin-left: 0; }
}
