@font-face {
    font-family: "nbrb";
    src: url("/static/fonts/nbrb.woff2") format("woff2"),
         url("/static/fonts/nbrb.ttf") format("truetype"),
         url("/static/fonts/nbrb.woff") format("woff");
    unicode-range: U+E901, U+42, U+59, U+4E;
    font-display: swap;
}
.nbrb-icon {
    font-family: "nbrb", sans-serif;
    font-style: normal;
    font-weight: inherit;
}

:root {
    /* Parchment + graphite + deep moss + antique silver — the palette from the
       SilverGarden monogram itself, not a generic "organic shop" green. */
    --color-bg: #f6f4ec;
    --color-surface: #ffffff;
    --color-surface-sunken: #efece1;
    --color-text: #292a23;
    --color-muted: #6c6f61;
    --color-primary: #46593e;
    --color-primary-dark: #2e3d28;
    --color-accent: #b3bba7;
    --color-silver: #9a9d8f;
    --color-gold: #b8933f;
    --color-danger: #b3463a;
    --color-danger-bg: #f8d7d3;
    --color-danger-text: #7a2b1e;
    --color-success-bg: #dcebd6;
    --color-success-text: #2f4a2a;
    --color-border: #e3e0d2;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow-sm: 0 2px 8px rgba(38, 38, 30, 0.07);
    --shadow-md: 0 8px 26px rgba(38, 38, 30, 0.11);
    --shadow-lg: 0 20px 48px rgba(38, 38, 30, 0.16);
    --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
    --font-body: "Manrope", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.55;
}

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    text-wrap: balance;
    color: var(--color-primary-dark);
}

.price-tag, .plant-card__price, td[data-label="Цена"], td[data-label="Сумма"] {
    font-variant-numeric: tabular-nums;
}

.container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 20px;
}

a { color: var(--color-primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 24px;
    padding: 16px 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    color: var(--color-primary-dark);
    white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-text {
    font-family: var(--font-display);
    font-size: 2.6rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.05;
}
.brand-logo {
    height: 78px;
    width: 78px;
    object-fit: cover;
    border-radius: 50%;
}

.search-form {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    max-width: 520px;
    margin: 0 auto;
}
.search-form input {
    flex: 1 1 auto;
    padding: 9px 14px;
    border: 1px solid var(--color-border);
    border-right: none;
    border-radius: 999px 0 0 999px;
    font: inherit;
    min-width: 0;
}
.search-form button {
    border: 1px solid var(--color-primary);
    background: var(--color-primary);
    color: #fff;
    padding: 0 16px;
    border-radius: 0 999px 999px 0;
    cursor: pointer;
}

.search-suggestions {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    z-index: 30;
}
.search-suggestions.is-open { display: block; }
.search-suggestions__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--color-text);
}
.search-suggestions__item:hover { background: var(--color-bg); text-decoration: none; }
.search-suggestions__item img,
.search-suggestions__placeholder {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--color-accent);
    flex-shrink: 0;
}
.search-suggestions__name { flex: 1 1 auto; font-size: 0.9rem; }
.search-suggestions__price { font-size: 0.85rem; color: var(--color-muted); white-space: nowrap; }

.header-icons { display: flex; align-items: center; gap: 8px; }

.icon-link {
    position: relative;
    font-size: 1.3rem;
    line-height: 1;
    padding: 4px 8px;
    color: var(--color-primary-dark);
}
.icon-link:hover { text-decoration: none; }
.icon-badge {
    position: absolute;
    top: -4px;
    right: -2px;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    line-height: 1;
    padding: 3px 5px;
    border-radius: 999px;
}

.admin-link { display: inline-flex; align-items: center; gap: 4px; }
.nav-badge {
    display: inline-block;
    background: var(--color-danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 999px;
}

.header-auth {
    display: flex;
    align-items: center;
    gap: 14px;
    white-space: nowrap;
}
.header-auth__hello { color: var(--color-muted); font-size: 0.9rem; }

.header-subnav {
    display: flex;
    gap: 24px;
    padding: 9px 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    border-top: 1px solid var(--color-border);
}
.header-subnav a { color: var(--color-muted); }
.header-subnav a:hover { color: var(--color-primary-dark); text-decoration: none; }

.hero-bar {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 14px 20px 20px;
}

.catalog-menu {
    flex: 0 0 220px;
    position: relative;
}
.catalog-menu summary {
    list-style: none;
    cursor: pointer;
    background: var(--color-primary);
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.catalog-menu summary::-webkit-details-marker { display: none; }
.catalog-menu ul {
    list-style: none;
    margin: 6px 0 0;
    padding: 8px;
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}
.catalog-menu li a {
    display: block;
    padding: 9px 10px;
    border-radius: 6px;
    color: var(--color-text);
}
.catalog-menu li a:hover { background: var(--color-bg); text-decoration: none; }

.hero-bar__extra { flex: 1 1 auto; min-width: 0; }

.inline-form { display: inline; margin: 0; }

.link-button {
    background: none;
    border: none;
    color: var(--color-primary-dark);
    font: inherit;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
}
.link-button:hover { text-decoration: underline; }

main.container { padding-top: 30px; padding-bottom: 60px; min-height: 60vh; }

.site-footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    color: var(--color-muted);
    font-size: 0.9rem;
    padding: 30px 0 20px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}
.footer-grid strong { color: var(--color-primary-dark); }
.footer-grid p { margin: 8px 0 0; }
.footer-grid a { color: var(--color-muted); }

.subcategory-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 24px;
}
.subcategory-chip {
    padding: 7px 16px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 0.9rem;
}
.subcategory-chip:hover { text-decoration: none; border-color: var(--color-primary); }
.subcategory-chip.is-active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

/* Fills the hero banner on filtered catalog pages, where the homepage's promo
   carousel would otherwise leave an empty gap. */
.hero-popular {
    height: 100%;
    min-height: 160px;
    border-radius: var(--radius);
    background: var(--color-accent);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.hero-popular__title { font-weight: 600; color: var(--color-primary-dark); }
.hero-popular__row {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.hero-popular__item {
    flex: 0 0 84px;
    color: var(--color-text);
    font-size: 0.8rem;
    text-align: center;
}
.hero-popular__item:hover { text-decoration: none; }
.hero-popular__item img,
.hero-popular__placeholder {
    width: 84px;
    height: 84px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    margin-bottom: 6px;
}
.hero-popular__placeholder { background: linear-gradient(135deg, var(--color-accent), var(--color-primary)); }
.hero-popular__item span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.catalog-toolbar { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.sort-form { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.sort-form select { padding: 6px 10px; border-radius: 6px; border: 1px solid var(--color-border); }

.pagination { display: flex; justify-content: center; align-items: center; gap: 20px; margin: 30px 0; }
.pagination__info { color: var(--color-muted); }

.plant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 22px;
}

.plant-card {
    position: relative;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s ease;
}
.plant-card:hover { box-shadow: var(--shadow-sm); }

.plant-card__image-link { display: block; }

.plant-card__image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: var(--color-accent);
}

.plant-card__favorite { position: absolute; top: 8px; right: 8px; margin: 0; }

.plant-card__body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
    color: var(--color-text);
}
.plant-card__body:hover { text-decoration: none; }

.plant-card__name { font-weight: 600; }
.plant-card__latin { color: var(--color-muted); font-style: italic; font-size: 0.85rem; }

.plant-card__price { color: var(--color-primary-dark); font-weight: 600; }

.heart-toggle {
    background: rgba(255,255,255,0.9);
    border: 1px solid var(--color-border);
    color: var(--color-primary-dark);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.heart-toggle.is-active { color: var(--color-danger); border-color: #e3b0a3; }
.heart-toggle:hover { border-color: var(--color-silver); }
.heart-toggle--large { width: 44px; height: 44px; font-size: 1.4rem; margin-left: 12px; }

.edit-pencil {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 5;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.9);
    border: 1px solid var(--color-border);
    border-radius: 50%;
    color: var(--color-primary-dark);
    font-size: 0.95rem;
}
.edit-pencil:hover { background: var(--color-primary); color: #fff; text-decoration: none; }
.edit-pencil--large { position: static; width: 36px; height: 36px; margin-left: 8px; font-size: 1.1rem; }

.plant-info__title-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.plant-info__title-row h1 { margin: 0; overflow-wrap: anywhere; }

/* Promo carousel (in the header's hero bar, next to the catalog dropdown) */
.promo-carousel {
    position: relative;
    height: 100%;
    min-height: 160px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-accent);
}
.promo-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease;
}
.promo-slide.is-active { opacity: 1; visibility: visible; }
.promo-slide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.promo-slide__placeholder {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--color-accent), var(--color-primary));
}
.promo-slide__text {
    position: relative;
    z-index: 1;
    color: #fff;
    padding: 20px 24px;
    max-width: 60%;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.promo-slide__text h3 { color: #fff; margin: 0 0 8px; }
.promo-slide--empty .promo-slide__text { max-width: 100%; text-align: center; margin: 0 auto; }

@media (max-width: 640px) {
    .promo-carousel { min-height: 200px; }
    .promo-slide__text { max-width: 85%; padding: 14px 16px; }
    .promo-slide__text h3 { font-size: 1.05rem; }
}
.promo-dots {
    position: absolute;
    z-index: 2;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}
.promo-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.6);
    cursor: pointer;
    padding: 0;
}
.promo-dot.is-active { background: #fff; }

/* Homepage: articles (narrow) + popular products (wide) side by side */
.home-row {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    align-items: start;
}
.plant-grid--compact { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

.article-list--compact { display: flex; flex-direction: column; gap: 14px; }
.article-card--compact {
    display: flex;
    gap: 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 10px;
    color: var(--color-text);
}
.article-card--compact:hover { text-decoration: none; box-shadow: var(--shadow-sm); }
.article-card--compact img,
.article-card__placeholder {
    width: 72px;
    height: 72px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--color-accent);
    flex-shrink: 0;
}
.article-card__title { font-weight: 600; margin-bottom: 4px; }
.article-card__excerpt { margin: 0; font-size: 0.85rem; color: var(--color-muted); }

@media (max-width: 800px) {
    .home-row { grid-template-columns: 1fr; }
    .hero-bar { flex-direction: column; }
    .catalog-menu { flex-basis: auto; width: 100%; }
    .hero-bar__extra { width: 100%; }
}

@media (max-width: 640px) {
    .header-top { padding: 12px 16px; gap: 10px 16px; }
    .brand-logo { height: 48px; width: 48px; }
    .brand-text { font-size: 1.6rem; }
    .search-form { order: 3; max-width: none; flex-basis: 100%; margin: 0; }
    .header-auth__hello { display: none; }
    .header-subnav { gap: 14px; padding: 8px 16px; overflow-x: auto; white-space: nowrap; }
    .hero-bar { padding: 10px 16px 16px; }
    main.container { padding-top: 20px; padding-bottom: 40px; }
}

.badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--color-accent);
    color: var(--color-primary-dark);
}
.badge--out { background: var(--color-danger-bg); color: var(--color-danger-text); }
.badge--new { background: var(--color-success-bg); color: var(--color-success-text); }
.badge--cancelled { background: var(--color-danger-bg); color: var(--color-danger-text); }
.badge--confirmed { background: var(--color-success-bg); color: var(--color-success-text); }
.badge--completed { background: #b8cdb2; color: var(--color-success-text); }

.plant-detail {
    display: grid;
    grid-template-columns: minmax(280px, 420px) 1fr;
    gap: 40px;
}
@media (max-width: 800px) {
    .plant-detail { grid-template-columns: 1fr; gap: 24px; }
    .plant-gallery { max-width: 420px; margin: 0 auto; }
}

.plant-gallery__main {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: var(--radius);
    background: var(--color-accent);
}

.plant-gallery__viewport { position: relative; }
.plant-gallery__track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    border-radius: var(--radius);
    background: var(--color-accent);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.plant-gallery__track::-webkit-scrollbar { display: none; }
.plant-gallery__slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    aspect-ratio: 1 / 1;
}
.plant-gallery__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.plant-gallery__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.85);
    color: var(--color-primary-dark);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.plant-gallery__arrow--prev { left: 10px; }
.plant-gallery__arrow--next { right: 10px; }
@media (hover: none) {
    .plant-gallery__arrow { display: none; }
}

.plant-gallery__thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.plant-gallery__thumbs img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
}
.plant-gallery__thumbs img.active { border-color: var(--color-primary); }

.price-tag { font-size: 1.6rem; font-weight: 700; color: var(--color-primary-dark); margin: 12px 0; }

.promo-box {
    margin-bottom: 20px;
    padding: 18px 20px;
    border: 1px dashed var(--color-silver);
    border-radius: var(--radius);
    background: var(--color-surface-sunken);
}
.promo-box--applied { border-style: solid; border-color: var(--color-primary); background: #eaefe6; }
.promo-box__eyebrow {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-muted);
    margin-bottom: 10px;
}
.promo-box__line { margin: 0 0 4px; }
.promo-box__code {
    font-weight: 700;
    letter-spacing: 0.03em;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 2px 9px;
}
.promo-box__discount { color: var(--color-gold); font-weight: 700; }
.promo-box__desc { margin: 0 0 10px; color: var(--color-muted); font-size: 0.9rem; }
.promo-box__remove { color: var(--color-muted); font-size: 0.85rem; }
.promo-box__remove:hover { color: var(--color-danger); }
.promo-form { display: flex; gap: 10px; flex-wrap: wrap; }
.promo-form input { flex: 1 1 200px; }

.cart-summary { margin-bottom: 16px; }
.cart-summary__line { margin: 0 0 4px; color: var(--color-muted); font-variant-numeric: tabular-nums; }
.cart-summary__line--discount { color: var(--color-gold); font-weight: 600; }

.rating-summary { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.rating-summary .star { color: var(--color-border); font-size: 1.2rem; line-height: 1; }
.rating-summary .star.is-filled { color: var(--color-gold); }
.rating-summary__count { color: var(--color-muted); font-size: 0.9rem; }

.star-input { display: flex; gap: 4px; }
.star-input__star {
    font-size: 2rem;
    line-height: 1;
    color: var(--color-border);
    cursor: pointer;
    user-select: none;
    transition: color 0.1s ease;
}
.star-input__star.is-filled { color: var(--color-gold); }

.reviews-section { margin-top: 48px; border-top: 1px solid var(--color-border); padding-top: 32px; }

.review-form-toggle { margin-bottom: 24px; }
.review-form-toggle summary {
    list-style: none;
    cursor: pointer;
    display: inline-block;
}
.review-form-toggle summary::-webkit-details-marker { display: none; }
.review-form-toggle .card { margin-top: 14px; }

.review-list { display: flex; flex-direction: column; gap: 16px; }
.review-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 14px 16px;
}
.review-card__header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.review-card__stars { color: var(--color-gold); letter-spacing: 1px; }
.review-card__date { color: var(--color-muted); font-size: 0.85rem; }
.review-card p { margin: 0 0 8px; }

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 22px;
}
.article-card {
    display: block;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    color: var(--color-text);
}
.article-card:hover { text-decoration: none; box-shadow: var(--shadow-sm); }
.article-card img,
.article-card__placeholder--wide {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: var(--color-accent);
}
.article-card__body { padding: 14px; }
.article-content p { margin: 0 0 1em; }

.video-embed {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
    margin-top: 20px;
}
.video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 24px;
}

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; }
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font: inherit;
    color: var(--color-text);
    background: var(--color-surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-group input:hover,
.form-group textarea:hover,
.form-group select:hover { border-color: var(--color-silver); }
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(70, 89, 62, 0.15);
}
.form-group textarea { min-height: 110px; resize: vertical; }
.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236c6f61' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
}
.form-group input[type="checkbox"] {
    width: auto;
    accent-color: var(--color-primary);
}

.form-narrow { max-width: 420px; margin: 0 auto; }

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--color-primary);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.btn:hover { background: var(--color-primary-dark); box-shadow: var(--shadow-md); transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); box-shadow: var(--shadow-sm); }
.btn:focus-visible { outline: 2px solid var(--color-gold); outline-offset: 2px; }
.btn--secondary { background: var(--color-accent); color: var(--color-primary-dark); }
.btn--secondary:hover { background: var(--color-silver); color: #fff; }
.btn--danger { background: var(--color-danger); }
.btn--danger:hover { background: var(--color-danger-text); }
.btn--small { padding: 6px 12px; font-size: 0.85rem; }

.error-message {
    background: var(--color-danger-bg);
    color: var(--color-danger-text);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    border-left: 3px solid var(--color-danger);
}
.success-message {
    background: var(--color-success-bg);
    color: var(--color-success-text);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    border-left: 3px solid var(--color-primary);
}
.admin-alert {
    background: #fbe7cf;
    color: #7a4a1e;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #f0cd9e;
}
.admin-alert a { color: #7a4a1e; text-decoration: underline; }

.stat-bar-row { margin-bottom: 14px; }
.stat-bar-row:last-child { margin-bottom: 0; }
.stat-bar-row__label {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 4px;
}
.stat-bar-row__label span { color: var(--color-muted); }
.stat-bar {
    background: var(--color-bg);
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
}
.stat-bar__fill {
    background: var(--color-primary);
    height: 100%;
    border-radius: 999px;
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--color-border); }

/* Below the breakpoint, list tables turn into a stack of cards instead of a
   horizontally-scrolling grid — each <td> needs a data-label attribute matching
   its column header, rendered via ::before so the card shows "Статус: Новый" etc. */
@media (max-width: 700px) {
    table.table-responsive { border: none; }
    table.table-responsive thead { display: none; }
    table.table-responsive, table.table-responsive tbody, table.table-responsive tr, table.table-responsive td {
        display: block;
        width: 100%;
    }
    table.table-responsive tr {
        border: 1px solid var(--color-border);
        border-radius: var(--radius);
        background: var(--color-surface);
        padding: 6px 14px;
        margin-bottom: 12px;
    }
    table.table-responsive td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
        padding: 8px 0;
        border-bottom: 1px solid var(--color-border);
        text-align: right;
    }
    table.table-responsive td:last-child { border-bottom: none; }
    table.table-responsive td[data-label]::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.8rem;
        color: var(--color-muted);
        text-align: left;
        margin-right: auto;
        padding-top: 2px;
    }
    table.table-responsive td:not([data-label]) { justify-content: flex-end; }
    table.table-responsive tr.table-note-row {
        border: none;
        background: transparent;
        padding: 0 0 12px;
    }
    table.table-responsive tr.table-note-row td {
        display: block;
        text-align: left;
        border-bottom: none;
        padding: 0;
        white-space: normal;
    }
}

.empty-state { color: var(--color-muted); padding: 40px 0; text-align: center; }

.admin-toolbar { display: flex; flex-wrap: wrap; gap: 10px 16px; justify-content: space-between; align-items: center; margin-bottom: 20px; }

.image-thumb-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.image-thumb-row .thumb-box { position: relative; }
.image-thumb-row img { width: 90px; height: 90px; object-fit: cover; border-radius: 6px; }

.icon-badge--inline {
    position: static;
    display: inline-flex;
    margin-left: 6px;
    vertical-align: middle;
}

.chat-widget {
    max-width: 720px;
    margin-top: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.chat-widget__messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 480px;
    overflow-y: auto;
    padding: 14px;
    margin-bottom: 14px;
    background: var(--color-surface-sunken);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}
.chat-widget__empty {
    color: var(--color-muted);
    text-align: center;
    margin: auto;
    padding: 0 24px;
    max-width: 320px;
}
.chat-widget__empty::before {
    content: "🌿";
    display: block;
    font-size: 1.8rem;
    margin-bottom: 8px;
    opacity: 0.8;
}

.chat-bubble {
    max-width: 75%;
    padding: 9px 13px;
    border-radius: 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}
.chat-bubble--theirs { align-self: flex-start; border-bottom-left-radius: 4px; }
.chat-bubble--mine {
    align-self: flex-end;
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.chat-bubble__text { white-space: pre-wrap; word-break: break-word; }
.chat-bubble__meta {
    font-size: 0.7rem;
    margin-top: 4px;
    opacity: 0.7;
}
.chat-bubble--mine .chat-bubble__meta { color: #eef1ec; }
.chat-bubble--theirs .chat-bubble__meta { color: var(--color-muted); }

.chat-widget__form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    background: var(--color-surface-sunken);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 6px 6px 6px 16px;
}
.chat-widget__form textarea {
    flex: 1 1 auto;
    min-height: 24px;
    max-height: 140px;
    padding: 8px 0;
    border: none;
    background: none;
    font: inherit;
    resize: none;
}
.chat-widget__form textarea:focus { outline: none; }
.chat-widget__form .btn {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 8px 18px;
}

@media (max-width: 640px) {
    .chat-widget { max-width: none; margin-top: 18px; padding: 10px; }
    .chat-widget__messages { height: 60vh; }
    .chat-bubble { max-width: 88%; }
}

.chat-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 720px;
}
.chat-list__item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 14px 16px;
    color: var(--color-text);
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.chat-list__item:hover { text-decoration: none; box-shadow: var(--shadow-sm); border-color: var(--color-silver); }
.chat-list__avatar {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--color-surface-sunken);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}
.chat-list__body { flex: 1 1 auto; min-width: 0; }
.chat-list__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
}
.chat-list__name { font-weight: 600; }
.chat-list__time { flex: 0 0 auto; font-size: 0.8rem; color: var(--color-muted); }
.chat-list__preview {
    margin: 4px 0 0;
    color: var(--color-muted);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
