/* ============================================================
   cpo4no.ru — Premium B2B SaaS theme
   ============================================================ */

/* Улучшение CLS: предотвращаем скачки шрифтов и картинок */
body {
    font-display: swap;
}
img {
    max-width: 100%;
    height: auto;
}

:root {
    /* Brand */
    --brand: #2563eb;
    --brand-600: #1d4ed8;
    --brand-700: #1e40af;
    --brand-50: #eff6ff;
    --brand-100: #dbeafe;

    /* Accent */
    --violet: #7c3aed;
    --violet-50: #f5f3ff;

    /* Ink */
    --ink: #0b1220;
    --ink-soft: #475569;
    --ink-muted: #64748b;

    /* Surfaces */
    --bg: #ffffff;
    --bg-soft: #f8fafc;
    --bg-subtle: #f1f5f9;
    --line: #e5e7eb;
    --line-soft: #eef2f7;

    /* Radii */
    --r-sm: 10px;
    --r-md: 14px;
    --r-lg: 18px;
    --r-xl: 22px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 12px rgba(15, 23, 42, .05);
    --shadow-md: 0 2px 4px rgba(15, 23, 42, .04), 0 12px 28px rgba(15, 23, 42, .08);
    --shadow-lg: 0 4px 8px rgba(15, 23, 42, .05), 0 24px 48px rgba(15, 23, 42, .10);
    --shadow-brand: 0 6px 20px rgba(37, 99, 235, .28);
}

/* ---------- Reset / base ---------- */
* { -webkit-font-smoothing: antialiased; }
html, body { height: 100%; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--ink);
    background: var(--bg);
    display: flex;
    flex-direction: column;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    line-height: 1.55;
}

main { flex: 1 0 auto; }

h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.02em;
    color: var(--ink);
}

p { color: var(--ink-soft); }

a { color: var(--brand); }

::selection {
    background: var(--brand-100);
    color: var(--brand-700);
}

/* ---------- Navbar ---------- */
.navbar {
    background: rgba(255, 255, 255, .82) !important;
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line-soft) !important;
}
.navbar-brand {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}
.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--brand), var(--violet));
    color: #fff;
    border-radius: 10px;
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: var(--shadow-brand);
}
.nav-link {
    font-weight: 500;
    color: var(--ink-soft);
    border-radius: 8px;
    padding: 8px 12px !important;
    transition: all .15s;
}
.nav-link:hover {
    color: var(--ink);
    background: var(--bg-subtle);
}
.nav-link.active { color: var(--brand); }

/* ---------- Buttons ---------- */
.btn {
    border-radius: var(--r-sm);
    font-weight: 600;
    letter-spacing: -0.01em;
    padding: 10px 18px;
    transition: transform .12s ease, box-shadow .18s ease, background .18s ease, color .18s;
    border-width: 1px;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: linear-gradient(135deg, var(--brand) 0%, var(--violet) 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: var(--shadow-brand);
}
.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--brand-600) 0%, #6d28d9 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 28px rgba(37, 99, 235, .35);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--brand);
    border-color: var(--brand-100);
    background: #fff;
}
.btn-outline-primary:hover {
    background: var(--brand-50);
    color: var(--brand-700);
    border-color: var(--brand);
}

.btn-outline-secondary {
    color: var(--ink-soft);
    border-color: var(--line);
    background: #fff;
}
.btn-outline-secondary:hover {
    background: var(--bg-subtle);
    color: var(--ink);
    border-color: #cbd5e1;
}

.btn-outline-dark {
    color: var(--ink);
    border-color: var(--ink);
    background: #fff;
}
.btn-outline-dark:hover {
    background: var(--ink);
    color: #fff;
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 18px rgba(16, 185, 129, .25);
}
.btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
    color: #fff;
    box-shadow: 0 10px 24px rgba(16, 185, 129, .35);
    transform: translateY(-1px);
}

.btn-outline-danger {
    color: #dc2626;
    border-color: #fecaca;
    background: #fff;
}
.btn-outline-danger:hover {
    background: #fef2f2;
    border-color: #ef4444;
    color: #b91c1c;
}

.btn-sm { padding: 6px 14px; font-size: 0.85rem; border-radius: 8px; }
.btn-lg { padding: 14px 26px; font-size: 1.02rem; border-radius: 12px; }

/* ---------- Forms ---------- */
.form-control,
.form-select {
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
    padding: 11px 14px;
    font-size: 0.95rem;
    background-color: #fff;
    transition: border-color .15s, box-shadow .15s;
    box-shadow: var(--shadow-xs);
}
.form-control:hover,
.form-select:hover { border-color: #cbd5e1; }

.form-control:focus,
.form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
    outline: none;
}
.form-label {
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 6px;
}
.form-text { color: var(--ink-muted); }
.form-check-input:checked {
    background-color: var(--brand);
    border-color: var(--brand);
}
.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
    border-color: var(--brand);
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    background: #fff;
    overflow: hidden;
    isolation: isolate;
}
.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.hero-blob {
    position: absolute;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    filter: blur(90px);
    opacity: .55;
}
.hero-blob-1 {
    top: -160px;
    left: -140px;
    background: radial-gradient(circle, rgba(37, 99, 235, .55), rgba(37, 99, 235, 0) 65%);
}
.hero-blob-2 {
    top: -80px;
    right: -160px;
    background: radial-gradient(circle, rgba(124, 58, 237, .45), rgba(124, 58, 237, 0) 65%);
}
.hero .container { position: relative; z-index: 1; }

.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--brand-50), var(--violet-50));
    color: var(--brand-700);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--brand-100);
}

.hero h1.display-4 {
    font-size: 3.4rem;
    line-height: 1.1;
    letter-spacing: -0.035em;
    font-weight: 800;
}
.hero .lead {
    font-size: 1.1rem;
    color: var(--ink-soft);
    max-width: 560px;
}
.hero-stats {
    font-size: 0.9rem;
}
.hero-stats > div {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--bg-soft);
    border: 1px solid var(--line-soft);
    border-radius: 999px;
}

/* Hero card */
.hero-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    padding: 26px;
    box-shadow: var(--shadow-lg);
    position: relative;
}
.hero-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(37,99,235,.25), rgba(124,58,237,.15), transparent 60%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
}

.avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--brand-50), var(--violet-50));
    color: var(--brand-700);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.88rem;
    flex-shrink: 0;
}

.task-item {
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    padding: 12px 14px;
    background: var(--bg-soft);
    transition: border-color .15s, background .15s;
}
.task-item:hover {
    border-color: var(--brand-100);
    background: #fff;
}

/* ---------- Section titles ---------- */
.section-title {
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--ink);
}

/* ---------- Feature cards ---------- */
.feature-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 26px;
    transition: transform .2s ease, box-shadow .25s ease, border-color .2s;
    box-shadow: var(--shadow-xs);
}
.feature-card:hover {
    border-color: #dbeafe;
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}
.feature-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand-50), var(--violet-50));
    color: var(--brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* ---------- Step cards ---------- */
.step-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 24px;
    box-shadow: var(--shadow-xs);
    transition: transform .2s ease, box-shadow .25s ease;
}
.step-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.step-num {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 12px;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--brand), var(--violet));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- Role cards ---------- */
.role-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 30px;
    transition: transform .2s ease, box-shadow .25s ease, border-color .2s;
    box-shadow: var(--shadow-xs);
}
.role-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}
.role-card.featured {
    border-color: transparent;
    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(135deg, var(--brand), var(--violet)) border-box;
    border: 1px solid transparent;
    box-shadow: var(--shadow-md), 0 0 0 4px rgba(37, 99, 235, .06);
}
.role-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--bg-subtle);
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}
.role-icon.accent {
    background: linear-gradient(135deg, var(--brand), var(--violet));
    color: #fff;
    box-shadow: var(--shadow-brand);
}
.role-list {
    list-style: none;
    padding: 0;
    margin: 14px 0 0;
}
.role-list li {
    padding: 8px 0 8px 24px;
    position: relative;
    font-size: 0.9rem;
    color: var(--ink-soft);
    border-top: 1px solid var(--line-soft);
}
.role-list li:first-child { border-top: 0; }
.role-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--violet));
}

/* ---------- CTA ---------- */
.cta-block {
    background:
        radial-gradient(600px 200px at 20% 0%, rgba(124, 58, 237, .10), transparent 60%),
        radial-gradient(600px 200px at 90% 100%, rgba(37, 99, 235, .12), transparent 60%),
        #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    padding: 42px;
    box-shadow: var(--shadow-sm);
}

/* ---------- Auth card ---------- */
.auth-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
}

/* ---------- Footer ---------- */
footer { flex-shrink: 0; }
.footer-link {
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.85rem;
    margin-left: 16px;
    transition: color .15s;
}
.footer-link:hover { color: var(--brand); }

/* ---------- Utils ---------- */
.bg-light-subtle { background: var(--bg-soft) !important; }

/* ============================================================
   Dashboard layout
   ============================================================ */
.dash-body {
    background: var(--bg-soft);
    min-height: 100vh;
    margin: 0;
    display: block;
}

.dash-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 260px;
    background: #fff;
    border-right: 1px solid var(--line-soft);
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
    z-index: 1030;
    transition: transform .2s;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.dash-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--ink);
    padding: 4px 8px 20px;
    border-bottom: 1px solid var(--line-soft);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}
.dash-sidebar-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1rem;
    color: var(--ink-muted);
    padding: 6px 8px;
    border-radius: 8px;
    transition: background .15s;
}
.dash-sidebar-close:hover { background: var(--bg-subtle); }

.dash-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}
.dash-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--ink-soft);
    font-size: 0.92rem;
    font-weight: 500;
    transition: .15s;
    min-height: 44px;
}
.dash-link:hover {
    background: var(--bg-subtle);
    color: var(--ink);
}
.dash-link.active {
    background: linear-gradient(135deg, var(--brand-50), var(--violet-50));
    color: var(--brand-700);
    font-weight: 600;
}
.dash-link.active i { color: var(--brand); }
.dash-link i { font-size: 1.08rem; width: 20px; text-align: center; }
.dash-link span { flex: 1; }

.dash-badge {
    background: linear-gradient(135deg, var(--brand), var(--violet));
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(37, 99, 235, .3);
}

.dash-footer {
    padding-top: 16px;
    border-top: 1px solid var(--line-soft);
    margin-top: 12px;
}
.dash-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 4px;
}
.dash-user-info { overflow: hidden; }
.dash-user-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-user-role {
    font-size: 0.75rem;
    color: var(--ink-muted);
}

.dash-main {
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.dash-topbar {
    height: 64px;
    background: rgba(255, 255, 255, .82);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line-soft);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 1020;
}
.dash-topbar-title {
    font-weight: 600;
    flex: 1;
    font-size: 0.98rem;
}
.dash-topbar-user { font-size: 0.85rem; }
.dash-content {
    padding: 28px;
    flex: 1;
}

.dash-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 1025;
    opacity: 0;
    transition: opacity .2s;
}
.dash-overlay.show {
    display: block;
    opacity: 1;
}

.mobile-bottomnav { display: none; }

/* ============================================================
   Chat
   ============================================================ */
.chat-wrap {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    height: calc(100vh - 240px);
    min-height: 400px;
    box-shadow: var(--shadow-sm);
}
.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-soft);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.chat-msg { display: flex; }
.chat-msg-mine { justify-content: flex-end; }
.chat-msg-other { justify-content: flex-start; }
.chat-bubble {
    max-width: 70%;
    padding: 11px 15px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-xs);
}
.chat-msg-mine .chat-bubble {
    background: linear-gradient(135deg, var(--brand), #4f46e5);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(37, 99, 235, .22);
}
.chat-author {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--brand);
}
.chat-text {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.92rem;
}
.chat-time {
    font-size: 0.7rem;
    opacity: .7;
    margin-top: 4px;
    text-align: right;
}
.chat-form {
    border-top: 1px solid var(--line-soft);
    padding: 12px;
    background: #fff;
}
.chat-form textarea {
    resize: none;
    min-height: 44px;
    max-height: 160px;
    overflow-y: auto;
}

.chat-image {
    display: block;
    max-width: 100%;
    max-height: 240px;
    border-radius: 8px;
    cursor: pointer;
}
.chat-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    background: rgba(15, 23, 42, .04);
    min-width: 200px;
    max-width: 100%;
    transition: background .15s;
}
.chat-file:hover { background: rgba(15, 23, 42, .08); }
.chat-msg-mine .chat-file {
    background: rgba(255, 255, 255, .18);
    color: #fff;
}
.chat-msg-mine .chat-file:hover { background: rgba(255, 255, 255, .28); }

.chat-file-icon { font-size: 1.3rem; flex-shrink: 0; }
.chat-file-info { flex: 1; min-width: 0; }
.chat-file-name {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-file-size { font-size: 0.72rem; opacity: 0.75; }

.chat-file-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--brand-50);
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 8px;
    color: var(--ink);
}
.chat-file-preview button {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.2rem;
    line-height: 1;
    color: var(--ink-soft);
    cursor: pointer;
    padding: 0 4px;
}
.chat-file-preview button:hover { color: #ef4444; }

/* ============================================================
   Admin tables
   ============================================================ */
.admin-table {
    width: 100%;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
}
.admin-table th,
.admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
}
.admin-table th {
    background: var(--bg-soft);
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--ink-muted);
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table td { font-size: 0.9rem; }
.admin-table tr:hover { background: var(--bg-soft); }

.admin-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.admin-table-wrap .admin-table { min-width: 640px; }

/* Analytics tables inside card */
.auth-card .admin-table {
    border: 0;
}
.auth-card .admin-table th,
.auth-card .admin-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--line-soft);
}
.auth-card .admin-table thead th {
    background: transparent;
    font-size: 0.76rem;
}
.auth-card .admin-table tr:last-child td { border-bottom: 0; }

/* ============================================================
   Profile
   ============================================================ */
.profile-avatar {
    width: 96px;
    height: 96px;
    background: linear-gradient(135deg, var(--brand-50), var(--violet-50));
    color: var(--brand-700);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 2.2rem;
    box-shadow: inset 0 0 0 1px var(--brand-100);
}

.stars-display {
    display: inline-flex;
    gap: 2px;
    line-height: 1;
}
.stars-display i { font-size: 0.95em; }
.stars-display.fs-5 i { font-size: 1.1rem; }

.star-rating {
    display: inline-flex;
    flex-direction: row-reverse;
    gap: 4px;
    font-size: 1.8rem;
    line-height: 1;
}
.star-rating input { display: none; }
.star-rating label {
    cursor: pointer;
    color: #cbd5e1;
    transition: color .15s;
}
.star-rating label i { display: block; }
.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label { color: #f59e0b; }

/* ============================================================
   Notifications
   ============================================================ */
.notif-unread {
    border-left: 3px solid var(--brand);
    background: linear-gradient(90deg, var(--brand-50) 0%, #fff 40%);
}
.notif-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.notif-dot {
    width: 8px;
    height: 8px;
    background: var(--brand);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .15);
}
.notif-counter {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    line-height: 1.4;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(239, 68, 68, .35);
}

/* ============================================================
   Auth role tabs
   ============================================================ */
.role-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.role-tab { margin: 0; cursor: pointer; }
.role-tab input { display: none; }
.role-tab > span {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    transition: .15s;
    background: #fff;
}
.role-tab > span i { font-size: 1.4rem; color: var(--ink-soft); }
.role-tab > span strong { font-size: 0.9rem; }
.role-tab > span small { color: var(--ink-muted); font-size: 0.75rem; }
.role-tab input:checked + span {
    border-color: var(--brand);
    background: linear-gradient(135deg, var(--brand-50), var(--violet-50));
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.role-tab input:checked + span i { color: var(--brand); }

/* ============================================================
   Animations
   ============================================================ */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
.anim-fade-up {
    animation: fadeUp .55s cubic-bezier(.2,.7,.3,1) both;
}
.anim-d-1 { animation-delay: .05s; }
.anim-d-2 { animation-delay: .12s; }
.anim-d-3 { animation-delay: .20s; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 991.98px) {
    .hero h1.display-4 { font-size: 2.4rem; }
    .section-title { font-size: 1.6rem; }

    .dash-sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: none;
    }
    .dash-sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    .dash-main {
        margin-left: 0;
        padding-bottom: 76px;
    }
    .dash-content { padding: 16px; }
    .dash-topbar { padding: 0 16px; height: 58px; }
    .dash-topbar-title {
        font-size: 0.95rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-bottomnav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, .94);
        backdrop-filter: saturate(180%) blur(14px);
        -webkit-backdrop-filter: saturate(180%) blur(14px);
        border-top: 1px solid var(--line-soft);
        z-index: 1030;
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
        box-shadow: 0 -2px 16px rgba(15, 23, 42, .05);
    }
    .mbn-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 6px 2px;
        color: var(--ink-muted);
        text-decoration: none;
        font-size: 0.68rem;
        font-weight: 500;
        border-radius: 8px;
        position: relative;
        min-height: 52px;
    }
    .mbn-item i { font-size: 1.25rem; line-height: 1; }
    .mbn-item.active { color: var(--brand); }
    .mbn-item:active { background: var(--bg-subtle); }
    .mbn-badge {
        position: absolute;
        top: 4px;
        right: calc(50% - 22px);
        background: #ef4444;
        color: #fff;
        font-size: 0.6rem;
        font-weight: 700;
        padding: 1px 5px;
        border-radius: 999px;
        min-width: 16px;
        line-height: 1.4;
        text-align: center;
    }
}

@media (max-width: 767.98px) {
    .hero { padding-top: 24px !important; padding-bottom: 32px !important; }
    .hero-blob { width: 340px; height: 340px; filter: blur(70px); }
    .hero-actions .btn,
    .hero-actions a { width: 100%; }

    .chat-wrap {
        height: calc(100vh - 200px);
        min-height: 340px;
        border-radius: 12px;
    }
    .chat-body { padding: 12px; }
    .chat-bubble { max-width: 85%; font-size: 0.9rem; }
    .chat-form {
        padding: 8px;
        position: sticky;
        bottom: 0;
        background: #fff;
        z-index: 5;
    }
    .chat-attach-btn,
    .chat-send-btn {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .chat-input { font-size: 16px; min-height: 44px; }
    .chat-hint { display: none; }
    .chat-image { max-height: 180px; }

    .form-control,
    .form-select {
        font-size: 16px;
        padding: 12px 14px;
        min-height: 44px;
    }
    .form-label { font-size: 0.85rem; }
    .auth-card { padding: 22px 18px; }
    .feature-card,
    .step-card,
    .role-card { padding: 20px; }
    .btn { min-height: 42px; }
    .btn-sm { min-height: 34px; padding: 6px 12px; }
    .hero-title { font-size: 1.9rem !important; }
    .hero-lead { font-size: 1rem; }
    .section-title { font-size: 1.5rem; }
    .display-4 { font-size: 2rem; }
    .cta-block { padding: 24px 20px; }
    .dash-content h1.h3 { font-size: 1.25rem; }
    .dash-content h1.h4 { font-size: 1.1rem; }

    .pagination { justify-content: center; flex-wrap: wrap; gap: 2px; font-size: 0.85rem; }
    .notif-icon { width: 36px; height: 36px; font-size: 1rem; }
}

@media (max-width: 575.98px) {
    .profile-avatar { width: 72px; height: 72px; font-size: 1.7rem; }
    .feature-card .avatar[style*="width:56px"] {
        width: 48px !important;
        height: 48px !important;
        font-size: 1.1rem !important;
    }
}

#sidebarToggle {
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   Freelancers catalog
   ============================================================ */
.feature-card .avatar { font-weight: 600; }
.badge.bg-warning-subtle.text-warning-emphasis {
    font-weight: 500;
    font-size: 0.72rem;
    padding: 3px 8px;
}

/* ============================================
   Avatars
   ============================================ */
.user-avatar {
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    aspect-ratio: 1 / 1;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    border: 2px solid #fff;
    box-shadow:
        0 0 0 2px #2563eb,
        0 4px 12px rgba(37, 99, 235, .18);
    background: var(--bg-subtle);
}

.avatar {
    border-radius: 50%;
    flex-shrink: 0;
    aspect-ratio: 1 / 1;
    border: 2px solid #fff;
    box-shadow:
        0 0 0 2px #2563eb,
        0 4px 12px rgba(37, 99, 235, .18);
}

/* Большой аватар в профиле */
.user-avatar.profile-avatar-img,
.avatar.profile-avatar-img {
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow:
        0 0 0 3px #2563eb,
        0 6px 20px rgba(37, 99, 235, .22);
}

/* ============================================
   Tags (skills, languages)
   ============================================ */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
}
.tag-skill {
    background: linear-gradient(135deg, #eff6ff, #f5f3ff);
    color: #1e40af;
    border: 1px solid #dbeafe;
}
.tag-language {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}
.tag-default {
    background: var(--bg-subtle);
    color: var(--ink-soft);
    border: 1px solid var(--line);
}

/* Мета-блок профиля: опыт, ставка, часовой пояс */
.profile-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
    padding: 12px 14px;
    background: var(--bg-soft);
    border-radius: 10px;
    font-size: 0.88rem;
    color: var(--ink-soft);
}
.profile-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}
.profile-meta-item i {
    width: 18px;
    text-align: center;
}
.profile-meta-item strong {
    color: var(--ink);
}

/* ============================================
   Onboarding checklist
   ============================================ */
.onboarding-card {
    background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
    border: 1px solid #dbeafe;
    border-radius: var(--r-lg);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
}
.onboarding-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid rgba(37, 99, 235, 0.1);
}
.onboarding-step:first-child {
    border-top: 0;
    padding-top: 0;
}
.onboarding-step-icon {
    width: 24px;
    text-align: center;
    color: #94a3b8;
    flex-shrink: 0;
    font-size: 1.1rem;
}
.onboarding-step.done .onboarding-step-icon {
    color: #10b981;
}
.onboarding-step-title {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--ink);
    text-decoration: none;
}
.onboarding-step.done .onboarding-step-title {
    color: var(--ink-muted);
    text-decoration: line-through;
}
a.onboarding-step-title:hover {
    color: var(--brand);
}
.onboarding-step .btn {
    flex-shrink: 0;
}
.onboarding-card .progress {
    background: rgba(37, 99, 235, 0.12);
    border-radius: 999px;
}
.onboarding-card .progress-bar {
    background: linear-gradient(90deg, #2563eb, #7c3aed);
    border-radius: 999px;
    transition: width .4s ease;
}

/* ============================================
   Verified badge
   ============================================ */
.verified-note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #eff6ff, #f5f3ff);
    border: 1px solid #dbeafe;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--brand-700);
}
.verified-note i {
    font-size: 1rem;
}

/* ============================================
   User badges (профиль) — Крупные и аккуратные
   ============================================ */
.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px; /* Расстояние между иконкой и текстом */
    padding: 0;
    background: transparent !important;
    font-size: 0.9rem; /* Размер текста */
    font-weight: 600;
    line-height: 1.2;
    border: none;
    box-shadow: none !important;
    white-space: nowrap;
    transition: opacity 0.15s ease;
}
.user-badge:hover {
    opacity: 0.8;
}

/* Стили для эмодзи (Вариант 1) */
.user-badge-emoji {
    font-size: 1.25rem; /* Эмодзи крупнее текста */
    line-height: 1;
    display: inline-block;
    transform: translateY(-1px);
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1)); /* Легкая тень для объема */
}

/* Стили для векторных иконок (Вариант 2) */
.user-badge i {
    font-size: 1.15rem; /* Размер векторной иконки */
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Яркие цвета (текст и иконки окрашиваются вместе) */
.user-badge-donor    { color: #e11d48 !important; }
.user-badge-trophy   { color: #ea580c !important; }
.user-badge-verified { color: #2563eb !important; }
.user-badge-success  { color: #16a34a !important; }
.user-badge-info     { color: #0284c7 !important; }
.user-badge-neutral  { color: #475569 !important; }
.user-badge-online   { color: #15803d !important; }