/* ================================================================
   CAFE NENNA TEAM-TOOL
   Design-System: cafenenna.de (Sion-Standard)
   Ein Tool das Spass macht -- Hygiene war noch nie so schoen.
   ================================================================ */

/* --- Fonts --- */
@font-face {
    font-family: 'Felmo';
    src: url('../fonts/Felmo.woff') format('woff');
    font-display: swap;
}

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* --- Design Tokens (Light) --- */
:root {
    /* Brand -- from cafenenna.de */
    --color-primary: #3932B5;
    --color-primary-dark: #2d27a0;
    --color-primary-light: #4a43c7;
    --color-primary-glow: rgba(57, 50, 181, 0.15);
    --color-accent: #FF8FB8;
    --color-accent-dark: #e57aa3;
    --color-accent-glow: rgba(255, 143, 184, 0.2);

    /* Surfaces */
    --color-bg: #FAFBFF;
    --color-bg-warm: #FFF9F5;
    --color-surface: #FFFFFF;
    --color-surface-hover: #F8F6FF;
    --color-surface-glass: rgba(255, 255, 255, 0.72);
    --color-border: #E8E4F0;
    --color-border-light: #F3F0FA;

    /* Text */
    --color-text: #1A1A2E;
    --color-text-secondary: #5C5A78;
    --color-text-muted: #9896AD;
    --color-text-inverse: #FFFFFF;

    /* Semantic */
    --color-success: #10B981;
    --color-success-bg: #ECFDF5;
    --color-success-glow: rgba(16, 185, 129, 0.15);
    --color-warning: #F59E0B;
    --color-warning-bg: #FFFBEB;
    --color-danger: #EF4444;
    --color-danger-bg: #FEF2F2;
    --color-info: #6366F1;

    /* Typography */
    --font-display: 'Felmo', 'DM Sans', system-ui, sans-serif;
    --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;

    --text-xs: 0.75rem;
    --text-sm: 0.8125rem;
    --text-base: clamp(0.9375rem, 0.9rem + 0.2vw, 1rem);
    --text-lg: clamp(1.0625rem, 1rem + 0.3vw, 1.125rem);
    --text-xl: clamp(1.1875rem, 1.1rem + 0.4vw, 1.3125rem);
    --text-2xl: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
    --text-3xl: clamp(1.75rem, 1.4rem + 1.5vw, 2.25rem);

    /* Spacing (8px Grid) */
    --space-0: 0; --space-1: 4px; --space-2: 8px; --space-3: 12px;
    --space-4: 16px; --space-5: 20px; --space-6: 24px; --space-8: 32px;
    --space-10: 40px; --space-12: 48px; --space-16: 64px; --space-20: 80px;

    /* Radii */
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(57,50,181,0.04);
    --shadow-sm: 0 2px 8px rgba(57,50,181,0.06);
    --shadow-md: 0 4px 16px rgba(57,50,181,0.08);
    --shadow-lg: 0 8px 32px rgba(57,50,181,0.1);
    --shadow-xl: 0 16px 48px rgba(57,50,181,0.14);
    --shadow-glow: 0 0 0 4px var(--color-primary-glow);
    --shadow-accent-glow: 0 0 0 4px var(--color-accent-glow);
    --shadow-success-glow: 0 0 0 4px var(--color-success-glow);

    /* Transitions */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --t-fast: 150ms ease;
    --t-normal: 250ms var(--ease-out-expo);
    --t-slow: 400ms var(--ease-out-expo);
    --t-spring: 500ms var(--ease-spring);

    /* Layout */
    --nav-height: 72px;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-nav: 300;
    --z-overlay: 400;
    --z-modal: 500;
    --z-toast: 600;
    --z-confetti: 700;
}

/* --- Dark Mode (warmer Cafe-Abend-Ton) --- */
@media (prefers-color-scheme: dark) {
    :root {
        --color-primary: #A49AFF;
        --color-primary-dark: #9388FF;
        --color-primary-light: #B5ADFF;
        --color-primary-glow: rgba(164, 154, 255, 0.15);
        --color-accent: #FFB4D2;
        --color-accent-dark: #FF8FB8;
        --color-accent-glow: rgba(255, 180, 210, 0.15);

        --color-bg: #0F0D13;
        --color-bg-warm: #131018;
        --color-surface: #1A1724;
        --color-surface-hover: #221F2E;
        --color-surface-glass: rgba(26, 23, 36, 0.82);
        --color-border: #2A2738;
        --color-border-light: #1F1C2A;

        --color-text: #F0ECF8;
        --color-text-secondary: #B0ABBD;
        --color-text-muted: #6E6A7C;
        --color-text-inverse: #0F0D13;

        --color-success-bg: rgba(16,185,129,0.1);
        --color-warning-bg: rgba(245,158,11,0.1);
        --color-danger-bg: rgba(239,68,68,0.1);

        --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
        --shadow-sm: 0 2px 8px rgba(0,0,0,0.25);
        --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
        --shadow-lg: 0 8px 32px rgba(0,0,0,0.35);
        --shadow-xl: 0 16px 48px rgba(0,0,0,0.4);
    }
}

/* ================================================================
   RESET & BASE
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Subtle background texture */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 0% 0%, var(--color-primary-glow) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 100%, var(--color-accent-glow) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

::selection {
    background: var(--color-accent);
    color: var(--color-text-inverse);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--t-fast);
}
a:hover { color: var(--color-primary-dark); }

img { max-width: 100%; height: auto; }

/* --- Typography --- */
h1, h2, h3, h4 {
    font-family: var(--font-body);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--color-text);
}
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

.heading-display {
    font-family: var(--font-display);
    text-transform: lowercase;
    color: var(--color-primary);
    letter-spacing: -0.03em;
}

/* ================================================================
   NAVIGATION -- Glassmorphic, floating
   ================================================================ */

.main-nav {
    position: fixed;
    top: var(--space-3);
    left: var(--space-3);
    right: var(--space-3);
    height: var(--nav-height);
    background: var(--color-surface-glass);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-nav);
    transition: all var(--t-slow);
}

.main-nav.scrolled {
    top: var(--space-2);
    box-shadow: var(--shadow-xl);
}

.nav-inner {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 var(--space-5);
    height: 100%;
}

.nav-logo {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    text-decoration: none;
    flex-shrink: 0;
    transition: transform var(--t-spring);
}

.nav-logo:hover { transform: scale(1.03); text-decoration: none; }

.nav-logo-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--color-primary);
    text-transform: lowercase;
    line-height: 1;
}

.nav-logo-sub {
    font-size: var(--text-xs);
    color: var(--color-accent);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    background: var(--color-accent-glow);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    flex: 1;
    margin-left: var(--space-6);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: all var(--t-normal);
    white-space: nowrap;
    position: relative;
}

.nav-link:hover {
    color: var(--color-text);
    background: var(--color-surface-hover);
    text-decoration: none;
}

.nav-link.active {
    color: var(--color-primary);
    background: var(--color-primary-glow);
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 3px;
    background: var(--color-primary);
    border-radius: var(--radius-full);
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-link.active .nav-icon,
.nav-link:hover .nav-icon { opacity: 1; }

/* Nav Groups */
.nav-group { position: relative; }

.nav-group-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border: none;
    border-radius: var(--radius-md);
    background: none;
    font: inherit;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--t-normal);
    white-space: nowrap;
}

.nav-group-toggle:hover {
    color: var(--color-text);
    background: var(--color-surface-hover);
}

.nav-chevron {
    width: 14px;
    height: 14px;
    transition: transform var(--t-normal);
}

.nav-group.open .nav-chevron { transform: rotate(180deg); }

.nav-dropdown {
    position: absolute;
    top: calc(100% + var(--space-2));
    left: 0;
    min-width: 190px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: var(--space-2);
    display: none;
    z-index: var(--z-dropdown);
    animation: dropdownIn 200ms var(--ease-out-expo);
}

@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.nav-group.open .nav-dropdown { display: block; }

.nav-dropdown .nav-link {
    display: block;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-sm);
}

.nav-dropdown .nav-link.active::after { display: none; }

/* Nav User */
.nav-user {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-left: auto;
    flex-shrink: 0;
}

.nav-user-name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
}

.nav-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: var(--text-xs);
    font-weight: 700;
}

.nav-logout {
    display: flex;
    align-items: center;
    padding: var(--space-2);
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    transition: all var(--t-fast);
}

.nav-logout:hover {
    color: var(--color-danger);
    background: var(--color-danger-bg);
}

/* Mobile toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: var(--space-2);
    border: none;
    background: none;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: all var(--t-normal);
}

/* ================================================================
   MAIN CONTENT
   ================================================================ */

.main-content {
    margin-top: calc(var(--nav-height) + var(--space-8));
    padding: var(--space-6);
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
    min-height: calc(100vh - var(--nav-height) - 100px);
    animation: pageIn 500ms var(--ease-out-expo);
}

@keyframes pageIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.main-footer {
    padding: var(--space-8) var(--space-6);
    text-align: center;
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    letter-spacing: 0.02em;
}

/* ================================================================
   PAGE HEADER
   ================================================================ */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-8);
    flex-wrap: wrap;
}

.page-header h1 {
    font-size: var(--text-2xl);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.page-header-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: #fff;
    flex-shrink: 0;
}

.page-header-icon svg { width: 20px; height: 20px; }

.page-actions {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

/* ================================================================
   CARDS -- Soft glass effect
   ================================================================ */

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    transition: all var(--t-normal);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    opacity: 0;
    transition: opacity var(--t-normal);
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-border);
}

.card:hover::before { opacity: 1; }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-5);
}

.card-title {
    font-size: var(--text-lg);
    font-weight: 700;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-5);
}

/* ================================================================
   BUTTONS -- Rounded, bouncy
   ================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-5);
    min-height: 40px;
    border: none;
    border-radius: var(--radius-full);
    font: inherit;
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--t-normal);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: #fff;
    box-shadow: 0 4px 12px var(--color-primary-glow);
}
.btn-primary:hover {
    box-shadow: 0 6px 20px var(--color-primary-glow);
    color: #fff;
}

.btn-accent {
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
    color: #fff;
    box-shadow: 0 4px 12px var(--color-accent-glow);
}

.btn-success {
    background: linear-gradient(135deg, #10B981, #059669);
    color: #fff;
    box-shadow: 0 4px 12px var(--color-success-glow);
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 1.5px solid var(--color-primary);
}
.btn-outline:hover {
    background: var(--color-primary-glow);
    color: var(--color-primary);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
}
.btn-ghost:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
}

.btn-sm {
    padding: var(--space-1) var(--space-3);
    min-height: 32px;
    font-size: var(--text-xs);
}

.btn-lg {
    padding: var(--space-3) var(--space-8);
    min-height: 48px;
    font-size: var(--text-base);
}

.btn-icon {
    padding: var(--space-2);
    min-height: auto;
    border-radius: var(--radius-md);
}

.btn svg { width: 18px; height: 18px; }

/* Ripple effect */
.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(255,255,255,0.3) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}
.btn-primary:active::after { opacity: 1; }

/* ================================================================
   FORMS -- Clean, spacious
   ================================================================ */

.form-group { margin-bottom: var(--space-5); }

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text);
}

.form-label .required { color: var(--color-accent); }

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    min-height: 44px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
    font-size: var(--text-base);
    transition: all var(--t-normal);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-glow);
}

.form-textarea { min-height: 100px; resize: vertical; }

.form-hint { margin-top: var(--space-1); font-size: var(--text-xs); color: var(--color-text-muted); }
.form-error { margin-top: var(--space-1); font-size: var(--text-xs); color: var(--color-danger); }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
}

.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
    font-size: var(--text-sm);
}

.form-check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all var(--t-spring);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.form-check input[type="checkbox"]:checked {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    border-color: var(--color-primary);
    animation: checkBounce 400ms var(--ease-spring);
}

.form-check input[type="checkbox"]:checked::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg) translateY(-1px);
}

@keyframes checkBounce {
    0% { transform: scale(1); }
    40% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

/* ================================================================
   TABLES -- Clean, hover rows
   ================================================================ */

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }

thead { background: var(--color-bg); }

th {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-weight: 600;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    white-space: nowrap;
}

td {
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--color-border-light);
    vertical-align: middle;
}

tr { transition: background var(--t-fast); }
tr:hover td { background: var(--color-surface-hover); }

/* ================================================================
   BADGES
   ================================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 3px var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 1.6;
}

.badge-success { background: var(--color-success-bg); color: #059669; }
.badge-warning { background: var(--color-warning-bg); color: #D97706; }
.badge-danger  { background: var(--color-danger-bg); color: #DC2626; }
.badge-info    { background: rgba(99,102,241,0.1); color: var(--color-info); }
.badge-neutral { background: var(--color-bg); color: var(--color-text-secondary); }

/* ================================================================
   FLASH MESSAGES -- Toast-style
   ================================================================ */

.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    margin-bottom: var(--space-5);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    font-weight: 500;
    animation: toastIn 400ms var(--ease-out-expo);
    box-shadow: var(--shadow-md);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-16px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.flash-success { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.flash-error   { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.flash-warning { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.flash-info    { background: #EEF2FF; color: #3730A3; border: 1px solid #C7D2FE; }

.flash-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
    padding: 0 var(--space-1);
    transition: opacity var(--t-fast);
}
.flash-close:hover { opacity: 1; }

/* ================================================================
   DASHBOARD -- Progress rings, streaks, celebrations
   ================================================================ */

.dashboard-greeting {
    margin-bottom: var(--space-8);
}

.dashboard-greeting h1 {
    font-size: var(--text-3xl);
    font-weight: 700;
    margin-bottom: var(--space-1);
}

.dashboard-greeting h1 .wave {
    display: inline-block;
    animation: wave 2.5s ease-in-out infinite;
    transform-origin: 70% 70%;
}

@keyframes wave {
    0%, 60%, 100% { transform: rotate(0deg); }
    10% { transform: rotate(14deg); }
    20% { transform: rotate(-8deg); }
    30% { transform: rotate(14deg); }
    40% { transform: rotate(-4deg); }
    50% { transform: rotate(10deg); }
}

.dashboard-greeting .subtitle {
    font-size: var(--text-lg);
    color: var(--color-text-secondary);
}

/* Stat Cards */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-5);
    margin-bottom: var(--space-8);
}

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    transition: all var(--t-normal);
    cursor: default;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Progress Ring */
.progress-ring {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    position: relative;
}

.progress-ring svg {
    width: 56px;
    height: 56px;
    transform: rotate(-90deg);
}

.progress-ring-bg {
    fill: none;
    stroke: var(--color-border);
    stroke-width: 5;
}

.progress-ring-fill {
    fill: none;
    stroke-width: 5;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s var(--ease-out-expo);
}

.progress-ring-fill.primary { stroke: var(--color-primary); }
.progress-ring-fill.success { stroke: var(--color-success); }
.progress-ring-fill.warning { stroke: var(--color-warning); }
.progress-ring-fill.danger  { stroke: var(--color-danger); }
.progress-ring-fill.accent  { stroke: var(--color-accent); }

.progress-ring-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--color-text);
}

.stat-content h3 {
    font-size: var(--text-xl);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 2px;
}

.stat-content p {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.quick-action {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    text-decoration: none;
    color: var(--color-text);
    font-weight: 600;
    font-size: var(--text-sm);
    transition: all var(--t-normal);
    position: relative;
    overflow: hidden;
}

.quick-action::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--color-primary-glow), var(--color-accent-glow));
    opacity: 0;
    transition: opacity var(--t-normal);
}

.quick-action:hover {
    border-color: var(--color-primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
}

.quick-action:hover::before { opacity: 1; }

.quick-action-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.quick-action-icon svg { width: 20px; height: 20px; }

.quick-action-icon.temp   { background: rgba(239,68,68,0.1); color: #EF4444; }
.quick-action-icon.clean  { background: rgba(16,185,129,0.1); color: #10B981; }
.quick-action-icon.goods  { background: rgba(99,102,241,0.1); color: #6366F1; }
.quick-action-icon.sched  { background: rgba(245,158,11,0.1); color: #F59E0B; }

.quick-action span { position: relative; z-index: 1; }

/* Warning Items */
.warning-list { display: flex; flex-direction: column; gap: var(--space-3); }

.warning-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    animation: slideInLeft 300ms var(--ease-out-expo) both;
}

.warning-item:nth-child(1) { animation-delay: 0ms; }
.warning-item:nth-child(2) { animation-delay: 60ms; }
.warning-item:nth-child(3) { animation-delay: 120ms; }

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}

.warning-item-danger  { background: var(--color-danger-bg); color: var(--color-danger); }
.warning-item-warning { background: var(--color-warning-bg); color: var(--color-warning); }

.warning-item svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ================================================================
   CHECKLISTE (Reinigung) -- Satisfying interactions
   ================================================================ */

.checklist { display: flex; flex-direction: column; gap: var(--space-2); }

.checklist-item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-5);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    transition: all var(--t-normal);
    cursor: pointer;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.checklist-item:hover {
    border-color: var(--color-primary);
    background: var(--color-surface-hover);
    transform: translateX(4px);
}

.checklist-item.done {
    border-color: var(--color-success);
    background: var(--color-success-bg);
}

.checklist-item.done .checklist-name { text-decoration: line-through; color: var(--color-text-muted); }

/* Custom checkbox */
.checklist-check {
    width: 28px;
    height: 28px;
    border: 2.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--t-spring);
    background: var(--color-surface);
}

.checklist-item:hover .checklist-check {
    border-color: var(--color-primary);
}

.checklist-item.done .checklist-check {
    background: linear-gradient(135deg, #10B981, #059669);
    border-color: transparent;
    box-shadow: 0 2px 8px var(--color-success-glow);
    animation: checkmarkPop 400ms var(--ease-spring);
}

@keyframes checkmarkPop {
    0% { transform: scale(0.5) rotate(-10deg); }
    50% { transform: scale(1.2) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.checklist-name {
    flex: 1;
    font-size: var(--text-sm);
    font-weight: 500;
    transition: all var(--t-normal);
}

.checklist-detail {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-top: 2px;
    font-weight: 400;
}

.checklist-meta {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    text-align: right;
    min-width: 60px;
}

.checklist-section {
    margin-top: var(--space-8);
    margin-bottom: var(--space-3);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.checklist-section::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

/* Completion celebration */
.checklist-complete-msg {
    text-align: center;
    padding: var(--space-8);
    animation: celebrateIn 600ms var(--ease-spring);
}

.checklist-complete-msg .emoji {
    font-size: 3rem;
    display: block;
    margin-bottom: var(--space-3);
    animation: bounce 1s ease-in-out infinite;
}

@keyframes celebrateIn {
    from { opacity: 0; transform: scale(0.8); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ================================================================
   TEMPERATURE -- Visual thermometer cards
   ================================================================ */

.temp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-5);
    margin-bottom: var(--space-8);
}

.temp-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-8) var(--space-6);
    text-align: center;
    transition: all var(--t-normal);
    position: relative;
    overflow: hidden;
}

.temp-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.temp-card-title {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-1);
}

.temp-limit {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-bottom: var(--space-5);
}

.temp-value {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-2);
    transition: color var(--t-normal);
}

.temp-ok   { color: var(--color-success); }
.temp-warn {
    color: var(--color-danger);
    animation: tempPulse 1.5s ease-in-out infinite;
}
.temp-empty { color: var(--color-text-muted); }

@keyframes tempPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.temp-who {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-bottom: var(--space-5);
}

.temp-input-wrap {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    justify-content: center;
}

.temp-input {
    width: 100px;
    padding: var(--space-2) var(--space-3);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-full);
    font: inherit;
    font-size: var(--text-lg);
    font-weight: 600;
    text-align: center;
    background: var(--color-bg);
    color: var(--color-text);
    transition: all var(--t-normal);
}

.temp-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-glow);
}

/* Status indicator bar */
.temp-status-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    transition: background var(--t-normal);
}

.temp-card.ok .temp-status-bar { background: linear-gradient(90deg, #10B981, #34D399); }
.temp-card.warn .temp-status-bar { background: linear-gradient(90deg, #EF4444, #F87171); }

/* ================================================================
   DIENSTPLAN / SCHEDULE -- Colorful, visual
   ================================================================ */

.schedule-grid {
    display: grid;
    grid-template-columns: 110px repeat(6, 1fr);
    gap: 1px;
    background: var(--color-border);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.schedule-header {
    background: var(--color-bg);
    padding: var(--space-3) var(--space-2);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
}

.schedule-header.today {
    color: var(--color-primary);
    background: var(--color-primary-glow);
}

.schedule-name {
    background: var(--color-surface);
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    font-weight: 600;
    display: flex;
    align-items: center;
}

.schedule-cell {
    background: var(--color-surface);
    padding: var(--space-2);
    min-height: 64px;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    transition: background var(--t-fast);
}

.schedule-cell:hover { background: var(--color-surface-hover); }

.schedule-shift {
    padding: 4px var(--space-2);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 600;
    text-align: center;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ================================================================
   ALLERGEN MATRIX
   ================================================================ */

.allergen-matrix { overflow-x: auto; }
.allergen-matrix table { min-width: 800px; }
.allergen-matrix th { text-align: center; padding: var(--space-2); font-size: var(--text-xs); min-width: 44px; }
.allergen-matrix td { text-align: center; padding: var(--space-2); }
.allergen-matrix td:first-child { text-align: left; font-weight: 600; min-width: 200px; }

.allergen-x  { color: var(--color-danger); font-weight: 800; font-size: var(--text-base); }
.allergen-sp { color: var(--color-warning); font-weight: 600; font-size: var(--text-xs); }

/* ================================================================
   LOGIN PAGE -- Full-screen, atmospheric
   ================================================================ */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--space-6);
    background: var(--color-bg);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--color-primary-glow) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    pointer-events: none;
    animation: loginGlow 8s ease-in-out infinite alternate;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--color-accent-glow) 0%, transparent 70%);
    bottom: -200px;
    left: -200px;
    pointer-events: none;
    animation: loginGlow 8s ease-in-out 4s infinite alternate;
}

@keyframes loginGlow {
    from { transform: scale(1); opacity: 0.6; }
    to   { transform: scale(1.2); opacity: 1; }
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-2xl);
    padding: var(--space-12) var(--space-8);
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 1;
    animation: loginCardIn 600ms var(--ease-out-expo);
}

@keyframes loginCardIn {
    from { opacity: 0; transform: translateY(24px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
    text-align: center;
    margin-bottom: var(--space-10);
}

.login-logo-text {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    color: var(--color-primary);
    text-transform: lowercase;
    line-height: 1;
}

.login-logo-sub {
    display: inline-block;
    font-size: var(--text-xs);
    color: var(--color-accent);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-top: var(--space-2);
    background: var(--color-accent-glow);
    padding: 3px 12px;
    border-radius: var(--radius-full);
}

.login-error {
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-5);
    background: var(--color-danger-bg);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: #991B1B;
}

/* ================================================================
   EMPTY STATE
   ================================================================ */

.empty-state {
    text-align: center;
    padding: var(--space-16) var(--space-6);
    color: var(--color-text-muted);
}

.empty-state svg { width: 48px; height: 48px; margin-bottom: var(--space-4); opacity: 0.3; }
.empty-state p { font-size: var(--text-sm); margin-bottom: var(--space-4); }

/* ================================================================
   CONFETTI CANVAS (JS-driven)
   ================================================================ */

#confetti-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: var(--z-confetti);
}

/* ================================================================
   PDF EXPORT BUTTON
   ================================================================ */

.btn-pdf {
    background: linear-gradient(135deg, #DC2626, #B91C1C);
    color: #fff;
    box-shadow: 0 4px 12px rgba(220,38,38,0.2);
}

.btn-pdf:hover { box-shadow: 0 6px 20px rgba(220,38,38,0.3); color: #fff; }

.btn-pdf svg { width: 16px; height: 16px; }

/* ================================================================
   STREAK BADGE
   ================================================================ */

.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    background: linear-gradient(135deg, #FBBF24, #F59E0B);
    color: #78350F;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 700;
    animation: streakGlow 2s ease-in-out infinite;
}

@keyframes streakGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.3); }
    50% { box-shadow: 0 0 0 6px rgba(245,158,11,0); }
}

/* ================================================================
   UTILITY CLASSES
   ================================================================ */

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-sm     { font-size: var(--text-sm); }
.text-xs     { font-size: var(--text-xs); }
.text-muted  { color: var(--color-text-muted); }
.text-success { color: var(--color-success); }
.text-danger  { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.fw-600      { font-weight: 600; }
.fw-700      { font-weight: 700; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.hidden { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 967px) {
    .main-nav {
        top: 0;
        left: 0;
        right: 0;
        border-radius: 0;
    }

    .nav-toggle { display: flex; }

    .nav-links {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        bottom: 0;
        flex-direction: column;
        align-items: stretch;
        background: var(--color-surface);
        padding: var(--space-4);
        margin-left: 0;
        overflow-y: auto;
        display: none;
        z-index: var(--z-nav);
        animation: mobileNavIn 300ms var(--ease-out-expo);
    }

    @keyframes mobileNavIn {
        from { opacity: 0; transform: translateY(-12px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    .nav-links.open { display: flex; }

    .nav-group-toggle, .nav-link {
        padding: var(--space-3) var(--space-4);
        font-size: var(--text-base);
    }

    .nav-dropdown {
        position: static;
        box-shadow: none;
        border: none;
        padding-left: var(--space-6);
        background: transparent;
    }

    .nav-group.open .nav-dropdown {
        display: flex;
        flex-direction: column;
    }

    .nav-user-name { display: none; }
    .main-content { padding: var(--space-4); }

    .schedule-grid {
        grid-template-columns: 80px repeat(6, 1fr);
        font-size: var(--text-xs);
    }

    .page-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
    .card { padding: var(--space-4); border-radius: var(--radius-lg); }
    .dashboard-stats { grid-template-columns: 1fr 1fr; }
    .quick-actions { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .card-grid { grid-template-columns: 1fr; }
    .temp-grid { grid-template-columns: 1fr; }
    .schedule-grid { grid-template-columns: 60px repeat(6, 1fr); }
}

/* ================================================================
   PRINT
   ================================================================ */

@media print {
    .main-nav, .nav-toggle, .page-actions, .quick-actions,
    .flash, .btn, #confetti-canvas, body::before { display: none !important; }

    .main-content { margin-top: 0; padding: 0; }
    body { background: #fff; color: #000; }
    .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }

    .print-header {
        display: block !important;
        text-align: center;
        margin-bottom: 20px;
        padding-bottom: 10px;
        border-bottom: 2px solid #3932B5;
    }
}

.print-header { display: none; }

/* ================================================================
   POS / KASSE
   Cafe-optimiert: grosse Touch-Targets, warme Farben, schnell bedienbar
   ================================================================ */

.pos-container {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: var(--space-3);
    height: calc(100vh - var(--nav-height) - 32px);
    margin: calc(-1 * var(--space-6)) calc(-1 * var(--space-6)) 0;
    padding: var(--space-3);
}

.pos-products {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    overflow: hidden;
}

/* Category Filter */
.pos-categories-bar {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 2px;
    scrollbar-width: none;
}
.pos-categories-bar::-webkit-scrollbar { display: none; }

.pos-cat-btn {
    padding: 8px 14px;
    border: none;
    border-radius: var(--radius-full);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--t-fast);
    box-shadow: var(--shadow-xs);
}
.pos-cat-btn:hover { background: var(--color-surface-hover); color: var(--color-text); }
.pos-cat-btn.active {
    background: var(--color-primary);
    color: var(--color-text-inverse);
    box-shadow: 0 2px 8px rgba(57, 50, 181, 0.3);
}

/* Search - compact */
.pos-search { position: relative; }
.pos-search input {
    width: 100%;
    font-size: var(--text-sm);
    padding: 8px 14px 8px 36px;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border-light);
    background: var(--color-surface);
}
.pos-search::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: currentColor;
    opacity: 0.3;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") center/contain no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Product Grid */
.pos-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: var(--space-2);
    overflow-y: auto;
    flex: 1;
    padding: 2px;
    scroll-behavior: smooth;
}
.pos-product-grid::-webkit-scrollbar { width: 4px; }
.pos-product-grid::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 2px; }

/* Product Card */
.pos-product-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: var(--space-3) var(--space-2);
    border: 1.5px solid var(--color-border-light);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    cursor: pointer;
    transition: all 120ms ease;
    text-align: center;
    min-height: 108px;
    font-family: var(--font-body);
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.pos-product-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--color-primary);
    opacity: 0;
    transition: opacity 120ms;
}
.pos-product-btn:hover {
    border-color: var(--color-primary-light);
    box-shadow: 0 2px 12px rgba(57, 50, 181, 0.1);
}
.pos-product-btn:active {
    transform: scale(0.93);
    transition: transform 60ms;
}
.pos-product-btn:active::after { opacity: 0.05; }
.pos-product-btn[style*="display:none"] { display: none !important; }

/* "Added" flash */
.pos-product-btn.just-added {
    border-color: var(--color-success);
    box-shadow: 0 0 0 3px var(--color-success-glow);
}

.pos-product-emoji {
    font-size: 2rem;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.08));
}
.pos-product-name {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--color-text);
    line-height: 1.25;
    max-height: 2.5em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.pos-product-price {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -0.02em;
}

/* === Cart === */
.pos-cart {
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.pos-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border-light);
    background: linear-gradient(to bottom, var(--color-surface), var(--color-bg));
}
.pos-cart-header h2 {
    font-size: var(--text-base);
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.pos-cart-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0 6px;
    transition: all var(--t-spring);
}
.pos-cart-count:empty,
.pos-cart-count[data-count="0"] { display: none; }
.pos-cart-count.bump {
    animation: countBump 300ms var(--ease-spring);
}
@keyframes countBump {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.pos-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-2) var(--space-3);
}
.pos-cart-items::-webkit-scrollbar { width: 3px; }
.pos-cart-items::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 2px; }

.pos-cart-empty {
    text-align: center;
    color: var(--color-text-muted);
    padding: var(--space-8) 0;
    font-size: var(--text-sm);
}
.pos-cart-empty::before {
    content: '🛒';
    display: block;
    font-size: 2.5rem;
    margin-bottom: var(--space-2);
    opacity: 0.4;
}

/* Cart Item */
.pos-cart-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border-light);
    animation: posCartIn 200ms var(--ease-out-expo);
}
.pos-cart-item:last-child { border-bottom: none; }
@keyframes posCartIn {
    from { opacity: 0; transform: translateX(16px); }
    to { opacity: 1; transform: translateX(0); }
}

.pos-cart-item-info { flex: 1; min-width: 0; }
.pos-cart-item-name {
    font-size: var(--text-sm);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.pos-cart-item-price { font-size: var(--text-xs); color: var(--color-text-muted); }

.pos-cart-item-qty {
    display: flex;
    align-items: center;
    gap: 2px;
}
.pos-cart-item-qty button {
    width: 32px; height: 32px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text);
    transition: all 100ms;
    -webkit-tap-highlight-color: transparent;
}
.pos-cart-item-qty button:active { background: var(--color-primary); color: white; border-color: var(--color-primary); transform: scale(0.9); }
.pos-cart-item-qty span {
    min-width: 24px;
    text-align: center;
    font-weight: 700;
    font-size: var(--text-sm);
    font-variant-numeric: tabular-nums;
}

.pos-cart-item-total {
    font-weight: 700;
    font-size: var(--text-sm);
    min-width: 56px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.pos-cart-item-remove {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
    opacity: 0;
    transition: all var(--t-fast);
    -webkit-tap-highlight-color: transparent;
}
.pos-cart-item:hover .pos-cart-item-remove { opacity: 0.5; }
.pos-cart-item-remove:hover { opacity: 1 !important; color: var(--color-danger); }

/* Cart Footer */
.pos-cart-footer {
    padding: var(--space-3) var(--space-4);
    border-top: 2px solid var(--color-border);
    background: var(--color-bg);
}

.pos-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: var(--text-2xl);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
}

/* Tax breakdown */
.pos-tax-breakdown {
    margin-bottom: var(--space-2);
    padding-bottom: var(--space-2);
    border-bottom: 1px dashed var(--color-border-light);
}
.pos-tax-row {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    padding: 1px 0;
    font-variant-numeric: tabular-nums;
}
.pos-tax-row-total {
    font-weight: 600;
    color: var(--color-text-secondary);
    padding-top: 2px;
}

.pos-cart-tax { text-align: right; margin-bottom: var(--space-2); font-size: var(--text-xs); }

.pos-pay-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
}

.pos-pay-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px var(--space-4);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 700;
    cursor: pointer;
    transition: all 120ms ease;
    -webkit-tap-highlight-color: transparent;
}
.pos-pay-btn svg { width: 20px; height: 20px; }
.pos-pay-btn:disabled { opacity: 0.35; cursor: not-allowed; filter: grayscale(0.5); }

.pos-pay-card {
    background: linear-gradient(135deg, #3932B5, #5B4FE8);
    color: white;
    box-shadow: 0 3px 12px rgba(57, 50, 181, 0.3);
}
.pos-pay-card:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(57, 50, 181, 0.4); }
.pos-pay-card:active:not(:disabled) { transform: scale(0.97); }

.pos-pay-cash {
    background: linear-gradient(135deg, #10B981, #34D399);
    color: white;
    box-shadow: 0 3px 12px rgba(16, 185, 129, 0.25);
}
.pos-pay-cash:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(16, 185, 129, 0.35); }
.pos-pay-cash:active:not(:disabled) { transform: scale(0.97); }

/* Payment Modal */
.pos-modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pos-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.pos-modal-content {
    position: relative;
    background: var(--color-surface);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 24px 64px rgba(0,0,0,0.2);
    animation: modalIn 300ms var(--ease-out-expo);
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.92) translateY(24px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.pos-modal-icon { margin-bottom: var(--space-4); }
.pos-modal-icon.pulse svg {
    color: var(--color-primary);
    animation: pulseIcon 1.5s ease-in-out infinite;
}
@keyframes pulseIcon {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.6; }
}

.pos-modal-amount {
    font-size: var(--text-3xl);
    font-weight: 800;
    color: var(--color-primary);
    margin: var(--space-3) 0;
    letter-spacing: -0.03em;
}

.pos-cash-input {
    font-size: var(--text-2xl) !important;
    text-align: center;
    font-weight: 700;
    padding: var(--space-3) !important;
    border-radius: var(--radius-lg) !important;
    font-variant-numeric: tabular-nums;
}

.pos-cash-change {
    font-size: var(--text-lg);
    padding: var(--space-3) var(--space-4);
    background: var(--color-success-bg);
    border-radius: var(--radius-md);
    margin-top: var(--space-3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.pos-cash-change strong {
    font-size: var(--text-2xl);
    color: var(--color-success);
    font-weight: 800;
}

.pos-quick-cash {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: var(--space-3);
}
.pos-quick-cash button {
    padding: 10px 18px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: var(--text-sm);
    transition: all 100ms;
}
.pos-quick-cash button:active { background: var(--color-primary); color: white; border-color: var(--color-primary); transform: scale(0.95); }

.pos-success-check {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10B981, #34D399);
    color: white;
    font-size: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-4);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
    animation: successBounce 500ms var(--ease-spring);
}
@keyframes successBounce {
    0% { transform: scale(0); }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* Styled Confirm Dialog (replaces browser alert) */
.confirm-dialog {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
}
.confirm-dialog-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
}
.confirm-dialog-box {
    position: relative;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    width: 90%;
    max-width: 360px;
    text-align: center;
    box-shadow: var(--shadow-xl);
    animation: modalIn 200ms var(--ease-out-expo);
}
.confirm-dialog-box h3 { margin: 0 0 var(--space-2); }
.confirm-dialog-box p { color: var(--color-text-secondary); font-size: var(--text-sm); margin-bottom: var(--space-5); }
.confirm-dialog-buttons { display: flex; gap: var(--space-2); justify-content: center; }
.confirm-dialog-buttons .btn { min-width: 100px; }

/* === Table Bar (POS) === */
.pos-table-bar {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding-bottom: var(--space-1);
}
.pos-order-type {
    display: flex;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.pos-type-btn {
    padding: 6px 14px;
    border: none;
    background: transparent;
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 600;
    cursor: pointer;
    transition: all 100ms;
    color: var(--color-text-secondary);
}
.pos-type-btn.active {
    background: var(--color-primary);
    color: white;
}
.pos-table-select {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* === Tischplan Grid === */
.tischplan-section {
    margin-bottom: var(--space-6);
}
.tischplan-section-title {
    font-size: var(--text-lg);
    font-weight: 700;
    margin-bottom: var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.tischplan-section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    border-radius: 2px;
    background: var(--color-primary);
}

.tischplan-grid {
    display: grid;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-3);
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-light);
    min-height: 180px;
}

.table-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: var(--space-3);
    border: 3px solid var(--color-border);
    cursor: pointer;
    transition: all 150ms var(--ease-out-expo);
    text-align: center;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    min-height: 90px;
}
.table-card::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 150ms;
}
.table-card:hover {
    transform: scale(1.06);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 2;
}
.table-card:hover::before { opacity: 1; }
.table-card:active { transform: scale(0.96); }

/* Shapes */
.table-card--round {
    border-radius: 50%;
    aspect-ratio: 1;
}
.table-card--square {
    border-radius: var(--radius-lg);
}
.table-card--rect {
    border-radius: var(--radius-md);
    min-height: 80px;
}

/* Status Colors - vivid, distinct */
.table-card--frei {
    border-color: #34d399;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
}
.table-card--frei::before { background: radial-gradient(circle, rgba(52,211,153,0.15), transparent 70%); }
.table-card--frei .table-card-number { color: #065f46; }

.table-card--besetzt {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    box-shadow: 0 2px 12px rgba(57, 50, 181, 0.15);
}
.table-card--besetzt::before { background: radial-gradient(circle, rgba(57,50,181,0.1), transparent 70%); }
.table-card--besetzt .table-card-number { color: var(--color-primary); }

.table-card--reserviert {
    border-color: #fbbf24;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-style: dashed;
}
.table-card--reserviert .table-card-number { color: #92400e; }

.table-card--schmutzig {
    border-color: #d1d5db;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    opacity: 0.7;
}
.table-card--schmutzig .table-card-number { color: #6b7280; }

.table-card-number {
    font-size: var(--text-2xl);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
}
.table-card-info {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    font-weight: 500;
}
.table-card-total {
    font-weight: 800;
    color: var(--color-primary);
    font-size: var(--text-sm);
    margin-top: 2px;
}
.table-card-status {
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.table-card--frei .table-card-status { color: #059669; }
.table-card--besetzt .table-card-status { color: var(--color-primary); }
.table-card--reserviert .table-card-status { color: #d97706; }
.table-card--schmutzig .table-card-status { color: #9ca3af; }

/* Terrasse special styling */
.tischplan-terrasse .tischplan-grid {
    background: linear-gradient(135deg, #fef9ef, #fdf4e3);
    border-color: #e5dcc8;
}

.tp-legend {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--color-text-secondary);
}
.tp-legend-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
    border: 2px solid;
}
.tp-legend-dot--frei { background: #d1fae5; border-color: #34d399; }
.tp-legend-dot--besetzt { background: #ddd6fe; border-color: var(--color-primary); }
.tp-legend-dot--reserviert { background: #fef3c7; border-color: #fbbf24; }
.tp-legend-dot--schmutzig { background: #e5e7eb; border-color: #d1d5db; }

/* Dark mode overrides */
@media (prefers-color-scheme: dark) {
    .table-card--frei { background: linear-gradient(135deg, rgba(52,211,153,0.1), rgba(52,211,153,0.05)); }
    .table-card--besetzt { background: linear-gradient(135deg, rgba(57,50,181,0.15), rgba(57,50,181,0.08)); }
    .table-card--reserviert { background: linear-gradient(135deg, rgba(251,191,36,0.1), rgba(251,191,36,0.05)); }
    .table-card--schmutzig { background: linear-gradient(135deg, rgba(156,163,175,0.1), rgba(156,163,175,0.05)); }
    .tischplan-terrasse .tischplan-grid { background: linear-gradient(135deg, rgba(254,249,239,0.03), rgba(253,244,227,0.02)); }
}

/* POS responsive */
@media (max-width: 768px) {
    .pos-container {
        grid-template-columns: 1fr;
        height: auto;
        margin: 0;
        padding: 0;
    }
    .pos-products { max-height: 50vh; }
    .pos-product-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
    .pos-cart { max-height: 50vh; }
}
