/* ═══════════════════════════════════════════════════════════════════════════
   OPBilling Design System — Clean & Minimal (Apple-Style)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── CSS Variables ────────────────────────────────────────────────────────── */
:root {
    --bg:           #f5f5f7;
    --surface:      #ffffff;
    --surface-2:    #f9f9fb;
    --border:       #e8e8ed;
    --border-light: #f0f0f5;

    --text-primary:   #1d1d1f;
    --text-secondary: #6e6e73;
    --text-tertiary:  #aeaeb2;

    --accent:         #007aff;
    --accent-light:   rgba(0,122,255,.10);
    --accent-hover:   #0066d9;
    --success:        #34c759;
    --success-light:  rgba(52,199,89,.12);
    --warning:        #ff9500;
    --warning-light:  rgba(255,149,0,.12);
    --danger:         #ff3b30;
    --danger-light:   rgba(255,59,48,.12);
    --info:           #5ac8fa;
    --info-light:     rgba(90,200,250,.12);

    --sidebar-width:  248px;
    --radius-sm:      8px;
    --radius-md:      12px;
    --radius-lg:      16px;
    --shadow-sm:      0 1px 3px rgba(0,0,0,.08), 0 0 0 1px rgba(0,0,0,.04);
    --shadow-md:      0 4px 16px rgba(0,0,0,.10);
    --shadow-lg:      0 12px 32px rgba(0,0,0,.14);

    --transition:     all .18s cubic-bezier(.25,.46,.45,.94);
}

/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter',
                 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    margin: 0;
    min-height: 100vh;
}

/* ── App Shell ────────────────────────────────────────────────────────────── */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 200;
    transition: transform .25s cubic-bezier(.25,.46,.45,.94);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border-light);
    text-decoration: none;
    color: var(--text-primary);
}
.sidebar-logo:hover { color: var(--text-primary); }
.logo-icon {
    font-size: 1.5rem;
    width: 36px;
    height: 36px;
    background: var(--accent);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.logo-text {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--text-primary);
}

.sidebar-section-label {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-tertiary);
    padding: 6px 8px 4px;
    margin: 14px 4px 2px;
    border-top: 1px solid var(--border-light);
    display: block;
}
/* Kein Separator vor dem ersten Label */
.sidebar-nav > .sidebar-section-label:first-child {
    border-top: none;
    margin-top: 4px;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 12px;
    overflow-y: auto;
}

.sidebar-nav a,
.sidebar-nav button.nav-link-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-primary);
    font-size: .92rem;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 2px;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
}
.sidebar-nav a:hover,
.sidebar-nav button.nav-link-btn:hover {
    background: var(--surface-2);
    color: var(--text-primary);
}
.sidebar-nav a.active,
.sidebar-nav a.active:hover {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
}
/* Untermenü-Links (eingerückt, kleiner) */
.sidebar-nav a.nav-sub,
.sidebar-nav button.nav-link-btn.nav-sub {
    padding-left: 38px;
    font-size: .83rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 1px;
}
.sidebar-nav a.nav-sub:hover,
.sidebar-nav button.nav-link-btn.nav-sub:hover {
    color: var(--text-primary);
}
.sidebar-nav a.nav-sub.active {
    color: var(--accent);
    font-weight: 500;
}
.sidebar-nav .nav-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-divider {
    height: 1px;
    background: var(--border-light);
    margin: 8px 0;
}

.sidebar-nav a.nav-primary {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    margin-bottom: 8px;
}
.sidebar-nav a.nav-primary:hover {
    background: var(--accent-hover);
    color: #fff;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border-light);
}

.sidebar-copyright {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
}

.sidebar-copyright-text {
    font-size: 10px;
    color: var(--text-tertiary, #aaa);
    white-space: nowrap;
}

.sidebar-legal-link {
    font-size: 10px;
    color: var(--text-tertiary, #aaa);
    text-decoration: none;
}

.sidebar-legal-link:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* ── Mobile Overlay ───────────────────────────────────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.3);
    z-index: 199;
    backdrop-filter: blur(2px);
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(calc(-1 * var(--sidebar-width)));
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    .sidebar-overlay.open { display: block; }
}

/* ── Main Content ─────────────────────────────────────────────────────────── */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
@media (max-width: 768px) {
    .main-wrapper { margin-left: 0; }
}

/* ── Top Bar (mobile) ─────────────────────────────────────────────────────── */
.top-bar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
@media (max-width: 768px) {
    .top-bar { display: flex; }
}
.hamburger {
    background: none;
    border: none;
    padding: 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1.2rem;
    line-height: 1;
    display: flex;
    align-items: center;
}
.hamburger:hover { background: var(--bg); }
.top-bar-title {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -.01em;
}

.main-content {
    flex: 1;
    padding: 28px 32px;
    max-width: 1280px;
}
@media (max-width: 768px) {
    .main-content { padding: 16px; }
}

/* ── Page Header ──────────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}
.page-title {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -.03em;
    color: var(--text-primary);
    margin: 0;
}
.page-subtitle {
    color: var(--text-secondary);
    font-size: .88rem;
    margin: 2px 0 0;
}

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-light);
    padding: 14px 18px;
    font-size: .88rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -.01em;
}
.card-body {
    padding: 18px;
}
.card-footer {
    background: var(--surface-2);
    border-top: 1px solid var(--border-light);
    padding: 12px 18px;
}

/* Stat Cards */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 18px 20px;
}
.stat-value {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -.04em;
    line-height: 1;
}
.stat-label {
    font-size: .8rem;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
}
.stat-delta {
    font-size: .78rem;
    font-weight: 600;
    margin-top: 6px;
}
.stat-delta.up   { color: var(--success); }
.stat-delta.down { color: var(--danger); }
.stat-delta.flat { color: var(--text-tertiary); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
    font-family: inherit;
    font-weight: 500;
    font-size: .88rem;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1.5px solid transparent;
    transition: var(--transition);
    letter-spacing: -.01em;
    line-height: 1.4;
    cursor: pointer;
}
.btn:focus-visible {
    outline: 3px solid var(--accent-light);
    outline-offset: 2px;
    box-shadow: none;
}
.btn:focus { box-shadow: none; }

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn-primary:hover, .btn-primary:active {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}
.btn-success {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}
.btn-success:hover { background: #2db84e; border-color: #2db84e; color: #fff; }
.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}
.btn-danger:hover { background: #e0352b; border-color: #e0352b; color: #fff; }

.btn-outline-primary {
    background: transparent;
    border-color: var(--accent);
    color: var(--accent);
}
.btn-outline-primary:hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
}
.btn-outline-secondary {
    background: transparent;
    border-color: var(--border);
    color: var(--text-primary);
}
.btn-outline-secondary:hover {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text-primary);
}
.btn-outline-danger {
    background: transparent;
    border-color: var(--danger);
    color: var(--danger);
}
.btn-outline-danger:hover {
    background: var(--danger-light);
    color: var(--danger);
    border-color: var(--danger);
}
.btn-secondary {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background: var(--border);
    color: var(--text-primary);
    border-color: var(--border);
}
.btn-lg { padding: 11px 22px; font-size: .95rem; border-radius: var(--radius-md); }
.btn-sm { padding: 5px 10px; font-size: .8rem; border-radius: 6px; }

/* Save button states */
.btn-success.inaktiv {
    background: var(--border);
    border-color: var(--border);
    color: var(--text-tertiary);
    pointer-events: none;
    cursor: not-allowed;
}

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-control, .form-select {
    font-family: inherit;
    font-size: .88rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    background: var(--surface);
    color: var(--text-primary);
    transition: var(--transition);
    line-height: 1.4;
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
    outline: none;
}
.form-control::placeholder { color: var(--text-tertiary); }
.form-control.bg-light { background: var(--surface-2); }

.form-label {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
    letter-spacing: -.01em;
}
.form-text {
    font-size: .78rem;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group-text {
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-right: none;
    color: var(--text-secondary);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    font-size: .88rem;
}

/* btn-check (radio/checkbox buttons) */
.btn-check + .btn-outline-primary {
    border-color: var(--border);
    color: var(--text-secondary);
    background: var(--surface);
}
.btn-check:checked + .btn-outline-primary {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}
.btn-check + .btn-outline-secondary {
    border-color: var(--border);
    color: var(--text-secondary);
    background: var(--surface);
}
.btn-check:checked + .btn-outline-secondary {
    background: rgba(0,0,0,.06);
    border-color: var(--text-secondary);
    color: var(--text-primary);
    font-weight: 600;
}

/* Form check */
.form-check-input {
    border: 1.5px solid var(--border);
    border-radius: 4px;
    width: 1rem;
    height: 1rem;
    margin-top: .2em;
}
.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}
.form-check-input:focus { box-shadow: 0 0 0 3px var(--accent-light); }

/* ── Tables ───────────────────────────────────────────────────────────────── */
.table {
    font-size: .88rem;
    color: var(--text-primary);
    border-collapse: separate;
    border-spacing: 0;
}
.table th {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-secondary);
    border-bottom: 1.5px solid var(--border);
    padding: 10px 14px;
    white-space: nowrap;
}
.table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover { background: var(--surface-2); }
.table-light { background: var(--surface-2); }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge {
    font-size: .72rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 20px;
    letter-spacing: .01em;
}
.bg-primary    { background: var(--accent) !important; }
.bg-success    { background: var(--success) !important; }
.bg-danger     { background: var(--danger) !important; }
.bg-warning    { background: var(--warning) !important; }
.bg-secondary  { background: var(--text-tertiary) !important; }
.bg-info       { background: var(--info) !important; }
.bg-light      { background: var(--surface-2) !important; color: var(--text-secondary) !important; }

/* Status-Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .76rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
}
.status-offen        { background: var(--warning-light); color: var(--warning); }
.status-abgeschlossen{ background: var(--success-light); color: #1a7a35; }
.status-storniert    { background: var(--danger-light);  color: var(--danger); }

/* ── Rollen-Vorschau Banner ────────────────────────────────────────────────── */
.rollen-vorschau-banner {
    background: #fff3cd;
    border-bottom: 2px solid #ffc107;
    color: #664d03;
    padding: 10px 20px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    border-radius: var(--radius-md);
}

/* ── Alerts ───────────────────────────────────────────────────────────────── */
.alert {
    border: none;
    border-radius: var(--radius-md);
    padding: 14px 16px;
    font-size: .88rem;
}
.alert-success  { background: var(--success-light); color: #1a7a35; }
.alert-danger   { background: var(--danger-light);  color: #c0392b; }
.alert-warning  { background: var(--warning-light); color: #b35900; }
.alert-info     { background: var(--accent-light);  color: var(--accent-hover); }

/* ── Dropdowns ────────────────────────────────────────────────────────────── */
.dropdown-menu {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 6px;
    font-size: .88rem;
}
.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 7px 12px;
    color: var(--text-primary);
}
.dropdown-item:hover { background: var(--surface-2); }

/* ── List Group (autocomplete dropdown) ───────────────────────────────────── */
.list-group-item {
    border-color: var(--border-light);
    font-size: .88rem;
    padding: 10px 14px;
    color: var(--text-primary);
}
.list-group-item-action:hover {
    background: var(--surface-2);
    color: var(--text-primary);
}
.list-group { border-radius: var(--radius-md); border: 1px solid var(--border); }

/* ── Pflichtfeld Validation ───────────────────────────────────────────────── */
.pflicht-hinweis {
    display: none;
    color: var(--danger);
    font-size: .8rem;
    font-weight: 500;
    margin-top: 5px;
}
.pflicht-hinweis.sichtbar { display: block; }
.pflicht-fehler-box {
    border: 2px solid var(--danger) !important;
    border-radius: var(--radius-sm) !important;
    background: var(--danger-light) !important;
    padding: 8px !important;
}

/* ── Time Picker ─────────────────────────────────────────────────────────── */
.tp-inline {
    display: flex;
    align-items: center;
    gap: 2px;
}
.tp-step {
    cursor: pointer;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-size: .78rem;
    width: 28px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
    touch-action: manipulation;
}
.tp-step:hover  { background: var(--accent-light); border-color: var(--accent); }
.tp-step:focus  { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.tp-part {
    cursor: pointer;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: 1rem;
    width: 38px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--text-primary);
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.tp-part.tp-empty { color: var(--text-tertiary); font-weight: 400; }
.tp-part:hover  { border-color: var(--accent); background: var(--accent-light); }
.tp-part:focus  { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.tp-colon {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-secondary);
    padding: 0 1px;
    user-select: none;
    line-height: 1;
}

/* ── Time Picker Grid-Popups ─────────────────────────────────────────────── */
.tp-grid-popup {
    position: absolute;
    z-index: 2000;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: none;
    padding: 8px;
}
.tp-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}
.tp-grid-btn {
    padding: 7px 0;
    font-size: .88rem;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    background: none;
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: center;
    min-width: 38px;
    color: var(--text-primary);
    transition: background .1s, border-color .1s;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}
.tp-grid-btn:hover  { background: var(--accent-light); border-color: var(--accent); }
.tp-grid-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Horizontal Rule ──────────────────────────────────────────────────────── */
hr {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 16px 0;
}

/* ── Utilities ────────────────────────────────────────────────────────────── */
.text-muted       { color: var(--text-secondary) !important; }
.text-success     { color: var(--success) !important; }
.text-danger      { color: var(--danger) !important; }
.text-primary     { color: var(--accent) !important; }
.text-secondary   { color: var(--text-secondary) !important; }
.fw-bold          { font-weight: 700 !important; }
.fw-semibold      { font-weight: 600 !important; }
.small            { font-size: .8rem; }
.font-monospace   { font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace; }

code {
    background: var(--surface-2);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: .82em;
    color: var(--danger);
    font-family: 'SF Mono', 'Menlo', monospace;
}

/* ── Month-Chart (Statistik) ──────────────────────────────────────────────── */
.month-bars { display: flex; align-items: flex-end; gap: 6px; height: 128px; padding-top: 8px; }
.month-bar-wrap { display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 0; }
.month-bar {
    width: 100%;
    max-width: 28px;
    min-height: 3px;
    border-radius: 4px 4px 0 0;
    transition: opacity .15s;
    position: relative;
}
.month-bar.aktuell  { background: var(--accent); }
.month-bar.vorjahr  { background: var(--border); margin-left: 2px; }
.month-bar:hover    { opacity: .75; }
.bar-val {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: .65rem;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
}
.month-label { font-size: .66rem; color: var(--text-tertiary); margin-top: 3px; text-align: center; }

.chart-legend { display: flex; gap: 16px; align-items: center; }
.chart-legend span {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    margin-right: 4px;
    vertical-align: middle;
}

/* ── Signature Canvas ─────────────────────────────────────────────────────── */
canvas { touch-action: none; }

/* ── Sticky Save Bar ──────────────────────────────────────────────────────── */
.sticky-save {
    position: sticky;
    bottom: 16px;
    z-index: 50;
    padding: 14px 18px;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-top: 20px;
}

/* ── Scan / QR Block ──────────────────────────────────────────────────────── */
.scan-block {
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    background: var(--surface-2);
    transition: border-color .15s;
}
.scan-block:focus-within { border-color: var(--accent); background: var(--surface); }

/* ── Statistik: Monatsbalken-Chart ───────────────────────────────────────── */
.month-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 160px;
    padding-bottom: 28px;
    position: relative;
}
.month-bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: center;
    gap: 1px;
    height: 100%;
    position: relative;
}
.month-bar {
    flex: 1;
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    transition: opacity .15s;
    position: relative;
}
.month-bar.aktuell { background: var(--accent); }
.month-bar.vorjahr { background: var(--border); }
.month-bar:hover   { opacity: .75; }
.month-bar .bar-val {
    position: absolute;
    top: -18px;
    left: 50%; transform: translateX(-50%);
    font-size: .68rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}
.month-label {
    position: absolute;
    bottom: 0;
    font-size: .68rem;
    color: var(--text-secondary);
    left: 50%; transform: translateX(-50%);
    white-space: nowrap;
}
.chart-axis { border-top: 2px solid var(--border); margin-top: -2px; }
.chart-legend span { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 4px; }

/* ── Admin Cards ─────────────────────────────────────────────────────────── */
.admin-section-label {
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-secondary);
    margin: 28px 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}
.admin-section-label:first-child { margin-top: 4px; }

.admin-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 18px;
    text-decoration: none;
    color: var(--text-primary);
    transition: box-shadow .18s cubic-bezier(.25,.46,.45,.94),
                transform .18s cubic-bezier(.25,.46,.45,.94),
                border-color .18s;
    height: 100%;
    position: relative;
    overflow: hidden;
}
.admin-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--border);
    color: var(--text-primary);
    text-decoration: none;
}
.admin-card:active { transform: translateY(0); box-shadow: var(--shadow-sm); }
.admin-card.disabled {
    opacity: .45;
    pointer-events: none;
    cursor: default;
}

.admin-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 13px;
    flex-shrink: 0;
}
.admin-card-title {
    font-size: .93rem;
    font-weight: 600;
    letter-spacing: -.01em;
    margin-bottom: 4px;
    line-height: 1.2;
}
.admin-card-desc {
    font-size: .78rem;
    color: var(--text-secondary);
    line-height: 1.45;
}
.admin-card-arrow {
    position: absolute;
    top: 18px;
    right: 16px;
    color: var(--text-tertiary);
    font-size: .75rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity .15s;
}
.admin-card:hover .admin-card-arrow { opacity: 1; }

.admin-badge-soon {
    display: inline-block;
    margin-top: 8px;
    font-size: .7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    background: var(--surface-2);
    color: var(--text-tertiary);
    border: 1px solid var(--border);
}

/* Icon colour variants */
.icon-blue   { background: rgba(0,122,255,.10);  }
.icon-green  { background: rgba(52,199,89,.12);  }
.icon-orange { background: rgba(255,149,0,.12);  }
.icon-red    { background: rgba(255,59,48,.10);  }
.icon-purple { background: rgba(175,82,222,.12); }
.icon-teal   { background: rgba(90,200,250,.13); }
.icon-indigo { background: rgba(88,86,214,.10);  }
.icon-gray   { background: var(--surface-2);     }

/* ── Admin Edit Mode (iPhone-style drag & drop) ──────────────────────────── */
@keyframes admin-jiggle {
    0%   { transform: rotate(-1.3deg) translateY(0); }
    50%  { transform: rotate( 1.3deg) translateY(-1px); }
    100% { transform: rotate(-1.3deg) translateY(0); }
}
.admin-editing .admin-card:not(.disabled) {
    animation: admin-jiggle .26s infinite ease-in-out;
    cursor: grab;
    user-select: none;
}
.admin-editing .admin-col { cursor: grab; }
.admin-ghost  { opacity: .3 !important; }
.admin-ghost .admin-card { box-shadow: none !important; transform: none !important; }
.admin-chosen .admin-card {
    animation: none !important;
    box-shadow: var(--shadow-lg) !important;
    transform: scale(1.05) rotate(1.5deg) !important;
    opacity: .95;
    cursor: grabbing;
    z-index: 999;
}
.btn-edit-done {
    font-size: .82rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}
.btn-edit-done.edit  { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-primary); }
.btn-edit-done.edit:hover  { background: var(--bg); }
.btn-edit-done.done  { background: var(--accent); color: #fff; }
.btn-edit-done.done:hover  { background: var(--accent-hover); }

/* ── No-Print ─────────────────────────────────────────────────────────────── */
@media print {
    .sidebar, .top-bar, .no-print, .sticky-save { display: none !important; }
    .main-wrapper { margin-left: 0; }
    .main-content { padding: 0; }
    .card { box-shadow: none; border: 1px solid #ccc; }
}
