/* IMS V13 – ausschließlich Gestaltung. Alle Daten- und Push-Funktionen bleiben V12.7.
   Die einzige Änderung an app.js ist die Darstellungsstruktur der Startseiten-Statistik.
   Design: iOS-ähnlich, blaue Akzente, dezente fast unsichtbare Wellen, klare Hierarchie. */
:root {
  --bg:#f9fbff;
  --card:rgba(255,255,255,.96);
  --ink:#171e2b;
  --muted:#7e889b;
  --blue:#2673fa;
  --blue-light:#eaf1ff;
  --green:#22a86a;
  --orange:#e99b34;
  --line:#e8edf7;
  --radius:19px;
  --shadow:0 6px 22px rgba(37,63,113,.055),0 1px 3px rgba(34,62,103,.025);
}
body {
  background-color:#f9fbff;
  background-image:
    radial-gradient(ellipse 85% 33% at 8% -4%, rgba(209,224,255,.48),transparent 84%),
    radial-gradient(ellipse 105% 42% at 91% 54%, rgba(230,238,255,.32),transparent 87%),
    radial-gradient(ellipse 88% 32% at 0% 103%, rgba(217,232,255,.41),transparent 88%);
  background-attachment:fixed;
}
.app { padding: max(23px,env(safe-area-inset-top)) 21px calc(115px + env(safe-area-inset-bottom)); }
.app::before {content:"";position:absolute;inset:0 0 auto; height:270px;z-index:-1;pointer-events:none;background:radial-gradient(ellipse 120% 85% at -16% -15%,rgba(221,234,255,.25) 0%,transparent 70%);}
#main {min-width:0;}
.topbar {gap:11px;min-height:42px;margin-bottom:21px;}
.topbar .icon-btn[data-action="open-settings"] {width:39px;height:39px;flex-shrink:0;border-radius:50%;border:1px solid rgba(228,234,246,.9);background:rgba(255,255,255,.76);color:#6f788b;box-shadow:0 3px 10px rgba(45,68,109,.055);}
.topbar .icon-btn[data-action="open-settings"] svg {width:19px;height:19px;}
.icon-btn{border:1px solid var(--line);background:rgba(255,255,255,.93);box-shadow:0 1px 5px rgba(39,57,92,.04);border-radius:13px;}
.cloud-badge {border-radius:999px;min-height:38px;padding:0 12px;background:rgba(255,255,255,.8);font-size:11px;font-weight:740;box-shadow:none;}
.cloud-badge.ok {color:#1e8354;background:rgba(232,249,239,.91);border-color:#def0e7;}
.page-head{margin-bottom:20px;}
.eyebrow {letter-spacing:.8px;font-size:10px;color:#2d6fe8;font-weight:790;}
h1 {font-size:31px;line-height:1.15;letter-spacing:-1.12px;font-weight:790;}
h2 {font-size:18px;letter-spacing:-.55px;font-weight:760;}
.subheading {font-size:13px;color:#8590a2;line-height:1.55;margin-top:8px;}
.section {margin-top:27px;}
.section-head {margin-bottom:13px;gap:8px;}
.link-btn {font-size:12px;font-weight:730;color:#256ee9;white-space:nowrap;}
.section-count {display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:24px;font-size:11px;font-weight:760;padding:0 8px;border-radius:50px;background:#e9edf5;color:#67738a;}
.card {border:1px solid rgba(229,235,247,.88);background:rgba(255,255,255,.96);border-radius:20px;box-shadow:var(--shadow);}
/* Header auf der Startseite: Kalenderdatum links, Cloud + Einstellungen rechts */
.topbar-home {display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:22px;}
.topbar-home .home-date {flex:0 1 auto;min-width:0;margin-right:auto;}
.topbar-home .cloud-badge,.topbar-home .icon-btn{flex:0 0 auto;}
.home-page-head {padding-top:0;margin-bottom:13px;}
.home-date {display:inline-flex;gap:6px;align-items:center;border-radius:999px;padding:10px 10px;background:rgba(224,234,255,.78);color:#246df0;letter-spacing:0;text-transform:none;font-size:11px;line-height:1.05;font-weight:760;margin:0;max-width:100%;white-space:nowrap;}
.home-date svg{width:15px;height:15px;flex-shrink:0;}
.home-date span{overflow:hidden;text-overflow:ellipsis;}
.home-page-head h1 {margin-top:0;font-size:32px;}
.home-overview {margin-top:17px;}
.home-overview-caption {display:flex;align-items:center;justify-content:space-between;gap:9px;margin-bottom:12px;font-size:12px;color:#647894;font-weight:620;}
.home-overview-caption b{color:var(--blue);font-weight:790;}
.home-new-inline {display:inline-flex;align-items:center;gap:5px;border:0;background:none;font-size:12px;font-weight:730;color:var(--blue);padding:6px 4px;white-space:nowrap;}
.home-new-inline svg{width:15px;height:15px;}
.home-stats {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;}
.home-stat {min-width:0;min-height:117px;padding:16px 13px 13px;border-radius:20px;border:1px solid rgba(255,255,255,.9);box-shadow:0 5px 16px rgba(34,74,144,.025);display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-end;}
.home-stat svg {width:22px;height:22px;flex-shrink:0;margin-bottom:10px;stroke-width:1.85;}
.home-stat strong {display:block;font-size:29px;letter-spacing:-1.1px;line-height:1.07;font-weight:790;color:#101827;}
.home-stat span{display:block;font-size:11px;color:#5c6679;margin-top:4px;line-height:1.2;white-space:nowrap;letter-spacing:-.15px;}
.home-stat-due{background:linear-gradient(135deg,#fff4f7 0%,#fae8f2 100%);color:#ac40bd;}
.home-stat-complete{background:linear-gradient(135deg,#f0fcf5 0%,#e7f7ee 100%);color:#24a05c;}
.home-stat-upcoming{background:linear-gradient(135deg,#f0f5ff 0%,#e5edff 100%);color:#3178f8;}
.home-main>.task-section:first-child {margin-top:28px;}
.task-section {margin-top:27px;}
.task-section .section-head {gap:10px;margin-bottom:12px;}
.task-section h2 {font-size:18px;}
.task-list {gap:9px;}
.task-item {padding:14px 13px;gap:11px;border-radius:18px;}
.check-btn {width:27px;height:27px;margin-top:3px;border:1.9px solid #c9ced8;transition:transform .16s,border-color .16s;}
.check-btn.checked{background:#24b36b;border-color:#24b36b;}
.check-btn:active{transform:scale(.9);}
.task-title{font-size:14px;font-weight:760;line-height:1.34;color:#222938;letter-spacing:-.19px;}
.task-title.done{color:#2d3745;text-decoration:none;}
.task-meta {gap:6px 8px;font-size:11px;margin-top:6px;color:#808b9d;}
.task-meta svg{width:13px;height:13px;}
.subject-pill {border-radius:9px;background:#f0f2f6;color:#566173;padding:5px 9px;font-size:10.5px;font-weight:700;}
.task-meta .today-label{font-weight:730;color:var(--blue);}
.status-done{color:#218a59;font-size:11px;}
.task-note{font-size:11.5px;margin-top:9px;}
.dots,.task-attach-btn{color:#8993a5;border-radius:10px;}
.dots:hover,.task-attach-btn:hover{background:#eff4ff;color:var(--blue);}
.task-actions{margin-top:10px;}
.mini-action {background:#edf3ff;color:#236de5;border-radius:10px;font-size:11px;padding:8px 10px;}
.attachment-link{border-radius:9px;background:#f5f8ff;border-color:#e3ebfb;}
.quiet-empty {background:rgba(255,255,255,.75);padding:15px;border:1px dashed #dbe3f2;color:#8690a2;}
/* Allgemeine Schaltflächen und sekundäre Seiten */
.button{border-radius:13px;padding:12px 15px;font-size:13px;font-weight:740;box-shadow:0 4px 12px rgba(40,112,245,.085);}
.button.light{box-shadow:none;background:#e9f1ff;}
.button.white,.small-btn {border:1px solid #e8effb;background:rgba(255,255,255,.94);box-shadow:none;}
.small-btn{border-radius:11px;color:var(--blue);}
.button:active,.small-btn:active,.home-new-inline:active{transform:scale(.975);}
.tabs {border:1px solid #e5eaf6;border-radius:15px;background:#eff3fa;padding:4px;}
.tab{font-size:12px;color:#7c8595;border-radius:11px;min-height:36px;}
.tab.active{color:#246de8;box-shadow:0 2px 8px rgba(38,70,117,.05);}
.day-tabs {gap:7px;}
.day-tab {border:1px solid #e9edf6;border-radius:13px;min-width:49px;height:59px;color:#6f798a;background:rgba(255,255,255,.75);}
.day-tab.active{border-color:#2673fa;background:#2673fa;box-shadow:0 7px 13px rgba(47,112,235,.16);}
.day-tab .short{font-size:12px;}.day-tab .smallnum{font-size:12px;}
.timeline::before {left:6px;background:#dbe6fa;}
.lesson {padding:16px 14px;border-radius:17px;}
.lesson::before {background:#8ab6ff;border-color:#f9fbff;}
.lesson.current {border:1px solid #aecbff;background:#fafdff;box-shadow:0 7px 22px rgba(50,110,232,.09);}
.lesson-title{font-size:14px;}
.lesson-time{font-size:11px;}
.lesson-now-pill{background:#e8f1ff;border-radius:999px;}
.lesson-actions .icon-btn {background:#edf3ff;border-radius:10px;}
.note-list{gap:10px;}
.note-item{padding:17px;border-radius:18px;}
.note-title{font-size:14px;}
.note-tag{border-radius:9px;}
.note-details{font-size:12px;color:#6c7686;}
.note-manage{border-color:#e8eef7;}
.note-home-btn {border-radius:11px;}
.note-sort-buttons button{border-radius:10px;}
.files-teaser {border-color:#e8edf8;background:rgba(255,255,255,.92);border-radius:17px;padding:17px 15px;color:#2b3c56;box-shadow:var(--shadow);}
.file-row{padding:12px;gap:8px;border-radius:17px;}
.file-symbol{background:#edf3ff;border-radius:12px;}
.file-open,.file-delete,.file-download{border-radius:10px;}
.file-name{font-size:12px;}
.file-description{font-size:11px;}
/* Packlisten: sieben Tage, deutlich erkennbare aktuelle Auswahl */
.pack-days,.pack-notify-days{gap:5px;}
.pack-day{background:rgba(255,255,255,.9);border-color:#e6ebf6;border-radius:12px;min-height:44px;}
.pack-day.active{background:#2876fa;box-shadow:0 5px 13px rgba(45,111,239,.13);}
.pack-item{padding:13px 11px;border-radius:15px;}
.pack-add-row input{background:rgba(255,255,255,.96);border-color:#e3eaf6;border-radius:12px;}
.pack-day-choice span{border-radius:11px;}
.pack-day-choice input:checked+span{background:#e5efff;border-color:#8eaffc;}
.pack-check-row{border-radius:13px;border-color:#e5ebf6;background:rgba(255,255,255,.94);}
.pack-popup-progress{height:6px;}
/* Dialoge, Formulare, Speicher- und Benachrichtigungseinstellungen */
.modal-backdrop {background:rgba(24,36,64,.36);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);}
.sheet {background:#f9fbff;border-radius:28px 28px 0 0;box-shadow:0 -16px 60px rgba(17,36,73,.16);}
.sheet-handle{background:#d3dcea;}
.sheet-header h2{font-size:20px;font-weight:780;letter-spacing:-.5px;}
.sheet-header .icon-btn{background:#eaf0f8;color:#68758b;}
.form-field label{color:#6d7b90;}
.form-field input,.form-field select,.form-field textarea{background:#fff;border:1px solid #e2e9f5;border-radius:13px;color:var(--ink);}
.form-field input:focus,.form-field select:focus,.form-field textarea:focus{border-color:#8db4ff;box-shadow:0 0 0 3px rgba(52,120,246,.09);}
.chip-btn{border-radius:10px;}
.chip-btn.is-selected {background:#e6efff;border-color:#79aaff;}
.settings-group{padding:3px 17px;border-radius:19px;}
.setting-row{min-height:65px;}
.setting-row-title{font-weight:710;}
.push-setting-row,.push-scope{border-color:#e7edf8;border-radius:17px;background:rgba(255,255,255,.96);padding:14px;}
.push-scope-choice{border-radius:11px;}
.push-clock{border-color:#e9edf7;}
.push-clock input{border-color:#e1e8f3;background:#f8faff;border-radius:11px;}
.push-summary{background:#edf2ff;color:#2b68cd;border-radius:11px;}
.push-save-btn{border-radius:13px;}
.upload-choice{border-color:#e9edf7;border-radius:14px;}
.upload-choice:has(input:checked){border-color:#8db7ff;background:#f0f6ff;}
.help-card{border-color:#e2ebfa;background:#f0f5ff;border-radius:15px;}
.account-summary{border-color:#e4ebf7;border-radius:17px;}
.account-avatar{background:#e8f0ff;}
.archive-notice{border-color:#e2e8f4;background:#f0f4fa;border-radius:14px;}
.warning{border-radius:13px;}
.empty{border-radius:19px;}
.empty-emoji{border-radius:14px;}
/* Navigation + Floating Action */
.nav{background:rgba(255,255,255,.91);border-top:1px solid #e8edf6;-webkit-backdrop-filter:blur(23px);backdrop-filter:blur(23px);padding-top:12px;}
.nav-item{font-size:10.5px;color:#8992a4;gap:5px;font-weight:720;}
.nav-item svg{width:23px;height:23px;stroke-width:1.8;}
.nav-item.active{color:#2575fa;}
.fab{background:linear-gradient(145deg,#3989ff,#1d68f5);box-shadow:0 11px 26px rgba(33,102,240,.26);border-radius:18px;width:56px;height:56px;}
.fab:active{transform:scale(.96);}
.toast{border-radius:14px;box-shadow:0 14px 32px rgba(23,38,76,.22);}
@media(max-width:395px){
  .app{padding-left:17px;padding-right:17px;}
  .home-date{font-size:10px;padding:9px 8px;}
  .home-date svg{width:13px;height:13px;}
  .cloud-badge{font-size:10px;padding:0 8px;min-height:36px;}
  .topbar .icon-btn[data-action="open-settings"]{width:35px;height:35px;}
  .home-stats{gap:7px;}
  .home-stat{min-height:107px;padding:13px 10px 12px;border-radius:18px;}
  .home-stat strong{font-size:26px;}
  .home-stat span{font-size:10px;}
  .task-item{padding:13px 11px;gap:9px;}
}
@media(max-width:345px){
  .home-date{font-size:9px;}
  .home-stat{padding:11px 7px;}
  .home-stat span{font-size:9.3px;}
}
@media(min-width:700px){
  body{background-color:#f3f6fc;background-image:radial-gradient(ellipse 85% 50% at 20% 0%,#eaf1ff,transparent 88%);}
  .app{background-color:#f9fbff;background-image:radial-gradient(ellipse 75% 28% at 0% 0%,rgba(222,233,255,.28),transparent 85%);}
  .home-stats{gap:13px;}
  .home-stat{min-height:130px;padding:18px;}
  .home-stat span{font-size:12px;}
}
@media(min-width:1100px){
  .app{max-width:1350px;padding:33px 38px 60px 253px;}
  .home-date{font-size:13px;padding:11px 15px;max-width:400px;}
  .home-content-grid{gap:28px;}
  .home-main>.task-section:first-child{margin-top:26px;}
  .nav{background:rgba(255,255,255,.93);border-color:#e5ebf6;border-radius:18px;box-shadow:0 7px 24px rgba(23,57,104,.045);}
  .nav-item{font-size:13px;}
  .nav-item.active{background:#e9f1ff;}
  .fab{bottom:35px;}
  .sheet{background:#f9fbff;}
}
@media(prefers-reduced-motion:reduce){.fab,.button,.small-btn,.check-btn{transition:none!important;}}

/* IMS V13.1: kleine Ergänzungen für Senden/Empfangen – restliches V13-Design unverändert. */
.share-inbox-icon{width:35px;height:35px;flex:0 0 auto;position:relative;border:1px solid #dfe8fa;background:rgba(255,255,255,.90);color:#2673fa;border-radius:13px;display:inline-flex;align-items:center;justify-content:center;box-shadow:0 2px 8px rgba(30,85,160,.045);}
.share-inbox-icon svg{width:18px;height:18px;}
.share-inbox-icon span{position:absolute;top:-5px;right:-5px;background:#2673fa;color:#fff;font-size:10px;line-height:16px;min-width:16px;height:16px;border-radius:99px;font-weight:750;padding:0 4px;text-align:center;box-shadow:0 2px 6px rgba(31,99,228,.18);}
.share-task-caption{font-size:13px;line-height:1.45;margin:0 0 15px;}
.share-menu{display:grid;gap:9px;margin-top:10px;}
.share-menu .setting-row{display:flex;align-items:center;justify-content:space-between;gap:14px;background:#f9fbff;border:1px solid #e4ecfa;border-radius:16px;padding:15px;text-align:left;}
.share-menu .setting-row span{display:grid;gap:4px;}
.share-menu .setting-row b{font-size:14px;color:#242d40;}
.share-menu .setting-row small{font-size:11px;color:#79869b;line-height:1.45;}
.share-menu .setting-row svg{width:21px;height:21px;color:#347af8;flex-shrink:0;}
.share-loading{display:flex;gap:10px;align-items:center;color:#79869b;font-size:13px;padding:15px 2px;}
.share-loading svg{width:17px;height:17px;}
#share-send-form .form-field{margin:15px 0 12px;}
#share-send-form select{width:100%;min-height:46px;padding:11px 12px;border:1px solid #dfe7f6;border-radius:13px;background:#fff;color:#253047;font-size:14px;}
#share-send-form .help-card{margin:10px 0 14px;}
.share-feedback{min-height:18px;line-height:1.45;color:#717f96;margin-top:10px;font-size:12px;}
.share-received-title{display:flex;align-items:flex-start;gap:12px;background:linear-gradient(135deg,#f1f6ff,#f9fbff);border:1px solid #e2eafa;border-radius:16px;padding:16px 14px;}
.share-received-title>svg{flex:0 0 auto;width:22px;height:22px;color:#347af8;margin-top:3px;}
.share-received-title span{display:grid;gap:7px;min-width:0;}
.share-received-title b{font-size:12px;color:#69788f;line-height:1.45;}
.share-received-title strong{font-size:16px;line-height:1.3;color:#20283a;overflow-wrap:anywhere;}
.share-received-meta{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:15px 1px 12px;font-size:12px;color:#68758c;}
.share-received-meta>span:not(.subject-pill){display:inline-flex;align-items:center;gap:5px;}
.share-received-meta svg{width:14px;height:14px;}
.share-received-details{font-size:13px;line-height:1.55;color:#55647c;white-space:pre-wrap;overflow-wrap:anywhere;margin:4px 2px 13px;max-height:130px;overflow:auto;}
.share-explain{font-size:12px;line-height:1.5;margin:16px 0 7px;}
.share-offer-actions{margin-top:16px;display:flex;gap:8px;}
.share-offer-actions .button{flex:1;}
.share-inbox-list{display:grid;gap:8px;}
.share-inbox-item{display:flex;width:100%;align-items:center;justify-content:space-between;gap:12px;border:1px solid #e5ebf6;background:#fff;border-radius:14px;padding:14px 13px;text-align:left;}
.share-inbox-item span{display:grid;gap:5px;min-width:0;}
.share-inbox-item b{font-size:12px;color:#3f587b;}
.share-inbox-item small{font-size:13px;color:#20283a;overflow:hidden;text-overflow:ellipsis;}
.share-inbox-item svg{width:17px;height:17px;color:#7c91b7;flex-shrink:0;}
@media(max-width:360px){.share-inbox-icon{width:32px;height:32px;}.topbar-home{gap:5px;}.topbar-home .cloud-badge{padding:0 8px;}}

/* === V13.2 – Wochen-Navigation, Prüfungen === */
.week-nav{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:2px 0 12px;padding:6px;border:1px solid #e5eaf6;border-radius:16px;background:rgba(255,255,255,.8);}
.week-nav-btn{flex:0 0 auto;width:42px;height:42px;border:0;border-radius:12px;background:#eff3fa;color:#246de8;display:grid;place-items:center;padding:0;}
.week-nav-btn svg{width:20px;height:20px;}
.week-nav-btn:active:not(:disabled){transform:scale(.94);}
.week-nav-btn:disabled{opacity:.35;}
.week-nav-label{flex:1;min-width:0;text-align:center;display:flex;flex-direction:column;gap:2px;}
.week-nav-label strong{font-size:15px;color:#101827;font-weight:760;}
.week-nav-label small{font-size:11.5px;color:#7c8595;font-weight:600;}
.week-reset{display:flex;justify-content:center;margin:-2px 0 10px;}
.week-reset .link-btn{display:inline-flex;align-items:center;gap:6px;}
.week-reset .link-btn svg{width:15px;height:15px;}
.day-tab{position:relative;}
.day-tab.is-today:not(.active){border-color:#9dbefa;}
.day-tab.is-today:not(.active) .short{color:#246de8;}
.day-dot{position:absolute;top:6px;right:7px;width:7px;height:7px;border-radius:50%;background:#e2554a;}
.day-tab.active .day-dot{background:#fff;}

.kind-switch{display:flex;gap:4px;padding:4px;margin-bottom:16px;border:1px solid #e5eaf6;border-radius:14px;background:#eff3fa;}
.kind-switch button{flex:1;display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:40px;border:0;border-radius:11px;background:transparent;color:#7c8595;font-size:13px;font-weight:740;}
.kind-switch button svg{width:16px;height:16px;}
.kind-switch button.active{background:#fff;color:#246de8;box-shadow:0 2px 8px rgba(38,70,117,.08);}

.exam-badge{flex:none;width:27px;height:27px;margin-top:3px;border-radius:9px;background:#fdecea;color:#d6453a;display:grid;place-items:center;}
.exam-badge svg{width:16px;height:16px;}
.exam-item.exam-soon{border-color:#f6c9c4;}
.exam-item.exam-past .exam-badge{background:#eef0f4;color:#9aa1ad;}
.exam-when{gap:6px;}
.exam-when svg{width:14px;height:14px;}
.exam-pill{display:inline-flex;align-items:center;gap:5px;padding:5px 8px;border-radius:999px;background:#fdecea;color:#d6453a;font-size:11px;font-weight:750;}
.exam-pill svg{width:12px;height:12px;}
.exam-day-list{display:flex;flex-direction:column;gap:10px;margin-bottom:12px;}
