:root {
  --bg-dark: #050816;
  --panel-border: rgba(255, 255, 255, 0.16);
  --text-light: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.9);
  --heading: #5b1d66;
  --button-start: #ffb56a;
  --button-end: #ff7f47;
  --shadow: 0 28px 55px rgba(4, 8, 27, 0.45);
  --page-pad-x: clamp(16px, 4vw, 48px);
  --page-pad-y: clamp(16px, 3vh, 36px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg-dark);
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 280px;
  min-height: 100%;
  margin: 0;
  font-family: Inter, "Avenir Next", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-light);
  background: radial-gradient(circle at top, #16204d 0%, var(--bg-dark) 52%, #03050e 100%);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  padding:
    max(var(--page-pad-y), env(safe-area-inset-top))
    max(var(--page-pad-x), env(safe-area-inset-right))
    max(var(--page-pad-y), env(safe-area-inset-bottom))
    max(var(--page-pad-x), env(safe-area-inset-left));
  overflow: hidden;
}

@supports (min-height: 100dvh) {
  .hero {
    min-height: 100dvh;
  }
}

.landscape {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(to bottom, rgba(5, 8, 22, 0.25), rgba(5, 8, 22, 0.04) 22%, rgba(5, 8, 22, 0.32) 100%),
    radial-gradient(circle at 50% 45%, rgba(255, 198, 112, 0.13), transparent 40%);
  pointer-events: none;
}

.leaf-layer {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.leaf {
  position: absolute;
  top: -14vh;
  left: 0;
  width: var(--size);
  height: var(--leaf-height);
  opacity: 0.95;
  animation: fall var(--fall-duration) linear infinite;
  animation-delay: var(--delay);
  filter: drop-shadow(0 0 10px rgba(255, 132, 75, 0.18));
  will-change: transform;
}

.leaf::before,
.leaf::after {
  content: "";
  position: absolute;
  inset: 0;
}

.leaf::before {
  background: linear-gradient(135deg, #ffcb75 0%, #ff9555 42%, #f34f55 100%);
  border-radius: 100% 0 100% 0;
  transform: rotate(var(--tilt));
}

.leaf::after {
  width: 2px;
  height: 130%;
  left: 48%;
  top: -8%;
  background: rgba(108, 29, 29, 0.42);
  transform: rotate(calc(var(--tilt) - 12deg));
  border-radius: 999px;
}

.leaf.alt::before {
  background: linear-gradient(135deg, #ffdf96 0%, #ff7e52 45%, #dd365d 100%);
  border-radius: 12% 88% 14% 86% / 18% 84% 16% 82%;
}

.login-box {
  position: relative;
  width: min(100%, 390px);
  margin-top: clamp(0px, 5vh, 48px);
  padding: clamp(20px, 3vw, 28px) clamp(18px, 3vw, 28px) clamp(16px, 2.5vw, 20px);
  border: 1px solid var(--panel-border);
  border-radius: clamp(16px, 2vw, 20px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.13));
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  backdrop-filter: blur(14px) saturate(120%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  z-index: 2;
}

.login-box h1 {
  margin: 0 0 clamp(14px, 2.2vh, 20px);
  text-align: center;
  color: var(--heading);
  font-size: clamp(1.55rem, 1.25rem + 1vw, 2rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0.02em;
}

form {
  display: grid;
  gap: clamp(11px, 1.7vh, 14px);
}

.input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: inset 0 1px 2px rgba(18, 23, 35, 0.08);
  transition: outline-color 0.18s ease, transform 0.18s ease;
}

.input-row:focus-within {
  outline: 2px solid rgba(255, 181, 106, 0.78);
  outline-offset: 2px;
}

.icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: #8c8d96;
  flex: 0 0 auto;
}

.icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #30324a;
  font-size: 16px; /* verhindert Auto-Zoom in iOS */
}

input::placeholder {
  color: #8d8e98;
  opacity: 1;
}

button {
  width: 100%;
  min-height: 50px;
  padding: 11px 18px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  color: #ffffff;
  background: linear-gradient(90deg, var(--button-start), var(--button-end));
  box-shadow: 0 12px 20px rgba(235, 113, 77, 0.26);
  font-weight: 600;
  letter-spacing: 0.01em;
  touch-action: manipulation;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(235, 113, 77, 0.32);
    filter: brightness(1.03);
  }

  .login-links a:hover {
    opacity: 0.82;
    transform: translateY(-1px);
  }
}

button:active {
  transform: translateY(1px);
}

button:focus-visible,
.login-links a:focus-visible {
  outline: 2px solid #ffd18a;
  outline-offset: 3px;
}

.login-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: clamp(12px, 1.8vh, 16px);
  font-size: clamp(0.78rem, 0.72rem + 0.25vw, 0.9rem);
}

.login-links a {
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes fall {
  0% {
    transform: translate3d(var(--x-start), -18vh, 0) rotate(0deg);
  }
  25% {
    transform: translate3d(var(--x-quarter), 25vh, 0) rotate(130deg);
  }
  50% {
    transform: translate3d(var(--x-mid), 52vh, 0) rotate(260deg);
  }
  75% {
    transform: translate3d(var(--x-three-quarter), 78vh, 0) rotate(370deg);
  }
  100% {
    transform: translate3d(var(--x-end), 112vh, 0) rotate(480deg);
  }
}

/* Tablet */
@media (max-width: 900px) {
  .login-box {
    width: min(100%, 360px);
    margin-top: clamp(12px, 4vh, 34px);
  }

  .leaf {
    opacity: 0.9;
  }
}

/* Handy hochkant */
@media (max-width: 600px) {
  :root {
    --page-pad-x: clamp(14px, 5vw, 22px);
    --page-pad-y: 16px;
  }

  .hero {
    place-items: center;
  }

  .landscape {
    /* leichte Vergrößerung hält den zentralen Sonnenuntergang im Fokus */
    transform: scale(1.06);
  }

  .login-box {
    width: min(100%, 350px);
    margin-top: clamp(4vh, 8vh, 72px);
    border-radius: 16px;
    -webkit-backdrop-filter: blur(11px) saturate(115%);
    backdrop-filter: blur(11px) saturate(115%);
  }

  .login-links {
    gap: 10px;
  }
}

/* Sehr schmale Handys */
@media (max-width: 360px) {
  .login-box {
    padding-inline: 16px;
  }

  .login-links {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 8px;
  }

  .login-links a {
    white-space: normal;
    text-align: center;
  }
}

/* Handy quer / kleine Notebook-Höhen */
@media (max-height: 620px) and (orientation: landscape) {
  .hero {
    align-items: center;
    padding-top: max(10px, env(safe-area-inset-top));
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }

  .login-box {
    width: min(86vw, 350px);
    margin-top: 0;
    padding: 14px 18px 12px;
    border-radius: 14px;
  }

  .login-box h1 {
    margin-bottom: 9px;
    font-size: 1.35rem;
  }

  form {
    gap: 8px;
  }

  .input-row,
  button {
    min-height: 42px;
  }

  input {
    min-height: 40px;
  }

  .login-links {
    margin-top: 8px;
    font-size: 0.76rem;
  }
}

/* Große Desktop-Monitore */
@media (min-width: 1440px) and (min-height: 800px) {
  .login-box {
    width: 420px;
    padding: 30px 30px 22px;
  }

  .input-row,
  button {
    min-height: 54px;
  }
}

/* Respektiert die Betriebssystem-Einstellung für weniger Bewegung */
@media (prefers-reduced-motion: reduce) {
  .leaf {
    animation: none;
    display: none;
  }

  button,
  .login-links a,
  .input-row {
    transition: none;
  }
}

/* ---------- Login-Status ---------- */
.login-message {
  min-height: 1.35em;
  margin: 0;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 500;
}

.login-message.error {
  color: #ffe4e8;
  text-shadow: 0 1px 2px rgba(55, 0, 8, 0.35);
}

.login-message.success {
  color: #e8ffe8;
  text-shadow: 0 1px 2px rgba(0, 50, 0, 0.25);
}

.login-note {
  margin: 10px 0 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
}

/* ---------- Beispiel-Zielseite nach dem Login ---------- */
.dashboard-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 158, 80, 0.2), transparent 30%),
    linear-gradient(145deg, #22113d 0%, #090d22 48%, #040712 100%);
}

.dashboard-card {
  width: min(92vw, 620px);
  padding: clamp(26px, 5vw, 48px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 28px 55px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.dashboard-card h1 {
  margin: 0 0 12px;
}

.dashboard-card p {
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.82);
}

.dashboard-card button {
  width: min(100%, 260px);
  padding-inline: 20px;
}

/* =========================================================
   LOGIN + DASHBOARD IM SELBEN FENSTER
   ========================================================= */
[hidden] {
  display: none !important;
}

.app-view {
  animation: view-in 0.36s ease both;
}

.login-message {
  min-height: 1.25em;
  margin: 0;
  text-align: center;
  font-size: 0.82rem;
  line-height: 1.35;
}

.login-message.error {
  color: #ffd0d0;
}

.login-message.success {
  color: #e7ffe7;
}

.login-note {
  margin: 12px 0 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.76rem;
}

.dashboard-card {
  position: relative;
  z-index: 2;
  width: min(100%, 880px);
  padding: clamp(22px, 3vw, 36px);
  border: 1px solid var(--panel-border);
  border-radius: clamp(18px, 2.5vw, 26px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.23), rgba(255, 255, 255, 0.12));
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  backdrop-filter: blur(16px) saturate(120%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.dashboard-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.dashboard-kicker {
  margin: 0 0 6px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.dashboard-card h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.55rem, 1.2rem + 1.4vw, 2.5rem);
  line-height: 1.15;
}

.logout-button {
  width: auto;
  min-width: 110px;
  flex: 0 0 auto;
  padding-inline: 22px;
}

.dashboard-content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 20px);
  padding-top: 22px;
}

.dashboard-panel {
  min-width: 0;
  padding: clamp(18px, 2.3vw, 24px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(7, 10, 26, 0.28);
}

.dashboard-panel-label {
  display: block;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.63);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dashboard-panel strong {
  display: block;
  overflow-wrap: anywhere;
  color: #fff;
  font-size: clamp(1rem, 0.92rem + 0.35vw, 1.18rem);
}

.dashboard-panel p {
  margin: 9px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.9rem;
  line-height: 1.55;
}

body.is-dashboard .hero::before {
  background:
    linear-gradient(to bottom, rgba(5, 8, 22, 0.35), rgba(5, 8, 22, 0.12) 22%, rgba(5, 8, 22, 0.45) 100%),
    radial-gradient(circle at 50% 45%, rgba(255, 198, 112, 0.11), transparent 40%);
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 700px) {
  .dashboard-card {
    width: min(100%, 520px);
  }

  .dashboard-topline {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .logout-button {
    width: 100%;
  }

  .dashboard-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .dashboard-card {
    padding: 18px;
    border-radius: 16px;
  }

  .dashboard-content {
    padding-top: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-view {
    animation: none;
  }
}

/* =========================================================
   DASHBOARD: KALENDER + NOTIZ-EDITOR
   ========================================================= */
body.is-dashboard {
  overflow-y: auto;
}

body.is-dashboard .hero {
  place-items: start center;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: visible;
  padding-top: max(clamp(18px, 3vh, 36px), env(safe-area-inset-top));
  padding-bottom: max(clamp(26px, 4vh, 54px), env(safe-area-inset-bottom));
}

body.is-dashboard .landscape,
body.is-dashboard .leaf-layer,
body.is-dashboard .hero::before {
  position: fixed;
}

.dashboard-card {
  width: min(100%, 1240px);
  padding: clamp(18px, 2.6vw, 34px);
  margin: 0 auto;
}

.dashboard-subtitle {
  max-width: 680px;
  margin: 9px 0 0 !important;
  color: rgba(255, 255, 255, 0.72) !important;
  font-size: clamp(0.82rem, 0.78rem + 0.2vw, 0.94rem) !important;
  line-height: 1.5 !important;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(310px, 0.85fr);
  gap: clamp(16px, 2vw, 24px);
  padding-top: 24px;
  align-items: start;
}

.workspace-panel {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 19px;
  background: rgba(8, 10, 28, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.calendar-panel {
  padding: clamp(16px, 2vw, 24px);
}

.notes-panel {
  padding: clamp(16px, 2vw, 22px);
  position: sticky;
  top: 24px;
}

.panel-heading,
.day-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-heading h2,
.day-section-heading h3,
.form-heading h3 {
  margin: 0;
  color: #fff;
}

.panel-heading h2 {
  font-size: clamp(1.15rem, 1rem + 0.55vw, 1.5rem);
}

.day-section-heading h3,
.form-heading h3 {
  font-size: 1rem;
}

.panel-eyebrow {
  display: block;
  margin-bottom: 3px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dashboard-card .secondary-button,
.dashboard-card .icon-button,
.dashboard-card .editor-button,
.dashboard-card .text-button {
  box-shadow: none;
}

.dashboard-card .compact-button {
  width: auto;
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  font-size: 0.78rem;
}

.calendar-toolbar {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 10px;
  margin: 18px 0 12px;
}

.dashboard-card .icon-button {
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.7rem;
  line-height: 1;
}

.calendar-month {
  text-align: center;
  color: #fff;
  font-size: clamp(0.98rem, 0.9rem + 0.32vw, 1.16rem);
  text-transform: capitalize;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-weekdays {
  padding: 0 2px 7px;
}

.calendar-weekdays span {
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.7rem;
  font-weight: 700;
}

.calendar-day {
  position: relative;
  width: 100%;
  min-height: 86px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 5px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: none;
  color: #fff;
  text-align: left;
}

.calendar-day.empty {
  min-height: 86px;
  border-color: transparent;
  background: transparent;
  pointer-events: none;
}

.calendar-day:not(.empty):hover {
  transform: none;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
  filter: none;
}

.calendar-day.is-selected {
  border-color: rgba(255, 185, 106, 0.8);
  background: rgba(255, 159, 83, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 185, 106, 0.22);
}

.calendar-day.is-today .day-number {
  background: linear-gradient(90deg, var(--button-start), var(--button-end));
  color: #fff;
}

.day-number {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.76rem;
  font-weight: 700;
  flex: 0 0 auto;
}

.day-preview {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 3px 5px;
  border-radius: 5px;
  font-size: 0.61rem;
  font-weight: 600;
  line-height: 1.25;
}

.day-preview.appointment {
  background: rgba(255, 158, 83, 0.24);
  color: #ffe0bf;
}

.day-preview.task {
  background: rgba(151, 133, 215, 0.27);
  color: #e2dcff;
}

.day-preview.completed {
  opacity: 0.48;
  text-decoration: line-through;
}

.day-more {
  margin-top: auto;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.6rem;
  font-weight: 700;
}

.day-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.count-badge,
.save-status {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.68rem;
  font-weight: 700;
}

.save-status.is-saving {
  color: #ffdcad;
}

.day-items {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.empty-state {
  margin: 0;
  padding: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 11px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.8rem;
  text-align: center;
}

.day-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 11px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.055);
}

.item-type-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff9b57;
  box-shadow: 0 0 0 4px rgba(255, 155, 87, 0.1);
}

.day-item.task .item-type-dot {
  background: #a38dde;
  box-shadow: 0 0 0 4px rgba(163, 141, 222, 0.1);
}

.day-item.is-completed .item-title {
  opacity: 0.55;
  text-decoration: line-through;
}

.item-copy {
  min-width: 0;
}

.item-title-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}

.item-title {
  color: #fff;
  font-size: 0.84rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.item-time,
.item-kind {
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.68rem;
  font-weight: 600;
}

.item-details {
  margin: 3px 0 0 !important;
  color: rgba(255, 255, 255, 0.62) !important;
  font-size: 0.72rem !important;
  line-height: 1.4 !important;
  overflow-wrap: anywhere;
}

.item-actions {
  display: flex;
  gap: 6px;
}

.dashboard-card .item-action {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.82);
  box-shadow: none;
  font-size: 0.82rem;
}

.dashboard-card .item-action.delete:hover {
  background: rgba(255, 99, 99, 0.18);
}

.calendar-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  gap: 11px;
}

.form-heading p {
  margin: 3px 0 0 !important;
  color: rgba(255, 255, 255, 0.52) !important;
  font-size: 0.72rem !important;
}

.form-row {
  display: grid;
  gap: 7px;
}

.form-row.two-columns {
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.55fr);
  gap: 10px;
}

.form-row label,
.calendar-form > label {
  display: grid;
  gap: 6px;
  margin: 0;
  font-weight: 400;
}

.form-row label > span,
.calendar-form > label > span {
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.7rem;
  font-weight: 700;
}

.form-row small {
  font-weight: 500;
  opacity: 0.75;
}

.calendar-form input,
.calendar-form select,
.calendar-form textarea {
  width: 100%;
  min-width: 0;
  min-height: 43px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  outline: 0;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font: inherit;
  font-size: 16px;
}

.calendar-form input::placeholder,
.calendar-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

.calendar-form select option {
  color: #1f1930;
}

.calendar-form textarea {
  min-height: 68px;
  resize: vertical;
  line-height: 1.45;
}

.calendar-form input:focus,
.calendar-form select:focus,
.calendar-form textarea:focus {
  border-color: rgba(255, 185, 106, 0.7);
  box-shadow: 0 0 0 2px rgba(255, 185, 106, 0.12);
}

.dashboard-card .add-entry-button {
  min-height: 44px;
  margin-top: 2px;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: rgba(5, 7, 22, 0.24);
}

.dashboard-card .editor-button {
  width: auto;
  min-width: 36px;
  min-height: 34px;
  padding: 5px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.76rem;
}

.dashboard-card .editor-button:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.09);
  box-shadow: none;
  filter: none;
}

.notes-editor {
  min-height: 470px;
  max-height: 68vh;
  overflow-y: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 0 0 12px 12px;
  outline: none;
  background: rgba(255, 255, 255, 0.94);
  color: #2e2940;
  font-size: 0.94rem;
  line-height: 1.65;
  white-space: normal;
}

.notes-editor:focus {
  border-color: rgba(255, 185, 106, 0.74);
  box-shadow: inset 0 0 0 2px rgba(255, 185, 106, 0.12);
}

.notes-editor:empty::before {
  content: attr(data-placeholder);
  color: #8c8794;
  pointer-events: none;
}

.notes-editor p:first-child,
.notes-editor ul:first-child,
.notes-editor ol:first-child {
  margin-top: 0;
}

.notes-editor p:last-child,
.notes-editor ul:last-child,
.notes-editor ol:last-child {
  margin-bottom: 0;
}

.notes-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 9px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.66rem;
}

.dashboard-card .text-button {
  width: auto;
  min-height: 30px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: rgba(255, 214, 178, 0.78);
  font-size: 0.68rem;
}

.dashboard-card .text-button:hover {
  transform: none;
  box-shadow: none;
  filter: none;
  color: #ffd7b0;
}

@media (max-width: 980px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .notes-panel {
    position: static;
  }

  .notes-editor {
    min-height: 300px;
    max-height: 55vh;
  }
}

@media (max-width: 700px) {
  body.is-dashboard .hero {
    padding-inline: max(12px, env(safe-area-inset-left));
  }

  .dashboard-card {
    width: 100%;
  }

  .workspace-grid {
    padding-top: 18px;
  }

  .calendar-day,
  .calendar-day.empty {
    min-height: 64px;
    padding: 5px;
    border-radius: 9px;
  }

  .day-number {
    width: 23px;
    height: 23px;
    font-size: 0.7rem;
  }

  .day-preview {
    height: 6px;
    padding: 0;
    border-radius: 999px;
    color: transparent !important;
  }

  .day-preview.completed {
    opacity: 0.28;
  }

  .day-more {
    font-size: 0.55rem;
  }

  .form-row.two-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  .calendar-panel,
  .notes-panel {
    padding: 13px;
    border-radius: 15px;
  }

  .calendar-weekdays,
  .calendar-grid {
    gap: 4px;
  }

  .calendar-day,
  .calendar-day.empty {
    min-height: 54px;
  }

  .day-section-heading {
    align-items: flex-end;
  }

  .day-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .item-actions {
    grid-column: 2;
    justify-self: start;
  }

  .notes-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

.dashboard-card .empty-state {
  margin: 0;
}

.calendar-form {
  color-scheme: dark;
}

/* Server-Speicherstatus */
.server-save-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  margin-top: 8px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(20, 14, 39, 0.22);
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.78rem;
  font-weight: 700;
}

.server-save-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a8e6b0;
  box-shadow: 0 0 0 3px rgba(168, 230, 176, 0.12);
}

.server-save-status[data-state="saving"]::before {
  background: #ffd18a;
  box-shadow: 0 0 0 3px rgba(255, 209, 138, 0.12);
}

.server-save-status[data-state="error"]::before {
  background: #ff8b8b;
  box-shadow: 0 0 0 3px rgba(255, 139, 139, 0.12);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}
