/* Ветерок КБ 15 — Employee/Public UI 2.2 */

body.vk-portal {
    margin: 0;
    min-height: 100vh;
    color: var(--vk-text) !important;
    background:
        radial-gradient(circle at 86% -10%, var(--vk-accent-soft), transparent 30%),
        var(--vk-bg) !important;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    -webkit-font-smoothing: antialiased;
}

body.vk-portal *, body.vk-portal *::before, body.vk-portal *::after { box-sizing: border-box; }
body.vk-portal a { color: inherit; }
body.vk-portal button, body.vk-portal input, body.vk-portal select, body.vk-portal textarea { font: inherit; }
body.vk-portal h1, body.vk-portal h2, body.vk-portal h3 { color: var(--vk-text) !important; }
body.vk-portal .subtitle, body.vk-portal .muted { color: var(--vk-text-muted) !important; }

/* shared top brand */
.vk-portal-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: min(calc(100% - 28px), 1080px);
    margin: 0 auto 14px;
    padding-top: 18px;
}
.vk-portal-brand img { width: 166px; max-width: 56vw; height: auto; display: block; }
.vk-portal-brand .vk-theme-switcher { width: min(270px, 48vw); }

/* generic surfaces */
body.vk-portal :is(.card,.section,.profile,.month-card,.editor,.info,.admin-select-card) {
    background: linear-gradient(145deg, color-mix(in srgb, var(--vk-surface) 97%, transparent), color-mix(in srgb, var(--vk-surface-2) 80%, transparent)) !important;
    color: var(--vk-text) !important;
    border: 1px solid var(--vk-border) !important;
    box-shadow: var(--vk-shadow) !important;
}
body.vk-portal :is(input,select,textarea) {
    color: var(--vk-text) !important;
    background: var(--vk-input-bg) !important;
    border: 1px solid var(--vk-border-strong) !important;
    border-radius: var(--vk-radius-sm) !important;
    outline: none !important;
}
body.vk-portal :is(input,select,textarea):focus {
    border-color: color-mix(in srgb, var(--vk-accent) 66%, transparent) !important;
    box-shadow: 0 0 0 3px var(--vk-accent-soft) !important;
}
body.vk-portal input::placeholder, body.vk-portal textarea::placeholder { color: var(--vk-text-muted) !important; }
body.vk-portal button { transition: transform var(--vk-transition), opacity var(--vk-transition), background var(--vk-transition); }
body.vk-portal button:active { transform: translateY(1px); }

/* AUTH */
body.vk-auth {
    display: grid;
    place-items: center;
    padding: 26px 14px;
}
body.vk-auth .vk-portal-brand {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(calc(100% - 28px), 1080px);
    z-index: 10;
}
body.vk-auth .page { width: min(100%, 470px) !important; margin: 74px auto 0 !important; padding: 0 !important; }
body.vk-auth .card {
    border-radius: 26px !important;
    padding: clamp(22px, 5vw, 34px) !important;
    background: linear-gradient(150deg, var(--vk-surface), var(--vk-surface-2)) !important;
}
body.vk-auth h1 { margin-top: 0 !important; font-size: clamp(28px, 7vw, 38px) !important; letter-spacing: -.04em; }
body.vk-auth :is(.field,label) { color: var(--vk-text-soft) !important; }
body.vk-auth input { min-height: 50px !important; }
body.vk-auth form button,
body.vk-auth #loginButton,
body.vk-auth #registerButton,
body.vk-auth #verifyButton {
    min-height: 50px !important;
    border: 0 !important;
    border-radius: 14px !important;
    background: linear-gradient(135deg, var(--vk-accent), var(--vk-accent-hover)) !important;
    color: #1b0f08 !important;
    font-weight: 800 !important;
    box-shadow: 0 12px 28px color-mix(in srgb, var(--vk-accent) 20%, transparent) !important;
}
body.vk-auth .note, body.vk-auth .message.info {
    background: var(--vk-surface-2) !important;
    color: var(--vk-text-soft) !important;
    border-color: var(--vk-border) !important;
}
body.vk-auth .footer, body.vk-auth .small, body.vk-auth .sub { color: var(--vk-text-muted) !important; }
body.vk-auth .footer a { color: var(--vk-accent) !important; font-weight: 750; }

/* PROFILE */
body.vk-profile .page { width: min(calc(100% - 28px), 1050px) !important; padding: 0 0 52px !important; }
body.vk-profile .profile { border-radius: 26px !important; padding: 24px !important; overflow: hidden; }
body.vk-profile .profile::after { background: var(--vk-accent-soft) !important; }
body.vk-profile .avatar {
    background: linear-gradient(145deg, var(--vk-accent), var(--vk-accent-hover)) !important;
    color: #1c1008 !important;
    box-shadow: 0 12px 28px color-mix(in srgb, var(--vk-accent) 22%, transparent);
}
body.vk-profile .profile-name { color: var(--vk-text) !important; }
body.vk-profile .profile-position { color: var(--vk-text-muted) !important; }
body.vk-profile .status { background: color-mix(in srgb, var(--vk-success) 12%, transparent) !important; color: var(--vk-success) !important; }
body.vk-profile .work-link { background: var(--vk-accent) !important; color: #1c1008 !important; }
body.vk-profile .profile-menu { gap: 12px !important; }
body.vk-profile .menu-item {
    min-height: 118px;
    background: var(--vk-surface) !important;
    color: var(--vk-text) !important;
    border: 1px solid var(--vk-border) !important;
    border-radius: 18px !important;
    box-shadow: var(--vk-shadow) !important;
    transition: transform var(--vk-transition), border-color var(--vk-transition), background var(--vk-transition);
}
body.vk-profile .menu-item:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--vk-accent) 32%, var(--vk-border)) !important; }
body.vk-profile .menu-icon { color: var(--vk-accent) !important; }
body.vk-profile .menu-title { color: var(--vk-text) !important; }
body.vk-profile .menu-description { color: var(--vk-text-muted) !important; }
body.vk-profile .dashboard { gap: 12px !important; }
body.vk-profile .card { border-radius: 18px !important; }
body.vk-profile .card-label, body.vk-profile .card-small { color: var(--vk-text-muted) !important; }
body.vk-profile .card-value { color: var(--vk-text) !important; }
body.vk-profile .section { border-radius: 20px !important; }
body.vk-profile :is(.row,.list > *) { border-color: var(--vk-border) !important; background: color-mix(in srgb, var(--vk-surface-2) 46%, transparent) !important; }
body.vk-profile .section-link { color: var(--vk-accent) !important; }
body.vk-profile .admin-banner { background: color-mix(in srgb, var(--vk-info) 13%, transparent) !important; color: var(--vk-info) !important; border-color: color-mix(in srgb, var(--vk-info) 25%, transparent) !important; }

/* PROFILE SCHEDULE / REPLACEMENT */
body.vk-profile-subpage .page { width: min(calc(100% - 28px), 920px) !important; padding: 0 0 52px !important; }
body.vk-profile-subpage .top { margin-top: 4px !important; }
body.vk-profile-subpage .back {
    background: var(--vk-surface) !important;
    color: var(--vk-text) !important;
    border: 1px solid var(--vk-border) !important;
    box-shadow: var(--vk-shadow) !important;
}
body.vk-profile-subpage :is(.month-card,.editor,.card,.admin-select-card,.info) { border-radius: 20px !important; }
body.vk-profile-subpage .month-button {
    background: var(--vk-surface-2) !important;
    color: var(--vk-text) !important;
    border-color: var(--vk-border) !important;
}
body.vk-profile-subpage .weekday { color: var(--vk-text-muted) !important; }
body.vk-profile-subpage .calendar > * { border-color: var(--vk-border) !important; }
body.vk-profile-subpage .day { background: var(--vk-surface-2) !important; color: var(--vk-text) !important; }
body.vk-profile-subpage .day.work { background: color-mix(in srgb, var(--vk-success) 13%, var(--vk-surface)) !important; }
body.vk-profile-subpage .day.off { background: color-mix(in srgb, var(--vk-text-muted) 8%, var(--vk-surface)) !important; }
body.vk-profile-subpage .save,
body.vk-profile-subpage .confirm {
    background: linear-gradient(135deg, var(--vk-accent), var(--vk-accent-hover)) !important;
    color: #1b0f08 !important;
    border: 0 !important;
}
body.vk-profile-subpage .shift {
    background: var(--vk-surface-2) !important;
    color: var(--vk-text) !important;
    border-color: var(--vk-border) !important;
}
body.vk-profile-subpage .shift.selected { border-color: var(--vk-accent) !important; box-shadow: 0 0 0 3px var(--vk-accent-soft) !important; }

/* EMPLOYEE WORK PAGES */
body.vk-work .page { max-width: 980px !important; padding: 0 18px 56px !important; }
body.vk-work .top { margin-top: 4px !important; align-items: center !important; }
body.vk-work h1 { font-size: clamp(27px, 6vw, 36px); letter-spacing: -.035em; }
body.vk-work .admin-mode { background: color-mix(in srgb, var(--vk-info) 12%, transparent) !important; color: var(--vk-info) !important; }
body.vk-work .grid { gap: 12px !important; }
body.vk-work .card { border-radius: 20px !important; padding: 20px !important; }
body.vk-work .card-title { color: var(--vk-text) !important; }
body.vk-work .big { color: var(--vk-accent) !important; }
body.vk-work .task-row { background: var(--vk-surface-2) !important; border-color: var(--vk-border) !important; border-radius: 14px !important; }
body.vk-work .task-title { color: var(--vk-text) !important; }
body.vk-work .task-description { color: var(--vk-text-muted) !important; }

/* STAR RATING */
body.vk-rating .page { width: min(calc(100% - 28px), 820px) !important; padding: 0 0 52px !important; }
body.vk-rating .topbar { margin-top: 4px !important; }
body.vk-rating .back { background: var(--vk-surface) !important; color: var(--vk-text) !important; border: 1px solid var(--vk-border) !important; }
body.vk-rating .card { border-radius: 22px !important; }
body.vk-rating .my-place, body.vk-rating .breakdown-item, body.vk-rating .podium-item, body.vk-rating .rating-row, body.vk-rating .history-item {
    background: var(--vk-surface-2) !important;
    color: var(--vk-text) !important;
    border: 1px solid var(--vk-border) !important;
}
body.vk-rating .podium-item.first { background: color-mix(in srgb, var(--vk-accent) 15%, var(--vk-surface-2)) !important; }
body.vk-rating .rating-row.me { outline-color: var(--vk-accent) !important; }
body.vk-rating :is(.rating-detail,.history-date,.my-place span,.breakdown-item span) { color: var(--vk-text-muted) !important; }
body.vk-rating :is(.my-stars,.podium-stars,.rating-stars,.history-stars) { color: var(--vk-accent) !important; }

/* CABINET */
body.vk-cabinet .layout { min-height: 100vh; background: transparent !important; }
body.vk-cabinet .sidebar { background: var(--vk-sidebar-bg) !important; color: var(--vk-sidebar-text) !important; border-right: 1px solid var(--vk-border) !important; }
body.vk-cabinet .brand { color: var(--vk-text) !important; }
body.vk-cabinet .menu a { color: var(--vk-sidebar-muted) !important; }
body.vk-cabinet .menu a.active { background: var(--vk-accent-soft) !important; color: var(--vk-accent) !important; }
body.vk-cabinet .content { background: transparent !important; color: var(--vk-text) !important; }
body.vk-cabinet .logout { background: var(--vk-surface) !important; color: var(--vk-text) !important; border: 1px solid var(--vk-border) !important; }
body.vk-cabinet .card { border-radius: 20px !important; }
body.vk-cabinet .card-text, body.vk-cabinet .task-description { color: var(--vk-text-muted) !important; }
body.vk-cabinet .card-link { color: var(--vk-accent) !important; }
body.vk-cabinet .task-row { background: var(--vk-surface-2) !important; border-color: var(--vk-border) !important; }

/* legacy schedule */
body.vk-legacy-schedule .page { width: min(calc(100% - 28px), 980px) !important; margin: 0 auto; }

@media (max-width: 760px) {
    .vk-portal-brand { padding-top: 12px; margin-bottom: 10px; align-items: flex-start; }
    .vk-portal-brand img { width: 142px; }
    .vk-portal-brand .vk-theme-switcher { width: 196px; grid-template-columns: repeat(3, 1fr); }
    .vk-portal-brand .vk-theme-switcher button { font-size: 10px; padding: 0 4px; }

    body.vk-profile .profile-content { align-items: flex-start !important; }
    body.vk-profile .profile-menu { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    body.vk-profile .dashboard { grid-template-columns: 1fr !important; }
    body.vk-profile .menu-item { min-height: 104px; }

    body.vk-work .page { padding: 0 14px 40px !important; }
    body.vk-work .top { flex-direction: row !important; align-items: flex-start !important; }
    body.vk-work .grid { grid-template-columns: 1fr !important; }
    body.vk-work .task-row { flex-direction: column !important; }

    body.vk-cabinet .layout { display: block !important; }
    body.vk-cabinet .sidebar { width: 100% !important; min-height: 0 !important; padding: 14px !important; }
    body.vk-cabinet .menu { display: flex !important; overflow-x: auto; gap: 8px; }
    body.vk-cabinet .menu a { white-space: nowrap; }
    body.vk-cabinet .content { padding: 18px 14px 40px !important; }
    body.vk-cabinet .grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 430px) {
    .vk-portal-brand { width: calc(100% - 20px); }
    body.vk-profile .page,
    body.vk-profile-subpage .page,
    body.vk-rating .page { width: calc(100% - 20px) !important; }
    body.vk-profile .profile { padding: 18px !important; }
    body.vk-profile .avatar { width: 58px !important; height: 58px !important; flex-basis: 58px !important; border-radius: 18px !important; }
    body.vk-profile .profile-menu { gap: 8px !important; }
    body.vk-profile .menu-item { padding: 13px !important; }
}

/* =========================================================
   PORTAL POLISH 2.3
   ========================================================= */
body.vk-portal {
    overflow-x: hidden;
}

.vk-portal-brand {
    min-height: 58px;
}

body.vk-auth .card,
body.vk-profile .profile,
body.vk-profile .section,
body.vk-work .card,
body.vk-rating .card,
body.vk-cabinet .card {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

body.vk-auth form {
    display: grid;
    gap: 14px;
}
body.vk-auth :is(input,select) {
    width: 100% !important;
}

body.vk-profile .profile-menu .menu-item {
    position: relative;
    overflow: hidden;
}
body.vk-profile .profile-menu .menu-item::after {
    content: "";
    position: absolute;
    width: 72px;
    height: 72px;
    right: -30px;
    top: -30px;
    border-radius: 50%;
    background: var(--vk-accent-soft);
    pointer-events: none;
}

body.vk-profile-subpage .shift,
body.vk-work .task-row,
body.vk-rating .rating-row,
body.vk-rating .history-item {
    transition: border-color var(--vk-transition), background var(--vk-transition), transform var(--vk-transition);
}

body.vk-work .card {
    min-width: 0;
}
body.vk-work .task-row {
    padding: 14px !important;
}

body.vk-rating .podium {
    gap: 10px !important;
}
body.vk-rating .podium-item {
    min-width: 0;
}

@media (max-width: 760px) {
    .vk-portal-brand {
        position: relative;
        z-index: 5;
        width: calc(100% - 24px);
    }
    .vk-portal-brand .vk-theme-switcher {
        max-width: 210px;
    }

    body.vk-auth {
        padding-top: 12px !important;
    }
    body.vk-auth .vk-portal-brand {
        position: static;
        transform: none;
    }
    body.vk-auth .page {
        margin-top: 8px !important;
    }

    body.vk-profile .profile-content {
        gap: 12px !important;
    }
    body.vk-profile .profile-menu {
        grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    }

    body.vk-rating .podium {
        grid-template-columns: repeat(3, minmax(0,1fr)) !important;
    }
    body.vk-rating .podium-name {
        font-size: 12px !important;
    }
}

@media (max-width: 430px) {
    .vk-portal-brand {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .vk-portal-brand img {
        width: 148px;
    }
    .vk-portal-brand .vk-theme-switcher {
        width: 100%;
        max-width: none;
    }

    body.vk-profile .profile-menu {
        grid-template-columns: 1fr !important;
    }
    body.vk-profile .menu-item {
        min-height: 88px;
    }

    body.vk-rating .podium {
        grid-template-columns: 1fr !important;
    }
    body.vk-rating .podium-item.first {
        order: -1;
    }
}
