/* ============================================================
   MKI Admin Dashboard Styles – Apple.com Design System
   Basis-Layout: Sidebar, Topbar, Pages, Komponenten
   ============================================================ */

/* ── Layout ─────────────────────────────────────────────── */
.admin-body {
  display: flex;
  min-height: 100vh;
  background: #f5f5f7;
  /* Kein overflow hier – würde position:fixed (Sidebar) in Safari/WebKit brechen */
  height: auto;
}

/* ── Sidebar – Mac-Stil ─────────────────────────────────── */
.sidebar {
  width: 260px;
  min-height: 100vh;
  background: #f6f6f6;
  border-right: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 200;
  transition: width 0.3s ease, transform 0.3s ease;
  overflow-x: hidden;
}
.sidebar.collapsed { width: 64px; }
.sidebar.collapsed .sidebar-item span,
.sidebar.collapsed .sidebar-badge,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .sidebar-logo > div:last-child,
.sidebar.collapsed .user-info,
.sidebar.collapsed .sidebar-mai-status span { display: none; }
.sidebar.collapsed .sidebar-collapse i { transform: rotate(180deg); }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  min-width: 0;
}
.sidebar-logo-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 122, 255, 0.08);
  border: 1px solid rgba(0, 122, 255, 0.15);
  position: relative;
  flex-shrink: 0;
}
.sidebar-logo-icon canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sidebar-collapse {
  width: 26px; height: 26px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.10);
  display: flex; align-items: center; justify-content: center;
  color: #86868b;
  font-size: 11px;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.sidebar-collapse:hover { color: #1d1d1f; background: rgba(0, 0, 0, 0.04); }
.sidebar-collapse i { transition: transform 0.3s; }

.sidebar-mai-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin: 8px 10px;
  background: rgba(52, 199, 89, 0.10);
  border: 1px solid rgba(52, 199, 89, 0.25);
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 500;
  color: #1d8348;
  overflow: hidden;
}
.mai-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #34c759;
  flex-shrink: 0;
  animation: pulse-dot 2s ease-in-out infinite;
}
.mai-status-badge {
  margin-left: auto;
  background: rgba(52, 199, 89, 0.15);
  border: 1px solid rgba(52, 199, 89, 0.30);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 9px;
  letter-spacing: 1px;
  color: #1d8348;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #c7c7cc;
  padding: 14px 20px 5px;
  white-space: nowrap;
}
.sidebar-nav ul { padding: 0; }
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  margin: 2px 8px;
  border-radius: 8px;
  color: #1d1d1f;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  position: relative;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}
.sidebar-item i {
  font-size: 14px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  color: #86868b;
  transition: color 0.15s;
}
.sidebar-item:hover {
  color: #1d1d1f;
  background: rgba(0, 0, 0, 0.04);
}
.sidebar-item:hover i { color: #6e6e73; }
.sidebar-item.active {
  color: #007aff;
  background: rgba(0, 122, 255, 0.08);
  font-weight: 600;
}
.sidebar-item.active i { color: #007aff; }
.sidebar-item.active::before { display: none; }
.sidebar-badge {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 9999px;
  background: rgba(0, 122, 255, 0.08);
  color: #007aff;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1.4;
  min-width: unset;
  height: auto;
}
.sidebar-badge.danger { background: rgba(215, 0, 21, 0.08); color: #d70015; }
.sidebar-badge.violet { background: rgba(94, 92, 230, 0.08); color: #5e5ce6; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
  overflow: hidden;
}
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(0, 122, 255, 0.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #007aff;
  flex-shrink: 0;
  border: none;
}
.user-info { flex: 1; min-width: 0; }
.user-name { display: block; font-size: 13px; font-weight: 600; color: #1d1d1f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { display: block; font-size: 11px; color: #86868b; }

/* ── Main area ───────────────────────────────────────────── */
.admin-main {
  flex: 1;
  margin-left: 260px;
  min-width: 0;
  display: block;
  transition: margin-left 0.3s;
  overflow-x: hidden;
  overflow-y: auto;             /* scrollt wenn Inhalt > Viewport */
  height: 100vh;                /* feste Höhe damit overflow-y greift */
  -webkit-overflow-scrolling: touch;
}
.admin-main.sidebar-collapsed { margin-left: 64px; }
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .admin-main { margin-left: 0 !important; }
}

/* ── Topbar – apple.com Glassmorphismus ─────────────────── */
.topbar {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-menu-btn {
  display: none;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: #f5f5f7;
  align-items: center;
  justify-content: center;
  color: #6e6e73;
  font-size: 15px;
}
@media (max-width: 900px) { .topbar-menu-btn { display: flex; } }
.breadcrumb { font-size: 15px; font-weight: 600; color: #1d1d1f; letter-spacing: -0.01em; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 0 12px;
  height: 34px;
  width: 260px;
  transition: border-color 0.15s, box-shadow 0.15s, width 0.25s ease;
}
.topbar-search:focus-within {
  background: #ffffff;
  border-color: #007aff;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
  width: 320px;
}
.topbar-search i { color: #86868b; font-size: 12px; }
.topbar-search input {
  flex: 1;
  font-size: 13px;
  color: #1d1d1f;
  background: none;
  border: none;
  outline: none;
}
.topbar-search input::placeholder { color: #c7c7cc; }
.topbar-search kbd {
  font-size: 10px;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.10);
  border-radius: 4px;
  color: #86868b;
  font-family: inherit;
}
@media (max-width: 640px) {
  .topbar-search { width: 160px; }
  .topbar-search:focus-within { width: 200px; }
}
.topbar-icon-btn {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  display: flex; align-items: center; justify-content: center;
  color: #6e6e73;
  font-size: 14px;
  position: relative;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.topbar-icon-btn:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #1d1d1f;
  border-color: rgba(0, 0, 0, 0.08);
}
.topbar-mai-dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #34c759;
  animation: pulse-dot 2s infinite;
}
.topbar-notif-dot {
  position: absolute;
  top: 5px; right: 5px;
  min-width: 14px; height: 14px;
  border-radius: 9999px;
  background: #d70015;
  font-size: 8px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  color: #ffffff;
}

/* ── Pages ──────────────────────────────────────────────── */
.page-container { padding: 24px 28px; overflow-x: hidden; }
.page { display: none; }
.page.active { display: block; }
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  flex-wrap: wrap;
  gap: 16px;
}
.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1d1d1f;
}
.page-header .wave { font-style: normal; }
.page-sub    { font-size: 13.5px; color: #6e6e73; margin-top: 2px; }
.page-title  { font-size: 22px; font-weight: 700; color: #1d1d1f; letter-spacing: -0.02em; }
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ── KPI cards ──────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .kpi-grid { grid-template-columns: 1fr; } }
.kpi-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border: none;
  transition: box-shadow 0.25s ease;
}
.kpi-card:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04); transform: none; }
.kpi-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  margin-bottom: 12px;
}
.kpi-icon.blue   { background: rgba(0, 122, 255, 0.10);  color: #007aff; }
.kpi-icon.indigo { background: rgba(94, 92, 230, 0.10);  color: #5e5ce6; }
.kpi-icon.red    { background: rgba(215, 0, 21, 0.10);   color: #d70015; }
.kpi-icon.gold   { background: rgba(245, 99, 0, 0.10);   color: #c97300; }
.kpi-data { flex: none; width: 100%; }
.kpi-value { display: block; font-size: 26px; font-weight: 700; line-height: 1; color: #1d1d1f; letter-spacing: -0.03em; }
.kpi-label { display: block; font-size: 12px; color: #6e6e73; margin-top: 4px; font-weight: 500; }
.kpi-trend { font-size: 11px; font-weight: 500; margin-top: 8px; color: #86868b; }
.kpi-trend.positive { color: #1d8348; }
.kpi-trend.danger   { color: #d70015; }
.kpi-trend i { margin-right: 4px; }

/* ── Dashboard grid ─────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } }
.dashboard-card { height: 100%; border-radius: 12px; }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.card-header h3 { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; color: #1d1d1f; }
.card-header h3 i { color: #86868b; }

/* ── Card base – apple.com Radius ───────────────────────── */
.card {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border: none;
  overflow: hidden;
  transition: box-shadow 0.25s ease;
}
.card:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04); }
.card-pad { padding: 24px; }
.card-title {
  font-size: 14px;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

/* ── Client list items ──────────────────────────────────── */
.client-list { display: flex; flex-direction: column; gap: 8px; }
.client-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.client-list-item:hover {
  border-color: rgba(0, 0, 0, 0.10);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
.client-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(0, 122, 255, 0.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #007aff;
  flex-shrink: 0;
}
.client-info { flex: 1; min-width: 0; }
.client-name { font-size: 13px; font-weight: 600; color: #1d1d1f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-meta { font-size: 11.5px; color: #6e6e73; margin-top: 1px; }

/* ── Deadlines list ─────────────────────────────────────── */
.deadlines-list { display: flex; flex-direction: column; gap: 6px; }
.deadline-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #ffffff;
  transition: border-color 0.15s;
}
.deadline-item:hover    { border-color: rgba(0, 0, 0, 0.10); }
.deadline-item.critical { border-color: rgba(215, 0, 21, 0.20); background: rgba(215, 0, 21, 0.03); }
.deadline-item.warning  { border-color: rgba(245, 99, 0, 0.25); background: rgba(245, 99, 0, 0.03); }
.deadline-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.deadline-dot.critical { background: #d70015; box-shadow: none; }
.deadline-dot.warning  { background: #f56300; }
.deadline-dot.normal   { background: #007aff; }
.deadline-dot.done     { background: #34c759; }
.deadline-info { flex: 1; min-width: 0; }
.deadline-title  { font-size: 12.5px; font-weight: 500; color: #1d1d1f; }
.deadline-client { font-size: 11px; color: #6e6e73; }
.deadline-days   { font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.deadline-days.critical { color: #d70015; }
.deadline-days.warning  { color: #b24400; }
.deadline-days.normal   { color: #007aff; }

/* ── MAI Insights ───────────────────────────────────────── */
.mai-insights-list { display: flex; flex-direction: column; gap: 8px; }
.mai-insight-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f5f5f7;
  border: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 13.5px;
}
.mai-insight-item i { color: #007aff; margin-top: 2px; flex-shrink: 0; font-size: 14px; }
.mai-insight-item .insight-text   { color: #1d1d1f; line-height: 1.5; }
.mai-insight-item .insight-action {
  display: inline-block;
  margin-top: 6px;
  color: #007aff;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.mai-insight-item .insight-action:hover { text-decoration: underline; }

/* ── Projects overview ──────────────────────────────────── */
.project-progress-item { margin-bottom: 12px; }
.project-progress-header { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 6px; }
.project-progress-header span:first-child { font-weight: 600; color: #1d1d1f; }
.project-progress-header span:last-child  { color: #6e6e73; font-size: 12px; }
.progress-bar { height: 4px; background: rgba(0, 0, 0, 0.08); border-radius: 9999px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 9999px; background: #007aff; transition: width 1s ease; }
.progress-fill.gold    { background: #f56300; }
.progress-fill.success { background: #34c759; }
.progress-bar-fill { height: 100%; border-radius: 9999px; background: #007aff; }

/* ── Table toolbar ──────────────────────────────────────── */
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.10);
  border-radius: 10px;
  padding: 0 12px;
  height: 34px;
  flex: 1;
  min-width: 200px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-box:focus-within {
  border-color: #007aff;
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12);
}
.search-box i     { color: #86868b; font-size: 13px; }
.search-box input { flex: 1; font-size: 13px; background: none; color: #1d1d1f; }
.search-box input::placeholder { color: #c7c7cc; }
.toolbar-filters { display: flex; gap: 8px; }

/* ── Kanban board ───────────────────────────────────────── */
.kanban-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1200px) { .kanban-board { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .kanban-board { grid-template-columns: 1fr; } }
.kanban-col {
  background: #f5f5f7;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 16px;
}
.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.kanban-col-title { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; color: #1d1d1f; }
.kanban-col-count {
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  color: #6e6e73;
  font-weight: 600;
}
.kanban-cards { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.kanban-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.kanban-card:hover {
  border-color: rgba(0, 0, 0, 0.10);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transform: none;
}
.kanban-card-title  { font-size: 13px; font-weight: 500; margin-bottom: 6px; color: #1d1d1f; }
.kanban-card-meta   { font-size: 11.5px; color: #6e6e73; margin-bottom: 8px; }
.kanban-card-footer { display: flex; align-items: center; justify-content: space-between; }
.priority-dot { width: 8px; height: 8px; border-radius: 50%; }
.priority-dot.critical { background: #d70015; }
.priority-dot.high     { background: #f56300; }
.priority-dot.normal   { background: #007aff; }

/* ── Document manager ───────────────────────────────────── */
.docs-layout { display: grid; grid-template-columns: 260px 1fr; gap: 20px; }
@media (max-width: 900px) { .docs-layout { grid-template-columns: 1fr; } }
.docs-sidebar-panel {
  padding: 16px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
}
.docs-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f5f5f7;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 16px;
  font-size: 13px;
  transition: border-color 0.15s;
}
.docs-search:focus-within { border-color: #007aff; }
.docs-search i { color: #86868b; }
.docs-search input { flex: 1; background: none; color: #1d1d1f; }
.docs-search input::placeholder { color: #c7c7cc; }
.folder-tree { display: flex; flex-direction: column; gap: 2px; }
.folder-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  color: #6e6e73;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.folder-item:hover  { color: #1d1d1f; background: #f5f5f7; }
.folder-item.active { color: #007aff; background: rgba(0, 122, 255, 0.08); font-weight: 600; }
.folder-item i { width: 16px; text-align: center; flex-shrink: 0; }
.docs-breadcrumb { font-size: 13px; color: #6e6e73; margin-bottom: 16px; display: flex; align-items: center; gap: 6px; }
.docs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.doc-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.doc-card:hover {
  border-color: rgba(0, 0, 0, 0.10);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transform: none;
}
.doc-icon { font-size: 28px; margin-bottom: 10px; }
.doc-icon.pdf    { color: #d70015; }
.doc-icon.word   { color: #007aff; }
.doc-icon.xlsx   { color: #34c759; }
.doc-icon.img    { color: #f56300; }
.doc-icon.folder { color: #c97300; }
.doc-name { font-size: 12px; font-weight: 500; color: #1d1d1f; word-break: break-word; margin-bottom: 4px; }
.doc-size { font-size: 10px; color: #86868b; }

/* ── Deadlines full list ────────────────────────────────── */
.deadlines-grid { display: grid; grid-template-columns: 1fr 280px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .deadlines-grid { grid-template-columns: 1fr; } }
.deadline-filter-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tab-btn {
  padding: 6px 16px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid rgba(0, 0, 0, 0.10);
  color: #6e6e73;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.tab-btn.active {
  color: #007aff;
  border-color: rgba(0, 122, 255, 0.30);
  background: rgba(0, 122, 255, 0.08);
}
.tab-btn:hover:not(.active) {
  color: #1d1d1f;
  background: rgba(0, 0, 0, 0.03);
}
.tab-dot { width: 7px; height: 7px; border-radius: 50%; }
.tab-dot.red    { background: #d70015; }
.tab-dot.orange { background: #f56300; }
.tab-dot.blue   { background: #007aff; }
.tab-dot.green  { background: #34c759; }
.deadline-full-item {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color 0.15s;
}
.deadline-full-item:hover { border-color: rgba(0, 0, 0, 0.10); }
.deadline-full-item.critical { border-left: 3px solid #d70015; }
.deadline-full-item.warning  { border-left: 3px solid #f56300; }
.deadline-full-item.normal   { border-left: 3px solid #007aff; }
.deadline-full-item.done     { border-left: 3px solid #34c759; opacity: 0.7; }
.deadline-full-left  { flex: 1; min-width: 0; }
.deadline-full-title { font-size: 14px; font-weight: 600; color: #1d1d1f; margin-bottom: 4px; }
.deadline-full-meta  { font-size: 12px; color: #6e6e73; }
.deadline-full-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.deadline-full-date  { font-size: 13px; font-weight: 600; text-align: right; color: #1d1d1f; }
.deadline-actions { display: flex; gap: 6px; }
.deadline-actions button {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.04);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  color: #6e6e73;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border: none;
}
.deadline-actions button:hover { color: #007aff; background: rgba(0, 122, 255, 0.08); }
.deadlines-stats-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 13px;
  color: #1d1d1f;
}
.deadlines-stats-item:last-child { border: none; }

/* ── Alarm chip ─────────────────────────────────────────── */
.alarm-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 9999px;
  border: 1px solid rgba(0, 0, 0, 0.10);
  font-size: 12px;
  color: #6e6e73;
  cursor: pointer;
  transition: all 0.15s;
}
.alarm-chip:has(input:checked) {
  border-color: rgba(0, 122, 255, 0.30);
  background: rgba(0, 122, 255, 0.08);
  color: #007aff;
}
.alarm-chip input { width: 0; height: 0; position: absolute; opacity: 0; }

/* ── View toggle ────────────────────────────────────────── */
.view-toggle {
  display: flex;
  border: 1px solid rgba(0, 0, 0, 0.10);
  border-radius: 10px;
  overflow: hidden;
}
.view-btn {
  padding: 7px 12px;
  font-size: 13px;
  color: #6e6e73;
  background: transparent;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  border: none;
}
.view-btn.active,
.view-btn:hover { color: #007aff; background: rgba(0, 122, 255, 0.08); }

/* ── MAI Chat ───────────────────────────────────────────── */
.mai-page-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
@media (max-width: 1100px) { .mai-page-layout { grid-template-columns: 1fr; } }
.mai-chat-panel {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 148px);
  min-height: 500px;
  padding: 0;
  overflow: hidden;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border: none;
}
.mai-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
  background: #ffffff;
}
.mai-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(0, 122, 255, 0.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  color: #007aff;
  border: none;
  flex-shrink: 0;
  animation: none;
}
.mai-avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.mai-chat-header strong { font-size: 14px; font-weight: 600; color: #1d1d1f; }
.mai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #ffffff;
}
.mai-message { display: flex; gap: 12px; align-items: flex-start; }
.mai-message.user { flex-direction: row-reverse; }
.mai-msg-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(0, 122, 255, 0.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #007aff;
  flex-shrink: 0;
  border: none;
}
.mai-message.user .mai-msg-avatar {
  background: #007aff;
  color: #ffffff;
}
.mai-msg-body {
  max-width: 75%;
  background: #f5f5f7;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 4px 12px 12px 12px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.6;
  color: #1d1d1f;
}
.mai-msg-body p      { color: #1d1d1f; }
.mai-msg-body ul     { color: #6e6e73; }
.mai-msg-body strong { color: #1d1d1f; }
.mai-message.user .mai-msg-body {
  background: rgba(0, 122, 255, 0.08);
  border-color: rgba(0, 122, 255, 0.14);
  border-radius: 12px 4px 12px 12px;
  color: #1d1d1f;
}
.mai-msg-time { font-size: 10px; color: #c7c7cc; margin-top: 6px; }
.mai-typing { display: flex; gap: 4px; padding: 4px 0; }
.mai-typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #86868b;
  animation: typing-dot 0.8s ease-in-out infinite;
}
.mai-typing span:nth-child(2) { animation-delay: 0.15s; }
.mai-typing span:nth-child(3) { animation-delay: 0.30s; }

.mai-suggestions {
  padding: 10px 18px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
  background: #ffffff;
}
.mai-suggestions button {
  padding: 5px 14px;
  border-radius: 9999px;
  border: 1px solid rgba(0, 0, 0, 0.10);
  font-size: 12.5px;
  color: #6e6e73;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.mai-suggestions button:hover {
  border-color: #007aff;
  color: #007aff;
  background: rgba(0, 122, 255, 0.06);
}

.mai-input-row {
  display: flex;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
  background: #f5f5f7;
  align-items: flex-end;
}
.mai-input-row textarea {
  flex: 1;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.10);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  color: #1d1d1f;
  resize: none;
  max-height: 120px;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}
.mai-input-row textarea:focus {
  border-color: #007aff;
  outline: none;
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12);
}
.mai-input-row textarea::placeholder { color: #c7c7cc; }

/* MAI side panel */
.mai-quick-analysis h4 { font-size: 14px; font-weight: 600; color: #1d1d1f; margin-bottom: 8px; }
.mai-page-stats { display: flex; flex-direction: column; }
.mai-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.mai-stat-row:last-child   { border: none; }
.mai-stat-row span:first-child { color: #6e6e73; }
.mai-stat-row span:last-child  { font-weight: 600; color: #1d1d1f; }

/* MAI Float panel */
.mai-float-panel {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 320px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.10);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.08);
  z-index: 800;
  display: none;
  overflow: hidden;
  animation: fadeInUp 0.3s ease;
}
.mai-float-panel.open { display: block; }
.mai-float-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 13.5px;
  font-weight: 600;
  color: #1d1d1f;
}
.mai-float-body  { padding: 16px; }
.mai-float-msg   { display: flex; gap: 10px; font-size: 13px; color: #6e6e73; line-height: 1.5; }

/* ── Notification panel ─────────────────────────────────── */
.notif-panel {
  position: fixed;
  top: 52px; right: 0;
  width: 360px;
  max-height: calc(100vh - 72px);
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.10);
  border-radius: 18px 0 0 18px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.10), 0 4px 8px rgba(0, 0, 0, 0.06);
  z-index: 700;
  overflow-y: auto;
  transform: translateX(110%);
  transition: transform 0.3s ease;
}
.notif-panel.open { transform: translateX(0); }
.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 14px;
  font-weight: 600;
  color: #1d1d1f;
  position: sticky;
  top: 0;
  background: #ffffff;
}
.panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: none;
}
.panel-overlay.active { display: block; }
.notif-item {
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}
.notif-item:hover { background: rgba(0, 0, 0, 0.02); }
.notif-item.unread { background: rgba(0, 122, 255, 0.04); }
.notif-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.notif-text  { flex: 1; }
.notif-title { font-weight: 600; margin-bottom: 2px; color: #1d1d1f; }
.notif-desc  { color: #6e6e73; font-size: 12px; }
.notif-time  { font-size: 10px; color: #c7c7cc; margin-top: 4px; }

/* ── Settings ───────────────────────────────────────────── */
.settings-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
}
@media (max-width: 768px) { .settings-layout { grid-template-columns: 1fr; } }
.settings-nav ul { display: flex; flex-direction: column; gap: 2px; }
.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #1d1d1f;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 2px;
}
.settings-nav-item:hover { background: rgba(0, 0, 0, 0.04); }
.settings-nav-item.active { color: #007aff; background: rgba(0, 122, 255, 0.08); font-weight: 600; }
.settings-section h3 { font-size: 17px; font-weight: 700; color: #1d1d1f; margin-bottom: 20px; letter-spacing: -0.01em; }
.settings-field {
  padding: 14px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: center;
}
.settings-field:last-child { border: none; }
.settings-field-label { font-size: 14px; font-weight: 600; color: #1d1d1f; }
.settings-field-desc  { font-size: 12px; color: #6e6e73; margin-top: 2px; }

/* Toggle switch */
.toggle-switch { position: relative; width: 44px; height: 26px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.10);
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s;
  border: 1px solid rgba(0, 0, 0, 0.10);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  left: 2px; top: 50%;
  transform: translateY(-50%);
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.25s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
input:checked + .toggle-slider { background: #007aff; border-color: #007aff; }
input:checked + .toggle-slider::before { transform: translateX(18px) translateY(-50%); }

/* ── Analytics ──────────────────────────────────────────── */
.analytics-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 768px) { .analytics-grid { grid-template-columns: 1fr; } }
.analytics-card { padding: 24px; }
.analytics-card h3 { font-size: 14px; font-weight: 600; color: #1d1d1f; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.analytics-card h3 i { color: #86868b; }
.analytics-bar-chart  { display: flex; flex-direction: column; gap: 10px; }
.analytics-bar-row    { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.analytics-bar-label  { width: 100px; color: #6e6e73; flex-shrink: 0; }
.analytics-bar-track  { flex: 1; height: 6px; background: rgba(0, 0, 0, 0.08); border-radius: 9999px; overflow: hidden; }
.analytics-bar-fill   { height: 100%; border-radius: 9999px; background: #007aff; }
.analytics-bar-val    { width: 40px; text-align: right; font-weight: 600; color: #1d1d1f; }

/* ── Client detail modal ────────────────────────────────── */
.client-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .client-detail-grid { grid-template-columns: 1fr; } }
.detail-label { font-size: 11px; font-weight: 700; color: #6e6e73; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 4px; }
.detail-value { font-size: 14px; color: #1d1d1f; }

/* ── Project Cards View ─────────────────────────────────── */
.project-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.project-card {
  position: relative;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.project-card:hover {
  transform: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.10);
}
.project-card-status-bar { height: 3px; flex-shrink: 0; }
.project-card-body  { padding: 16px; flex: 1; }
.project-card-title { font-size: 14px; font-weight: 600; color: #1d1d1f; line-height: 1.3; }
.project-card-meta  {
  font-size: 12px;
  color: #6e6e73;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.project-card-meta i { font-size: 11px; flex-shrink: 0; }

/* ── Traffic Light / Ampel ──────────────────────────────── */
.traffic-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.traffic-dot.red    { background: #d70015; box-shadow: none; }
.traffic-dot.yellow { background: #f56300; box-shadow: none; }
.traffic-dot.green  { background: #34c759; box-shadow: none; }
.traffic-dot.none   { background: rgba(0, 0, 0, 0.10); }

/* ── Ticket System ──────────────────────────────────────── */
.ticket-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
}
.ticket-status.new         { background: rgba(175, 82, 222, 0.10); color: #8944ab; }
.ticket-status.open        { background: rgba(0, 122, 255, 0.10);  color: #007aff; }
.ticket-status.in_progress { background: rgba(245, 99, 0, 0.10);   color: #b24400; }
.ticket-status.waiting     { background: rgba(0, 0, 0, 0.06);      color: #6e6e73; }
.ticket-status.resolved    { background: rgba(52, 199, 89, 0.10);  color: #1d8348; }
.ticket-status.closed      { background: rgba(0, 0, 0, 0.05);      color: #8e8e93; }

.reply-thread { display: flex; flex-direction: column; gap: 10px; max-height: 520px; overflow-y: auto; }
.reply-bubble {
  background: #f5f5f7;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  padding: 12px 14px;
}
.reply-bubble.internal {
  background: rgba(245, 99, 0, 0.04);
  border-color: rgba(245, 99, 0, 0.25);
  border-style: dashed;
}
.reply-meta { font-size: 11px; color: #6e6e73; margin-bottom: 6px; display: flex; gap: 8px; }

/* ── Upload Drop Zone ───────────────────────────────────── */
.upload-zone {
  border: 2px dashed rgba(0, 0, 0, 0.16);
  border-radius: 18px;
  padding: 32px;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}
.upload-zone:hover,
.upload-zone.drag-over {
  border-color: #007aff;
  background: rgba(0, 122, 255, 0.04);
}
.upload-zone i { font-size: 28px; color: #86868b; margin-bottom: 10px; display: block; }
.upload-zone p { font-size: 13px; color: #6e6e73; margin: 0; }

/* ── Team Member Cards ──────────────────────────────────── */
.team-member-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  margin-bottom: 8px;
}
.team-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(0, 122, 255, 0.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #007aff;
  flex-shrink: 0;
}

/* ── Workspace Tabs ─────────────────────────────────────── */
.workspace-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  margin-bottom: 24px;
}
.workspace-tab {
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #6e6e73;
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  gap: 7px;
}
.workspace-tab:hover { color: #1d1d1f; }
.workspace-tab.active { color: #007aff; border-bottom-color: #007aff; font-weight: 600; }
.workspace-tab .tab-badge {
  background: #007aff;
  color: #ffffff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 9999px;
  font-weight: 700;
}

/* ── Expense Row ────────────────────────────────────────── */
.expense-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.expense-row:last-child { border-bottom: none; }
.expense-amount        { font-size: 15px; font-weight: 700; color: #d70015; white-space: nowrap; }
.expense-amount.income { color: #1d8348; }

/* ── Settings Tabs Extension ────────────────────────────── */
.permission-matrix { width: 100%; border-collapse: collapse; font-size: 13px; }
.permission-matrix th { padding: 8px 12px; text-align: center; font-size: 11px; color: #6e6e73; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.permission-matrix th:first-child { text-align: left; }
.permission-matrix td { padding: 8px 12px; text-align: center; border-bottom: 1px solid rgba(0, 0, 0, 0.06); color: #1d1d1f; }
.permission-matrix td:first-child { text-align: left; }
.permission-matrix tr:hover td { background: rgba(0, 0, 0, 0.02); }

/* ── Ticket Detail ──────────────────────────────────────── */
.ticket-status-step {
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.10);
  color: #6e6e73;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.ticket-status-step:hover  { border-color: #007aff; color: #007aff; }
.ticket-status-step.passed { background: rgba(0, 122, 255, 0.06); border-color: rgba(0, 122, 255, 0.25); color: #6e6e73; }
.ticket-status-step.active { background: #007aff; border-color: #007aff; color: #ffffff; font-weight: 700; }

.detail-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 13px;
  gap: 8px;
}
.detail-meta-row:last-child { border-bottom: none; }
.detail-meta-label { color: #6e6e73; font-size: 12px; flex-shrink: 0; }

/* ── Task Cards ─────────────────────────────────────────── */
.task-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
  cursor: pointer;
  position: relative;
}
.task-card:hover { border-color: #007aff; box-shadow: 0 2px 12px rgba(0,102,204,0.08); }
.task-card.done { border-color: transparent; background: transparent; cursor: default; }
.task-card.done:hover { box-shadow: none; }
.task-check-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: #86868b;
  font-size: 18px;
  transition: color 0.15s;
  line-height: 1;
}
.task-check-btn:hover { color: #34c759; }

/* ── Form Grid Utilities ────────────────────────────────── */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 640px) { .form-grid-2 { grid-template-columns: 1fr; } }

/* ── Flash Messages ─────────────────────────────────────── */
.flash-msg {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
}
.flash-success { background: rgba(52, 199, 89, 0.10);  border-color: rgba(52, 199, 89, 0.25);  color: #1d8348; }
.flash-error   { background: rgba(215, 0, 21, 0.08);   border-color: rgba(215, 0, 21, 0.20);   color: #d70015; }
.flash-warning { background: rgba(245, 99, 0, 0.10);   border-color: rgba(245, 99, 0, 0.25);   color: #b24400; }

/* ── Animations ─────────────────────────────────────────── */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(1.2); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes typing-dot {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
  40%           { transform: scale(1); opacity: 1; }
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE — Tabellen, Karten, Page-Container
   Verhindert dass Tabellen rechts abgeschnitten werden ohne
   sichtbaren Scrollbar (Bug auf engen Viewports < 1400px).
   ════════════════════════════════════════════════════════════ */

/* Tabellen IMMER horizontal scrollbar — auch innerhalb von .card.
   Der native Scrollbar erscheint nur wenn nötig und respektiert das Theme. */
.table-wrap,
.card .table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

/* Tabellen-Mindestbreite damit Spalten nicht zusammengequetscht werden;
   der Scroll greift wenn Container schmaler als 720px wird. */
.table-wrap > table { min-width: 720px; }

/* Datei-Tabelle (project_detail Files-Tab) — Spalten-Priorität bei engen Viewports.
   Spalten: 1 Checkbox · 2 Typ · 3 Dateiname (incl. Doc-Nr unten) · 4 Zugewiesen · 5 Grösse · 6 Hochgeladen · 7 Optionen
   Fading-Reihenfolge: HOCHGELADEN → GRÖSSE → ZUGEWIESEN.
   DATEINAME und OPTIONEN bleiben IMMER sichtbar.
   Scope: NUR .files-table. */
.files-table { width: 100%; table-layout: auto; }
.files-table td, .files-table th { padding: 8px 10px; vertical-align: middle; }

@media (max-width: 1180px) {
  .files-table th:nth-child(6),
  .files-table td:nth-child(6) { display: none; }                /* HOCHGELADEN */
}
@media (max-width: 1000px) {
  .files-table th:nth-child(5),
  .files-table td:nth-child(5) { display: none; }                /* GRÖSSE */
}
@media (max-width: 820px) {
  .files-table th:nth-child(4),
  .files-table td:nth-child(4) { display: none; }                /* ZUGEWIESEN */
}

/* Page-Container Padding auf engen Screens reduzieren */
@media (max-width: 900px) {
  .page-container { padding: 14px 12px; }
}
@media (max-width: 560px) {
  .page-container { padding: 10px 8px; }
}

/* Forms: Grids zerlegen wenn schmal */
@media (max-width: 760px) {
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:1fr 360px"],
  [style*="grid-template-columns: 1fr 360px"] {
    grid-template-columns: 1fr !important;
  }
}

/* Modals: auf schmalen Screens randvoll, kein Margin außen */
@media (max-width: 640px) {
  .modal,
  .modal-content,
  .ce-modal { width: 100% !important; max-width: 100% !important; margin: 8px !important; }
  .modal-body, .modal-footer { padding: 14px !important; }
}

/* Topbar: bei Bedarf umbrechen statt rauspressen */
.topbar { flex-wrap: wrap; row-gap: 8px; }

/* Buttons in engen Toolbars: Kleiner werden statt überzulaufen */
@media (max-width: 760px) {
  .btn-sm   { font-size: 11px !important; padding: 4px 8px !important; }
  .page-actions { gap: 6px; }
}

/* ── Status-Dots (Ersatz für 🔴🟠🟡🟢⚪🔵) ─────────────────── */
.dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 4px;
  flex-shrink: 0;
}
.dot-red    { background: #d70015; }
.dot-orange { background: #ff9500; }
.dot-yellow { background: #ffcc00; }
.dot-green  { background: #34c759; }
.dot-blue   { background: #007aff; }
.dot-gray   { background: #c7c7cc; }

/* ── Tabellen: Auf Mobile scrollbar mit visuellem Hinweis ── */
.table-wrap, .table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 768px) {
  table { font-size: 12.5px; }
  table th, table td { padding: 7px 8px !important; white-space: nowrap; }
  /* Hinweis-Schatten am rechten Rand */
  .table-wrap, .table-responsive {
    background-image: linear-gradient(to right, rgba(0,0,0,0) 0, rgba(0,0,0,0) calc(100% - 8px), rgba(0,0,0,.06) 100%);
    background-attachment: local;
  }
}

/* ── Page-Title kleiner auf Mobile ───────────────────────── */
@media (max-width: 640px) {
  .page-title { font-size: 18px !important; }
  .page-sub   { font-size: 12px !important; }
  .breadcrumb { font-size: 12px !important; }
  .topbar-search { width: 120px !important; }
  .topbar-search kbd { display: none; }
}

/* ── KPI-Cards: 2 statt 4 Spalten auf Tablet ─────────────── */
@media (max-width: 900px) {
  [class*="kpi-grid"], [class*="stats-grid"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
@media (max-width: 480px) {
  [class*="kpi-grid"], [class*="stats-grid"] {
    grid-template-columns: 1fr !important;
  }
}

/* ── Sidebar-Backdrop auf Mobile (Tap-Outside zum Schließen) */
@media (max-width: 900px) {
  body.sidebar-open::before {
    content: '';
    position: fixed; inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 99;
    backdrop-filter: blur(2px);
  }
  .sidebar.mobile-open { z-index: 100; box-shadow: 4px 0 24px rgba(0,0,0,.2); }
}

/* ── Long-Text-Felder: Wrappen statt H-Scroll ────────────── */
@media (max-width: 640px) {
  .truncate, .wrap-cell { white-space: normal !important; word-break: break-word; }
}
