/* Unit-Plan Ampel (Sergey 28.10.2026, ported by hand from dbs-lager "DBS Ampel"): the management reports as a phone PWA
   in the colours of the office web (MudBlazor palette variables of UnitPlanTheme; dark palette by the phone's setting or
   by "Hell / Dunkel", see AmpelThemeStyle and theme.js). Inter from our own server (under /ampel/res/ so that the
   offline pages need no network). Layout like the employee app: app bar on top, four tabs at the bottom. */
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900; src: url('res/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900; src: url('res/inter-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900; src: url('res/inter-cyrillic.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

html, body.ampel-body {
    margin: 0;
    min-height: 100%;
    background: var(--mud-palette-background);
    color: var(--mud-palette-text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

.ampel-app { min-height: 100vh; min-height: 100dvh; }

/* App bar: sticky, the colours of the office web's bar (purple; dark in the dark design); under the iPhone status bar. */
.ampel-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 56px;
    padding: calc(6px + env(safe-area-inset-top)) calc(4px + env(safe-area-inset-right)) 6px calc(16px + env(safe-area-inset-left));
    background: var(--mud-palette-appbar-background);
    color: var(--mud-palette-appbar-text);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

/* Left: "Unit-Plan", the company name below. */
.ampel-brand { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.ampel-brand-name { font-weight: 700; font-size: 1.15rem; letter-spacing: .5px; }
.ampel-brand-tenant { font-size: .8rem; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Right: the ⋮ menu — a native <details>, no script needed to open it. */
.ampel-menu { position: relative; flex: none; }
.ampel-menu > summary, .ampel-theme-button {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    color: inherit;
}
.ampel-menu > summary::-webkit-details-marker { display: none; }
.ampel-menu > summary:focus-visible, .ampel-menu[open] > summary, .ampel-theme-button:focus-visible { background: rgba(255, 255, 255, .16); outline: none; }
.ampel-menu-panel {
    position: absolute;
    right: 4px;
    top: calc(100% + 6px);
    min-width: 230px;
    padding: 6px 0;
    border-radius: 10px;
    background: var(--mud-palette-surface);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
    border: 1px solid var(--mud-palette-lines-default);
}
.ampel-menu-panel a, .ampel-menu-panel button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 0 16px;
    border: 0;
    background: transparent;
    color: var(--mud-palette-text-primary);
    text-decoration: none;
    font: inherit;
    font-size: .95rem;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
}
.ampel-menu-panel a:active, .ampel-menu-panel a:focus-visible,
.ampel-menu-panel button:active, .ampel-menu-panel button:focus-visible { background: rgba(var(--mud-palette-primary-rgb), .1); outline: none; }
@media (hover: hover) {
    .ampel-menu-panel a:hover, .ampel-menu-panel button:hover { background: rgba(var(--mud-palette-primary-rgb), .08); }
}
.ampel-menu-panel .mud-icon-root { color: var(--mud-palette-text-secondary); font-size: 1.3rem; }

/* Offline banner (the service worker served the last kept page). */
.ampel-offline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 12px;
    padding: 8px calc(16px + env(safe-area-inset-right)) 8px calc(16px + env(safe-area-inset-left));
    background: var(--mud-palette-warning);
    color: #1f1b2e;
    font-weight: 700;
    font-size: .9rem;
}
.ampel-offline[hidden] { display: none; }
.ampel-offline button {
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid #1f1b2e;
    border-radius: 18px;
    background: transparent;
    color: #1f1b2e;
    font: inherit;
    cursor: pointer;
}

/* Content: 12 px gutter (plus the safe areas in landscape), room for the bottom navigation. */
.ampel-main {
    max-width: 960px;
    margin: 0 auto;
    padding: 12px calc(12px + env(safe-area-inset-right)) calc(84px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left));
    box-sizing: border-box;
    min-width: 0;
}
.ampel-app-plain .ampel-main { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }

/* Bottom navigation: four tabs, icon + label, thumb-sized, like the employee app; the active tab in the primary colour. */
.ampel-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    background: var(--mud-palette-surface);
    border-top: 1px solid var(--mud-palette-lines-default);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, .08);
}
.ampel-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 60px;
    padding: 6px 0 8px;
    color: var(--mud-palette-text-secondary);
    text-decoration: none;
    font-size: .75rem;
}
.ampel-nav-icon { display: flex; align-items: center; justify-content: center; height: 30px; padding: 0 18px; border-radius: 15px; }
.ampel-nav-icon .mud-icon-root { font-size: 1.45rem; }
.ampel-nav a.active { color: var(--mud-palette-primary); font-weight: 700; }
.ampel-nav a.active .ampel-nav-icon { background: rgba(var(--mud-palette-primary-rgb), .16); }
.ampel-nav a:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: -4px; }

/* Page heading inside a tab (the reports render no title of their own in the Ampel). */
.ampel-page-title { margin: 4px 0 12px; font-size: 1.25rem; font-weight: 700; }

/* Help page. */
.ampel-help { padding: 4px 4px 8px; line-height: 1.5; }
.ampel-help h2 { margin: 20px 0 6px; font-size: 1.05rem; }
.ampel-help ul { margin: 0; padding-left: 1.2rem; }
.ampel-help li { margin: 4px 0; }
.ampel-help-colors { list-style: none; padding-left: 0 !important; }
.ampel-help-colors li { display: flex; gap: 10px; align-items: flex-start; }
.ampel-dot { flex: none; width: 16px; height: 16px; margin-top: 3px; border-radius: 50%; }
.ampel-dot-red { background: var(--mud-palette-error); }
.ampel-dot-amber { background: var(--mud-palette-warning); }
.ampel-dot-green { background: var(--mud-palette-success); }
.ampel-help-back { margin-top: 24px; text-align: center; }

/* Problem report page. */
.ampel-problem-title { margin-top: 0; }
.ampel-problem-meta { margin: 6px 0 0; font-size: .8rem; color: var(--mud-palette-text-secondary); }
.ampel-login-links { margin-top: 16px; margin-bottom: 0; }

/* The reports inside: no outer card on the phone (the charts have their own cards), the period selector centred. */
.ampel-main > .unit-perf.mud-paper { background: transparent; box-shadow: none; padding: 0 !important; }
.ampel-main .perf-head { justify-content: center; margin-bottom: 4px; }
.ampel-period { gap: 4px !important; }
.ampel-period .perf-month-name { min-width: 0; font-size: 1rem; }
.ampel-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: var(--mud-palette-primary);
    text-decoration: none;
    flex: none;
}
.ampel-step:active, .ampel-step:focus-visible { background: rgba(var(--mud-palette-primary-rgb), .14); outline: none; }
.ampel-step-off { color: var(--mud-palette-text-disabled); opacity: .45; }
.ampel-today {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 10px;
    color: var(--mud-palette-primary);
    font-weight: 700;
    text-decoration: none;
}
.ampel-main .unit-probs .pc-card { scroll-margin-top: calc(72px + env(safe-area-inset-top)); }
.ampel-main a.pt-tile { color: inherit; text-decoration: none; }
.ampel-main a.perf-row { color: inherit; text-decoration: none; }
.ampel-main a:not([href]) { cursor: inherit; }
.ampel-main a:not([href]):hover { text-decoration: none; }

/* Tap targets of the charts: the details open as a card above the navigation (ampel.js). */
.ampel-tap { cursor: pointer; }
.ampel-tap:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: 1px; border-radius: 4px; }
.ampel-tap.ampel-tap-on { outline: 2px solid var(--mud-palette-primary); outline-offset: 1px; border-radius: 4px; }
.ampel-tap.ampel-tap-on .pc-slot { background: rgba(var(--mud-palette-primary-rgb), .08); border-radius: 4px; }

.ampel-sheet {
    position: fixed;
    left: calc(8px + env(safe-area-inset-left));
    right: calc(8px + env(safe-area-inset-right));
    bottom: calc(66px + env(safe-area-inset-bottom));
    z-index: 30;
    max-width: 560px;
    margin: 0 auto;
    max-height: 55vh;
    overflow-y: auto;
    padding: 14px 52px 14px 16px;
    border-radius: 14px;
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    border: 1px solid var(--mud-palette-lines-default);
    border-top: 3px solid var(--mud-palette-primary);
    box-shadow: 0 10px 32px rgba(0, 0, 0, .3);
    font-size: .92rem;
    line-height: 1.45;
}
.ampel-sheet[hidden] { display: none; }
.ampel-sheet-close {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--mud-palette-text-secondary);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}
.ampel-sheet-close:focus-visible { outline: 2px solid var(--mud-palette-primary); }
.ampel-app-plain .ampel-sheet { bottom: calc(12px + env(safe-area-inset-bottom)); }

/* "alle anzeigen" and the table as native disclosures. */
details.ampel-more { margin-top: 4px; }
details.ampel-more > summary {
    display: flex;
    align-items: center;
    min-height: 44px;
    color: var(--mud-palette-primary);
    font-weight: 700;
    font-size: .9rem;
    cursor: pointer;
}

/* "Leistung": the employee tabs swipe sideways inside their strip; the page itself never scrolls sideways. */
.ampel-emp-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    padding: 2px 2px 8px;
    margin: 0 -12px;
    padding-left: 12px;
    padding-right: 12px;
    border-bottom: 1px solid var(--mud-palette-divider);
}
.ampel-emp-tabs::-webkit-scrollbar { display: none; }
.ampel-emp-tab {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 22px;
    border: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    text-decoration: none;
    white-space: nowrap;
    font-size: .9rem;
    scroll-snap-align: start;
}
.ampel-emp-tab-on {
    border-color: var(--mud-palette-primary);
    background: rgba(var(--mud-palette-primary-rgb), .14);
    color: var(--mud-palette-primary);
    font-weight: 700;
}

/* Hint at the bottom of every tab. */
.ampel-hint {
    margin: 28px 0 8px;
    padding: 16px;
    text-align: center;
    border-top: 1px solid var(--mud-palette-divider);
    color: var(--mud-palette-text-secondary);
    font-size: .9rem;
}
.ampel-hint p { margin: 0 0 12px; }
.ampel-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 24px;
    border: 0;
    border-radius: 10px;
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
    font: inherit;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
}
.ampel-back-link { display: block; margin-top: 18px; text-align: center; color: var(--mud-palette-primary); font-weight: 600; text-decoration: none; }
.ampel-button:focus-visible { outline: 3px solid rgba(var(--mud-palette-primary-rgb), .45); outline-offset: 2px; }

/* Login, logout, no access, offline fallback. */
.ampel-login {
    max-width: 400px;
    margin: 16px auto 0;
    padding: 24px 20px;
    border-radius: 14px;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    text-align: center;
}
.ampel-login-icon { width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 2px 10px rgba(0, 0, 0, .15); }
.ampel-login-title {
    margin: 12px 0 0;
    font-weight: 700;
    font-size: 1.6rem;
    line-height: 1.15;
}
.ampel-login-sub { margin: 6px 0 16px; color: var(--mud-palette-text-secondary); font-size: .95rem; line-height: 1.4; }
.ampel-login-sub a { color: var(--mud-palette-primary); }
.ampel-login-form { display: flex; flex-direction: column; text-align: left; gap: 4px; }
.ampel-login-form label { font-weight: 700; font-size: .9rem; margin-top: 10px; }
.ampel-login-form input:not([type="checkbox"]), .ampel-login-form textarea {
    width: 100%;
    min-height: 48px;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--mud-palette-lines-inputs, #bdbdbd);
    background: var(--mud-palette-background);
    color: var(--mud-palette-text-primary);
    font: inherit;
    font-size: 16px; /* no zoom on focus in iOS Safari */
}
.ampel-login-form textarea { min-height: 140px; resize: vertical; }
.ampel-login-form input:focus, .ampel-login-form textarea:focus { outline: 2px solid var(--mud-palette-primary); border-color: var(--mud-palette-primary); }
.ampel-login-form .validation-message { color: var(--mud-palette-error); font-size: .85rem; }
.ampel-login-check { display: flex !important; align-items: center; gap: 10px; min-height: 44px; font-weight: 400 !important; }
.ampel-login-check input { width: 22px; height: 22px; accent-color: var(--mud-palette-primary); }
.ampel-login-button { width: 100%; margin-top: 16px; }
.ampel-login-error, .ampel-login-note {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: .92rem;
    text-align: left;
}
.ampel-login-error { background: rgba(var(--mud-palette-error-rgb), .12); color: var(--mud-palette-error); font-weight: 700; }
.ampel-login-note { background: rgba(var(--mud-palette-success-rgb), .12); color: var(--mud-palette-text-primary); }

/* The offline fallback page has no MudBlazor theme: the few colours it needs (UnitPlanTheme). */
.ampel-static {
    --mud-palette-background: #f5f3fb;
    --mud-palette-surface: #ffffff;
    --mud-palette-text-primary: #424242;
    --mud-palette-text-secondary: #616161;
    --mud-palette-lines-default: #e0dce8;
    --mud-palette-primary: #7c3aed;
    --mud-palette-primary-rgb: 124, 58, 237;
    --mud-palette-primary-text: #ffffff;
    --mud-palette-appbar-background: #7c3aed;
    --mud-palette-appbar-text: #ffffff;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme=light]) .ampel-static {
        --mud-palette-background: #1a1a27;
        --mud-palette-surface: #1e1e2d;
        --mud-palette-text-primary: #b2b0bf;
        --mud-palette-text-secondary: #92929f;
        --mud-palette-lines-default: #33323e;
        --mud-palette-primary: #7e6fff;
        --mud-palette-primary-rgb: 126, 111, 255;
        --mud-palette-appbar-background: #1a1a27;
        --mud-palette-appbar-text: #d4d2e0;
    }
}
:root[data-theme=dark] .ampel-static {
    --mud-palette-background: #1a1a27;
    --mud-palette-surface: #1e1e2d;
    --mud-palette-text-primary: #b2b0bf;
    --mud-palette-text-secondary: #92929f;
    --mud-palette-lines-default: #33323e;
    --mud-palette-primary: #7e6fff;
    --mud-palette-primary-rgb: 126, 111, 255;
    --mud-palette-appbar-background: #1a1a27;
    --mud-palette-appbar-text: #d4d2e0;
}

/* "Unit-Plan Ampel installieren": QR code (always on white so that cameras read it in dark mode) and the steps per device. */
.ampel-install-qr { display: block; margin: 8px auto 4px; padding: 10px; background: #fff; border-radius: 10px; width: 220px; height: 220px; }
.ampel-install-url { margin: 0 0 4px; font-size: .85rem; word-break: break-all; color: var(--mud-palette-text-secondary); }
.ampel-install-steps { margin-top: 20px; text-align: left; }
.ampel-install-steps h2 { margin: 16px 0 4px; font-size: 1rem; }
.ampel-install-steps ol { margin: 0; padding-left: 1.3rem; line-height: 1.55; }

/* "Leistung" with many employees: one list instead of a long row of tabs (28.10.2026). */
.ampel-emp-pick { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 8px; }
.ampel-emp-pick label { font-weight: 700; font-size: .9rem; }
.ampel-emp-pick select {
    min-height: 48px; padding: 8px 10px; border-radius: 8px; font: inherit; font-size: 16px;
    border: 1px solid var(--mud-palette-lines-inputs, #bdbdbd); background: var(--mud-palette-background); color: var(--mud-palette-text-primary);
}
