/* ==========================================================================
   Calendio 2026 Layout
   Scope: app shell, sidebar, navigation, topbar, mobile drawer overlay
   Depends on: app.css tokens
   ========================================================================== */

/* --------------------------------------------------------------------------
   Layout shell
   -------------------------------------------------------------------------- */

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 292px minmax(0, 1fr);
    background:
        radial-gradient(circle at 8% 0%, rgba(var(--calendio-accent-rgb, 240, 91, 168), .10), transparent 30%),
        radial-gradient(circle at 100% 0%, rgba(var(--calendio-primary-rgb, 109, 93, 246), .12), transparent 28%),
        radial-gradient(circle at 60% 0%, rgba(var(--calendio-peach-rgb, 255, 179, 107), .08), transparent 24%),
        var(--calendio-bg, #FAF7F3);
}

.app-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: transparent;
}

.app-content {
    width: 100%;
    min-width: 0;
    padding: 18px 28px 32px;
    color: var(--calendio-text, #303544);
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */

.app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
    /* Bottom padding reserves clearance below the footer links (My
       account / Logout) so the fixed "Cookie settings" reopen button
       (bottom: 16px, ~36px tall — see calendio-cookie-consent.css)
       never sits on top of them. */
    padding: 18px 14px 76px;
    color: rgba(255, 255, 255, .90);
    border-right: 1px solid rgba(255, 255, 255, .09);
    background:
        radial-gradient(circle at 12% 0%, rgba(var(--calendio-primary-rgb, 109, 93, 246), .34), transparent 30%),
        radial-gradient(circle at 100% 12%, rgba(var(--calendio-accent-rgb, 240, 91, 168), .18), transparent 26%),
        radial-gradient(circle at 70% 100%, rgba(var(--calendio-peach-rgb, 255, 179, 107), .10), transparent 30%),
        var(--calendio-sidebar-bg, #111827);
    box-shadow: 18px 0 46px rgba(31, 35, 48, .16);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .22) transparent;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.app-sidebar::-webkit-scrollbar {
    width: 8px;
}

.app-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.app-sidebar::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 255, 255, .20);
}

/* --------------------------------------------------------------------------
   Brand
   -------------------------------------------------------------------------- */

.app-sidebar__brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    padding: 2px 4px 0;
}

.app-brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: #FFFFFF;
    text-decoration: none;
}

.app-brand-link:hover,
.app-brand-link:focus {
    color: #FFFFFF;
    text-decoration: none;
}

.app-brand-mark {
    flex: 0 0 auto;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0 !important;
    border-radius: 16px;
    background:
        radial-gradient(circle at 20% 0%, rgba(255, 255, 255, .26), transparent 38%),
        linear-gradient(135deg, var(--calendio-primary, #6D5DF6), var(--calendio-pink, #F05BA8));
    color: #FFFFFF;
    box-shadow:
        0 16px 32px rgba(var(--calendio-primary-rgb, 109, 93, 246), .30),
        inset 0 0 0 1px rgba(255, 255, 255, .20);
    font-size: 17px;
    line-height: 1 !important;
    font-weight: 950;
    letter-spacing: -.04em;
    text-align: center;
    vertical-align: middle;
}

.app-brand-mark,
.app-brand-mark * {
    box-sizing: border-box;
}

.app-brand-link > div:not(.app-brand-mark) {
    min-width: 0;
}

.app-brand-link strong,
.app-brand-link span:first-child {
    display: block;
    color: #FFFFFF;
    font-size: 17px;
    line-height: 1.05;
    font-weight: 950;
    letter-spacing: -.035em;
}

.app-brand-link small {
    display: block;
    margin-top: 3px;
    color: rgba(255, 255, 255, .68);
    font-size: 12px;
    line-height: 1.2;
    font-weight: 750;
}

/* --------------------------------------------------------------------------
   Sidebar buttons
   -------------------------------------------------------------------------- */

.app-sidebar__close,
.app-topbar__menu-btn {
    position: relative;
    align-items: center;
    justify-content: center;
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0 !important;
    border: 1px solid var(--calendio-border, #E8DED2);
    border-radius: 15px;
    background: rgba(255, 255, 255, .82);
    color: var(--calendio-ink, #1F2330);
    box-shadow: var(--calendio-shadow-sm, 0 6px 18px rgba(31, 35, 48, .06));
    font: inherit;
    font-size: 22px;
    line-height: 1 !important;
    font-weight: 950;
    text-align: center;
    cursor: pointer;
    transition:
        transform .16s ease,
        background .16s ease,
        color .16s ease,
        border-color .16s ease,
        box-shadow .16s ease;
}

.app-sidebar__close {
    display: none;
    border-color: rgba(255, 255, 255, .10);
    background: rgba(255, 255, 255, .08);
    color: #FFFFFF;
    box-shadow: none;
}

.app-topbar__menu-btn {
    display: none;
}

.app-sidebar__close:hover,
.app-topbar__menu-btn:hover {
    transform: translateY(-1px);
}

.app-sidebar__close:hover {
    background: rgba(255, 255, 255, .14);
    color: #FFFFFF;
}

.app-topbar__menu-btn:hover {
    background: #FFFFFF;
    color: var(--calendio-primary-hover, #5947E8);
}

.app-topbar__menu-btn::before,
.app-sidebar__close::before {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 18px;
}

.app-topbar__menu-btn svg,
.app-sidebar__close svg {
    display: block;
    width: 22px;
    height: 22px;
    pointer-events: none;
}

.app-topbar__menu-btn span,
.app-sidebar__close span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   Tenant / workspace card
   -------------------------------------------------------------------------- */

.app-sidebar__tenant {
    position: relative;
    overflow: hidden;
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 20px;
    background:
        radial-gradient(circle at top right, rgba(var(--calendio-accent-rgb, 240, 91, 168), .18), transparent 40%),
        linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .045));
    box-shadow:
        0 14px 36px rgba(0, 0, 0, .16),
        inset 0 0 0 1px rgba(255, 255, 255, .035);
}

.app-sidebar__tenant::before {
    content: "";
    position: absolute;
    right: -38px;
    bottom: -42px;
    width: 110px;
    height: 110px;
    border-radius: 999px;
    background: rgba(var(--calendio-primary-rgb, 109, 93, 246), .20);
    pointer-events: none;
}

.app-sidebar__tenant > * {
    position: relative;
    z-index: 1;
}

.app-sidebar__tenant-label {
    margin-bottom: 7px;
    color: rgba(255, 255, 255, .68);
    font-size: 10.5px;
    line-height: 1;
    font-weight: 950;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.app-sidebar__tenant-name {
    overflow: hidden;
    color: #FFFFFF;
    font-size: 15px;
    line-height: 1.2;
    font-weight: 950;
    letter-spacing: -.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-sidebar__tenant-meta {
    margin-top: 6px;
    color: rgba(255, 255, 255, .68);
    font-size: 12px;
    line-height: 1.35;
    font-weight: 750;
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */

.app-nav {
    display: grid;
    gap: 18px;
}

.app-nav__group {
    display: grid;
    gap: 4px;
}

.app-nav__title {
    padding: 0 10px 7px;
    color: rgba(255, 255, 255, .62);
    font-size: 10.5px;
    line-height: 1;
    font-weight: 950;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.app-nav__item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 44px;
    margin-bottom: 2px;
    padding: 10px 11px;
    border: 1px solid transparent;
    border-radius: 15px;
    color: rgba(255, 255, 255, .88);
    text-decoration: none;
    transition:
        transform .16s ease,
        background .16s ease,
        border-color .16s ease,
        color .16s ease,
        box-shadow .16s ease;
}

.app-nav__item::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 11px;
    bottom: 11px;
    width: 3px;
    border-radius: 999px;
    background: transparent;
    transition: background .16s ease;
}

.app-nav__item:hover,
.app-nav__item:focus {
    transform: translateX(2px);
    border-color: rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .075);
    color: #FFFFFF;
    text-decoration: none;
}

.app-nav__item.is-active {
    border-color: rgba(255, 255, 255, .12);
    background:
        radial-gradient(circle at top right, rgba(var(--calendio-accent-rgb, 240, 91, 168), .16), transparent 40%),
        linear-gradient(135deg, rgba(var(--calendio-primary-rgb, 109, 93, 246), .30), rgba(255, 255, 255, .08));
    color: #FFFFFF;
    box-shadow:
        0 12px 26px rgba(0, 0, 0, .14),
        inset 0 0 0 1px rgba(255, 255, 255, .045);
}

.app-nav__item.is-active::before {
    background:
        linear-gradient(180deg, var(--calendio-pink, #F05BA8), var(--calendio-peach, #FFB36B));
}

.app-nav__icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: currentColor;
    opacity: 1;
}

.app-nav__icon svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.9;
}

.app-nav__label {
    min-width: 0;
    overflow: hidden;
    color: inherit;
    opacity: 1;
    font-size: 13.5px;
    line-height: 1.25;
    font-weight: 900;
    letter-spacing: -.005em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/*
 * Setup guide item while the business cannot receive bookings yet: a
 * gradient ring runs around the item three times on every page load and
 * then rests, while the progress badge stays visible. Browsers without
 * @property support show the same ring without the motion.
 */
@property --app-nav-attention-angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

.app-nav__badge {
    flex: 0 0 auto;
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--calendio-pink, #F05BA8), var(--calendio-peach, #FFB36B));
    color: #1F1A3D;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.5;
    letter-spacing: .01em;
    white-space: nowrap;
}

.app-nav__badge--success {
    background: var(--calendio-mint, #7FE0C2);
}

/* "You have work here" counters (MenuBadgeService). */
.app-nav__badge--todo {
    min-width: 20px;
    text-align: center;
}

.app-nav__badge--alert {
    min-width: 20px;
    background: #F2555A;
    color: #FFFFFF;
    text-align: center;
}

.app-nav__badge--dot {
    width: 9px;
    min-width: 0;
    height: 9px;
    padding: 0;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .12);
}

.app-nav__item--toggle .app-nav__badge--dot {
    margin-right: 6px;
}

/* Mobile menu button: something in the (closed) menu needs attention. */
.app-topbar__menu-btn {
    position: relative;
}

.app-topbar__menu-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 9px;
    height: 9px;
    border: 2px solid #FFFFFF;
    border-radius: 999px;
    background: var(--calendio-pink, #F05BA8);
}

.app-nav__sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.app-nav__item--attention {
    border-color: transparent;
    background: rgba(255, 255, 255, .06);
}

.app-nav__item--attention::after {
    content: "";
    position: absolute;
    inset: -1px;
    padding: 2px;
    border-radius: inherit;
    background: conic-gradient(
        from var(--app-nav-attention-angle),
        var(--calendio-pink, #F05BA8),
        var(--calendio-peach, #FFB36B),
        rgba(255, 255, 255, 0) 45%,
        rgba(255, 255, 255, 0) 70%,
        var(--calendio-primary, #6D5DF6),
        var(--calendio-pink, #F05BA8)
    );
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    animation: app-nav-attention-spin 2.6s linear 3;
}

@keyframes app-nav-attention-spin {
    to {
        --app-nav-attention-angle: 360deg;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-nav__item--attention::after {
        animation: none;
    }
}

.app-nav__submenu {
    display: grid;
}

.app-nav__submenu > summary {
    cursor: pointer;
    list-style: none;
}

.app-nav__submenu > summary::-webkit-details-marker {
    display: none;
}

.app-nav__chevron {
    flex: 0 0 auto;
    margin-left: auto;
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    opacity: .55;
    transition: transform .16s ease;
}

.app-nav__submenu[open] > summary .app-nav__chevron {
    transform: rotate(-135deg);
}

.app-nav__subitems {
    display: grid;
    gap: 2px;
    margin: 2px 0 4px 20px;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, .1);
}

.app-nav__item--sub {
    min-height: 38px;
    padding: 8px 11px;
    font-size: 12.5px;
}

.app-nav__item--sub .app-nav__icon,
.app-nav__item--sub .app-nav__icon svg {
    width: 17px;
    height: 17px;
}

/* --------------------------------------------------------------------------
   Sidebar footer
   -------------------------------------------------------------------------- */

.app-sidebar__footer {
    display: grid;
    gap: 8px;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, .09);
}

.app-sidebar__footer-link {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 40px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 14px;
    color: rgba(255, 255, 255, .68);
    font-size: 13px;
    font-weight: 850;
    text-decoration: none;
    transition:
        transform .16s ease,
        background .16s ease,
        border-color .16s ease,
        color .16s ease;
}

.app-sidebar__footer-link:hover,
.app-sidebar__footer-link:focus {
    transform: translateX(2px);
    border-color: rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .07);
    color: #FFFFFF;
    text-decoration: none;
}

.app-sidebar__footer-link.is-danger:hover,
.app-sidebar__footer-link.is-danger:focus {
    border-color: rgba(var(--calendio-danger-rgb, 239, 68, 68), .22);
    background: rgba(var(--calendio-danger-rgb, 239, 68, 68), .15);
    color: #FFFFFF;
}

/* --------------------------------------------------------------------------
   Topbar
   -------------------------------------------------------------------------- */

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 82px;
    padding: 18px 28px 14px;
    border-bottom: 1px solid rgba(232, 222, 210, .72);
    background:
        linear-gradient(180deg, rgba(250, 247, 243, .92), rgba(250, 247, 243, .76));
    backdrop-filter: blur(16px);
}

.app-topbar::before {
    content: "";
    position: absolute;
    left: 28px;
    right: 28px;
    bottom: -1px;
    height: 1px;
    background:
        linear-gradient(90deg, transparent, rgba(var(--calendio-primary-rgb, 109, 93, 246), .18), rgba(var(--calendio-accent-rgb, 240, 91, 168), .14), transparent);
    pointer-events: none;
}

.app-topbar__left,
.app-topbar__right {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.app-topbar__left {
    flex: 1 1 auto;
}

.app-topbar__right {
    flex: 0 0 auto;
    justify-content: flex-end;
}

.app-topbar__title {
    margin: 0;
    color: var(--calendio-ink, #1F2330);
    font-size: clamp(24px, 3vw, 32px);
    line-height: 1.05;
    font-weight: 950;
    letter-spacing: -.045em;
}

.app-topbar__subtitle {
    margin-top: 4px;
    color: var(--calendio-text-muted, #766E66);
    font-size: 13px;
    line-height: 1.35;
    font-weight: 750;
}

.app-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    min-width: 220px;
    min-height: 42px;
    padding: 10px 36px 10px 13px;
    border: 1px solid var(--calendio-border, #E8DED2);
    border-radius: 15px;
    background-color: #FFFFFF;
    background-image:
        var(--calendio-select-arrow),
        linear-gradient(180deg, #FFFFFF, var(--calendio-surface-warm, #FFFCF7));
    background-repeat: no-repeat, no-repeat;
    background-position: right 13px center, center;
    background-size: 11px 7px, auto;
    color: var(--calendio-ink, #1F2330);
    box-shadow: var(--calendio-shadow-xs, 0 2px 8px rgba(31, 35, 48, .045));
    font-size: 13px;
    font-weight: 850;
    outline: 0;
    cursor: pointer;
}

.app-select:focus {
    border-color: var(--calendio-primary, #6D5DF6);
    box-shadow: 0 0 0 4px rgba(var(--calendio-primary-rgb, 109, 93, 246), .12);
}

/* Language switcher ------------------------------------------------------ */

.app-locale-switcher {
    display: inline-flex;
}

.app-locale-switcher__select {
    min-width: 108px;
    min-height: 42px;
    padding: 10px 30px 10px 13px;
}

.app-locale-switcher--floating {
    position: fixed;
    z-index: 3800;
    top: 14px;
    right: 14px;
}

@media (max-width: 640px) {
    .app-locale-switcher--floating {
        top: 10px;
        right: 10px;
    }

    .app-locale-switcher__select {
        min-width: 92px;
        min-height: 38px;
        font-size: 12px;
    }
}

.app-topbar__settings-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border: 1px solid var(--calendio-border, #E8DED2);
    border-radius: 999px;
    background:
        linear-gradient(180deg, #FFFFFF, var(--calendio-surface-warm, #FFFCF7));
    box-shadow: var(--calendio-shadow-xs, 0 2px 8px rgba(31, 35, 48, .045));
    color: var(--calendio-text-muted, #766E66);
    transition: color .14s ease, border-color .14s ease, background .14s ease;
}

.app-topbar__settings-btn:hover {
    border-color: var(--calendio-primary, #6D5DF6);
    color: var(--calendio-primary, #6D5DF6);
    background:
        linear-gradient(180deg, #FFFFFF, var(--calendio-primary-soft, #EFECFF));
}

.app-topbar__settings-btn svg {
    width: 19px;
    height: 19px;
}

.app-topbar__profile-menu {
    position: relative;
}

.app-topbar__profile-menu > summary {
    list-style: none;
    cursor: pointer;
}

.app-topbar__profile-menu > summary::-webkit-details-marker {
    display: none;
}

.app-topbar__profile {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 7px 11px 7px 7px;
    border: 1px solid var(--calendio-border, #E8DED2);
    border-radius: 999px;
    background:
        linear-gradient(180deg, #FFFFFF, var(--calendio-surface-warm, #FFFCF7));
    box-shadow: var(--calendio-shadow-xs, 0 2px 8px rgba(31, 35, 48, .045));
}

.app-topbar__profile-menu[open] > .app-topbar__profile {
    border-color: var(--calendio-primary, #6D5DF6);
}

.app-topbar__profile-chevron {
    flex: 0 0 auto;
    width: 6px;
    height: 6px;
    margin-left: 2px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    color: var(--calendio-text-muted, #766E66);
    opacity: .55;
    transform: rotate(45deg);
    transition: transform .16s ease;
}

.app-topbar__profile-menu[open] .app-topbar__profile-chevron {
    transform: rotate(-135deg);
}

.app-topbar__profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 45;
    display: grid;
    gap: 2px;
    min-width: 190px;
    padding: 8px;
    border: 1px solid var(--calendio-border, #E8DED2);
    border-radius: 16px;
    background: #FFFFFF;
    box-shadow: 0 18px 40px rgba(31, 35, 48, .16);
}

.app-topbar__profile-dropdown-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 11px;
    color: var(--calendio-ink, #1F2330);
    font-size: 13px;
    font-weight: 800;
}

.app-topbar__profile-dropdown-link:hover {
    background: var(--calendio-surface-warm, #FFFCF7);
}

.app-topbar__profile-dropdown-link svg {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
}

.app-topbar__profile-dropdown-link--danger {
    color: #C4432E;
}

.app-topbar__avatar {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background:
        radial-gradient(circle at 20% 0%, rgba(255, 255, 255, .28), transparent 38%),
        linear-gradient(135deg, var(--calendio-primary, #6D5DF6), var(--calendio-pink, #F05BA8));
    color: #FFFFFF;
    box-shadow: 0 8px 18px rgba(var(--calendio-primary-rgb, 109, 93, 246), .18);
    font-size: 12px;
    font-weight: 950;
    letter-spacing: .02em;
}

.app-topbar__profile-text {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.app-topbar__profile-text strong {
    max-width: 180px;
    overflow: hidden;
    color: var(--calendio-ink, #1F2330);
    font-size: 13px;
    line-height: 1.1;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-topbar__profile-text span,
.app-topbar__profile-text small {
    max-width: 180px;
    overflow: hidden;
    color: var(--calendio-text-muted, #766E66);
    font-size: 11.5px;
    line-height: 1.1;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Overlay
   -------------------------------------------------------------------------- */

.app-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background:
        radial-gradient(circle at top right, rgba(var(--calendio-primary-rgb, 109, 93, 246), .18), transparent 30%),
        rgba(31, 35, 48, .48);
    backdrop-filter: blur(4px);
    transition:
        opacity .18s ease,
        visibility .18s ease;
}

.app-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Desktop safety: overlay can never block desktop even if is-open remains */
@media (min-width: 961px) {
    .app-overlay,
    .app-overlay.is-open {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    .app-sidebar,
    .app-sidebar.is-open {
        transform: none !important;
    }
}

/* --------------------------------------------------------------------------
   Flash messages inside layout
   -------------------------------------------------------------------------- */

.app-main > .message,
.app-content > .message,
.app-content .message {
    margin: 0 0 16px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
    .app-shell {
        grid-template-columns: 270px minmax(0, 1fr);
    }

    .app-content {
        padding-left: 22px;
        padding-right: 22px;
    }

    .app-topbar {
        padding-left: 22px;
        padding-right: 22px;
    }
}

@media (max-width: 960px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 50;
        width: min(292px, calc(100vw - 42px));
        height: auto;
        transform: translateX(-105%);
        transition: transform .22s ease;
        box-shadow: 24px 0 70px rgba(31, 35, 48, .28);
    }

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

    .app-sidebar__close,
    .app-topbar__menu-btn {
        display: inline-flex;
    }

    .app-topbar {
        min-height: auto;
        padding: 16px 18px 12px;
    }

    .app-content {
        padding: 12px 18px 26px;
    }

    .app-topbar__right {
        flex-wrap: wrap;
    }

    .app-select {
        min-width: 0;
        width: min(100%, 260px);
        /* Below 16px, iOS Safari auto-zooms the page on focus/tap. */
        font-size: 16px;
    }
}

@media (max-width: 680px) {
    .app-topbar {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .app-topbar__left,
    .app-topbar__right {
        width: 100%;
        justify-content: space-between;
    }

    .app-topbar__right {
        align-items: stretch;
        flex-direction: column;
    }

    .app-select {
        width: 100%;
    }

    .app-topbar__profile-menu {
        width: 100%;
    }

    .app-topbar__profile {
        width: 100%;
        justify-content: flex-start;
        border-radius: 18px;
    }

    .app-topbar__profile-text strong,
    .app-topbar__profile-text span,
    .app-topbar__profile-text small {
        max-width: none;
    }

    .app-content {
        padding: 10px 14px 24px;
    }
}

/* --------------------------------------------------------------------------
   Setup hint cards (Calendars / Services / Team management list pages)
   -------------------------------------------------------------------------- */

.setup-hint-card {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 18px;
    padding: 14px 40px 14px 16px;
    border: 1px solid rgba(var(--calendio-mint-rgb, 49, 198, 164), .32);
    border-radius: var(--calendio-radius-lg, 18px);
    background: var(--calendio-mint-soft, #EAFBF6);
}

.setup-hint-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    font-size: 16px;
}

.setup-hint-card__body {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.setup-hint-card__body p {
    margin: 0;
    color: var(--calendio-ink, #1F2330);
    font-size: 13px;
    line-height: 1.5;
    font-weight: 750;
}

.setup-hint-card__cta {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border-radius: 999px;
    background: #FFFFFF;
    color: var(--calendio-primary-hover, #5947E8);
    box-shadow: var(--calendio-shadow-xs, 0 2px 8px rgba(31, 35, 48, .045));
    font-size: 12.5px;
    font-weight: 900;
    text-decoration: none;
}

.setup-hint-card__cta:hover {
    text-decoration: underline;
}

.setup-hint-card__dismiss {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--calendio-text-muted, #766E66);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.setup-hint-card__dismiss:hover {
    background: rgba(31, 35, 48, .06);
    color: var(--calendio-ink, #1F2330);
}
/* "Back to the setup guide" bar (templates/element/onboarding/setup_return_bar.php). */
.setup-return-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    margin-bottom: 18px;
    padding: 12px 16px;
    border: 1px solid rgba(var(--calendio-primary-rgb, 109, 93, 246), .22);
    border-radius: 16px;
    background: var(--calendio-primary-soft, #EFEDFF);
    color: var(--calendio-ink, #1F2330);
}

.setup-return-bar__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--calendio-primary, #6D5DF6);
    font-weight: 900;
    text-decoration: none;
}

.setup-return-bar__link:hover,
.setup-return-bar__link:focus {
    color: var(--calendio-primary-hover, #5A4BE0);
    text-decoration: underline;
}

.setup-return-bar__hint {
    color: var(--calendio-text-muted, #6B7080);
    font-size: 13px;
}
