/* ВебФикс — основная таблица стилей.
   Цвета: emerald/teal градиент (без синего/индиго).
   Адаптивная вёрстка mobile-first.
*/

/* === Сброс === */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* Гарантируем, что атрибут hidden всегда скрывает элемент,
   даже если другие правила задают display: flex/block/... */
[hidden] { display: none !important; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #ffffff;
    color: #0f172a;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 24px; } }

/* === Переменные === */
:root {
    --primary: #10b981;
    --primary-dark: #047857;
    --primary-light: #d1fae5;
    --teal: #0d9488;
    --bg: #ffffff;
    --bg-muted: #f8fafc;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --text: #0f172a;
    --text-muted: #64748b;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --warning: #f59e0b;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.05);
}

/* === Header === */
.site-header {
    border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 50;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    gap: 16px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 17px;
}
.logo-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #10b981, #0d9488);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}
.logo-mark svg { width: 18px; height: 18px; }
.logo-mark-sm { width: 26px; height: 26px; }
.logo-mark-sm svg { width: 14px; height: 14px; }

.nav {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}
.nav > a:not(.btn) {
    color: var(--text-muted);
    transition: color .15s;
}
.nav > a:not(.btn):hover { color: var(--text); }
.nav > a.active { color: var(--text); font-weight: 500; }
.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: var(--bg-muted);
    border-radius: 20px;
}
.avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}
.user-name { font-size: 13px; font-weight: 500; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 768px) {
    .nav > a:not(.btn):not(.active) { display: none; }
    .user-name { display: none; }
}

/* === Кнопки === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: var(--bg-muted);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.2;
}
.btn:hover { background: #f1f5f9; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 12px 22px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; min-width: 36px; min-height: 36px; }

.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg-muted); }

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-muted); color: var(--text); }

.btn-outline-white { background: transparent; border-color: rgba(255,255,255,.3); color: white; }
.btn-outline-white:hover { background: rgba(255,255,255,.1); color: white; }

.btn-secondary { background: white; color: var(--primary-dark); border-color: white; }
.btn-secondary:hover { background: #f8fafc; color: var(--primary-dark); }

.btn-danger { color: var(--danger); background: transparent; border-color: transparent; }
.btn-danger:hover { background: var(--danger-light); }

/* === Hero === */
.hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(to bottom, rgba(209,250,229,.6) 0%, rgba(209,250,229,.3) 50%, var(--bg) 100%);
    padding: 64px 0;
}
@media (min-width: 768px) { .hero { padding: 96px 0 80px; } }
@media (min-width: 1024px) { .hero { padding: 128px 0 96px; } }
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top, rgba(16,185,129,.12), transparent 60%);
    z-index: 0;
    pointer-events: none;
}
.hero-inner {
    position: relative;
    max-width: 768px;
    margin: 0 auto;
    text-align: center;
    z-index: 1;
}
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}
.badge svg { color: var(--primary); }
.hero h1 {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.1;
    margin-bottom: 24px;
}
@media (min-width: 768px) { .hero h1 { font-size: 48px; } }
@media (min-width: 1024px) { .hero h1 { font-size: 60px; } }
.hero h1 .accent {
    background: linear-gradient(to right, #10b981, #0d9488);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero-sub {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
@media (min-width: 768px) { .hero-sub { font-size: 20px; } }
.hero-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}
@media (min-width: 640px) { .hero-cta { flex-direction: row; justify-content: center; } }
.hero-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    font-size: 12px;
    color: var(--text-muted);
}
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta svg { color: var(--primary); }

/* === Stats === */
.stats {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--bg-muted);
    padding: 32px 0;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}
@media (min-width: 768px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-num {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(to right, #10b981, #0d9488);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
@media (min-width: 768px) { .stat-num { font-size: 40px; } }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.stats > div { text-align: center; }

/* === Sections === */
section { padding: 64px 0; }
@media (min-width: 768px) { section { padding: 96px 0; } }
.section-head { max-width: 672px; margin: 0 auto 48px; text-align: center; }
.section-head h2 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 16px; }
@media (min-width: 768px) { .section-head h2 { font-size: 40px; } }
.section-head p { font-size: 18px; color: var(--text-muted); }

/* === Features === */
.features { background: var(--bg); }
.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
@media (min-width: 768px) { .features-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .features-grid { grid-template-columns: repeat(3, 1fr); } }
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all .2s;
}
.feature-card:hover { border-color: rgba(16,185,129,.5); box-shadow: var(--shadow); }
.feature-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    background: var(--primary-light);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}
.feature-card h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* === How it works === */
.how { background: var(--bg-muted); }
.steps-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}
@media (min-width: 768px) { .steps-grid { grid-template-columns: repeat(4, 1fr); } }
.step-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}
.step-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #0d9488);
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}
.step-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.step-card p { font-size: 14px; color: var(--text-muted); }

/* === CTA === */
.cta-box {
    background: linear-gradient(135deg, #10b981, #0d9488);
    color: white;
    border-radius: 24px;
    padding: 64px 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.cta-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top right, rgba(255,255,255,.2), transparent 60%);
    pointer-events: none;
}
.cta-box h2 { font-size: 30px; font-weight: 700; margin-bottom: 16px; position: relative; }
@media (min-width: 768px) { .cta-box h2 { font-size: 48px; } }
.cta-box p { font-size: 18px; opacity: .9; max-width: 540px; margin: 0 auto 32px; position: relative; }
.cta-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
}
@media (min-width: 640px) { .cta-buttons { flex-direction: row; justify-content: center; } }

/* === Footer === */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg);
    padding: 24px 0;
}
.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    text-align: center;
}
@media (min-width: 768px) { .footer-inner { flex-direction: row; justify-content: space-between; } }
.footer-brand { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.text-right { text-align: right; }

/* === Auth pages === */
.auth-page {
    padding: 48px 16px;
    background: linear-gradient(to bottom, rgba(209,250,229,.5), var(--bg));
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.auth-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 32px;
    max-width: 420px;
    width: 100%;
}
.auth-card h1 { font-size: 24px; font-weight: 700; text-align: center; margin-bottom: 4px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }
.auth-alt { text-align: center; font-size: 14px; color: var(--text-muted); }
.auth-alt a { color: var(--primary-dark); font-weight: 500; }
.auth-hint { margin-top: 16px; max-width: 420px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 500; color: var(--text); }
.field input, .field textarea, .field select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    background: white;
    color: var(--text);
    width: 100%;
}
.field input:focus, .field textarea:focus, .field select:focus {
    outline: 2px solid var(--primary);
    outline-offset: -1px;
    border-color: var(--primary);
}
.field textarea { min-height: 80px; resize: vertical; }

/* === Alerts === */
.alert-error, .alert-info, .form-msg.error, .form-msg.success {
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 14px;
}
.alert-error { background: var(--danger-light); color: var(--danger); border: 1px solid rgba(220,38,38,.3); }
.alert-info { background: #fef9c3; color: #854d0e; border: 1px solid rgba(245,158,11,.3); font-size: 12px; }
.form-msg { font-size: 14px; min-height: 1em; }
.form-msg.error { color: var(--danger); }
.form-msg.success { color: var(--primary-dark); }

/* === Dashboard === */
.dashboard {
    display: grid;
    grid-template-columns: 1fr;
    min-height: calc(100vh - 56px);
}
@media (min-width: 768px) {
    .dashboard { grid-template-columns: 320px 1fr; }
}
.chat-list {
    border-right: 1px solid var(--border);
    background: var(--bg);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 56px);
    overflow: hidden;
}
.chat-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}
.chat-list-head h2 { font-size: 18px; font-weight: 600; }
.chat-list-items { overflow-y: auto; flex: 1; padding: 8px; }
.chat-list-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}
.chat-list-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background .15s;
    border: 1px solid transparent;
    background: transparent;
    margin-bottom: 4px;
    font-family: inherit;
    color: var(--text);
}
.chat-list-item:hover { background: var(--bg-muted); }
.chat-list-item.active { background: var(--primary-light); border-color: rgba(16,185,129,.3); }
.chat-list-item .title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-list-item .meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-list-item .meta-left { font-size: 12px; color: var(--text-muted); }
.chat-list-item .meta-stats { font-size: 12px; color: var(--text-muted); display: flex; gap: 8px; align-items: center; }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    background: var(--bg-muted);
    color: var(--text-muted);
}
.status-badge.open { background: var(--primary-light); color: var(--primary-dark); }
.status-badge.in_progress { background: #fef3c7; color: #92400e; }
.status-badge.closed { background: var(--bg-muted); color: var(--text-muted); }

/* === Chat view === */
.chat-main { display: flex; flex-direction: column; min-height: calc(100vh - 56px); }
.chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    text-align: center;
}
.chat-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.chat-empty h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.chat-empty p { font-size: 14px; color: var(--text-muted); max-width: 320px; margin-bottom: 16px; }

.chat-view { display: flex; flex-direction: column; height: 100%; flex: 1; }
.chat-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
.chat-header h2 { font-size: 16px; font-weight: 600; }
.chat-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg-muted);
    max-height: calc(100vh - 320px);
}
.msg {
    display: flex;
    margin-bottom: 12px;
}
.msg.mine { justify-content: flex-end; }
.msg-bubble {
    max-width: 75%;
    padding: 8px 12px;
    border-radius: var(--radius);
    background: white;
    border: 1px solid var(--border);
}
.msg.mine .msg-bubble { background: var(--primary); color: white; border-color: var(--primary); }
.msg-sender { font-size: 12px; font-weight: 500; color: var(--primary-dark); margin-bottom: 2px; }
.msg.mine .msg-sender { color: rgba(255,255,255,.8); }
.msg-content { font-size: 14px; white-space: pre-wrap; word-wrap: break-word; }
.msg-time { font-size: 10px; color: var(--text-muted); margin-top: 4px; }
.msg.mine .msg-time { color: rgba(255,255,255,.8); }
.msg-attachments { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.msg.mine .msg-attachments { border-top: 1px solid rgba(255,255,255,.2); padding-top: 8px; }
.msg:not(.mine) .msg-attachments { border-top: 1px solid var(--border); padding-top: 8px; }
.msg-attachment {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    background: rgba(0,0,0,.05);
    color: var(--text);
}
.msg.mine .msg-attachment { background: rgba(255,255,255,.2); color: white; }
.msg-attachment:hover { background: rgba(0,0,0,.1); }
.msg.mine .msg-attachment:hover { background: rgba(255,255,255,.3); color: white; }

.spec-banner {
    background: var(--primary-light);
    border: 1px solid rgba(16,185,129,.3);
    border-radius: var(--radius);
    padding: 8px 12px;
    margin-bottom: 16px;
}
.spec-banner-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--primary-dark);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.spec-banner a {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--primary-dark);
    text-decoration: underline;
}

.typing-indicator {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    padding: 4px 8px;
    margin-bottom: 8px;
}

/* === Composer === */
.chat-composer {
    border-top: 1px solid var(--border);
    background: var(--bg);
    padding: 12px;
}
.composer-attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.composer-attachment {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--bg-muted);
    border-radius: 12px;
    font-size: 12px;
}
.composer-attachment button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 14px;
    padding: 0;
    line-height: 1;
}
.composer-attachment button:hover { color: var(--danger); }
.composer-row { display: flex; align-items: flex-end; gap: 8px; }
.composer-row textarea {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    min-height: 40px;
    max-height: 120px;
}
.composer-row textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.composer-hint { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* === Modal === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 100;
}
.modal {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 24px;
    max-width: 448px;
    width: 100%;
}
.modal h3 { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.modal .muted { font-size: 14px; margin-bottom: 16px; }
.modal form { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.modal-actions { display: flex; gap: 8px; }
.modal-actions button { flex: 1; }

/* === File drop === */
.file-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all .15s;
    text-align: center;
    color: var(--text-muted);
}
.file-drop:hover { background: var(--bg-muted); }
.file-drop.has-file { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); }
.file-drop svg { color: var(--text-muted); }
.file-drop.has-file svg { color: var(--primary-dark); }
.file-drop-text { font-size: 14px; font-weight: 500; color: var(--text); }
.file-drop-sub { font-size: 12px; color: var(--text-muted); }
.file-drop input[type=file] { display: none; }

/* === Admin === */
.admin { padding: 24px 0; }
.tabs {
    display: flex;
    gap: 4px;
    align-items: center;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
    padding: 0 16px;
}
.tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); }
.tab-count {
    background: var(--bg-muted);
    color: var(--text-muted);
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}
.admin-refresh { margin-left: auto; }

.tab-panel { display: none; padding: 0 16px; }
.tab-panel.active { display: block; }

.admin-chats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
@media (min-width: 1024px) { .admin-chats { grid-template-columns: 360px 1fr; } }
.admin-chat-list {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    max-height: calc(100vh - 240px);
    overflow-y: auto;
}
.admin-chat-view {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 480px;
    max-height: calc(100vh - 240px);
}

/* === Table === */
.table-wrap { overflow-x: auto; background: white; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.users-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.users-table th, .users-table td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); }
.users-table th { font-size: 12px; color: var(--text-muted); font-weight: 500; background: var(--bg-muted); }
.users-table tbody tr:last-child td { border-bottom: none; }
.users-table tbody tr:hover { background: var(--bg-muted); }
.users-table .actions { display: flex; gap: 4px; justify-content: flex-end; }
.role-badge {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}
.role-badge.admin { background: var(--primary); color: white; }
.role-badge.user { background: var(--bg-muted); color: var(--text-muted); }

/* === Status select в админке === */
.status-select {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    background: white;
    cursor: pointer;
}
.status-select:focus { outline: 2px solid var(--primary); }

/* === Loading spinner === */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
.btn:not(.btn-primary) .spinner { border-color: rgba(0,0,0,.2); border-top-color: var(--text); }
@keyframes spin { to { transform: rotate(360deg); } }

/* === Анимации === */
.fade-in { animation: fadeIn .3s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* === Toast === */
.toast {
    position: fixed;
    top: 16px;
    right: 16px;
    padding: 12px 16px;
    background: var(--text);
    color: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    font-size: 14px;
    animation: slideIn .2s ease-out;
}
.toast.success { background: var(--primary); }
.toast.error { background: var(--danger); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: none; opacity: 1; } }
