/* ===================================================================
   Coliving Express — demo overlay
   Sits on top of the Nordic theme to add: a permanent "demo mode"
   banner, the toast that appears whenever the user tries to save
   something, a screen-switcher, role-aware visibility helpers and
   the role-picker tiles.
   =================================================================== */

/* ─── Demo banner (sticky, very top) ──────────────────────────────── */
.demo-banner {
    position: sticky; top: 0; z-index: 100;
    background: var(--gold);
    color: #fff;
    font-weight: 700;
    font-size: .9rem;
    padding: .55rem 1rem;
    text-align: center;
    letter-spacing: .02em;
    box-shadow: 0 1px 0 rgba(0,0,0,.06);
}
.demo-banner .material-symbols-outlined { font-size: 18px; vertical-align: -.25em; color: #fff; margin-right: .35rem; }
.demo-banner a { color: #fff; text-decoration: underline; margin-left: .5rem; }
.demo-banner .role-chip {
    display: inline-block; margin-left: .75rem; padding: .1rem .55rem;
    border-radius: 2px; background: rgba(255,255,255,.18);
    font-size: .78rem; letter-spacing: .04em; text-transform: uppercase;
}

/* Push sticky nav below the demo banner */
.site-nav { top: 38px; }
@media (max-width: 640px) {
    .demo-banner { font-size: .82rem; padding: .45rem .75rem; }
    .demo-banner a, .demo-banner .role-chip { display: inline-block; margin-top: .15rem; }
    .site-nav { top: 60px; }
}

/* ─── Screen switcher ─────────────────────────────────────────────── */
.screen { display: none; }
.screen.is-active { display: block; }

/* ─── Role-aware visibility ───────────────────────────────────────── */
/* Hide elements whose minimum role is above the body's role.
   Hierarchy: visitor < resident < moderator < admin < super_admin   */
body:not([data-role="resident"]):not([data-role="moderator"]):not([data-role="admin"]):not([data-role="super_admin"]) [data-role-min="resident"]    { display: none !important; }
body:not([data-role="moderator"]):not([data-role="admin"]):not([data-role="super_admin"])                                  [data-role-min="moderator"]   { display: none !important; }
body:not([data-role="admin"]):not([data-role="super_admin"])                                                               [data-role-min="admin"]       { display: none !important; }
body:not([data-role="super_admin"])                                                                                        [data-role-min="super_admin"] { display: none !important; }
/* Hide elements that are *only* for one role */
body:not([data-role="visitor"])     [data-role-only="visitor"]     { display: none !important; }
body:not([data-role="resident"])    [data-role-only="resident"]    { display: none !important; }
body:not([data-role="moderator"])   [data-role-only="moderator"]   { display: none !important; }
body:not([data-role="admin"])       [data-role-only="admin"]       { display: none !important; }
body:not([data-role="super_admin"]) [data-role-only="super_admin"] { display: none !important; }

/* ─── Role chooser tiles ──────────────────────────────────────────── */
.role-grid {
    display: grid; gap: 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-top: 2rem;
}
.role-tile {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-md); padding: 1.5rem; cursor: pointer;
    text-align: left; transition: border-color .15s var(--ease), background .15s var(--ease);
    display: flex; flex-direction: column; gap: .4rem;
    color: inherit; text-decoration: none;
}
.role-tile:hover { border-color: var(--primary); background: var(--surface-2); }
.role-tile .material-symbols-outlined {
    font-size: 38px; color: var(--primary); margin-bottom: .25rem;
}
.role-tile h3 { font-size: 1.1rem; margin-bottom: .15rem; }
.role-tile .role-perks { margin: .5rem 0 0 1rem; color: var(--text-muted); font-size: .85rem; }
.role-tile .role-perks li { margin-bottom: .15rem; }
.role-tile .role-cta {
    margin-top: auto; padding-top: .8rem;
    color: var(--primary-dark); font-weight: 700; font-size: .9rem;
}

/* ─── Toast ───────────────────────────────────────────────────────── */
.toast {
    position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(160%);
    background: #0a0a0a; color: #fff; padding: .8rem 1.2rem;
    border-radius: var(--r-md); font-size: .92rem; font-weight: 600;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    transition: transform .25s var(--ease), opacity .25s var(--ease);
    z-index: 200; opacity: 0; pointer-events: none;
    max-width: 90vw;
    display: inline-flex; align-items: center; gap: .5rem;
}
.toast.is-visible { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast .material-symbols-outlined { font-size: 20px; color: #ffd87a; }

/* ─── Small layout helpers used in demo screens ───────────────────── */
.screen-pad { padding: 0; }
.app-nav-inner-wrap { display: contents; }   /* placeholder for nav helpers */

/* PIN reveal block sized for demo data */
.demo-pin { font-family: var(--font-mono); font-size: 2.6rem; letter-spacing: .35rem; font-weight: 800; }

/* Calendar mini for sauna/rooms */
.mini-cal {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: .35rem;
    background: var(--surface); border: 1px solid var(--border);
    padding: .75rem; border-radius: var(--r-md);
}
.mini-cal .cell {
    min-height: 78px; border: 1px solid var(--border-soft); padding: .35rem .45rem;
    background: #fff; border-radius: var(--r-sm); font-size: .75rem;
}
.mini-cal .cell .d { font-weight: 700; color: var(--text-muted); font-size: .7rem; margin-bottom: .25rem; }
.mini-cal .cell .ev {
    display: block; background: var(--primary-light); color: var(--primary-dark);
    padding: .1rem .35rem; margin-top: .15rem; border-left: 2px solid var(--primary);
    font-size: .7rem; border-radius: 1px;
}

/* Inventory cards laid out in a wider grid for the demo */
.inv-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

/* Wishlist row: vote button + content */
.wish-row { display: flex; gap: 1rem; align-items: flex-start; padding: 1rem; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); margin-bottom: .75rem; }
.wish-row .vote-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-width: 60px; padding: .5rem .6rem; border: 1px solid var(--primary-dark);
    background: #fff; color: var(--primary-dark); border-radius: var(--r-md);
    cursor: pointer; font-weight: 700;
}
.wish-row .vote-btn.is-voted { background: var(--primary); color: #fff; }
.wish-row .vote-btn .material-symbols-outlined { font-size: 20px; color: inherit; }
.wish-row .vote-count { font-size: 1.1rem; }

/* Ticket conversation */
.tk-comment { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 1rem; margin-bottom: .75rem; }
.tk-comment.is-internal { background: var(--bg-tint); border-color: var(--primary-dark); }
.tk-meta { font-size: .82rem; color: var(--text-muted); }

/* Manager queue: priority colour stripe */
.pri-stripe { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: middle; margin-right: .3rem; }
.pri-urgent { background: var(--accent); }
.pri-high   { background: var(--gold); }
.pri-normal { background: var(--primary); }
.pri-low    { background: var(--border-strong); }

/* Compact "step" indicator used in bike/car booking demo */
.step { display: flex; align-items: center; gap: .75rem; padding: .8rem 1rem; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); margin-bottom: .65rem; }
.step.is-done   { border-color: var(--primary); background: var(--primary-light); }
.step.is-active { border-left: 4px solid var(--primary); }
.step .num { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; flex-shrink: 0; }
.step.is-pending .num { background: var(--border-strong); }

/* Subtle "demo data" caption */
.demo-note { color: var(--text-muted); font-size: .82rem; font-style: italic; }
