:root {
    --bg: #eef3f8;
    --panel: #ffffff;
    --text: #17212b;
    --muted: #667085;
    --primary: #173b63;
    --cream: #ffe2b8;
    --line-strong: rgba(35, 46, 68, .38);
    --weekend: #73b6c0;
    --holiday: #f5b7a8;
    --school: #ead6a4;
}

* {
    box-sizing: border-box;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 6%, rgba(115, 182, 192, .28), transparent 28%),
        radial-gradient(circle at 88% 0%, rgba(109, 88, 116, .23), transparent 33%),
        linear-gradient(135deg, #edf4f8 0%, #f9fbfd 52%, #edf3f8 100%);
    overflow-x: auto;
}

.app-shell,
.screen-panel,
.urlaub-list {
    max-width: 1500px;
    margin: 0 auto;
    padding: 18px 16px 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.eyebrow {
    color: var(--primary);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
    margin-bottom: 5px;
    font-size: clamp(30px, 4vw, 52px);
    letter-spacing: -.04em;
    line-height: .95;
}

.topbar p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 15px;
}

.forms {
    display: grid;
    grid-template-columns: 1fr 1.35fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}

.card,
.box {
    background: rgba(255, 255, 255, .9);
    border: 1px solid rgba(255, 255, 255, .95);
    border-radius: 22px;
    box-shadow: 0 18px 46px rgba(20, 37, 63, .11);
}

.glass-card,
.box {
    padding: 16px;
    backdrop-filter: blur(14px);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 12px;
}

.card-header h3 {
    margin: 0;
    font-size: 18px;
    letter-spacing: -.02em;
}

.card-header small {
    color: var(--muted);
    font-weight: 600;
}

.icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(23,59,99,.12), rgba(115,182,192,.22));
    font-size: 21px;
}

form {
    max-width: 100%;
}

input,
select,
button {
    min-height: 42px;
    padding: 10px 12px;
    margin: 4px 0;
    border-radius: 14px;
    font-size: 15px;
}

input,
select {
    border: 1px solid #cfd8e3;
    background: #fff;
    color: var(--text);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

input:focus,
select:focus {
    border-color: #5da9b6;
    box-shadow: 0 0 0 4px rgba(115, 182, 192, .18);
}

input[type="color"] {
    width: 52px;
    height: 42px;
    padding: 3px;
    vertical-align: middle;
}

button,
.btn {
    cursor: pointer;
    border: 0;
    background: linear-gradient(135deg, #173b63, #315d91);
    color: #fff;
    font-weight: 900;
    box-shadow: 0 10px 22px rgba(23, 59, 99, .18);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

button:hover,
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(23, 59, 99, .24);
    filter: brightness(1.04);
}

.btn-primary { background: linear-gradient(135deg, #173b63, #315d91); }
.btn-success { background: linear-gradient(135deg, #15935f, #23c483); }
.btn-danger { background: linear-gradient(135deg, #d62828, #f03e3e); }
.btn-sm { min-height: 32px; padding: 7px 10px; border-radius: 10px; font-size: 12px; }
.print-btn { border-radius: 999px; min-width: 180px; }

.vacation-list form {
    align-items: center;
}

.legend-chip,
.urlaub-chip,
.legend-color {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0,0,0,.24);
    color: #000 !important;
    font-weight: 900;
    line-height: 1;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
}

.page-wrap {
    width: 100%;
    overflow-x: auto;
    padding: 0 10px 20px;
}

.page {
    width: 297mm;
    min-height: 210mm;
    margin: 0 auto;
    padding: 7mm;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 24px 70px rgba(20,37,63,.20);
}

.planner-head {
    height: 26mm;
    background:
        linear-gradient(135deg, rgba(43,71,115,.96), rgba(51,77,116,.96) 45%, rgba(109,88,116,.96) 100%),
        radial-gradient(circle at 20% 0%, rgba(255,255,255,.22), transparent 24%);
    color: var(--cream);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 4mm 7mm;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}

.brand {
    font-size: 14pt;
    font-weight: 950;
    line-height: 1.05;
    text-shadow: 0 2px 7px rgba(0,0,0,.22);
}

.year {
    font-size: 42pt;
    font-weight: 300;
    letter-spacing: 2mm;
    text-shadow: 0 3px 10px rgba(0,0,0,.18);
}

.note {
    text-align: right;
    font-size: 10pt;
    font-style: italic;
    line-height: 1.2;
}

.legend {
    background: #fff;
    min-height: 9mm;
    display: flex;
    align-items: center;
    gap: 2.4mm;
    padding: 1.4mm 0;
    font-size: 7.2pt;
    overflow: hidden;
    white-space: nowrap;
}

.legend-chip,
.legend-color {
    padding: 1.15mm 2mm;
    border-radius: 999px;
}

.year-planner {
    height: 161mm;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    border-left: 1px solid var(--line-strong);
    border-top: 1px solid var(--line-strong);
    background: #fff;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
}

.month-col {
    background: #fff;
    border-right: 1px solid var(--line-strong);
    min-width: 0;
}

.month-title {
    height: 9mm;
    background: linear-gradient(135deg, #243e66, #365a86);
    color: #ffdcb0;
    font-size: 9.8pt;
    font-weight: 950;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--line-strong);
    text-shadow: 0 1px 3px rgba(0,0,0,.25);
}

.day-row {
    background: #fff;
    height: calc((152mm) / 31);
    display: grid;
    grid-template-columns: 5.1mm 5.2mm 1fr;
    border-bottom: 1px solid rgba(35,46,68,.20);
    min-height: 0;
    overflow: hidden;
}

.day-row.empty { background: #fff; }

.day-num,
.day-name {
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(35,46,68,.18);
    font-size: 5.8pt;
    font-weight: 900;
}

.day-name {
    font-size: 4.3pt;
    font-weight: 700;
    color: #334155;
}

.day-info {
    position: relative;
    overflow: hidden;
    padding: .45mm .55mm;
    font-size: 4.4pt;
    line-height: 1.02;
    white-space: nowrap;
}

.weekend { background: var(--weekend) !important; }
.holiday { background: var(--holiday) !important; }
.school { background: var(--school) !important; }
.holiday.school { background: linear-gradient(90deg, var(--holiday) 0%, var(--holiday) 50%, var(--school) 50%, var(--school) 100%) !important; }

.holiday-label,
.school-label {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.holiday-label { font-weight: 950; }

.urlaub-chip {
    max-width: 100%;
    padding: .45mm .7mm;
    margin: 0 .35mm .25mm 0;
    border-radius: 3px;
    font-size: 4.5pt;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: top;
}

.urlaub-list {
    margin-bottom: 30px;
    padding: 18px;
}

.urlaub-entry {
    padding: 10px 0;
    border-bottom: 1px solid #e1e8ef;
}

@media (max-width: 1200px) {
    .forms { grid-template-columns: 1fr 1fr; }
    .forms .box:nth-child(2) { grid-column: span 2; }
}

@media (max-width: 760px) {
    body { background: linear-gradient(180deg, #eef5f9 0%, #fff 100%); }
    .app-shell, .screen-panel, .urlaub-list { padding: 10px; }
    .topbar { align-items: stretch; flex-direction: column; }
    .print-btn { position: sticky; top: 8px; z-index: 10; width: 100%; }
    .forms { grid-template-columns: 1fr; }
    .forms .box:nth-child(2) { grid-column: auto; }
    .box { padding: 13px; border-radius: 18px; }
    input, select, button { width: 100%; font-size: 16px; }
    input[type="color"] { width: 64px; }
    .vacation-list form { width: 100%; display: grid !important; grid-template-columns: 1fr 64px 70px; gap: 6px !important; margin: 5px 0 !important; }
    .vacation-list input, .vacation-list button { width: 100%; }
    .page { width: 1080px; min-height: auto; margin: 0; padding: 14px; border-radius: 16px; }
    .planner-head { height: 96px; border-radius: 12px 12px 0 0; }
    .legend { min-height: 34px; }
    .year-planner { height: 610px; }
    .month-title { height: 34px; }
    .day-row { height: calc((610px - 34px) / 31); grid-template-columns: 20px 20px 1fr; }
}

@page {
    size: A4 landscape;
    margin: 0;
}

@media print {
    html, body {
        width: 297mm;
        height: 210mm;
        overflow: hidden;
        background: #fff !important;
    }

    .no-print,
    .screen-panel,
    .urlaub-list,
    .app-shell {
        display: none !important;
    }

    .page-wrap {
        padding: 0 !important;
        overflow: hidden !important;
    }

    .page,
    .legend,
    .year-planner,
    .month-col,
    .day-row {
        background: #fff !important;
    }

    .page {
        width: 297mm;
        height: 210mm;
        min-height: 210mm;
        margin: 0;
        padding: 6mm;
        border-radius: 0;
        box-shadow: none;
        page-break-after: avoid;
        page-break-inside: avoid;
        overflow: hidden;
    }

    .planner-head { height: 24mm; border-radius: 0; }
    .brand { font-size: 12pt; }
    .year { font-size: 38pt; }
    .note { font-size: 8pt; }
    .legend { height: 8mm; min-height: 8mm; font-size: 6pt; gap: 1.4mm; }
    .legend-chip, .legend-color { padding: .8mm 1.2mm; border-radius: 3px; }
    .year-planner { height: 166mm; border-radius: 0; }
    .month-title { height: 8mm; font-size: 8.5pt; }
    .day-row { height: calc((158mm) / 31); grid-template-columns: 4.6mm 4.6mm 1fr; }
    .day-num { font-size: 5.4pt; }
    .day-name { font-size: 3.9pt; }
    .day-info { font-size: 3.85pt; padding: .35mm .4mm; }
    .urlaub-chip { font-size: 3.85pt; padding: .25mm .45mm; margin: 0 .2mm .15mm 0; border-radius: 2px; }

    .day-row.weekend,
    .day-row.weekend .day-num,
    .day-row.weekend .day-name,
    .day-row.weekend .day-info { background: var(--weekend) !important; }

    .day-row.holiday,
    .day-row.holiday .day-num,
    .day-row.holiday .day-name,
    .day-row.holiday .day-info { background: var(--holiday) !important; }

    .day-row.school,
    .day-row.school .day-num,
    .day-row.school .day-name,
    .day-row.school .day-info { background: var(--school) !important; }

    .day-row.holiday.school,
    .day-row.holiday.school .day-num,
    .day-row.holiday.school .day-name,
    .day-row.holiday.school .day-info {
        background: linear-gradient(90deg, var(--holiday) 0%, var(--holiday) 50%, var(--school) 50%, var(--school) 100%) !important;
    }

    .day-row.empty,
    .day-row.empty .day-num,
    .day-row.empty .day-name,
    .day-row.empty .day-info { background: #fff !important; }
}

/* ===== Screen-Größen: Desktop größer + Smartphone vollständig sichtbar ===== */
@media screen {
    .app-shell,
    .screen-panel,
    .urlaub-list {
        max-width: 1780px;
        padding-left: clamp(10px, 2vw, 28px);
        padding-right: clamp(10px, 2vw, 28px);
    }

    .page-wrap {
        width: 100%;
        overflow-x: visible;
        padding: 0 clamp(8px, 1.5vw, 24px) 28px;
    }

    .page {
        width: min(96vw, 1680px);
        min-height: unset;
        aspect-ratio: 297 / 210;
        padding: clamp(12px, 1.35vw, 28px);
    }

    .planner-head {
        height: 13%;
        padding: clamp(12px, 1.4vw, 26px) clamp(16px, 2vw, 34px);
    }

    .brand { font-size: clamp(18px, 1.55vw, 29px); }
    .year { font-size: clamp(46px, 4.5vw, 82px); letter-spacing: clamp(8px, .7vw, 14px); }
    .note { font-size: clamp(13px, .95vw, 18px); }

    .legend {
        min-height: 4.6%;
        height: auto;
        font-size: clamp(10px, .72vw, 13px);
        gap: clamp(6px, .55vw, 12px);
        padding: clamp(5px, .45vw, 8px) 0;
    }

    .legend-chip,
    .legend-color { padding: clamp(4px, .35vw, 7px) clamp(8px, .65vw, 13px); }

    .year-planner { height: calc(100% - 13% - 5.3%); }

    .month-col {
        display: grid;
        grid-template-rows: clamp(30px, 2.45vw, 43px) repeat(31, minmax(0, 1fr));
    }

    .month-title { height: auto; font-size: clamp(14px, 1.05vw, 19px); }

    .day-row {
        height: auto;
        grid-template-columns: clamp(18px, 1.35vw, 25px) clamp(18px, 1.35vw, 25px) 1fr;
    }

    .day-num { font-size: clamp(8px, .58vw, 11px); }
    .day-name { font-size: clamp(6px, .45vw, 8.5px); }
    .day-info { font-size: clamp(6px, .45vw, 8.6px); padding: clamp(1px, .16vw, 3px) clamp(2px, .23vw, 4px); }
    .urlaub-chip { font-size: clamp(6px, .45vw, 8.5px); padding: clamp(1px, .13vw, 2px) clamp(2px, .23vw, 4px); margin: 0 1px 1px 0; }
}

@media screen and (max-width: 760px) {
    body { overflow-x: hidden; }
    .page-wrap { overflow-x: hidden; padding: 0 6px 18px; }

    .page {
        width: 100%;
        max-width: 100%;
        aspect-ratio: 297 / 210;
        padding: 7px;
        border-radius: 14px;
    }

    .planner-head {
        height: 14%;
        padding: 8px 10px;
        border-radius: 10px 10px 0 0;
    }

    .brand { font-size: clamp(9px, 2.7vw, 13px); line-height: 1.05; }
    .year { font-size: clamp(25px, 8.8vw, 42px); letter-spacing: 3px; }
    .note { font-size: clamp(7px, 2vw, 10px); }

    .legend {
        min-height: 24px;
        font-size: 7px;
        gap: 3px;
        padding: 3px 0;
        overflow: hidden;
    }

    .legend-chip,
    .legend-color { padding: 3px 5px; border-radius: 999px; }
    .year-planner { height: calc(100% - 14% - 28px); min-width: 0; }
    .month-col { grid-template-rows: 19px repeat(31, minmax(0, 1fr)); }
    .month-title { font-size: 8px; }
    .day-row { grid-template-columns: 10px 10px 1fr; min-width: 0; }
    .day-num { font-size: 5.2px; }
    .day-name { font-size: 3.7px; }
    .day-info { font-size: 3.7px; padding: 0 1px; }
    .urlaub-chip { font-size: 3.6px; padding: 0 1px; border-radius: 1px; max-width: 100%; }
}
