/**
 * Schreinerei Lehmann - Fertigmeldungssystem
 * Einheitliches Design - Mobile First - Apple Style
 */

/* ===== Google Font ===== */
@import url('https://fonts.googleapis.com/css2?family=Abel&display=swap');

/* ===== View Transitions (Modern Page Transitions) ===== */
@view-transition {
    navigation: auto;
}

html {
    background: #0f0f1a;
}

::view-transition-group(root) {
    background: #0f0f1a;
}

::view-transition-old(root) {
    animation: fade-out 0.2s ease-out forwards;
}

::view-transition-new(root) {
    animation: fade-in 0.25s ease-in forwards;
}

@keyframes fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}


/* Slide transition for cards */
::view-transition-old(page-content) {
    animation: slide-out-left 0.3s ease-out forwards;
}

::view-transition-new(page-content) {
    animation: slide-in-right 0.3s ease-out forwards;
}

@keyframes slide-out-left {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(-30px); opacity: 0; }
}

@keyframes slide-in-right {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ===== CSS Variables ===== */
:root {
    --primary: #0f0f1a;
    --primary-light: #1a1a2e;
    --primary-gradient: linear-gradient(145deg, #1a1a2e 0%, #0f0f1a 100%);
    --accent: #10b981;
    --accent-light: #34d399;
    --accent-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --danger: #ef4444;
    --warning: #f59e0b;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --radius: 1.25rem;
    --radius-sm: 0.75rem;
    --shadow: 0 4px 15px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.15);
    --shadow-xl: 0 12px 40px rgba(0,0,0,0.2);
    --glass: rgba(255,255,255,0.05);
    --glass-border: rgba(255,255,255,0.1);
    --font: 'Abel', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 18px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--primary);
    background: var(--primary-gradient);
    background-attachment: fixed;
    color: var(--white);
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: 90px; /* Platz für Bottom-Nav */
    letter-spacing: 0.01em;
}

@media (min-width: 600px) {
    body {
        padding-bottom: 80px; /* Weniger Platz auf Desktop */
    }
}

body.no-nav {
    padding-bottom: 0;
}

a {
    color: var(--accent-light);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent);
}

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

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 400;
    color: var(--white);
    line-height: 1.3;
    letter-spacing: 0.02em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

.text-muted { color: rgba(255,255,255,0.5); }
.text-small { font-size: 0.9rem; }
.text-xs { font-size: 0.8rem; }
.text-center { text-align: center; }
.text-mono { font-family: 'SF Mono', Monaco, monospace; font-size: 0.9em; }

/* ===== Layout ===== */
.container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1rem;
}

.page {
    padding-bottom: 1rem;
    view-transition-name: page-content;
}

.page > * + * {
    margin-top: 1rem;
}

.page-header {
    margin-bottom: 1rem;
}

.page-title {
    font-size: 1.5rem;
    margin-bottom: 0.35rem;
}

.page-subtitle {
    color: rgba(255,255,255,0.5);
    font-size: 0.95rem;
}

/* ===== Navbar ===== */
.navbar {
    background: rgba(15, 15, 26, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    color: var(--white);
    padding: 1rem 0;
    margin-bottom: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    color: var(--white);
    font-weight: 400;
    font-size: 1.2rem;
    letter-spacing: 0.03em;
}

.navbar-brand img {
    height: 44px;
    filter: brightness(0) invert(1);
}

.navbar-action {
    display: flex;
    gap: 0.5rem;
}

/* Hamburger Menu */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 15, 26, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 99;
    display: flex;
    flex-direction: column;
    padding: 6rem 2rem 2rem;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.open {
    transform: translateX(0);
}

.mobile-menu a {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    color: rgba(255,255,255,0.7);
    padding: 1.1rem 0;
    font-size: 1.35rem;
    border-bottom: 1px solid var(--glass-border);
    transition: var(--transition);
}

.mobile-menu a:hover {
    color: var(--white);
}

.mobile-menu a svg {
    width: 26px;
    height: 26px;
    opacity: 0.7;
}

.mobile-menu a.active {
    color: var(--accent-light);
}

.mobile-menu a.active svg {
    opacity: 1;
}

/* ===== Bottom Navigation ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-around;
    padding: 0.75rem 0;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    z-index: 100;
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 1rem;
    color: rgba(255,255,255,0.4);
    font-size: 0.75rem;
    font-weight: 400;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.bottom-nav a svg {
    width: 26px;
    height: 26px;
    margin-bottom: 0.3rem;
}

.bottom-nav a.active {
    color: var(--accent-light);
}

.bottom-nav a:hover {
    color: var(--white);
}

/* ===== Cards ===== */
.card {
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl), 0 0 40px rgba(0,0,0,0.1);
    overflow: hidden;
    animation: card-enter 0.4s ease-out backwards;
}

@keyframes card-enter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-header {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.02);
}

.card-title {
    font-size: 1rem;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--white);
}

.card-title svg {
    opacity: 0.7;
}

.card-body {
    padding: 1.25rem;
}

.card-body.no-padding {
    padding: 0;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
    font-weight: 400;
    font-family: inherit;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    letter-spacing: 0.02em;
    line-height: 1;
}

.btn svg {
    flex-shrink: 0;
    vertical-align: middle;
}

.btn-primary {
    background: var(--accent-gradient);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    color: var(--white);
}

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: var(--white);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.15);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: rgba(255,255,255,0.7);
}

.btn-outline:hover {
    border-color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.05);
    color: var(--white);
}

.btn-outline-danger {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #f87171;
}

.btn-outline-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
}

.btn-outline-light {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--white);
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
}

.btn-outline-light:hover {
    background: rgba(255,255,255,0.15);
}

.btn-sm {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
}

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

.btn-block {
    width: 100%;
}

.btn-icon {
    padding: 0.6rem;
    min-width: 42px;
    min-height: 42px;
}

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

/* ===== Forms ===== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 400;
    color: rgba(255,255,255,0.7);
    margin-bottom: 0.5rem;
}

.form-hint {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.4);
    margin-top: 0.35rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.9rem 1.1rem;
    font-size: 1.05rem;
    font-family: inherit;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.05);
    color: var(--white);
    transition: var(--transition);
    -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255,255,255,0.08);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-input::placeholder {
    color: rgba(255,255,255,0.3);
}

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

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 400;
    border-radius: 2rem;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-light);
}

.badge-primary {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* ===== Alert ===== */
.alert {
    padding: 1.1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--accent-light);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

/* ===== Greeting Card ===== */
.greeting-card {
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    animation: card-enter 0.4s ease-out backwards;
}

.greeting-text {
    font-size: 1.3rem;
    color: rgba(255,255,255,0.5);
}

.greeting-name {
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--white);
}

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stat-card {
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.25rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: stat-enter 0.5s ease-out backwards;
}

.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.2s; }

@keyframes stat-enter {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 400;
    color: var(--white);
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    letter-spacing: 0.02em;
    margin-top: 0.25rem;
}

.stat-sublabel {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== List Items ===== */
.list-item {
    display: flex;
    align-items: center;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--glass-border);
    gap: 1rem;
    transition: var(--transition);
    animation: list-item-enter 0.3s ease-out backwards;
}

.list-item:nth-child(1) { animation-delay: 0.05s; }
.list-item:nth-child(2) { animation-delay: 0.1s; }
.list-item:nth-child(3) { animation-delay: 0.15s; }
.list-item:nth-child(4) { animation-delay: 0.2s; }
.list-item:nth-child(5) { animation-delay: 0.25s; }
.list-item:nth-child(6) { animation-delay: 0.3s; }
.list-item:nth-child(7) { animation-delay: 0.35s; }
.list-item:nth-child(8) { animation-delay: 0.4s; }
.list-item:nth-child(9) { animation-delay: 0.45s; }
.list-item:nth-child(10) { animation-delay: 0.5s; }

@keyframes list-item-enter {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.list-item:last-child {
    border-bottom: none;
}

.list-item:hover {
    background: rgba(255,255,255,0.02);
}

.list-item-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.list-item-icon svg {
    width: 22px;
    height: 22px;
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-weight: 400;
    color: var(--white);
    font-size: 1.05rem;
    margin-bottom: 0.15rem;
}

.list-item-subtitle {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.5);
}

.list-item-meta {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.list-item-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    align-items: center;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 3.5rem 1.5rem;
    color: rgba(255,255,255,0.4);
}

.empty-state > svg {
    width: 56px;
    height: 56px;
    margin-bottom: 1.25rem;
    opacity: 0.3;
}

.empty-state p {
    margin-bottom: 1.25rem;
    font-size: 1rem;
}

.empty-state .btn svg {
    width: 18px;
    height: 18px;
}

/* ===== Machine Button ===== */
.machine-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 1.1rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    font-family: inherit;
    color: var(--white);
}

.machine-btn:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.machine-btn.selected {
    border-color: var(--accent);
    background: rgba(16, 185, 129, 0.1);
}

.machine-btn-icon {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    margin-right: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.machine-btn-icon svg {
    width: 26px;
    height: 26px;
}

.machine-btn-info {
    flex: 1;
}

.machine-btn-name {
    font-weight: 400;
    color: var(--white);
    font-size: 1.1rem;
}

.machine-btn-desc {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.5);
    margin-top: 0.2rem;
}

/* ===== Scanner Specific ===== */
.scanner-bar {
    background: rgba(16, 185, 129, 0.1);
    border-bottom: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--white);
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scanner-bar-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 400;
    font-size: 1.05rem;
    color: var(--accent-light);
}

.scanner-bar-info svg {
    width: 22px;
    height: 22px;
}

.scanner-hint {
    text-align: center;
    padding: 1.25rem;
    color: rgba(255,255,255,0.5);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

#qr-reader {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 1.25rem;
    border-radius: var(--radius);
    overflow: hidden;
    background: transparent;
}

#qr-reader video {
    border-radius: var(--radius);
    width: 100% !important;
    object-fit: cover;
}

#qr-reader__scan_region {
    background: transparent !important;
}

#qr-reader__scan_region video {
    width: 100% !important;
}

#qr-reader > div {
    display: flex;
    justify-content: center;
}

.scan-result {
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin: 0.75rem 0;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

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

.scan-result-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.scan-result-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.scan-result-icon svg {
    width: 26px;
    height: 26px;
}

.scan-result-title h6 {
    font-size: 1.1rem;
    margin-bottom: 0.15rem;
    color: var(--white);
}

.scan-result-title small {
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
}

.scan-result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.scan-result-field {
    background: rgba(255,255,255,0.05);
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
}

.scan-result-field-label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.scan-result-field-value {
    font-weight: 400;
    color: var(--white);
    font-size: 1rem;
    margin-top: 0.1rem;
}

/* ===== Login Page ===== */
.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--primary);
    background: radial-gradient(ellipse at top, #1a1a2e 0%, #0f0f1a 100%);
    padding: 1.25rem;
    margin: 0;
}

.login-card {
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    padding: 2.5rem 1.75rem;
    max-width: 420px;
    width: 100%;
    margin: auto;
    animation: login-enter 0.6s ease-out;
}

@keyframes login-enter {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.login-logo {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-logo img {
    height: 120px;
    margin-bottom: 1.5rem;
    filter: brightness(0) invert(1);
}

.login-logo h1 {
    font-size: 2rem;
    margin-bottom: 0.35rem;
    letter-spacing: 0.03em;
    color: var(--white);
}

.login-logo p {
    color: rgba(255,255,255,0.6);
    font-size: 1.3rem;
    letter-spacing: 0.1em;
}

/* ===== Success Header (Scan Erfasst) ===== */
.success-header {
    background: var(--accent);
    color: var(--white);
    padding: 2rem 1.5rem;
    text-align: center;
}

.success-icon {
    width: 70px;
    height: 70px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.success-icon svg {
    width: 36px;
    height: 36px;
}

/* ===== Color/Icon Picker ===== */
.picker-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.picker-option {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--glass-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.6);
}

.picker-option:hover {
    transform: scale(1.08);
    border-color: rgba(255,255,255,0.3);
}

.picker-option.active {
    border-color: var(--accent);
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-light);
}

.picker-option input {
    display: none;
}

.picker-option svg {
    width: 20px;
    height: 20px;
}

.color-picker-option {
    border-radius: 50%;
    border: 3px solid transparent;
}

.color-picker-option.active {
    border-color: var(--white);
    box-shadow: 0 0 0 2px var(--accent);
}

/* ===== QR Container ===== */
.qr-container {
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
    margin-bottom: 1.25rem;
    animation: card-enter 0.4s ease-out backwards;
}

.qr-container img {
    max-width: 220px;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
}

/* ===== Utilities ===== */
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }

.flex { display: flex; }
.flex-between { justify-content: space-between; }
.flex-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* ===== Responsive ===== */
@media (max-width: 479px) {
    .container {
        padding: 0 0.75rem;
    }

    /* Workpiece Steps Mobile */
    .workpiece-steps {
        padding: 0.5rem 0.75rem 0.75rem;
        gap: 0.4rem;
    }

    .step-row {
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .step-icon {
        width: 28px;
        height: 28px;
    }

    .step-icon svg {
        width: 14px;
        height: 14px;
    }

    .step-machine {
        font-size: 0.85rem;
    }

    .step-time {
        font-size: 0.75rem;
    }

    .step-delete {
        width: 32px;
        height: 32px;
    }

    .step-delete svg {
        width: 14px;
        height: 14px;
    }

    /* Workpiece Header Mobile */
    .workpiece-info {
        min-width: 0;
    }

    .workpiece-kunde {
        font-size: 0.9rem;
    }

    .workpiece-bez {
        font-size: 0.85rem;
    }

    .workpiece-meta {
        font-size: 0.75rem;
    }
}

@media (min-width: 480px) {
    html {
        font-size: 19px;
    }

    .stats-grid {
        gap: 1.25rem;
    }

    .stat-card {
        padding: 1.5rem 1.25rem;
    }

    .stat-value {
        font-size: 2.5rem;
    }

    .container {
        padding: 0 1.5rem;
    }
}

@media (min-width: 768px) {
    html {
        font-size: 20px;
    }

    .container {
        max-width: 700px;
        padding: 0 2rem;
    }

    .bottom-nav a {
        font-size: 0.85rem;
        padding: 0.6rem 1.25rem;
    }

    .bottom-nav a svg {
        width: 28px;
        height: 28px;
    }
}

/* ===== Delete Confirm Modal ===== */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(239, 68, 68, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.confirm-overlay.active {
    opacity: 1;
    visibility: visible;
}

.confirm-modal {
    background: linear-gradient(145deg, #2a1a1a 0%, #1a0f0f 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius);
    box-shadow: 0 25px 60px rgba(239, 68, 68, 0.3), 0 0 80px rgba(239, 68, 68, 0.1);
    padding: 2rem;
    max-width: 340px;
    width: 100%;
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
}

.confirm-overlay.active .confirm-modal {
    transform: scale(1) translateY(0);
}

.confirm-icon {
    width: 70px;
    height: 70px;
    background: rgba(239, 68, 68, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    color: var(--danger);
    animation: confirm-pulse 2s ease-in-out infinite;
}

@keyframes confirm-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px 5px rgba(239, 68, 68, 0.2); }
}

.confirm-icon svg {
    width: 32px;
    height: 32px;
}

.confirm-title {
    font-size: 1.3rem;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.confirm-message {
    color: rgba(255,255,255,0.6);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    gap: 0.75rem;
}

.confirm-actions .btn {
    flex: 1;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

/* ===== Info/Error Modal ===== */
.info-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.info-overlay.active {
    opacity: 1;
    visibility: visible;
}

.info-modal {
    background: linear-gradient(145deg, #1a1a2e 0%, #0f0f1a 100%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    padding: 2rem;
    max-width: 340px;
    width: 100%;
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
}

.info-overlay.active .info-modal {
    transform: scale(1) translateY(0);
}

.info-modal.info-error {
    border-color: rgba(239, 68, 68, 0.3);
}

.info-modal.info-error .info-icon {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.info-modal.info-success {
    border-color: rgba(16, 185, 129, 0.3);
}

.info-modal.info-success .info-icon {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-light);
}

.info-icon {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    color: rgba(255, 255, 255, 0.7);
}

.info-icon svg {
    width: 32px;
    height: 32px;
}

.info-title {
    font-size: 1.3rem;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.info-message {
    color: rgba(255,255,255,0.6);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.info-actions {
    display: flex;
    justify-content: center;
}

.info-actions .btn {
    min-width: 120px;
}

/* ===== Scan Success Overlay ===== */
.scan-success-overlay {
    position: fixed;
    inset: 0;
    background: rgba(16, 185, 129, 0.95);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.scan-success-overlay.active {
    opacity: 1;
    visibility: visible;
}

.scan-success-icon {
    width: 120px;
    height: 120px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    animation: success-pop 0.4s ease-out;
}

@keyframes success-pop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.scan-success-icon svg {
    width: 60px;
    height: 60px;
    color: white;
    animation: success-check 0.3s ease-out 0.2s backwards;
}

@keyframes success-check {
    from { stroke-dashoffset: 50; opacity: 0; }
    to { stroke-dashoffset: 0; opacity: 1; }
}

.scan-success-text {
    color: white;
    font-size: 1.5rem;
    font-weight: 400;
    text-align: center;
    animation: success-fade 0.3s ease-out 0.2s backwards;
}

@keyframes success-fade {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.scan-success-detail {
    color: rgba(255,255,255,0.8);
    font-size: 1rem;
    margin-top: 0.5rem;
    animation: success-fade 0.3s ease-out 0.3s backwards;
}

/* ===== Grouped Scan Item (Werkstück) ===== */
.workpiece-item {
    border-bottom: 1px solid var(--glass-border);
    animation: list-item-enter 0.3s ease-out backwards;
}

.workpiece-item:last-child {
    border-bottom: none;
}

.workpiece-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: var(--transition);
}

.workpiece-header:hover {
    background: rgba(255,255,255,0.02);
}

.workpiece-count {
    width: 48px;
    height: 48px;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 1rem;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.workpiece-count-value {
    font-size: 1.5rem;
    font-weight: 400;
    color: white;
}

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

.workpiece-kunde {
    font-size: 1.1rem;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.workpiece-bez {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.7);
}

.workpiece-meta {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.workpiece-toggle {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.4);
    transition: var(--transition);
}

.workpiece-item.open .workpiece-toggle {
    transform: rotate(90deg);
    color: var(--accent-light);
}

/* Workpiece Steps (Scan-Liste) */
.workpiece-steps {
    display: none;
    padding: 0.75rem 1rem 1rem;
    flex-direction: column;
    gap: 0.5rem;
}

.workpiece-item.open .workpiece-steps {
    display: flex;
}

.step-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

.step-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.step-icon svg {
    width: 16px;
    height: 16px;
}

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

.step-machine {
    color: var(--white);
    font-size: 0.95rem;
    font-weight: 500;
}

.step-time {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
}

.step-delete {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.step-delete:active {
    background: rgba(239, 68, 68, 0.25);
}

.step-delete svg {
    width: 16px;
    height: 16px;
}
