/* ═══════════════════════════════════════════════════════════════════════════
   PulzTag — Design-System
   Alle Farben und Abstände als CSS-Variablen definiert.
   Der Admin-Bereich setzt diese aus PHP (settings) über ein <style>-Tag.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Selbst gehostete Fonts ─────────────────────────────────────────────── */
@font-face {
    font-family: 'Raleway';
    src: local('Raleway'),
         url('fonts/raleway/Raleway-Regular.woff2') format('woff2');
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Raleway';
    src: local('Raleway SemiBold'),
         url('fonts/raleway/Raleway-SemiBold.woff2') format('woff2');
    font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Raleway';
    src: local('Raleway Bold'),
         url('fonts/raleway/Raleway-Bold.woff2') format('woff2');
    font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Lato';
    src: local('Lato'),
         url('fonts/lato/Lato-Regular.woff2') format('woff2');
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Lato';
    src: local('Lato Bold'),
         url('fonts/lato/Lato-Bold.woff2') format('woff2');
    font-weight: 700; font-style: normal; font-display: swap;
}

/* ── Design-Token (werden via <style> aus PHP überschrieben) ────────────── */
:root {
    --pt-primary:       #780078;
    --pt-primary-soft:  rgba(120, 0, 120, 0.15);
    --pt-accent:        #00E5A0;
    --pt-accent-soft:   rgba(0, 229, 160, 0.12);
    --pt-bg:            #0D0D14;
    --pt-surface:       #16161F;
    --pt-surface2:      #1E1E2A;
    --pt-border:        #2A2A38;
    --pt-text:          #F0EFF5;
    --pt-text-muted:    #8888A0;
    --pt-success:       #00E5A0;
    --pt-warning:       #F5A623;
    --pt-danger:        #FF4560;
    --pt-danger-soft:   rgba(255, 69, 96, 0.15);
    --pt-radius:        10px;
    --pt-radius-sm:     6px;
    --pt-radius-lg:     16px;
    --pt-font-heading:  'Raleway', 'Segoe UI', system-ui, sans-serif;
    --pt-font-body:     'Lato', 'Segoe UI', system-ui, sans-serif;
    --pt-font-mono:     'JetBrains Mono', 'Fira Code', monospace;
    --pt-font-size:     15px;
    --pt-sidebar-w:     240px;
    --pt-transition:    200ms ease;
    --pt-shadow:        0 2px 12px rgba(0,0,0,.4);
    --pt-shadow-lg:     0 8px 32px rgba(0,0,0,.5);
}

/* ── Reset & Basis ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: var(--pt-font-size);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--pt-font-body);
    background: var(--pt-bg);
    color: var(--pt-text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ── Typografie ─────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5 {
    font-family: var(--pt-font-heading);
    font-weight: 700;
    line-height: 1.25;
    color: var(--pt-text);
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 0.95rem; }

p { margin-bottom: 0.75rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--pt-accent); text-decoration: none; transition: opacity var(--pt-transition); }
a:hover { opacity: 0.8; }

code, kbd {
    font-family: var(--pt-font-mono);
    font-size: 0.85em;
    background: var(--pt-surface2);
    padding: 2px 6px;
    border-radius: var(--pt-radius-sm);
    color: var(--pt-accent);
}

/* ── Layout: Sidebar + Main ─────────────────────────────────────────────── */
.pt-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────────────────── */
.pt-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--pt-sidebar-w);
    background: var(--pt-surface);
    border-right: 1px solid var(--pt-border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
    transition: transform var(--pt-transition);
}

.pt-sidebar-brand {
    padding: 20px 18px 16px;
    border-bottom: 1px solid var(--pt-border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.pt-brand-logo {
    max-height: 36px;
    max-width: 120px;
    object-fit: contain;
}

.pt-brand-text {
    font-family: var(--pt-font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--pt-text);
    letter-spacing: 0.3px;
}
.pt-brand-text span { color: var(--pt-primary); }

.pt-brand-version {
    font-size: 0.65rem;
    color: var(--pt-text-muted);
    margin-top: 2px;
    letter-spacing: 0.5px;
}

/* ── Navigation ─────────────────────────────────────────────────────────── */
.pt-nav {
    flex: 1;
    padding: 12px 0;
    list-style: none;
}

.pt-nav-section {
    padding: 14px 18px 4px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--pt-text-muted);
}

.pt-nav-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 18px;
    color: var(--pt-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0;
    transition: all var(--pt-transition);
    position: relative;
}

.pt-nav-item a:hover {
    color: var(--pt-text);
    background: var(--pt-surface2);
    opacity: 1;
}

.pt-nav-item.active a {
    color: var(--pt-primary);
    background: var(--pt-primary-soft);
    font-weight: 600;
}

.pt-nav-item.active a::before {
    content: '';
    position: absolute;
    left: 0; top: 4px; bottom: 4px;
    width: 3px;
    background: var(--pt-primary);
    border-radius: 0 3px 3px 0;
}

.pt-nav-icon {
    width: 18px; height: 18px;
    flex-shrink: 0;
    opacity: 0.7;
}
.pt-nav-item.active a .pt-nav-icon,
.pt-nav-item a:hover .pt-nav-icon { opacity: 1; }

.pt-nav-badge {
    margin-left: auto;
    background: var(--pt-danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 20px;
    min-width: 18px;
    text-align: center;
}

/* Sidebar Footer */
.pt-sidebar-footer {
    padding: 12px 18px 16px;
    border-top: 1px solid var(--pt-border);
    font-size: 0.75rem;
    color: var(--pt-text-muted);
}

.pt-sidebar-footer a {
    color: var(--pt-text-muted);
    font-size: 0.75rem;
}

.pt-powered {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    color: var(--pt-text-muted);
    opacity: 0.7;
}

.pt-powered .pt-heart { color: var(--pt-primary); animation: heartbeat 2s ease infinite; }

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    14% { transform: scale(1.15); }
    28% { transform: scale(1); }
    42% { transform: scale(1.1); }
    70% { transform: scale(1); }
}

/* ── Hauptbereich ───────────────────────────────────────────────────────── */
.pt-main {
    margin-left: var(--pt-sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.pt-topbar {
    position: sticky;
    top: 0;
    background: var(--pt-bg);
    border-bottom: 1px solid var(--pt-border);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 50;
    backdrop-filter: blur(8px);
}

.pt-topbar-title {
    font-family: var(--pt-font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    flex: 1;
}

.pt-topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--pt-text-muted);
}

.pt-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--pt-primary-soft);
    border: 2px solid var(--pt-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--pt-primary);
    text-transform: uppercase;
    flex-shrink: 0;
}

.pt-content {
    flex: 1;
    padding: 28px;
    max-width: 1200px;
    width: 100%;
}

/* ── Karten ─────────────────────────────────────────────────────────────── */
.pt-card {
    background: var(--pt-surface);
    border: 1px solid var(--pt-border);
    border-radius: var(--pt-radius);
    padding: 22px;
    margin-bottom: 20px;
}

.pt-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--pt-border);
}

.pt-card-title {
    font-family: var(--pt-font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--pt-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Stat-Karten ─────────────────────────────────────────────────────────── */
.pt-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.pt-stat-card {
    background: var(--pt-surface);
    border: 1px solid var(--pt-border);
    border-radius: var(--pt-radius);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: border-color var(--pt-transition), transform var(--pt-transition);
}
.pt-stat-card:hover {
    border-color: var(--pt-primary);
    transform: translateY(-2px);
}

.pt-stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--pt-primary), var(--pt-accent));
    opacity: 0;
    transition: opacity var(--pt-transition);
}
.pt-stat-card:hover::before { opacity: 1; }

.pt-stat-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--pt-text-muted);
    margin-bottom: 8px;
}

.pt-stat-value {
    font-family: var(--pt-font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--pt-text);
    line-height: 1;
}

.pt-stat-sub {
    font-size: 0.75rem;
    color: var(--pt-text-muted);
    margin-top: 6px;
}

.pt-stat-icon {
    position: absolute;
    top: 18px; right: 18px;
    width: 32px; height: 32px;
    opacity: 0.15;
}

/* ── EKG-Chart ───────────────────────────────────────────────────────────── */
.pt-ekg-wrap {
    position: relative;
    background: var(--pt-surface);
    border: 1px solid var(--pt-border);
    border-radius: var(--pt-radius);
    padding: 22px;
    margin-bottom: 24px;
    overflow: hidden;
}

.pt-ekg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.pt-ekg-pulse-dot {
    width: 8px; height: 8px;
    background: var(--pt-accent);
    border-radius: 50%;
    animation: pulse-dot 2s ease infinite;
    box-shadow: 0 0 0 0 var(--pt-accent);
}
@keyframes pulse-dot {
    0%   { box-shadow: 0 0 0 0 rgba(0,229,160,.6); }
    70%  { box-shadow: 0 0 0 8px rgba(0,229,160,0); }
    100% { box-shadow: 0 0 0 0 rgba(0,229,160,0); }
}

.pt-ekg-svg {
    width: 100%;
    height: 100px;
    display: block;
}

.pt-ekg-line {
    fill: none;
    stroke: var(--pt-accent);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 4px rgba(0,229,160,.5));
}

.pt-ekg-area {
    fill: url(#ekgGradient);
}

.pt-ekg-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.7rem;
    color: var(--pt-text-muted);
}

/* ── Aktivitäts-Indikator ────────────────────────────────────────────────── */
.pt-pulse-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.pt-pulse-dot.green  { background: var(--pt-success); box-shadow: 0 0 0 3px rgba(0,229,160,.2); }
.pt-pulse-dot.yellow { background: var(--pt-warning); }
.pt-pulse-dot.gray   { background: var(--pt-text-muted); }

.pt-trend { font-size: 0.8rem; font-weight: 700; }
.pt-trend.up   { color: var(--pt-success); }
.pt-trend.down { color: var(--pt-danger); }
.pt-trend.flat { color: var(--pt-text-muted); }

/* ── Tabellen ────────────────────────────────────────────────────────────── */
.pt-table-wrap {
    overflow-x: auto;
    border-radius: var(--pt-radius);
    border: 1px solid var(--pt-border);
}

.pt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    background: var(--pt-surface);
}

.pt-table th {
    background: var(--pt-surface2);
    padding: 11px 16px;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--pt-text-muted);
    border-bottom: 1px solid var(--pt-border);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}
.pt-table th:hover { color: var(--pt-text); }
.pt-table th.sorted-asc::after  { content: ' ↑'; color: var(--pt-accent); }
.pt-table th.sorted-desc::after { content: ' ↓'; color: var(--pt-accent); }

.pt-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--pt-border);
    vertical-align: middle;
}
.pt-table tr:last-child td { border-bottom: 0; }
.pt-table tbody tr:hover { background: var(--pt-surface2); }

.pt-table-slug {
    font-family: var(--pt-font-mono);
    font-size: 0.8rem;
    color: var(--pt-accent);
    background: var(--pt-accent-soft);
    padding: 2px 8px;
    border-radius: var(--pt-radius-sm);
}

.pt-table-label {
    font-weight: 600;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pt-table-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.pt-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border: none;
    border-radius: var(--pt-radius-sm);
    font-family: var(--pt-font-body);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: all var(--pt-transition);
    line-height: 1;
}

.pt-btn-primary {
    background: var(--pt-primary);
    color: #fff;
}
.pt-btn-primary:hover { background: color-mix(in srgb, var(--pt-primary) 85%, white); opacity: 1; }

.pt-btn-accent {
    background: var(--pt-accent);
    color: #0D0D14;
}
.pt-btn-accent:hover { opacity: 0.85; }

.pt-btn-ghost {
    background: transparent;
    color: var(--pt-text-muted);
    border: 1px solid var(--pt-border);
}
.pt-btn-ghost:hover { color: var(--pt-text); border-color: var(--pt-text-muted); opacity: 1; }

.pt-btn-danger {
    background: var(--pt-danger-soft);
    color: var(--pt-danger);
    border: 1px solid transparent;
}
.pt-btn-danger:hover { background: var(--pt-danger); color: #fff; opacity: 1; }

.pt-btn-sm {
    padding: 5px 10px;
    font-size: 0.78rem;
}

.pt-btn-icon {
    padding: 7px;
    width: 32px; height: 32px;
    justify-content: center;
}

.pt-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Formulare ───────────────────────────────────────────────────────────── */
.pt-form-group {
    margin-bottom: 18px;
}

.pt-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--pt-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.pt-label .req { color: var(--pt-danger); }

.pt-input, .pt-select, .pt-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--pt-surface2);
    border: 1px solid var(--pt-border);
    border-radius: var(--pt-radius-sm);
    color: var(--pt-text);
    font-family: var(--pt-font-body);
    font-size: 0.875rem;
    transition: border-color var(--pt-transition), box-shadow var(--pt-transition);
    outline: none;
    -webkit-appearance: none;
}

.pt-input:focus, .pt-select:focus, .pt-textarea:focus {
    border-color: var(--pt-primary);
    box-shadow: 0 0 0 3px var(--pt-primary-soft);
}

.pt-input.error { border-color: var(--pt-danger); }
.pt-input:disabled { opacity: 0.5; cursor: not-allowed; }

.pt-input-group {
    display: flex;
    gap: 8px;
}
.pt-input-group .pt-input { flex: 1; }

.pt-input-prefix {
    display: flex;
    align-items: center;
}
.pt-input-prefix-text {
    padding: 10px 12px;
    background: var(--pt-surface2);
    border: 1px solid var(--pt-border);
    border-right: none;
    border-radius: var(--pt-radius-sm) 0 0 var(--pt-radius-sm);
    color: var(--pt-text-muted);
    font-size: 0.8rem;
    white-space: nowrap;
}
.pt-input-prefix .pt-input {
    border-radius: 0 var(--pt-radius-sm) var(--pt-radius-sm) 0;
}

.pt-textarea { resize: vertical; min-height: 80px; }
.pt-select { cursor: pointer; }

.pt-hint {
    font-size: 0.75rem;
    color: var(--pt-text-muted);
    margin-top: 5px;
    line-height: 1.4;
}

.pt-field-error {
    font-size: 0.75rem;
    color: var(--pt-danger);
    margin-top: 4px;
}

/* Color-Picker-Feld */
.pt-color-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.pt-color-preview {
    width: 36px; height: 36px;
    border-radius: var(--pt-radius-sm);
    border: 2px solid var(--pt-border);
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color var(--pt-transition);
}
.pt-color-preview:hover { border-color: var(--pt-text-muted); }

/* Checkbox & Toggle */
.pt-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--pt-border);
}
.pt-toggle-row:last-child { border-bottom: 0; }

.pt-toggle-label { font-size: 0.875rem; }
.pt-toggle-desc  { font-size: 0.75rem; color: var(--pt-text-muted); margin-top: 2px; }

.pt-toggle {
    position: relative;
    display: inline-block;
    width: 40px; height: 22px;
    flex-shrink: 0;
}
.pt-toggle input { opacity: 0; width: 0; height: 0; }
.pt-toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--pt-surface2);
    border: 1px solid var(--pt-border);
    border-radius: 22px;
    transition: background var(--pt-transition);
    cursor: pointer;
}
.pt-toggle-slider::before {
    content: '';
    position: absolute;
    left: 3px; top: 3px;
    width: 14px; height: 14px;
    background: var(--pt-text-muted);
    border-radius: 50%;
    transition: all var(--pt-transition);
}
.pt-toggle input:checked + .pt-toggle-slider { background: var(--pt-primary); border-color: var(--pt-primary); }
.pt-toggle input:checked + .pt-toggle-slider::before {
    transform: translateX(18px);
    background: #fff;
}

/* ── Badges & Status ─────────────────────────────────────────────────────── */
.pt-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}
.pt-badge-success { background: rgba(0,229,160,.15); color: var(--pt-success); }
.pt-badge-warning { background: rgba(245,166,35,.15); color: var(--pt-warning); }
.pt-badge-danger  { background: var(--pt-danger-soft); color: var(--pt-danger); }
.pt-badge-muted   { background: var(--pt-surface2); color: var(--pt-text-muted); }
.pt-badge-primary { background: var(--pt-primary-soft); color: var(--pt-primary); }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.pt-alert {
    padding: 12px 16px;
    border-radius: var(--pt-radius-sm);
    font-size: 0.875rem;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-left: 3px solid;
}
.pt-alert-success { background: rgba(0,229,160,.1); border-color: var(--pt-success); color: var(--pt-success); }
.pt-alert-warning { background: rgba(245,166,35,.1); border-color: var(--pt-warning); color: var(--pt-warning); }
.pt-alert-danger  { background: var(--pt-danger-soft); border-color: var(--pt-danger); color: var(--pt-danger); }
.pt-alert-info    { background: var(--pt-primary-soft); border-color: var(--pt-primary); color: var(--pt-text); }

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.pt-tabs {
    display: flex;
    border-bottom: 1px solid var(--pt-border);
    margin-bottom: 24px;
    gap: 2px;
    overflow-x: auto;
}
.pt-tab {
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--pt-text-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--pt-transition);
    background: transparent;
    border-top: 0; border-left: 0; border-right: 0;
    font-family: var(--pt-font-body);
}
.pt-tab:hover { color: var(--pt-text); }
.pt-tab.active {
    color: var(--pt-primary);
    border-bottom-color: var(--pt-primary);
}
.pt-tab-panel { display: none; }
.pt-tab-panel.active { display: block; }

/* ── Onboarding / Setup ──────────────────────────────────────────────────── */
.pt-setup-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--pt-bg);
}

.pt-setup-card {
    width: 100%;
    max-width: 520px;
    background: var(--pt-surface);
    border: 1px solid var(--pt-border);
    border-radius: var(--pt-radius-lg);
    overflow: hidden;
}

.pt-setup-header {
    background: linear-gradient(135deg, var(--pt-primary) 0%, #4a0050 100%);
    padding: 32px 36px 28px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.pt-setup-header::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 180px; height: 180px;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
}

.pt-setup-logo {
    max-height: 48px;
    margin-bottom: 12px;
}

.pt-setup-product {
    font-family: var(--pt-font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.pt-setup-tagline {
    font-size: 0.8rem;
    color: rgba(255,255,255,.6);
    margin-top: 4px;
}

/* Step-Indicator */
.pt-steps {
    display: flex;
    align-items: center;
    padding: 20px 36px;
    background: var(--pt-surface2);
    border-bottom: 1px solid var(--pt-border);
    gap: 0;
}

.pt-step {
    display: flex;
    align-items: center;
    flex: 1;
}

.pt-step-dot {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 2px solid var(--pt-border);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--pt-text-muted);
    background: var(--pt-surface);
    flex-shrink: 0;
    transition: all var(--pt-transition);
    z-index: 1;
}

.pt-step.done .pt-step-dot {
    background: var(--pt-success);
    border-color: var(--pt-success);
    color: #0D0D14;
}
.pt-step.active .pt-step-dot {
    background: var(--pt-primary);
    border-color: var(--pt-primary);
    color: #fff;
    box-shadow: 0 0 0 4px var(--pt-primary-soft);
}

.pt-step-line {
    flex: 1;
    height: 2px;
    background: var(--pt-border);
    margin: 0 4px;
}
.pt-step.done + .pt-step .pt-step-line { background: var(--pt-success); }

.pt-setup-body { padding: 28px 36px; }
.pt-setup-step-title {
    font-family: var(--pt-font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.pt-setup-step-desc {
    font-size: 0.85rem;
    color: var(--pt-text-muted);
    margin-bottom: 24px;
}

.pt-setup-footer {
    padding: 16px 36px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--pt-border);
}

/* ── Login-Seite ─────────────────────────────────────────────────────────── */
.pt-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--pt-bg);
}

.pt-login-card {
    width: 100%;
    max-width: 380px;
    background: var(--pt-surface);
    border: 1px solid var(--pt-border);
    border-radius: var(--pt-radius-lg);
    overflow: hidden;
}

.pt-login-header {
    padding: 28px 28px 20px;
    text-align: center;
    border-bottom: 1px solid var(--pt-border);
}

.pt-login-logo { max-height: 40px; margin-bottom: 10px; }
.pt-login-product {
    font-family: var(--pt-font-heading);
    font-size: 1.2rem;
    font-weight: 700;
}
.pt-login-product span { color: var(--pt-primary); }

.pt-login-body { padding: 24px 28px; }
.pt-login-footer {
    padding: 14px 28px 20px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--pt-text-muted);
    border-top: 1px solid var(--pt-border);
}

/* EKG-Dekoration auf der Login-Seite */
.pt-login-ekg {
    height: 36px;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* ── Kontrastwarnung ─────────────────────────────────────────────────────── */
.pt-contrast-warn {
    font-size: 0.72rem;
    color: var(--pt-warning);
    margin-top: 4px;
    display: none;
}
.pt-contrast-warn.show { display: block; }

/* ── Update-Banner ───────────────────────────────────────────────────────── */
.pt-update-banner {
    background: var(--pt-primary-soft);
    border: 1px solid var(--pt-primary);
    border-radius: var(--pt-radius-sm);
    padding: 10px 16px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

/* ── Toast-Nachrichten ───────────────────────────────────────────────────── */
.pt-toast-area {
    position: fixed;
    bottom: 24px; right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.pt-toast {
    background: var(--pt-surface);
    border: 1px solid var(--pt-border);
    border-radius: var(--pt-radius-sm);
    padding: 12px 16px;
    font-size: 0.85rem;
    max-width: 320px;
    box-shadow: var(--pt-shadow-lg);
    pointer-events: all;
    animation: slideInRight 300ms ease;
}
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);   opacity: 1; }
}
.pt-toast.success { border-left: 3px solid var(--pt-success); }
.pt-toast.error   { border-left: 3px solid var(--pt-danger); }

/* ── Leerer Zustand ──────────────────────────────────────────────────────── */
.pt-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--pt-text-muted);
}
.pt-empty-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.4; }
.pt-empty h3 { color: var(--pt-text); margin-bottom: 8px; }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.pt-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0 0;
    font-size: 0.8rem;
    color: var(--pt-text-muted);
    flex-wrap: wrap;
    gap: 12px;
}
.pt-pagination-pages {
    display: flex;
    gap: 4px;
}
.pt-page-btn {
    min-width: 32px; height: 32px;
    border-radius: var(--pt-radius-sm);
    border: 1px solid var(--pt-border);
    background: transparent;
    color: var(--pt-text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--pt-transition);
    font-family: var(--pt-font-body);
    padding: 0 6px;
}
.pt-page-btn:hover { border-color: var(--pt-primary); color: var(--pt-primary); }
.pt-page-btn.active { background: var(--pt-primary); border-color: var(--pt-primary); color: #fff; }
.pt-page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Modus-Schalter ──────────────────────────────────────────────────────── */
.pt-mode-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--pt-text-muted);
}
.pt-mode-pill {
    display: flex;
    background: var(--pt-surface2);
    border: 1px solid var(--pt-border);
    border-radius: 20px;
    padding: 2px;
}
.pt-mode-opt {
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--pt-transition);
    color: var(--pt-text-muted);
    user-select: none;
}
.pt-mode-opt.active { background: var(--pt-primary); color: #fff; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    :root { --pt-sidebar-w: 0px; }

    .pt-sidebar {
        transform: translateX(-240px);
        width: 240px;
        box-shadow: var(--pt-shadow-lg);
    }
    .pt-sidebar.open { transform: translateX(0); }

    .pt-main { margin-left: 0; }

    .pt-topbar { padding: 12px 16px; }
    .pt-content { padding: 16px; }

    .pt-mobile-menu {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 36px; height: 36px;
        border: none;
        background: transparent;
        color: var(--pt-text-muted);
        cursor: pointer;
        border-radius: var(--pt-radius-sm);
    }
    .pt-mobile-menu:hover { background: var(--pt-surface2); }

    .pt-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .pt-table-wrap { font-size: 0.8rem; }
    .pt-setup-body { padding: 20px 20px; }
    .pt-setup-header { padding: 24px 20px 20px; }
    .pt-steps { padding: 14px 20px; }
    .pt-setup-footer { padding: 14px 20px 20px; }
}

.pt-mobile-menu { display: none; }

@media (max-width: 420px) {
    .pt-stats-grid { grid-template-columns: 1fr; }
    .pt-login-card { border-radius: var(--pt-radius); }
    .pt-setup-card { border-radius: var(--pt-radius); }
}

/* ── Druckansicht ────────────────────────────────────────────────────────── */
@media print {
    .pt-sidebar, .pt-topbar, .pt-btn, .pt-tabs { display: none !important; }
    .pt-main { margin-left: 0; }
    .pt-content { padding: 0; }
    body { background: white; color: black; }
    .pt-card, .pt-ekg-wrap { border: 1px solid #ccc; }
}

/* ── Barrierefreiheit ────────────────────────────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--pt-primary);
    outline-offset: 2px;
    border-radius: 2px;
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ── Hilfeklassen ────────────────────────────────────────────────────────── */
.hidden  { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.muted   { color: var(--pt-text-muted); }
.mono    { font-family: var(--pt-font-mono); }
.flex    { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2   { gap: 8px; }
.gap-3   { gap: 12px; }
.mt-1    { margin-top: 4px; }
.mt-2    { margin-top: 8px; }
.mt-3    { margin-top: 12px; }
.mt-4    { margin-top: 16px; }
.mb-4    { margin-bottom: 16px; }
.w-full  { width: 100%; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.font-bold   { font-weight: 700; }
