/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* -------------------------------------------------------------------------
   Обновлённая визуальная система платформы
   ------------------------------------------------------------------------- */
:root {
    --primary-color: #5865e8;
    --primary-dark: #4651c9;
    --secondary-color: #667085;
    --success-color: #16a37a;
    --danger-color: #d94b67;
    --warning-color: #d58a1d;
    --bg-color: #f6f8fc;
    --text-color: #172033;
    --muted-text: #667085;
    --border-color: #e3e8f2;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-card: 0 14px 40px rgba(34, 48, 83, 0.08);
    --shadow-dropdown: 0 16px 34px rgba(34, 48, 83, 0.14);
}

body {
    background: var(--bg-color);
    color: var(--text-color);
}

.container {
    max-width: 1240px;
}

.navbar {
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid rgba(227, 232, 242, 0.9);
    box-shadow: 0 4px 20px rgba(34, 48, 83, 0.04);
    backdrop-filter: blur(16px);
}

.navbar .container {
    min-height: 72px;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(135deg, #6f7bf4, #7858d9);
    box-shadow: 0 8px 18px rgba(88, 101, 232, 0.28);
    font-size: 1.1rem;
}

.brand-name {
    font-size: 1.14rem;
    white-space: nowrap;
}

.nav-menu {
    gap: 0.2rem;
}

.nav-link {
    padding: 0.6rem 0.8rem;
    border-radius: 10px;
    color: #4b5565;
    font-size: 0.93rem;
    transition: color 0.2s, background 0.2s, transform 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background: #f0f2ff;
}

.nav-link.btn-primary,
.nav-link.btn-primary:hover,
.nav-link.btn-primary.active {
    color: #fff;
    background: var(--primary-color);
    box-shadow: 0 8px 16px rgba(88, 101, 232, 0.18);
}

.btn {
    border-radius: 11px;
    padding: 0.72rem 1.1rem;
    font-weight: 650;
    letter-spacing: -0.01em;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary-color);
    box-shadow: 0 8px 18px rgba(88, 101, 232, 0.2);
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 10px 22px rgba(88, 101, 232, 0.28);
}

.btn-secondary {
    background: #eef1f7;
    color: #465166;
}

.btn-secondary:hover {
    background: #e2e7f1;
    color: #29344b;
}

.btn-ghost,
.btn-text {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: transparent;
    color: var(--primary-color);
    border: 1px solid #dce1ff;
}

.btn-ghost:hover {
    background: #f0f2ff;
    border-color: #c9d0ff;
}

.btn-text {
    border: 0;
    padding: 0.35rem 0;
    box-shadow: none;
}

.btn-text:hover {
    color: var(--primary-dark);
    transform: none;
}

/* Главная */
.home-page {
    overflow: hidden;
}

.home-hero {
    position: relative;
    overflow: hidden;
    padding: 4.75rem 0 4.5rem;
    text-align: left;
    background:
        radial-gradient(circle at 75% 22%, rgba(148, 137, 255, 0.42), transparent 29%),
        radial-gradient(circle at 100% 100%, rgba(81, 129, 255, 0.36), transparent 34%),
        linear-gradient(120deg, #28356f 0%, #4458b9 53%, #6d5bc8 100%);
}

.hero-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.03fr) minmax(420px, 0.97fr);
    gap: 3rem;
    align-items: center;
}

.hero-copy {
    position: relative;
    z-index: 2;
}

.eyebrow,
.section-eyebrow {
    display: inline-block;
    margin-bottom: 0.85rem;
    color: var(--primary-color);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.eyebrow-light {
    color: #d9ddff;
}

.hero-title {
    max-width: 700px;
    margin-bottom: 1.25rem;
    color: #fff;
    font-size: clamp(2.55rem, 5vw, 4.25rem);
    font-weight: 800;
    line-height: 1.06;
    letter-spacing: -0.055em;
}

.hero-subtitle {
    max-width: 620px;
    margin: 0 0 2rem;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.12rem;
    line-height: 1.7;
}

.hero-actions {
    justify-content: flex-start;
    gap: 0.8rem;
}

.hero-actions .btn {
    min-width: 0;
}

.hero-actions .btn-primary {
    color: #27336f;
    background: #fff;
    box-shadow: 0 12px 26px rgba(18, 26, 72, 0.22);
}

.hero-actions .btn-primary:hover {
    color: #27336f;
    background: #f4f5ff;
}

.btn-hero-outline {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.44);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
}

.btn-hero-outline:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.82);
    background: rgba(255, 255, 255, 0.18);
}

.trust-points {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem 1.25rem;
    margin-top: 2rem;
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.85rem;
}

.trust-point {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.trust-point-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    color: #30408f;
    background: #dce2ff;
    font-size: 0.7rem;
    font-weight: 800;
}

.hero-visual {
    position: relative;
    min-height: 410px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-glow {
    position: absolute;
    width: 210px;
    height: 210px;
    border-radius: 50%;
    filter: blur(5px);
    opacity: 0.55;
    background: #9ca8ff;
}

.hero-glow-one {
    top: 5%;
    right: 4%;
}

.hero-glow-two {
    bottom: 2%;
    left: 5%;
    width: 145px;
    height: 145px;
    background: #73c3ff;
}

.credential-preview {
    position: relative;
    z-index: 1;
    width: min(100%, 430px);
    min-height: 310px;
    padding: 1.65rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 24px;
    color: #263259;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(241, 244, 255, 0.92));
    box-shadow: 0 28px 70px rgba(17, 25, 69, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transform: rotate(3deg);
}

.credential-preview::after {
    position: absolute;
    right: -60px;
    bottom: -90px;
    width: 240px;
    height: 240px;
    border: 1px solid rgba(88, 101, 232, 0.16);
    border-radius: 50%;
    content: '';
}

.credential-topline,
.credential-bottomline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.credential-brand {
    color: #5662c8;
    font-size: 0.82rem;
    font-weight: 800;
}

.credential-status {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    color: #168061;
    background: #e0f7ee;
    font-size: 0.68rem;
    font-weight: 750;
}

.credential-seal {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin: 2.2rem auto 1.25rem;
    border: 1px solid #cdd5ff;
    border-radius: 50%;
    color: #5967d8;
    background: #eef0ff;
    font-size: 1.45rem;
}

.credential-kicker,
.credential-name {
    display: block;
    text-align: center;
}

.credential-kicker {
    color: #7b849d;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.15em;
}

.credential-title {
    display: block;
    max-width: 300px;
    margin: 0.55rem auto 0.4rem;
    text-align: center;
    color: #28345f;
    font-size: 1.35rem;
    line-height: 1.2;
}

.credential-name {
    color: #7b849d;
    font-size: 0.82rem;
}

.credential-bottomline {
    position: absolute;
    right: 1.65rem;
    bottom: 1.3rem;
    left: 1.65rem;
    color: #7b849d;
    font-size: 0.72rem;
}

.credential-qr {
    display: grid;
    grid-template-columns: repeat(2, 7px);
    gap: 2px;
    padding: 4px;
    border: 1px solid #cfd6ed;
    background: #fff;
}

.credential-qr i {
    display: block;
    width: 7px;
    height: 7px;
    background: #313b70;
}

.credential-qr i:nth-child(2),
.credential-qr i:nth-child(3) {
    background: #fff;
    border: 1px solid #313b70;
}

.hero-floating-label {
    position: absolute;
    z-index: 2;
    padding: 0.55rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 10px;
    color: #fff;
    background: rgba(27, 39, 99, 0.48);
    box-shadow: 0 10px 22px rgba(17, 25, 69, 0.16);
    backdrop-filter: blur(10px);
    font-size: 0.75rem;
    font-weight: 700;
}

.hero-floating-label-top {
    top: 7%;
    left: 0;
}

.hero-floating-label-bottom {
    right: 0;
    bottom: 8%;
}

.home-section {
    padding: 5rem 0;
}

.events-announcements {
    background: var(--bg-color);
}

.section-heading {
    margin-bottom: 2rem;
}

.section-heading-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1.5rem;
}

.section-heading-centered {
    max-width: 650px;
    margin-right: auto;
    margin-left: auto;
    text-align: center;
}

.section-heading .section-title {
    margin-bottom: 0.55rem;
    text-align: inherit;
}

.section-title {
    color: var(--text-color);
    font-size: clamp(1.8rem, 3vw, 2.35rem);
    font-weight: 800;
    letter-spacing: -0.04em;
}

.section-description {
    color: var(--muted-text);
}

.home-filter-panel,
.events-filter-panel {
    margin-bottom: 2rem;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 8px 24px rgba(34, 48, 83, 0.04);
}

.home-filter-grid,
.events-filter-grid {
    display: grid;
    grid-template-columns: minmax(180px, 1.5fr) repeat(4, minmax(130px, 1fr)) auto;
    gap: 0.8rem;
    align-items: end;
}

.filter-field {
    min-width: 0;
}

.filter-field label {
    display: block;
    margin-bottom: 0.45rem;
    color: #4b5565;
    font-size: 0.76rem;
    font-weight: 750;
}

.filter-field input,
.filter-field select,
.events-filter-panel input,
.events-filter-panel select {
    width: 100%;
    min-height: 44px;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-color);
    background: #fff;
    font: inherit;
    font-size: 0.9rem;
}

.filter-field input:focus,
.filter-field select:focus,
.events-filter-panel input:focus,
.events-filter-panel select:focus,
.input-large:focus {
    outline: 3px solid rgba(88, 101, 232, 0.14);
    border-color: var(--primary-color);
}

.filter-submit {
    min-height: 44px;
    white-space: nowrap;
}

.home-event-grid,
.events-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.home-event-card,
.event-card-modern {
    display: flex;
    min-height: 245px;
    flex-direction: column;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(34, 48, 83, 0.05);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.home-event-card:hover,
.event-card-modern:hover {
    border-color: #cdd4ff;
    box-shadow: var(--shadow-card);
    transform: translateY(-3px);
}

.home-event-card-top,
.event-card-modern-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
}

.event-date-badge {
    display: inline-flex;
    min-width: 48px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.5rem;
    border-radius: 11px;
    color: #4c5ad0;
    background: #eef0ff;
    line-height: 1;
}

.event-date-badge strong {
    font-size: 1.15rem;
}

.event-date-badge small {
    margin-top: 0.2rem;
    font-size: 0.67rem;
    text-transform: uppercase;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    color: #167a5f;
    background: #e4f8f0;
    font-size: 0.7rem;
    font-weight: 750;
    text-align: right;
}

.status-pill-danger {
    color: #b43b56;
    background: #fff0f3;
}

.home-event-card-body,
.event-card-modern-body {
    flex: 1;
    margin: 1rem 0;
}

.home-event-organization,
.event-card-organization {
    display: block;
    overflow: hidden;
    color: var(--primary-color);
    font-size: 0.78rem;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-event-card h3,
.event-card-modern h3 {
    margin: 0.45rem 0 0.55rem;
    color: var(--text-color);
    font-size: 1.12rem;
    line-height: 1.3;
}

.home-event-card p,
.event-card-modern-meta {
    color: var(--muted-text);
    font-size: 0.84rem;
}

.event-card-modern-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.8rem;
}

.event-card-modern-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.event-card-modern-actions .btn {
    flex: 1;
}

.event-card-note {
    display: inline-flex;
    align-items: center;
    color: var(--muted-text);
    font-size: .84rem;
    padding: .55rem .15rem;
}

.home-empty-state,
.events-empty-state {
    display: flex;
    min-height: 190px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 2rem;
    border: 1px dashed #cfd6e7;
    border-radius: 18px;
    color: var(--muted-text);
    background: rgba(255, 255, 255, 0.55);
    text-align: center;
}

.home-empty-state strong,
.events-empty-state strong {
    color: var(--text-color);
    font-size: 1.05rem;
}

.empty-state-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-bottom: 0.35rem;
    border-radius: 14px;
    color: var(--primary-color);
    background: #eef0ff;
    font-size: 1.25rem;
}

.loading-message {
    align-items: center;
    justify-content: center;
    min-height: 130px;
    color: var(--muted-text);
}

.verification-section {
    background: #fff;
}

.verification-card {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 2rem;
    align-items: center;
    padding: 2.25rem;
    border: 1px solid #dfe4ff;
    border-radius: 22px;
    background: linear-gradient(135deg, #f2f4ff, #f8faff);
}

.verification-copy .section-title {
    margin-bottom: 0.55rem;
    text-align: left;
}

.verification-copy p {
    max-width: 470px;
    color: var(--muted-text);
}

.verification-box {
    max-width: none;
    padding: 0.45rem;
    border: 1px solid #dfe4ff;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(80, 92, 174, 0.08);
}

.input-large {
    min-height: 48px;
    border: 0;
    border-radius: 10px;
}

.verification-box .btn {
    white-space: nowrap;
}

.home-feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.home-feature-grid .feature-card {
    min-height: 300px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(34, 48, 83, 0.04);
}

.home-feature-grid .feature-card:hover {
    border-color: #cdd4ff;
    box-shadow: var(--shadow-card);
    transform: translateY(-3px);
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    border-radius: 14px;
    font-size: 1.45rem;
    font-weight: 800;
}

.feature-icon-blue { color: #4e61d7; background: #e9edff; }
.feature-icon-violet { color: #8556bd; background: #f1eaff; }
.feature-icon-green { color: #168467; background: #e2f8ef; }

.home-feature-grid .feature-card h3 {
    margin-bottom: 0.35rem;
    color: var(--text-color);
    font-size: 1.15rem;
}

.feature-card-lead {
    min-height: 42px;
    margin-bottom: 0.85rem;
    color: var(--muted-text);
    font-size: 0.86rem;
}

.home-feature-grid .feature-card li {
    padding: 0.45rem 0;
    border-bottom-color: #edf0f5;
    color: #4b5565;
    font-size: 0.88rem;
}

.home-feature-grid .feature-card li:before {
    content: '✓';
    margin-right: 0.45rem;
}

/* Страница мероприятий */
.events-page {
    min-height: calc(100vh - 72px);
    padding-top: 2.7rem;
}

.events-page-header {
    align-items: center;
    margin-bottom: 2.2rem;
}

.events-page-header h2 {
    margin-bottom: 0.3rem;
    color: var(--text-color);
    font-size: clamp(2rem, 4vw, 2.8rem);
    letter-spacing: -0.05em;
}

.page-lead {
    max-width: 560px;
    color: var(--muted-text);
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.page-actions-centered {
    justify-content: center;
}

.filter-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.filter-panel-heading strong,
.filter-panel-heading span {
    display: block;
}

.filter-panel-heading strong {
    color: var(--text-color);
}

.filter-panel-heading span {
    margin-top: 0.2rem;
    color: var(--muted-text);
    font-size: 0.82rem;
}

.events-filter-grid {
    grid-template-columns: minmax(230px, 1.4fr) repeat(2, minmax(170px, 1fr));
}

.events-login-card {
    margin-top: 2rem;
    padding: 2.25rem;
    border: 1px solid #d7ddff;
    border-radius: 20px;
    background: linear-gradient(135deg, #eef2ff, #f8f9ff);
    text-align: center;
}

.events-login-card h3 {
    margin-bottom: 0.45rem;
    color: #273b91;
    font-size: 1.35rem;
}

.events-login-card p {
    max-width: 520px;
    margin: 0 auto 1.25rem;
    color: #59678f;
}

/* Остальные страницы получают те же базовые поверхности. */
.dashboard-header h2 {
    color: var(--text-color);
    letter-spacing: -0.04em;
}

.document-card,
.form-container {
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 24px rgba(34, 48, 83, 0.05);
}

.document-card h3 {
    color: var(--text-color);
}

.footer {
    margin-top: 0;
    padding: 2.5rem 0;
    background: #172033;
}

.footer-inner {
    gap: 1.5rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-align: left;
}

.footer-brand .brand-mark {
    width: 30px;
    height: 30px;
    box-shadow: none;
}

.footer-brand strong,
.footer-brand span:last-child {
    display: block;
}

.footer-brand strong {
    color: #fff;
}

.footer-brand span:last-child,
.footer-copy {
    color: #aab4ca;
    font-size: 0.78rem;
}

.footer-links a {
    color: #dce2f1;
    font-size: 0.86rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 1040px) {
    .hero-shell {
        grid-template-columns: minmax(0, 1fr) minmax(350px, 0.85fr);
        gap: 1.5rem;
    }

    .home-filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .filter-field-wide {
        grid-column: span 2;
    }

    .filter-submit {
        grid-column: span 1;
    }

    .home-event-grid,
    .events-grid,
    .home-feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .navbar .container {
        min-height: 64px;
    }

    .nav-menu {
        top: 64px;
        height: calc(100vh - 64px);
    }

    .home-hero {
        padding: 3.5rem 0 3.25rem;
    }

    .hero-shell {
        display: block;
    }

    .hero-title {
        font-size: clamp(2.3rem, 11vw, 3.3rem);
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .home-page .hero-actions .btn {
        width: 100%;
    }

    .hero-visual {
        min-height: 340px;
        margin-top: 2rem;
    }

    .credential-preview {
        transform: rotate(2deg) scale(0.92);
    }

    .hero-floating-label-top {
        left: 2%;
    }

    .hero-floating-label-bottom {
        right: 2%;
    }

    .home-section {
        padding: 3.5rem 0;
    }

    .section-heading-row,
    .events-page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .home-filter-grid,
    .events-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-field-wide,
    .filter-submit {
        grid-column: span 2;
    }

    .home-event-grid,
    .events-grid,
    .home-feature-grid {
        grid-template-columns: 1fr;
    }

    .verification-card {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }

    .verification-copy .section-title {
        text-align: left;
    }

    .verification-box {
        flex-direction: column;
        border: 0;
        padding: 0;
        box-shadow: none;
        background: transparent;
    }

    .verification-box .input-large,
    .verification-box .btn {
        width: 100%;
    }

    .events-page {
        padding-top: 2rem;
    }

    .page-actions .btn {
        width: auto;
        margin-bottom: 0;
    }

    .filter-panel-heading {
        align-items: flex-start;
    }

    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .brand-name {
        font-size: 1rem;
    }

    .brand-mark {
        width: 30px;
        height: 30px;
    }

    .trust-points {
        flex-direction: column;
        gap: 0.55rem;
    }

    .home-filter-grid,
    .events-filter-grid {
        grid-template-columns: 1fr;
    }

    .filter-field-wide,
    .filter-submit {
        grid-column: auto;
    }

    .filter-submit {
        width: 100%;
    }

    .credential-preview {
        width: 108%;
        transform: rotate(2deg) scale(0.78);
    }

    .hero-floating-label {
        font-size: 0.68rem;
    }

    .events-login-card {
        padding: 1.5rem 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #6b7280;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f9fafb;
    --text-color: #1f2937;
    --border-color: #e5e7eb;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-dropdown: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-color);
    background: var(--bg-color);
    line-height: 1.6;
}

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

/* Навигация */
.navbar {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.nav-brand h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-menu-toggle {
    display: none;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link.active {
    color: var(--primary-color);
}

/* Хлебные крошки */
.breadcrumbs {
    margin-bottom: 1.5rem;
    padding: 0.75rem 0;
}

.breadcrumbs ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.breadcrumb-item a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--text-color);
    font-weight: 500;
}

.breadcrumb-separator {
    margin-left: 0.5rem;
    color: var(--secondary-color);
}

/* Быстрые действия (FAB) */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: all 0.3s;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

/* Кнопка «Наверх» */
.back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s, background 0.2s;
}
.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}
.back-to-top:hover {
    background: var(--primary-dark);
}

.fab-menu {
    position: fixed;
    bottom: 8rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 99;
}

.fab-item {
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-color);
    white-space: nowrap;
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .fab {
        bottom: 1rem;
        right: 1rem;
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
    
    .fab-menu {
        bottom: 6rem;
        right: 1rem;
    }
    
    main.has-fab {
        padding-bottom: 5rem;
    }
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    text-align: center;
}

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

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

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5rem 2rem;
    text-align: center;
}

.hero-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    opacity: 0.95;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-actions .btn {
    min-width: 180px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.hero-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Hero outline button (for secondary actions on dark background) */
.btn-hero-outline {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.btn-hero-outline:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: white;
}

/* Features Section */
.features {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    color: var(--text-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: transform 0.2s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.feature-card ul {
    list-style: none;
}

.feature-card li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.feature-card li:last-child {
    border-bottom: none;
}

.feature-card li:before {
    content: "✓ ";
    color: var(--success-color);
    font-weight: bold;
}

/* Verification Section */
.verification-section {
    padding: 4rem 0;
    background: white;
}

.verification-box {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    gap: 1rem;
}

.input-large {
    flex: 1;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
}

.input-large:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Формы */
.form-container {
    max-width: 500px;
    margin: 2rem auto;
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--secondary-color);
    font-size: 0.875rem;
}

/* Form validation */
.form-group.is-invalid input,
.form-group.is-invalid select,
.form-group.is-invalid textarea {
    border-color: var(--danger-color);
}
.form-group .invalid-feedback {
    display: none;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--danger-color);
}
.form-group.is-invalid .invalid-feedback {
    display: block;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}
.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}
.empty-state-text {
    font-size: 1.125rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}
.empty-state-subtext {
    font-size: 0.875rem;
    color: #9ca3af;
}
.empty-state .btn {
    margin-top: 1rem;
}

/* Loading */
.loading-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    text-align: center;
    color: var(--secondary-color);
}
.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toasts */
#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}
.toast {
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-dropdown);
    background: white;
    color: var(--text-color);
    font-size: 0.9375rem;
    max-width: 360px;
    pointer-events: auto;
    animation: toastIn 0.25s ease-out;
}
@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
.toast--success {
    border-left: 4px solid var(--success-color);
}
.toast--error {
    border-left: 4px solid var(--danger-color);
}
.toast--info {
    border-left: 4px solid var(--primary-color);
}

.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.success-message {
    background: #d1fae5;
    color: #065f46;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

/* Dashboard */
.dashboard {
    padding: 2rem 0;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.document-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: transform 0.2s;
}

.document-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-dropdown);
}

.document-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.document-meta {
    color: var(--secondary-color);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.document-actions {
    display: flex;
    gap: 0.5rem;
}

/* Organization switcher */
.organization-switcher {
    position: relative;
    margin-left: auto;
}
.org-switcher-dropdown {
    position: relative;
}
.org-switcher-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.org-switcher-button:hover {
    border-color: var(--primary-color);
    background: var(--bg-color);
}
.org-switcher-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.org-name {
    font-weight: 500;
    color: var(--text-color);
}
.org-status-badge {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-weight: 500;
}
.org-status-badge.pending {
    background: #fef3c7;
    color: #92400e;
}
.org-status-badge.rejected {
    background: #fee2e2;
    color: #991b1b;
}
.org-status-badge.approved {
    background: #d1fae5;
    color: #065f46;
}
.org-switcher-arrow {
    font-size: 0.75rem;
    color: var(--secondary-color);
    transition: transform 0.2s;
}
.org-switcher-button[aria-expanded="true"] .org-switcher-arrow {
    transform: rotate(180deg);
}
.org-switcher-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 250px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-dropdown);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}
.org-switcher-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.org-switcher-header {
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
}
.org-switcher-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-color);
    transition: background 0.2s;
}
.org-switcher-item:hover {
    background: var(--bg-color);
}
.org-switcher-item.active {
    background: #e0e7ff;
    color: var(--primary-color);
}
.org-item-name {
    flex: 1;
    font-weight: 500;
}
.org-item-role {
    font-size: 0.8rem;
    color: var(--secondary-color);
    text-transform: capitalize;
}
.org-switcher-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}
.org-switcher-add {
    color: var(--primary-color);
    font-weight: 500;
}
.org-switcher-create-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: background 0.2s;
}
.org-switcher-create-link:hover {
    background: var(--primary-dark);
}
@media (max-width: 768px) {
    .org-switcher-menu {
        right: 0;
        left: auto;
        min-width: 200px;
    }
}

/* Footer */
.footer {
    background: var(--text-color);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}
.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.footer-links {
    display: flex;
    gap: 1.5rem;
}
.footer-links a {
    color: white;
    text-decoration: none;
}
.footer-links a:hover {
    text-decoration: underline;
}

/* Error page (404, etc.) */
.error-page {
    text-align: center;
    padding: 4rem 2rem;
}
.error-page-code {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 700;
}
.error-page-title {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}
.error-page-desc {
    color: var(--secondary-color);
    margin-bottom: 2rem;
}
.error-page-actions {
    margin-top: 1.5rem;
}

/* Dashboard header actions */
.dashboard-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Responsive */
/* Планшеты (768px - 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }
    
    .documents-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .event-card-info {
        grid-template-columns: 1fr;
    }
}

/* Мобильные устройства (до 768px) */
@media (max-width: 768px) {
    .hero {
        padding: 3rem 1rem;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .hero-actions .btn {
        min-width: unset;
    }
    
    /* Бургер-меню для навигации */
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: white;
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        transition: left 0.3s;
        z-index: 999;
        overflow-y: auto;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu .nav-link {
        padding: 1rem 20px;
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-menu-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        color: var(--text-color);
        padding: 0.5rem;
    }
    
    .verification-box {
        flex-direction: column;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    /* Адаптация форм */
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        font-size: 16px; /* Предотвращает зум на iOS */
    }
    
    /* Адаптация карточек */
    .document-card,
    .event-card {
        padding: 1rem;
    }
    
    .event-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .event-card-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .event-card-actions {
        flex-direction: column;
    }
    
    .event-card-actions .btn {
        width: 100%;
    }
    
    /* Адаптация таблиц */
    .documents-table {
        font-size: 0.875rem;
    }
    
    .documents-table th,
    .documents-table td {
        padding: 0.5rem;
    }
    
    /* Адаптация фильтров */
    .events-filters {
        flex-direction: column;
    }
    
    .filter-input,
    .filter-select {
        width: 100%;
    }
    
    /* Адаптация кнопок */
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn-large {
        padding: 1rem;
    }
    
    /* Адаптация редактора шаблонов */
    #canvas-container {
        overflow-x: auto;
    }
    
    /* Адаптация модальных окон */
    .modal {
        width: 95%;
        max-width: 95%;
        margin: 1rem auto;
        padding: 1rem;
    }
    
    /* Адаптация табов */
    .tabs,
    .event-tabs {
        flex-wrap: wrap;
        overflow-x: auto;
    }
    
    .tab,
    .event-tab {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }
    
    /* Адаптация категорий */
    .category-item {
        padding: 0.75rem;
    }
    
    .date-inputs {
        grid-template-columns: 1fr;
    }
}

/* Печать */
@media print {
    .navbar,
    .footer,
    .breadcrumbs,
    .back-to-top,
    .fab,
    .fab-menu,
    #toast-container,
    .nav-menu-toggle,
    .btn,
    .document-actions a,
    .chat-input-wrap,
    .support-instructions-block summary {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .container {
        max-width: 100%;
    }
    
    .document-card,
    .faq-item,
    .help-section,
    .feature-card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
    
    a[href]::after {
        content: none;
    }
    
    main {
        padding-top: 0;
    }
}

/* Финальный слой темы: расположен после базовых правил, чтобы каскад
   одинаково применял обновлённый стиль к старым и новым шаблонам. */
:root {
    --primary-color: #5865e8;
    --primary-dark: #4651c9;
    --secondary-color: #667085;
    --success-color: #16a37a;
    --danger-color: #d94b67;
    --warning-color: #d58a1d;
    --bg-color: #f6f8fc;
    --text-color: #172033;
    --border-color: #e3e8f2;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-card: 0 14px 40px rgba(34, 48, 83, 0.08);
    --shadow-dropdown: 0 16px 34px rgba(34, 48, 83, 0.14);
}

body { background: var(--bg-color); color: var(--text-color); }
.container { max-width: 1240px; }
.navbar { background: rgba(255,255,255,.94); border-bottom: 1px solid rgba(227,232,242,.9); box-shadow: 0 4px 20px rgba(34,48,83,.04); backdrop-filter: blur(16px); }
.navbar .container { min-height: 72px; padding-top: .75rem; padding-bottom: .75rem; }
.brand-lockup { display: inline-flex; align-items: center; gap: .65rem; color: var(--text-color); text-decoration: none; font-weight: 800; letter-spacing: -.025em; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 11px; color: #fff; background: linear-gradient(135deg,#6f7bf4,#7858d9); box-shadow: 0 8px 18px rgba(88,101,232,.28); font-size: 1.1rem; }
.brand-name { font-size: 1.14rem; white-space: nowrap; }
.nav-menu { gap: .2rem; }
.nav-link { padding: .6rem .8rem; border-radius: 10px; color: #4b5565; font-size: .93rem; transition: color .2s,background .2s,transform .2s; }
.nav-link:hover, .nav-link.active { color: var(--primary-color); background: #f0f2ff; }
.nav-link.btn-primary, .nav-link.btn-primary:hover, .nav-link.btn-primary.active { color: #fff; background: var(--primary-color); box-shadow: 0 8px 16px rgba(88,101,232,.18); }
.btn { border-radius: 11px; padding: .72rem 1.1rem; font-weight: 650; letter-spacing: -.01em; transition: transform .2s,box-shadow .2s,background .2s,border-color .2s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary-color); box-shadow: 0 8px 18px rgba(88,101,232,.2); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 10px 22px rgba(88,101,232,.28); }
.btn-secondary { background: #eef1f7; color: #465166; }
.btn-secondary:hover { background: #e2e7f1; color: #29344b; }
.btn-ghost, .btn-text { display: inline-flex; align-items: center; gap: .4rem; background: transparent; color: var(--primary-color); border: 1px solid #dce1ff; }
.btn-ghost:hover { background: #f0f2ff; border-color: #c9d0ff; }
.btn-text { border: 0; padding: .35rem 0; box-shadow: none; }
.btn-text:hover { color: var(--primary-dark); transform: none; }

.home-page .home-hero { padding: 4.75rem 0 4.5rem; text-align: left; background: radial-gradient(circle at 75% 22%,rgba(148,137,255,.42),transparent 29%),radial-gradient(circle at 100% 100%,rgba(81,129,255,.36),transparent 34%),linear-gradient(120deg,#28356f 0%,#4458b9 53%,#6d5bc8 100%); }
.home-page .hero-title { max-width: 700px; margin-bottom: 1.25rem; color: #fff; font-size: clamp(2.55rem,5vw,4.25rem); font-weight: 800; line-height: 1.06; letter-spacing: -.055em; }
.home-page .hero-subtitle { max-width: 620px; margin: 0 0 2rem; color: rgba(255,255,255,.82); font-size: 1.12rem; line-height: 1.7; }
.home-page .hero-actions { justify-content: flex-start; gap: .8rem; }
.home-page .hero-actions .btn { min-width: 0; }
.home-page .hero-actions .btn-primary { color: #27336f; background: #fff; box-shadow: 0 12px 26px rgba(18,26,72,.22); }
.home-page .hero-actions .btn-primary:hover { color: #27336f; background: #f4f5ff; }
.home-page .btn-hero-outline { color: #fff; border-color: rgba(255,255,255,.44); background: rgba(255,255,255,.1); }
.home-page .btn-hero-outline:hover { color: #fff; border-color: rgba(255,255,255,.82); background: rgba(255,255,255,.18); }
.home-page .section-title { color: var(--text-color); font-size: clamp(1.8rem,3vw,2.35rem); font-weight: 800; letter-spacing: -.04em; }
.home-page .verification-section { padding: 5rem 0; background: #fff; }
.home-page .verification-box { max-width: none; padding: .45rem; border: 1px solid #dfe4ff; border-radius: 14px; background: #fff; box-shadow: 0 12px 28px rgba(80,92,174,.08); }
.home-page .verification-box .input-large { min-height: 48px; border: 0; }
.home-page .feature-icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin-bottom: 1rem; border-radius: 14px; font-size: 1.45rem; font-weight: 800; }
.home-page .home-feature-grid .feature-card { min-height: 300px; padding: 1.5rem; border: 1px solid var(--border-color); border-radius: 18px; box-shadow: 0 8px 24px rgba(34,48,83,.04); }
.home-page .home-feature-grid .feature-card:hover { border-color: #cdd4ff; box-shadow: var(--shadow-card); transform: translateY(-3px); }
.home-page .home-feature-grid .feature-card h3 { margin-bottom: .35rem; color: var(--text-color); font-size: 1.15rem; }
.home-page .home-feature-grid .feature-card li { color: #4b5565; font-size: .88rem; }

.events-page { min-height: calc(100vh - 72px); padding-top: 2.7rem; }
.events-page-header { align-items: center; margin-bottom: 2.2rem; }
.events-page-header h2 { margin-bottom: .3rem; color: var(--text-color); font-size: clamp(2rem,4vw,2.8rem); letter-spacing: -.05em; }
.page-lead { max-width: 560px; color: #667085; }
.page-actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.events-filter-panel { margin-bottom: 2rem; padding: 1.25rem; border: 1px solid var(--border-color); border-radius: 18px; background: rgba(255,255,255,.88); box-shadow: 0 8px 24px rgba(34,48,83,.04); }
.filter-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.filter-panel-heading strong, .filter-panel-heading span { display: block; }
.filter-panel-heading strong { color: var(--text-color); }
.filter-panel-heading span { margin-top: .2rem; color: #667085; font-size: .82rem; }
.home-filter-grid, .events-filter-grid { display: grid; gap: .8rem; align-items: end; }
.home-filter-grid { grid-template-columns: minmax(180px,1.5fr) repeat(4,minmax(130px,1fr)) auto; }
.events-filter-grid { grid-template-columns: minmax(230px,1.4fr) repeat(2,minmax(170px,1fr)); }
.filter-field label { display: block; margin-bottom: .45rem; color: #4b5565; font-size: .76rem; font-weight: 750; }
.filter-field input, .filter-field select, .events-filter-panel input, .events-filter-panel select { width: 100%; min-height: 44px; padding: .65rem .75rem; border: 1px solid var(--border-color); border-radius: 10px; color: var(--text-color); background: #fff; font: inherit; font-size: .9rem; }
.filter-field input:focus, .filter-field select:focus, .events-filter-panel input:focus, .events-filter-panel select:focus, .input-large:focus { outline: 3px solid rgba(88,101,232,.14); border-color: var(--primary-color); }
.filter-submit { min-height: 44px; white-space: nowrap; }
.home-event-grid, .events-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1rem; }
.home-event-card, .event-card-modern { display: flex; min-height: 245px; flex-direction: column; padding: 1.25rem; border: 1px solid var(--border-color); border-radius: 18px; background: #fff; box-shadow: 0 8px 24px rgba(34,48,83,.05); transition: transform .2s,box-shadow .2s,border-color .2s; }
.home-event-card:hover, .event-card-modern:hover { border-color: #cdd4ff; box-shadow: var(--shadow-card); transform: translateY(-3px); }
.home-event-card-top, .event-card-modern-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; }
.event-date-badge { display: inline-flex; min-width: 48px; flex-direction: column; align-items: center; justify-content: center; padding: .45rem .5rem; border-radius: 11px; color: #4c5ad0; background: #eef0ff; line-height: 1; }
.event-date-badge strong { font-size: 1.15rem; }
.event-date-badge small { margin-top: .2rem; font-size: .67rem; text-transform: uppercase; }
.status-pill { display: inline-flex; align-items: center; padding: .35rem .55rem; border-radius: 999px; color: #167a5f; background: #e4f8f0; font-size: .7rem; font-weight: 750; text-align: right; }
.status-pill-danger { color: #b43b56; background: #fff0f3; }
.home-event-card-body, .event-card-modern-body { flex: 1; margin: 1rem 0; }
.home-event-organization, .event-card-organization { display: block; overflow: hidden; color: var(--primary-color); font-size: .78rem; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.home-event-card h3, .event-card-modern h3 { margin: .45rem 0 .55rem; color: var(--text-color); font-size: 1.12rem; line-height: 1.3; }
.home-event-card p, .event-card-modern-meta { color: #667085; font-size: .84rem; }
.event-card-modern-meta { display: flex; flex-wrap: wrap; gap: .5rem .8rem; }
.event-card-modern-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.event-card-modern-actions .btn { flex: 1; }
.home-empty-state, .events-empty-state { display: flex; min-height: 190px; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; padding: 2rem; border: 1px dashed #cfd6e7; border-radius: 18px; color: #667085; background: rgba(255,255,255,.55); text-align: center; }
.home-empty-state strong, .events-empty-state strong { color: var(--text-color); font-size: 1.05rem; }
.empty-state-icon { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; margin-bottom: .35rem; border-radius: 14px; color: var(--primary-color); background: #eef0ff; font-size: 1.25rem; }
.events-login-card { margin-top: 2rem; padding: 2.25rem; border: 1px solid #d7ddff; border-radius: 20px; background: linear-gradient(135deg,#eef2ff,#f8f9ff); text-align: center; }
.events-login-card h3 { margin-bottom: .45rem; color: #273b91; font-size: 1.35rem; }
.events-login-card p { max-width: 520px; margin: 0 auto 1.25rem; color: #59678f; }
.dashboard-header h2 { color: var(--text-color); letter-spacing: -.04em; }
.document-card, .form-container { border: 1px solid var(--border-color); box-shadow: 0 8px 24px rgba(34,48,83,.05); }
.document-card h3 { color: var(--text-color); }
.footer { margin-top: 0; padding: 2.5rem 0; background: #172033; }
.footer-inner { gap: 1.5rem; }
.footer-brand { display: flex; align-items: center; gap: .65rem; text-align: left; }
.footer-brand .brand-mark { width: 30px; height: 30px; box-shadow: none; }
.footer-brand strong, .footer-brand span:last-child { display: block; }
.footer-brand strong { color: #fff; }
.footer-brand span:last-child, .footer-copy { color: #aab4ca; font-size: .78rem; }
.footer-links a { color: #dce2f1; font-size: .86rem; }

@media (max-width: 1040px) {
    .hero-shell { grid-template-columns: minmax(0,1fr) minmax(350px,.85fr); gap: 1.5rem; }
    .home-filter-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .filter-field-wide { grid-column: span 2; }
    .filter-submit { grid-column: span 1; }
    .home-event-grid, .events-grid, .home-feature-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 768px) {
    .navbar .container { min-height: 64px; }
    .nav-menu { top: 64px; height: calc(100vh - 64px); }
    .home-page .home-hero { padding: 3.5rem 0 3.25rem; }
    .hero-shell { display: block; }
    .home-page .hero-title { font-size: clamp(2.3rem,11vw,3.3rem); }
    .home-page .hero-subtitle { font-size: 1rem; }
    .home-page .hero-actions { align-items: stretch; flex-direction: column; }
    .home-page .hero-actions .btn { width: 100%; }
    .hero-visual { min-height: 340px; margin-top: 2rem; }
    .credential-preview { transform: rotate(2deg) scale(.92); }
    .home-section { padding: 3.5rem 0; }
    .section-heading-row, .events-page-header { align-items: flex-start; flex-direction: column; }
    .home-filter-grid, .events-filter-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .filter-field-wide, .filter-submit { grid-column: span 2; }
    .home-event-grid, .events-grid, .home-feature-grid { grid-template-columns: 1fr; }
    .verification-card { grid-template-columns: 1fr; padding: 1.5rem; }
    .verification-copy .section-title { text-align: left; }
    .home-page .verification-box { flex-direction: column; border: 0; padding: 0; box-shadow: none; background: transparent; }
    .home-page .verification-box .input-large, .home-page .verification-box .btn { width: 100%; }
    .events-page { padding-top: 2rem; }
    .page-actions .btn { width: auto; margin-bottom: 0; }
    .filter-panel-heading { align-items: flex-start; }
    .footer-inner { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 480px) {
    .brand-name { font-size: 1rem; }
    .brand-mark { width: 30px; height: 30px; }
    .trust-points { flex-direction: column; gap: .55rem; }
    .home-filter-grid, .events-filter-grid { grid-template-columns: 1fr; }
    .filter-field-wide, .filter-submit { grid-column: auto; }
    .filter-submit { width: 100%; }
    .credential-preview { width: 108%; transform: rotate(2deg) scale(.78); }
    .events-login-card { padding: 1.5rem 1rem; }
}

/* Компактная навигация и защита от горизонтального разъезда страниц. */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.nav-menu,
.nav-primary-links,
.nav-actions {
    display: flex;
    align-items: center;
}

.nav-menu {
    justify-content: space-between;
    flex: 1;
    gap: 1.5rem;
    margin-left: 2rem;
}

.nav-primary-links,
.nav-actions {
    gap: 0.25rem;
}

.nav-actions {
    margin-left: auto;
}

.nav-cta {
    color: #fff !important;
    background: var(--primary-color);
    box-shadow: 0 8px 16px rgba(88, 101, 232, 0.18);
}

.nav-cta:hover,
.nav-cta.active {
    color: #fff !important;
    background: var(--primary-dark) !important;
}

.nav-account {
    position: relative;
}

.nav-account-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 42px;
    padding: 0.35rem 0.75rem 0.35rem 0.4rem;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #4b5565;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 0.93rem;
    font-weight: 650;
}

.nav-account-toggle:hover,
.nav-account-toggle.active,
.nav-account.is-open .nav-account-toggle {
    color: var(--primary-color);
    border-color: #dce1ff;
    background: #f0f2ff;
}

.nav-account-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(135deg, #6f7bf4, #7858d9);
    font-size: 0.8rem;
    font-weight: 800;
}

.nav-account-chevron {
    color: #7d879b;
    font-size: 1rem;
    line-height: 1;
    transition: transform 0.2s;
}

.nav-account.is-open .nav-account-chevron {
    transform: rotate(180deg);
}

.nav-account-menu {
    position: absolute;
    top: calc(100% + 0.65rem);
    right: 0;
    z-index: 1100;
    display: none;
    width: 270px;
    padding: 0.55rem;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow-dropdown);
}

.nav-account.is-open .nav-account-menu {
    display: block;
    animation: navMenuIn 0.16s ease-out;
}

@keyframes navMenuIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.nav-account-heading {
    padding: 0.7rem 0.75rem 0.8rem;
    border-bottom: 1px solid #edf0f5;
}

.nav-account-heading-label,
.nav-account-heading-caption {
    display: block;
}

.nav-account-heading-label {
    color: var(--text-color);
    font-size: 0.88rem;
    font-weight: 800;
}

.nav-account-heading-caption {
    margin-top: 0.2rem;
    color: var(--muted-text);
    font-size: 0.72rem;
}

.nav-account-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.62rem 0.75rem;
    border-radius: 9px;
    color: #4b5565;
    font-size: 0.84rem;
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
}

.nav-account-link:hover,
.nav-account-link.active {
    color: var(--primary-color);
    background: #f0f2ff;
}

.nav-account-link.nav-account-create {
    margin: 4px 8px;
    width: calc(100% - 16px);
    background: var(--primary-color);
    color: #fff;
    font-weight: 700;
}

.nav-account-link.nav-account-create:hover,
.nav-account-link.nav-account-create.active {
    background: #4b55d9;
    color: #fff;
}

.nav-account-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    color: #7884dc;
}

.nav-account-link-icon svg {
    display: block;
    width: 18px;
    height: 18px;
    overflow: visible;
}

.nav-account-chevron {
    display: block;
    width: 16px;
    height: 16px;
    margin-left: 0.1rem;
    transition: transform 0.2s ease;
}

.nav-account.is-open .nav-account-chevron {
    transform: rotate(180deg);
}

.nav-account-divider {
    height: 1px;
    margin: 0.45rem 0;
    background: #edf0f5;
}

.nav-account-logout {
    color: #b84760;
}

.nav-account-logout:hover {
    color: #b84760;
    background: #fff1f4;
}

.nav-account-menu .organization-switcher {
    width: 100%;
    margin: 0;
}

.nav-account-menu .org-switcher-button,
.nav-account-menu .org-switcher-create-link {
    width: 100%;
    margin: 0.2rem 0;
    border-radius: 9px;
    font-size: 0.82rem;
}

.nav-account-menu .org-switcher-menu {
    right: calc(100% + 0.5rem);
    left: auto;
    top: 0;
}

/* Админка: вкладки не должны растягивать весь документ по горизонтали. */
.admin-page {
    min-width: 0;
    overflow-x: clip;
}

.admin-page > .container {
    min-width: 0;
}

.admin-page .admin-header,
.admin-page .tabs,
.admin-page .tab-content {
    min-width: 0;
}

.admin-page .tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: 0.55rem;
    margin-bottom: 1.5rem;
    padding: 0.35rem;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(34, 48, 83, 0.04);
}

.admin-page .tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-width: 0;
    min-height: 54px;
    margin: 0;
    padding: 0.65rem 0.7rem;
    border: 1px solid transparent;
    border-radius: 11px;
    color: #667085;
    font-size: 0.82rem;
    line-height: 1.25;
    white-space: normal;
}

.admin-page .admin-tab-icon {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    overflow: visible;
}

.admin-page .tab .stat-badge {
    flex: 0 0 auto;
    margin-left: 0.2rem !important;
}

.admin-page .admin-header,
.admin-page .moderation-header {
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-page .moderation-stats,
.admin-page .moderation-header > div {
    flex-wrap: wrap;
    max-width: 100%;
}

.admin-page .moderation-header > div {
    justify-content: flex-end;
}

.admin-page .search-box,
.admin-page .search-input,
.admin-page select,
.admin-page input,
.admin-page textarea {
    max-width: 100%;
    box-sizing: border-box;
}

.admin-page .tab-content > [style*="grid-template-columns"] {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)) !important;
}

.admin-page .org-card-actions {
    flex-wrap: wrap;
}

.admin-page .org-card-actions .btn-approve,
.admin-page .org-card-actions .btn-reject {
    min-width: min(220px, 100%);
}

.admin-page table {
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
}

.admin-page .tab:hover {
    color: var(--primary-color);
    background: #f4f5ff;
}

.admin-page .tab.active {
    color: var(--primary-color);
    border-color: #cfd6ff;
    background: #eef0ff;
}

.admin-page .tab-content {
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.admin-page .tab-content > * {
    max-width: 100%;
}

.admin-page .documents-grid,
.admin-page .org-card-info {
    min-width: 0;
}

.admin-page table {
    max-width: 100%;
}

.admin-page .admin-header h2 {
    font-size: clamp(1.7rem, 3vw, 2.25rem);
    letter-spacing: -0.04em;
}

@media (max-width: 900px) {
    .nav-menu {
        gap: 0.75rem;
        margin-left: 1rem;
    }

    .nav-primary-links,
    .nav-actions {
        gap: 0.1rem;
    }

    .admin-page .tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .nav-menu {
        align-items: stretch;
        flex-direction: column;
        gap: 0;
        margin-left: 0;
        padding: 1rem 20px 2rem;
    }

    .nav-primary-links,
    .nav-actions {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
        gap: 0.25rem;
    }

    .nav-actions {
        margin-left: 0;
        padding-top: 0.55rem;
        border-top: 1px solid var(--border-color);
    }

    .nav-help-link {
        order: 5;
    }

    .nav-account-toggle,
    .nav-cta,
    .nav-actions > .nav-link {
        width: 100%;
        justify-content: flex-start;
        margin-bottom: 0;
    }

    .nav-account-menu {
        position: static;
        width: 100%;
        margin-top: 0.35rem;
        box-shadow: none;
        background: #f7f8fc;
    }

    .nav-account-menu .org-switcher-menu {
        position: absolute;
        right: 0;
        top: 100%;
    }

    .admin-page .tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .admin-page .tabs {
        grid-template-columns: 1fr 1fr;
    }
}
