/* ========================================================================
   ABG Operations App - Phase A CSS
   Pfad: /public_html/app/assets/css/app.css
   ========================================================================
   
   Initial-CSS für Login-Seite und Shell-Test-Layout. Komplett eigenständig,
   kein Bezug zur Desktop-CSS. In Phase B kommen App-Layout-Styles hinzu.
   ======================================================================== */

/* -- Reset ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 
                 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #0f172a;
    line-height: 1.5;
}
img { max-width: 100%; height: auto; display: block; }
input, button { font-family: inherit; font-size: inherit; }

/* -- Brand-Farben (Avis-CI) ------------------------------------------- */
:root {
    --avis-red:        #D4002A;
    --avis-red-dark:   #A50410;
    --bg-dark:         #1a1f2e;
    --bg-darker:       #0f1420;
    --text:            #0f172a;
    --text-muted:      #64748b;
    --border:          #e2e8f0;
    --bg-light:        #f8fafc;
    --error:           #dc2626;
    --error-bg:        #fef2f2;
    --success:         #16a34a;
}

/* ========================================================================
   LOGIN-SEITE
   ======================================================================== */
.body--login {
    background: var(--bg-dark);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.login-wrap {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-box {
    width: 100%;
    background: #ffffff;
    border-radius: 14px;
    padding: 32px 28px 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.login-box__logo {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 22px;
}

.login-box__logo img {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.login-box__title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    margin-bottom: 4px;
}

.login-box__subtitle {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 24px;
}

/* -- Form-Elemente ---------------------------------------------------- */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    letter-spacing: -0.1px;
}

.form-group input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: 9px;
    font-size: 15px;
    color: var(--text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background: #fff;
}

.form-group input:focus {
    outline: none;
    border-color: var(--avis-red);
    box-shadow: 0 0 0 3px rgba(212, 0, 42, 0.12);
}

.form-group input:disabled {
    background: var(--bg-light);
    color: var(--text-muted);
    cursor: not-allowed;
}

.btn-primary {
    width: 100%;
    padding: 12px 20px;
    margin-top: 6px;
    background: var(--avis-red);
    color: #fff;
    border: 0;
    border-radius: 9px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.08s ease;
    letter-spacing: -0.1px;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary:hover {
    background: var(--avis-red-dark);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

/* -- Alerts ----------------------------------------------------------- */
.alert {
    padding: 11px 14px;
    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 16px;
    line-height: 1.4;
}

.alert--error {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid #fecaca;
}

.login-footer {
    margin-top: 22px;
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.32);
    text-align: center;
    line-height: 1.6;
}

/* ========================================================================
   SHELL-LAYOUT (Phase A Test)
   ======================================================================== */
.body--shell {
    background: var(--bg-light);
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: env(safe-area-inset-top);
}

.shell-wrap {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
}

.shell-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--avis-red);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(212, 0, 42, 0.18);
}

.shell-logo {
    height: 24px;
    width: auto;
    object-fit: contain;
}

.shell-logout {
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 7px;
    transition: background 0.15s ease;
}

.shell-logout:hover,
.shell-logout:active {
    background: rgba(255, 255, 255, 0.28);
}

.shell-card {
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border);
}

.shell-card__title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text);
    margin-bottom: 4px;
}

.shell-card__subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.shell-info {
    background: var(--bg-light);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.shell-info__row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.shell-info__row:last-child {
    border-bottom: 0;
}

.shell-info__label {
    color: var(--text-muted);
    font-weight: 500;
}

.shell-info__value {
    color: var(--text);
    font-weight: 600;
    text-align: right;
    word-break: break-all;
}

.shell-status {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 14px 16px;
}

.shell-status__title {
    font-size: 14px;
    font-weight: 700;
    color: #166534;
    margin-bottom: 8px;
}

.shell-status__list {
    margin: 0;
    padding-left: 4px;
    list-style: none;
    font-size: 12.5px;
    color: #166534;
    line-height: 1.7;
}

.shell-status__list li {
    padding-left: 4px;
}

/* ========================================================================
   APP-LAYOUT (Phase B)
   ======================================================================== */

/* -- Body in App-Modus ------------------------------------------------ */
.body--app {
    background: var(--bg-light);
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
}

/* -- Main Content Container ------------------------------------------- */
.app-main {
    min-height: calc(100vh - 56px);
    min-height: calc(100dvh - 56px);
    padding-bottom: env(safe-area-inset-bottom);
}

.app-content {
    padding: 16px;
    max-width: 720px;
    margin: 0 auto;
}

/* ========================================================================
   TOPBAR (abg-bar) - Phase B2
   ------------------------------------------------------------------------
   Komplett isolierte Klassennamen. Sticky am oberen Rand,
   Avis-Rot, mit Notch-Padding für PWA-Standalone-Modus.
   ======================================================================== */

.abg-bar {
    /* Layout */
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    height: 56px;
    width: 100%;
    box-sizing: border-box;
    
    /* Sticky am oberen Rand */
    position: sticky;
    top: 0;
    z-index: 50;
    
    /* Avis-Rot Brand */
    background: var(--avis-red);
    color: #FFFFFF;
    
    /* Sauber bündig */
    margin: 0;
    border: 0;
    box-shadow: none;
    
    /* Notch-Support für PWA-Standalone */
    padding-top: env(safe-area-inset-top);
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    height: calc(56px + env(safe-area-inset-top));
}

/* -- Burger-Button ---------------------------------------------------- */
.abg-bar__menu {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    box-sizing: border-box;
    
    background: transparent;
    color: #FFFFFF;
    border: 0;
    cursor: pointer;
    border-radius: 8px;
    flex-shrink: 0;
    margin-left: -8px;
    padding: 0;
    
    -webkit-tap-highlight-color: transparent;
    transition: background 0.12s ease;
}

.abg-bar__menu:hover,
.abg-bar__menu:active {
    background: rgba(255, 255, 255, 0.15);
}

.abg-bar__menu svg {
    width: 22px;
    height: 22px;
    stroke-width: 2;
    color: #FFFFFF;
    fill: none;
    stroke: currentColor;
    pointer-events: none;
}

/* -- Page-Title ------------------------------------------------------- */
.abg-bar__title {
    flex: 1;
    color: #FFFFFF;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* -- Profil-Avatar (rechts) ------------------------------------------- */
.abg-bar__avatar,
.abg-bar__avatar:link,
.abg-bar__avatar:visited,
.abg-bar__avatar:hover,
.abg-bar__avatar:active {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #FFFFFF;
    font-size: 12.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    flex-shrink: 0;
    margin-right: -4px;
    cursor: pointer;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    letter-spacing: 0.2px;
    transition: transform 0.12s ease, background 0.12s ease;
    -webkit-tap-highlight-color: transparent;
}

.abg-bar__avatar:hover {
    background: rgba(255, 255, 255, 0.28);
}

.abg-bar__avatar:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.32);
}

/* ========================================================================
   PREMIUM-SIDEBAR (Phase B3)
   ------------------------------------------------------------------------
   Klassen mit Praefix `app-sb-*` zur Isolation. 280px breit auf Mobile,
   Slide-in von links mit Backdrop-Blur.
   ======================================================================== */

/* Backdrop hinter der Sidebar */
.app-sb-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px) saturate(120%);
    -webkit-backdrop-filter: blur(6px) saturate(120%);
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.app-sb-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

/* Sidebar Container */
.app-sb {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 86vw;
    background: linear-gradient(180deg, #1a1f2e 0%, #0f1420 100%);
    color: #FFFFFF;
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(-100%);
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
    /* Notch-Padding fuer PWA */
    padding-left: env(safe-area-inset-left);
}

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

/* Header mit Logos */
.app-sb__header {
    flex-shrink: 0;
    padding: 18px 20px 16px;
    padding-top: calc(18px + env(safe-area-inset-top));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
}

.app-sb__close {
    position: absolute;
    top: 14px;
    top: calc(14px + env(safe-area-inset-top));
    right: 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 0;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
}

.app-sb__close:hover,
.app-sb__close:active {
    background: rgba(255, 255, 255, 0.16);
    color: #FFFFFF;
}

.app-sb__brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.app-sb__logos {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-right: 40px;
}

.app-sb__logo-avis {
    height: 28px;
    width: auto;
    object-fit: contain;
    border-radius: 3px;
}

.app-sb__logo-divider {
    width: 1px;
    height: 22px;
    background: rgba(255, 255, 255, 0.18);
}

.app-sb__logo-budget {
    height: 20px;
    width: auto;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.app-sb__brand-name {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: -0.2px;
    line-height: 1.3;
}

.app-sb__brand-sub {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.2px;
    margin-top: 1px;
}

/* Navigation */
.app-sb__nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 12px 16px;
    -webkit-overflow-scrolling: touch;
}

.app-sb__nav::-webkit-scrollbar {
    width: 4px;
}

.app-sb__nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
}

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

.app-sb__section:first-child {
    padding-top: 6px;
}

.app-sb__section-label {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.38);
    letter-spacing: 0.7px;
    text-transform: uppercase;
    padding: 0 12px 6px;
}

/* Nav-Items */
.app-sb__item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: 9px;
    margin-bottom: 1px;
    transition: background 0.12s ease, color 0.12s ease;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.app-sb__item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.95);
}

.app-sb__item:active {
    background: rgba(255, 255, 255, 0.1);
}

.app-sb__item--active {
    background: rgba(212, 0, 42, 0.18);
    color: #FFFFFF;
}

.app-sb__item--active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    background: var(--avis-red);
    border-radius: 0 3px 3px 0;
}

.app-sb__icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.85;
}

.app-sb__icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.8;
}

.app-sb__item--active .app-sb__icon {
    color: var(--avis-red);
    opacity: 1;
}

.app-sb__item--active .app-sb__icon svg {
    stroke-width: 2.2;
}

/* Footer mit User und Logout */
.app-sb__footer {
    flex-shrink: 0;
    padding: 14px 16px 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
}

.app-sb__user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 10px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.app-sb__user:hover,
.app-sb__user:active {
    background: rgba(255, 255, 255, 0.06);
}

.app-sb__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--avis-red) 0%, var(--avis-red-dark) 100%);
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(212, 0, 42, 0.3);
}

.app-sb__user-info {
    flex: 1;
    min-width: 0;
}

.app-sb__user-name {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: -0.1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-sb__user-role {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-sb__user-arrow {
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.4);
    transition: transform 0.15s ease, color 0.15s ease;
}

.app-sb__user:hover .app-sb__user-arrow {
    color: rgba(255, 255, 255, 0.7);
    transform: translateX(2px);
}

.app-sb__logout {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 500;
    border-radius: 8px;
    transition: background 0.12s ease, color 0.12s ease;
    -webkit-tap-highlight-color: transparent;
}

.app-sb__logout:hover,
.app-sb__logout:active {
    background: rgba(212, 0, 42, 0.12);
    color: #FFFFFF;
}

.app-sb__logout svg {
    flex-shrink: 0;
}

/* ========================================================================
   HERO-SECTION (Phase B3.5)
   ------------------------------------------------------------------------
   Dunkle Hero-Card mit Gradient (passend zum Sidebar-Look).
   Wird oben in Modul-Seiten als Begruessung/Header genutzt.
   ======================================================================== */

.app-hero {
    position: relative;
    background: linear-gradient(135deg, #1a1f2e 0%, #0f1420 100%);
    color: #FFFFFF;
    border-radius: 16px;
    padding: 24px 22px 26px;
    margin-bottom: 18px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(15, 20, 32, 0.25);
    isolation: isolate;
}

.app-hero__content {
    position: relative;
    z-index: 2;
}

.app-hero__badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.9);
    font-size: 11px;
    font-weight: 600;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.app-hero__title {
    font-size: 26px;
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: -0.5px;
    line-height: 1.15;
    margin-bottom: 4px;
}

.app-hero__subtitle {
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 500;
    line-height: 1.4;
}

/* Glow-Effekte fuer Premium-Look */
.app-hero__glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    filter: blur(48px);
    opacity: 0.55;
}

.app-hero__glow--1 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(212, 0, 42, 0.4), rgba(212, 0, 42, 0));
    top: -50px;
    right: -30px;
}

.app-hero__glow--2 {
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.35), rgba(99, 102, 241, 0));
    bottom: -60px;
    left: -40px;
}

/* Bei kleineren Screens etwas kompakter */
@media (max-width: 480px) {
    .app-hero {
        padding: 20px 18px 22px;
        border-radius: 14px;
    }
    .app-hero__title {
        font-size: 22px;
    }
    .app-hero__subtitle {
        font-size: 13px;
    }
}

/* ========================================================================
   BOTTOM-NAV (Phase B4)
   ------------------------------------------------------------------------
   Schwarze Bottom-Nav mit 5 Slots, Avis-Rot Akzent fuer aktiven Tab.
   Sticky am unteren Bildschirmrand mit Notch-Padding.
   Klassen mit Praefix `app-bn-*` zur Isolation.
   ======================================================================== */

/* Wenn Bottom-Nav genutzt wird: Hauptbereich braucht zusaetzlichen 
   Padding-Bottom, damit Inhalt nicht hinter der Nav versteckt ist */
.app-main--with-bn {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
}

.app-bn {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #0A0A0A;
    border-top: 1px solid #1F1F1F;
    z-index: 80;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.15);
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}

.app-bn__items {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    padding: 0 max(4px, env(safe-area-inset-left)) 0 max(4px, env(safe-area-inset-right));
    gap: 0;
    max-width: 720px;
    margin: 0 auto;
}

.app-bn__item {
    flex: 1;
    min-width: 0;
    max-width: 90px;
    min-height: 50px;
    padding: 6px 4px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 10px;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.18s ease, background 0.18s ease;
    white-space: nowrap;
    overflow: hidden;
}

.app-bn__item span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    text-align: center;
    line-height: 1.2;
}

.app-bn__item svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.8;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
}

.app-bn__item:active {
    background: rgba(255, 255, 255, 0.06);
}

.app-bn__item--active {
    color: var(--avis-red);
}

.app-bn__item--active svg {
    stroke-width: 2.2;
}

/* Roter Strich oben am aktiven Tab */
.app-bn__item--active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 3px;
    background: var(--avis-red);
    border-radius: 0 0 3px 3px;
}

/* ========================================================================
   PWA INSTALL-BANNER (Phase B7+8)
   ------------------------------------------------------------------------
   Wird unten am Bildschirmrand eingeblendet, wenn der Browser
   beforeinstallprompt feuert (Android/Chrome).
   iOS Safari hat kein Equivalent, dort muss User selbst auf 
   "Zum Home-Bildschirm" tippen.
   ======================================================================== */

.pwa-install-banner {
    position: fixed;
    bottom: calc(80px + env(safe-area-inset-bottom));
    left: 12px;
    right: 12px;
    max-width: 480px;
    margin: 0 auto;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 14px 14px 16px;
    box-shadow: 0 8px 30px rgba(15, 20, 32, 0.18);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 95;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.3s ease;
}

.pwa-install-banner.is-visible {
    transform: translateY(0);
    opacity: 1;
}

.pwa-install-banner__icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--avis-red) 0%, var(--avis-red-dark) 100%);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(212, 0, 42, 0.3);
}

.pwa-install-banner__icon svg {
    fill: none;
    stroke: currentColor;
}

.pwa-install-banner__text {
    flex: 1;
    min-width: 0;
}

.pwa-install-banner__title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.1px;
    line-height: 1.2;
}

.pwa-install-banner__sub {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.3;
}

.pwa-install-banner__btn {
    background: var(--avis-red);
    color: #FFFFFF;
    border: 0;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, transform 0.08s ease;
}

.pwa-install-banner__btn:hover {
    background: var(--avis-red-dark);
}

.pwa-install-banner__btn:active {
    transform: scale(0.96);
}

.pwa-install-banner__close {
    background: transparent;
    border: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, color 0.15s ease;
}

.pwa-install-banner__close:hover {
    background: var(--bg-light);
    color: var(--text);
}

.pwa-install-banner__close svg {
    fill: none;
    stroke: currentColor;
}

/* ========================================================================
   DASHBOARD CARDS (Phase C1)
   ======================================================================== */

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

.dash-card {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 18px;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

.dash-card:hover {
    border-color: rgba(212, 0, 42, 0.3);
    box-shadow: 0 4px 16px rgba(15, 20, 32, 0.06);
}

.dash-card:active {
    transform: scale(0.985);
}

.dash-card__head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.dash-card__icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: var(--avis-red);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dash-card__icon svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.8;
    fill: none;
    stroke: currentColor;
}

.dash-card__title {
    flex: 1;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.2px;
}

.dash-card__arrow {
    color: var(--text-muted);
    flex-shrink: 0;
    opacity: 0.6;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.dash-card__arrow svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
}

.dash-card:hover .dash-card__arrow {
    opacity: 1;
    transform: translateX(2px);
}

.dash-card__sub {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 4px;
    padding-left: 50px;
}

.dash-card__stats {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    padding-top: 12px;
    padding-left: 50px;
    border-top: 1px solid var(--border);
}

.dash-card__stat {
    flex: 1;
    min-width: 0;
}

.dash-card__stat-label {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 2px;
}

.dash-card__stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.dash-card__unit {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    margin-left: 2px;
}

/* ========================================================================
   PULL-TO-REFRESH-INDIKATOR (Phase C1)
   ======================================================================== */

.pull-refresh {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    z-index: 60;
    margin-top: calc(env(safe-area-inset-top) + 56px);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(15, 20, 32, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    pointer-events: none;
    opacity: 0;
}

.pull-refresh.is-ready {
    color: var(--avis-red);
    border-color: rgba(212, 0, 42, 0.3);
}

.pull-refresh.is-refreshing .pull-refresh__spinner {
    animation: pullRefreshSpin 0.7s linear infinite;
}

.pull-refresh__spinner {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pull-refresh__spinner svg {
    fill: none;
    stroke: currentColor;
}

@keyframes pullRefreshSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ========================================================================
   DIENSTPLAN-MODUL (Phase C2 - Step 2)
   ======================================================================== */

/* View-Toggle (Liste/Woche) */
.dp-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.dp-toggle__btn {
    flex: 1;
    padding: 8px 0;
    text-decoration: none;
    background: transparent;
    color: var(--text-muted);
    border: 0.5px solid var(--border);
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.dp-toggle__btn.is-active {
    background: #1a1f2e;
    color: white;
    border-color: #1a1f2e;
}
.dp-toggle__btn svg {
    fill: none;
    stroke: currentColor;
}

/* Range-Picker (Heute/Woche/Monat/Eigener) */
.dp-ranges {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.dp-ranges::-webkit-scrollbar { display: none; }
.dp-range {
    flex-shrink: 0;
    padding: 6px 12px;
    background: white;
    color: var(--text-muted);
    border: 0.5px solid var(--border);
    border-radius: 99px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    display: inline-flex;
    align-items: center;
}
.dp-range svg { fill: none; stroke: currentColor; }
.dp-range.is-active {
    background: var(--avis-red);
    color: white;
    border-color: var(--avis-red);
}

/* Custom Range Form */
.dp-custom-form {
    background: white;
    border: 0.5px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
}
.dp-custom-form__row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}
.dp-custom-form__field {
    flex: 1;
}
.dp-custom-form__field label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 4px;
}
.dp-custom-form__field input {
    width: 100%;
    padding: 8px 10px;
    border: 0.5px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text);
    background: white;
    box-sizing: border-box;
}
.dp-custom-form__btn {
    width: 100%;
    padding: 10px;
    background: var(--avis-red);
    color: white;
    border: 0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

/* Wochen-Navigation */
.dp-weeknav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border: 0.5px solid var(--border);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 12px;
}
.dp-weeknav__btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    border-radius: 8px;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.dp-weeknav__btn:active {
    background: var(--bg-light);
}
.dp-weeknav__title {
    flex: 1;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.dp-weeknav__btn svg {
    fill: none;
    stroke: currentColor;
}

/* Group-Label (z.B. "Heute", "Diese Woche") */
.dp-group-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 14px 0 6px 4px;
}
.dp-group-label:first-child {
    margin-top: 4px;
}

/* Schicht-Card */
.dp-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.dp-card {
    display: flex;
    align-items: stretch;
    gap: 12px;
    padding: 12px;
    background: white;
    border: 0.5px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.dp-card:active {
    transform: scale(0.99);
}
.dp-card[data-id]:hover {
    border-color: rgba(212, 0, 42, 0.25);
    box-shadow: 0 2px 8px rgba(15, 20, 32, 0.05);
}
.dp-card.is-today {
    background: #FFF7ED;
    border-color: #FED7AA;
}
.dp-card--empty {
    opacity: 0.6;
}
.dp-card--empty.is-today {
    opacity: 1;
}
.dp-card--absence {
    background: #FEF2F2;
    border-color: #FECACA;
}
.dp-card--absence.is-today {
    background: #FEF2F2;
    border-color: #FCA5A5;
}

.dp-card__date {
    width: 52px;
    flex-shrink: 0;
    text-align: center;
    align-self: center;
}
.dp-card.is-today .dp-card__date {
    color: #C2410C;
}
.dp-card__day {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}
.dp-card.is-today .dp-card__day {
    color: #C2410C;
}
.dp-card--empty .dp-card__day {
    color: var(--text-muted);
    font-weight: 600;
}
.dp-card__dow {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}
.dp-card.is-today .dp-card__dow {
    color: #C2410C;
}

.dp-card__bar {
    width: 4px;
    border-radius: 2px;
    background: #94a3b8;
    flex-shrink: 0;
}
.dp-card__bar--empty {
    background: #cbd5e1;
}

.dp-card__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.dp-card__title {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.2px;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 6px;
}
.dp-card__today {
    background: #FED7AA;
    color: #C2410C;
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.dp-card__time, .dp-card__station, .dp-card__sub {
    font-size: 12.5px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 3px;
}
.dp-card__station {
    font-size: 11.5px;
    color: var(--text-muted);
    opacity: 0.8;
}
.dp-card__time svg, .dp-card__station svg {
    fill: none;
    stroke: currentColor;
    flex-shrink: 0;
}
.dp-card__free {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

.dp-card__pill {
    align-self: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: 0.3px;
}

/* Empty-State */
.dp-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.dp-empty__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}
.dp-empty__sub {
    font-size: 13px;
}
.dp-empty svg {
    fill: none;
    stroke: currentColor;
}

/* ========================================================================
   DETAIL-MODAL (Bottom-Sheet)
   ======================================================================== */

.dp-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    visibility: hidden;
    pointer-events: none;
    transition: visibility 0.25s;
}
.dp-modal.is-open {
    visibility: visible;
    pointer-events: auto;
}

.dp-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.25s ease;
}
.dp-modal.is-open .dp-modal__backdrop {
    opacity: 1;
}

.dp-modal__sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    border-radius: 18px 18px 0 0;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
    padding-bottom: env(safe-area-inset-bottom);
    -webkit-overflow-scrolling: touch;
}
.dp-modal.is-open .dp-modal__sheet {
    transform: translateY(0);
}
.dp-modal__handle {
    width: 36px;
    height: 4px;
    background: #cbd5e1;
    border-radius: 2px;
    margin: 8px auto 4px;
    flex-shrink: 0;
}

.dp-modal__loading {
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dp-spinner {
    animation: dpSpin 0.8s linear infinite;
    color: var(--avis-red);
    fill: none;
    stroke: currentColor;
}
@keyframes dpSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.dp-detail {
    padding: 12px 22px 28px;
    position: relative;
}
.dp-detail__close {
    position: absolute;
    top: 4px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-light);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.dp-detail__close svg { fill: none; stroke: currentColor; }
.dp-detail__date {
    font-size: 12.5px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
    margin-top: 4px;
}
.dp-detail__title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.3px;
    margin-bottom: 14px;
    padding-right: 40px;
}
.dp-detail__row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 0.5px solid var(--border);
    font-size: 13.5px;
}
.dp-detail__row:last-child {
    border-bottom: 0;
}
.dp-detail__label {
    color: var(--text-muted);
    font-weight: 500;
    flex-shrink: 0;
}
.dp-detail__value {
    color: var(--text);
    font-weight: 500;
    text-align: right;
    flex: 1;
    word-break: break-word;
}
.dp-detail__sub {
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 4px;
}
.dp-detail__divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}
.dp-detail__section-title {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 10px;
}
.dp-detail__colleagues {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.dp-detail__colleague {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: var(--bg-light);
    border-radius: 10px;
}
.dp-detail__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--avis-red) 0%, var(--avis-red-dark) 100%);
    color: white;
    font-size: 12.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.3px;
}
.dp-detail__col-info {
    flex: 1;
    min-width: 0;
}
.dp-detail__col-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dp-detail__col-role {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 1px;
}
