* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

@media (max-width: 900px) {
    .hero { flex-direction: column-reverse; gap:18px; }
    .hero-right { width:100%; }
    .hero-left h2 { font-size:28px; }
    .hero { padding:20px; margin: 10px; }
    .topbar { padding:12px 16px; }
}

.header {
    background: linear-gradient(45deg, #2196F3, #21CBF3);
    color: white;
    padding: 30px;
    text-align: center;
}

/* Topbar + Hero */
.topbar {
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:18px 30px;
    background: linear-gradient(90deg,#021124 0%, #052238 60%);
    color: #e6f7ff;
}
.topbar-left { background: #2f3740; padding:10px 16px; border-radius:8px; }
.topbar-left .app-title { font-size:20px; color: var(--ze-accent); margin-bottom:4px; font-weight:700; }
.topbar-left .app-sub { font-size:12px; color:#bfefff; }
.topbar-right { display:flex; gap:12px; align-items:center; }

#user-pane { display:none; }
#user-pane.active { display:flex; gap:12px; align-items:center; background:#33414a; padding:8px 12px; border-radius:8px; color:#fff; }

.hero {
    display:flex;
    gap:30px;
    align-items:center;
    padding:36px 30px;
    padding-top: 48px;
    padding-bottom: 48px;
    background: linear-gradient(180deg,#0b2540 0%, #112f4a 100%);
    color: #e6f7ff;
    border-radius: 12px;
    margin: 56px 30px 30px 30px;
}
.hero-left { flex:1; }
.hero-left h2 { font-size:48px; margin:0 0 6px 0; color:#00ffc8; }
.hero-left .lead { font-size:18px; opacity:0.9; }
.hero-right { width:420px; display:flex; justify-content:center; }
.hero-right img { max-width:100%; height:auto; border-radius:12px; box-shadow: 0 20px 40px rgba(0,0,0,0.5); }

/* compact content area beneath hero */
.content { padding: 10px 30px 60px 30px; }

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding: 15px;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
}

.user-switch {
    background: rgba(255,255,255,0.3);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
}

.content {
    padding: 30px;
}

.nav-buttons {
    display: none; /* hidden until logged in */
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

body.logged-in .nav-buttons {
    display: flex;
}

.nav-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    background: #f0f2f5;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.nav-btn.active {
    background: #2196F3;
    color: white;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

/* Abteilungsauswahl */
.department-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.department-card {
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
}

.department-card:hover {
    border-color: #2196F3;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.department-card.selected {
    border-color: #4CAF50;
    background: #e8f5e8;
}

/* QR-Code Display */
.qr-display {
    text-align: center;
    padding: 40px;
    border: 2px solid #4CAF50;
    border-radius: 12px;
    background: #f8fff8;
    margin: 20px 0;
    display: none;
}

.qr-display.active {
    display: block;
}

.qr-code-big {
    width: 200px;
    height: 200px;
    margin: 20px auto;
    border: 3px solid #4CAF50;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    cursor: pointer;
    transition: transform 0.3s;
}

.qr-code-big:hover {
    transform: scale(1.05);
}

/* Mitarbeiter Panel */
.employee-panel {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 30px;
    margin-top: 40px; /* less vertical offset so panel is visible on smaller screens */
    display: none;
    transition: margin-top 220ms ease;
}

.employee-panel.active {
    display: block;
    margin-top: 20px; /* when active, pull the panel a bit higher to center better */
}

.employee-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e1e5e9;
}

.employee-info h2 {
    color: #2196F3;
    margin-bottom: 5px;
}

.employee-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #2196F3;
    }
.topbar-left .app-title { color: var(--ze-accent); font-weight: 700; }
.topbar { padding-top: 18px; padding-bottom: 18px; }

/* Action Buttons */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.action-btn {
    padding: 20px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.btn-start {
    background: #4CAF50;
    color: white;
}

.btn-pause {
    background: #FF9800;
    color: white;
}

.btn-end {
    background: #f44336;
    color: white;
}

.btn-vacation {
    background: #9C27B0;
    color: white;
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

/* Urlaubskalender */
.vacation-calendar {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-top: 20px;
    display: none;
}

.vacation-calendar.active {
    display: block;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-nav {
    background: #2196F3;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 20px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-day:hover {
    background: #e3f2fd;
}

.calendar-day.selected {
    background: #2196F3;
    color: white;
}

.calendar-day.vacation-requested {
    background: #fff3e0;
    color: #f57c00;
}

.calendar-day.vacation-approved {
    background: #e8f5e8;
    color: #4CAF50;
}

/* Verwaltungsbereich */
.admin-section {
    background: #f5f5f5;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
}

.employees-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.employees-table th,
.employees-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.employees-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-working {
    background: #e8f5e8;
    color: #4CAF50;
}

.status-pause {
    background: #fff3e0;
    color: #f57c00;
}

.status-ended {
    background: #f3f4f6;
    color: #6b7280;
}

/* Urlaubsanträge Verwaltung */
.vacation-requests {
    background: white;
    border-radius: 10px;
    padding: 25px;
}

.request-item {
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
}

.request-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.request-actions {
    display: flex;
    gap: 10px;
}

.btn-approve {
    background: #4CAF50;
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.btn-reject {
    background: #f44336;
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

.center-text { text-align: center; margin-bottom: 30px; }
.center-muted { color: #666 }

@media (max-width: 768px) {
    .department-grid,
    .employee-stats,
    .action-grid {
        grid-template-columns: 1fr;
    }
}

/* Utility classes used in HTML */
.hidden { display: none !important; }
.qr-inner { text-align: center; }
.qr-emoji { font-size: 48px; margin-bottom: 10px; }
.qr-title { font-size: 18px; font-weight: bold; }
.time-now { font-size: 24px; font-weight: bold; color: #2196F3; }
.vacation-highlight { color: #9C27B0; }
.spaced-block { margin-top: 20px; }
.btn-primary { background: #9C27B0; color: white; }
.badge-waiting { background: #fff3e0; color: #f57c00; }
.badge-approved { background: #e8f5e8; color: #4CAF50; }
.modal-actions { display:flex; gap:10px; justify-content:flex-end; }
.time-block { text-align: right; }
.selected-dates { margin: 10px 0; min-height: 20px; }
.admin-create { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.sr-only { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.center-block { margin-top:10px; text-align:center; }
.admin-section--mt { margin-top:20px; }

/* Secondary action button used for extra actions */
.btn-secondary {
    background: #f3f4f6;
    color: #111827;
    padding: 12px;
    border-radius: 8px;
    border: none;
}

/* Toast notifications */
#app-toast { pointer-events: none; }
#app-toast .toast { pointer-events: auto; }

/* Rich notification (centered dialog) */
.rich-notification-wrap {
    position: fixed !important;
    left: 50%;
    top: 45%;
    transform: translate(-50%, -50%);
    z-index: 11000;
    pointer-events: none;
}
.rich-notification {
    pointer-events: auto;
    width: 360px;
    max-width: calc(100vw - 40px);
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(245,250,255,0.98));
    border-radius: 12px;
    box-shadow: 0 18px 38px rgba(8,12,20,0.28);
    padding: 18px;
    border: 1px solid rgba(20,30,40,0.06);
    color: var(--ze-muted);
    font-family: inherit;
}
.rich-notification .rn-title { font-size: 16px; font-weight: 700; color: var(--ze-accent); margin-bottom: 10px; }
.rich-notification .rn-items { list-style: none !important; margin: 0; padding: 0; display: grid; gap: 8px; }
.rich-notification .rn-items li { margin: 0; padding: 0; }
.rich-notification .rn-item { display:flex; gap:10px; align-items:center; }
.rich-notification .rn-item .icon { width:22px; height:22px; display:inline-flex; align-items:center; justify-content:center; border-radius:6px; color:white; font-weight:700; }
.rich-notification .rn-item.success .icon { background: linear-gradient(180deg,#16a34a,#10b981); }
.rich-notification .rn-item.info .icon { background: linear-gradient(180deg,#0284c7,#0ea5e9); }
.rich-notification .rn-item.warn .icon { background: linear-gradient(180deg,#f59e0b,#f97316); }
.rich-notification .rn-suppress { display:flex; align-items:center; gap:8px; margin-top:12px; font-size:13px; color:#556; }
.rich-notification .rn-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:14px; }
.rich-notification .rn-ok { background: linear-gradient(180deg, rgba(40,110,140,0.98), rgba(40,95,130,0.9)); color:white; border:none; padding:8px 14px; border-radius:8px; cursor:pointer; }
.rich-notification .rn-ok:active { transform: translateY(1px); }
.rich-notification .rn-close { background: rgba(0,0,0,0.06); border:none; padding:8px 12px; border-radius:8px; cursor:pointer; }


/* Welcome banner after PIN login */
.welcome-banner {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    top: 20px;
    background: linear-gradient(90deg,#16a34a,#10b981);
    color: white;
    padding: 12px 18px;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(16,24,40,0.25);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
}
.welcome-banner .welcome-content { display:flex; flex-direction:column; }
.welcome-banner .welcome-content strong { font-size:16px; }
.welcome-banner .welcome-sub { font-size:13px; opacity:0.95 }
.welcome-banner .welcome-close { background: rgba(255,255,255,0.12); color: white; border: none; padding: 8px 12px; border-radius: 8px; cursor: pointer; }

/* ---- Gray Transparent Theme Overrides ---- */
:root{
    --ze-bg: rgba(235,243,249,1);
    --ze-muted: #263238;
    --ze-glass: rgba(40,60,84,0.12);
    --ze-glass-strong: rgba(30,50,74,0.18);
    --ze-accent: rgba(3,169,244,0.98);
    --ze-accent-soft: rgba(3,169,244,0.6);
    --ze-shadow: 0 12px 34px rgba(20,30,40,0.08);
}

/* page background subtle */
body {
    background: linear-gradient(180deg, rgba(250,250,251,1), rgba(245,246,248,1));
}

/* container less white, subtle glass */
.container {
    background: linear-gradient(180deg, rgba(230,240,248,0.94), rgba(220,235,246,0.9));
    border-radius: 14px;
    box-shadow: var(--ze-shadow);
    border: 1px solid rgba(30,34,38,0.06);
}

/* topbar translucent gray */
.topbar {
    background: linear-gradient(90deg, rgba(220,230,240,0.36), rgba(210,225,236,0.28));
    color: var(--ze-muted);
    border-bottom: 1px solid rgba(30,34,38,0.04);
}
.topbar-left { background: rgba(40,44,48,0.06); padding:10px 16px; border-radius:8px; }
.topbar-left .app-title { color: var(--ze-accent); }

/* hero overlay to keep text readable */
.hero { background: transparent; }
.hero::after{
    content: '';
    position: absolute;
    left: 30px; right: 30px; top: 36px; bottom: 36px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(200,225,240,0.62), rgba(180,210,235,0.48));
    pointer-events: none;
    z-index: 0;
}
.hero * { position: relative; z-index: 1; }

.hero-left h2 { color: var(--ze-accent); }
.hero-left .lead { color: rgba(30,50,70,0.68); }

/* cards and panels become glassy gray */
.card, .employee-panel, .vacation-requests, .admin-section, .stat-card, .vacation-calendar {
    background: linear-gradient(180deg, rgba(235,244,250,0.78), rgba(225,236,246,0.72));
    border: 1px solid rgba(30,34,38,0.04);
    box-shadow: var(--ze-shadow);
}

#user-pane.active { background: linear-gradient(180deg, rgba(230,240,246,0.82), rgba(215,230,242,0.74)); color: var(--ze-muted); border: 1px solid rgba(30,34,38,0.05); }

/* department cards muted */
.department-card { background: linear-gradient(180deg, rgba(232,242,249,0.72), rgba(222,236,246,0.68)); border: 1px solid rgba(20,24,28,0.04); }
.department-card.selected { background: linear-gradient(180deg, rgba(215,235,242,0.94), rgba(200,225,236,0.86)); border-color: rgba(60,130,140,0.18); }
.department-card.disabled { opacity: 0.52; filter: grayscale(10%); }

/* buttons desaturated */
.nav-btn, .action-btn, .btn-start, .btn-pause, .btn-end, .btn-vacation, .btn-approve, .btn-reject, .btn-primary {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.nav-btn { background: linear-gradient(180deg, rgba(230,240,246,0.86), rgba(220,236,246,0.72)); color: var(--ze-muted); border: 1px solid rgba(20,24,28,0.04); }
.nav-btn.active { background: linear-gradient(180deg, rgba(60,130,140,0.96), rgba(60,130,140,0.82)); color: white; }
.btn-start { background: linear-gradient(180deg, rgba(46,160,102,0.98), rgba(46,160,102,0.88)); color: white; }
.btn-pause { background: linear-gradient(180deg, rgba(245,159,11,0.96), rgba(245,159,11,0.86)); color: white; }
.btn-end { background: linear-gradient(180deg, rgba(224,70,70,0.96), rgba(224,70,70,0.86)); color: white; }

/* toasts soft dark */
.toast { background: rgba(24,28,32,0.9); color: #f7f8fa; }

/* small adjustments */
.qr-display, .qr-code-big { background: linear-gradient(180deg, rgba(235,244,250,0.96), rgba(225,236,246,0.92)); border: 1px solid rgba(20,24,28,0.04); }

/* ensure inputs remain readable */
input, textarea, select {
    background: linear-gradient(180deg, rgba(250,255,255,0.96), rgba(240,248,252,0.92));
    border: 1px solid rgba(20,24,28,0.06);
}

/* small responsive tweak for hero overlay on mobile */
@media (max-width: 900px) {
    .hero::after{ left: 12px; right: 12px; top: 20px; bottom: 20px; }
}

/* End overrides */

/* ---- Button & Toast refinements (gray-blue) ---- */
.nav-btn { background: linear-gradient(180deg, rgba(220,232,240,0.94), rgba(200,224,236,0.82)); color: var(--ze-muted); border: 1px solid rgba(20,24,28,0.04); }
.nav-btn.active { background: linear-gradient(180deg, rgba(40,110,140,0.98), rgba(40,95,130,0.88)); color: white; box-shadow: 0 8px 22px rgba(30,70,90,0.12); }
.nav-btn:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(20,34,46,0.06); }

.btn-start { background: linear-gradient(180deg, rgba(36,150,140,0.96), rgba(26,130,120,0.86)); color: white; }
.btn-pause { background: linear-gradient(180deg, rgba(220,140,40,0.96), rgba(210,120,30,0.86)); color: white; }
.btn-end { background: linear-gradient(180deg, rgba(200,70,80,0.96), rgba(190,60,70,0.86)); color: white; }
.btn-vacation { background: linear-gradient(180deg, rgba(120,88,160,0.96), rgba(110,70,150,0.86)); color: white; }

.btn-secondary {
    background: linear-gradient(180deg, rgba(240,246,250,0.9), rgba(230,242,250,0.86));
    color: var(--ze-muted);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(20,24,28,0.04);
}
.btn-secondary:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(20,34,46,0.06); }
.btn-secondary:active { transform: translateY(-1px); }

.toast { background: linear-gradient(180deg, rgba(18,24,32,0.94), rgba(14,18,22,0.88)); color: #f7f8fa; border: 1px solid rgba(255,255,255,0.04); box-shadow: 0 8px 24px rgba(8,12,16,0.28); }
.toast.success { border-left: 4px solid rgba(40,160,120,0.9); }
.toast.warn { border-left: 4px solid rgba(245,160,50,0.9); }
.toast.error { border-left: 4px solid rgba(220,60,60,0.9); }

.btn:focus, .nav-btn:focus, .btn-secondary:focus { outline: 3px solid rgba(60,130,140,0.12); outline-offset: 2px; }

/* End button & toast refinements */