:root {
    --sidebar-width: 250px;
    --sidebar-collapsed: 62px;
    --sidebar-bg: #1a3a5c;
    --header-bg: #1a3a5c;
    --sidebar-hover: #2a5a8c;
    --sidebar-active: #3a7abf;
    --header-height: 56px;
}

body {
    background: #f4f6f9;
}

/* ── Header ── */
#acm-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: var(--header-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    z-index: 1050;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

#acm-header .brand {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: .5px;
}

#acm-header .user-info {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: #fff;
}

#acm-header .user-info .avatar {
    width: 34px; height: 34px;
    background: #3a7abf;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: .9rem;
}

/* ── Sidebar ── */
#acm-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    transition: width .25s ease;
    overflow: hidden;
    z-index: 1040;
    display: flex;
    flex-direction: column;
}

#acm-sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-nav {
    list-style: none;
    padding: .5rem 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .7rem 1rem;
    color: #b8d0e8;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar-nav a.active {
    background: var(--sidebar-active);
    color: #fff;
    border-left-color: #7ec8f4;
}

.sidebar-nav i {
    font-size: 1.1rem;
    min-width: 22px;
    text-align: center;
}

.sidebar-nav .label {
    opacity: 1;
    transition: opacity .2s;
}

#acm-sidebar.collapsed .label {
    opacity: 0;
    pointer-events: none;
}

/* Toggle-Button */
#sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: .6rem 1rem;
    color: #7eb8e8;
    cursor: pointer;
    border-top: 1px solid rgba(255,255,255,.1);
    user-select: none;
}

#sidebar-toggle:hover { color: #fff; }

#acm-sidebar.collapsed #sidebar-toggle {
    justify-content: center;
}

/* ── Sidebar Groups ── */
.sidebar-group-header {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: 1rem 1rem .3rem;
    color: #5a9ecf;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    white-space: nowrap;
}

.sidebar-group-header.active {
    color: #b8d0e8;
}

.sidebar-group-header i {
    font-size: 1rem;
    min-width: 22px;
    text-align: center;
}

.sidebar-subnav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-subnav a {
    padding-left: 2.4rem;
}

#acm-sidebar.collapsed .sidebar-group-header {
    justify-content: center;
    padding-left: 1rem;
    padding-right: 1rem;
}

#acm-sidebar.collapsed .sidebar-subnav a {
    padding-left: 1rem;
}

/* ── Main Content ── */
#acm-content {
    margin-top: var(--header-height);
    margin-left: var(--sidebar-width);
    padding: 1.75rem;
    min-height: calc(100vh - var(--header-height));
    transition: margin-left .25s ease;
}

#acm-content.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed);
}

/* ── Flash Messages ── */
.flash-container {
    margin-bottom: 1rem;
}

/* ── Vollbild-Modus ── */
body.acm-fullscreen #acm-header,
body.acm-fullscreen #acm-sidebar {
    display: none !important;
}

body.acm-fullscreen #acm-content {
    margin-top: 0 !important;
    margin-left: 0 !important;
    padding: .75rem !important;
}

/* Elemente die im Vollbild versteckt werden */
body.acm-fullscreen .fs-hidden {
    display: none !important;
}

/* Training-Header im Vollbild: weniger Abstand */
body.acm-fullscreen #training-header {
    margin-bottom: .4rem !important;
}

/* QR-Code im Vollbild: schwebend oben rechts, Größe per JS gesetzt */
body.acm-fullscreen #qr-card {
    position: fixed !important;
    top: 4px;
    right: 4px;
    z-index: 9000;
    min-width: auto !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    background: transparent !important;
    cursor: pointer;
    overflow: hidden;
}

body.acm-fullscreen #qr-card .qr-label {
    display: none;
}

body.acm-fullscreen #qr-card img {
    display: block !important;
    image-rendering: pixelated;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
}

/* Info-Karten im Vollbild: minimale Höhe, einzeilig */
body.acm-fullscreen #info-cards {
    margin-bottom: .4rem !important;
    gap: .3rem !important;
}

body.acm-fullscreen #info-cards .card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: .4rem !important;
    padding: .2rem .6rem !important;
    text-align: left !important;
}

body.acm-fullscreen #info-cards .card .info-label {
    font-size: .65rem !important;
    margin-bottom: 0 !important;
    white-space: nowrap;
}

body.acm-fullscreen #info-cards .card .info-value {
    font-size: .95rem !important;
    font-weight: 700;
    white-space: nowrap;
}

/* Fenster-Button: Mitte oben, schwebend, dezent */
.btn-fullscreen-exit {
    position: fixed;
    top: .5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: none;
    opacity: .55;
    transition: opacity .15s;
}

.btn-fullscreen-exit:hover {
    opacity: 1;
}

body.acm-fullscreen .btn-fullscreen-exit {
    display: block;
}

/* ── Login Page ── */
.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a3a5c 0%, #2a5a8c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,.25);
}

.login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--sidebar-bg);
    font-size: 1.5rem;
    font-weight: 700;
}
