/* ─── Yory Brand Fonts ──────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Area Normal';
  src: url('fonts/AreaNormal-Regular.otf') format('opentype');
  font-weight: 400; font-style: normal;
}
@font-face {
  font-family: 'Area Normal';
  src: url('fonts/AreaNormal-SemiBold.otf') format('opentype');
  font-weight: 600; font-style: normal;
}
@font-face {
  font-family: 'Area Normal';
  src: url('fonts/AreaNormal-Bold.otf') format('opentype');
  font-weight: 700; font-style: normal;
}
@font-face {
  font-family: 'Area Normal';
  src: url('fonts/AreaNormal-ExtraBold.otf') format('opentype');
  font-weight: 800; font-style: normal;
}

/* ─── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Yory Brand Colors */
  --blue:        #5A467D;   /* Dunkelviolett – Primär */
  --blue-dark:   #4A3A6E;
  --blue-light:  #EDE8F8;
  --blue-hover:  #6B54A0;
  --flieder:     #B588F2;   /* Flieder – Highlight */
  --gelb:        #F2D188;   /* Gelb – Akzent */

  /* Alias – unified primary color */
  --primary:        #5A467D;
  --primary-dark:   #4A3A6E;
  --primary-light:  #EDE8F8;
  --primary-hover:  #6B54A0;
  --violet:         #5A467D;
  --violet-light:   #EDE8F8;

  /* Layout */
  --sidebar-w:   260px;
  --nav-h:       52px;

  /* Typography */
  --text:        #1a1a2e;
  --text-muted:  #6B778C;
  --text-secondary: #6B778C;
  --text-primary:   #1a1a2e;

  /* Surfaces */
  --border:      #DFE1E6;
  --bg:          #F3F5FF;
  --bg-primary:  #FFFFFF;
  --bg-secondary:#F3F5FF;
  --bg-tertiary: #ECEEF6;
  --bg-hover:    #EDE8F8;
  --bg-card:     #FFFFFF;
  --white:       #FFFFFF;

  /* Semantic */
  --red:         #DE350B;
  --green:       #00875A;
  --yellow:      #FF991F;

  /* Spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 28px;
  --sp-8: 32px;

  /* Border radius */
  --radius-sm:   4px;
  --radius:      8px;
  --radius-lg:   12px;
  --radius-full: 9999px;

  /* Transitions */
  --transition:  150ms ease;

  /* Shadows */
  --shadow-sm:   0 1px 2px rgba(9,30,66,.08);
  --shadow:      0 1px 3px rgba(9,30,66,.13), 0 0 1px rgba(9,30,66,.08);
  --shadow-lg:   0 8px 24px rgba(9,30,66,.15);
  --shadow-xl:   0 20px 48px rgba(9,30,66,.22);
}

html, body { height: 100%; font-family: 'Area Normal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 14px; color: var(--text); background: var(--bg); }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; }
input, textarea { font-family: inherit; font-size: inherit; }

/* ─── Top Navigation ───────────────────────────────────────────────────────── */
.topnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: var(--blue);
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,.2);
}

.topnav-left  { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.topnav-center { flex: 1; display: flex; justify-content: center; }
.topnav-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.sidebar-toggle {
  color: rgba(255,255,255,.8); font-size: 18px; padding: 4px 8px;
  border-radius: var(--radius);
  transition: background .15s;
}
.sidebar-toggle:hover { background: rgba(255,255,255,.15); color: #fff; }

.logo {
  display: flex; align-items: center; gap: 8px;
  color: #fff; font-size: 17px; font-weight: 700;
  text-decoration: none; letter-spacing: -0.3px;
}
.logo:hover { text-decoration: none; opacity: .9; }

/* Search */
.search-wrap { position: relative; width: 100%; max-width: 480px; }
.search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}
#globalSearch {
  width: 100%; padding: 7px 12px 7px 34px;
  border: 1px solid transparent;
  border-radius: 20px;
  background: rgba(255,255,255,.15);
  color: #fff;
  outline: none;
  transition: background .2s, border-color .2s;
}
#globalSearch::placeholder { color: rgba(255,255,255,.6); }
#globalSearch:focus {
  background: #fff; color: var(--text); border-color: var(--blue-light);
}
#globalSearch:focus + .search-icon,
#globalSearch:focus ~ .search-icon { color: var(--text-muted); }

.search-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  max-height: 360px; overflow-y: auto; z-index: 200;
}
.search-dropdown.hidden { display: none; }
.search-result-item {
  padding: 10px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 2px;
  border-bottom: 1px solid var(--border);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg); }
.sri-title { font-weight: 600; color: var(--text); }
.sri-meta  { font-size: 12px; color: var(--text-muted); }
.sri-excerpt { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.sri-excerpt mark { background: #FFE380; border-radius: 2px; }
.search-empty { padding: 20px; text-align: center; color: var(--text-muted); }

/* Avatar */
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--blue-dark); border: 2px solid rgba(255,255,255,.4);
  color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}

/* ─── Layout ───────────────────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  margin-top: var(--nav-h);
  min-height: calc(100vh - var(--nav-h));
}

/* ─── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  position: fixed;
  top: var(--nav-h); bottom: 0; left: 0;
  transition: transform .25s ease;
  z-index: 50;
}
.sidebar.collapsed { transform: translateX(calc(-1 * var(--sidebar-w))); }

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; color: var(--text-muted);
}

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

.spaces-list { padding: 0 8px; }

.space-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius);
  cursor: pointer; color: var(--text);
  transition: background .15s; position: relative;
}
.space-item:hover { background: var(--bg); }
.space-item.active { background: var(--blue-light); color: var(--blue); font-weight: 600; }

.space-dot {
  width: 26px; height: 26px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.space-name { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.space-count { font-size: 11px; color: var(--text-muted); }
.tree-add-btn { opacity: 0; margin-left: auto; padding: 0 6px; font-size: 16px; font-weight: 400; color: var(--blue); line-height: 1; flex-shrink: 0; border-radius: 4px; }
.tree-add-btn:hover { background: var(--blue-light); }
.tree-item:hover .tree-add-btn { opacity: 1; }
.tree-drag-handle { font-size: 12px; color: var(--text-muted); cursor: grab; padding: 0 2px; opacity: 0; flex-shrink: 0; }
.tree-lock-icon { font-size: 10px; margin-left: 3px; flex-shrink: 0; line-height: 1; }
.btn-icon.is-locked { color: var(--red, #e53e3e) !important; }
.tree-item:hover .tree-drag-handle { opacity: 1; }
.tree-pin { font-size: 11px; flex-shrink: 0; padding: 0 2px; }
.tree-draggable.drag-over > .tree-item { border-top: 2px solid var(--blue); border-radius: 0; }
.tree-dropzone.drag-over > .tree-item { background: var(--blue-light); outline: 2px dashed var(--blue); border-radius: var(--radius); }
.tree-draggable { transition: opacity .15s; }
.tree-draggable[draggable="true"]:active { opacity: .5; }
.space-group { margin-bottom: 2px; }
.space-group-header { display: flex; align-items: center; justify-content: space-between; padding: 5px 10px; border-radius: var(--radius); cursor: pointer; font-size: 12px; font-weight: 600; color: var(--text-muted); letter-spacing: .3px; }
.space-group-header:hover { background: var(--bg); color: var(--text); }
.space-group-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.space-group-toggle { font-size: 10px; flex-shrink: 0; margin-left: 4px; }
.space-group-items .space-item { padding-left: 18px; }

/* Page Tree */
.page-tree-section { padding-bottom: 20px; }
.page-tree { padding: 0 8px; }

.tree-node { }
.tree-item {
  display: flex; align-items: center; gap: 4px;
  padding: 5px 8px; border-radius: var(--radius);
  cursor: pointer; color: var(--text); font-size: 13px;
  transition: background .15s; position: relative;
}
.tree-item:hover { background: var(--bg); }
.tree-item.active { background: var(--blue-light); color: var(--blue); font-weight: 600; }
.tree-toggle {
  width: 18px; height: 18px; display: flex; align-items: center; justify-content: center;
  border-radius: 3px; flex-shrink: 0; font-size: 10px; color: var(--text-muted);
  transition: transform .15s;
}
.tree-toggle.open { transform: rotate(90deg); }
.tree-toggle-placeholder { width: 18px; flex-shrink: 0; }
.tree-icon { font-size: 14px; flex-shrink: 0; }
.tree-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-children { padding-left: 22px; }

/* ─── Main Content ─────────────────────────────────────────────────────────── */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: calc(100vh - var(--nav-h));
  transition: margin-left .25s ease;
}
.main.expanded { margin-left: 0; }
.view { padding: 0; }

/* ─── Dashboard ────────────────────────────────────────────────────────────── */
.dashboard { max-width: 1040px; margin: 0 auto; padding: 40px 32px; }

/* ── Dashboard Hero ──────────────────────────────────────────────────────── */
.db-hero {
  background: linear-gradient(135deg, var(--violet,#5A467D) 0%, #7c5cbf 100%);
  border-radius: 12px; padding: 32px 36px; color: #fff;
  margin-bottom: 24px; position: relative; overflow: hidden;
}
.db-hero::after {
  content: ''; position: absolute; right: -40px; top: -40px;
  width: 220px; height: 220px; border-radius: 50%;
  background: rgba(255,255,255,.06);
}
.db-hero h1 { font-size: 26px; font-weight: 700; margin: 0 0 10px; line-height: 1.2; }
.db-greeting-day { font-size: 13px; font-weight: 400; opacity: .7; margin-left: 10px; vertical-align: middle; }
.db-quote { font-size: 13px; opacity: .82; font-style: italic; margin: 0; max-width: 620px; line-height: 1.5; }

/* ── Mini Stats ──────────────────────────────────────────────────────────── */
.db-mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 12px; margin-bottom: 24px; }
.db-mini-stat {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px 20px; cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  position: relative; overflow: hidden;
}
.db-mini-stat::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--primary); opacity: 0;
  transition: opacity var(--transition);
}
.db-mini-stat:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: var(--primary-light); }
.db-mini-stat:hover::before { opacity: 1; }
.db-mini-stat-num { font-size: 30px; font-weight: 800; color: var(--primary); line-height: 1; }
.db-mini-stat-label { font-size: 12px; color: var(--text); font-weight: 600; margin-top: 6px; }
.db-mini-stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* ── 2-col grid ──────────────────────────────────────────────────────────── */
.db-grid { display: grid; grid-template-columns: 1fr 320px; gap: 16px; margin-bottom: 24px; }
.db-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  transition: box-shadow var(--transition);
}
.db-card:hover { box-shadow: var(--shadow); }
.db-card-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted); margin-bottom: 14px;
  display: flex; align-items: center; gap: 6px;
}

/* ── Task rows ───────────────────────────────────────────────────────────── */
.db-task-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 0;
  border-bottom: 1px solid var(--border); cursor: pointer; font-size: 13px;
  transition: color .1s;
}
.db-task-row:last-child { border-bottom: none; }
.db-task-row:hover { color: var(--violet,#5A467D); }
.db-task-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.db-task-key { color: var(--text-muted); font-size: 11px; white-space: nowrap; flex-shrink: 0; }
.db-task-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-task-sprint { font-size: 11px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }

/* ── Sprint progress ─────────────────────────────────────────────────────── */
.db-sprint-bar-track {
  height: 8px; background: var(--border); border-radius: 4px;
  overflow: hidden; margin: 10px 0;
}
.db-sprint-bar-fill {
  height: 8px; background: var(--violet,#5A467D); border-radius: 4px;
  transition: width .4s ease;
}
.db-sprint-counts { display: flex; gap: 12px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }
.db-sprint-count-done { color: #2d7a4f; font-weight: 600; }

/* ── Offers chips ────────────────────────────────────────────────────────── */
.db-offers-row { display: flex; gap: 10px; margin-top: 8px; }
.db-offer-chip {
  flex: 1; text-align: center; padding: 10px 8px;
  border-radius: 6px; background: var(--bg);
}
.db-offer-chip-num { font-size: 22px; font-weight: 800; line-height: 1; }

/* legacy kept for compat */
.dashboard-hero { margin-bottom: 40px; }
.dashboard-hero h1 { font-size: 28px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.dashboard-hero p  { color: var(--text-muted); font-size: 15px; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 40px; }
.stat-card {
  background: var(--white); border-radius: 8px; border: 1px solid var(--border);
  padding: 20px 24px; text-align: center;
}
.stat-num  { font-size: 36px; font-weight: 800; color: var(--blue); line-height: 1; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.section-title {
  font-size: 16px; font-weight: 700; color: var(--text);
  margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}

.spaces-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 40px; }
.dash-lower-card { position: relative; }
.dash-drag-handle { position: absolute; top: 4px; right: 8px; font-size: 16px; color: var(--border); cursor: grab; user-select: none; line-height: 1; padding: 2px 4px; border-radius: 4px; }
.dash-drag-handle:hover { color: var(--text-muted); background: var(--bg-secondary); }
.dash-dragging { opacity: .4; }
.dash-drag-over { outline: 2px dashed var(--primary-light); outline-offset: 4px; border-radius: 8px; }
.space-card {
  background: var(--white); border-radius: 8px; border: 1px solid var(--border);
  padding: 20px; cursor: pointer;
  transition: box-shadow .2s, transform .2s;
  text-decoration: none; color: var(--text);
  display: block;
}
.space-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); text-decoration: none; }
.sc-icon {
  width: 42px; height: 42px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px; font-weight: 700; margin-bottom: 12px;
}
.sc-name  { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.sc-desc  { font-size: 12px; color: var(--text-muted); }
.sc-count { font-size: 11px; color: var(--text-muted); margin-top: 8px; }

.new-space-card {
  border: 2px dashed var(--border); cursor: pointer;
  background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--text-muted); min-height: 120px;
  border-radius: 8px; transition: border-color .2s, color .2s;
}
.new-space-card:hover { border-color: var(--blue); color: var(--blue); }
.new-space-card svg { opacity: .6; }

.recent-list { background: var(--white); border-radius: 8px; border: 1px solid var(--border); overflow: hidden; }
.recent-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--border); cursor: pointer;
  transition: background .15s;
}
.recent-item:last-child { border-bottom: none; }
.recent-item:hover { background: var(--bg); }
.ri-badge {
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 3px;
  color: #fff; flex-shrink: 0;
}
.ri-title { flex: 1; font-weight: 500; color: var(--text); }
.ri-meta  { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }

/* ─── Page View ────────────────────────────────────────────────────────────── */
.page-view { max-width: 900px; margin: 0 auto; padding: 32px; }

.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-muted); margin-bottom: 20px; flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb-sep { opacity: .5; }

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  margin-bottom: 6px;
}
.page-title-h1 {
  font-size: 28px; font-weight: 800; color: var(--text);
  line-height: 1.2; flex: 1;
}
.page-title-h1[onclick] { cursor: text; }
.page-title-h1[onclick]:hover { color: var(--blue); }
.inline-title-input {
  font-size: 28px; font-weight: 800; color: var(--text);
  border: none; border-bottom: 2px solid var(--blue);
  outline: none; background: transparent;
  width: 100%; font-family: inherit; line-height: 1.2;
  padding: 0;
}
.page-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: center; }
.action-group {
  display: flex; align-items: center; gap: 2px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2px;
}
.action-group .btn-icon {
  width: 30px; height: 30px; border-radius: 6px;
  color: var(--text-muted);
}
.action-group .btn-icon:hover { background: var(--white); color: var(--primary); box-shadow: var(--shadow-sm); }
.action-sep { width: 1px; height: 18px; background: var(--border); margin: 0 2px; }
.page-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 28px; }
.page-meta span { margin-right: 16px; }

.page-content { font-size: 15px; line-height: 1.7; color: var(--text); }
.page-content h1 { font-size: 24px; font-weight: 700; margin: 24px 0 12px; }
.page-content h2 { font-size: 20px; font-weight: 700; margin: 20px 0 10px; }
.page-content h3 { font-size: 17px; font-weight: 700; margin: 16px 0 8px; }
.page-content p  { margin-bottom: 12px; }
.page-content ul, .page-content ol { margin: 0 0 12px 24px; }
.page-content li { margin-bottom: 4px; }
.page-content blockquote {
  border-left: 4px solid var(--blue); padding-left: 16px;
  margin: 12px 0; color: var(--text-muted);
}
.page-content code {
  background: #F1F2F4; padding: 1px 5px; border-radius: 3px;
  font-family: 'SF Mono', Consolas, monospace; font-size: 13px;
}
.page-content pre {
  background: #1D2125; color: #ADBAC7; padding: 16px; border-radius: 6px;
  overflow-x: auto; margin: 12px 0;
}
.page-content pre code { background: none; padding: 0; color: inherit; font-size: 13px; }
.page-content img { max-width: 100%; border-radius: 6px; }
.page-content table { border-collapse: collapse; width: 100%; margin: 12px 0; }
.page-content th, .page-content td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.page-content th { background: var(--bg); font-weight: 600; }
.page-content a { color: var(--blue); }
.page-content strong { font-weight: 700; }

/* ─── Editor ───────────────────────────────────────────────────────────────── */
.page-edit { max-width: 900px; margin: 0 auto; padding: 32px; }

.edit-title-input {
  width: 100%; font-size: 28px; font-weight: 800; color: var(--text);
  border: none; outline: none; background: transparent;
  margin-bottom: 20px; padding: 0;
  border-bottom: 2px solid transparent;
  transition: border-color .2s;
}
.edit-title-input:focus { border-bottom-color: var(--blue); }

.editor-wrapper { background: var(--white); border-radius: 8px; border: 1px solid var(--border); overflow: hidden; }
.ql-container { font-size: 15px; min-height: 400px; }
.ql-editor { min-height: 400px; line-height: 1.7; }
.ql-toolbar { border-bottom: 1px solid var(--border) !important; background: var(--bg); }

.edit-actions { display: flex; gap: 10px; margin-top: 20px; }

/* ─── Comments ─────────────────────────────────────────────────────────────── */
.comments-section { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--border); }
.comments-title { font-size: 16px; font-weight: 700; margin-bottom: 20px; }

.comment-item {
  display: flex; gap: 12px; margin-bottom: 20px;
}
.comment-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--blue);
  color: #fff; font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.comment-body { flex: 1; }
.comment-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.comment-meta strong { color: var(--text); font-weight: 600; margin-right: 6px; }
.comment-text { font-size: 14px; line-height: 1.6; background: var(--white); padding: 10px 14px; border-radius: 0 8px 8px 8px; border: 1px solid var(--border); }
.comment-del { font-size: 11px; color: var(--text-muted); cursor: pointer; margin-left: 8px; }
.comment-del:hover { color: var(--red); }

.comment-form { display: flex; gap: 12px; margin-top: 16px; }
.comment-form textarea {
  flex: 1; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: 8px; resize: vertical; min-height: 72px; outline: none;
  transition: border-color .2s;
}
.comment-form textarea:focus { border-color: var(--blue); }

/* ─── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  transition: background .15s, box-shadow .15s;
  cursor: pointer; border: 1px solid transparent;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); }
.btn-secondary { background: var(--bg); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { opacity: .9; }
.btn-ghost { color: var(--blue); padding: 7px 12px; }
.btn-ghost:hover { background: var(--blue-light); }
.btn-sm { padding: 5px 12px; font-size: 13px; }

.btn-icon {
  width: 32px; height: 32px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: background .15s;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text); }
/* btn-icon im dunklen Topnav: weiss */
.topnav .btn-icon { color: rgba(255,255,255,.8); }
.topnav .btn-icon:hover { background: rgba(255,255,255,.15); color: #fff; }
.sidebar-header .btn-icon,
.page-actions .btn-icon {
  color: var(--text-muted);
}
.sidebar-header .btn-icon:hover,
.page-actions .btn-icon:hover {
  background: var(--bg); color: var(--text);
}

/* ─── Modal ────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(9,30,66,.54);
  display: flex; align-items: center; justify-content: center;
  z-index: 300; padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--white); border-radius: var(--radius-lg);
  width: 100%; max-width: 520px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(.97) translateY(-10px); } to { opacity: 1; transform: none; } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 0;
}
.modal-header h3 { font-size: 18px; font-weight: 700; }
.modal-header .btn-icon { color: var(--text-muted); }
.modal-header .btn-icon:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 20px 24px 24px; }

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-input, .form-textarea, .form-select {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); outline: none; font-size: 14px;
  transition: border-color .2s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--blue); }
.input-group { display:flex; align-items:stretch; width:100%; }
.input-group-prefix {
  background:#5A467D; color:#fff; padding:0 12px;
  border-radius:6px 0 0 6px; font-weight:700; font-size:14px;
  display:flex; align-items:center; white-space:nowrap; flex-shrink:0;
  border:1px solid var(--violet); border-right:none;
}
.input-group .form-input { border-radius:0 6px 6px 0; flex:1; width:0; min-width:0; }
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

.color-presets { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.color-preset {
  width: 28px; height: 28px; border-radius: 6px; cursor: pointer;
  border: 2px solid transparent; transition: transform .15s;
}
.color-preset:hover { transform: scale(1.15); }
.color-preset.selected { border-color: var(--text); }

/* ─── History ──────────────────────────────────────────────────────────────── */
.history-list { }
.history-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.history-item:last-child { border-bottom: none; }
.hi-time { font-size: 13px; font-weight: 500; }
.hi-by   { font-size: 12px; color: var(--text-muted); }

/* ─── Loading States ────────────────────────────────────────────────────────── */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--bg-tertiary) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s infinite;
  border-radius: var(--radius);
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.skeleton-line {
  height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, var(--border) 25%, var(--bg-tertiary) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s infinite;
}
.skeleton-line--short { width: 40%; }
.skeleton-line--med   { width: 65%; }
.skeleton-line--long  { width: 90%; }
.skeleton-line--full  { width: 100%; }
.skeleton-title { height: 18px; border-radius: 6px; margin-bottom: 4px; }

.loading-spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.loading-spinner--lg { width: 32px; height: 32px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.module-loading {
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 12px;
  padding: 80px 20px; color: var(--text-muted);
}

/* ─── Toast ────────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 999; pointer-events: none;
}
.toast {
  background: #1D2125; color: #fff;
  padding: 11px 16px; border-radius: 10px;
  font-size: 13.5px; font-weight: 500;
  box-shadow: var(--shadow-xl);
  display: flex; align-items: center; gap: 10px;
  animation: toastIn .22s ease;
  pointer-events: all;
  max-width: 340px;
  border-left: 4px solid transparent;
}
.toast-icon { font-size: 16px; flex-shrink: 0; line-height: 1; }
.toast-msg  { flex: 1; line-height: 1.4; }
.toast-close {
  opacity: .5; cursor: pointer; font-size: 16px; padding: 0 2px;
  flex-shrink: 0; line-height: 1;
  background: none; border: none; color: #fff;
}
.toast-close:hover { opacity: 1; }
.toast.success { border-left-color: #36B37E; }
.toast.error   { border-left-color: #DE350B; }
.toast.info    { border-left-color: #0052CC; }
.toast.warning { border-left-color: #FF991F; }
.toast.hiding  { animation: toastOut .2s ease forwards; }
@keyframes toastIn  { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(16px); } }
/* Legacy support */
.toast.hidden { display: none; }

/* ─── Empty State ──────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 64px 24px; color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center;
}
.empty-state-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; margin-bottom: 20px;
}
.empty-state svg { opacity: .3; margin-bottom: 16px; }
.empty-state h3 { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.empty-state p  { font-size: 13px; margin-bottom: 24px; max-width: 340px; line-height: 1.6; }

/* ─── Login ────────────────────────────────────────────────────────────────── */
.login-screen {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; align-items: center; justify-content: center; z-index: 500;
}
.login-screen.hidden { display: none; }
.login-card {
  background: var(--white); border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: 40px; width: 100%; max-width: 380px;
}
.login-logo {
  display: flex; align-items: center; gap: 12px;
  font-size: 20px; font-weight: 800; color: var(--text);
  margin-bottom: 28px;
}
.login-card h2 { font-size: 20px; margin-bottom: 20px; color: var(--text); }
.login-error {
  background: #FFEBE6; color: var(--red); border-radius: var(--radius);
  padding: 8px 12px; font-size: 13px; margin-bottom: 12px;
}
.login-error.hidden { display: none; }

/* ─── User Chip / Profile Menu ──────────────────────────────────────────────── */
.user-chip {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; position: relative;
  padding: 4px 8px; border-radius: 20px;
  color: rgba(255,255,255,.9);
  transition: background .15s;
}
.user-chip:hover { background: rgba(255,255,255,.15); }
.user-chip span  { font-size: 13px; font-weight: 500; }
.profile-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--white); border-radius: 8px; min-width: 180px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--border); z-index: 200;
  overflow: hidden;
}
.profile-menu.hidden { display: none; }
.pm-item { padding: 10px 16px; font-size: 14px; cursor: pointer; color: var(--text); }
.pm-item:hover { background: var(--bg); }
.pm-logout { color: var(--red); }
.pm-divider { height: 1px; background: var(--border); }

/* ─── Permission & Role Badges ──────────────────────────────────────────────── */
.space-badge {
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 10px;
  flex-shrink: 0; white-space: nowrap;
}
.space-badge--edit { background: #E3FCEF; color: var(--green); }
.space-badge--view { background: #DEEBFF; color: var(--blue); }
.space-badge--none { background: var(--bg); color: var(--text-muted); }

.role-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.role-badge--admin  { background: #EAE6FF; color: #403294; }
.role-badge--member { background: var(--bg); color: var(--text-muted); }

/* ─── User Management Table ─────────────────────────────────────────────────── */
.user-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.user-table th {
  text-align: left; padding: 8px 10px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted);
  border-bottom: 2px solid var(--border);
}
.user-table td { padding: 10px 10px; border-bottom: 1px solid var(--border); }
.user-table tr:last-child td { border-bottom: none; }

.user-form {
  background: var(--bg); border-radius: var(--radius); padding: 16px;
  margin-bottom: 16px; border: 1px solid var(--border);
}

/* ─── Sidebar empty ─────────────────────────────────────────────────────────── */
.sidebar-empty { padding: 6px 16px; color: var(--text-muted); font-size: 12px; }
.sidebar-trash-btn { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; font-size: 12px; color: var(--text-muted); background: none; border: none; border-radius: 6px; cursor: pointer; text-align: left; }
.sidebar-trash-btn:hover { background: var(--bg-hover); color: var(--text); }

/* ─── Folder Tree Item ──────────────────────────────────────────────────────── */
.tree-folder-item { font-weight: 600; }
.tree-folder-item:hover { background: #FFF7E6; }
.tree-folder-item.active { background: #FFF0B3; color: #172B4D; }

/* ─── Folder View ───────────────────────────────────────────────────────────── */
.folder-section-title {
  font-size: 11px; font-weight: 700; letter-spacing: .7px;
  text-transform: uppercase; color: var(--text-muted);
  margin: 20px 0 10px;
}
.folder-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.folder-card {
  background: var(--white); border: 1px solid var(--border); border-radius: 8px;
  padding: 16px 12px; text-align: center; cursor: pointer;
  transition: box-shadow .2s, transform .2s;
}
.folder-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.folder-card-icon  { display: block; font-size: 32px; margin-bottom: 8px; }
.folder-card-name  { font-size: 13px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

/* ─── Whiteboard Embed ───────────────────────────────────────────────────────── */
.wb-page-header { padding-bottom: 12px; }
.wb-embed-wrap {
  width: 100%;
  height: calc(100vh - 200px);
  min-height: 500px;
  border-top: 1px solid var(--border);
}
.wb-embed-frame {
  width: 100%; height: 100%;
  border: none; display: block;
}

/* ─── Type Selector ─────────────────────────────────────────────────────────── */
.type-selector { display: flex; gap: 10px; margin-top: 4px; }
.type-option {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; font-size: 14px; transition: border-color .15s, background .15s;
}
.type-option:hover { border-color: var(--blue); background: var(--blue-light); }
.type-option input[type="radio"] { accent-color: var(--blue); }

/* ─── Modal wider for user management ──────────────────────────────────────── */
.modal { max-width: 620px; }
/* ─── Task-Detail Modal extra breit ────────────────────────────────────────── */
.modal:has(.task-detail) { max-width: 820px; }

/* ─── Modul-Tabs ───────────────────────────────────────────────────────────── */
.module-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 16px;
  height: var(--nav-h);
}
.module-tab {
  padding: 0 14px;
  height: 100%;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,.6);
  border-bottom: 3px solid transparent;
  border-top: 3px solid transparent;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
  display: flex;
  align-items: center;
}
.module-tab:hover { color: rgba(255,255,255,.9); }
.module-tab.active { color: #fff; border-bottom-color: #fff; }

/* ─── Angebote-Sidebar ─────────────────────────────────────────────────────── */
.offers-nav { padding: 8px 0; }
.offers-nav-item {
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  border-radius: var(--radius);
  margin: 1px 8px;
  color: var(--text);
  transition: background .15s;
}
.offers-nav-item:hover  { background: var(--blue-light); color: var(--blue); }
.offers-nav-item.active { background: var(--blue-light); color: var(--blue); font-weight: 600; }

/* ─── Angebote & Kunden ────────────────────────────────────────────────────── */
.offers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.offers-table th {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 2px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.offers-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.offers-table tfoot td {
  border-top: 2px solid var(--border);
  border-bottom: none;
  padding: 8px 12px;
}
.offer-row { cursor: pointer; }
.offer-row:hover td { background: var(--bg); }

.client-key-badge {
  display: inline-block;
  background: var(--blue-light);
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: .5px;
  margin-right: 2px;
}

.status-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.status-entwurf    { background: #F4F5F7; color: #6B778C; }
.status-gesendet   { background: var(--blue-light); color: var(--blue); }
.status-angenommen { background: #E3FCEF; color: #00875A; }
.status-abgelehnt  { background: #FFEBE6; color: #DE350B; }
.status-abgelaufen { background: #FFF4E5; color: #FF991F; }

.offer-item-row {
  display: flex;
  gap: 0;
  align-items: center;
  margin-bottom: 4px;
  background: var(--bg-secondary, #f7f6fb);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: box-shadow 0.15s, border-color 0.15s;
  overflow: hidden;
}
.offer-item-row:hover { border-color: var(--primary-light, #c5bde8); box-shadow: 0 1px 6px rgba(90,70,125,0.07); }
.offer-item-row .form-input {
  margin-bottom: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 8px 10px;
  height: 38px;
  font-size: 13px;
}
.offer-item-row .form-input:focus {
  background: white;
  box-shadow: inset 0 0 0 2px var(--primary);
  border-radius: 6px;
  z-index: 1;
  position: relative;
}
.offer-item-row .oir-sep {
  width: 1px; background: var(--border); align-self: stretch; flex-shrink: 0;
}
.offer-item-row .oir-field {
  display: flex; flex-direction: column; flex-shrink: 0;
}
.offer-item-row .oir-field-label {
  font-size: 9px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase;
  color: var(--text-muted); padding: 4px 10px 0; line-height: 1; white-space: nowrap;
}
.offer-item-row--heading {
  background: linear-gradient(90deg, #ede9f7 0%, var(--bg-secondary) 100%);
  border-left: 3px solid var(--primary);
}
.offer-item-row--pagebreak { opacity: 0.45; }
.offer-item-row--subitem { background: white; border-style: dashed; margin-left: 28px; }
.offer-row-label { display: none; }
.drag-handle {
  cursor: grab; color: var(--text-muted); padding: 0 8px;
  font-size: 14px; flex-shrink: 0; user-select: none; align-self: stretch;
  display: flex; align-items: center; border-right: 1px solid var(--border);
}
.drag-handle:hover { background: var(--bg-hover); color: var(--primary); }
.drag-handle:active { cursor: grabbing; }
.offer-item-row.dragging { opacity: 0.3; box-shadow: 0 4px 16px rgba(0,0,0,0.15); }
.offer-item-row.drag-over { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light, #c5bde8); }

.offer-add-toolbar {
  display: flex; flex-direction: column; gap: 6px; margin-top: 8px;
}
.offer-add-search-row {
  display: flex; gap: 6px; align-items: center;
}
.offer-add-type-row {
  display: flex; gap: 4px; flex-wrap: wrap;
}
.offer-type-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; font-size: 11.5px; font-weight: 500;
  background: white; border: 1px solid var(--border);
  border-radius: 20px; cursor: pointer; color: var(--text-muted);
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  white-space: nowrap;
}
.offer-type-btn:hover { background: var(--bg-secondary); border-color: var(--primary-light, #c5bde8); color: var(--primary); }

.offer-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin: 16px 0;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.offer-meta-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 4px;
}

.offer-notes {
  padding: 12px 16px;
  background: #FFFAED;
  border-left: 3px solid var(--yellow);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 13px;
  line-height: 1.5;
}

.offer-intro-text {
  margin: 16px 0 24px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
}

.offer-footnote {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
  font-style: italic;
}

.offer-conditions {
  margin-top: 28px;
  padding: 16px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.6;
}
.offer-conditions-title {
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ─── Kunden-Sidebar ───────────────────────────────────────────────────────── */
.clients-nav-list { padding: 8px 0; }
.clients-nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 16px; cursor: pointer;
  border-radius: var(--radius); margin: 1px 8px;
  font-size: 13px; color: var(--text);
  transition: background .15s;
}
.clients-nav-item:hover  { background: var(--blue-light); color: var(--blue); }
.clients-nav-item.active { background: var(--blue-light); color: var(--blue); font-weight: 600; }
.clients-nav-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Kunden Übersicht (Grid) ──────────────────────────────────────────────── */
.clients-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.client-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
}
.client-card:hover { box-shadow: var(--shadow); border-color: var(--blue); }
.client-card-key {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 4px;
  letter-spacing: .5px;
  margin-bottom: 10px;
}
.client-card-name { font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.client-card-meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.client-card--new {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--text-muted); border-style: dashed;
  font-size: 13px;
}
.client-card--new:hover { color: var(--blue); border-color: var(--blue); background: var(--blue-light); }

/* ─── Kunden Detailseite ───────────────────────────────────────────────────── */
.client-detail-key {
  background: var(--blue);
  color: #fff;
  font-size: 13px; font-weight: 700;
  padding: 4px 12px; border-radius: 6px;
  letter-spacing: .5px;
}
.client-info-row {
  display: flex; flex-wrap: wrap; gap: 16px;
  margin: 12px 0 20px;
  font-size: 13px; color: var(--text-muted);
}
.client-section { margin-top: 32px; }
.client-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.client-section-empty {
  color: var(--text-muted); font-size: 13px; padding: 12px 0;
}
.client-section-empty a { margin-left: 6px; }
.client-spaces-list { display: flex; flex-direction: column; gap: 6px; }
.client-linked-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer;
  font-size: 13px; transition: border-color .15s;
}
.client-linked-item:hover { border-color: var(--blue); }

/* ─── Produktkatalog & Vorlagen ─────────────────────────────────────────────── */
.catalog-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.catalog-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.catalog-table thead th {
  padding: 9px 12px; text-align: left; font-weight: 600;
  background: var(--bg); border-bottom: 2px solid var(--border);
  color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .4px;
}
.catalog-table th.right, .catalog-table td.right { text-align: right; }
.catalog-table tbody tr { border-bottom: 1px solid var(--border); cursor: default; }
.catalog-table tbody tr:hover { background: var(--bg); }
.catalog-table tbody td { padding: 8px 12px; vertical-align: top; }
.catalog-category-row td {
  padding: 6px 12px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--blue); background: var(--blue-light);
  border-bottom: 1px solid var(--border);
}
.product-num { color: var(--text-muted); font-size: 11px; font-family: monospace; }
.product-inactive { opacity: .45; }

/* Vorlagen-Karten */
.templates-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px;
  margin-bottom: 24px;
}
.template-card {
  background: var(--white); border: 2px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.template-card:hover { border-color: var(--blue); box-shadow: var(--shadow); }
.template-card--new {
  border-style: dashed; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  color: var(--text-muted); min-height: 100px;
}
.template-card--new:hover { border-color: var(--blue); color: var(--blue); }
.template-card-name { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.template-card-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.template-card-meta { font-size: 11px; color: var(--text-muted); }

/* Vorlage-Picker Modal */
.template-picker-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px;
  margin-top: 8px;
}
.tpl-pick-card {
  background: var(--white); border: 2px solid var(--border);
  border-radius: var(--radius); padding: 14px;
  cursor: pointer; transition: border-color .15s, background .15s;
  text-align: center;
}
.tpl-pick-card:hover { border-color: var(--blue); background: var(--blue-light); }
.tpl-pick-card--empty {
  border-style: dashed; color: var(--text-muted);
}
.tpl-pick-name { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.tpl-pick-count { font-size: 11px; color: var(--text-muted); }

/* Checklisten-Items in Angebot-Modal */
.checklist-section { margin-bottom: 8px; }
.checklist-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; color: var(--text-muted); margin-bottom: 6px;
}
.checklist-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 4px;
  background: var(--white); font-size: 13px;
}
.checklist-item.mandatory { background: var(--bg); }
.checklist-item input[type=checkbox] { flex-shrink: 0; width: 15px; height: 15px; cursor: pointer; }
.checklist-item input[type=checkbox]:disabled { cursor: not-allowed; }
.checklist-item-name { flex: 1; }
.checklist-item-price { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.checklist-badge-opt {
  font-size: 10px; padding: 1px 6px; border-radius: 3px;
  background: var(--yellow); color: #fff; font-weight: 600;
}

/* Produktsuche Autocomplete */
.product-search-wrap { position: relative; }
.product-autocomplete {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 200;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-height: 240px; overflow-y: auto;
}
.product-ac-item {
  padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.product-ac-item:last-child { border-bottom: none; }
.product-ac-item:hover { background: var(--blue-light); }
.product-ac-num { color: var(--text-muted); font-size: 11px; font-family: monospace; margin-right: 6px; }
.product-ac-price { float: right; color: var(--text-muted); font-size: 11px; }

/* Vorlage-Items Editor */
.template-items-list { margin-top: 8px; }
.template-item-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 4px;
  background: var(--white); font-size: 13px;
}
.template-item-row .item-name { flex: 1; font-weight: 500; }
.template-item-row .item-meta { font-size: 11px; color: var(--text-muted); }
.template-item-row .item-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* ─── Preis-Update-Hinweis ──────────────────────────────────────────────────── */
.price-update-hint {
  font-size: 11px; color: var(--yellow);
  display: flex; align-items: center; gap: 8px; margin-top: 4px;
}
.price-update-hint button {
  font-size: 11px; color: var(--blue);
  text-decoration: underline; cursor: pointer; padding: 0;
}
.price-update-hint button:hover { color: var(--blue-dark); }

/* ─── Terminierung ───────────────────────────────────────────────────────────── */
.offer-terminierung {
  margin-top: 28px;
  padding: 16px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.offer-terminierung-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.offer-terminierung-title {
  font-weight: 700; font-size: 12px;
  text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted);
}
.phase-block {
  margin-bottom: 16px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.phase-block:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.phase-header {
  display: flex; align-items: center; gap: 6px; margin-bottom: 4px;
}
.phase-title { font-weight: 700; font-size: 14px; flex: 1; }
.phase-body { font-size: 13px; line-height: 1.8; color: var(--text); padding-left: 12px; }
.phase-note { color: var(--text-muted); font-style: italic; }
.phase-items-list { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; padding: 4px 0; }
.phase-item-check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.preset-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.preset-chip { font-size: 12px; padding: 4px 12px; border-radius: 20px; border: 1px solid var(--border); background: var(--bg); cursor: pointer; color: var(--text); }
.preset-chip:hover { background: var(--blue-light); border-color: var(--blue); }
.duplicate-hint { background: #fffbeb; border: 1px solid #f59e0b; border-radius: 6px; padding: 8px 10px; margin-top: 6px; font-size: 12px; }
.duplicate-hint strong { display: block; margin-bottom: 6px; color: #92400e; }
.duplicate-hint-item { display: flex; align-items: center; gap: 8px; padding: 3px 0; border-top: 1px solid #fde68a; }
.status-badge.status-none { background: var(--bg); color: var(--text-muted); }

/* ─── Presence Avatars ──────────────────────────────────────────────────────── */
.page-presence { display: flex; align-items: center; gap: 4px; }
.presence-avatar { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 600; cursor: default; flex-shrink: 0; }

/* ─── Draft Banner ──────────────────────────────────────────────────────────── */
.draft-banner { background: var(--violet-light, #ede8f5); color: var(--violet, #5A467D); padding: 7px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; border: 1px solid var(--violet, #5A467D)20; }
.draft-banner a { color: var(--violet, #5A467D); font-weight: 600; }

/* ─── Yjs Remote Cursors (TipTap CollaborationCursor) ───────────────────────── */
.collaboration-cursor__caret {
  position: relative;
  margin-left: -1px;
  margin-right: -1px;
  border-left: 2px solid currentColor;
  border-right: none;
  word-break: normal;
  pointer-events: none;
}

.collaboration-cursor__label {
  position: absolute;
  top: -1.7em;
  left: -2px;
  font-size: 10.5px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.4;
  white-space: nowrap;
  padding: 2px 7px 2px 6px;
  border-radius: 4px 4px 4px 0;
  color: #fff;
  pointer-events: none;
  user-select: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.20);
  letter-spacing: .2px;
}

/* ─── Reload Banner ─────────────────────────────────────────────────────────── */
#reload-banner { background: var(--yellow, #ffe082); color: #333; padding: 8px 14px; border-radius: 8px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; font-size: 14px; }
#reload-banner button { background: rgba(0,0,0,0.12); border: none; border-radius: 5px; padding: 3px 10px; cursor: pointer; font-size: 13px; }
#reload-banner button:hover { background: rgba(0,0,0,0.22); }

/* ─── Aufgaben-Modul ────────────────────────────────────────────────────────── */
.tasks-nav { display:flex; flex-direction:column; gap:2px; padding:8px 0; }
.tasks-nav-item { display:flex; align-items:center; gap:8px; padding:7px 16px; font-size:13px; cursor:pointer; border-radius:6px; color:var(--text-secondary); }
.tasks-nav-item:hover, .tasks-nav-item.active { background:var(--bg-hover); color:var(--text-primary); }
.tasks-project-list { padding:4px 0 8px; }
.tasks-client-group { margin-bottom:4px; }
.tasks-client-name { display:flex; align-items:center; gap:4px; padding:6px 8px 3px 16px; font-size:12px; font-weight:700; color:var(--text-secondary); text-transform:uppercase; letter-spacing:.4px; cursor:pointer; }
.tasks-client-name:hover { color:var(--text); }
.tasks-client-name.active { color:var(--violet); }
.sidebar-collapse-btn { font-size:9px; flex-shrink:0; opacity:.5; padding:2px; }
.sidebar-collapse-btn:hover { opacity:1; }
.sidebar-fav-btn { font-size:13px; flex-shrink:0; color:var(--text-muted); opacity:.4; padding:2px 4px; line-height:1; }
.sidebar-fav-btn:hover { opacity:.8; }
.sidebar-fav-btn.fav-active { color:#f59e0b; opacity:1; }
.sidebar-section-label { padding:8px 16px 2px; font-size:10px; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:.6px; }
.sidebar-section-toggle { cursor:pointer; user-select:none; }
.sidebar-section-toggle:hover { color:var(--text); }
.sidebar-drag-over { background:var(--bg-hover); border-radius:6px; }
.tasks-project-item { display:flex; align-items:center; gap:6px; padding:5px 8px 5px 16px; font-size:13px; cursor:pointer; border-radius:6px; }
.sidebar-proj-fav { font-size:11px; color:var(--text-muted); opacity:.3; flex-shrink:0; padding:1px 2px; line-height:1; }
.sidebar-proj-fav:hover { opacity:.7; }
.sidebar-proj-fav.fav-active { color:#f59e0b; opacity:1; }
.sidebar-proj-more { padding:3px 16px 3px 28px; font-size:11px; color:var(--violet); cursor:pointer; opacity:.8; }
.sidebar-proj-more:hover { opacity:1; }
.sidebar-completed-toggle { color:var(--text-muted); }
.sidebar-completed-toggle:hover { color:var(--text); }
.sidebar-proj-archive { font-size:11px; color:var(--text-muted); opacity:.3; flex-shrink:0; padding:1px 2px; line-height:1; cursor:pointer; }
.sidebar-proj-archive:hover { opacity:.8; color:var(--violet); }
.sidebar-proj-archive.archive-done { color:var(--violet); opacity:.6; }
.proj-completed { opacity:.7; }
.tasks-project-item:hover, .tasks-project-item.active { background:var(--bg-hover); }
.sidebar-parent-group { margin-bottom:2px; }
.sidebar-parent-header { display:flex; align-items:center; gap:5px; padding:4px 8px 4px 20px; font-size:11px; font-weight:600; cursor:pointer; border-radius:6px; color:var(--text-muted); letter-spacing:.2px; }
.sidebar-parent-header:hover { background:var(--bg-hover); color:var(--text-secondary); }
.sidebar-parent-header.active { color:#5A467D; }
.tasks-project-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.tasks-project-count { margin-left:auto; font-size:11px; color:var(--text-muted); background:var(--bg-tertiary); border-radius:10px; padding:1px 6px; }
.tasks-nav-add { padding:6px 16px; font-size:12px; color:var(--text-muted); cursor:pointer; }
.tasks-nav-add:hover { color:var(--violet); }

/* Kanban */
.kanban-wrap { padding:24px; }
.kanban-header { display:flex; align-items:center; gap:12px; margin-bottom:20px; flex-wrap:wrap; }
.kanban-header h2 { margin:0; font-size:20px; }
.kanban-filters { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.kanban-filters select {
  font-size:12px; padding:5px 10px; border:1px solid var(--border);
  border-radius:var(--radius-full); background:var(--white);
  color:var(--text); cursor:pointer; transition: border-color var(--transition);
}
.kanban-filters select:hover { border-color:var(--primary-light); }
.kanban-filters select:focus { outline:none; border-color:var(--primary); }
.kanban-filter-chip {
  display:inline-flex; align-items:center; gap:4px; padding:4px 10px;
  background:var(--white); border:1px solid var(--border); border-radius:var(--radius-full);
  font-size:12px; cursor:pointer; color:var(--text-muted);
  transition: all var(--transition);
}
.kanban-filter-chip:hover { border-color:var(--primary-light); color:var(--primary); }
.kanban-filter-chip.active { background:var(--primary-light); border-color:var(--primary); color:var(--primary); font-weight:600; }
.kanban-subtask-toggle { display:flex; align-items:center; gap:5px; font-size:12px; color:var(--text-muted); cursor:pointer; }
.kanban-project-group { margin-bottom:32px; }
.kanban-project-header { display:flex; align-items:center; gap:8px; margin-bottom:12px; font-size:14px; font-weight:600; }
.kanban-project-dot { width:10px; height:10px; border-radius:50%; }
.kanban-columns { display:grid; grid-template-columns:repeat(5,1fr); gap:12px; min-width:900px; overflow-x:auto; }
.kanban-column { background:var(--bg-secondary); border-radius:var(--radius-lg); min-height:200px; display:flex; flex-direction:column; }
.kanban-col-header { padding:10px 12px; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.6px; color:var(--text-muted); display:flex; align-items:center; gap:6px; border-bottom:1px solid var(--border); }
.kanban-col-count { background:var(--primary); color:#fff; border-radius:var(--radius-full); padding:1px 7px; font-size:10px; }
.kanban-cards { flex:1; padding:8px; display:flex; flex-direction:column; gap:6px; min-height:120px; }
.kanban-card {
  background:var(--white); border:1px solid var(--border);
  border-radius:var(--radius); padding:10px 12px; cursor:pointer;
  transition:box-shadow var(--transition), border-color var(--transition), transform var(--transition);
  position:relative; overflow:hidden;
}
.kanban-card::before {
  content:''; position:absolute; left:0; top:0; bottom:0; width:3px;
  background:var(--prio-color, transparent);
}
.kanban-card:hover { box-shadow:var(--shadow); border-color:var(--primary-light); transform:translateY(-1px); }
.kcard-title { font-size:13px; font-weight:500; margin-bottom:6px; line-height:1.3; }
.kcard-meta { display:flex; align-items:center; gap:6px; margin-bottom:6px; flex-wrap:wrap; }
.kcard-type { display:inline-flex; align-items:center; font-size:10px; font-weight:600; padding:2px 7px; border-radius:var(--radius-full); flex-shrink:0; }
.kcard-type-story   { color:#2d7a4f; background:#e6f4ec; }
.kcard-type-subtask { color:#6b7280; background:#f3f4f6; }
.kcard-type-task    { color:#6d28d9; background:#ede9fe; }
.kcard-type-bug     { color:#b91c1c; background:#fee2e2; }
.kcard-key { font-size:11px; color:var(--text-muted); font-family:monospace; background:var(--bg-tertiary); padding:1px 5px; border-radius:4px; }
.kcard-due { font-size:11px; color:var(--text-muted); }
.kcard-due.overdue { color:var(--red,#e74c3c); font-weight:600; }
.kcard-footer { display:flex; align-items:center; gap:6px; margin-top:2px; }
.kcard-prio { font-size:12px; font-weight:700; line-height:1; }
.kcard-hours { font-size:11px; color:var(--text-muted); background:var(--bg-tertiary); padding:1px 5px; border-radius:4px; }
.kcard-subs { font-size:11px; color:var(--text-muted); }
.kcard-avatar {
  margin-left:auto; width:22px; height:22px; border-radius:50%;
  background:var(--primary); color:#fff;
  font-size:9px; font-weight:700;
  display:inline-flex; align-items:center; justify-content:center;
  flex-shrink:0; border:1.5px solid var(--white);
  box-shadow: 0 0 0 1px var(--border);
}
.filter-badge { display:inline-flex; align-items:center; gap:4px; background:var(--primary-light); color:var(--primary); font-size:12px; font-weight:600; padding:3px 10px; border-radius:var(--radius-full); }
.kanban-empty { padding:48px; text-align:center; color:var(--text-muted); font-size:13px; }

/* Backlog */
.backlog-wrap { padding:24px; }
.backlog-header { display:flex; align-items:center; gap:16px; margin-bottom:20px; }
.backlog-header h2 { margin:0; font-size:20px; }
.backlog-list { display:flex; flex-direction:column; gap:4px; }
.backlog-sprint { border:1px solid var(--border); border-radius:10px; overflow:hidden; }
.backlog-sprint-header { display:flex; align-items:center; gap:10px; padding:12px 16px; cursor:pointer; background:var(--bg-secondary); }
.backlog-sprint-header:hover { background:var(--bg-hover); }
.backlog-sprint-toggle { color:var(--text-muted); font-size:10px; width:12px; }
.backlog-sprint-label { font-size:14px; font-weight:600; flex:1; }
.backlog-sprint-dates { font-size:12px; font-weight:400; color:var(--text-muted); margin-left:8px; }
.backlog-sprint-tasks { font-size:12px; color:var(--text-muted); }
.backlog-sprint-hours { display:flex; gap:4px; margin-left:auto; }
.bsh { font-size:12px; padding:2px 8px; border-radius:4px; font-weight:600; }
.bsh-total { background:var(--bg-tertiary); color:var(--text-secondary); }
.bsh-prog  { background:#dbeafe; color:#2563eb; }
.bsh-done  { background:#dcfce7; color:#16a34a; }
.backlog-sprint-actions { display:flex; gap:6px; }
.backlog-sprint-body { padding:0 0 8px; }
.backlog-table { width:100%; border-collapse:collapse; font-size:13px; }
.backlog-table th { padding:8px 12px; text-align:left; font-size:11px; color:var(--text-muted); border-bottom:1px solid var(--border); font-weight:600; }
.backlog-row { cursor:pointer; }
.backlog-row:hover td { background:var(--bg-hover); }
.backlog-row td { padding:7px 12px; border-bottom:1px solid var(--border); }
.backlog-empty { padding:16px; color:var(--text-muted); font-size:13px; text-align:center; }
.backlog-add-row { padding:8px 12px; }

/* Task Status Badges */
.task-status-badge { display:inline-block; padding:2px 8px; border-radius:4px; font-size:11px; font-weight:600; }
.status-todo        { background:#f1f5f9; color:#64748b; }
.status-inprogress  { background:#dbeafe; color:#2563eb; }
.status-review_intern { background:#fef3c7; color:#d97706; }
.status-review_extern { background:#ede9fe; color:#7c3aed; }
.status-done        { background:#dcfce7; color:#16a34a; }
.overdue            { color:var(--red,#e74c3c) !important; }

/* Task Detail Modal */
.task-detail { display:grid; grid-template-columns:1fr 260px; gap:24px; }
.task-detail-main { display:flex; flex-direction:column; gap:12px; min-width:0; overflow:hidden; }
.task-detail-side { min-width:0; }
.task-detail-side { display:flex; flex-direction:column; gap:16px; border-left:1px solid var(--border); padding-left:20px; }
.task-field { display:flex; flex-direction:column; gap:4px; }
.task-field label { font-size:11px; font-weight:600; color:var(--text-muted); text-transform:uppercase; letter-spacing:.4px; }
.task-fields-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.task-input { width:100%; box-sizing:border-box; padding:7px 10px; border:1px solid var(--border); border-radius:6px; background:var(--bg-secondary); color:var(--text-primary); font-size:13px; font-family:inherit; resize:vertical; }
.task-input:focus { outline:none; border-color:var(--violet); }
.task-meta-info { display:flex; flex-direction:column; gap:6px; font-size:12px; color:var(--text-secondary); }
.task-subtasks-header { font-size:12px; font-weight:600; color:var(--text-muted); text-transform:uppercase; margin-bottom:6px; }
.task-parent-link { display:inline-flex; align-items:center; gap:4px; font-size:12px; color:var(--blue); background:none; border:none; padding:0; cursor:pointer; margin-bottom:4px; }
.task-parent-link:hover { text-decoration:underline; }
.subtask-row { display:flex; align-items:center; gap:6px; padding:5px 0; font-size:12px; cursor:pointer; border-bottom:1px solid var(--border); width:100%; background:none; border-left:none; border-right:none; border-top:none; text-align:left; color:inherit; font-family:inherit; }
.subtask-row:hover { color:var(--violet); }
.modal-actions { display:flex; align-items:center; gap:8px; margin-top:20px; padding-top:16px; border-top:1px solid var(--border); }
.modal-lg .modal-box { max-width:800px; width:90vw; }

/* Releases */
.releases-wrap { padding:24px; }
.releases-header { display:flex; align-items:center; gap:16px; margin-bottom:20px; }
.releases-header h3 { margin:0 0 12px; font-size:16px; }
.releases-header h2 { margin:0; font-size:20px; }
.releases-global { margin-bottom:32px; }
.release-month-group { margin-bottom:16px; }
.release-month-title { font-size:14px; font-weight:700; color:var(--text-secondary); margin-bottom:8px; padding:4px 0; border-bottom:1px solid var(--border); }
.release-row-compact { display:flex; align-items:center; gap:10px; padding:8px 12px; border-radius:8px; cursor:pointer; font-size:13px; }
.release-row-compact:hover { background:var(--bg-hover); }
.release-client-tag { font-size:11px; background:var(--bg-tertiary); padding:1px 6px; border-radius:4px; color:var(--text-muted); }
.release-status-badge { display:inline-block; padding:2px 7px; border-radius:4px; font-size:10px; font-weight:700; letter-spacing:.3px; }
.status-unreleased { background:#fef3c7; color:#d97706; }
.status-released   { background:#dcfce7; color:#16a34a; }
.releases-divider { border:none; border-top:2px solid var(--border); margin:24px 0; }
.releases-by-client { }
.releases-client-group { margin-bottom:24px; }
.releases-client-name { font-size:15px; font-weight:700; margin-bottom:8px; }
.releases-table { width:100%; border-collapse:collapse; font-size:13px; margin-bottom:8px; }
.releases-table th { text-align:left; padding:8px 10px; font-size:11px; color:var(--text-muted); border-bottom:2px solid var(--border); font-weight:600; }
.releases-table td { padding:8px 10px; border-bottom:1px solid var(--border); }
.release-progress-bar { display:inline-block; width:80px; height:8px; background:var(--bg-tertiary); border-radius:4px; overflow:hidden; vertical-align:middle; margin-right:6px; }
.release-progress-bar div { height:100%; background:var(--violet); border-radius:4px; }
.releases-empty { padding:32px; text-align:center; color:var(--text-muted); }
.release-milestone-row { display:flex; align-items:center; gap:8px; padding:6px 12px; border-radius:6px; font-size:13px; }
.release-milestone-row:hover { background:var(--bg-hover); }

/* Wiki Task-Suche Zeilen */
.wlt-task-row { display:flex; align-items:center; gap:8px; padding:7px 8px; border-radius:6px; cursor:pointer; font-size:13px; }
.wlt-task-row:hover { background:var(--bg-hover); }

/* Wiki Slash Command Menu */
/* Wiki Task-Links */
.wiki-task-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 12px;
  font-weight: 500;
  color: #5A467D;
  text-decoration: none;
  cursor: pointer;
}
.wiki-task-link:hover {
  background: #ede9f5;
  border-color: #5A467D;
  text-decoration: none;
}

/* ─── Bild: Resize & Ausrichtung ───────────────────────────────────────────── */
.image-wrapper {
  margin: 8px 0;
  line-height: 0;
}
.image-resizable {
  display: inline-block;
  position: relative;
  max-width: 100%;
  line-height: 0;
}
.image-resizable img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}
/* Toolbar (Ausrichtung) — nur bei Selektion sichtbar */
.image-toolbar {
  display: none;
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30,20,50,0.82);
  border-radius: 8px;
  padding: 4px 6px;
  gap: 2px;
  z-index: 20;
  white-space: nowrap;
}
.ProseMirror-selectednode .image-toolbar {
  display: flex;
}
.image-toolbar button {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  padding: 3px 8px;
  border-radius: 5px;
  line-height: 1;
}
.image-toolbar button:hover {
  background: rgba(255,255,255,0.18);
}
/* Resize-Handle — nur bei Selektion sichtbar */
.image-resize-handle {
  display: none;
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  background: #fff;
  border: 2px solid var(--violet, #6c4da9);
  border-radius: 3px;
  cursor: se-resize;
  z-index: 20;
}
.ProseMirror-selectednode .image-resize-handle {
  display: block;
}
/* Auswahlrahmen */
.ProseMirror-selectednode .image-resizable {
  outline: 2px solid var(--violet, #6c4da9);
  border-radius: 4px;
}

/* + Einfügen Button */
.tt-insert-btn {
  color: var(--violet, #6c4da9) !important;
  font-weight: 600 !important;
  border: 1px solid var(--violet, #6c4da9) !important;
  border-radius: 6px !important;
  padding: 3px 10px !important;
}
.tt-insert-btn:hover {
  background: var(--bg-hover, #f3f0ff) !important;
}

/* Tabellen-Toolbar */
.tt-label {
  font-size: 11px;
  color: var(--text-muted);
  padding: 0 4px;
  align-self: center;
  white-space: nowrap;
}
.tt-cell-color {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  padding: 2px;
  background: none;
  vertical-align: middle;
}

/* Bild-Upload */
.wi-file-input {
  padding: 6px 4px;
  cursor: pointer;
}
.wi-or {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin: 6px 0;
}

#wiki-slash-menu {
  position: fixed;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border, #e0d9f0);
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,.18);
  min-width: 240px;
  z-index: 99999;
  padding: 4px;
  isolation: isolate;
}
.wiki-slash-item {
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.wiki-slash-item:hover {
  background: var(--bg-hover, #f3f0fa);
}
.wiki-slash-item.active {
  background: #ede9f7;
  color: #5A467D;
  font-weight: 500;
}

/* Angebot → Aufgaben Dialog */
.ctf-wrap { max-height:60vh; overflow-y:auto; }
.ctf-project { border:1px solid var(--border); border-radius:8px; padding:12px; margin-bottom:12px; }
.ctf-project-header { display:flex; align-items:center; gap:12px; margin-bottom:10px; }
.ctf-task-row, .ctf-subtask-row { display:flex; align-items:center; gap:6px; padding:4px 0; border-bottom:1px solid var(--border); }
.ctf-subtask-row { padding-left:20px; }
.ctf-indent { color:var(--text-muted); }
.ctf-title { flex:1; min-width:0; }
.ctf-hours { width:60px; }
.ctf-sprint { width:130px; }
.ctf-assignee { width:120px; }
.ctf-task-rel { width:120px; }

/* ─── Projekt-Cockpit ───────────────────────────────────────────────────────── */
.cockpit-section { background:var(--bg); border:1px solid var(--border); border-radius:10px; padding:18px 20px; margin-top:24px; }
.cockpit-title { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--text-muted); margin-bottom:14px; }
.cockpit-bars { display:flex; flex-direction:column; gap:10px; margin-bottom:16px; }
.cockpit-bar-row { display:flex; align-items:center; gap:10px; }
.cockpit-bar-label { font-size:12px; color:var(--text-muted); width:110px; flex-shrink:0; }
.cockpit-bar-track { flex:1; height:8px; background:var(--border); border-radius:4px; overflow:hidden; min-width:60px; }
.cockpit-bar-fill { height:8px; background:var(--blue); border-radius:4px; transition:width .3s; }
.cockpit-bar-fill.cockpit-bar-warn { background:#E74C3C; }
.cockpit-bar-value { font-size:12px; color:var(--text-muted); white-space:nowrap; }
.cockpit-warn-icon { color:#E74C3C; font-size:13px; }
.cockpit-stats { display:flex; gap:16px; flex-wrap:wrap; padding:12px 0; border-top:1px solid var(--border); border-bottom:1px solid var(--border); margin-bottom:16px; }
.cockpit-stat { display:flex; align-items:center; gap:6px; font-size:13px; }
.cockpit-stat strong { font-size:16px; font-weight:700; }
.cockpit-stat small { color:var(--text-muted); font-size:11px; }
.task-status-dot { display:inline-block; width:9px; height:9px; border-radius:50%; background:var(--border); }
.task-status-dot.status-todo { background:#DFE1E6; }
.task-status-dot.status-inprogress { background:#0052CC; }
.task-status-dot.status-review_intern { background:#FF991F; }
.task-status-dot.status-review_extern { background:#6554C0; }
.task-status-dot.status-done { background:#36B37E; }
.cockpit-team-title { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--text-muted); margin-bottom:10px; }
.cockpit-team { display:flex; flex-direction:column; gap:8px; }
.cockpit-team-row { display:flex; align-items:center; gap:10px; }
.cockpit-team-name { font-size:13px; width:90px; flex-shrink:0; }
.cockpit-team-hours { font-size:12px; color:var(--text-muted); white-space:nowrap; width:50px; text-align:right; }
.cockpit-team-chf { font-size:12px; color:var(--text-muted); white-space:nowrap; width:80px; text-align:right; }

/* ─── Zeiterfassung (Task-Detail) ──────────────────────────────────────────── */
.task-time-section { border-top:1px solid var(--border); padding-top:14px; margin-top:4px; }
.time-entry-row { display:flex; align-items:center; gap:8px; padding:5px 0; border-bottom:1px solid var(--border); font-size:12px; }
.te-date { color:var(--text-muted); white-space:nowrap; width:70px; flex-shrink:0; }
.te-user { font-weight:600; width:70px; flex-shrink:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.te-hours { font-weight:700; color:var(--blue); width:36px; flex-shrink:0; text-align:right; }
.te-note { flex:1; color:var(--text-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.te-del { color:var(--text-muted); font-size:11px; padding:2px 4px; opacity:.5; }
.te-del:hover { color:var(--red,#E74C3C); opacity:1; }
.te-add-toggle { margin-top:8px; }
.te-add-row { display:flex; align-items:center; gap:6px; margin-top:8px; flex-wrap:wrap; }
.te-add-row .task-input { padding:5px 8px; font-size:12px; }

/* ─── Angebote: has_tasks Badge ─────────────────────────────────────────────── */
.offer-tasks-badge { display:inline-block; background:var(--blue-light); color:var(--blue); border-radius:12px; padding:2px 8px; font-size:11px; font-weight:600; white-space:nowrap; }

/* ─── Projektübersicht-Tabelle ──────────────────────────────────────────────── */
.overview-table { width:100%; border-collapse:collapse; }
.overview-table th { text-align:left; padding:8px 12px; font-size:11px; color:var(--text-muted); border-bottom:2px solid var(--border); font-weight:600; text-transform:uppercase; letter-spacing:.04em; }
.overview-table td { padding:10px 12px; border-bottom:1px solid var(--border); vertical-align:middle; }
.overview-table tr:hover td { background:var(--bg); }
.ov-bar-track { display:inline-block; width:100%; height:6px; background:var(--border); border-radius:3px; overflow:hidden; }
.ov-bar-fill { height:6px; background:var(--blue); border-radius:3px; }
.ov-bar-fill.cockpit-bar-warn { background:#E74C3C; }
.ov-client-row td { background:var(--bg-secondary) !important; }
.ov-client-row:hover td { background:var(--bg-hover) !important; }
.ov-parent-row td { background:var(--bg) !important; }
.ov-parent-row:hover td { background:var(--bg-hover) !important; }

/* ─── CSS Tooltip ───────────────────────────────────────────────────────────── */
.yory-tip {
  position: relative; cursor: help; font-size: 12px;
  color: var(--text-muted); display: inline-flex;
}
.yory-tip::after {
  content: attr(data-tip);
  position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: #1D2125; color: #fff; font-size: 12px; font-weight: 400;
  padding: 6px 10px; border-radius: 6px; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity .15s;
  z-index: 999; box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.yory-tip:hover::after { opacity: 1; }

/* ─── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
  .sidebar.mobile-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main { margin-left: 0 !important; }
  .stats-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .page-view, .page-edit, .dashboard { padding: 20px 16px; }
  .db-mini-stats { grid-template-columns: repeat(2,1fr); }
  .db-grid { grid-template-columns: 1fr; }
  .db-hero { padding: 24px 20px; }
  .db-hero h1 { font-size: 20px; }
  .db-greeting-day { display: block; margin-left: 0; margin-top: 4px; }
  .topnav-center { display: none; }
  .module-tab span { display: none; }
  .page-header { flex-direction: column; gap: 10px; }
  .task-detail { grid-template-columns: 1fr; }
  .clients-overview-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .db-mini-stats { grid-template-columns: 1fr 1fr; }
  .clients-overview-grid { grid-template-columns: 1fr; }
  .offers-table th:nth-child(n+4), .offers-table td:nth-child(n+4) { display: none; }
  .modal { border-radius: var(--radius-lg) var(--radius-lg) 0 0; margin-top: auto; }
  .modal-overlay { align-items: flex-end; padding: 0; }
}

/* ─── Task-Kommentare ───────────────────────────────────────────────────────── */
.task-comments-section {
  border-top: 1px solid var(--border);
  padding-top: 16px; margin-top: 8px;
}
.task-comment-item {
  display: flex; gap: 10px; padding: 10px 12px;
  border-radius: var(--radius); background: var(--bg);
  border: 1px solid var(--border);
}
.task-comment--teams {
  background: var(--primary-light); border-color: #d0c8ed;
}
.task-comment-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.task-comment-body { flex: 1; min-width: 0; }
.task-comment-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--text-muted); margin-bottom: 4px;
  flex-wrap: wrap;
}
.task-comment-meta strong { color: var(--text); font-size: 12px; }
.task-comment-source-badge {
  font-size: 10px; font-weight: 700; padding: 1px 6px;
  background: var(--primary); color: #fff; border-radius: var(--radius-full);
}
.task-comment-text { font-size: 13px; line-height: 1.5; color: var(--text); }

/* ─── Offer-Tasks-Section ───────────────────────────────────────────────────── */
.offer-tasks-section { margin-top:24px; padding-top:16px; border-top:1px solid var(--border); }
.offer-tasks-section h4 { font-size:13px; font-weight:600; color:var(--text-muted); margin-bottom:10px; text-transform:uppercase; letter-spacing:.04em; }

/* ─── Task-Key Link ─────────────────────────────────────────────────────────── */
.task-key-link { cursor:pointer; user-select:none; border-radius:3px; }
.task-key-link:hover { background:var(--violet-light,#ede9f8); color:var(--violet); }

/* ─── Hierarchie-View ───────────────────────────────────────────────────────── */
.hierarchy-wrap { padding:24px; max-width:900px; }
.hierarchy-project { margin-bottom:24px; }
.hierarchy-project-header {
  display:flex; align-items:center; gap:8px; padding:8px 10px;
  border-radius:6px; font-weight:600; font-size:13px;
  background:var(--bg); border:1px solid var(--border);
  margin-bottom:6px;
}
.hierarchy-project-header.drag-over { background:var(--violet-light,#ede9f8); outline:2px dashed var(--violet); }
.hierarchy-row {
  display:flex; align-items:center; gap:8px; padding:6px 10px;
  border-radius:6px; cursor:pointer; font-size:13px;
  border:1px solid transparent;
}
.hierarchy-row:hover { background:var(--bg); border-color:var(--border); }
.hierarchy-row.hierarchy-subtask { padding-left:36px; }
.hierarchy-row.hierarchy-subtask2 { padding-left:60px; }
.hierarchy-row-title { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.hierarchy-row-meta { font-size:11px; color:var(--text-muted); white-space:nowrap; }
.hierarchy-drag-handle { color:var(--text-muted); cursor:grab; font-size:14px; line-height:1; }
.hier-title { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.hier-add-btn {
  opacity:0; padding:1px 7px; border-radius:4px; border:1px solid var(--border);
  background:var(--bg); color:var(--text-muted); font-size:13px; cursor:pointer;
  line-height:1.4; transition:opacity .1s;
}
.hierarchy-row:hover .hier-add-btn { opacity:1; }
.hier-add-btn:hover { background:var(--violet-light,#ede9f8); color:var(--violet); border-color:var(--violet); }
.hier-add-proj {
  opacity:1; margin-left:8px; font-size:12px; padding:2px 10px;
}
.hierarchy-project.hier-drop-over { outline:2px dashed var(--violet); outline-offset:-2px; border-radius:8px; }
.hier-assignee {
  width:24px; height:24px; border-radius:50%; background:var(--violet,#5A467D);
  color:#fff; font-size:10px; font-weight:700; display:flex; align-items:center;
  justify-content:center; flex-shrink:0;
}

/* ─── Kalender-View ─────────────────────────────────────────────────────────── */
.calendar-wrap { padding:24px; }
.calendar-nav {
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:16px;
}
.calendar-nav-title { font-size:16px; font-weight:700; }
.calendar-nav-btns { display:flex; align-items:center; gap:8px; }
.calendar-mode-toggle { display:flex; gap:4px; }
.calendar-mode-btn {
  padding:4px 12px; border-radius:5px; border:1px solid var(--border);
  background:var(--white); font-size:12px; cursor:pointer; color:var(--text);
}
.calendar-mode-btn.active { background:var(--violet); color:#fff; border-color:var(--violet); }
.calendar-weekday-header {
  display:grid; grid-template-columns:repeat(7,1fr);
  background:var(--bg); border:1px solid var(--border);
  border-bottom:none; border-radius:8px 8px 0 0;
}
.calendar-weekday-header div {
  padding:6px 8px; font-size:11px; font-weight:600;
  color:var(--text-muted); text-align:center; text-transform:uppercase;
}
.calendar-grid-header {
  display:grid; grid-template-columns:repeat(7,1fr);
  background:var(--border); gap:1px;
  border:1px solid var(--border); border-bottom:none;
}
.calendar-weeks {
  border:1px solid var(--border); border-top:none;
  border-radius:0 0 8px 8px; overflow:hidden;
}
.calendar-week-row { border-bottom:1px solid var(--border); }
.calendar-week-row:last-child { border-bottom:none; }
.cal-event-strip {
  display:grid; grid-template-columns:repeat(7,1fr);
  gap:2px; padding:2px 2px 0; background:var(--white);
  min-height:22px;
}
.cal-span-bar {
  font-size:10px; font-weight:600; color:#fff;
  padding:2px 7px; white-space:nowrap; overflow:hidden;
  text-overflow:ellipsis; cursor:pointer; line-height:18px;
  min-height:18px;
}
.cal-milestone-bar { background:#7c3aed !important; border-radius:20px !important; }
.calendar-cells-row {
  display:grid; grid-template-columns:repeat(7,1fr);
  gap:0; background:var(--border); gap:1px;
}
.calendar-day-header {
  background:var(--bg); padding:6px 8px; font-size:11px;
  font-weight:600; color:var(--text-muted); text-align:center;
  text-transform:uppercase; letter-spacing:.04em;
}
.calendar-cell {
  background:var(--white); min-height:90px; padding:4px 6px;
}
.calendar-cell-header {
  font-size:11px; font-weight:600; color:var(--text-muted);
  margin-bottom:4px; padding:2px 0;
}
.calendar-cell.today .calendar-cell-header {
  color:var(--violet); font-size:12px;
}
.calendar-cell.today { background:var(--violet-light,#f8f6ff); }
.calendar-cell.other-month { background:var(--bg); }
.calendar-cell.other-month .calendar-cell-header { opacity:.45; }
.calendar-chip {
  font-size:11px; padding:2px 6px; border-radius:10px;
  margin-bottom:2px; cursor:pointer;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  color:#fff; display:block;
}
.calendar-chip:hover { opacity:.85; }
.calendar-week-grid {
  display:grid; grid-template-columns:repeat(7,1fr);
}
.calendar-week-col {
  border-right:1px solid var(--border);
  min-height:120px;
}
.calendar-week-col:last-child { border-right:none; }
.calendar-week-col.today { background:var(--violet-light,#f8f6ff); }
.calendar-week-col-header {
  padding:6px 8px; font-size:12px; font-weight:600;
  background:var(--bg); text-align:center; border-bottom:1px solid var(--border);
}
.calendar-week-col.today .calendar-week-col-header { background:var(--violet-light,#f8f6ff); color:var(--violet); }
.calendar-week-col-body { padding:6px; }
.calendar-week-card {
  font-size:12px; padding:4px 8px; border-radius:6px;
  margin-bottom:4px; cursor:pointer; color:#fff;
}
.calendar-week-card:hover { opacity:.85; }

/* Sprint-Anzeige im Kalender */
.calendar-sprint-chip {
  font-size:10px; padding:2px 6px; border-radius:10px;
  margin-bottom:2px; color:#fff; white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis; display:block;
  font-weight:600;
}
.calendar-release-chip {
  font-size:10px; padding:2px 6px; border-radius:10px;
  margin-bottom:2px; color:#fff; white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis; display:block;
  font-weight:600; cursor:pointer;
}
.cal-release-start { background:#059669; }
.cal-release-end   { background:#d97706; }
.calendar-milestone-chip {
  font-size:10px; padding:2px 6px; border-radius:10px;
  margin-bottom:2px; background:#7c3aed; color:#fff;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  display:block; font-weight:600; cursor:pointer;
}
.calendar-sprint-bar {
  display:flex; flex-wrap:wrap; gap:6px; margin-bottom:12px;
}
.calendar-sprint-banner {
  display:flex; align-items:center; gap:8px;
  padding:6px 12px; border-radius:6px; color:#fff;
  font-size:12px; font-weight:600;
}
.calendar-sprint-dates { font-weight:400; opacity:.85; font-size:11px; }
.calendar-sprint-status {
  background:rgba(255,255,255,.25); border-radius:10px;
  padding:1px 8px; font-size:10px; margin-left:auto;
}

/* ─── Freigaben-Modul ───────────────────────────────────────────────────────── */
.freigaben-nav { padding:8px 0; }
.freigaben-nav-item {
  display:flex; align-items:center; gap:8px;
  padding:7px 16px; font-size:13px; cursor:pointer;
  border-radius:6px; margin:1px 8px; color:var(--text);
  transition:background .12s;
}
.freigaben-nav-item:hover  { background:var(--bg); }
.freigaben-nav-item.active { background:#fff7ed; color:var(--orange,#ea580c); font-weight:600; }

/* ─── HR / Personal-Modul ──────────────────────────────────────────────────── */
.hr-nav { padding:8px 0; }
.hr-nav-item {
  display:flex; align-items:center; gap:8px;
  padding:7px 16px; font-size:13px; cursor:pointer;
  border-radius:6px; margin:1px 8px; color:var(--text);
  transition:background .12s;
}
.hr-nav-item:hover { background:var(--bg); }
.hr-nav-item.active { background:var(--violet-light,#f0edfb); color:var(--violet); font-weight:600; }

/* Balance grid */
.hr-balance-grid { display:flex; gap:16px; flex-wrap:wrap; }
.hr-balance-card {
  background:var(--white); border:1px solid var(--border); border-radius:10px;
  padding:20px 24px; min-width:180px; text-align:center;
}
.hr-balance-title { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted); margin-bottom:12px; }
.hr-balance-ring-wrap { display:flex; justify-content:center; margin-bottom:12px; }
.hr-balance-sub { display:flex; gap:8px; justify-content:center; flex-wrap:wrap; }
.hr-balance-chip { font-size:12px; padding:3px 10px; border-radius:20px; }

/* Section titles */
.hr-section-title { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted); margin-bottom:8px; display:block; }
.hr-section-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }

/* Absence list */
.hr-absence-list { display:flex; flex-direction:column; gap:2px; }
.hr-absence-row {
  display:flex; align-items:center; gap:8px; padding:7px 10px;
  border-radius:6px; font-size:13px; background:var(--white);
  border:1px solid var(--border);
}
.hr-absence-row:hover { background:var(--bg); }
.hr-absence-type-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.hr-absence-type { font-weight:500; white-space:nowrap; }
.hr-absence-dates { color:var(--text-muted); font-size:12px; white-space:nowrap; }
.hr-absence-days { color:var(--text-muted); font-size:12px; white-space:nowrap; margin-left:auto; }
.hr-absence-status { font-size:11px; padding:2px 8px; border-radius:10px; white-space:nowrap; }
.hr-status-pending  { background:#fef3c7; color:#92400e; }
.hr-status-approved { background:#d1fae5; color:#065f46; }
.hr-status-rejected { background:#fee2e2; color:#991b1b; }

/* Two-col layout */
.hr-two-col { display:grid; grid-template-columns:1fr 1fr; gap:24px; }
@media(max-width:700px) { .hr-two-col { grid-template-columns:1fr; } }

/* Holiday list */
.hr-holiday-list { display:flex; flex-direction:column; gap:2px; }
.hr-holiday-row { display:flex; align-items:center; gap:8px; padding:6px 8px; border-radius:6px; font-size:13px; border:1px solid var(--border); background:var(--white); }
.hr-holiday-row:hover { background:var(--bg); }
.hr-holiday-date { font-size:12px; color:var(--text-muted); white-space:nowrap; min-width:42px; }
.hr-holiday-days { font-size:12px; font-weight:700; color:var(--violet); min-width:30px; }
.hr-holiday-name { flex:1; }

/* Requests */
.hr-requests-list { display:flex; flex-direction:column; gap:12px; }
.hr-request-card { background:var(--white); border:1px solid var(--border); border-radius:8px; padding:14px 16px; }
.hr-request-header { display:flex; align-items:center; gap:8px; font-size:13px; }

/* Timeline table */
.hr-timeline-table { border-collapse:collapse; font-size:12px; min-width:100%; }
.hr-timeline-table th, .hr-timeline-table td { border:1px solid var(--border); padding:2px 3px; vertical-align:top; }
.hr-tl-name-col { min-width:120px; max-width:140px; padding:6px 8px; font-weight:600; font-size:12px; position:sticky; left:0; background:var(--white); z-index:2; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.hr-timeline-table thead th.hr-tl-name-col { z-index:3; }
.hr-tl-day { text-align:center; font-size:10px; font-weight:600; padding:4px 2px; color:var(--text-muted); white-space:nowrap; }
.hr-tl-cell { height:28px; min-width:32px; padding:2px; vertical-align:top; }
.hr-tl-weekend  { background:#f1f2f4; }
.hr-tl-holiday  { background:#fffbeb; border-top:3px solid #f59e0b !important; }
.hr-tl-today    { outline:2px solid var(--violet); outline-offset:-2px; }
.hr-tl-abs-pending  { background:#f3f4f6; border-top:3px dashed #9ca3af; }
.hr-tl-chip-pending { background:#e5e7eb; color:#6b7280; }
.hr-tl-abs-vacation { background:#fef9c3; border-top:3px solid #f59e0b; }
.hr-tl-abs-sick     { background:#fee2e2; border-top:3px solid #ef4444; }
.hr-tl-abs-event    { background:#dbeafe; border-top:3px solid #3b82f6; }
.hr-tl-abs-other    { background:#f3f4f6; border-top:3px solid #9ca3af; }

/* Absence chip inside cell */
.hr-tl-abs-chip {
  font-size:9px; font-weight:600; border-radius:3px;
  padding:1px 3px; margin-bottom:2px;
  display:flex; align-items:center; gap:2px;
  overflow:hidden; white-space:nowrap;
}
.hr-tl-abs-chip span { overflow:hidden; text-overflow:ellipsis; }
.hr-tl-chip-vacation { background:#fde68a; color:#92400e; }
.hr-tl-chip-sick     { background:#fecaca; color:#991b1b; }
.hr-tl-chip-event    { background:#bfdbfe; color:#1e40af; }
.hr-tl-chip-other    { background:#e5e7eb; color:#374151; }
.hr-tl-chip-holiday  { background:#fde68a; color:#78350f; }
/* Multi-day continuation: hide label on middle days */
.hr-tl-abs-mid span, .hr-tl-abs-end span { display:none; }
.hr-tl-task {
  font-size:10px; color:#fff; border-radius:3px; padding:1px 4px;
  margin-bottom:2px; cursor:pointer; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  max-width:100%;
}
.hr-tl-task:hover { opacity:.85; }
.hr-tl-release { text-align:center; color:var(--violet); font-size:12px; cursor:pointer; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; padding:1px 2px; }
.hr-tl-release:hover { opacity:.75; }
.hr-tl-release-label { font-size:10px; font-weight:600; display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:100%; }
.hr-tl-release-cell { background:var(--bg); }
.hr-tl-cell-selecting {
  background: rgba(108, 77, 169, 0.18) !important;
  outline: 2px solid var(--violet) !important;
  outline-offset: -2px;
  cursor: cell !important;
}

/* Table wrapper for overflow */
.table-wrap { overflow-x:auto; }
.data-table { border-collapse:collapse; width:100%; font-size:13px; }
.data-table th { padding:8px 12px; text-align:left; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted); border-bottom:2px solid var(--border); }
.data-table td { padding:10px 12px; border-bottom:1px solid var(--border); vertical-align:middle; }
.data-table tr:last-child td { border-bottom:none; }
.data-table tr:hover td { background:var(--bg); }

/* ── Backlog: Drag & Drop / Bulk / Sprint Picker ──────────────────────── */
.bl-bulk-bar.hidden { display:none; }
.bl-bulk-bar {
  display:flex; align-items:center; gap:12px;
  background:#B588F2; color:#fff;
  padding:10px 16px; border-radius:8px; margin-bottom:12px;
  font-size:13px; font-weight:600;
}
.bl-bulk-bar #blBulkCount { color:#fff; }
.bl-bulk-bar .form-input { background:#fff; color:#1a1a1a; border:none; font-size:12px; padding:4px 8px; width:auto; }
.bl-bulk-bar .btn { font-size:12px; padding:4px 12px; }
.bl-bulk-bar .btn-primary { background:#fff; color:#7c3aed; border:none; }
.bl-bulk-bar .btn-primary:hover { background:#ede9fe; }
.bl-bulk-bar .btn-secondary { background:transparent; color:#fff; border:1px solid rgba(255,255,255,.5); }
.bl-bulk-bar .btn-secondary:hover { background:rgba(255,255,255,.15); }

.bl-subtask-row td { background:#fafafa; }
.bl-subtask-row td:nth-child(2) { padding-left:24px; }
.bl-subtask-row:hover td { background:#f3f0ff; }

.backlog-row.bl-dragging { opacity:.4; }
.backlog-row.bl-selected td { background:color-mix(in srgb, var(--violet) 8%, transparent); }
.backlog-sprint.bl-drop-over { outline:2px dashed var(--violet); outline-offset:-2px; border-radius:8px; }

.bl-sprint-btn {
  background:none; border:none; cursor:pointer;
  color:var(--text-muted); padding:2px 6px; border-radius:4px;
  font-size:14px; line-height:1;
  transition:background .15s, color .15s;
}
.bl-sprint-btn:hover { background:var(--bg-hover,#f3f0ff); color:var(--violet); }

.bl-sprint-picker {
  position:fixed; z-index:9999;
  background:#fff; border:1px solid var(--border);
  border-radius:8px; box-shadow:0 4px 16px rgba(0,0,0,.15);
  min-width:200px; max-height:280px; overflow-y:auto;
  padding:4px 0;
}
.bl-sprint-option {
  padding:8px 14px; font-size:13px; cursor:pointer;
  color:var(--text);
  transition:background .12s;
}
.bl-sprint-option:hover { background:var(--bg); }
.bl-sprint-option.active { font-weight:600; color:var(--violet); }

/* ── TipTap WYSIWYG Editor ────────────────────────────────────────────── */
.tiptap-editor-wrap .ProseMirror {
  min-height: 420px; padding: 20px 24px; outline: none;
  font-size: 15px; line-height: 1.75; color: var(--text);
}
.tiptap-editor-wrap .ProseMirror p.is-editor-empty:first-child::before {
  content: attr(data-placeholder); color: var(--text-muted);
  pointer-events: none; float: left; height: 0;
}
/* Überschriften im Editor */
.tiptap-editor-wrap .ProseMirror h1 { font-size: 1.8em; font-weight: 700; margin: 20px 0 8px; }
.tiptap-editor-wrap .ProseMirror h2 { font-size: 1.4em; font-weight: 700; margin: 16px 0 6px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.tiptap-editor-wrap .ProseMirror h3 { font-size: 1.15em; font-weight: 600; margin: 14px 0 4px; }
/* Task List Checkboxen (Editor + View) */
.tiptap-editor-wrap ul[data-type="taskList"],
.page-content ul[data-type="taskList"] { list-style: none; padding: 0; margin: 8px 0; }
.tiptap-editor-wrap ul[data-type="taskList"] li,
.page-content ul[data-type="taskList"] li { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 4px; }
.tiptap-editor-wrap ul[data-type="taskList"] li > label,
.page-content ul[data-type="taskList"] li > label { margin-top: 3px; cursor: pointer; }
.tiptap-editor-wrap ul[data-type="taskList"] li > label input[type="checkbox"],
.page-content ul[data-type="taskList"] li > label input[type="checkbox"] { cursor: pointer; width: 15px; height: 15px; }
.tiptap-editor-wrap ul[data-type="taskList"] li > div,
.page-content ul[data-type="taskList"] li > div { flex: 1; }
.page-content ul[data-type="taskList"] li[data-checked="true"] > div { text-decoration: line-through; color: var(--text-muted); }
/* Tabellen */
.tiptap-editor-wrap .ProseMirror table,
.page-content table { border-collapse: collapse; width: 100%; margin: 12px 0; }
.tiptap-editor-wrap .ProseMirror td,
.tiptap-editor-wrap .ProseMirror th,
.page-content td,
.page-content th { border: 1px solid var(--border); padding: 7px 10px; min-width: 60px; font-size: 14px; }
/* Kopfzeile (th) – violett + fett */
.tiptap-editor-wrap .ProseMirror th,
.page-content thead th { background: #5A467D; color: #fff; font-weight: 700; }
.page-content tbody th { background: var(--bg-tertiary, #ECEEF6); color: var(--text, #172B4D); font-weight: 600; }
/* Tabellenlinien-Modus */
.tiptap-editor-wrap .ProseMirror table.table-bordered td,
.tiptap-editor-wrap .ProseMirror table.table-bordered th,
.page-content table.table-bordered td,
.page-content table.table-bordered th { border: 2px solid #5A467D; }
.tiptap-editor-wrap .ProseMirror .selectedCell { background: rgba(108,77,169,.12); }
/* Toolbar */
.tiptap-toolbar {
  display: flex; flex-direction: column; gap: 0; padding: 4px 8px 6px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky; top: 0; z-index: 10;
}
.tt-row-main {
  display: flex; gap: 2px; flex-wrap: nowrap; align-items: center; padding: 2px 0;
  overflow-x: auto; scrollbar-width: none;
}
.tt-row-main::-webkit-scrollbar { display: none; }
.tt-row-table {
  display: flex; gap: 2px; flex-wrap: wrap; align-items: center;
  background: #ede9f7; border: 1px solid #c9bbee;
  border-radius: 7px; padding: 4px 10px; margin-top: 5px;
}
.tiptap-toolbar button {
  padding: 4px 8px; border-radius: 4px; background: none;
  border: none; cursor: pointer; font-size: 13px; color: var(--text);
  transition: background .12s;
}
.tiptap-toolbar button:hover { background: var(--bg-hover, #f3f0ff); }
.tiptap-toolbar button.is-active { background: #d8ceef; color: var(--violet); font-weight: 700; }
.tiptap-toolbar .tt-divider { width: 1px; background: var(--border); margin: 2px 4px; align-self: stretch; }
/* Code blocks */
.tiptap-editor-wrap .ProseMirror pre,
.page-content pre { background: #f4f4f4; border-radius: 6px; padding: 12px 14px; overflow: auto; margin: 12px 0; }
.tiptap-editor-wrap .ProseMirror pre code,
.page-content pre code { background: none; font-family: 'Courier New', monospace; font-size: 13px; color: #1a1a1a; }
.tiptap-editor-wrap .ProseMirror code,
.page-content code { background: #f4f4f4; padding: 1px 5px; border-radius: 3px; font-family: 'Courier New', monospace; font-size: 13px; color: #c7254e; }
