/* ═══════════════ STATS ═══════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
    width: 100%;
}
.stat-card {
    background: var(--bg-surface);
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    min-width: 0;
}
.stat-card h3 {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.3;
}
.stat-card .stat-value {
    font-family: var(--font-body);
    font-size: 32px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.05;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1, "lnum" 1;
}

/* ═══════════════ PAGES ═══════════════ */
.pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
    min-width: 0;
}
.page-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: var(--transition);
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}
.page-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}
.page-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(var(--accent-rgb), 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}
.page-card-body { flex-grow: 1; min-width: 0; }
.page-card-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 4px;
    overflow-wrap: break-word;
    line-height: 1.4;
}
.page-card-id {
    font-size: 13px;
    color: var(--text-muted);
    font-family: monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.page-card-arrow {
    font-size: 22px;
    color: var(--text-muted);
    flex-shrink: 0;
}
.page-card:hover .page-card-arrow {
    color: var(--accent);
    transform: translateX(4px);
}

/* ═══════════════ HASHTAGS ADMIN ═══════════════ */
.hashtags-admin-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}
.hashtag-admin-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: border-color 0.2s ease;
}
.hashtag-admin-card:hover { border-color: var(--border); }
.hashtag-admin-card-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.hashtag-admin-card-tag {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.hashtag-admin-card-count {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    flex-shrink: 0;
}
.hashtag-admin-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.admin-product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
}
.admin-product-tag {
    font-size: 11px;
    font-weight: 500;
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
    padding: 2px 7px;
    border-radius: 4px;
    line-height: 1.3;
}

/* ═══════════════ ORDERS ═══════════════ */
.orders-list,
.promocodes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.order-card,
.promocode-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    transition: border-color 0.2s ease;
}
.order-card:hover,
.promocode-card:hover { border-color: var(--border); }
.order-card-main,
.promocode-card-main {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.order-card-id {
    font-family: monospace;
    color: var(--text-muted);
    font-size: 13px;
}
.order-card-name {
    font-size: 16px;
    font-weight: 600;
    margin: 2px 0;
    color: var(--text-main);
    word-break: break-word;
}
.order-card-meta {
    font-size: 13px;
    color: var(--text-muted);
    word-break: break-word;
}
.order-card-side { text-align: right; flex-shrink: 0; }
.order-card-total {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
}
.order-card-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}
.order-card-promo {
    font-size: 11px;
    color: var(--accent);
    margin-top: 4px;
    background: rgba(var(--accent-rgb), 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}
.order-card-actions { margin-top: 12px; }
.order-status-select {
    padding: 8px 36px 8px 12px;
    font-size: 14px;
    max-width: 200px;
}

.promocode-card-code {
    font-family: monospace;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0.04em;
    word-break: break-word;
}
.promocode-card-value {
    color: var(--accent);
    font-weight: 600;
    font-size: 14px;
    margin-top: 2px;
}
.promocode-card-meta {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
}
.promocode-card.inactive { opacity: 0.55; }
.promocode-card-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.promocode-card-actions .btn-action {
    padding: 8px 14px;
    min-height: 36px;
    font-size: 13px;
}

/* ═══════════════ ADMIN CATEGORIES LIST ═══════════════ */
.admin-categories-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    flex-wrap: wrap;
    min-width: 0;
}
.category-item.category-parent {
    border-left: 3px solid var(--accent);
}
.category-main { min-width: 0; flex: 1; }
.category-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
    word-break: break-word;
}
.category-meta {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    word-break: break-word;
}
.category-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.category-actions .btn-action {
    padding: 8px 14px;
    min-height: 36px;
    font-size: 13px;
}

.category-children {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 24px;
    border-left: 1px dashed var(--border);
    margin-left: 12px;
    margin-top: 4px;
}
.category-item.category-child {
    padding: 11px 16px;
    background: var(--bg-input);
}
.category-item.category-child .category-title {
    font-size: 14px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .category-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .category-actions { width: 100%; }
    .category-actions .btn-action { flex: 1; }
    .category-children { padding-left: 14px; margin-left: 6px; }
}

/* ═══════════════ PERSONALIZATION ═══════════════ */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}
.color-picker-input {
    width: 56px;
    height: 48px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-input);
    cursor: pointer;
    flex-shrink: 0;
}
.color-picker-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-picker-input::-webkit-color-swatch {
    border: none;
    border-radius: 8px;
}
.color-picker-input::-moz-color-swatch {
    border: none;
    border-radius: 8px;
}
.color-picker-hex {
    flex: 1;
    text-transform: uppercase;
    font-family: monospace;
    letter-spacing: 0.05em;
}

.pers-preview-card {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}
.pers-preview-color {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: var(--accent);
    flex-shrink: 0;
    transition: background 0.1s linear;
}
.pers-preview-hex {
    font-family: monospace;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: 0.05em;
}

.pers-preview-demo {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 16px;
}
.pers-preview-demo-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.pers-preview-btn {
    padding: 12px 28px;
    background: var(--accent);
    color: var(--white-on-accent);
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    transition: background 0.1s linear;
}

.pers-preview-checkout {
    padding: 12px 28px;
    background: var(--accent);
    color: var(--white-on-accent);
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    transition: background 0.1s linear;
}

.pers-preview-badge {
    padding: 4px 12px;
    background: var(--accent);
    color: var(--white-on-accent);
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background 0.1s linear;
}

.pers-preview-price {
    font-size: 20px;
    font-weight: 600;
    color: var(--accent);
    font-family: var(--font-body);
    transition: color 0.1s linear;
}

.pers-preview-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    transition: background 0.1s linear;
    flex-shrink: 0;
}

.pers-preview-link {
    color: var(--accent);
    font-size: 14px;
    font-weight: 500;
    text-decoration: underline;
    transition: color 0.1s linear;
    cursor: pointer;
}

/* ═══════════════ HOME SECTIONS (admin) ═══════════════ */
.home-sections-list { display: flex; flex-direction: column; gap: 10px; }

.home-section-admin-card {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
}
.home-section-admin-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.home-section-admin-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
    word-break: break-word;
}
.home-section-admin-type {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
    border: 1px solid rgba(var(--accent-rgb), 0.25);
    border-radius: var(--radius-pill);
    padding: 2px 9px;
    margin-left: 8px;
    line-height: 1.5;
    vertical-align: middle;
}
.home-section-admin-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 3px;
    word-break: break-word;
}
.home-section-admin-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }
.home-section-admin-actions .btn-action { padding: 6px 12px; min-height: 32px; font-size: 13px; }
.home-section-admin-actions .btn-action:disabled { opacity: 0.35; cursor: not-allowed; }

.home-section-categories {
    max-height: 320px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-input);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.home-section-cat-group { display: flex; flex-direction: column; gap: 4px; }
.home-section-cat-parent { font-weight: 600; }
.home-section-children { display: flex; flex-direction: column; gap: 4px; padding-left: 26px; }
.home-section-categories .form-check { margin: 0; font-size: 14px; gap: 10px; padding: 4px 0; }

@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        width: 100%;
    }
    .stat-card {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        gap: 16px;
    }
    .stat-card h3 {
        margin-bottom: 0;
        flex: 1;
        min-width: 0;
    }
    .stat-card .stat-value {
        font-size: 26px;
        flex-shrink: 0;
    }
}

@media (max-width: 768px) {
    .pages-grid { grid-template-columns: 1fr; }
    .order-card-actions .order-status-select { max-width: 100%; width: 100%; }
    .order-card-side { text-align: left; width: 100%; }
    .promocode-card-actions { width: 100%; }
    .promocode-card-actions .btn-action { flex: 1; }
    .hashtags-admin-list { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .stat-card { padding: 14px; }
    .stat-value { font-size: 24px !important; }
}

/* ═══════════════ STORIES ADMIN ═══════════════ */
.stories-admin-list { display: flex; flex-direction: column; gap: 12px; }

.story-admin-card {
    display: flex;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    align-items: center;
}
.story-admin-card.inactive { opacity: 0.55; }

.story-admin-thumb {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-input);
    position: relative;
    border: 2px solid var(--accent);
}
.story-admin-thumb img,
.story-admin-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.story-admin-info { flex: 1; min-width: 0; }
.story-admin-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-main);
    margin-bottom: 2px;
    word-break: break-word;
}
.story-admin-meta {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    word-break: break-word;
}
.story-admin-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.story-admin-actions .btn-action {
    padding: 6px 12px;
    min-height: 32px;
    font-size: 13px;
}
.story-admin-actions .btn-action:disabled { opacity: 0.35; cursor: not-allowed; }

.story-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 8px;
    margin-top: 10px;
}
.story-preview-item {
    position: relative;
    aspect-ratio: 9 / 16;
    max-height: 140px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.story-preview-item img,
.story-preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.story-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--overlay-backdrop);
    color: var(--white-on-accent);
    font-size: 14px;
    line-height: 1;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    transition: background 0.2s;
}
.story-preview-remove:hover { background: var(--accent); }

@media (max-width: 768px) {
    .story-admin-card { flex-direction: column; align-items: stretch; }
    .story-admin-thumb { width: 80px; height: 80px; margin: 0 auto; }
    .story-admin-actions { width: 100%; }
    .story-admin-actions .btn-action { flex: 1; }
}
/* ═══════════════ BRANCHES ADMIN ═══════════════ */
.branches-admin-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.branch-admin-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    transition: var(--transition);
}
.branch-admin-card.inactive { opacity: 0.55; }
.branch-admin-card:hover     { border-color: var(--accent); }

.branch-admin-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.branch-admin-head { flex: 1 1 auto; min-width: 0; }

.branch-admin-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
    margin-bottom: 4px;
    word-break: break-word;
}
.branch-badge-main {
    display: inline-block;
    background: rgba(var(--accent-rgb), 0.15);
    color: var(--accent);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 100px;
    margin-left: 8px;
    vertical-align: middle;
}
.branch-badge-inactive {
    display: inline-block;
    color: var(--yellow);
    font-size: 11px;
    margin-left: 8px;
    vertical-align: middle;
}
.branch-admin-address {
    font-size: 14px;
    color: var(--text-main);
    margin-bottom: 4px;
    word-break: break-word;
}
.branch-admin-meta {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    word-break: break-word;
}
.branch-map-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}
.branch-map-link:hover { text-decoration: underline; }

.branch-admin-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.branch-admin-actions .btn-action {
    padding: 6px 12px;
    min-height: 32px;
    font-size: 13px;
}
.branch-admin-actions .btn-action:disabled { opacity: 0.35; cursor: not-allowed; }

@media (max-width: 768px) {
    .branch-admin-card { padding: 14px 16px; }
    .branch-admin-actions { width: 100%; }
    .branch-admin-actions .btn-action { flex: 1; }
}