/* ============================================
   Abwesenheitsverwaltung – Sonnendach Design
   Farbe: #ffe71a | Font: Nunito Sans
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;600;700;800;900&display=swap');

:root {
    --yellow:      #ffe71a;
    --yellow-dark: #e6cf00;
    --yellow-deep: #b8a500;
    --yellow-light:#fff9a0;
    --yellow-pale: #fffde0;
    --yellow-bg:   #fffef0;

    --text:        #1a1a1a;
    --text-2:      #444444;
    --text-3:      #888888;
    --surface:     #ffffff;
    --border:      #f0e800;
    --border-soft: #fff3a0;

    --green:       #16a34a;
    --red:         #dc2626;
    --orange:      #d97706;

    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-lg:  18px;
    --radius-xl:  28px;
    --radius-pill:999px;

    --shadow-sm:  0 2px 6px rgba(200,180,0,.15);
    --shadow-md:  0 4px 16px rgba(200,180,0,.22);
    --shadow-lg:  0 8px 32px rgba(200,180,0,.28);
    --shadow-btn: 0 4px 14px rgba(200,180,0,.45);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Nunito Sans', system-ui, sans-serif;
    background: #fff;
    color: var(--text);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #fafafa; }
::-webkit-scrollbar-thumb { background: var(--yellow); border-radius: 99px; }

/* ════════════════════════════════════════
   APP SHELL
   ════════════════════════════════════════ */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Topbar (weiß, wie Sonnendach-Header) ── */
.topbar {
    background: #fff;
    border-bottom: 1px solid #f5f5f5;
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.topbar-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.topbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.topbar-brand-icon {
    width: 40px; height: 40px;
    background: var(--yellow);
    border-radius: var(--radius-md);
    display: grid;
    place-items: center;
    font-size: 20px;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}
.topbar-brand-name {
    font-size: 18px;
    font-weight: 900;
    color: var(--yellow-deep);
    letter-spacing: -0.3px;
    line-height: 1;
}
.topbar-brand-sub {
    font-size: 11px;
    color: var(--text-3);
    font-weight: 600;
    margin-top: 1px;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-2);
}
.topbar-avatar {
    width: 32px; height: 32px;
    background: var(--yellow);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 900;
    color: var(--text);
    border: 2px solid var(--yellow-dark);
}
.btn-topbar-logout {
    background: var(--yellow);
    color: var(--text);
    border: none;
    padding: 8px 20px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    box-shadow: var(--shadow-btn);
    transition: background .15s, transform .1s, box-shadow .15s;
    display: inline-block;
}
.btn-topbar-logout:hover {
    background: var(--yellow-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(200,180,0,.55);
}

/* ── Navigation (gelb, wie Sonnendach-Nav) ── */
.sidenav {
    background: var(--yellow);
    position: relative;
    z-index: 100;
}
/* Wellentrennlinie unten (SVG via clip-path) */
.sidenav::after {
    content: '';
    display: block;
    position: absolute;
    bottom: -28px;
    left: 0; right: 0;
    height: 30px;
    background: var(--yellow);
    clip-path: ellipse(55% 100% at 50% 0%);
    z-index: 1;
}
.sidenav-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 2px;
    position: relative;
    z-index: 2;
}
.sidenav-link {
    display: flex;
    align-items: center;
    gap: 5px;
    color: rgba(0,0,0,.75);
    text-decoration: none;
    padding: 13px 16px;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: color .15s, border-color .15s, background .15s;
}
.sidenav-link:hover {
    color: #000;
    background: rgba(0,0,0,.07);
}
.sidenav-link.active {
    color: #000;
    border-bottom-color: rgba(0,0,0,.4);
    background: rgba(0,0,0,.06);
}

/* ── Main content ── */
.main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    width: 100%;
    /* Abstand wegen Wellen-Pseudo-Element der Nav */
    padding-top: 3.5rem;
    flex: 1;
}

/* ════════════════════════════════════════
   CARDS
   ════════════════════════════════════════ */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 2px solid #f5f0c0;
    box-shadow: 0 2px 12px rgba(200,180,0,.10);
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.card-header {
    padding: 1.1rem 1.5rem;
    border-bottom: 2px solid #fff5a0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--yellow-pale);
}
.card-title {
    font-size: 15px;
    font-weight: 900;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-title-icon {
    width: 30px; height: 30px;
    background: var(--yellow);
    border-radius: var(--radius-sm);
    display: grid;
    place-items: center;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
}
.card-body { padding: 1.5rem; }

/* ════════════════════════════════════════
   FORMS
   ════════════════════════════════════════ */
.field { margin-bottom: 1rem; }
.field-label {
    display: block;
    font-size: 12.5px;
    font-weight: 800;
    color: var(--text-2);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.field-label .req { color: #cc9900; margin-left: 2px; }

.field-input,
.field-select,
.field-textarea {
    width: 100%;
    padding: 9px 14px;
    border: 2px solid #e8e8e8;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    font-weight: 600;
    background: #fafafa;
    color: var(--text);
    transition: border-color .15s, box-shadow .15s, background .15s;
    appearance: none;
}
.field-input:hover, .field-select:hover { border-color: var(--yellow-dark); }
.field-input:focus, .field-select:focus, .field-textarea:focus {
    outline: none;
    border-color: var(--yellow);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255,231,26,.25);
}
.field-textarea { resize: vertical; min-height: 80px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* Toggle / Checkbox */
.toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    background: var(--yellow-pale);
    border: 2px solid var(--border-soft);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.toggle-row:hover { border-color: var(--yellow-dark); background: var(--yellow-light); }
.toggle-row input[type=checkbox] { width: 16px; height: 16px; accent-color: #b8a500; cursor: pointer; }
.toggle-label { font-size: 13px; font-weight: 700; color: var(--text-2); }

/* ════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 22px;
    border-radius: var(--radius-pill);
    font-size: 13.5px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all .15s;
    white-space: nowrap;
    letter-spacing: .01em;
}
.btn:active { transform: scale(.97); }

.btn-primary {
    background: var(--yellow);
    color: #1a1a1a;
    box-shadow: var(--shadow-btn);
}
.btn-primary:hover {
    background: var(--yellow-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(200,180,0,.5);
}
.btn-success {
    background: var(--green);
    color: #fff;
    box-shadow: 0 2px 8px rgba(22,163,74,.3);
}
.btn-success:hover { background: #15803d; transform: translateY(-1px); }
.btn-danger {
    background: var(--red);
    color: #fff;
    box-shadow: 0 2px 8px rgba(220,38,38,.3);
}
.btn-danger:hover { background: #b91c1c; transform: translateY(-1px); }
.btn-ghost {
    background: transparent;
    color: var(--text-2);
    border: 2px solid #e0e0e0;
}
.btn-ghost:hover { border-color: var(--yellow); background: var(--yellow-pale); color: var(--text); }
.btn-neutral {
    background: #f0f0f0;
    color: var(--text-2);
    border: 2px solid #e8e8e8;
}
.btn-neutral:hover { background: #e8e8e8; }
.btn-warn {
    background: var(--orange);
    color: #fff;
    box-shadow: 0 2px 8px rgba(217,119,6,.3);
}
.btn-warn:hover { background: #b45309; transform: translateY(-1px); }
.btn-secondary {
    background: #f0f0f0;
    color: var(--text-2);
    border: 2px solid #e8e8e8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 22px;
    border-radius: var(--radius-pill);
    font-size: 13.5px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all .15s;
}
.btn-secondary:hover { background: #e8e8e8; }

.btn-sm { padding: 6px 14px; font-size: 12.5px; }
.btn-icon { padding: 8px; border-radius: var(--radius-md); }

/* ════════════════════════════════════════
   ALERTS / BADGES
   ════════════════════════════════════════ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 16px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 700;
    margin-bottom: 1.25rem;
    border: 2px solid transparent;
}
.alert-icon { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: #f0fdf4; border-color: #86efac; color: #15803d; }
.alert-error   { background: #fff1f2; border-color: #fca5a5; color: #dc2626; }
.alert-info    { background: var(--yellow-pale); border-color: var(--yellow); color: #7a6a00; }
.alert-warn    { background: #fffbeb; border-color: #fcd34d; color: #92400e; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 800;
}
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-red    { background: #fee2e2; color: #dc2626; }
.badge-yellow { background: var(--yellow); color: #5a4a00; }
.badge-gray   { background: #f0f0f0; color: #666; }

/* ════════════════════════════════════════
   TABLE
   ════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead tr { border-bottom: 3px solid var(--yellow); }
thead th {
    padding: 11px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 900;
    color: #5a4a00;
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
    background: var(--yellow-pale);
}
tbody td { padding: 12px 16px; border-bottom: 1px solid #f5f5f5; color: var(--text-2); font-weight: 600; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--yellow-pale); color: var(--text); }
.td-strong { font-weight: 900; color: var(--text) !important; }

/* ════════════════════════════════════════
   ACTION ROW
   ════════════════════════════════════════ */
.action-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ════════════════════════════════════════
   STATS GRID
   ════════════════════════════════════════ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.25rem; margin-bottom: 1.75rem; }
.stat-tile {
    background: var(--surface);
    border: 2px solid #f0e800;
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.75rem;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}
.stat-tile::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--yellow);
}
.stat-tile-label { font-size: 11px; font-weight: 900; color: #8a7a00; text-transform: uppercase; letter-spacing: .07em; }
.stat-tile-value { font-size: 2.25rem; font-weight: 900; color: var(--text); line-height: 1.15; margin-top: 6px; }
.stat-tile-sub   { font-size: 12px; color: var(--text-3); margin-top: 2px; font-weight: 600; }

/* ════════════════════════════════════════
   CALENDAR
   ════════════════════════════════════════ */
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.cal-nav-title { font-size: 16px; font-weight: 900; color: var(--text); }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 5px; }
.cal-head { text-align: center; font-size: 11.5px; font-weight: 900; color: #7a6800; padding: 7px 0; text-transform: uppercase; letter-spacing: .05em; }
.cal-cell {
    min-height: 86px;
    border: 2px solid #f5f0c0;
    border-radius: var(--radius-sm);
    padding: 5px;
    background: var(--surface);
    transition: border-color .15s;
}
.cal-cell:hover { border-color: var(--yellow); }
.cal-cell.other  { background: #fafafa; opacity: .55; }
.cal-cell.today  { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255,231,26,.35); }
.cal-day { font-size: 12px; font-weight: 900; color: var(--text-2); }
.cal-cell.today .cal-day { color: #7a6800; }
.cal-badge {
    display: block;
    background: var(--yellow);
    color: #4a3c00;
    border-radius: 4px;
    padding: 2px 5px;
    font-size: 11px;
    font-weight: 800;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ════════════════════════════════════════
   SECTION LABEL
   ════════════════════════════════════════ */
.section-label {
    font-size: 11px;
    font-weight: 900;
    color: #8a7a00;
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-bottom: 10px;
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.section-label::after { content: ''; flex: 1; height: 2px; background: var(--yellow); border-radius: 99px; }

/* ════════════════════════════════════════
   CODE BLOCK
   ════════════════════════════════════════ */
.code-block {
    background: #1a1a1a;
    color: #fffde0;
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    font-family: 'Cascadia Code', 'Fira Code', 'Courier New', monospace;
    font-size: 12.5px;
    line-height: 1.9;
    overflow-x: auto;
    border: 2px solid var(--yellow);
}
.code-block .c-key  { color: #7dd3fc; }
.code-block .c-val  { color: #86efac; }
.code-block .c-com  { color: #6b7280; font-style: italic; }

/* ════════════════════════════════════════
   BAR CHART
   ════════════════════════════════════════ */
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 190px; margin-top: 1rem; }
.bar-wrap  { display: flex; flex-direction: column; align-items: center; flex: 1; height: 100%; justify-content: flex-end; }
.bar       { width: 100%; background: var(--yellow); border-radius: 6px 6px 0 0; min-height: 2px; transition: height .3s; box-shadow: 0 -2px 8px rgba(200,180,0,.3); }
.bar:hover { background: var(--yellow-dark); cursor: pointer; }
.bar-label { font-size: 10.5px; color: var(--text-3); margin-top: 5px; text-align: center; font-weight: 700; }
.bar-value { font-size: 11.5px; color: #8a7a00; font-weight: 900; }

/* ════════════════════════════════════════
   TIMEOUT WARNING
   ════════════════════════════════════════ */
#timeout-warning {
    position: fixed;
    bottom: 24px; right: 24px;
    background: var(--yellow);
    color: var(--text);
    padding: 14px 22px;
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 9999;
    font-size: 13.5px;
    font-weight: 900;
    border: 2px solid var(--yellow-dark);
}

/* ════════════════════════════════════════
   LOGIN PAGE
   ════════════════════════════════════════ */
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: #fff;
    padding: 1rem;
    /* Diagonaler Gelb-Streifen wie Sonnendach */
    background-image: linear-gradient(135deg, var(--yellow) 0%, var(--yellow) 40%, #fff 40%);
}
.login-panel {
    background: #fff;
    border: 2px solid #f0e800;
    border-radius: var(--radius-xl);
    padding: 2.75rem 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 40px rgba(200,180,0,.22), 0 2px 8px rgba(0,0,0,.08);
}
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo-icon {
    width: 60px; height: 60px;
    background: var(--yellow);
    border-radius: var(--radius-lg);
    display: inline-grid;
    place-items: center;
    font-size: 28px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-btn);
}
.login-title { font-size: 22px; font-weight: 900; color: var(--text); }
.login-sub   { font-size: 13px; color: var(--text-3); margin-top: 3px; font-weight: 600; }

/* Login form compat */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    font-size: 12.5px;
    font-weight: 800;
    color: var(--text-2);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px 14px;
    border: 2px solid #e8e8e8;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    font-weight: 600;
    background: #fafafa;
    color: var(--text);
    transition: border-color .15s, box-shadow .15s, background .15s;
    appearance: none;
}
.form-group input:focus,
.form-group select:focus { outline: none; border-color: var(--yellow); background: #fff; box-shadow: 0 0 0 4px rgba(255,231,26,.25); }

/* Step dots */
.step-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 1.5rem; }
.step-dot  { width: 8px; height: 8px; border-radius: 99px; background: #e0e0e0; transition: all .25s; }
.step-dot.active { background: var(--yellow); width: 24px; }
.step-dot.done   { background: var(--yellow-dark); }

/* Method tiles */
.method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 1.25rem; }
.method-tile {
    border: 2px solid #e8e8e8;
    border-radius: var(--radius-md);
    padding: 1.25rem .75rem;
    text-align: center;
    cursor: pointer;
    background: #fafafa;
    transition: all .2s;
}
.method-tile:hover  { border-color: var(--yellow-dark); background: var(--yellow-pale); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.method-tile.sel    { border-color: var(--yellow); background: var(--yellow-light); box-shadow: 0 0 0 3px rgba(255,231,26,.35); }
.method-tile-icon   { font-size: 1.85rem; margin-bottom: 7px; }
.method-tile-title  { font-size: 13.5px; font-weight: 900; color: var(--text); }
.method-tile-desc   { font-size: 11px; color: var(--text-3); margin-top: 2px; font-weight: 600; }

.back-btn { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); font-size: 13px; font-weight: 800; text-decoration: none; margin-bottom: 1rem; }
.back-btn:hover { color: var(--text); }

.code-field {
    text-align: center !important;
    font-size: 2rem !important;
    letter-spacing: .5em !important;
    font-weight: 900 !important;
    padding-left: 1.5rem !important;
}

/* ════════════════════════════════════════
   UTILITY
   ════════════════════════════════════════ */
.flex       { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-3 { margin-bottom: 12px; }
.text-sm  { font-size: 12.5px; }
.text-muted { color: var(--text-3); font-weight: 600; }
.font-bold { font-weight: 900; }
.w-full { width: 100%; }
.divider { height: 2px; background: var(--yellow); border-radius: 99px; margin: 1.25rem 0; }
.container { max-width: 1280px; margin: 0 auto; padding: 2rem; }

/* ════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════ */
@media (max-width: 768px) {
    .main { padding: 3rem 1rem 2rem; }
    .field-row { grid-template-columns: 1fr; }
    .cal-cell { min-height: 58px; }
    .sidenav-inner { overflow-x: auto; padding: 0 1rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .topbar-inner { padding: 0 1rem; }
    .login-page { background-image: none; background: #fffde0; }
}
