@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&display=swap');

:root {
  --primary: #0d4f45;
  --secondary: #f0b429;
  --accent: #101827;
  --bg: #f5f6f8;
  --card: rgba(255, 255, 255, 0.58);
  --card-muted: rgba(255, 255, 255, 0.42);
  --input-bg: rgba(255, 255, 255, 0.75);
  --border: rgba(15, 23, 42, 0.12);
  --glass-border: rgba(255, 255, 255, 0.55);
  --glass-highlight: rgba(255, 255, 255, 0.8);
  --shadow: 0 20px 55px rgba(15, 23, 42, 0.16);
  --shadow-soft: 0 10px 26px rgba(15, 23, 42, 0.1);
  --table-head-bg: rgba(255, 255, 255, 0.55);
  --app-bg:
    radial-gradient(1200px 700px at 10% -10%, rgba(255, 255, 255, 0.95), transparent 60%),
    radial-gradient(900px 800px at 90% 0%, rgba(59, 130, 246, 0.18), transparent 55%),
    radial-gradient(1100px 800px at 50% 100%, rgba(16, 185, 129, 0.18), transparent 55%),
    linear-gradient(180deg, #f8fafc 0%, #eef2f6 100%);
  --header-bg: var(--primary);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Space Grotesk', 'SF Pro Display', 'SF Pro Text', sans-serif;
  color: var(--accent);
  background: var(--app-bg);
  background-attachment: fixed;
  letter-spacing: -0.01em;
  font-size: 15px;
  line-height: 1.55;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.app { min-height: 100vh; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 36px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--primary) !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: var(--shadow);
  color: #fff;
}

.brand { display: flex; gap: 16px; align-items: center; }

.logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.logo-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.2), transparent), var(--primary);
  color: #fff;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
}

.company { font-weight: 700; font-size: 22px; color: #fff; }
.subtitle { font-size: 14px; opacity: 0.85; color: rgba(255,255,255,0.9); }
.topbar .actions { color: #fff; }
.topbar .badge { border-color: rgba(255,255,255,0.3); }
.topbar .ghost {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
}
.topbar .ghost:hover { box-shadow: 0 8px 20px rgba(0,0,0,0.18); }

body[data-theme='dark'] .topbar {
  background: var(--primary) !important;
}

.actions { display: flex; align-items: center; gap: 12px; }

.badge {
  padding: 7px 14px;
  border-radius: 999px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.2)), var(--secondary);
  color: #2a2010;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.ghost {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--glass-border);
  padding: 10px 16px;
  border-radius: 14px;
  cursor: pointer;
  color: var(--accent);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.ghost:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

.ghost.big {
  padding: 14px 20px;
  font-size: 15px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 26px;
  padding: 32px 40px 90px;
}

.dashboard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quick-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  background: var(--card);
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.quick-button:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.stat-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--glass-border);
  background: var(--card);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
}

.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  margin: 6px 0 4px;
}

.stat-meta { font-size: 13px; opacity: 0.7; }
.stat-row { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; }

details.fold {
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  background: var(--card);
  padding: 10px 14px;
  box-shadow: var(--shadow-soft);
}

details.fold + details.fold { margin-top: 12px; }

details.fold summary {
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

details.fold summary::-webkit-details-marker { display: none; }

details.fold[open] summary { margin-bottom: 12px; }

.fold-content { display: grid; gap: 14px; }

.email-compact .callout { padding: 12px; border-radius: 14px; }
.email-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.45));
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
}

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

.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 18px;
}

.tab {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--card-muted);
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
}

.tab.active {
  background: var(--card);
  border-color: var(--primary);
  color: var(--primary);
}

.material-filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.ghost.small {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 12px;
}

.form-toggle.small {
  width: auto;
  justify-self: start;
  align-self: start;
  display: inline-flex;
}

.monitor-logout {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 2500;
}

.workshop-panel button,
.workshop-panel .ghost,
.workshop-panel .form-toggle {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 12px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.chat-panel {
  padding: 0;
}

.chat-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 560px;
  background: #f3f4f7;
  border-radius: 18px;
  overflow: hidden;
}

.chat-sidebar {
  border-right: 1px solid #e1e3ea;
  background: #f7f8fb;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-sidebar-header,
.chat-sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
}

.chat-title {
  font-size: 16px;
}

.chat-search input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d8dbe6;
  background: #fff;
}

.chat-room-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.chat-room-list li a,
.chat-room-list .room-item a {
  display: block;
  position: relative;
  padding: 10px 12px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid transparent;
}

.room-item a {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: center;
}

.chat-room-list li.active a {
  background: #fff;
  border-color: #dfe3ee;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  font-weight: 600;
}

.room-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e8ecff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #2a3a73;
}

.room-body {
  display: grid;
  gap: 4px;
}

.room-badge {
  background: #ff5a5a;
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  padding: 2px 8px;
  position: absolute;
  top: 10px;
  right: 10px;
}

.room-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 600;
}

.room-name {
  font-size: 14px;
}

.room-meta,
.room-time {
  font-size: 11px;
  color: rgba(0,0,0,0.5);
}

.room-preview {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(0,0,0,0.6);
  margin-top: 4px;
}

.room-preview .tag {
  font-size: 10px;
  padding: 2px 6px;
}

.chat-main {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 520px;
}

.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e1e3ea;
  background: #fff;
}

.chat-header-info {
  display: grid;
  gap: 4px;
}

.chat-room-name {
  font-size: 16px;
  font-weight: 600;
}

.chat-room-sub {
  font-size: 12px;
  color: rgba(0,0,0,0.55);
}

.chat-messages {
  padding: 16px 20px;
  overflow-y: auto;
  display: grid;
  gap: 12px;
  background: #f4f6fb;
}

.chat-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.chat-bubble.me {
  margin-left: auto;
  background: #e7f0ff;
  border: 1px solid #cfe0ff;
}

.chat-meta {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(0,0,0,0.5);
  margin-bottom: 4px;
}

.chat-text {
  font-size: 14px;
}

.chat-time {
  font-size: 11px;
  color: rgba(0,0,0,0.45);
  margin-top: 6px;
}

.chat-image {
  max-width: 100%;
  border-radius: 12px;
  margin-top: 8px;
}

.chat-file {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.7);
  border-radius: 10px;
}

.chat-input {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #e1e3ea;
  background: #fff;
}


/* Teams-style chat */
.teams-chat .teams-chat-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 620px;
  border-radius: 18px;
  overflow: hidden;
  background: #f2f3f8;
}

.teams-chat .teams-sidebar {
  background: #f7f8fc;
  border-right: 1px solid #e1e3ea;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.teams-chat .teams-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 15px;
}

.teams-chat .teams-search input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d8dbe6;
  background: #fff;
}

.teams-chat .teams-room-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.teams-chat .teams-room-item a {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  position: relative;
}

.teams-chat .teams-room-item.active a {
  background: #fff;
  border-color: #dfe3ee;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.teams-chat .teams-room-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e7ecff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #2a3a73;
}

.teams-chat .teams-room-body {
  display: grid;
  gap: 4px;
}

.teams-chat .teams-room-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.teams-chat .teams-room-name {
  font-size: 14px;
  font-weight: 600;
}

.teams-chat .teams-room-time {
  font-size: 11px;
  color: rgba(0,0,0,0.5);
}

.teams-chat .teams-room-preview {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(0,0,0,0.6);
}

.teams-chat .teams-room-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #ff5a5a;
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  padding: 2px 8px;
}

.teams-chat .teams-main {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 620px;
}

.teams-chat .teams-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e1e3ea;
  background: #fff;
}

.teams-chat .teams-header-title {
  font-size: 16px;
  font-weight: 700;
}

.teams-chat .teams-header-sub {
  font-size: 12px;
  color: rgba(0,0,0,0.5);
  margin-top: 2px;
}

.teams-chat .teams-messages {
  padding: 16px 20px;
  overflow-y: auto;
  background: #f4f6fb;
  display: grid;
  gap: 14px;
}

.teams-chat .teams-msg {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: start;
}

.teams-chat .teams-msg.me {
  grid-template-columns: 1fr 34px;
}

.teams-chat .teams-msg.me .teams-msg-avatar {
  order: 2;
}

.teams-chat .teams-msg.me .teams-msg-body {
  order: 1;
}

.teams-chat .teams-msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #dfe7ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #2a3a73;
  font-size: 12px;
}

.teams-chat .teams-msg-body {
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}

.teams-chat .teams-msg.me .teams-msg-body {
  background: #e7f0ff;
  border: 1px solid #cfe0ff;
}

.teams-chat .teams-msg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.teams-chat .teams-msg-name {
  font-weight: 600;
  font-size: 12px;
}

.teams-chat .teams-msg-time {
  font-size: 11px;
  color: rgba(0,0,0,0.5);
}

.teams-chat .teams-msg-text {
  font-size: 14px;
}

.teams-chat .teams-msg-image {
  max-width: 100%;
  border-radius: 10px;
  margin-top: 8px;
}

.teams-chat .teams-msg-file {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.7);
  border-radius: 10px;
}

.teams-chat .teams-input {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #e1e3ea;
  background: #fff;
}

.teams-chat .teams-input input[type=\"text\"] {
  background: #f9fafc;
}

.teams-chat .teams-attach {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #eef1f7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.teams-chat .teams-attach input {
  display: none;
}

@media (max-width: 900px) {
  .teams-chat .teams-chat-layout {
    grid-template-columns: 1fr;
  }
  .teams-chat .teams-sidebar {
    border-right: none;
    border-bottom: 1px solid #e1e3ea;
  }
}

.chat-input input[type="text"] {
  background: rgba(255,255,255,0.9);
}

.chat-attach {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255,255,255,0.7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.chat-attach input {
  display: none;
}

@media (max-width: 900px) {
  .chat-layout {
    grid-template-columns: 1fr;
  }
  .chat-sidebar {
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.2);
  }
}

.material-table-wrap {
  border-radius: 18px;
  border: 1px solid var(--glass-border);
  background: var(--card);
  overflow: auto;
  box-shadow: var(--shadow-soft);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table thead th {
  text-align: left;
  padding: 12px 14px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--table-head-bg);
  border-bottom: 1px solid var(--glass-border);
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--glass-border);
  vertical-align: top;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.45);
}

.data-table .tag {
  margin-top: 6px;
  display: inline-flex;
}

.row-active {
  background: rgba(16, 185, 129, 0.16);
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.calendar-view-toggle,
.calendar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ghost.toggle-active {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--shadow);
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 12px;
  font-size: 12px;
  opacity: 0.85;
}

.legend-item { display: inline-flex; align-items: center; gap: 6px; }

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  display: inline-block;
}

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

.calendar-grid.calendar-week .calendar-cell {
  min-height: 160px;
}

.calendar-head {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.6;
  text-align: center;
  padding-bottom: 6px;
}

.calendar-cell {
  min-height: 130px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid var(--glass-border);
  background: linear-gradient(160deg, rgba(255,255,255,0.75), rgba(255,255,255,0.35));
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calendar-cell.calendar-empty {
  background: transparent;
  border-style: dashed;
  box-shadow: none;
}

.calendar-cell.is-today {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.calendar-date {
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: var(--card-muted);
}

.calendar-events {
  display: grid;
  gap: 6px;
}

.calendar-event {
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #0f3d2e;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-more {
  font-size: 11px;
  opacity: 0.65;
}

.calendar-event.status-draft { background: rgba(148, 163, 184, 0.25); border-color: rgba(148, 163, 184, 0.45); color: #1f2937; }
.calendar-event.status-sent { background: rgba(59, 130, 246, 0.18); border-color: rgba(59, 130, 246, 0.4); color: #0f2f66; }
.calendar-event.status-packing { background: rgba(251, 191, 36, 0.22); border-color: rgba(251, 191, 36, 0.45); color: #5a3b0a; }
.calendar-event.status-packed { background: rgba(16, 185, 129, 0.2); border-color: rgba(16, 185, 129, 0.45); color: #0f3d2e; }
.calendar-event.status-unpacking { background: rgba(249, 115, 22, 0.2); border-color: rgba(249, 115, 22, 0.45); color: #6b2d05; }
.calendar-event.status-unpacked { background: rgba(148, 163, 184, 0.2); border-color: rgba(148, 163, 184, 0.45); color: #1f2937; }

.calendar-event.prio-2 { box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.4) inset; }
.calendar-event.prio-3 { box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.5) inset; }

.legend-dot.status-draft { background: rgba(148, 163, 184, 0.25); border-color: rgba(148, 163, 184, 0.45); }
.legend-dot.status-sent { background: rgba(59, 130, 246, 0.18); border-color: rgba(59, 130, 246, 0.4); }
.legend-dot.status-packing { background: rgba(251, 191, 36, 0.22); border-color: rgba(251, 191, 36, 0.45); }
.legend-dot.status-packed { background: rgba(16, 185, 129, 0.2); border-color: rgba(16, 185, 129, 0.45); }
.legend-dot.status-unpacking { background: rgba(249, 115, 22, 0.2); border-color: rgba(249, 115, 22, 0.45); }
.legend-dot.status-unpacked { background: rgba(148, 163, 184, 0.2); border-color: rgba(148, 163, 184, 0.45); }
.legend-dot.prio-2 { box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.7) inset; background: rgba(249, 115, 22, 0.25); border-color: rgba(249, 115, 22, 0.45); }
.legend-dot.prio-3 { box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.7) inset; background: rgba(239, 68, 68, 0.25); border-color: rgba(239, 68, 68, 0.45); }

.event-edit-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.event-edit-tab {
  border: 1px solid var(--glass-border);
  background: var(--card);
  color: var(--accent);
  padding: 8px 14px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.event-edit-tab.active {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--shadow);
}

.event-edit-panel {
  display: none;
}

.event-edit-panel.active {
  display: grid;
  gap: 12px;
}

.event-detail-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.event-detail-tab {
  border: 1px solid var(--glass-border);
  background: var(--card);
  color: var(--accent);
  padding: 8px 14px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.event-detail-tab.active {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--shadow);
}

.event-detail-panel {
  display: none;
}

.event-detail-panel.active {
  display: grid;
  gap: 14px;
}

h2 { margin: 0 0 16px 0; font-size: 20px; }

.form { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }

input[type='text'],
input[type='email'],
input[type='password'],
input[type='number'],
input[type='date'],
textarea {
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  font-family: inherit;
  background: var(--input-bg);
  color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  resize: vertical;
  font-size: 14px;
}

select {
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  font-family: inherit;
  background: var(--input-bg);
  color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  font-size: 14px;
}

input[type='color'] {
  width: 100%;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px;
  background: var(--card);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(13, 79, 69, 0.35);
  outline-offset: 2px;
  border-color: transparent;
  box-shadow: 0 0 0 4px rgba(13, 79, 69, 0.12);
}

button {
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.1)), var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(13, 79, 69, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

button.small {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 10px;
  width: auto;
  justify-self: start;
}

button:hover { transform: translateY(-1px); filter: brightness(1.03); }
button:active { transform: translateY(0); }

.list { list-style: none; padding-left: 0; margin: 0; display: grid; gap: 6px; }
.list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  opacity: 0.7;
  margin-top: 8px;
}

.divider { height: 1px; background: var(--border); margin: 18px 0; }

.list-block { margin-top: 12px; }

.muted { font-size: 12px; opacity: 0.6; }
.tag-sla-ok { background: rgba(16, 185, 129, 0.18); border-color: rgba(16, 185, 129, 0.4); color: #0f3d2e; }
.tag-sla-warn { background: rgba(251, 191, 36, 0.2); border-color: rgba(251, 191, 36, 0.45); color: #5a3b0a; }
.tag-sla-bad { background: rgba(239, 68, 68, 0.2); border-color: rgba(239, 68, 68, 0.45); color: #5a1111; }
.plate {
  display: inline-flex;
  align-items: center;
  border: 1px solid #0f172a;
  border-radius: 6px;
  background: #ffffff;
  color: #0f172a;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.1);
}
.plate-eu {
  background: #0b4ea2;
  color: #fff;
  font-weight: 700;
  font-size: 10px;
  padding: 3px 6px;
}
.plate-text {
  padding: 3px 8px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(17, 24, 39, 0.85);
  color: #fff;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: min(520px, 90vw);
}

.toast[data-error='true'] { background: #7f1d1d; }

.toast-text {
  line-height: 1.4;
}

.toast-close {
  border: none;
  background: rgba(255,255,255,0.2);
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  padding: 0;
}

.actions-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.actions-row > * { margin: 0; }
.actions-row form { margin: 0; }

.user-card {
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 18px;
  background: var(--card);
  display: grid;
  gap: 12px;
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: var(--shadow-soft);
}

.user-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.user-name { font-weight: 700; }

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

.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.perm-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  background: var(--card);
  cursor: pointer;
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: var(--shadow-soft);
}

.perm-card.active { border-color: var(--primary); box-shadow: 0 0 0 1px rgba(13, 79, 69, 0.2); }

.perm-card input { margin-top: 3px; }
.perm-title { font-weight: 600; font-size: 14px; }

.chat-box {
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 14px;
  background: var(--card-muted);
  max-height: 220px;
  overflow: auto;
  display: grid;
  gap: 6px;
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
}

.chat-line { font-size: 14px; }

.callout {
  padding: 14px;
  border-radius: 16px;
  background: var(--card-muted);
  border: 1px solid var(--glass-border);
  font-size: 14px;
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
}

.callout.warn {
  background: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}

.step-list {
  display: grid;
  gap: 8px;
  font-size: 14px;
}

.big-button {
  padding: 14px 20px;
  font-size: 15px;
}

.form-collapsible {
  display: grid;
  gap: 10px;
  align-content: start;
}

.form-collapsible .form-toggle {
  justify-content: center;
  width: 100%;
}

.form-collapsible-body {
  display: none;
}

.form-collapsible.open .form-collapsible-body {
  display: block;
}

.modal-hidden { display: none; }
.is-hidden { display: none !important; }
.filter-chips { flex-wrap: wrap; gap: 8px; }
.chip {
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.85rem;
  color: #0f172a;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.chip.active {
  border-color: rgba(13, 79, 69, 0.5);
  box-shadow: var(--shadow);
}
.cell-edit { display: none; }
.row-editing .cell-view { display: none; }
.row-editing .cell-edit { display: inline-block; }
.row-editing .cell-edit.actions-row { display: inline-flex; }
.cell-edit.actions-row { display: none; gap: 6px; flex-wrap: wrap; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 25, 0.45);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 2000;
}

.modal-overlay.open { display: flex; }

.modal-window {
  width: min(980px, 92vw);
  max-height: 90vh;
  background: var(--card);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--glass-border);
  background: linear-gradient(180deg, rgba(255,255,255,0.65), rgba(255,255,255,0.4));
}

.modal-title { font-weight: 700; font-size: 16px; }

.modal-body {
  padding: 18px 20px 26px;
  overflow: auto;
  display: grid;
  gap: 16px;
}

body[data-theme='dark'] {
  --bg: #0b0f17;
  --card: rgba(17, 25, 40, 0.68);
  --card-muted: rgba(17, 25, 40, 0.5);
  --input-bg: rgba(17, 25, 40, 0.8);
  --border: rgba(148, 163, 184, 0.22);
  --glass-border: rgba(148, 163, 184, 0.22);
  --accent: #f9fafb;
  --shadow: 0 28px 70px rgba(2, 6, 23, 0.7);
  --shadow-soft: 0 14px 30px rgba(2, 6, 23, 0.45);
  --table-head-bg: rgba(15, 23, 42, 0.6);
  --app-bg:
    radial-gradient(1000px 700px at 10% -10%, rgba(30, 41, 59, 0.8), transparent 60%),
    radial-gradient(900px 700px at 90% 0%, rgba(30, 64, 175, 0.25), transparent 55%),
    radial-gradient(1000px 700px at 50% 100%, rgba(16, 185, 129, 0.2), transparent 55%),
    linear-gradient(180deg, #0b1120 0%, #020617 100%);
  --header-bg: var(--primary);
}

body[data-theme='dark'] .badge { color: #1f2937; }
body[data-theme='dark'] .calendar-cell {
  background: linear-gradient(160deg, rgba(17,25,40,0.85), rgba(17,25,40,0.55));
}
body[data-theme='dark'] .calendar-cell.calendar-empty {
  background: transparent;
}
body[data-theme='dark'] .calendar-date {
  background: rgba(30, 41, 59, 0.7);
}

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