/* ============================================================
   OshRent — премиальный визуальный стиль
   ============================================================ */

:root {
    --brand-50:  #f4f1ff;
    --brand-100: #e9e1ff;
    --brand-200: #d3c4ff;
    --brand-400: #8b6df4;
    --brand-500: #6d4ee5;
    --brand-600: #5b3dd1;
    --brand-700: #4a30b0;
    --accent-400:#ff8a5b;
    --accent-500:#ff6b35;
    --accent-600:#e95722;

    --ink-900: #0f1024;
    --ink-800: #1c1d3a;
    --ink-700: #2a2c52;
    --ink-600: #4b4d75;
    --ink-500: #6c6e95;
    --ink-400: #9799b8;
    --ink-300: #c7c8dd;
    --ink-200: #e5e6f0;
    --ink-100: #f1f2f8;
    --ink-50:  #f8f9fc;
    --white:   #ffffff;

    --success: #10b981;
    --warning: #f59e0b;
    --danger:  #ef4444;
    --info:    #3b82f6;

    --bg-app:    var(--ink-50);
    --bg-card:   #ffffff;
    --bg-elev:   #ffffff;
    --text:      var(--ink-900);
    --text-soft: var(--ink-500);
    --border:    var(--ink-200);

    --shadow-sm:  0 1px 2px rgba(15, 16, 36, 0.04), 0 1px 3px rgba(15, 16, 36, 0.04);
    --shadow-md:  0 4px 6px -1px rgba(15, 16, 36, 0.05), 0 10px 25px -5px rgba(15, 16, 36, 0.08);
    --shadow-lg:  0 25px 50px -12px rgba(15, 16, 36, 0.15);
    --shadow-glow: 0 10px 40px -10px rgba(109, 78, 229, 0.45);

    --radius-sm: 8px;
    --radius:    14px;
    --radius-lg: 22px;
    --radius-xl: 32px;

    --grad-brand: linear-gradient(135deg, #6d4ee5 0%, #8b6df4 50%, #ff6b35 100%);
    --grad-brand-soft: linear-gradient(135deg, rgba(109,78,229,.08), rgba(255,107,53,.08));
    --grad-hero: linear-gradient(135deg, #1c1d3a 0%, #2a2c52 35%, #4a30b0 100%);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[data-theme="dark"] {
    --bg-app:    #0a0b1e;
    --bg-card:   #15172e;
    --bg-elev:   #1c1e3a;
    --text:      #e8e9fa;
    --text-soft: #9799b8;
    --border:    #2a2c52;
    --ink-100:   #1c1e3a;
    --ink-200:   #2a2c52;
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.4), 0 10px 25px -5px rgba(0,0,0,.5);
    --shadow-lg: 0 25px 50px -12px rgba(0,0,0,.6);
    --grad-brand-soft: linear-gradient(135deg, rgba(139,109,244,.15), rgba(255,107,53,.15));
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-app);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color .25s ease, color .25s ease;
}

main { flex: 1; }

a {
    color: var(--brand-600);
    text-decoration: none;
    transition: color .2s ease;
}
a:hover { color: var(--brand-700); }

img { max-width: 100%; display: block; }

/* ----- Контейнер ----- */
.shell {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================================
   Хедер
   ============================================================ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,.78);
    backdrop-filter: saturate(150%) blur(14px);
    -webkit-backdrop-filter: saturate(150%) blur(14px);
    border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .topbar { background: rgba(10,11,30,.78); }

.topbar-inner {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 14px 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 19px;
    color: var(--text);
    letter-spacing: -.01em;
}
.brand:hover { color: var(--text); }

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--grad-brand);
    color: white;
    display: grid;
    place-items: center;
    font-size: 18px;
    box-shadow: var(--shadow-glow);
}

.nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.nav-link {
    padding: 9px 14px;
    color: var(--text-soft);
    font-weight: 500;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all .2s ease;
}
.nav-link:hover {
    background: var(--ink-100);
    color: var(--text);
}
.nav-link.active {
    background: var(--grad-brand-soft);
    color: var(--brand-600);
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-soft);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: all .2s ease;
}
.icon-btn:hover {
    color: var(--brand-600);
    border-color: var(--brand-400);
    transform: translateY(-1px);
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-card);
    color: var(--text);
    font-weight: 500;
    transition: all .2s ease;
}
.user-chip:hover {
    color: var(--text);
    border-color: var(--brand-400);
    box-shadow: var(--shadow-sm);
}
.user-chip .avatar {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--ink-100);
}
.user-chip .avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-chip .role-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--success);
}
.user-chip[data-role="admin"] .role-dot { background: var(--danger); }
.user-chip[data-role="owner"] .role-dot { background: var(--warning); }

/* ============================================================
   Кнопки
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all .2s ease;
    font-family: inherit;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary {
    background: var(--grad-brand);
    color: white;
    box-shadow: 0 4px 14px rgba(109, 78, 229, .35);
}
.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(109, 78, 229, .45);
    color: white;
}

.btn-outline {
    background: var(--bg-card);
    color: var(--text);
    border-color: var(--border);
}
.btn-outline:hover:not(:disabled) {
    border-color: var(--brand-400);
    color: var(--brand-600);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-soft);
}
.btn-ghost:hover { background: var(--ink-100); color: var(--text); }

.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    color: white;
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success);
    color: white;
}
.btn-success:hover:not(:disabled) {
    background: #059669;
    color: white;
    transform: translateY(-2px);
}

.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn-lg { padding: 14px 24px; font-size: 15px; border-radius: 14px; }
.btn-block { width: 100%; }

/* ============================================================
   Карточки и сетки
   ============================================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { box-shadow: var(--shadow-md); }

.card-pad { padding: 24px; }

.grid {
    display: grid;
    gap: 20px;
}
.grid-listings {
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}

/* Карточка объявления */
.listing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s ease, border-color .3s ease;
    animation: cardIn .5s ease both;
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.listing-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}
.listing-card .media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--ink-100);
}
.listing-card .media img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .6s ease;
}
.listing-card:hover .media img { transform: scale(1.08); }

.media-placeholder {
    width: 100%; height: 100%;
    display: grid; place-items: center;
    background: var(--grad-brand-soft);
    color: var(--brand-500);
    font-size: 2.5rem;
}

.badge-row {
    position: absolute;
    inset: 14px 14px auto 14px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
    gap: 8px;
}
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255,255,255,.95);
    color: var(--ink-800);
    backdrop-filter: blur(6px);
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    pointer-events: auto;
}
.badge.brand   { background: var(--brand-600); color: white; }
.badge.accent  { background: var(--accent-500); color: white; }
.badge.success { background: var(--success); color: white; }
.badge.warning { background: var(--warning); color: white; }
.badge.muted   { background: var(--ink-100); color: var(--text-soft); }

.fav-btn {
    pointer-events: auto;
    width: 38px; height: 38px;
    border-radius: 999px;
    border: 0;
    background: rgba(255,255,255,.95);
    color: var(--ink-700);
    display: grid; place-items: center;
    cursor: pointer;
    backdrop-filter: blur(6px);
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    transition: all .2s ease;
}
.fav-btn:hover { transform: scale(1.1); color: var(--danger); }
.fav-btn.is-liked { color: var(--danger); }

.listing-card .body {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.listing-card .title {
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
    margin: 0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.listing-card .meta {
    color: var(--text-soft);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.listing-card .features {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--text-soft);
    font-size: 13px;
    margin-top: 4px;
}
.listing-card .features span { display: inline-flex; align-items: center; gap: 5px; }
.listing-card .footer {
    margin-top: auto;
    padding-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border);
}
.price {
    font-weight: 800;
    font-size: 19px;
    background: var(--grad-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -.01em;
}
.price-period { font-size: 12px; color: var(--text-soft); font-weight: 500; }
.stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-soft);
}

/* ============================================================
   Hero (главная)
   ============================================================ */
.hero {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: var(--grad-hero);
    color: white;
    padding: 56px 48px 64px;
    margin: 24px 0 28px;
    box-shadow: var(--shadow-lg);
}
.hero::before {
    content: '';
    position: absolute;
    inset: -20% -10% auto auto;
    width: 65%;
    aspect-ratio: 1;
    background: radial-gradient(closest-side, rgba(255,107,53,.55), transparent 70%);
    pointer-events: none;
}
.hero::after {
    content: '';
    position: absolute;
    inset: auto auto -30% -10%;
    width: 55%;
    aspect-ratio: 1;
    background: radial-gradient(closest-side, rgba(139,109,244,.55), transparent 70%);
    pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: 760px; }
.hero h1 {
    font-size: clamp(28px, 4vw, 46px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -.02em;
    margin: 0 0 14px;
}
.hero h1 .accent {
    background: linear-gradient(90deg, #ffd9c2, #ff8a5b);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero p {
    font-size: 17px;
    opacity: .82;
    margin: 0 0 26px;
    max-width: 580px;
}
.hero-stats {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
    margin-top: 32px;
    padding-top: 26px;
    border-top: 1px solid rgba(255,255,255,.18);
}
.hero-stat .num {
    font-size: 28px;
    font-weight: 800;
    display: block;
    line-height: 1;
}
.hero-stat .lbl {
    font-size: 13px;
    opacity: .7;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Поиск в hero */
.search-bar {
    position: relative;
    background: white;
    color: var(--text);
    border-radius: 16px;
    box-shadow: 0 18px 40px -12px rgba(0,0,0,.35);
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr auto;
    gap: 4px;
    padding: 8px;
    margin-top: 6px;
}
.search-bar .field { padding: 8px 14px; }
.search-bar .field label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-soft);
    letter-spacing: .05em;
    margin-bottom: 3px;
}
.search-bar input,
.search-bar select {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    font: inherit;
    font-weight: 600;
    color: var(--text);
    padding: 0;
}
.search-bar .submit {
    align-self: stretch;
    border-radius: 12px;
    background: var(--grad-brand);
    color: white;
    border: 0;
    padding: 0 24px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
    transition: transform .2s ease;
}
.search-bar .submit:hover { transform: translateY(-1px); }

@media (max-width: 820px) {
    .hero { padding: 36px 24px 40px; }
    .search-bar { grid-template-columns: 1fr; }
}

/* ============================================================
   Боковая панель фильтров
   ============================================================ */
.layout-with-aside {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 28px;
    align-items: start;
}
@media (max-width: 980px) {
    .layout-with-aside { grid-template-columns: 1fr; }
}
.filters {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    position: sticky;
    top: 90px;
}
.filters h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.filter-group { margin-bottom: 18px; }
.filter-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-soft);
    margin-bottom: 6px;
}
.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-soft);
    cursor: pointer;
    transition: all .2s ease;
    text-decoration: none;
}
.chip:hover { color: var(--brand-600); border-color: var(--brand-400); }
.chip.active {
    background: var(--brand-600);
    border-color: var(--brand-600);
    color: white;
}

.range-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* ============================================================
   Поля ввода
   ============================================================ */
.input,
.textarea,
.select {
    width: 100%;
    padding: 11px 14px;
    border-radius: 11px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.input:focus,
.textarea:focus,
.select:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 4px rgba(109, 78, 229, .12);
}
.textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.form-field { margin-bottom: 16px; }
.form-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.form-field .hint { font-size: 12px; color: var(--text-soft); margin-top: 4px; }

.check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    transition: all .2s ease;
    user-select: none;
}
.check input { accent-color: var(--brand-600); }
.check:has(input:checked) {
    background: var(--grad-brand-soft);
    border-color: var(--brand-400);
    color: var(--brand-700);
}

/* ============================================================
   Flash-сообщения
   ============================================================ */
.flash-stack {
    position: fixed;
    top: 88px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(380px, 92vw);
}
.flash {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--brand-500);
    border-radius: 12px;
    padding: 14px 18px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: flashIn .35s ease both;
}
@keyframes flashIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}
.flash.success { border-left-color: var(--success); }
.flash.danger  { border-left-color: var(--danger); }
.flash.warning { border-left-color: var(--warning); }
.flash.info    { border-left-color: var(--info); }
.flash .ico { font-size: 18px; }
.flash.success .ico { color: var(--success); }
.flash.danger  .ico { color: var(--danger); }
.flash.warning .ico { color: var(--warning); }
.flash.info    .ico { color: var(--info); }
.flash .close-x {
    margin-left: auto;
    background: transparent;
    border: 0;
    color: var(--text-soft);
    cursor: pointer;
    font-size: 16px;
}

/* ============================================================
   Заголовки секций
   ============================================================ */
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 8px 0 18px;
}
.section-head h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.01em;
}
.section-head .sub { color: var(--text-soft); font-size: 14px; }

/* ============================================================
   Детальная страница объявления
   ============================================================ */
.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
    margin-top: 20px;
}
@media (max-width: 980px) {
    .detail-layout { grid-template-columns: 1fr; }
}

.gallery {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
}
.gallery-main {
    aspect-ratio: 16/10;
    background: var(--ink-100);
    overflow: hidden;
    position: relative;
}
.gallery-main img {
    width: 100%; height: 100%;
    object-fit: cover;
    animation: fadeIn .35s ease;
}
@keyframes fadeIn { from { opacity: .25; } to { opacity: 1; } }
.gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 8px;
    padding: 10px;
}
.gallery-thumbs button {
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid transparent;
    padding: 0;
    background: var(--ink-100);
    cursor: pointer;
    transition: border-color .2s ease, transform .15s ease;
}
.gallery-thumbs button:hover { transform: translateY(-2px); }
.gallery-thumbs button.active { border-color: var(--brand-500); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.detail-title { font-size: 30px; font-weight: 800; margin: 24px 0 8px; letter-spacing: -.01em; }
.detail-address { color: var(--text-soft); display: flex; align-items: center; gap: 6px; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }

.amenities {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin: 20px 0;
}
.amenity {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
}
.amenity i {
    width: 34px; height: 34px;
    border-radius: 9px;
    background: var(--grad-brand-soft);
    color: var(--brand-600);
    display: grid; place-items: center;
    font-size: 16px;
}
.amenity.disabled { opacity: .4; }

.aside-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    position: sticky;
    top: 90px;
    box-shadow: var(--shadow-sm);
}
.aside-price { font-size: 30px; font-weight: 800; background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: -.02em; }
.aside-period { font-size: 14px; color: var(--text-soft); }
.aside-owner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin: 18px 0;
}
.aside-owner .avatar {
    width: 50px; height: 50px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--ink-100);
    flex-shrink: 0;
}
.aside-owner .avatar img { width: 100%; height: 100%; object-fit: cover; }
.aside-owner .who { line-height: 1.3; }
.aside-owner .who b { font-size: 15px; }
.aside-owner .who small { color: var(--text-soft); font-size: 12.5px; }

/* Комментарии */
.comment {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 12px;
    transition: border-color .2s ease;
}
.comment:hover { border-color: var(--brand-200); }
.comment-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.comment-avatar {
    width: 38px; height: 38px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--ink-100);
}
.comment-avatar img { width: 100%; height: 100%; object-fit: cover; }
.comment-meta { line-height: 1.2; }
.comment-meta b { font-size: 14px; }
.comment-meta small { color: var(--text-soft); font-size: 12px; }
.stars { color: var(--warning); font-size: 14px; margin-left: auto; }
.comment p { margin: 4px 0 0; font-size: 14px; }

/* ============================================================
   Auth (login / register)
   ============================================================ */
.auth-shell {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: calc(100vh - 80px);
    margin: 0 -24px;
}
@media (max-width: 920px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-shell .auth-hero { display: none; }
}
.auth-hero {
    background: var(--grad-hero);
    color: white;
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}
.auth-hero::before {
    content: '';
    position: absolute;
    inset: -10% auto auto -10%;
    width: 70%;
    aspect-ratio: 1;
    background: radial-gradient(closest-side, rgba(255,107,53,.45), transparent 70%);
}
.auth-hero::after {
    content: '';
    position: absolute;
    inset: auto -10% -10% auto;
    width: 60%;
    aspect-ratio: 1;
    background: radial-gradient(closest-side, rgba(139,109,244,.5), transparent 70%);
}
.auth-hero > * { position: relative; z-index: 1; }
.auth-hero h2 {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.15;
    margin: 0 0 14px;
}
.auth-hero p { font-size: 16px; opacity: .85; max-width: 460px; margin: 0; }
.auth-hero .glyph {
    width: 56px; height: 56px;
    border-radius: 16px;
    background: rgba(255,255,255,.14);
    backdrop-filter: blur(10px);
    display: grid; place-items: center;
    font-size: 26px;
    margin-bottom: 20px;
}

.auth-form {
    padding: 60px clamp(24px, 6vw, 80px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.auth-form .head { margin-bottom: 28px; }
.auth-form h1 { font-size: 28px; font-weight: 800; margin: 0 0 6px; letter-spacing: -.01em; }
.auth-form .head p { color: var(--text-soft); margin: 0; }
.auth-bottom { text-align: center; color: var(--text-soft); font-size: 14px; margin-top: 18px; }

.demo-block {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px dashed var(--border);
}
.demo-block .head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-soft);
    margin-bottom: 12px;
}
.demo-card {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    font: inherit;
    color: var(--text);
    transition: all .2s ease;
    margin-bottom: 8px;
}
.demo-card:hover { border-color: var(--brand-400); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.demo-card .glyph {
    width: 38px; height: 38px;
    border-radius: 10px;
    display: grid; place-items: center;
    font-size: 16px;
    color: white;
    flex-shrink: 0;
}
.demo-card.role-danger  .glyph { background: var(--danger); }
.demo-card.role-warning .glyph { background: var(--warning); }
.demo-card.role-success .glyph { background: var(--success); }
.demo-card .who { line-height: 1.25; flex: 1; }
.demo-card .who b { font-weight: 700; font-size: 14px; }
.demo-card .who small { color: var(--text-soft); font-size: 12px; display: block; }
.demo-card .creds {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 12px;
    color: var(--text-soft);
    background: var(--ink-100);
    padding: 4px 8px;
    border-radius: 6px;
}

/* ============================================================
   Админ-панель
   ============================================================ */
.admin-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 28px;
    margin: 28px 0;
}
@media (max-width: 980px) { .admin-shell { grid-template-columns: 1fr; } }
.admin-side {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    position: sticky;
    top: 90px;
    align-self: start;
}
.admin-side h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-soft);
    margin: 12px 10px 8px;
}
.admin-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text);
    font-weight: 500;
    margin-bottom: 2px;
    transition: all .2s ease;
}
.admin-link i { width: 20px; color: var(--text-soft); }
.admin-link:hover { background: var(--ink-100); color: var(--text); }
.admin-link.active {
    background: var(--grad-brand-soft);
    color: var(--brand-700);
}
.admin-link.active i { color: var(--brand-600); }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 16px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.stat-card .ico {
    width: 42px; height: 42px;
    border-radius: 12px;
    background: var(--grad-brand-soft);
    color: var(--brand-600);
    display: grid; place-items: center;
    font-size: 19px;
    margin-bottom: 12px;
}
.stat-card .num {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -.02em;
}
.stat-card .lbl {
    color: var(--text-soft);
    font-size: 13px;
    margin-top: 2px;
}
.stat-card.accent .ico { background: linear-gradient(135deg, rgba(255,107,53,.16), rgba(255,107,53,.08)); color: var(--accent-600); }
.stat-card.success .ico { background: rgba(16,185,129,.14); color: var(--success); }
.stat-card.warning .ico { background: rgba(245,158,11,.14); color: var(--warning); }
.stat-card.info .ico { background: rgba(59,130,246,.14); color: var(--info); }

.dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 24px;
}
@media (max-width: 980px) { .dash-grid { grid-template-columns: 1fr; } }

.bar-row {
    display: grid;
    grid-template-columns: 110px 1fr 40px;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    font-size: 13.5px;
}
.bar { background: var(--ink-100); border-radius: 999px; height: 9px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--grad-brand); border-radius: 999px; }
.bar-row b { color: var(--text); font-weight: 600; }

/* Таблица */
.table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.table th, .table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table th {
    background: var(--ink-50);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-soft);
}
[data-theme="dark"] .table th { background: rgba(255,255,255,.03); }
.table tbody tr:hover { background: var(--ink-50); }
[data-theme="dark"] .table tbody tr:hover { background: rgba(255,255,255,.03); }
.table tr:last-child td { border-bottom: 0; }
.table .thumb {
    width: 56px; height: 44px; border-radius: 8px;
    object-fit: cover; background: var(--ink-100);
}
.role-tag {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.role-tag.admin { background: rgba(239,68,68,.14); color: #b91c1c; }
.role-tag.owner { background: rgba(245,158,11,.16); color: #92400e; }
.role-tag.user  { background: rgba(16,185,129,.14); color: #047857; }
[data-theme="dark"] .role-tag.admin { color: #fca5a5; }
[data-theme="dark"] .role-tag.owner { color: #fcd34d; }
[data-theme="dark"] .role-tag.user  { color: #6ee7b7; }
.status-tag {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
}
.status-tag.active { background: rgba(16,185,129,.14); color: #047857; }
.status-tag.inactive { background: var(--ink-100); color: var(--text-soft); }
[data-theme="dark"] .status-tag.active { color: #6ee7b7; }

.row-actions {
    display: inline-flex;
    gap: 6px;
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
    margin-top: 60px;
    background: var(--ink-900);
    color: var(--ink-300);
    padding: 40px 0 24px;
}
[data-theme="dark"] .footer { background: #050617; }
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer h5 { color: white; font-size: 14px; margin: 0 0 12px; }
.footer a { color: var(--ink-300); display: block; padding: 4px 0; font-size: 14px; }
.footer a:hover { color: white; }
.footer .brand-block { max-width: 340px; }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 18px;
    font-size: 13px;
    color: var(--ink-400);
    gap: 16px;
    flex-wrap: wrap;
}

/* ============================================================
   Утилиты
   ============================================================ */
.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-soft);
}
.empty .icon {
    font-size: 56px;
    color: var(--ink-300);
    margin-bottom: 12px;
}
.empty h3 { margin: 0 0 6px; color: var(--text); font-weight: 700; }
.empty p { margin: 0; }

.divider { height: 1px; background: var(--border); margin: 20px 0; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.muted { color: var(--text-soft); }
.text-sm { font-size: 13px; }
.text-lg { font-size: 17px; }
.text-center { text-align: center; }
.text-strong { font-weight: 700; }
.hide-mobile { @media (max-width: 720px) { display: none !important; } }

/* Scroll-up animation */
.anim-in { animation: cardIn .5s ease both; }
.anim-in:nth-child(2) { animation-delay: .05s; }
.anim-in:nth-child(3) { animation-delay: .1s; }
.anim-in:nth-child(4) { animation-delay: .15s; }
.anim-in:nth-child(5) { animation-delay: .2s; }
.anim-in:nth-child(6) { animation-delay: .25s; }

/* Mobile nav */
.mobile-toggle { display: none; }
@media (max-width: 820px) {
    .nav { display: none; position: absolute; top: 100%; right: 24px; left: 24px;
           flex-direction: column; align-items: stretch; background: var(--bg-card);
           border: 1px solid var(--border); border-radius: 14px; padding: 10px;
           box-shadow: var(--shadow-md); margin-top: 6px; }
    .nav.open { display: flex; }
    .mobile-toggle { display: grid; place-items: center; margin-left: auto; }
}
