:root {
    --color-brand: #362fc1;
    --color-brand-dark: #252d4f;
    --color-brand-soft: #73a8dc;
    --color-bg: #f3f4f8;
    --color-surface: #ffffff;
    --color-border: #e5e7f3;
    --color-text: #252d4f;
    --color-text-soft: #5e6280;
    --color-highlight-blue: #b9d8f4;
    --color-highlight-pink: #f5d4da;
    --color-shadow: 0 18px 40px rgba(37, 45, 79, 0.08);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: 'Barlow', sans-serif;
}

html.auth-pending body {
    visibility: hidden;
}

body {
    overflow-x: hidden;
    overflow-y: auto;
}

button,
a,
img {
    -webkit-tap-highlight-color: transparent;
}

button,
a {
    font: inherit;
}

.app-shell {
    min-height: 100vh;
}

.topbar {
    height: 56px;
    background: var(--color-brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: relative;
}

.topbar__brand,
.topbar__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.topbar__menu-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    padding: 0 8px;
    cursor: pointer;
}

.topbar__menu-btn span {
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
}

.topbar__logo-link {
    display: inline-flex;
    align-items: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.topbar__logo {
    height: 26px;
    width: auto;
    display: block;
}

.topbar__profile-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    padding: 4px 0 4px 8px;
}

.topbar__profile-name {
    display: none;
    font-size: 14px;
    font-weight: 600;
}

.topbar__profile-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fff;
    color: var(--color-brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.topbar__profile-avatar--image {
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.topbar__profile-caret {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid rgba(255, 255, 255, 0.95);
}

.profile-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(220px, calc(100vw - 32px));
    background: var(--color-surface);
    border: 1px solid rgba(37, 45, 79, 0.08);
    border-radius: 16px;
    box-shadow: var(--color-shadow);
    overflow: hidden;
    z-index: 40;
}

.profile-menu__item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border: 0;
    background: transparent;
    text-decoration: none;
    color: var(--color-text);
    padding: 14px 16px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
}

.profile-menu__item + .profile-menu__item {
    border-top: 1px solid rgba(37, 45, 79, 0.08);
}

.profile-menu__item--danger {
    color: #9f2f5d;
}

.shell-layout {
    position: relative;
    display: flex;
    min-height: calc(100vh - 56px);
}

.shell-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 24, 42, 0.45);
    z-index: 90;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-width: 380px;
    background: var(--color-surface);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar.is-open {
    transform: translateX(0);
}

.sidebar__header {
    background: var(--color-brand);
    color: #fff;
    padding: 16px 20px 24px;
}

.sidebar__header-top {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.sidebar__close-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background: transparent;
    border: none;
    color: #fff;
    padding: 0;
    margin-left: -8px;
    cursor: pointer;
}

.sidebar__close-btn svg {
    width: 28px;
    height: 28px;
}

.sidebar__brand {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.sidebar__profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar__avatar {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sidebar__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar__verified-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sidebar__verified-badge svg {
    width: 24px;
    height: 24px;
}

.sidebar__user-info {
    flex: 1;
}

.sidebar__user-name {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.1;
}

.sidebar__user-cuil {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    opacity: 0.95;
}

.sidebar__user-verified {
    margin: 0;
    font-size: 14px;
    opacity: 0.95;
    font-weight: 500;
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    padding: 12px 20px;
    flex: 1;
}

.nav-link {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px 0;
    border: 0;
    background: transparent;
    color: var(--color-text);
    text-decoration: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    text-align: left;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.nav-link:last-child {
    border-bottom: 0;
}

.nav-link.has-border {
    border-bottom: 1px solid rgba(0,0,0,0.18);
    margin-bottom: 8px;
    padding-bottom: 24px;
}

.nav-link__icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #666;
}

.nav-link__icon img,
.nav-link__icon svg {
    width: 26px;
    height: 26px;
    display: block;
}

.home {
    flex: 1;
    width: 100%;
    min-height: calc(100vh - 56px);
    overflow-y: auto;
    padding: 22px 16px calc(92px + 28px);
}

.welcome {
    text-align: center;
    margin: 0 auto 20px;
    max-width: 720px;
}

.welcome__title {
    margin: 0 0 10px;
    font-size: 24px;
    line-height: 1.15;
    font-weight: 700;
}

.welcome__subtitle {
    margin: 0;
    color: var(--color-text-soft);
    font-size: 15px;
    line-height: 1.45;
    font-weight: 500;
}

.home-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    width: min(100%, 1100px);
    margin: 0 auto;
}

.panel,
.shortcuts-panel {
    border-radius: var(--radius-xl);
    background: var(--color-surface);
    box-shadow: var(--color-shadow);
}

.panel {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
}

.panel[role="button"],
.panel[role="link"] {
    cursor: pointer;
}

.panel__media {
    width: 74px;
    height: 74px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.panel__media--compact {
    width: 62px;
    height: 62px;
    background: transparent;
    border-radius: 0;
}

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

.panel__content {
    min-width: 0;
}

.panel__eyebrow {
    margin: 0 0 4px;
    color: var(--color-text-soft);
    font-size: 13px;
    font-weight: 600;
}

.panel__title {
    margin: 0;
    font-size: 24px;
    line-height: 1.05;
    font-weight: 700;
}

.panel__title--small {
    font-size: 20px;
    line-height: 1.15;
}

.panel__description {
    margin: 6px 0 0;
    font-size: 14px;
    line-height: 1.35;
    color: rgba(37, 45, 79, 0.9);
    font-weight: 500;
}

.panel--turns {
    background: var(--color-surface);
    border: 1px solid rgba(54, 47, 193, 0.08);
}

.panel--holiday {
    background: var(--color-highlight-blue);
}

.panel--profile {
    background: var(--color-highlight-pink);
}

.pill-action {
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: var(--color-brand);
    color: #fff;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

.shortcuts-panel {
    padding: 18px;
}

.section-title {
    margin: 0 0 16px;
    font-size: 24px;
    line-height: 1.1;
    font-weight: 700;
}

.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.shortcut {
    border: 0;
    border-radius: 22px;
    background: var(--color-surface);
    box-shadow: inset 0 0 0 1px rgba(54, 47, 193, 0.08);
    padding: 16px 10px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    min-height: 134px;
}

.shortcut__icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shortcut__icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.shortcut__label {
    text-align: center;
    color: var(--color-brand-dark);
    font-size: 15px;
    line-height: 1.1;
    font-weight: 500;
}

.shortcut__label strong {
    display: block;
    font-weight: 600;
}

.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    z-index: 30;
    width: 100%;
    max-width: 1200px;
    height: 92px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    align-items: start;
    padding: 8px 10px 14px;
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid rgba(25, 31, 55, 0.08);
    box-shadow: 0 -3px 10px rgba(28, 33, 56, 0.08);
}

.bottom-nav__item {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    padding: 4px 0 0;
    color: #6f7078;
    cursor: pointer;
    border: 0;
    background: transparent;
}

.bottom-nav__item--active {
    color: var(--color-brand);
}

.bottom-nav__icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bottom-nav__icon svg {
    width: 26px;
    height: 26px;
}

.bottom-nav__item span:last-child {
    font-size: 14px;
    line-height: 1;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(92px + 12px);
    transform: translateX(-50%);
    width: min(calc(100vw - 32px), 360px);
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(37, 45, 79, 0.96);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    box-shadow: 0 18px 32px rgba(8, 12, 28, 0.26);
    z-index: 150;
}

.is-hidden {
    display: none !important;
}

@media (min-width: 900px) {
    .topbar {
        padding: 0 20px;
    }

    .topbar__profile-name {
        display: inline;
    }

    .home {
        padding: 22px 28px calc(92px + 32px);
    }

    .welcome__title {
        font-size: 26px;
    }

    .home-grid {
        grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.95fr);
        grid-template-areas:
            "turns holiday"
            "shortcuts profile";
        align-items: start;
    }

    .panel--turns {
        grid-area: turns;
    }

    .panel--holiday {
        grid-area: holiday;
    }

    .shortcuts-panel {
        grid-area: shortcuts;
    }

    .panel--profile {
        grid-area: profile;
    }

    .shortcuts-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 899px) {
    .panel--holiday,
    .panel--profile {
        min-height: 108px;
    }
}

@media (max-width: 599px) {
    .topbar {
        padding: 0 12px;
    }

    .topbar__logo {
        height: 24px;
    }

    .home {
        padding: 16px 12px 28px;
    }

    .welcome {
        padding-top: 4px;
        margin-bottom: 14px;
    }

    .welcome__title {
        font-size: 20px;
        margin-bottom: 8px;
    }

    .welcome__subtitle {
        font-size: 14px;
    }

    .panel,
    .shortcuts-panel {
        border-radius: 20px;
    }

    .panel {
        padding: 16px;
        gap: 12px;
    }

    .panel__media {
        width: 58px;
        height: 58px;
        border-radius: 16px;
    }

    .panel__title {
        font-size: 22px;
    }

    .panel__title--small {
        font-size: 18px;
    }

    .section-title {
        font-size: 22px;
        margin-bottom: 14px;
    }

    .shortcuts-panel {
        padding: 16px;
    }

    .shortcuts-grid {
        gap: 12px;
    }

    .shortcut {
        min-height: 116px;
        border-radius: 18px;
        padding: 14px 8px 12px;
        gap: 10px;
    }

    .shortcut__icon {
        width: 42px;
        height: 42px;
    }

    .shortcut__label {
        font-size: 13px;
    }
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 24, 42, 0.7);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.modal-overlay:not([hidden]) {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: 32px 24px;
    width: 100%;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 24px 48px rgba(37, 45, 79, 0.15);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay:not([hidden]) .modal {
    transform: scale(1);
}

.modal__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    background: var(--color-highlight-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal__icon svg {
    width: 32px;
    height: 32px;
}

.modal__title {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 12px;
}

.modal__text {
    font-size: 16px;
    line-height: 1.5;
    color: var(--color-text-soft);
    margin: 0 0 28px;
}

.modal__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.install-steps {
    text-align: left;
    margin-bottom: 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.install-step {
    background: var(--color-bg);
    padding: 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

.install-step strong {
    display: block;
    font-size: 15px;
    color: var(--color-text);
    margin-bottom: 4px;
}

.install-step p {
    margin: 0;
    font-size: 14px;
    color: var(--color-text-soft);
    line-height: 1.4;
}
