/* Файл: frontend/static/css/seller/seller.css */
/* Панель продавца Road Market — единая стилистика с админ-панелью + улучшения читаемости и удобства */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
    --bg-main: rgb(24, 24, 24);
    --bg-tile: rgba(255, 255, 255, 0.06);
    --bg-tile-elevated: rgba(255, 255, 255, 0.085);
    --bg-input: rgba(255, 255, 255, 0.05);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-tile: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.22);
    --text-main: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.65);
    --text-muted: rgba(255, 255, 255, 0.42);
    --accent: #ff4e50;
    --accent-hover: #ff3335;
    --accent-soft: rgba(255, 78, 80, 0.14);
    --green: #4ade80;
    --green-soft: rgba(74, 222, 128, 0.14);
    --amber: #fbbf24;
    --amber-soft: rgba(245, 158, 11, 0.14);
    --blue: #60a5fa;
    --blue-soft: rgba(59, 130, 246, 0.14);
    --red: #f87171;
    --red-soft: rgba(248, 113, 113, 0.15);
}

* {
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    min-height: 100vh;
    color: var(--text-main);
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Фоновый водяной знак как в админ-панели */
body::before {
    content: "ROAD";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28vw;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.025);
    z-index: -1;
    pointer-events: none;
    user-select: none;
}

/* Основная сетка: сайдбар + контент */
.admin-wrapper {
    display: grid;
    grid-template-columns: 270px 1fr;
    min-height: 100vh;
}

/* ============================================================
   САЙДБАР
   ============================================================ */
.sidebar {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 50;
}

.sidebar-header .logo {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 0 10px 18px 10px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header .logo a {
    color: #fff;
    text-decoration: none;
}

.sidebar-header .logo span {
    color: var(--accent);
    font-size: 11px;
    vertical-align: super;
    margin-left: 4px;
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--accent-soft);
    border: 1px solid rgba(255, 78, 80, 0.3);
}

/* Мини-карточка магазина в сайдбаре */
.sidebar-shop-card {
    margin-top: 14px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-shop-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-shop-logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 78, 80, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-shop-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-shop-meta {
    min-width: 0;
    flex: 1;
}

.sidebar-shop-name {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-shop-status {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.sidebar-shop-balances {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-mini-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-mini-stat small {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
}

.sidebar-mini-stat strong {
    font-size: 12px;
    font-weight: 700;
    color: var(--green);
}

.sidebar-mini-stat.hold strong {
    color: var(--blue);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 16px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.nav-item.active {
    background: rgba(255, 78, 80, 0.14);
    color: #fff;
    border-color: rgba(255, 78, 80, 0.35);
    font-weight: 600;
}

.nav-item img,
.nav-item svg {
    width: 19px;
    height: 19px;
    object-fit: contain;
    flex-shrink: 0;
    opacity: 0.88;
}

.nav-item.active img,
.nav-item.active svg {
    opacity: 1;
}

.nav-badge {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(255, 78, 80, 0.22);
    color: #ff8587;
    border: 1px solid rgba(255, 78, 80, 0.35);
}

.nav-badge.warn {
    background: var(--amber-soft);
    color: var(--amber);
    border-color: rgba(245, 158, 11, 0.35);
}

.sidebar-footer {
    border-top: 1px solid var(--border-subtle);
    padding-top: 14px;
    margin-top: 14px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 11px;
}

.user-profile .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.user-profile-info {
    min-width: 0;
    flex: 1;
}

.user-profile-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.user-profile-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* ============================================================
   КОНТЕНТНАЯ ЗОНА И ШАПКА
   ============================================================ */
.main-content {
    padding: 30px 32px 60px;
    max-width: 1260px;
    width: 100%;
    margin: 0 auto;
}

.seller-mobile-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 18px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(18px);
    border: 1px solid var(--border-tile);
    border-radius: 16px;
}

.seller-mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 16px;
    text-decoration: none;
    color: #fff;
}

.seller-mobile-brand span {
    color: var(--accent);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--accent-soft);
}

.seller-banned-banner {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    margin-bottom: 22px;
    border-radius: 16px;
    background: rgba(220, 53, 69, 0.14);
    border: 1px solid rgba(248, 113, 113, 0.4);
    color: #fecaca;
    font-size: 13.5px;
}

.seller-banned-banner.visible {
    display: flex;
}

.admin-page-header {
    margin-bottom: 24px;
}

.admin-page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.admin-page-title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.admin-page-subtitle {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 13.5px;
    line-height: 1.45;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 12px;
    transition: color 0.2s;
}

.btn-back:hover {
    color: var(--accent);
}

.header-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.header-title-row h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
}

/* ============================================================
   КАРТОЧКИ, ПЛИТКИ (TILES) И СЕТКИ
   ============================================================ */
.tile {
    background: var(--bg-tile);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border-tile);
    border-radius: 24px;
    padding: 26px 28px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.14);
    margin-bottom: 24px;
}

.tile-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.tile-title h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
}

.admin-grid-2 {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 24px;
    align-items: start;
}

.admin-grid-equal {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.dashboard-overview-grid {
    display: grid;
    grid-template-columns: minmax(390px, 0.9fr) minmax(0, 1.35fr);
    gap: 24px;
    align-items: stretch;
    margin-bottom: 24px;
}

.dashboard-overview-grid > .tile,
.dashboard-overview-grid > .stat-grid {
    margin-bottom: 0;
}

.dashboard-stats-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    align-content: stretch;
}

.tile-caption {
    color: var(--text-muted);
    font-size: 11.5px;
    line-height: 1.4;
    margin-top: 5px;
    max-width: 330px;
}

.finance-overview-tile {
    min-height: 280px;
}

.finance-overview-content {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 26px;
    align-items: center;
}

.finance-donut-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.finance-donut {
    width: 164px;
    height: 164px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: conic-gradient(var(--green) 0 var(--available), var(--blue) var(--available) 100%);
    box-shadow: 0 0 30px rgba(74, 222, 128, 0.11);
    position: relative;
}

.finance-donut::after {
    content: "";
    position: absolute;
    inset: 14px;
    border-radius: 50%;
    background: #202024;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.finance-donut-center {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    max-width: 110px;
    text-align: center;
}

.finance-donut-center strong {
    font-size: 16px;
    line-height: 1.2;
}

.finance-donut-center span,
.finance-donut-caption {
    color: var(--text-muted);
    font-size: 11px;
}

.finance-breakdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.finance-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 38px;
    gap: 8px;
    align-items: center;
    font-size: 12.5px;
}

.finance-line > span {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.finance-line strong {
    font-size: 14px;
    white-space: nowrap;
}

.finance-line small {
    color: var(--text-muted);
    text-align: right;
}

.finance-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.finance-dot.available { background: var(--green); box-shadow: 0 0 8px rgba(74, 222, 128, .45); }
.finance-dot.hold { background: var(--blue); box-shadow: 0 0 8px rgba(96, 165, 250, .45); }

.finance-progress {
    height: 7px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--blue);
    margin-bottom: 3px;
}

.finance-progress span {
    display: block;
    height: 100%;
    background: var(--green);
    border-radius: inherit;
}

.finance-extra {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    padding-top: 11px;
    border-top: 1px solid var(--border-subtle);
}

.finance-extra div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.finance-extra div span {
    color: var(--text-muted);
    font-size: 11px;
}

.finance-extra div strong {
    font-size: 13px;
}

.finance-extra .btn-primary {
    grid-column: 1 / -1;
    justify-self: start;
    margin-top: 3px;
    padding: 8px 13px;
    font-size: 12px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

/* Витринная карточка магазина на дашборде */
.shop-hero-tile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 28px;
    background: linear-gradient(135deg, rgba(255, 78, 80, 0.12) 0%, rgba(255, 255, 255, 0.05) 60%);
    border: 1px solid rgba(255, 78, 80, 0.24);
    border-radius: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.shop-hero-left {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.shop-hero-logo {
    width: 68px;
    height: 68px;
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    overflow: hidden;
    flex-shrink: 0;
}

.shop-hero-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shop-hero-info h2 {
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.shop-hero-info p {
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 580px;
    line-height: 1.45;
}

.shop-hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============================================================
   СТАТИСТИКА (STAT CARDS)
   ============================================================ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.18);
}

.stat-card::after {
    content: "";
    position: absolute;
    inset: auto -30% -60% auto;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(255, 78, 80, 0.18), transparent 70%);
    pointer-events: none;
}

.stat-card.accent-green::after {
    background: radial-gradient(circle, rgba(74, 222, 128, 0.2), transparent 70%);
}

.stat-card.accent-blue::after {
    background: radial-gradient(circle, rgba(96, 165, 250, 0.2), transparent 70%);
}

.stat-label {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(255, 255, 255, 0.48);
    margin-bottom: 10px;
    font-weight: 600;
}

.stat-value {
    font-size: 25px;
    font-weight: 700;
    line-height: 1.15;
}

.stat-value.small {
    font-size: 20px;
}

.stat-value.money-green {
    color: var(--green);
}

.stat-value.money-blue {
    color: var(--blue);
}

.stat-sub {
    margin-top: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.35;
}

.stat-sub .positive { color: var(--green); font-weight: 600; }
.stat-sub .negative { color: var(--red); font-weight: 600; }
.stat-sub .warning  { color: var(--amber); font-weight: 600; }

/* Быстрые ссылки и фильтр-табы (чипсы) */
.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.quick-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.quick-link:hover,
.quick-link.active {
    background: rgba(255, 78, 80, 0.16);
    border-color: rgba(255, 78, 80, 0.45);
    color: #fff;
    transform: translateY(-1px);
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.filter-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.72);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s ease;
}

.filter-pill:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
}

.filter-pill.active {
    background: rgba(255, 78, 80, 0.18);
    border-color: rgba(255, 78, 80, 0.5);
    color: #fff;
}

.filter-pill .pill-count {
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
}

/* ============================================================
   КНОПКИ И БЕЙДЖИ
   ============================================================ */
.btn-primary {
    background: var(--accent);
    color: #fff;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.2s;
    white-space: nowrap;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(255, 78, 80, 0.28);
}

.btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.88);
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: 0.2s;
    white-space: nowrap;
}

.btn-outline:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}

.btn-outline:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.btn-danger-outline {
    border-color: rgba(248, 113, 113, 0.42);
    color: var(--red);
}

.btn-danger-outline:hover:not(:disabled) {
    background: rgba(248, 113, 113, 0.14);
    border-color: rgba(248, 113, 113, 0.65);
    color: #fecaca;
}

.btn-success-outline {
    border-color: rgba(74, 222, 128, 0.4);
    color: var(--green);
}

.btn-success-outline:hover:not(:disabled) {
    background: rgba(74, 222, 128, 0.14);
    border-color: rgba(74, 222, 128, 0.65);
    color: #bbf7d0;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.badge-success {
    background: rgba(40, 167, 69, 0.16);
    color: var(--green);
    border: 1px solid rgba(40, 167, 69, 0.32);
}

.badge-danger {
    background: rgba(220, 53, 69, 0.16);
    color: var(--red);
    border: 1px solid rgba(220, 53, 69, 0.32);
}

.badge-warning {
    background: var(--amber-soft);
    color: var(--amber);
    border: 1px solid rgba(245, 158, 11, 0.32);
}

.badge-info {
    background: var(--blue-soft);
    color: var(--blue);
    border: 1px solid rgba(59, 130, 246, 0.32);
}

.badge-neutral {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

/* ============================================================
   ТАБЛИЦЫ И СПИСКИ
   ============================================================ */
.table-container {
    overflow-x: auto;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    color: #fff;
    font-size: 13.5px;
}

.admin-table th {
    text-align: left;
    padding: 15px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.48);
    font-weight: 600;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.22);
}

.admin-table td {
    padding: 15px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
    transition: background 0.18s ease;
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.035);
}

.cell-flex {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-logo {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.table-link {
    color: #ff8082;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s;
}

.table-link:hover {
    color: #ffa3a5;
    text-decoration: underline;
}

.text-muted {
    color: var(--text-muted);
}

.mono-id {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.48);
}

.table-placeholder {
    padding: 36px 18px;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 13.5px;
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 16px;
    margin-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
    flex-wrap: wrap;
}

/* ============================================================
   ФОРМЫ И ПОЛЯ ВВОДА
   ============================================================ */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 18px;
}

.toolbar .form-control {
    width: auto;
    min-width: 165px;
    padding: 10px 13px;
}

.toolbar .form-control.grow {
    flex: 1;
    min-width: 220px;
}

.form-tile h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 17px;
    font-weight: 600;
    color: #fff;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 14px;
}

.admin-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.admin-form label {
    font-size: 12.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.68);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.form-hint {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.4;
}

.form-control {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    font-family: inherit;
    transition: all 0.2s ease;
}

select.form-control option {
    background-color: #1e1e22;
    color: #fff;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.26);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    background-color: rgba(0, 0, 0, 0.28);
    box-shadow: 0 0 0 3px rgba(255, 78, 80, 0.12);
}

textarea.form-control {
    resize: vertical;
    min-height: 92px;
    line-height: 1.5;
}

.form-group-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; }
.mt-4 { margin-top: 26px; }

.amount-input {
    font-size: 16px;
    font-weight: 700;
    color: var(--green);
}

.separator {
    height: 1px;
    background: var(--border-subtle);
    margin: 22px 0;
}

/* Загрузка картинок и логотипа */
.shop-branding-edit {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.logo-preview {
    width: 108px;
    height: 108px;
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.38);
    border: 1px dashed rgba(255, 255, 255, 0.22);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    cursor: pointer;
    transition: border-color 0.2s;
}

.logo-preview:hover {
    border-color: var(--accent);
}

.logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.logo-preview-placeholder {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    padding: 8px;
}

.branding-inputs {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.upload-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* Переключатель (Switch) */
.toggle-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.04);
    padding: 15px 18px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toggle-group.webhook-toggle {
    background: rgba(40, 167, 69, 0.06);
    border-color: rgba(74, 222, 128, 0.22);
}

.toggle-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toggle-title {
    font-weight: 600;
    font-size: 14px;
    color: #fff;
}

.toggle-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.12);
    transition: 0.25s;
    border-radius: 34px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.25s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent);
    border-color: var(--accent);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

/* Конструктор пар ключ-значение (Характеристики / Поля покупателя) */
.kv-builder-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kv-builder-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
    align-items: center;
}

/* ============================================================
   ТАБЫ, ДЕТАЛИ, ГИСТОГРАММА, ТОСТЫ И МОДАЛКИ
   ============================================================ */
.tabs-tile {
    padding: 0;
    overflow: hidden;
}

.admin-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.24);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    overflow-x: auto;
}

.tab-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.52);
    padding: 16px 26px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover { color: #fff; }
.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: rgba(255, 78, 80, 0.06);
}

.tab-content {
    display: none;
    padding: 24px;
}

.tab-content.active {
    display: block;
}

.kv-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 13.5px;
}

.kv-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.kv-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.kv-row span:first-child {
    color: var(--text-muted);
    flex-shrink: 0;
}

.kv-row span:last-child {
    text-align: right;
    word-break: break-word;
}

.pre-json {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 220px;
    overflow: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: #e2e8f0;
}

/* Гистограмма как в админке */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 220px;
    padding-top: 20px;
    padding-bottom: 8px;
    overflow-x: auto;
}

.bar-chart-item {
    flex: 1;
    min-width: 22px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
}

.bar-chart-value {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
}

.bar-chart-track {
    width: 100%;
    flex: 1;
    display: flex;
    align-items: flex-end;
    background: rgba(255, 255, 255, 0.035);
    border-radius: 6px;
    overflow: hidden;
}

.bar-chart-bar {
    width: 100%;
    background: linear-gradient(180deg, #ff6b6d, #ff4e50);
    border-radius: 6px 6px 0 0;
    min-height: 2px;
    transition: height 0.3s ease;
}

.bar-chart.green .bar-chart-bar {
    background: linear-gradient(180deg, #6ee7b7, #4ade80);
}

.bar-chart-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.38);
    white-space: nowrap;
    transform: rotate(-35deg);
    transform-origin: center;
}

.review-icon { font-size: 16px; }
.review-icon.positive { color: var(--green); }
.review-icon.negative { color: var(--red); }

/* Прогресс-полоса рейтинга */
.rating-meter {
    height: 10px;
    border-radius: 999px;
    background: rgba(248, 113, 113, 0.25);
    overflow: hidden;
    margin-top: 10px;
}

.rating-meter-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ade80, #22c55e);
    border-radius: 999px;
    transition: width 0.35s ease;
}

/* Тосты */
.admin-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    background: rgba(22, 22, 26, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    padding: 14px 20px;
    color: #fff;
    font-size: 13.5px;
    font-weight: 500;
    max-width: 380px;
    opacity: 0;
    transform: translateY(10px);
    transition: 0.25s;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}

.admin-toast.visible { opacity: 1; transform: translateY(0); }
.admin-toast-success { border-color: rgba(74, 222, 128, 0.45); }
.admin-toast-error   { border-color: rgba(248, 113, 113, 0.55); }

/* Модалка */
.admin-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.68);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.admin-modal.open { display: flex; }

.admin-modal-card {
    width: 100%;
    max-width: 500px;
    background: #1d1d21;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 22px;
    padding: 26px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

.admin-modal-card h3 {
    margin: 0 0 16px;
    font-size: 18px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* ============================================================
   НИЖНЯЯ НАВИГАЦИЯ НА МОБИЛЬНЫХ / TELEGRAM MINI APP
   ============================================================ */
.seller-bottom-nav {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    background: rgba(20, 20, 24, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    justify-content: space-around;
    align-items: center;
}

.seller-bottom-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: rgba(255, 255, 255, 0.52);
    text-decoration: none;
    font-size: 10.5px;
    font-weight: 600;
    padding: 6px 8px;
    border-radius: 10px;
    position: relative;
}

.seller-bottom-link img {
    width: 20px;
    height: 20px;
    opacity: 0.65;
}

.seller-bottom-link.active {
    color: var(--accent);
}

.seller-bottom-link.active img {
    opacity: 1;
}

/* ============================================================
   АДАПТИВНОСТЬ (MOBILE & TABLET)
   ============================================================ */
@media (max-width: 960px) {
    .admin-wrapper {
        grid-template-columns: 1fr;
    }
    .sidebar {
        display: none;
    }
    .seller-mobile-bar {
        display: flex;
    }
    .seller-bottom-nav {
        display: flex;
    }
    .main-content {
        padding: calc(18px + env(safe-area-inset-top, 0px)) 16px calc(96px + env(safe-area-inset-bottom, 0px));
    }
    .admin-grid-2,
    .admin-grid-equal,
    .dashboard-overview-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-overview-grid > .stat-grid {
        margin-bottom: 0;
    }
}

@media (max-width: 680px) {
    .tile {
        padding: 18px;
        border-radius: 18px;
    }
    .shop-hero-tile {
        padding: 18px;
    }
    .form-group-row {
        grid-template-columns: 1fr;
    }
    .shop-branding-edit {
        flex-direction: column;
    }
    .admin-page-title {
        font-size: 22px;
    }
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .stat-value {
        font-size: 20px;
    }

    .finance-overview-content {
        grid-template-columns: 1fr;
    }

    .finance-donut-wrap {
        flex-direction: row;
        justify-content: center;
    }

    .finance-donut-caption {
        max-width: 70px;
    }
    .bar-chart-value {
        display: none;
    }
    .bar-chart-label {
        transform: rotate(-55deg);
    }
}

/* ============================================================
   ТАБЛИЦЫ → КАРТОЧКИ НА МОБИЛЬНЫХ / TELEGRAM MINI APP
   ============================================================ */
@media (max-width: 680px) {
    .table-container {
        background: transparent;
        border: none;
        border-radius: 0;
        overflow: visible;
    }

    .admin-table,
    .admin-table tbody {
        display: block;
        width: 100%;
    }

    .admin-table thead {
        display: none;
    }

    .admin-table tr {
        display: block;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 16px;
        margin-bottom: 12px;
        padding: 4px 0;
        overflow: hidden;
    }

    .admin-table tbody tr:hover td {
        background: transparent;
    }

    .admin-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        padding: 10px 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        text-align: right;
    }

    .admin-table td:last-child {
        border-bottom: none;
    }

    .admin-table td::before {
        content: attr(data-label);
        flex-shrink: 0;
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: rgba(255, 255, 255, 0.45);
        text-align: left;
    }

    .admin-table td:not([data-label])::before,
    .admin-table td[data-label=""]::before {
        content: none;
    }

    /* Ячейка-действие: кнопки на всю ширину карточки */
    .admin-table td[data-label=""] {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 12px 16px;
    }
    .admin-table td[data-label=""] .btn-outline,
    .admin-table td[data-label=""] .btn-primary {
        width: 100%;
        justify-content: center;
    }
    .admin-table td[data-label=""] > div {
        display: flex;
        gap: 8px;
        width: 100%;
    }
    .admin-table td[data-label=""] > div .btn-outline,
    .admin-table td[data-label=""] > div .btn-primary {
        flex: 1;
        width: auto;
    }

    /* Пустая строка / состояние загрузки */
    .admin-table td[colspan] {
        display: block;
        text-align: center;
        padding: 24px 16px;
    }
    .admin-table td[colspan] .table-placeholder {
        padding: 0;
    }
}
