:root {
  --bg: linear-gradient(180deg, #eef4ff 0%, #f9fbff 40%, #f5f7fb 100%);
  --glass: rgba(255,255,255,0.72);
  --glass-border: rgba(255,255,255,0.65);
  --shadow: 0 24px 60px rgba(18, 38, 63, 0.12);
  --text: #172031;
  --muted: #5e6b84;
  --accent: #2c6bed;
  --danger: #d94d4d;
  --success: #2e9e6f;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.field-error {
  margin-top: 6px;
  color: #c62828;
  font-size: 0.9rem;
}

.field-hint {
  margin-top: 6px;
  color: #666;
  font-size: 0.9rem;
}

.btn[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-link {
  background: transparent;
  border: 0;
  color: #2563eb;
  padding: 0;
  margin-top: 12px;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
  gap: 20px;
  padding: 20px;
}

.glass {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}

.sidebar {
  border-radius: 28px;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 22px;
}

.brand-badge {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #2c6bed, #709df6);
  color: white;
  font-weight: 700;
}

.brand h1, .section-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.brand p, .section-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .92rem;
}

.nav-item {
  display: block;
  padding: 12px 14px;
  border-radius: 16px;
  color: var(--muted);
  margin-bottom: 8px;
  transition: .2s ease;
}

.nav-item:hover, .nav-item.active {
  background: rgba(255,255,255,0.88);
  color: var(--text);
}

.sidebar-footer {
  margin-top: auto;
}

.user-card {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.7);
}

.content {
  padding-right: 6px;
}

.stack {
  display: grid;
  gap: 18px;
}

.page-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 18px;
}

.section-card {
  border-radius: 28px;
  padding: 20px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.section-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.input, textarea, input[type="file"], select {
  width: 100%;
  border: 1px solid rgba(148, 164, 186, 0.3);
  background: rgba(255,255,255,.8);
  border-radius: 16px;
  padding: 12px 14px;
  color: var(--text);
}

.textarea {
  min-height: 110px;
  resize: vertical;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid label span {
  display: block;
  margin-bottom: 6px;
  font-size: .9rem;
  color: var(--muted);
}

.btn, .mini-btn {
  border: none;
  cursor: pointer;
  border-radius: 16px;
  padding: 12px 16px;
  background: var(--accent);
  color: white;
  font-weight: 600;
}

.btn.secondary, .mini-btn {
  background: rgba(255,255,255,0.9);
  color: var(--text);
  border: 1px solid rgba(148,164,186,.25);
}

.mini-btn {
  padding: 8px 10px;
}

.mini-btn.danger {
  color: var(--danger);
}

.table-wrap {
  overflow: auto;
  border-radius: 20px;
  border: 1px solid rgba(148,164,186,.2);
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255,255,255,.75);
}

.table th, .table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148,164,186,.16);
  font-size: .95rem;
  vertical-align: top;
}

.table tbody tr:hover {
  background: rgba(255,255,255,.95);
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.alert {
  padding: 12px 14px;
  border-radius: 16px;
  margin-bottom: 12px;
}

.alert.error {
  background: rgba(217,77,77,.12);
  color: #7f2630;
}

.alert.success {
  background: rgba(46,158,111,.14);
  color: #176542;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 14px;
}

.stat-card {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255,255,255,0.85);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-card span {
  color: var(--muted);
}

.stat-card strong {
  font-size: 1.8rem;
}

.search {
  min-width: 240px;
}

.login-wrapper {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: min(460px, 100%);
  padding: 28px;
  border-radius: 28px;
  background: rgba(255,255,255,.8);
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: var(--shadow);
}

.security-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.pane {
  padding: 18px;
  border-radius: 24px;
}

.bullet-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.qr {
  width: 180px;
  margin: 14px 0;
  border-radius: 18px;
}

code {
  display: inline-block;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,.85);
}

@media (max-width: 1100px) {
  .app-shell, .page-grid, .security-grid, .stats-grid { grid-template-columns: 1fr; }
}

.calendar-page-grid { grid-template-columns: 1.7fr 1fr; }
.calendar-toolbar { display: grid; gap: 14px; margin-bottom: 16px; }
.calendar-toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.calendar-view-switch { display: flex; gap: 8px; flex-wrap: wrap; }
.calendar-view-switch .mini-btn.active { background: var(--accent); color: white; }
.calendar-filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.calendar-grid { display: grid; gap: 10px; }
.calendar-grid.month { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-grid.week { grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: start; }
.calendar-grid-head { font-size: .88rem; color: var(--muted); text-transform: uppercase; padding: 0 6px; }
.calendar-day-cell, .calendar-week-column { border: 1px solid rgba(148,164,186,.22); background: rgba(255,255,255,.78); border-radius: 18px; min-height: 150px; padding: 10px; text-align: left; }
.calendar-day-cell.muted { opacity: 0.55; }
.calendar-day-cell.selected, .calendar-week-column.selected, .calendar-detail-item.selected { outline: 2px solid rgba(44,107,237,.4); }
.calendar-day-header { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 10px; }
.calendar-day-header.large { align-items: start; flex-direction: column; }
.calendar-event-stack { display: grid; gap: 6px; }
.calendar-badge { display: block; border-radius: 12px; padding: 7px 9px; font-size: .84rem; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.calendar-badge.calendar { background: rgba(44,107,237,.12); color: #1d4fd8; }
.calendar-badge.meeting { background: rgba(46,158,111,.14); color: #176542; }
.calendar-badge.deadline { background: rgba(217,77,77,.12); color: #8a2332; }
.calendar-badge.task { background: rgba(255,172,51,.18); color: #8a4f00; }
.calendar-more { font-size: .82rem; color: var(--muted); padding: 0 2px; }
.calendar-detail-list { display: grid; gap: 8px; }
.calendar-detail-item { display: flex; justify-content: space-between; gap: 12px; text-align: left; border: 1px solid rgba(148,164,186,.2); background: rgba(255,255,255,.78); border-radius: 16px; padding: 12px 14px; }

@media (max-width: 1300px) {
  .calendar-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  .calendar-page-grid { grid-template-columns: 1fr; }
  .calendar-grid.month, .calendar-grid.week { grid-template-columns: 1fr; }
}

/* Modernes Layout passend zum neuen Mockup */
.app-shell-modern {
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 20px;
  padding: 20px;
  background:
    radial-gradient(circle at top left, rgba(44, 107, 237, 0.06), transparent 30%),
    linear-gradient(180deg, #f3f6fb 0%, #f7f9fc 100%);
}

.sidebar-modern {
  border-radius: 24px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.08);
}

.brand-modern {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  padding: 4px 4px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.brand-logo {
  width: 58px;
  height: auto;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand-copy {
  min-width: 0;
  flex: 1;
}

.brand-copy h1 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.brand-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.sidebar-groups {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-group {
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.55);
}

.sidebar-group.standalone {
  padding: 6px;
}

.sidebar-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  background: transparent;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.98rem;
  text-align: left;
}

.sidebar-group-toggle:hover {
  background: rgba(15, 23, 42, 0.04);
}

.sidebar-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: rotate(180deg);
  transition: transform 0.18s ease;
  opacity: 0.65;
}

.sidebar-chevron.open {
  transform: rotate(0deg);
}

.sidebar-links {
  display: grid;
  gap: 6px;
  padding: 0 8px 10px;
}

.sidebar-group.standalone .sidebar-links {
  padding: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 12px;
  color: #334155;
  font-weight: 500;
  transition: background 0.16s ease, color 0.16s ease;
}

.sidebar-link:hover {
  background: rgba(15, 23, 42, 0.05);
  color: var(--text);
}

.sidebar-link.active {
  background: rgba(37, 99, 235, 0.11);
  color: #1d4ed8;
  font-weight: 700;
}

.user-card-modern {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: 14px;
}

.content-modern {
  min-width: 0;
}

.app-topbar {
  display: none;
}

.menu-btn,
.sidebar-close-btn {
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 700;
}

.sidebar-close-btn {
  display: none;
}

.sidebar-backdrop {
  display: none;
}

.mobile-brand-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-brand-logo {
  width: 28px;
  height: auto;
}

.dashboard-stack {
  gap: 20px;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.dashboard-kpi-card {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 120px;
  padding: 20px;
  border-radius: 24px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(148,164,186,.14);
}

.dashboard-kpi-icon {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  background: rgba(37,99,235,.08);
  flex: 0 0 auto;
}

.dashboard-kpi-content {
  display: grid;
  gap: 4px;
}

.dashboard-kpi-content span {
  color: var(--muted);
  font-size: 0.95rem;
}

.dashboard-kpi-content strong {
  font-size: 2rem;
  line-height: 1;
}

.dashboard-kpi-content small {
  color: #2563eb;
  font-size: 0.92rem;
}

.tone-green .dashboard-kpi-icon { background: rgba(34,197,94,.12); }
.tone-purple .dashboard-kpi-icon { background: rgba(168,85,247,.12); }
.tone-amber .dashboard-kpi-icon { background: rgba(245,158,11,.12); }

.dashboard-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.dashboard-list {
  display: grid;
  gap: 10px;
}

.dashboard-list-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(148,164,186,.18);
}

.dashboard-date-box {
  display: grid;
  place-items: center;
  min-height: 64px;
  border-radius: 14px;
  background: rgba(15,23,42,0.04);
  text-align: center;
}

.dashboard-date-box strong {
  font-size: 1rem;
}

.dashboard-date-box span {
  font-size: 0.8rem;
  color: var(--muted);
}

.dashboard-list-main {
  min-width: 0;
}

.dashboard-table td strong {
  display: block;
}

.dashboard-notification-list {
  display: grid;
  gap: 10px;
}

.dashboard-notification-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(148,164,186,.16);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  background: rgba(148,163,184,.14);
  color: #475569;
  white-space: nowrap;
}

.status-geplant,
.status-neu,
.status-offen,
.status-gestartet {
  background: rgba(37,99,235,.12);
  color: #1d4ed8;
}

.status-in_bearbeitung,
.status-rueckfrage,
.status-ungeplant {
  background: rgba(245,158,11,.18);
  color: #9a5b00;
}

.status-abgeschlossen,
.status-beendet {
  background: rgba(34,197,94,.14);
  color: #15803d;
}

.status-neutral {
  background: rgba(148,163,184,.14);
  color: #475569;
}

@media (max-width: 1280px) {
  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .app-shell-modern {
    grid-template-columns: 1fr;
    padding: 0;
    gap: 0;
  }

  .sidebar-modern {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(320px, 88vw);
    height: 100vh;
    border-radius: 0 22px 22px 0;
    transform: translateX(-100%);
    transition: transform 0.24s ease;
    z-index: 40;
    overflow: auto;
  }

  .sidebar-modern.open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 35;
  }

  .app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    position: sticky;
    top: 0;
    z-index: 25;
  }

  .sidebar-close-btn {
    display: inline-flex;
    margin-left: auto;
  }

  .content-modern {
    padding: 14px;
  }

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

.deadline-datepicker-textfield .ms-TextField-fieldGroup {
  background: rgba(255, 255, 255, 0.96) !important;
  border: 1px solid rgba(148, 163, 184, 0.35) !important;
  border-radius: 10px !important;
  min-height: 40px !important;
  box-shadow: none !important;
}

.deadline-datepicker-textfield .ms-TextField-field {
  background: #ffffff !important;
  color: #0f172a !important;
}

.deadline-datepicker-textfield .ms-TextField-field::placeholder {
  color: #64748b !important;
  opacity: 1 !important;
}

@media (max-width: 760px) {
  .dashboard-kpi-grid {
    grid-template-columns: 1fr;
  }

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

  .dashboard-notification-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

.glass-panel,
.glass-modal,
.glass-surface {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.18);
  border-radius: 20px;
}

.glass-section {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
  border-radius: 18px;
}

.page-glass {
  min-height: 100%;
}

.page-glass .table-wrap,
.page-glass .pane,
.page-glass .stack > *,
.page-glass .page-grid > *,
.page-glass .section-card,
.page-glass .glass,
.page-glass .glass-card {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.10);
  border-radius: 18px;
}
