/* ===== alike. Design System — Style A ===== */

/* ── Newake display font ────────────────────────────── */
@font-face {
  font-family: 'Newake';
  src: url('/static/fonts/Newake.woff2') format('woff2'),
       url('/static/fonts/Newake.woff')  format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens: Light (default) ───────────────────────── */
:root {
  /* Surfaces */
  --bg:          #f7f7f8;
  --surface:     #ffffff;
  --surface-2:   #f2f2f4;
  --surface-3:   #eaeaed;
  --surface-hover: rgba(0,0,0,0.04);

  /* Text */
  --text-1:      #0f0f10;
  --text:        #0f0f10;
  --text-2:      #6b6b72;
  --text-3:      #ababaf;
  --text-4:      rgba(0,0,0,0.20);

  /* Backward-compat aliases */
  --text-muted: var(--text-2);
  --text-light-color: var(--text-3);

  /* Borders */
  --border:       rgba(0,0,0,0.07);
  --border-dark:  rgba(0,0,0,0.12);

  /* Accent — Brand Blue */
  --accent:       #1104c5;
  --accent-dark:  #0d03a0;
  --accent-light: rgba(18,4,197,0.08);

  /* Status */
  --success:  #22c55e;
  --warning:  #f59e0b;
  --danger:   #ef4444;
  --info:     #3b82f6;

  /* Aliases */
  --primary:       var(--accent);
  --primary-dark:  var(--accent-dark);
  --primary-light: var(--accent-light);

  /* Sidebar (stays dark in both modes) */
  --sidebar-bg:          #0f0f10;
  --sidebar-text:        rgba(255,255,255,0.78);
  --sidebar-text-muted:  rgba(255,255,255,0.36);
  --sidebar-active:      rgba(255,255,255,0.09);
  --sidebar-hover:       rgba(255,255,255,0.06);
  --sidebar-sep:         rgba(255,255,255,0.07);

  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.05);
  --shadow:    0 4px 12px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.05);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.10), 0 0 0 1px rgba(0,0,0,0.05);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.05);

  /* Border radius */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  /* Layout */
  --sidebar-w: 220px;
  --topbar-h:  56px;

  /* Animation */
  --transition: 0.13s cubic-bezier(0.4,0,0.2,1);
}

/* ── Tokens: Dark (manual override) ────────────────── */
[data-theme="dark"] {
  --bg:          #111113;
  --surface:     #1c1c1f;
  --surface-2:   #242428;
  --surface-3:   #2e2e33;
  --surface-hover: rgba(255,255,255,0.04);

  --text-1:      #f0f0f0;
  --text:        #f0f0f0;
  --text-2:      rgba(240,240,240,0.55);
  --text-3:      rgba(240,240,240,0.28);
  --text-4:      rgba(255,255,255,0.18);

  /* Backward-compat aliases */
  --text-muted: var(--text-2);
  --text-light-color: var(--text-3);

  --border:      rgba(255,255,255,0.07);
  --border-dark: rgba(255,255,255,0.13);

  --accent:      #5548f5;
  --accent-dark: #4538f0;
  --accent-light: rgba(85,72,245,0.10);

  --sidebar-bg:         #0a0a0b;
  --sidebar-text:       rgba(255,255,255,0.75);
  --sidebar-text-muted: rgba(255,255,255,0.32);
  --sidebar-active:     rgba(255,255,255,0.09);
  --sidebar-hover:      rgba(255,255,255,0.06);
  --sidebar-sep:        rgba(255,255,255,0.07);

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.05);
  --shadow:    0 4px 12px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.05);
}

/* ── Tokens: Dark (system auto) ────────────────────── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #111113;
    --surface:     #1c1c1f;
    --surface-2:   #242428;
    --surface-3:   #2e2e33;
    --surface-hover: rgba(255,255,255,0.04);

    --text-1:      #f0f0f0;
    --text:        #f0f0f0;
    --text-2:      rgba(240,240,240,0.55);
    --text-3:      rgba(240,240,240,0.28);
    --text-4:      rgba(255,255,255,0.18);

    /* Backward-compat aliases */
    --text-muted: var(--text-2);
    --text-light-color: var(--text-3);

    --border:      rgba(255,255,255,0.07);
    --border-dark: rgba(255,255,255,0.13);

    --accent:      #5548f5;
    --accent-dark: #4538f0;
    --accent-light: rgba(85,72,245,0.10);

    --sidebar-bg:         #0a0a0b;
    --sidebar-text:       rgba(255,255,255,0.75);
    --sidebar-text-muted: rgba(255,255,255,0.32);
    --sidebar-active:     rgba(255,255,255,0.09);
    --sidebar-hover:      rgba(255,255,255,0.06);
    --sidebar-sep:        rgba(255,255,255,0.07);

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.05);
    --shadow:    0 4px 12px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05);
    --shadow-lg: 0 16px 40px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.05);
  }
}

/* ── Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: 15px;
  /* iOS Safari vergrößert sonst Text in schmalen Containern automatisch —
     bläht z.B. die Dokument-Tabs und den Fließtext-Dropdown auf. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ── Typography ─────────────────────────────────────── */
h1, h2, h3, h4, h5, h6,
.page-title, .page-title-lg, .topbar-title, .card-title, .section-title {
  font-family: 'Newake', 'Poppins', sans-serif;
}
h1, h2, h3, h4 { line-height: 1.35; letter-spacing: 0.01em; }
.text-muted  { color: var(--text-2); }
.text-light  { color: var(--text-3); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.mono { font-family: 'Geist Mono', 'SF Mono', 'Fira Code', monospace; }

/* ── Utility ─────────────────────────────────────────── */
.mb-0  { margin-bottom: 0; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mt-0  { margin-top: 0; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.flex        { display: flex; }
.w-100       { width: 100%; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-3        { margin-top: 12px; }
.mt-4        { margin-top: 16px; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ===== App Layout ===== */
.app-layout { display: flex; min-height: 100vh; }

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

/* Logo */
.sidebar-logo {
  padding: 20px 16px 14px;
  border-bottom: 1px solid var(--sidebar-sep);
  flex-shrink: 0;
}
.logo-link { display: inline-block; text-decoration: none; }
.logo-wordmark {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  line-height: 1;
}
.logo-period { color: rgba(255,255,255,0.35); }
.sidebar-logo-img {
  max-height: 28px; max-width: 140px; width: auto;
  object-fit: contain;
}
/* Light logo: invert to white on dark sidebar background */
.sidebar-logo-light { filter: brightness(0) invert(1); }
/* Dark logo: shown as-is (designed for dark bg), hidden by default */
.sidebar-logo-dark { display: none; filter: none; }
/* In dark mode: swap to dark logo if one exists */
[data-theme="dark"] .sidebar-logo-light { display: none; }
[data-theme="dark"] .sidebar-logo-dark  { display: block; }

/* Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-section-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sidebar-text-muted);
  padding: 10px 8px 4px;
  display: block;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 450;
  transition: background var(--transition), color var(--transition);
  margin-bottom: 2px;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
}
.nav-item:hover  { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; }
.nav-icon { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.6; }

/* Finance nav accordion */
.nav-group-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 16px;
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.nav-group-toggle:hover { background: var(--sidebar-hover); color: #fff; }
.nav-group-toggle:hover .nav-icon { opacity: 1; }
.nav-group-toggle .nav-icon { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.6; }
.nav-group.open .nav-group-toggle { color: #fff; }
.nav-group.open .nav-group-toggle .nav-icon { opacity: 1; }
.nav-group-toggle .nav-group-arrow {
  margin-left: auto;
  width: 12px;
  height: 12px;
  opacity: 0.4;
  transition: transform 0.2s, opacity 0.15s;
}
.nav-group.open .nav-group-arrow { transform: rotate(90deg); opacity: 0.7; }

.nav-group-items {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  /* left border track */
  margin-left: 22px;
  padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,0.1);
}
.nav-group.open .nav-group-items { max-height: 600px; }

.nav-subitem {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  color: rgba(255,255,255,0.55);
  font-size: 13px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.nav-subitem:hover  { background: var(--sidebar-hover); color: rgba(255,255,255,0.9); }
.nav-subitem.active { background: var(--sidebar-active); color: #fff; font-weight: 500; }
.nav-item:hover .nav-icon,
.nav-item.active .nav-icon { opacity: 1; }

/* Sidebar footer */
.sidebar-footer {
  flex-shrink: 0;
  padding: 10px 8px;
  border-top: 1px solid var(--sidebar-sep);
  display: flex;
  align-items: center;
  gap: 4px;
}
.sidebar-user {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 9px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  text-decoration: none;
  transition: background var(--transition);
  overflow: hidden;
}
.sidebar-user:hover { background: var(--sidebar-hover); }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 13px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block;
}
.sidebar-user-role { font-size: 11px; color: var(--sidebar-text-muted); display: block; }
.logout-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text-muted);
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0; text-decoration: none;
}
.logout-btn:hover { background: var(--sidebar-hover); color: rgba(255,255,255,0.85); }

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ===== Main Wrapper ===== */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== Topbar ===== */
.topbar {
  height: var(--topbar-h);
  background: rgba(247,247,248,0.88); /* fallback for older Safari */
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-hamburger {
  display: none;
  align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border: none; background: transparent;
  border-radius: var(--radius-sm); cursor: pointer;
  color: var(--text); flex-shrink: 0;
  margin-right: 4px;
}
.topbar-hamburger:hover { background: var(--surface-hover); }
.topbar-hamburger svg { width: 18px; height: 18px; }

/* Breadcrumb */
.topbar-breadcrumb {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-family: 'Geist Mono', monospace;
  color: var(--text-3);
  min-width: 0;
  overflow: hidden;
}
.topbar-breadcrumb a { color: var(--text-3); text-decoration: none; transition: color var(--transition); }
.topbar-breadcrumb a:hover { color: var(--text-2); }
.topbar-breadcrumb-sep { color: var(--border-dark); flex-shrink: 0; }
.topbar-breadcrumb-current { color: var(--text-2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topbar-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.btn-icon {
  width: 32px; height: 32px;
  border: none; background: transparent;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); cursor: pointer; position: relative;
  transition: background var(--transition), color var(--transition);
}
.btn-icon:hover { background: var(--surface-hover); color: var(--text); }

/* Theme toggle */
.theme-toggle {
  width: 32px; height: 32px;
  border: none; background: transparent;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.theme-toggle:hover { background: var(--surface-hover); color: var(--text); }
.theme-toggle svg { width: 16px; height: 16px; }

/* Notification badge */
.notif-badge {
  position: absolute; top: 3px; right: 3px;
  width: 15px; height: 15px;
  background: var(--danger); color: #fff;
  font-size: 9px; font-weight: 700; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.notif-bell { position: relative; }
.notif-panel {
  display: none;
  position: absolute;
  top: calc(var(--topbar-h) + 4px); right: 0;
  width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
}
.notif-panel.open { display: block; }
.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 14px;
}
.btn-text {
  background: none; border: none; color: var(--accent);
  font-size: 13px; font-weight: 500; cursor: pointer;
  padding: 2px 4px; border-radius: 4px;
  transition: background var(--transition); font-family: inherit;
}
.btn-text:hover { background: var(--accent-light); }
.notif-list { max-height: 320px; overflow-y: auto; }
.notif-item {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; gap: 10px;
  cursor: pointer; transition: background var(--transition);
}
.notif-item:hover { background: var(--surface-hover); }
.notif-item.unread { background: var(--accent-light); }
.notif-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-top: 5px; flex-shrink: 0; }
.notif-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.notif-icon svg { width: 15px; height: 15px; }
.notif-item.unread .notif-icon {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
}
.notif-body { flex: 1; min-width: 0; }
.notif-text { font-size: 13px; line-height: 1.5; color: var(--text); }
.notif-time { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.notif-empty { padding: 32px; text-align: center; color: var(--text-3); font-size: 14px; }
.notif-panel-footer { padding: 10px 16px; border-top: 1px solid var(--border); text-align: center; }
.notif-panel-footer a { font-size: 13px; color: var(--accent); }
.notif-rsvp { display: flex; gap: 6px; margin-top: 6px; }
.btn-rsvp {
  padding: 3px 10px;
  border-radius: 6px;
  border: none;
  font-size: 12px;
  cursor: pointer;
  font-weight: 500;
  line-height: 1.5;
}
.btn-accept { background: #10b981; color: #fff; }
.btn-accept:hover { background: #059669; }
.btn-decline {
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-decline:hover { background: var(--surface-3, #f3f4f6); }
.notif-rsvp-done {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* ===== Main Content ===== */
.main-content { flex: 1; padding: 24px 28px; }

/* ===== Page Content ===== */
.page-content { padding: 36px 40px; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
}
.page-title-lg {
  font-size: 26px; font-weight: 700;
  letter-spacing: 0.01em; line-height: 1.35;
  margin-bottom: 3px; color: var(--text);
}
/* legacy alias */
.section-title { font-size: 22px; font-weight: 700; letter-spacing: 0.01em; color: var(--text); }
.page-subtitle  { font-size: 14px; color: var(--text-2); }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 16px; }
.page-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Flash alerts */
.alert {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 12px 20px;
  font-size: 14px; border-left: 3px solid var(--accent);
  background: var(--accent-light); color: var(--text);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 16px;
}
.alert-success { border-color: var(--success); background: rgba(34,197,94,0.08); }
.alert-error, .alert-danger { border-color: var(--danger); background: rgba(239,68,68,0.08); }
.alert-warning { border-color: var(--warning); background: rgba(245,158,11,0.08); }
.alert-close {
  background: none; border: none; color: var(--text-3);
  font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500;
  border: 1px solid transparent; cursor: pointer;
  transition: background var(--transition), border-color var(--transition),
              color var(--transition), opacity var(--transition), box-shadow var(--transition);
  white-space: nowrap; line-height: 1.4; letter-spacing: -0.1px;
  font-family: inherit;
}
.btn:disabled { opacity: 0.42; cursor: not-allowed; }

.btn-primary   { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); }

.btn-secondary {
  background: var(--surface); color: var(--text);
  border-color: var(--border-dark); box-shadow: var(--shadow-xs);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border-dark); }

.btn-ghost   { background: transparent; color: var(--text-2); border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--surface-hover); color: var(--text); }

.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover:not(:disabled) { filter: brightness(0.9); }
.btn-danger  { background: var(--danger);  color: #fff; border-color: var(--danger); }
.btn-danger:hover:not(:disabled)  { filter: brightness(0.9); }
.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-dark    { background: #1d1d1f; color: #fff; border-color: #1d1d1f; }
.btn-dark:hover:not(:disabled) { background: #000; }

.btn-sm  { padding: 5px 11px; font-size: 12.5px; }
.btn-lg  { padding: 10px 20px; font-size: 15px; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon-round { width: 32px; height: 32px; padding: 0; border-radius: 50%; justify-content: center; }

/* ===== Badges ===== */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 99px;
  font-size: 11px; font-weight: 600; line-height: 1.6;
  white-space: nowrap;
}
.badge-primary, .badge-info    { background: var(--accent-light); color: var(--accent); }
.badge-success, .badge-green   { background: rgba(34,197,94,0.10);  color: #16803a; }
.badge-warning, .badge-orange  { background: rgba(245,158,11,0.12); color: #b45309; }
.badge-danger,  .badge-red     { background: rgba(239,68,68,0.10);  color: #b91c1c; }
.badge-muted, .badge-gray, .badge-secondary { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.badge-dark    { background: var(--text); color: var(--bg); }

/* Pipeline status badges */
.badge-pitch          { background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border); }
.badge-requested      { background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border); }
.badge-pre_production { background: rgba(59,130,246,0.10); color: #1d4ed8; }
.badge-production     { background: var(--accent-light); color: var(--accent); }
.badge-post_production { background: rgba(168,85,247,0.10); color: #7e22ce; }
.badge-delivery       { background: rgba(13,148,136,0.10); color: #0d9488; }
.badge-payment_pending { background: rgba(249,115,22,0.12); color: #ea580c; }
.badge-completed      { background: var(--surface-2); color: var(--text-3); }
.badge-active, .badge-planning { background: var(--accent-light); color: var(--accent); }

/* Priority */
.priority-low    { background: rgba(34,197,94,0.10);  color: #16803a; }
.priority-medium { background: rgba(245,158,11,0.12); color: #b45309; }
.priority-high   { background: rgba(239,68,68,0.10);  color: #b91c1c; }
.priority-urgent { background: rgba(168,85,247,0.10); color: #7e22ce; }

/* Role badges */
.role-admin    { background: rgba(239,68,68,0.10); color: #b91c1c; }
.role-manager  { background: var(--accent-light);  color: var(--accent); }
.role-creative { background: rgba(34,197,94,0.10); color: #16803a; }
.role-viewer   { background: var(--surface-2);     color: var(--text-2); }

/* ── Project Status Pill ─────────────────────────────────────────────────── */
.proj-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.proj-status::before {
  content: '';
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.proj-status-secondary { background: var(--surface-2); color: var(--text-3); border-color: var(--border); }
.proj-status-secondary::before { background: var(--text-3); }
.proj-status-info { background: rgba(59,130,246,0.08); color: #1d4ed8; border-color: rgba(59,130,246,0.2); }
.proj-status-info::before { background: #3b82f6; }
.proj-status-primary { background: var(--accent-light); color: var(--accent); border-color: rgba(18,4,197,0.25); }
.proj-status-primary::before { background: var(--accent); animation: status-dot-pulse 2s infinite; }
.proj-status-warning { background: rgba(245,158,11,0.08); color: #b45309; border-color: rgba(245,158,11,0.25); }
.proj-status-warning::before { background: #f59e0b; }
.proj-status-success { background: rgba(34,197,94,0.08); color: #15803d; border-color: rgba(34,197,94,0.25); }
.proj-status-success::before { background: #22c55e; animation: status-dot-pulse 2s infinite; }
.proj-status-muted { background: var(--surface-2); color: var(--text-3); border-color: var(--border); }
.proj-status-muted::before { background: var(--text-3); opacity: 0.4; }
.proj-status-danger { background: rgba(239,68,68,0.08); color: #b91c1c; border-color: rgba(239,68,68,0.2); }
.proj-status-danger::before { background: #ef4444; animation: status-dot-pulse 1.5s infinite; }
@keyframes status-dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.45; transform: scale(0.8); }
}

/* Project number badges */
/* project-number-badge – main definition at bottom of file */
.project-number-header {
  font-size: 0.65em;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin-left: 8px;
  vertical-align: middle;
}

/* ===== Avatar ===== */
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.avatar-xs { width: 22px; height: 22px; font-size: 9px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; flex-shrink: 0; }
.avatar-sm { width: 26px; height: 26px; font-size: 10px; }
.avatar-lg { width: 44px; height: 44px; font-size: 15px; }
.avatar-xl { width: 60px; height: 60px; font-size: 20px; }
.avatar-group { display: flex; }
.avatar-group .avatar { border: 2px solid var(--surface); margin-left: -8px; }
.avatar-group .avatar:first-child { margin-left: 0; }

/* ===== Forms ===== */
.form-group    { margin-bottom: 16px; }
.form-row      { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3    { grid-template-columns: 1fr 1fr 1fr; }
.form-label    { display: block; font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 5px; }
.form-label .required { color: var(--danger); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text); background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none; appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.form-input::placeholder  { color: var(--text-3); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px;
}
.form-hint  { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }
.form-input.is-invalid { border-color: var(--danger); }
.form-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.form-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.form-check-label { font-size: 14px; }
.form-section { margin-bottom: 28px; }
.form-section-title {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-3);
  margin-bottom: 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.form-actions { display: flex; gap: 8px; padding-top: 8px; }

/* ===== Cards ===== */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-title { font-size: 14px; font-weight: 600; }
.card-body  { padding: 18px; }
.card-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.card-actions { display: flex; gap: 8px; }

/* ===== Grid Layouts ===== */
.grid   { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2,1fr); }
.grid-3 { grid-template-columns: repeat(3,1fr); }
.grid-4 { grid-template-columns: repeat(4,1fr); }
.grid-5 { grid-template-columns: repeat(5,1fr); }
@media (max-width:1200px) { .grid-4 { grid-template-columns: repeat(3,1fr); } .grid-5 { grid-template-columns: repeat(3,1fr); } }
@media (max-width:960px)  { .grid-3 { grid-template-columns: repeat(2,1fr); } .grid-4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width:640px)  { .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; } }

/* ===== KPI Cards ===== */
.kpi-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 22px 24px; position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 16px;
}
.kpi-icon {
  width: 48px; height: 48px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.kpi-content { flex: 1; min-width: 0; }
.kpi-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.kpi-grid-3 { grid-template-columns: repeat(3, 1fr) !important; }
.kpi-grid-auto { grid-template-columns: repeat(auto-fill, minmax(220px,1fr)) !important; }

/* Finance page utilities */
.page-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.page-toolbar-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 4px;
}
.page-toolbar-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
}
.finance-section {
  margin-top: 2.5rem;
}
.finance-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 16px;
}
.finance-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.2px;
}
.finance-section-sub {
  font-size: 12px;
  color: var(--text-3);
}
.kpi-label {
  font-size: 11px; color: var(--text-3); font-weight: 600;
  margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.06em;
  font-family: 'Geist Mono', monospace;
}
.kpi-value {
  font-size: 26px; font-weight: 700; line-height: 1;
  margin-bottom: 5px; letter-spacing: -0.5px; color: var(--text);
}
.kpi-sub { font-size: 12px; color: var(--text-2); }
.kpi-card.kpi-blue   .kpi-value { color: var(--accent); }
.kpi-card.kpi-green  .kpi-value { color: var(--success); }
.kpi-card.kpi-orange .kpi-value { color: var(--warning); }
.kpi-card.kpi-red    .kpi-value { color: var(--danger); }

/* ===== Tables ===== */
.table { width: 100%; border-collapse: collapse; }
.table thead tr {
  background: var(--surface-2);
  border-bottom: 2px solid var(--border);
}
.table th {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-3);
  padding: 12px 14px; text-align: left;
  font-family: 'Geist Mono', monospace;
  white-space: nowrap;
}
.table th:first-child, .table td:first-child { padding-left: 0; }
.table th:last-child,  .table td:last-child  { padding-right: 0; }
.table td {
  padding: 13px 14px; border-bottom: 1px solid var(--border);
  font-size: 13.5px; color: var(--text-2);
  height: 52px; vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table td:first-child { color: var(--text); font-weight: 500; }
.table tbody tr:hover td { background: var(--surface-hover); }
.table-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* Detail grid */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.detail-label { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); margin-bottom: 5px; font-family: 'Geist Mono', monospace; }
.detail-value { font-size: 15px; font-weight: 500; color: var(--text); }

/* ===== Pipeline Board ===== */
.pipeline-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  min-height: calc(100dvh - var(--topbar-h) - 120px);
  align-items: start;
}

.pipeline-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 320px;
}

.pipeline-col-header {
  padding: 13px 16px 12px;
  border-bottom: 2px solid transparent;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}

/* Status color accent on header bottom border */
.pipeline-col[data-status="pitch"]            .pipeline-col-header { border-color: var(--text-3); }
.pipeline-col[data-status="requested"]        .pipeline-col-header { border-color: var(--text-3); }
.pipeline-col[data-status="pre_production"]   .pipeline-col-header { border-color: #3b82f6; }
.pipeline-col[data-status="production"]       .pipeline-col-header { border-color: var(--accent); }
.pipeline-col[data-status="post_production"]  .pipeline-col-header { border-color: #a855f7; }
.pipeline-col[data-status="delivery"]         .pipeline-col-header { border-color: #0d9488; }
.pipeline-col[data-status="payment_pending"]  .pipeline-col-header { border-color: #f97316; }
.pipeline-col[data-status="completed"]        .pipeline-col-header { border-color: var(--success); opacity: 0.7; }

.pipeline-col-title {
  font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-3);
}
.pipeline-col[data-status="production"]       .pipeline-col-title { color: var(--accent); }
.pipeline-col[data-status="pre_production"]   .pipeline-col-title { color: #3b82f6; }
.pipeline-col[data-status="post_production"]  .pipeline-col-title { color: #a855f7; }
.pipeline-col[data-status="delivery"]         .pipeline-col-title { color: #0d9488; }
.pipeline-col[data-status="payment_pending"]  .pipeline-col-title { color: #f97316; }
.pipeline-col[data-status="completed"]        .pipeline-col-title { color: var(--success); }

.pipeline-col-count {
  font-size: 11px; font-weight: 700;
  background: var(--surface-2); color: var(--text-3);
  padding: 1px 7px; border-radius: 99px;
  font-family: 'Geist Mono', monospace;
}
.pipeline-col[data-status="production"]       .pipeline-col-count { background: var(--accent-light); color: var(--accent); }
.pipeline-col[data-status="pre_production"]   .pipeline-col-count { background: rgba(59,130,246,0.10); color: #3b82f6; }
.pipeline-col[data-status="post_production"]  .pipeline-col-count { background: rgba(168,85,247,0.10); color: #a855f7; }
.pipeline-col[data-status="delivery"]         .pipeline-col-count { background: rgba(13,148,136,0.10); color: #0d9488; }
.pipeline-col[data-status="payment_pending"]  .pipeline-col-count { background: rgba(249,115,22,0.12); color: #f97316; }
.pipeline-col[data-status="completed"]        .pipeline-col-count { background: rgba(34,197,94,0.10); color: var(--success); }

.pipeline-col-body {
  padding: 10px;
  flex: 1;
  display: flex; flex-direction: column; gap: 8px;
}

/* Project card inside pipeline */
.pipeline-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-decoration: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  cursor: pointer;
}
.pipeline-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.pipeline-card-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  margin-bottom: 3px; line-height: 1.35;
}
.pipeline-card-client {
  font-size: 12px; color: var(--text-2); margin-bottom: 9px;
}
.pipeline-card-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px;
}
.pipeline-card-meta .text-muted { font-size: 11.5px; font-family: 'Geist Mono', monospace; }

/* Produktion detail tab bar (standalone — not managed by initTabs) */
/* prod-tab-bar/btn = alias for the unified tab system */
.prod-tab-bar { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; overflow-y: hidden; flex-wrap: nowrap; scrollbar-width: none; }
.prod-tab-bar::-webkit-scrollbar { display: none; }
.prod-tab-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 16px;
  border: none; background: transparent;
  font-size: 13.5px; font-weight: 500; color: var(--text-2);
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px; white-space: nowrap;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-family: inherit;
}
.prod-tab-btn:hover  { color: var(--text); background: var(--surface-hover); }
.prod-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Pipeline drag-and-drop states */
.pipeline-card {
  cursor: grab;
}
.pipeline-card.dragging {
  opacity: 0.45;
  transform: rotate(1.5deg) scale(0.97);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.pipeline-col-body.drag-over {
  background: var(--accent-light);
  border-radius: 0 0 var(--radius) var(--radius);
}
.pipeline-empty {
  font-size: 12px;
  color: var(--text-3);
  padding: 8px 4px;
  text-align: center;
}

/* Info box (crew selection confirmation) */
.info-box {
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
}

/* ===== Team Utilization ===== */
.util-list { display: flex; flex-direction: column; gap: 0; }
.util-row {
  display: grid;
  grid-template-columns: 200px 1fr 130px;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.util-row:last-child { border-bottom: none; }
.util-user { display: flex; align-items: center; gap: 10px; }
.util-bar-wrap {
  height: 6px; background: var(--surface-3);
  border-radius: 99px; overflow: hidden;
}
.util-bar-fill {
  height: 100%; border-radius: 99px;
  transition: width 0.4s ease;
}
.util-bar-fill.util-ok   { background: var(--success); }
.util-bar-fill.util-high { background: var(--warning); }
.util-bar-fill.util-over { background: var(--danger); }
.util-label { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }

/* ===== Management page ===== */
.kpi-grid-3 { grid-template-columns: repeat(3, 1fr) !important; }

.card-header-inline {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 14px 20px 0;
}
.card-title-sm { font-size: 13px; font-weight: 600; color: var(--text); }
.link-muted { color: var(--text-3); text-decoration: none; }
.link-muted:hover { color: var(--text-2); }

.mgmt-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
}
.mgmt-chart-card { padding: 0 20px 16px; }
.mgmt-reminders-card { padding: 0 0 8px; }

.mgmt-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
}

/* Compact table */
.table.table-compact td { height: 42px; padding: 10px 14px; font-size: 13px; }
.table.table-compact th { padding: 10px 14px; }

/* Compact util list */
.util-list-compact { padding: 0 16px; }
.util-row-compact {
  grid-template-columns: 110px 1fr 48px;
  padding: 10px 0;
  gap: 10px;
}

/* Reminders */
.reminder-list { padding: 8px 0 0; }
.reminder-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px;
  border-bottom: 1px solid var(--border);
}
.reminder-item:last-child { border-bottom: none; }
.reminder-icon {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.reminder-birthday { background: #fdf4ff; color: #a855f7; }
.reminder-vacation  { background: #f0fdf4; color: #10b981; }
.reminder-body { flex: 1; min-width: 0; }
.reminder-when {
  font-size: 11px; font-weight: 600;
  color: var(--text-3); white-space: nowrap;
  font-family: 'Geist Mono', monospace;
}
.reminder-today { color: var(--success); }
.reminder-soon  { color: var(--warning); }

@media (max-width: 1100px) {
  .mgmt-grid { grid-template-columns: 1fr; }
  .mgmt-bottom-grid { grid-template-columns: 1fr; }
  .kpi-grid-3 { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (max-width: 640px) {
  .kpi-grid-3 { grid-template-columns: 1fr 1fr !important; }
}

/* Budget progress bar */
.budget-bar-wrap {
  height: 3px; background: var(--surface-3); border-radius: 99px; overflow: hidden;
}
.budget-bar-fill {
  height: 100%; background: var(--accent); border-radius: 99px;
  transition: width 0.3s ease;
}
.budget-bar-fill.budget-warn { background: var(--warning); }
.budget-bar-fill.budget-over { background: var(--danger); }

/* ===== Project Detail ===== */
.project-detail-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 28px;
  margin-bottom: 20px;
  display: flex; align-items: flex-start; gap: 16px;
}
.project-detail-title {
  font-size: 20px; font-weight: 700;
  letter-spacing: 0.01em; color: var(--text); line-height: 1.35;
}
.project-detail-meta {
  font-size: 13px; color: var(--text-2); margin-top: 4px;
}
.project-detail-actions { margin-left: auto; display: flex; gap: 8px; align-items: flex-start; flex-shrink: 0; }

/* ===== Tab Bar ===== */
.tab-bar {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab-btn,
.tab-bar a.tab-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 16px;
  border: none; background: transparent;
  font-size: 13.5px; font-weight: 500; color: var(--text-2);
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px; white-space: nowrap;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-family: inherit; text-decoration: none;
}
.tab-btn:hover,
.tab-bar a.tab-btn:hover { color: var(--text); background: var(--surface-hover); }
.tab-btn.active,
.tab-bar a.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
/* ── Universal tab fade-in animation ── */
@keyframes tab-fade-in {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tab-pane         { display: none; }
.tab-pane.active  { display: block; animation: tab-fade-in .18s ease; }

/* canvas-panel (forms builder) */
.canvas-panel        { display: none; }
.canvas-panel.active { display: block; animation: tab-fade-in .18s ease; }

/* ===== Section Card (inside tabs) ===== */
.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}
.section-card-header {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.section-card-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.section-card-body  { padding: 20px; }
/* Tables inside cards get proper side padding */
.section-card .table th:first-child,
.section-card .table td:first-child { padding-left: 20px; }
.section-card .table th:last-child,
.section-card .table td:last-child  { padding-right: 20px; }

/* Two-col section layout */
.section-grid-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}

.tab-empty {
  text-align: center; padding: 32px;
  color: var(--text-3); font-size: 13.5px;
}

/* ===== Autocomplete dropdown ===== */
.autocomplete-wrap { position: relative; }
.autocomplete-dropdown {
  position: absolute; z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  max-height: 240px; overflow-y: auto;
  width: 100%;
}
.autocomplete-item {
  padding: 9px 12px; cursor: pointer;
  font-size: 13.5px; color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: var(--surface-hover); }
.autocomplete-item-role { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* Page title (legacy .page-title used in some templates) */
.page-title { font-size: 22px; font-weight: 700; letter-spacing: 0.01em; color: var(--text); }

/* ===== Kalkulation (spreadsheet tab) ===== */
.kalkulation-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}
.kalkulation-table {
  width: 100%; border-collapse: collapse; min-width: 800px;
}
.kalkulation-table th {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-3);
  padding: 10px 12px; text-align: left; background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap; font-family: 'Geist Mono', monospace;
}
.kalkulation-table td {
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text); vertical-align: middle;
}
.kalkulation-table tr:last-child td { border-bottom: none; }
.kalkulation-table tr:hover td { background: var(--surface-hover); }
[contenteditable]:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent);
  border-radius: 3px;
  background: var(--accent-light);
}
.kalkulation-footer {
  padding: 12px 18px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px;
  border-radius: 0 0 var(--radius) var(--radius);
}
.kalkulation-total { font-weight: 700; font-size: 15px; }

/* ===== Dokumente (Quill editor tab) ===== */
.dokumente-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 12px;
  height: calc(100vh - 228px);
  min-height: 400px;
}
.dokumente-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.dokumente-list-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 600;
}
.dokumente-list-body { flex: 1; overflow-y: auto; }
.doc-item {
  padding: 10px 14px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text);
  transition: background var(--transition);
}
.doc-item:hover  { background: var(--surface-hover); }
.doc-item.active { background: var(--accent-light); color: var(--accent); font-weight: 500; }
.doc-item-title  { font-weight: 500; margin-bottom: 2px; }
.doc-item-date   { font-size: 11px; color: var(--text-3); font-family: 'Geist Mono', monospace; }

.dokumente-editor {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
}
/* Quill toolbar + container integration */
.ql-toolbar { border: none !important; border-bottom: 1px solid var(--border) !important; background: var(--surface-2) !important; }
.ql-container { border: none !important; flex: 1; font-family: 'Geist', inherit !important; font-size: 14px !important; }
.ql-editor { color: var(--text) !important; padding: 16px 20px !important; }
/* Quill dark mode */
[data-theme="dark"] .ql-stroke { stroke: rgba(240,240,240,0.55) !important; }
[data-theme="dark"] .ql-fill   { fill:   rgba(240,240,240,0.55) !important; }
[data-theme="dark"] .ql-picker-label { color: rgba(240,240,240,0.55) !important; }
[data-theme="dark"] .ql-editor { background: var(--surface) !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ql-stroke { stroke: rgba(240,240,240,0.55) !important; }
  :root:not([data-theme="light"]) .ql-fill   { fill:   rgba(240,240,240,0.55) !important; }
  :root:not([data-theme="light"]) .ql-picker-label { color: rgba(240,240,240,0.55) !important; }
}

/* ===== Filter Bar ===== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-bar .form-input,
.filter-bar .form-select {
  width: auto; min-width: 140px; flex: 1; max-width: 260px;
}
.filter-bar-actions { display: flex; gap: 6px; margin-left: auto; }

/* ===== Data Table Page ===== */
.data-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  overflow-x: auto;
}
.data-table-wrap .table { margin: 0; min-width: 700px; }
.data-table-wrap .table th:first-child,
.data-table-wrap .table td:first-child { padding-left: 20px; }
.data-table-wrap .table th:last-child,
.data-table-wrap .table td:last-child  { padding-right: 20px; }

/* ===== Responsive table card layout (mobile) ===== */
@media (max-width: 767px) {
  .data-table-responsive thead { display: none; }
  .data-table-responsive tr {
    display: block; padding: 12px 16px;
    border-bottom: 1px solid var(--border);
  }
  .data-table-responsive td {
    display: flex; justify-content: space-between; align-items: center;
    padding: 5px 0; border-top: none; height: auto; font-size: 13px;
  }
  .data-table-responsive td::before {
    content: attr(data-label);
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--text-3);
    font-family: 'Geist Mono', monospace;
  }
  .data-table-responsive td:first-child { color: var(--text); font-size: 14px; font-weight: 600; }
}

/* ===== Responsive — Tablet (768–1024px) ===== */
@media (max-width: 1024px) {
  :root { --sidebar-w: 60px; }

  .sidebar { width: 60px; }
  .sidebar.open { width: 220px; z-index: 102; }

  /* Hide text labels on tablet — show only icons */
  .nav-item span,
  .nav-section-label,
  .sidebar-user-info,
  .logout-btn { display: none; }

  .sidebar.open .nav-item span,
  .sidebar.open .nav-section-label,
  .sidebar.open .sidebar-user-info,
  .sidebar.open .logout-btn { display: block; }

  .sidebar.open .nav-item { justify-content: flex-start; }
  .nav-item { justify-content: center; }

  .topbar-hamburger { display: flex; }
  .topbar { padding: 0 20px; }

  .main-content { padding: 16px 20px; }
  .page-content { padding: 24px 22px; }

  .kpi-grid { grid-template-columns: repeat(2, 1fr); }

  .section-grid-2 { grid-template-columns: 1fr; }

  .pipeline-board {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    overflow-x: auto;
  }

  .filter-bar .form-input,
  .filter-bar .form-select { min-width: 110px; }
}

/* ===== Responsive — Mobile (≤767px) ===== */
@media (max-width: 767px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    width: 220px;
    transform: translateX(-100%);
    z-index: 102;
  }
  .sidebar.open { transform: translateX(0); }

  .main-wrapper { margin-left: 0; overflow-x: hidden; }

  .topbar { padding: 0 16px; gap: 8px; overflow: hidden; }
  .topbar-hamburger { display: flex; }

  /* Hide non-essential topbar items on mobile to prevent overflow */
  .topbar-breadcrumb { display: none; }
  .theme-toggle      { display: none; }

  /* Page title: truncate if too long */
  .page-title {
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
  }

  /* Topbar actions: allow shrink & wrap so buttons stay visible */
  .topbar-actions {
    flex-shrink: 1;
    flex-wrap: nowrap;
    gap: 4px;
    min-width: 0;
  }
  .topbar-actions .btn { white-space: nowrap; }

  .main-content { padding: 12px 16px; }
  .page-content { padding: 16px; }

  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi-value { font-size: 20px; }

  .pipeline-board {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    overflow-x: auto;
  }

  .tab-bar { gap: 0; }
  .tab-btn { padding: 8px 11px; font-size: 13px; }

  .dokumente-layout { grid-template-columns: 1fr; height: auto; }

  .section-grid-2 { grid-template-columns: 1fr; }

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

  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar .form-input,
  .filter-bar .form-select { max-width: 100%; min-width: 0; }
  .filter-bar-actions { margin-left: 0; }

  .page-header { flex-direction: column; }
  .page-header-actions { width: 100%; }

  .project-detail-header { flex-direction: column; gap: 12px; }
  .project-detail-actions { margin-left: 0; }

  .table-actions { flex-wrap: wrap; }
}

/* Hide old sidebar-toggle button (replaced by topbar-hamburger) */
.sidebar-toggle { display: none !important; }

/* ===== Dashboard ===== */
.dashboard-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 20px; margin-bottom: 28px; }
.dashboard-col-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.dashboard-col-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
@media (max-width:1100px) { .dashboard-grid { grid-template-columns: 1fr; } }

/* ── Project list rows ────────────────────────────── */
.project-list { border-top: 1px solid var(--border); }
.project-list-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  color: inherit;
}
.project-list-item:hover { background: var(--surface-hover); }
.project-type-bar {
  width: 3px; min-height: 36px; border-radius: 99px;
  align-self: stretch; flex-shrink: 0;
}
.project-list-info { flex: 1; min-width: 0; }
.project-list-name {
  font-size: 14px; font-weight: 600; color: var(--text);
  margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.project-list-meta {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; font-size: 12.5px; color: var(--text-2);
}
.project-list-progress {
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0;
}
.progress-bar-wrap {
  width: 64px; height: 4px;
  background: var(--surface-3); border-radius: 99px; overflow: hidden;
}
.progress-bar { height: 100%; border-radius: 99px; }
.progress-pct {
  font-size: 11.5px; color: var(--text-3);
  font-family: 'Geist Mono', monospace;
}

/* ── Task list rows ───────────────────────────────── */
.task-list { border-top: 1px solid var(--border); }
.task-list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-bottom: 1px solid var(--border);
}
.task-priority-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.task-list-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.task-title {
  font-size: 13.5px; font-weight: 500; color: var(--text);
  text-decoration: none; display: block;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.task-title:hover { color: var(--accent); }
.text-sm { font-size: 12px; }
.task-list-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.due-date { font-size: 12px; color: var(--text-2); font-family: 'Geist Mono', monospace; }

/* ── Dashboard misc ───────────────────────────────── */
.btn-link {
  color: var(--accent); font-size: 13px; font-weight: 500;
  text-decoration: none; white-space: nowrap; flex-shrink: 0;
}
.btn-link:hover { text-decoration: underline; }

.empty-state {
  padding: 28px 18px; text-align: center;
  color: var(--text-3); font-size: 13.5px;
}
.text-xs { font-size: 11px; }

/* ── Task table specifics ─────────────────────────── */
.priority-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.type-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; margin-right: 5px; }
.user-cell { display: flex; align-items: center; gap: 6px; }
.task-link {
  font-size: 13.5px; font-weight: 500; color: var(--text);
  text-decoration: none; display: block;
}
.task-link:hover { color: var(--accent); }
.row-overdue td { background: color-mix(in srgb, var(--danger) 4%, transparent); }
.row-overdue td { background: rgba(239,68,68,0.04); } /* fallback */
.status-select {
  font-size: 12px; font-weight: 500; padding: 4px 8px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-2);
  cursor: pointer; outline: none; appearance: none;
  font-family: inherit; width: 100%; max-width: 130px;
}
.status-select:focus { border-color: var(--accent); }
.status-select.status-done,
.status-select.status-completed  { background: rgba(16,185,129,0.12); color: #059669; border-color: rgba(16,185,129,0.3); }
.status-select.status-in_progress { background: rgba(18,4,197,0.1);  color: var(--accent); border-color: rgba(18,4,197,0.25); }
.status-select.status-review      { background: rgba(245,158,11,0.1);  color: #b45309; border-color: rgba(245,158,11,0.25); }
.status-select.status-blocked     { background: rgba(239,68,68,0.1);   color: var(--danger); border-color: rgba(239,68,68,0.25); }

/* ── Event list ───────────────────────────────────── */
.event-list { border-top: 1px solid var(--border); }
.event-list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-bottom: 1px solid var(--border);
}
.event-type-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.event-list-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.event-title {
  font-size: 13.5px; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Workload list ────────────────────────────────── */
.workload-list { padding: 4px 0; }
.workload-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px;
}
.workload-name { font-size: 13px; color: var(--text); min-width: 60px; flex-shrink: 0; }
.workload-bar-wrap {
  flex: 1; height: 6px; background: var(--surface-3);
  border-radius: 99px; overflow: hidden;
}
.workload-bar { height: 100%; border-radius: 99px; transition: width 0.4s ease; }
.workload-count { font-size: 12px; color: var(--text-2); min-width: 20px; text-align: right; flex-shrink: 0; }

/* ── Activity list ────────────────────────────────── */
.activity-list { border-top: 1px solid var(--border); }
.activity-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 18px; border-bottom: 1px solid var(--border);
}
.activity-content { flex: 1; min-width: 0; font-size: 13px; }
.activity-actor { font-weight: 600; color: var(--text); }

/* ── Chart container ──────────────────────────────── */
.chart-container-sm { padding: 16px 18px; }
.chart-container-sm canvas { max-height: 220px; }

/* ===== Login / Auth page ===== */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 20px;
}
.auth-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px; width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo .logo-wordmark { font-size: 28px; }
.auth-title { font-size: 20px; font-weight: 700; margin-bottom: 6px; letter-spacing: 0.01em; }
.auth-sub   { font-size: 14px; color: var(--text-2); margin-bottom: 24px; }

/* ===== Packliste (standalone print page) ===== */
.packliste-page { max-width: 800px; margin: 40px auto; padding: 0 20px; }
.packliste-page h1 { font-size: 22px; font-weight: 700; margin-bottom: 20px; }
.packliste-page .table th { font-size: 12px; }
@media print {
  .packliste-page button { display: none; }
  body { background: #fff !important; }
}

/* ===== Finance ===== */
.finance-stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px;
}
.finance-stat-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-3); font-family: 'Geist Mono', monospace; margin-bottom: 6px;
}
.finance-stat-value { font-size: 24px; font-weight: 700; letter-spacing: -0.4px; }

/* ===== Capacity view ===== */
.capacity-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.capacity-label { width: 140px; flex-shrink: 0; font-size: 13px; font-weight: 500; }
.capacity-bar-wrap {
  flex: 1; height: 8px; background: var(--surface-3);
  border-radius: 99px; overflow: hidden;
}
.capacity-bar-fill { height: 100%; background: var(--accent); border-radius: 99px; }
.capacity-bar-fill.over { background: var(--danger); }
.capacity-pct {
  width: 40px; text-align: right; font-size: 12px;
  color: var(--text-2); font-family: 'Geist Mono', monospace;
}

/* ===== Calendar ===== */
.calendar-grid {
  display: grid; grid-template-columns: repeat(7,1fr); gap: 1px;
  background: var(--border); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.calendar-cell { background: var(--surface); padding: 8px; min-height: 80px; }
.calendar-cell-header {
  font-size: 11px; font-family: 'Geist Mono', monospace;
  color: var(--text-3); margin-bottom: 4px;
}
.calendar-event {
  font-size: 11.5px; padding: 2px 6px; border-radius: 3px;
  background: var(--accent-light); color: var(--accent);
  margin-bottom: 2px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ===== Misc helpers ===== */
.page-empty {
  text-align: center; padding: 60px 20px;
  color: var(--text-3); font-size: 15px;
}
.page-empty-icon { font-size: 40px; margin-bottom: 12px; }
.inline-form { display: inline; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0);
}

/* ===== Scrollbar styling ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ===== Focus visible ===== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button:focus:not(:focus-visible),
a:focus:not(:focus-visible) { outline: none; }

/* ===== Selection ===== */
::selection { background: var(--accent-light); color: var(--accent); }

/* ===== Link in tables ===== */
.table a { color: var(--text); font-weight: 500; text-decoration: none; }
.table a:hover { color: var(--accent); }

/* ===== Shared: filter-form / filter-select (legacy class aliases) ===== */
.filter-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; width: 100%; }
.filter-select {
  padding: 8px 32px 8px 12px; min-width: 140px;
  border: 1px solid var(--border-dark); border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text); background: var(--surface);
  cursor: pointer; outline: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  font-family: inherit; transition: border-color var(--transition);
}
.filter-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.btn-outline {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500;
  border: 1px solid var(--border-dark); background: transparent; color: var(--text);
  cursor: pointer; text-decoration: none; transition: background var(--transition), border-color var(--transition);
}
.btn-outline:hover { background: var(--surface-hover); border-color: var(--text-3); }
.btn-outline.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-xs { padding: 3px 8px; font-size: 12px; border-radius: var(--radius-sm); }

/* ===== Modal system ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.45); display: flex;
  align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-sm { max-width: 400px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 16px; border-bottom: 1px solid var(--border);
}
.modal-header h2, .modal-header h3 { font-size: 16px; font-weight: 600; margin: 0; }
.modal-close {
  width: 28px; height: 28px; border-radius: 50%; border: none;
  background: var(--surface-2); color: var(--text-2); font-size: 16px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.modal-close:hover { background: var(--surface-3); }
.modal-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.modal-footer {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 22px 18px; border-top: 1px solid var(--border);
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.form-group input, .form-group select, .form-group textarea {
  padding: 8px 12px; border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm); font-size: 14px; color: var(--text);
  background: var(--surface); outline: none; font-family: inherit;
  transition: border-color var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.attendee-checkboxes { display: flex; flex-wrap: wrap; gap: 6px; }
.checkbox-item-sm {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 4px 8px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); font-size: 13px;
  transition: background var(--transition);
}
.checkbox-item-sm:hover { background: var(--surface-hover); }
.checkbox-item-sm input[type="checkbox"] { margin: 0; }

/* RSVP status badges in attendee list */
.rsvp-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  line-height: 1.5;
  flex-shrink: 0;
}
.rsvp-accepted  { background: #d1fae5; color: #065f46; }
.rsvp-declined  { background: #fee2e2; color: #991b1b; }
.rsvp-tentative { background: #fef3c7; color: #92400e; }
.rsvp-pending   { background: #f3f4f6; color: #6b7280; }
[data-theme="dark"] .rsvp-accepted  { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] .rsvp-declined  { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .rsvp-tentative { background: #451a03; color: #fcd34d; }
[data-theme="dark"] .rsvp-pending   { background: #374151; color: #9ca3af; }

/* ── Google Meet link bar ── */
.meet-link-bar {
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  background: #e8f5e9;
}
[data-theme="dark"] .meet-link-bar { background: #0d2b18; }
.btn-meet-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 8px;
  background: #1a73e8;
  color: #fff;
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s;
}
.btn-meet-link:hover { background: #1557b0; color: #fff; }

/* ── Event modal RSVP bar — Google-Calendar-style inline response ── */
.rsvp-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(18, 4, 197, 0.035) 0%, rgba(18, 4, 197, 0.01) 100%);
  transition: background .2s ease;
}
[data-theme="dark"] .rsvp-bar {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.05) 0%, rgba(56, 189, 248, 0.01) 100%);
}
.rsvp-bar.rsvp-state-accepted {
  background: linear-gradient(180deg, rgba(22, 163, 74, 0.08) 0%, rgba(22, 163, 74, 0.02) 100%);
}
.rsvp-bar.rsvp-state-declined {
  background: linear-gradient(180deg, rgba(220, 38, 38, 0.08) 0%, rgba(220, 38, 38, 0.02) 100%);
}
.rsvp-bar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: .88rem;
  font-weight: 500;
  min-width: 0;
}
.rsvp-bar.rsvp-state-accepted .rsvp-bar-status { color: #16a34a; }
.rsvp-bar.rsvp-state-declined .rsvp-bar-status { color: #dc2626; }
[data-theme="dark"] .rsvp-bar.rsvp-state-accepted .rsvp-bar-status { color: #4ade80; }
[data-theme="dark"] .rsvp-bar.rsvp-state-declined .rsvp-bar-status { color: #f87171; }
.rsvp-status-icon {
  flex: 0 0 auto;
  stroke-width: 2.2;
}
.rsvp-status-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rsvp-bar-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}
.btn-rsvp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s, transform .08s;
  background: var(--surface);
  color: var(--text-2);
  line-height: 1;
  user-select: none;
}
.btn-rsvp:active { transform: scale(.97); }
.btn-rsvp svg { flex: 0 0 auto; }
.btn-rsvp-accept {
  color: #16a34a;
  border-color: #16a34a55;
}
.btn-rsvp-accept:hover {
  background: #16a34a12;
  border-color: #16a34a;
}
.btn-rsvp-accept.btn-rsvp-active {
  background: #16a34a;
  color: #fff;
  border-color: #16a34a;
  box-shadow: 0 2px 10px #16a34a40;
}
.btn-rsvp-decline {
  color: #dc2626;
  border-color: #dc262655;
}
.btn-rsvp-decline:hover {
  background: #dc262612;
  border-color: #dc2626;
}
.btn-rsvp-decline.btn-rsvp-active {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
  box-shadow: 0 2px 10px #dc262640;
}
[data-theme="dark"] .btn-rsvp { background: #1e293b; color: var(--text-2); }
[data-theme="dark"] .btn-rsvp-accept  { color: #4ade80; border-color: #4ade8055; }
[data-theme="dark"] .btn-rsvp-decline { color: #f87171; border-color: #f8717155; }
[data-theme="dark"] .btn-rsvp-accept:hover  { background: #4ade8018; border-color: #4ade80; }
[data-theme="dark"] .btn-rsvp-decline:hover { background: #f8717118; border-color: #f87171; }
[data-theme="dark"] .btn-rsvp-accept.btn-rsvp-active  { background: #16a34a; color:#fff; border-color: #16a34a; }
[data-theme="dark"] .btn-rsvp-decline.btn-rsvp-active { background: #dc2626; color:#fff; border-color: #dc2626; }
@media (max-width: 540px) {
  .rsvp-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .rsvp-bar-actions { justify-content: center; }
}

/* ── GCal all-attendees read-only list ── */
.gcal-attendee-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.gcal-attendee-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius);
  background: var(--surface-2, #f8fafc);
  border: 1px solid var(--border);
}
[data-theme="dark"] .gcal-attendee-item { background: #1e293b; }
.gcal-attendee-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.gcal-attendee-name {
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gcal-attendee-email {
  font-size: .75rem;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gcal-attendee-role {
  font-size: .7rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-light);
  border-radius: 4px;
  padding: 0 4px;
  margin-left: 5px;
  vertical-align: middle;
}
.gcal-attendee-item .rsvp-badge { margin-left: 0; }

/* ── FullCalendar: week number column ── */
/* Narrow the column — only in month view (fc-dayGridMonth-view).
   .fc-daygrid-body also appears inside the timeGrid's allday section where
   col:first-child is the "Ganztag" axis col — NOT the week-number col.
   Scoping to fc-dayGridMonth-view prevents breaking timeGrid column alignment. */
.fc .fc-week-number-harness,
.fc-dayGridMonth-view .fc-daygrid-body > table > colgroup > col:first-child {
  width: 36px !important;
}
/* The clickable link cell */
.fc .fc-daygrid-week-number {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: .6rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  color: var(--text-3);
  background: transparent;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px 4px;
  border-radius: 4px;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.fc .fc-daygrid-week-number:hover {
  background: var(--accent-light);
  color: var(--accent);
}
/* Week number header cell (month view top row) */
.fc th.fc-week-number-harness {
  background: transparent;
  border-bottom: 1px solid var(--border);
}
/* Separate KW column from day columns with a subtle rule */
.fc td.fc-week-number-harness,
.fc th.fc-week-number-harness {
  border-right: 1px solid var(--border) !important;
}
/* Dark mode adjustments */
[data-theme="dark"] .fc .fc-daygrid-week-number { color: var(--text-3); }
[data-theme="dark"] .fc .fc-daygrid-week-number:hover {
  background: var(--accent-light);
  color: var(--accent);
}

/* ── FullCalendar: holiday & vacation label chips ── */
.fc-holiday-event,
.fc-vacation-approved,
.fc-vacation-pending,
.fc-birthday-event {
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em !important;
  cursor: default !important;
  pointer-events: none !important;
  padding: 1px 4px !important;
}
/* ● dot prefix via CSS — no emoji needed */
.fc-holiday-event .fc-event-title::before,
.fc-vacation-approved .fc-event-title::before,
.fc-vacation-pending .fc-event-title::before,
.fc-birthday-event .fc-event-title::before {
  font-size: 8px;
  vertical-align: middle;
  margin-right: 4px;
  content: '●';
}
.fc-holiday-event,
.fc-holiday-event .fc-event-main,
.fc-holiday-event .fc-event-title    { color: #b91c1c !important; }
.fc-vacation-approved,
.fc-vacation-approved .fc-event-main,
.fc-vacation-approved .fc-event-title { color: #166534 !important; }
.fc-vacation-pending,
.fc-vacation-pending .fc-event-main,
.fc-vacation-pending .fc-event-title  { color: #854d0e !important; }
.fc-birthday-event,
.fc-birthday-event .fc-event-main,
.fc-birthday-event .fc-event-title    { color: #be185d !important; }
.fc-holiday-event .fc-event-title::before    { color: #ef4444; }
.fc-vacation-approved .fc-event-title::before { color: #22c55e; }
.fc-vacation-pending .fc-event-title::before  { color: #eab308; }
.fc-birthday-event .fc-event-title::before    { color: #ec4899; }

/* Background tint — light mode: FullCalendar default opacity ~0.3 is fine */
/* Background tint — dark mode: reduce so it doesn't overpower dark surfaces */
[data-theme="dark"] .fc-bg-event { opacity: 0.15 !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .fc-bg-event { opacity: 0.15 !important; }
}

/* Dark mode label colors */
[data-theme="dark"] .fc-holiday-event,
[data-theme="dark"] .fc-holiday-event .fc-event-main,
[data-theme="dark"] .fc-holiday-event .fc-event-title    { color: #fca5a5 !important; }
[data-theme="dark"] .fc-vacation-approved,
[data-theme="dark"] .fc-vacation-approved .fc-event-main,
[data-theme="dark"] .fc-vacation-approved .fc-event-title { color: #6ee7b7 !important; }
[data-theme="dark"] .fc-vacation-pending,
[data-theme="dark"] .fc-vacation-pending .fc-event-main,
[data-theme="dark"] .fc-vacation-pending .fc-event-title  { color: #fde68a !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .fc-holiday-event,
  :root:not([data-theme="light"]) .fc-holiday-event .fc-event-main,
  :root:not([data-theme="light"]) .fc-holiday-event .fc-event-title    { color: #fca5a5 !important; }
  :root:not([data-theme="light"]) .fc-vacation-approved,
  :root:not([data-theme="light"]) .fc-vacation-approved .fc-event-main,
  :root:not([data-theme="light"]) .fc-vacation-approved .fc-event-title { color: #6ee7b7 !important; }
  :root:not([data-theme="light"]) .fc-vacation-pending,
  :root:not([data-theme="light"]) .fc-vacation-pending .fc-event-main,
  :root:not([data-theme="light"]) .fc-vacation-pending .fc-event-title  { color: #fde68a !important; }
}

/* ===== Calendar page ===== */
.calendar-layout {
  display: grid; grid-template-columns: 220px 1fr; gap: 20px;
  /* Fill remaining viewport height below topbar + main-content padding */
  height: calc(100dvh - var(--topbar-h) - 48px);
}
.calendar-sidebar {
  display: flex; flex-direction: column; gap: 16px;
  height: 100%; overflow-y: auto;
}
.calendar-main { min-width: 0; height: 100%; display: flex; flex-direction: column; }
.calendar-main > div { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.calendar-main > div > #calendar { flex: 1; min-height: 0; }
.legend-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-3); margin-bottom: 10px;
  font-family: 'Geist Mono', monospace;
}
.legend-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-2); cursor: pointer;
  padding: 4px 0; user-select: none;
}
.legend-item input[type="checkbox"] { margin: 0; cursor: pointer; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-item-project { display: flex; align-items: center; gap: 6px; }
@media (max-width: 900px) { .calendar-layout { grid-template-columns: 1fr; } }

/* ===== Team page ===== */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.team-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 18px 16px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 10px;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.team-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); border-color: var(--border-dark); }
.team-card-inactive { opacity: 0.55; }
.team-card-avatar { position: relative; }
.inactive-badge {
  position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
  background: var(--surface-3); color: var(--text-3); font-size: 10px;
  font-weight: 600; padding: 1px 6px; border-radius: 99px;
  white-space: nowrap;
}
.team-card-info { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 100%; }
.team-card-name {
  font-size: 14px; font-weight: 600; color: var(--text);
  text-decoration: none; display: block;
}
.team-card-name:hover { color: var(--accent); }
.team-card-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 4px; }
.badge-dept {
  font-size: 11px; padding: 2px 7px; border-radius: 99px;
  border: 1px solid; background: transparent; font-weight: 500;
}
.team-card-stats {
  display: flex; gap: 20px; width: 100%;
  justify-content: center; border-top: 1px solid var(--border);
  padding-top: 10px; margin-top: 2px;
}
.stat-mini { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stat-mini-value { font-size: 18px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-mini-label { font-size: 11px; color: var(--text-3); }
.team-card-actions { margin-top: 2px; }
.empty-state-full { padding: 40px; text-align: center; color: var(--text-3); grid-column: 1/-1; }

/* ===== Kapazität page ===== */
.capacity-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.capacity-nav { display: flex; align-items: center; gap: 8px; }
.capacity-period { font-size: 14px; font-weight: 600; color: var(--text); min-width: 160px; text-align: center; }
.capacity-legend {
  display: flex; flex-wrap: wrap; gap: 8px 16px;
  margin-bottom: 16px; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.capacity-table-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow-x: auto;
}
.capacity-table { width: 100%; border-collapse: collapse; min-width: 800px; }
.capacity-table th, .capacity-table td {
  padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.capacity-table thead tr { background: var(--surface-2); }
.capacity-table thead th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); font-family: 'Geist Mono', monospace; }
.capacity-table tbody tr:last-child td { border-bottom: none; }
.capacity-table tbody tr:hover td { background: var(--surface-hover); }
.capacity-name-col { min-width: 180px; position: sticky; left: 0; z-index: 2; }
/* Solid backgrounds so sticky column covers event blocks scrolled behind it */
.capacity-table thead th.capacity-name-col { background: var(--surface-2); }
.capacity-table tbody td.capacity-name-col { background: var(--surface); }
.capacity-table tbody tr:hover td.capacity-name-col { background: var(--surface-hover); }
.capacity-cap-col { min-width: 88px; position: sticky; left: 180px; z-index: 2; }
.capacity-table thead th.capacity-cap-col { background: var(--surface-2); }
.capacity-table tbody td.capacity-cap-col { background: var(--surface); }
.capacity-table tbody tr:hover td.capacity-cap-col { background: var(--surface-hover); }

/* Utilization cell layout */
.util-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
}
.util-cap {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.02em;
}
.util-bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 100%;
}
.util-bar-track {
  width: 100%;
  height: 5px;
  border-radius: 99px;
  background: var(--border);
  overflow: hidden;
}
.util-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--success, #22c55e);
  transition: width 300ms ease, background 300ms ease;
}
.util-bar-fill.high { background: #f59e0b; }
.util-bar-fill.over { background: var(--danger); }
.util-used {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  transition: color 200ms;
}
.util-used.high { color: #f59e0b; font-weight: 700; }
.util-used.over { color: var(--danger); font-weight: 700; }
.capacity-day-col { min-width: 100px; }
.capacity-today-header {
  background: var(--accent) !important;
  position: relative;
}
.capacity-today-header .day-label,
.capacity-today-header .day-date,
.capacity-today-header .kw-badge  { color: #fff !important; }
.capacity-today-header .day-date  { font-weight: 800; }
.week-label { font-size: 11px; font-weight: 600; }
.week-dates { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.capacity-cell { cursor: pointer; padding: 8px 10px !important; }
.capacity-cell:hover { background: var(--accent-light) !important; }
/* The content div is the true clip boundary (overflow:hidden on <td> is
   unreliable in table layout across browsers). */
.capacity-cell-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;       /* clips blocks that are wider than the column  */
  min-width: 0;           /* allows flex child to shrink below content size */
  width: 100%;
}
.capacity-block {
  border-radius: var(--radius-sm); padding: 3px 6px;
  font-size: 11.5px; font-weight: 500; color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;           /* don't push the flex container wider          */
  max-width: 100%;        /* hard cap at the container width               */
  box-sizing: border-box;
}
/* Public holiday block — hatched unavailable banner */
.capacity-block.holiday-block {
  background: repeating-linear-gradient(
    -45deg,
    rgba(244, 63, 94, 0.09) 0px,
    rgba(244, 63, 94, 0.09) 3px,
    rgba(244, 63, 94, 0.02) 3px,
    rgba(244, 63, 94, 0.02) 9px
  ) !important;
  border: 1px solid rgba(244, 63, 94, 0.28);
  border-radius: 3px;
  color: #f43f5e;
  font-style: normal;
  font-weight: 700;
  font-size: 9px;
  letter-spacing: .07em;
  text-transform: uppercase;
  cursor: default;
  pointer-events: none;
  opacity: 1;
  padding: 3px 5px;
}
.holiday-cell {
  background: rgba(244, 63, 94, 0.025) !important;
}

/* Vacation: cell fill + inline block, mirrors FullCalendar's
   fc-vacation-approved / fc-vacation-pending styles so timeline and
   calendar views communicate the same thing visually. */
.vacation-cell {
  background: rgba(34, 197, 94, 0.09) !important;
}
.vacation-cell.vacation-cell-pending {
  background: rgba(234, 179, 8, 0.09) !important;
}
.capacity-block.vacation-block {
  background: rgba(34, 197, 94, 0.18) !important;
  border: 1px solid rgba(34, 197, 94, 0.42);
  border-radius: 3px;
  color: #16a34a;
  font-style: normal;
  font-weight: 700;
  font-size: 9px;
  letter-spacing: .07em;
  text-transform: uppercase;
  cursor: default;
  pointer-events: none;
  opacity: 1;
  padding: 3px 5px;
}
.vacation-cell-pending .capacity-block.vacation-block {
  background: rgba(234, 179, 8, 0.18) !important;
  border-color: rgba(234, 179, 8, 0.45);
  color: #b45309;
}
[data-theme="dark"] .vacation-cell { background: rgba(34, 197, 94, 0.13) !important; }
[data-theme="dark"] .vacation-cell.vacation-cell-pending { background: rgba(234, 179, 8, 0.13) !important; }
[data-theme="dark"] .capacity-block.vacation-block { color: #4ade80; }
[data-theme="dark"] .vacation-cell-pending .capacity-block.vacation-block { color: #facc15; }

/* Tentative capacity block — dashed border, no fill, light+dark safe */
.capacity-block.tentative {
  background: transparent !important;
  border: 2px dashed var(--block-color, #6366f1);
  color: var(--block-color, #6366f1);
  box-shadow: none;
}
.capacity-block.tentative .capacity-block-label {
  color: var(--block-color, #6366f1);
  opacity: 1;
}
.capacity-block.declined .capacity-block-label {
  text-decoration: line-through;
  opacity: .7;
}
.capacity-block-label { font-size: 11px; }
.capacity-total { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.over-capacity  { color: var(--danger) !important; font-weight: 700; }
.high-capacity  { color: var(--warning) !important; font-weight: 600; }
.capacity-overtime { color: var(--danger); font-weight: 700; margin-left: 3px; }
.capacity-today { background: color-mix(in srgb, var(--accent) 10%, transparent) !important; }
.capacity-today .capacity-cell-content { border-left: 3px solid var(--accent); padding-left: 5px; }

/* Drag-to-create range highlight */
.capacity-cell { position: relative; overflow: hidden; }
.capacity-cell.range-selecting { background: color-mix(in srgb, var(--accent) 18%, transparent) !important; }
.capacity-cell.range-selecting::after { content:''; position:absolute; inset:0; border:2px dashed var(--accent); border-radius:3px; pointer-events:none; }

/* ── Custom Date Picker ──────────────────────────────────────────────────────── */

.dp-wrap {
  position: relative;
  display: block;
  width: 100%;
  font-size: 0; /* collapse inline gaps */
}

.dp-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  user-select: none;
  box-sizing: border-box;
  width: 100%;
}

.dp-trigger:hover { border-color: var(--accent); }

.dp-trigger:focus-within {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.dp-trigger-error { border-color: var(--danger) !important; }

.dp-icon {
  color: var(--text-3);
  display: flex;
  align-items: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: color var(--transition);
}

.dp-trigger:hover .dp-icon { color: var(--accent); }
.dp-icon:focus-visible { outline: none; color: var(--accent); }

.dp-display {
  flex: 1;
  line-height: 1.4;
  font-size: 14px;
}
.dp-placeholder { color: var(--text-3); }

.dp-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  line-height: 1.4;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
}
.dp-input::placeholder { color: var(--text-3); }

.dp-error {
  display: none;
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
}

/* Popup card */
.dp-popup {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  background: var(--surface);
  border: 1px solid var(--border-dark);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.08), 0 0 0 1px rgba(0,0,0,.04);
  padding: 14px;
  width: 272px;
  opacity: 0;
  transform: translateY(-4px) scale(.98);
  pointer-events: none;
  transition: opacity .13s ease, transform .13s cubic-bezier(.2,.8,.4,1);
}

.dp-popup.dp-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.dp-popup.dp-above {
  transform: translateY(4px) scale(.98);
}

.dp-popup.dp-above.dp-open { transform: translateY(0) scale(1); }

[data-theme="dark"] .dp-popup {
  box-shadow: 0 12px 40px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.06);
}

/* Header */
.dp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.dp-head-center {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .01em;
  background: none;
  border: none;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition);
}
.dp-head-center:hover { background: var(--bg); }

/* Month / year grid variants — 3×4 buttons instead of 7-col day grid */
.dp-grid.dp-grid-months,
.dp-grid.dp-grid-years {
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 4px 0;
}
.dp-month, .dp-year {
  height: 38px;
  border: none;
  background: none;
  font-size: 12.5px;
  color: var(--text);
  cursor: pointer;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-family: inherit;
  transition: background var(--transition), color var(--transition);
}
.dp-month:hover:not(.dp-selected),
.dp-year:hover:not(.dp-selected) {
  background: var(--bg);
}
.dp-month.dp-selected,
.dp-year.dp-selected {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.dp-year-lbl { color: var(--text-2); font-weight: 400; margin-left: 3px; }

.dp-nav {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background var(--transition), color var(--transition);
}

.dp-nav:hover { background: var(--bg); color: var(--text); }

/* Weekday labels */
.dp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 2px;
}

.dp-weekdays span {
  text-align: center;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-3);
  padding: 3px 0 5px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* Day grid */
.dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.dp-empty { height: 34px; }

.dp-day {
  height: 34px;
  border: none;
  background: none;
  font-size: 12.5px;
  color: var(--text);
  cursor: pointer;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-family: inherit;
  transition: background var(--transition), color var(--transition);
  position: relative;
}

.dp-day:hover:not(.dp-disabled):not(.dp-selected):not(.dp-range-cap) {
  background: var(--bg);
}

/* Today dot */
.dp-day.dp-today::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
}

/* Selected (single) */
.dp-day.dp-selected {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  border-radius: 7px;
}

/* Range fill */
.dp-day.dp-in-range {
  background: var(--accent-light);
  border-radius: 0;
  color: var(--accent);
}

/* Range end caps */
.dp-day.dp-range-cap {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.dp-day.dp-range-start { border-radius: 7px 0 0 7px; }
.dp-day.dp-range-end   { border-radius: 0 7px 7px 0; }

/* Disabled */
.dp-day.dp-disabled {
  color: var(--text-3);
  opacity: 0.35;
  cursor: not-allowed;
}

/* Drag-to-move states */

/* Source block: fades to a dashed outline placeholder so you see the origin */
.capacity-block.drag-source {
  opacity: 0.2;
  outline: 2px dashed rgba(255,255,255,0.6);
  outline-offset: -2px;
  filter: grayscale(0.4);
}

/* Drop target cell: glowing inset border to confirm landing zone */
.capacity-cell.drag-target {
  background: color-mix(in srgb, var(--accent) 12%, transparent) !important;
}
.capacity-cell.drag-target::after {
  content: '';
  position: absolute;
  inset: 2px;
  border: 2px solid var(--accent);
  border-radius: 3px;
  pointer-events: none;
  opacity: 0.7;
  animation: drag-target-pulse 0.9s ease-in-out infinite alternate;
}
@keyframes drag-target-pulse {
  from { opacity: 0.4; }
  to   { opacity: 0.85; }
}

/* Horizontal scroll only — page scrolls vertically, table scrolls horizontally.
   overflow-y: clip avoids creating a scroll container (unlike hidden),
   so position:sticky in thead uses the page scroll, not this container. */
.capacity-table-wrap {
  overflow-x: auto !important;
  overflow-y: clip;
  -webkit-overflow-scrolling: touch;
}
/* Sticky column headers — stick at top of their scroll container (the wrap) */
.capacity-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-2);
}
/* Corner cell: sticky both left and top */
.capacity-table thead th.capacity-name-col,
.capacity-table thead th.capacity-cap-col {
  z-index: 3;
}
.page-content { overflow: visible !important; }

/* Weekend columns — subtle gray tint */
.capacity-weekend-header {
  background: var(--surface-2) !important;
  min-width: 52px !important;
}
.capacity-weekend-header .day-label,
.capacity-weekend-header .day-date {
  color: var(--text-3) !important;
}
.capacity-weekend-cell {
  background: var(--surface-2) !important;
  min-width: 52px;
}
.capacity-table tbody tr:hover .capacity-weekend-cell {
  background: color-mix(in srgb, var(--accent) 6%, var(--surface-2)) !important;
}

/* KW badge on Monday columns */
.kw-badge {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 3px;
  padding: 1px 4px;
  margin-top: 3px;
  white-space: nowrap;
}
/* Visible range display in toolbar */
#capVisibleRange {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  min-width: 120px;
}
/* Heute button always visible next to range */
#capTodayBtn { flex-shrink: 0; }

/* ===== Talent redesign ===== */
.talent-table-row { cursor: pointer; }
.talent-table-row:hover td { background: var(--surface-2); }

.platform-badge {
  font-size: 10px; font-weight: 700; padding: 2px 6px;
  border-radius: 4px; letter-spacing: 0.03em;
}
.platform-ig { background: #fdf0f6; color: #e1306c; }
.platform-yt { background: #fff0f0; color: #cc0000; }
.platform-tk { background: rgba(238,29,82,.12); color: #ee1d52; }

/* ── Talent Hero (compact header + inline KPIs) ── */
.th-hero {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 24px;
  margin-bottom: 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.th-hero-left { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.th-hero-info { flex: 1; min-width: 0; }
.th-hero-name { font-size: 18px; font-weight: 700; color: var(--text); line-height: 1.2; }
.th-hero-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.th-hero-realname { font-size: 12px; color: var(--text-2); }
.th-hero-links { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.th-hero-kpis {
  display: flex; align-items: center; gap: 20px; flex-shrink: 0;
}
.th-kpi { text-align: right; }
.th-kpi-value {
  font-size: 20px; font-weight: 700; color: var(--text);
  line-height: 1.15; font-variant-numeric: tabular-nums;
}
.th-kpi-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-3); margin-top: 2px;
}
.th-kpi-sub { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.th-kpi-sep {
  width: 1px; height: 32px; background: var(--border); flex-shrink: 0;
}

@media (max-width: 768px) {
  .th-hero { flex-direction: column; align-items: flex-start; gap: 16px; }
  .th-hero-kpis { width: 100%; justify-content: flex-start; gap: 16px; border-top: 1px solid var(--border); padding-top: 14px; }
  .th-kpi { text-align: left; }
}

/* Legacy compat */
.talent-hero {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 20px;
  padding: 20px 24px; flex-wrap: wrap;
}
.talent-hero-left   { display: flex; align-items: flex-start; gap: 16px; flex: 1; min-width: 0; }
.talent-hero-info   { flex: 1; min-width: 0; }
.talent-hero-kpis   { display: flex; gap: 24px; flex-shrink: 0; flex-wrap: wrap; }

.kpi-mini           { text-align: right; }
.kpi-mini-value     { font-size: 18px; font-weight: 700; color: var(--text); line-height: 1.2; }
.kpi-mini-label     { font-size: 11px; color: var(--text-3); margin-top: 2px; }

.social-handle-link {
  font-size: 12px; font-weight: 500; padding: 3px 8px;
  border-radius: 20px; text-decoration: none;
  border: 1px solid transparent;
}
.social-handle-link.platform-ig { background:#fdf0f6; color:#e1306c; border-color:#fce7f3; }
.social-handle-link.platform-yt { background:#fff0f0; color:#cc0000; border-color:#fecaca; }
.social-handle-link.platform-tk { background:rgba(238,29,82,.1); color:#ee1d52; border-color:rgba(238,29,82,.25); }
.social-handle-link:not([class*="platform-"]) { background:var(--surface-2); color:var(--text-2); border-color:var(--border); }

.tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 1px 5px; border-radius: 10px;
  margin-left: 4px; line-height: 1.4;
}

.talent-overview-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
}

.detail-list-sm { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13px; margin: 0; }
.detail-list-sm dt { color: var(--text-3); font-weight: 500; }
.detail-list-sm dd { color: var(--text-2); margin: 0; }

.tag-chip {
  display: inline-block; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 20px;
  padding: 1px 8px; font-size: 11px; color: var(--text-2);
}

.inline-select {
  border: 1px solid var(--border); border-radius: 6px;
  padding: 3px 6px; font-size: 12px;
  background: var(--surface); color: var(--text-2);
  cursor: pointer;
}
.inline-select:hover { border-color: var(--accent); }

.kpi-grid-4 { grid-template-columns: repeat(4, 1fr) !important; }

/* Deal cards */
.deal-summary-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.deal-summary-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
}
.deal-summary-label { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.deal-summary-value { font-size: 22px; font-weight: 700; color: var(--text); }

.deal-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.deal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow .15s;
}
.deal-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.deal-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.deal-card-brand { font-size: 15px; font-weight: 600; color: var(--text); }
.deal-card-type { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.deal-card-values { display: flex; gap: 24px; }
.deal-card-amount { font-size: 16px; font-weight: 700; color: var(--text); }
.deal-card-sublabel { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.deal-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.chip-count {
  display: inline-block;
  background: rgba(0,0,0,.08);
  border-radius: 20px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 600;
  margin-left: 3px;
}
.chip-active .chip-count { background: rgba(255,255,255,.25); }

/* ===== Analytics redesign ===== */

/* Section label */
.an-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-3);
}

/* Channels card */
.an-channels {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 20px; overflow: hidden;
}
.an-channels-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.an-add-form {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  border-bottom: 1px solid var(--border); background: var(--surface-2); flex-wrap: wrap;
}
.an-select, .an-input {
  padding: 6px 10px; font-size: 12px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--surface); color: var(--text); outline: none;
  font-family: inherit; transition: border-color var(--transition);
}
.an-select:focus, .an-input:focus { border-color: var(--accent); }
.an-input { min-width: 140px; }

.an-channel-list {}
.an-channel-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  transition: background var(--transition); gap: 12px;
}
.an-channel-row:last-child { border-bottom: none; }
.an-channel-row:hover { background: var(--surface-hover); }
.an-channel-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.an-channel-handle { font-size: 13px; font-weight: 600; color: var(--text); }
.an-channel-platform { font-size: 11px; color: var(--text-3); }
.an-channel-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }

.an-platform-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.an-dot-instagram { background: #e1306c; }
.an-dot-youtube   { background: #ff0000; }
.an-dot-tiktok    { background: #010101; }
[data-theme="dark"] .an-dot-tiktok { background: #888; }
.an-dot-linkedin  { background: #0077b5; }

.an-status-connected {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--text-3);
}
.an-sync-date { color: var(--text-3); opacity: .7; }
.an-status-disconnected { font-size: 11px; color: var(--text-3); }

.an-btn-ghost {
  background: none; border: 1px solid var(--border); border-radius: 5px;
  padding: 3px 10px; font-size: 11px; color: var(--text-2);
  cursor: pointer; transition: all var(--transition); font-family: inherit;
}
.an-btn-ghost:hover { border-color: var(--border-dark); color: var(--text); }
.an-btn-remove { padding: 3px 5px; color: var(--text-3); }
.an-btn-remove:hover { color: var(--danger); border-color: var(--danger); }

.an-empty-state {
  padding: 24px 16px; font-size: 13px; color: var(--text-3);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}

/* Filter pills */
.an-filter-bar {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px;
}
.an-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--border); border-radius: 20px;
  background: var(--surface); color: var(--text-2);
  cursor: pointer; transition: all var(--transition);
  font-family: inherit; line-height: 1.3;
}
.an-pill:hover { border-color: var(--accent); color: var(--accent); }
.an-pill.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.an-pill.active .an-platform-dot { box-shadow: 0 0 0 2px rgba(255,255,255,.3); }

/* KPI cards */
.an-kpi-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 20px;
}
.an-kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  position: relative; overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.an-kpi:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.an-kpi-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.an-kpi-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.an-kpi-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.an-kpi-icon--purple { background: #f5f3ff; color: #7c3aed; }
.an-kpi-icon--green  { background: #ecfdf5; color: #059669; }
.an-kpi-icon--blue   { background: #eff6ff; color: #2563eb; }
.an-kpi-icon--orange { background: #fff7ed; color: #ea580c; }
[data-theme="dark"] .an-kpi-icon--purple { background: rgba(124,58,237,.12); }
[data-theme="dark"] .an-kpi-icon--green  { background: rgba(5,150,105,.12); }
[data-theme="dark"] .an-kpi-icon--blue   { background: rgba(37,99,235,.12); }
[data-theme="dark"] .an-kpi-icon--orange { background: rgba(234,88,12,.12); }

.an-kpi-value {
  font-size: 26px; font-weight: 700; color: var(--text);
  line-height: 1.15; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.an-kpi-sub { font-size: 11px; color: var(--text-3); margin-top: 4px; }

/* Breakdown table */
.an-breakdown {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px; margin-bottom: 20px;
}
.an-table-wrap { overflow-x: auto; }
.an-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.an-table th {
  text-align: left; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3); padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--border);
}
.an-table td {
  padding: 10px 12px 10px 0; color: var(--text);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.an-table tr:last-child td { border-bottom: none; }
.an-table .an-num { text-align: right; font-variant-numeric: tabular-nums; padding-right: 0; }
.an-table th.an-num { text-align: right; padding-right: 0; }
.an-table td:first-child { font-weight: 600; }

/* Charts grid */
.an-charts-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 12px; margin-bottom: 20px;
}
.an-chart-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.an-chart-header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 16px;
}
.an-chart-title {
  margin: 0; font-size: 14px; font-weight: 600; color: var(--text);
}
/* Period pills inside chart cards */
.an-period-pills {
  display: flex; gap: 1px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 3px;
}
.an-period {
  padding: 4px 12px; font-size: 11px; font-weight: 600;
  border: none; border-radius: 6px; cursor: pointer;
  background: transparent; color: var(--text-3);
  font-family: inherit; transition: all .15s ease;
  line-height: 1.3; letter-spacing: .02em;
}
.an-period:hover { color: var(--text); }
.an-period.active {
  background: var(--accent); color: #fff;
  box-shadow: 0 1px 4px rgba(17,4,197,0.25);
}
[data-theme="dark"] .an-period.active {
  box-shadow: 0 1px 4px rgba(85,72,245,0.3);
}
.an-chart-wrap { position: relative; height: 220px; }

/* Demographics */
.an-demographics { margin-top: 4px; }
.an-demo-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 12px;
}
.an-demo-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--text);
  margin-bottom: 16px;
}

/* Responsive */
@media (max-width: 900px) {
  .an-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .an-charts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .an-kpi-row { grid-template-columns: 1fr; }
  .an-channel-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .an-channel-actions { width: 100%; justify-content: flex-end; }
}

/* Legacy compat — keep old class working */
.analytics-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.analytics-chart-title { margin: 0 0 14px; font-size: 13px; font-weight: 600; color: var(--text); }

/* Deal direction badges */
.deal-direction-inbound  { background: #eff6ff; color: #3b82f6; border: 1px solid #bfdbfe; }
.deal-direction-outbound { background: #fdf4ff; color: #9333ea; border: 1px solid #e9d5ff; }

/* Platform connection cards */
.platform-connect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.platform-connect-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
}
.platform-connect-header { display: flex; justify-content: space-between; align-items: flex-start; }
.platform-connect-handle { font-size: 13px; font-weight: 600; margin-top: 4px; color: var(--text); }
.platform-connect-meta   { font-size: 11px; color: var(--text-muted); margin-top: 8px; }

.badge-success { background: rgba(34,197,94,0.10); color: var(--success); }

/* Demographics */
.demo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.demo-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: 10px; }
.demo-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.demo-bar-key { font-size: 11px; color: var(--text); width: 56px; flex-shrink: 0; }
.demo-bar-track { flex: 1; height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.demo-bar-fill  { height: 100%; background: var(--accent); border-radius: 3px; }
.demo-bar-pct   { font-size: 11px; color: var(--text-muted); width: 34px; text-align: right; flex-shrink: 0; }

@media (max-width: 900px) {
  .talent-overview-grid { grid-template-columns: 1fr; }
  .kpi-grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
  .talent-hero-kpis { gap: 16px; }
  .deal-summary-row { grid-template-columns: repeat(2, 1fr); }
  .analytics-charts-grid { grid-template-columns: 1fr; }
}

/* ===== Projects Grid & Cards ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.projects-list { display: flex; flex-direction: column; gap: 8px; }
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; flex-direction: column; gap: 10px;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.project-card:hover { box-shadow: var(--shadow-sm); border-color: var(--border-dark); }
.projects-list .project-card { flex-direction: row; align-items: center; padding: 14px 20px; gap: 16px; }
.project-card-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.projects-list .project-card-header { flex-shrink: 0; }
.project-type-pill {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px;
  letter-spacing: 0.03em;
}
.project-card-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.project-card-name {
  font-size: 15px; font-weight: 600; color: var(--text); text-decoration: none;
  line-height: 1.3;
}
.projects-list .project-card-name { flex: 1; }
.project-card-name:hover { color: var(--accent); }
.project-card-progress { display: flex; align-items: center; gap: 10px; }
.projects-list .project-card-progress { min-width: 140px; flex-shrink: 0; }
.progress-bar-wrap {
  flex: 1; height: 5px;
  background: var(--surface-3); border-radius: 99px; overflow: hidden;
}
.progress-bar { height: 100%; border-radius: 99px; transition: width 0.3s ease; }
.project-card-footer { display: flex; justify-content: space-between; align-items: center; }
.project-card-members { display: flex; }
.project-card-members .avatar { border: 2px solid var(--surface); margin-left: -6px; }
.project-card-members .avatar:first-child { margin-left: 0; }
.empty-state-full {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 60px 20px; color: var(--text-muted); text-align: center;
}
.view-toggle { display: flex; gap: 2px; margin-left: auto; }
.view-toggle .btn-icon { font-size: 16px; }
.view-toggle .btn-icon.active { background: var(--accent-light); color: var(--accent); }
@media (max-width: 768px) {
  .projects-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
  .projects-grid { grid-template-columns: 1fr; }
}

/* ===== Social Media Accounts ===== */
.social-accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.social-account-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: block; text-decoration: none;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.social-account-card:hover { box-shadow: var(--shadow-sm); border-color: var(--border-dark); }
.social-account-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
}
.social-platform-icon { font-size: 26px; line-height: 1; flex-shrink: 0; }
.social-account-name { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.social-account-stats {
  display: flex; gap: 0;
  padding-top: 14px; border-top: 1px solid var(--border);
}
.social-stat { flex: 1; padding-right: 12px; }
.social-stat:not(:last-child) {
  border-right: 1px solid var(--border); margin-right: 12px;
}
.social-stat-value { font-size: 18px; font-weight: 700; color: var(--text); line-height: 1.2; }
.social-stat-label {
  font-size: 10px; color: var(--text-3); margin-top: 3px;
  text-transform: uppercase; letter-spacing: 0.05em;
  font-family: 'Geist Mono', monospace;
}

/* ===== Podcast Cards ===== */
.podcast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.podcast-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: block; text-decoration: none;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.podcast-card:hover { box-shadow: var(--shadow-sm); border-color: var(--border-dark); }
.podcast-card-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px; flex-wrap: wrap;
}
.podcast-card-title {
  font-size: 14px; font-weight: 600; color: var(--text);
  flex: 1; min-width: 0;
}
.podcast-card-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

/* ===== Finance data-table (alias for .table style) ===== */
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead tr {
  background: var(--surface-2);
  border-bottom: 2px solid var(--border);
}
.data-table th {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-3);
  padding: 12px 14px; text-align: left;
  font-family: 'Geist Mono', monospace;
}
.data-table td {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  font-size: 13.5px; color: var(--text-2); vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tfoot td {
  padding: 12px 14px; border-top: 2px solid var(--border);
  font-weight: 600; color: var(--text);
}
.data-table tbody tr:hover td { background: var(--surface-hover); }
.data-table .text-right,
.data-table th.text-right { text-align: right; }

/* ===== Social Media Detail Page ===== */
.sm-hero-icon {
  width: 64px; height: 64px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sm-hero-stats {
  display: flex; gap: 0; flex-shrink: 0;
  border-left: 1px solid var(--border);
  padding-left: 24px; margin-left: 8px;
}
.sm-hero-stat {
  padding: 0 20px;
  border-right: 1px solid var(--border);
  text-align: right;
}
.sm-hero-stat:last-child { border-right: none; padding-right: 0; }
.sm-hero-stat-value { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1.2; }
.sm-hero-stat-label { font-size: 10px; color: var(--text-3); margin-top: 3px; text-transform: uppercase; letter-spacing: 0.05em; font-family: 'Geist Mono', monospace; }

/* Calendar */
.sm-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.sm-cal-header {
  background: var(--surface-2);
  padding: 8px 10px;
  font-size: 11px; font-weight: 600; color: var(--text-3);
  text-align: center;
  text-transform: uppercase; letter-spacing: 0.05em;
  font-family: 'Geist Mono', monospace;
}
.sm-cal-cell {
  background: var(--surface);
  min-height: 90px;
  padding: 6px 8px;
  display: flex; flex-direction: column; gap: 3px;
  transition: background var(--transition);
}
.sm-cal-cell:hover { background: var(--surface-hover); }
.sm-cal-empty { background: var(--surface-2); }
.sm-cal-day-num {
  font-size: 11px; font-weight: 600; color: var(--text-3);
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  margin-bottom: 2px; flex-shrink: 0;
}
.sm-cal-today { background: var(--accent); color: #fff; }
.sm-cal-post {
  display: block; text-decoration: none;
  padding: 3px 6px;
  border-radius: 4px;
  border-left: 3px solid transparent;
  transition: opacity var(--transition);
}
.sm-cal-post:hover { opacity: 0.8; }
.sm-cal-post-type {
  font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  display: block; font-family: 'Geist Mono', monospace;
}
.sm-cal-post-title {
  font-size: 10.5px; color: var(--text); display: block; line-height: 1.3;
  margin-top: 1px;
}

/* Assets */
.sm-asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.sm-asset-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.sm-asset-card:hover { box-shadow: var(--shadow-sm); border-color: var(--border-dark); }
.sm-asset-thumb {
  height: 100px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sm-asset-body { padding: 12px 14px; flex: 1; }
.sm-asset-name { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.3; }
.sm-asset-type-tag {
  font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
  letter-spacing: 0.03em;
}
.sm-asset-format {
  font-size: 10px; color: var(--text-3);
  background: var(--surface-2);
  padding: 2px 5px; border-radius: 3px;
  font-family: 'Geist Mono', monospace;
}
.sm-asset-notes {
  font-size: 11.5px; color: var(--text-muted);
  margin-top: 6px; line-height: 1.4;
}
.sm-asset-footer {
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface-2);
}

@media (max-width: 768px) {
  .sm-hero-stats { display: none; }
  .sm-cal-cell { min-height: 60px; }
  .sm-cal-post-type { display: none; }
}

/* ===================================================================
   FORM PAGE LAYOUT & IMPROVEMENTS
   =================================================================== */

.form-page        { max-width: 900px; }
.form-page-narrow { max-width: 660px; }

.content-grid { display: grid; gap: 16px; align-items: start; }
.content-grid.two-col { grid-template-columns: 3fr 2fr; }
@media (max-width: 920px) { .content-grid.two-col { grid-template-columns: 1fr; } }

/* form-control — Bootstrap-compatible alias for .form-input */
.form-control {
  display: block; width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text);
  background: var(--surface);
  outline: none; font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  box-sizing: border-box; appearance: none; -webkit-appearance: none;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.form-control::placeholder { color: var(--text-3); }
textarea.form-control { resize: vertical; }
select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 32px;
}

/* Card section header strip */
.card-header h2 {
  font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-3);
}
.form-card-strip {
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 9px;
  background: var(--surface-2);
}
.form-card-strip-bar {
  width: 3px; height: 15px; border-radius: 2px; flex-shrink: 0;
}
.form-card-strip-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-3);
}
.form-card-body { padding: 20px 20px 6px; }
.form-card-body .form-group { margin-bottom: 14px; }

/* Checkbox group for multi-select lists */
.checkbox-group {
  display: flex; flex-direction: column; gap: 2px;
  max-height: 220px; overflow-y: auto;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  padding: 4px; background: var(--surface);
}
.checkbox-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px;
  transition: background var(--transition);
}
.checkbox-item:hover { background: var(--surface-hover); }
.checkbox-item input[type="checkbox"] {
  width: 14px; height: 14px; accent-color: var(--accent);
  cursor: pointer; flex-shrink: 0;
}

/* Form actions bar (bottom row of form pages) */
.form-actions {
  margin-top: 20px;
  padding: 16px 0 4px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center;
  justify-content: space-between; gap: 12px;
}
.form-actions-left { display: flex; gap: 8px; }
.form-actions-right { display: flex; gap: 8px; }

/* ===================================================================
   PROJECT DETAIL PAGE
   =================================================================== */

/* ── Stats row ── */
.project-stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
@media (max-width: 1024px) { .project-stats-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px)  { .project-stats-row { grid-template-columns: repeat(2, 1fr); } }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-xs);
}
.stat-label {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-3); margin-bottom: 4px;
}
.stat-value {
  font-size: 22px; font-weight: 700;
  letter-spacing: 0.01em; color: var(--text); line-height: 1.35;
}
.stat-sub {
  font-size: 11px; color: var(--text-3); margin-top: 3px;
}

/* ── Project meta header ── */
.project-detail-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-bottom: 8px;
}
.project-description {
  font-size: 14px; color: var(--text-2); line-height: 1.5; margin: 0;
}

/* ── Kanban board ── */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  align-items: start;
  min-height: calc(100dvh - var(--topbar-h) - 200px);
}
@media (max-width: 1100px) { .kanban-board { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .kanban-board { grid-template-columns: 1fr; } }

.kanban-column {
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex; flex-direction: column;
  min-height: 180px;
  transition: background var(--transition);
}
.kanban-column.drag-over { background: var(--accent-light); }

.kanban-col-header {
  padding: 10px 12px;
  display: flex; align-items: center; justify-content: space-between;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.kanban-col-title {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-2);
}
.kanban-col-count {
  font-size: 11px; font-weight: 600;
  background: var(--surface-3);
  color: var(--text-3);
  border-radius: 10px;
  padding: 1px 7px;
  min-width: 20px; text-align: center;
}

.kanban-cards {
  padding: 8px;
  display: flex; flex-direction: column; gap: 6px;
  flex: 1;
  min-height: 60px;
}

.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 10px 8px;
  cursor: grab;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition), transform var(--transition);
  position: relative;
  overflow: hidden;
}
.kanban-card:hover { box-shadow: var(--shadow-sm); }
.kanban-card.dragging { opacity: 0.5; transform: rotate(1deg); }

.kanban-card-priority {
  position: absolute; top: 0; left: 0;
  width: 3px; height: 100%;
}
.kanban-card-title {
  display: block;
  font-size: 13px; font-weight: 500; color: var(--text);
  text-decoration: none; line-height: 1.4;
  padding-left: 8px;
  margin-bottom: 6px;
}
.kanban-card-title:hover { color: var(--accent); }

.kanban-card-tags {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding-left: 8px; margin-bottom: 6px;
}

.kanban-card-footer {
  display: flex; align-items: center;
  justify-content: space-between;
  padding-left: 8px;
  margin-top: 4px;
}
.kanban-card-meta {
  display: flex; align-items: center; gap: 8px;
}

.kanban-add-btn {
  display: block;
  padding: 7px 12px;
  font-size: 12px; color: var(--text-3);
  text-decoration: none;
  border-top: 1px solid var(--border);
  text-align: center;
  transition: background var(--transition), color var(--transition);
  border-radius: 0 0 var(--radius) var(--radius);
}
.kanban-add-btn:hover { background: var(--surface-hover); color: var(--accent); }

/* ── Milestone timeline ── */
.milestone-timeline {
  padding: 8px 0;
}
.milestone-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.milestone-item:last-child { border-bottom: none; }
.milestone-item:hover { background: var(--surface-hover); }
.milestone-item.milestone-done { opacity: 0.65; }

.milestone-marker { flex-shrink: 0; padding-top: 1px; }
.milestone-check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-dark);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 11px; font-weight: 700;
  color: transparent;
  transition: all var(--transition);
  padding: 0;
}
.milestone-check:hover { border-color: var(--accent); }
.milestone-check.checked {
  background: var(--success); border-color: var(--success);
  color: #fff;
}

.milestone-content { flex: 1; min-width: 0; }
.milestone-title { font-size: 14px; font-weight: 500; color: var(--text); }
.milestone-item.milestone-done .milestone-title { text-decoration: line-through; }
.milestone-date {
  font-size: 12px; flex-shrink: 0;
  padding-top: 3px;
}

/* ── Details tab ── */
.detail-row {
  display: flex; align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.detail-row:last-child { border-bottom: none; }
.detail-label {
  font-size: 12px; font-weight: 500;
  color: var(--text-3);
  flex-shrink: 0;
  min-width: 100px;
}

/* ── Team member row ── */
.member-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 6px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.member-row:hover { background: var(--surface-hover); }

/* ── empty-state (inline, within card) ── */
.empty-state {
  padding: 32px 18px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

/* ═══════════════════════════════════════════════════════════
   HR / Employee Hub
═══════════════════════════════════════════════════════════ */

/* Layout */
.hub-layout { display: flex; flex-direction: column; gap: 20px; max-width: 800px; }

/* Header card */
.hub-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; }
.hub-header-left { display: flex; align-items: center; gap: 14px; }
.hub-name { font-size: 18px; font-weight: 700; margin: 0; }
.hub-payday { text-align: right; }
.payday-label { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }
.payday-date { font-size: 17px; font-weight: 700; color: var(--text-1); }
.payday-days { font-size: 12px; color: var(--text-3); }

/* Hub section */
.hub-section { padding: 20px 24px; }
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase;
                 letter-spacing: 0.06em; color: var(--text-3); margin-bottom: 14px; }

/* Timer */
.timer-widget { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.timer-status { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.timer-status.running { color: var(--success, #22c55e); }
.timer-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor;
             animation: pulse-dot 1.5s ease-in-out infinite; }
@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:0.3} }
.timer-elapsed { font-size: 13px; color: var(--text-2); }
.timer-actions { display: flex; gap: 8px; }

/* Week grid */
.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week-day { padding: 8px 4px; border-radius: 8px; text-align: center; cursor: pointer;
            border: 1px solid transparent; transition: all 0.15s; }
.week-day:not(.weekend):hover { background: var(--accent-light); border-color: var(--accent); }
.week-day.today { background: color-mix(in srgb, var(--accent) 10%, transparent);
                  border-color: var(--accent); }
.week-day.weekend { opacity: 0.45; cursor: default; }
.week-day-name { font-size: 11px; font-weight: 600; color: var(--text-3); }
.week-day-date { font-size: 11px; color: var(--text-3); }
.week-day-hours { font-size: 14px; font-weight: 700; margin-top: 4px; }
.week-day-hours.good  { color: var(--success, #22c55e); }
.week-day-hours.ok    { color: var(--text-2); }
.week-day-hours.low   { color: var(--warning, #f59e0b); }
.week-day-hours.over  { color: var(--danger); }
.week-day-hours.empty { color: var(--text-4); }
.week-day-hours.running { color: var(--accent); }
.week-day-warn { font-size: 11px; color: var(--warning, #f59e0b); }

/* Vacation */
.vacation-balance { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.vac-bar-wrap { flex: 1; min-width: 120px; }
.vac-bar-track { height: 8px; border-radius: 99px; background: var(--border); overflow: hidden; }
.vac-bar-fill  { height: 100%; border-radius: 99px; background: var(--accent); transition: width 0.4s; }
.vac-stats { display: flex; flex-direction: column; }
.vac-remaining { font-weight: 700; font-size: 14px; }
.vac-list { display: flex; flex-direction: column; gap: 6px; }
.vac-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px;
            border-radius: 8px; background: var(--surface-2); font-size: 13px; flex-wrap: wrap; }
.vac-dates { font-weight: 500; }
.vac-days { color: var(--text-3); min-width: 60px; }

/* Hub tabs */
.hub-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); padding-bottom: 0; }
.hub-tab { background: none; border: none; padding: 8px 14px; font-size: 13px; font-weight: 500;
           cursor: pointer; color: var(--text-3); border-bottom: 2px solid transparent;
           margin-bottom: -1px; transition: all 0.15s; }
.hub-tab:hover { color: var(--text-1); }
.hub-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Expense list */
.expense-actions { display: flex; gap: 8px; margin-bottom: 12px; }
.expense-list { display: flex; flex-direction: column; gap: 6px; }
.expense-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px;
                border-radius: 8px; background: var(--surface-2); font-size: 13px; flex-wrap: wrap; }
.expense-meta { display: flex; flex-direction: column; min-width: 80px; }
.expense-date { font-weight: 500; font-size: 13px; }
.expense-desc { flex: 1; color: var(--text-2); }
.expense-amount { font-weight: 700; white-space: nowrap; }

/* Payslip list (employee) */
.payslip-list { display: flex; flex-direction: column; gap: 8px; }
.payslip-item { display: flex; justify-content: space-between; align-items: center;
                padding: 10px 14px; border-radius: 8px; background: var(--surface-2); }
.payslip-month { font-weight: 600; font-size: 14px; }

/* Page tabs (team page) */
.page-tabs { display: flex; gap: 2px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.page-tab { background: none; border: none; padding: 10px 16px; font-size: 13px; font-weight: 500;
            cursor: pointer; color: var(--text-3); border-bottom: 2px solid transparent;
            margin-bottom: -1px; transition: all 0.15s; position: relative; }
.page-tab:hover { color: var(--text-1); }
.page-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-badge { display: inline-flex; align-items: center; justify-content: center;
             width: 18px; height: 18px; border-radius: 50%; background: var(--danger);
             color: white; font-size: 10px; font-weight: 700; margin-left: 6px; }

/* Approval sections */
.approval-section { margin-bottom: 20px; }
.user-cell-sm { display: flex; align-items: center; gap: 8px; }
.action-cell { display: flex; gap: 6px; }
.btn-success { background: var(--success, #22c55e); color: white; border: none; }
.btn-success:hover { opacity: 0.9; }
.btn-danger-outline { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-danger-outline:hover { background: var(--danger); color: white; }

/* Time table cells */
.time-cell { text-align: center; font-size: 12px; }
.time-cell.good  { color: var(--success, #22c55e); }
.time-cell.ok    { color: var(--text-2); }
.time-cell.low   { color: var(--warning, #f59e0b); }
.time-cell.over  { color: var(--danger); }
.time-cell.empty { color: var(--text-4); }
.time-overview-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }

/* Payslip grid (manager) */
.payslip-grid { display: flex; flex-direction: column; gap: 12px; }
.payslip-user-card { display: flex; align-items: flex-start; gap: 16px; padding: 14px;
                     border-radius: 10px; background: var(--surface-2); flex-wrap: wrap; }
.payslip-user-card .user-cell-sm { min-width: 180px; }
.payslip-months { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; align-items: center; }
.payslip-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
               border-radius: 20px; background: var(--accent-light);
               font-size: 12px; font-weight: 500; color: var(--accent); }
.payslip-chip a { color: var(--accent); text-decoration: none; }

/* Section header flex */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }

/* Form page layout */
.form-page { max-width: 640px; }
.form-card { padding: 24px; }
.form-section-title { font-size: 14px; font-weight: 700; text-transform: uppercase;
                      letter-spacing: 0.05em; color: var(--text-3); margin-bottom: 16px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; padding-top: 16px;
                border-top: 1px solid var(--border); }

/* ── Stundenstand (Gesamtsaldo) ── */
.saldo-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
.saldo-bar.saldo-pos { background: #f0fdf4; border: 1px solid #86efac; }
.saldo-bar.saldo-neg { background: #fef2f2; border: 1px solid #fca5a5; }
[data-theme="dark"] .saldo-bar.saldo-pos { background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.30); }
[data-theme="dark"] .saldo-bar.saldo-neg { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.30); }
.saldo-bar.saldo-none { background: var(--surface); border: 1px solid var(--border); }
.saldo-value { font-weight: 700; font-size: 1.1rem; }
.saldo-pos .saldo-value { color: #16a34a; }
.saldo-neg .saldo-value { color: #dc2626; }
.saldo-detail { font-size: 0.85rem; }

/* ── Month Table ── */
.month-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0 0.5rem;
}
.month-nav-label {
  font-weight: 600;
  font-size: 0.95rem;
  min-width: 12rem;
  text-align: center;
}
.month-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}
.month-table th {
  text-align: left;
  padding: 0.35rem 0.5rem;
  border-bottom: 2px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  white-space: nowrap;
}
.month-table td {
  padding: 10px 8px;
  height: 2.5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}
.month-row-dim td { opacity: 0.45; }
.month-row-today { background: color-mix(in srgb, var(--primary) 6%, transparent); }
.month-day-cell { white-space: nowrap; }
.month-weekday { color: var(--text-muted); font-size: 0.8rem; display: inline-block; width: 1.8rem; text-align: left; }
.month-daynum  { font-weight: 500; }
.month-total-row td { border-top: 2px solid var(--border); border-bottom: none; padding-top: 0.5rem; }
.btn-xs { padding: 0.15rem 0.45rem; font-size: 0.78rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   MHUB — Employee Hub redesign
   All classes prefixed with .mhub- to avoid conflicts
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Layout ───────────────────────────────────────────────────────────────── */
.mhub {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1000px;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.mhub-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  flex-wrap: wrap;
}
.mhub-hero-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.mhub-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.mhub-hero-name {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 2px;
  line-height: 1.2;
  color: var(--text-1);
}
.mhub-hero-sub {
  font-size: 13px;
  color: var(--text-3);
  margin: 0;
}
.mhub-payday-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.mhub-payday-icon { font-size: 20px; }
.mhub-payday-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  font-weight: 600;
}
.mhub-payday-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  margin-top: 2px;
}
.mhub-payday-days {
  font-weight: 400;
  color: var(--text-3);
}

/* ── Grid ─────────────────────────────────────────────────────────────────── */
.mhub-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 800px) {
  .mhub-grid {
    grid-template-columns: 1fr 320px;
  }
}

/* ── Card ─────────────────────────────────────────────────────────────────── */
.mhub-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
}
.mhub-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}
.mhub-card-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.mhub-card-icon { font-size: 14px; }

/* Time card running state */
.mhub-card-time--running {
  border-color: rgba(22,163,74,0.35);
  background: color-mix(in srgb, #16a34a 4%, var(--surface));
}

/* ── Timer ────────────────────────────────────────────────────────────────── */
.mhub-timer { margin-bottom: 20px; }

.mhub-timer-running {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 14px;
}
.mhub-timer-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #16a34a;
  animation: mhub-pulse 1.4s ease-in-out infinite;
  margin-bottom: 6px;
}
@keyframes mhub-pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}
.mhub-timer-time {
  font-size: 42px;
  font-weight: 700;
  font-family: 'Geist Mono', monospace;
  font-variant-numeric: tabular-nums;
  color: #16a34a;
  line-height: 1;
  letter-spacing: -0.02em;
}
.mhub-card-time--running .mhub-timer-time { color: #15803d; }
.mhub-timer-since {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
}
.mhub-timer-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mhub-timer-idle {
  margin-bottom: 14px;
}
.mhub-timer-idle-clock {
  font-size: 42px;
  font-weight: 700;
  font-family: 'Geist Mono', monospace;
  font-variant-numeric: tabular-nums;
  color: var(--text-4);
  line-height: 1;
  letter-spacing: -0.02em;
}
.mhub-timer-idle-hint {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 6px;
}

/* ── Week strip ───────────────────────────────────────────────────────────── */
.mhub-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-bottom: 16px;
}
.mhub-day {
  padding: 8px 4px 10px;
  border-radius: 9px;
  text-align: center;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.12s, border-color 0.12s;
  background: var(--surface-2);
}
.mhub-day:not(.mhub-day--weekend):hover {
  background: var(--accent-light);
  border-color: var(--accent);
}
.mhub-day--today {
  background: color-mix(in srgb, var(--accent) 12%, transparent) !important;
  border-color: var(--accent) !important;
}
.mhub-day--weekend {
  opacity: 0.4;
  cursor: default;
}
.mhub-day-wd {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-3);
}
.mhub-day-num {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  margin: 3px 0 4px;
}
.mhub-day-h {
  font-size: 12px;
  font-weight: 700;
  font-family: 'Geist Mono', monospace;
  min-height: 16px;
}
.mhub-h--good  { color: #16a34a; }
.mhub-h--ok    { color: var(--text-2); }
.mhub-h--low   { color: #d97706; }
.mhub-h--over  { color: var(--danger); }
.mhub-h--empty { color: var(--text-4); }
.mhub-h--live  { color: var(--accent); animation: mhub-pulse 1.4s ease-in-out infinite; }

/* ── Saldo ────────────────────────────────────────────────────────────────── */
.mhub-saldo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 9px;
  flex-wrap: wrap;
}
.mhub-saldo--pos { background: #f0fdf4; border: 1px solid #bbf7d0; }
.mhub-saldo--neg { background: #fef2f2; border: 1px solid #fecaca; }
.mhub-saldo--none {
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-3);
}
.mhub-saldo-num {
  font-size: 22px;
  font-weight: 800;
  font-family: 'Geist Mono', monospace;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.mhub-saldo--pos .mhub-saldo-num { color: #15803d; }
.mhub-saldo--neg .mhub-saldo-num { color: #dc2626; }
.mhub-saldo-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}
.mhub-saldo-detail {
  font-size: 11px;
  color: var(--text-3);
  flex: 1;
}

/* ── Vacation card ────────────────────────────────────────────────────────── */
.mhub-card-vacation { display: flex; flex-direction: column; }

.mhub-vac-big {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
}
.mhub-vac-num {
  font-size: 54px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.mhub-vac-unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  line-height: 1.4;
}

.mhub-vac-progress { margin-bottom: 16px; }
.mhub-vac-track {
  height: 7px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
  margin-bottom: 6px;
}
.mhub-vac-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
  transition: width 0.5s cubic-bezier(.4,0,.2,1);
}
.mhub-vac-legend {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-3);
}

.mhub-vac-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
}
.mhub-vac-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  gap: 8px;
}
.mhub-vac-info { display: flex; align-items: center; gap: 8px; }
.mhub-vac-range { font-size: 13px; font-weight: 500; }
.mhub-vac-ndays { font-size: 12px; color: var(--text-3); }
.mhub-vac-item-right { display: flex; align-items: center; gap: 6px; }

/* ── Status pills ─────────────────────────────────────────────────────────── */
.mhub-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.mhub-pill--green  { background: #dcfce7; color: #15803d; }
.mhub-pill--amber  { background: #fef9c3; color: #b45309; }
.mhub-pill--red    { background: #fee2e2; color: #dc2626; }

/* ── Doc tabs ─────────────────────────────────────────────────────────────── */
.mhub-doc-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.mhub-doc-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 16px;
  margin-bottom: -1px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mhub-doc-tab:hover { color: var(--text-1); }
.mhub-doc-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.mhub-doc-actions { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }

/* ── Expense list ─────────────────────────────────────────────────────────── */
.mhub-exp-list { display: flex; flex-direction: column; gap: 6px; }
.mhub-exp-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--surface-2);
  flex-wrap: wrap;
}
.mhub-exp-left { display: flex; flex-direction: column; min-width: 90px; }
.mhub-exp-date { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mhub-exp-type { font-size: 11px; color: var(--text-3); }
.mhub-exp-desc { flex: 1; font-size: 13px; color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mhub-exp-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mhub-exp-amt { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── Payslip list ─────────────────────────────────────────────────────────── */
.mhub-slip-list { display: flex; flex-direction: column; gap: 8px; }
.mhub-slip-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 9px;
  background: var(--surface-2);
}
.mhub-slip-icon { font-size: 18px; }
.mhub-slip-month { flex: 1; font-size: 14px; font-weight: 600; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.mhub-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  padding: 7px 14px;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  white-space: nowrap;
  border: 1px solid transparent;
}
.mhub-btn-start {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  width: 100%;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
}
.mhub-btn-start:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.mhub-btn-stop {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.mhub-btn-stop:hover { background: var(--danger); color: #fff; }
.mhub-btn-outline {
  background: transparent;
  color: var(--text-1);
  border-color: var(--border-dark);
}
.mhub-btn-outline:hover { background: var(--surface-hover); }
.mhub-btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-3);
}
.mhub-btn-ghost:hover { color: var(--text-1); background: var(--surface-hover); }
.mhub-btn-xs { padding: 4px 9px; font-size: 12px; border-radius: 6px; }
.mhub-btn-sm { padding: 6px 12px; font-size: 12px; }

/* ── Empty states ─────────────────────────────────────────────────────────── */
.mhub-empty {
  font-size: 13px;
  color: var(--text-3);
  padding: 8px 0;
  margin: 0;
}
.mhub-empty--center { text-align: center; padding: 20px 0; }

/* ── Dark mode overrides ──────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  .mhub-saldo--pos { background: rgba(22,163,74,0.1); border-color: rgba(22,163,74,0.25); }
  .mhub-saldo--neg { background: rgba(220,38,38,0.1); border-color: rgba(220,38,38,0.25); }
  .mhub-pill--green { background: rgba(22,163,74,0.15); color: #4ade80; }
  .mhub-pill--amber { background: rgba(217,119,6,0.15); color: #fbbf24; }
  .mhub-pill--red   { background: rgba(220,38,38,0.15); color: #f87171; }
}
:root:not([data-theme="light"]) .mhub-saldo--pos { background: rgba(22,163,74,0.1); border-color: rgba(22,163,74,0.25); }
:root:not([data-theme="light"]) .mhub-saldo--neg { background: rgba(220,38,38,0.1); border-color: rgba(220,38,38,0.25); }
:root:not([data-theme="light"]) .mhub-pill--green { background: rgba(22,163,74,0.15); color: #4ade80; }
:root:not([data-theme="light"]) .mhub-pill--amber { background: rgba(217,119,6,0.15); color: #fbbf24; }
:root:not([data-theme="light"]) .mhub-pill--red   { background: rgba(220,38,38,0.15); color: #f87171; }

/* ── Mobile fixes pass 2 ── */

/* 1. Notification panel — prevent overflow on narrow viewports (390px) */
@media (max-width: 767px) {
  .notif-bell { position: static; }
  .notif-panel {
    position: fixed;
    top: var(--topbar-h);
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 0 0 var(--radius) var(--radius);
    z-index: 300;
  }
}

/* 2. Topbar — hide breadcrumb on mobile to prevent crowding */
@media (max-width: 767px) {
  .topbar-breadcrumb { display: none; }
  .page-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(100vw - 130px); }
}

/* 3. Hub week strip — reduce font sizes on very narrow screens */
@media (max-width: 420px) {
  .mhub-day { padding: 6px 2px 8px; }
  .mhub-day-wd { font-size: 9px; }
  .mhub-day-num { font-size: 12px; margin: 2px 0 3px; }
  .mhub-day-h { font-size: 10px; }
  .mhub-week { gap: 3px; }
}

/* 4. Month table — horizontal scroll on mobile.
   #monthTableContainer gets overflow:hidden to create a block formatting
   context — this prevents the 520px min-width table from pushing the
   page wider than the viewport (which was cutting off topbar icons). */
#monthTableContainer { overflow: hidden; }
.month-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

@media (max-width: 767px) {
  .month-nav-label { min-width: 9rem; font-size: 0.9rem; }
}

/* 5. Expense list — restructure to 2-row layout on mobile */
@media (max-width: 540px) {
  .mhub-exp-item {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 4px 8px;
    align-items: start;
  }
  .mhub-exp-left {
    grid-column: 1;
    grid-row: 1;
    flex-direction: row;
    gap: 6px;
    align-items: center;
    min-width: 0;
  }
  .mhub-exp-desc {
    grid-column: 1 / -1;
    grid-row: 2;
    white-space: normal;
  }
  .mhub-exp-right {
    grid-column: 2;
    grid-row: 1;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
  }
}

/* 6. Modal — ensure 95vw on mobile with proper padding */
/* modal mobile handled by bottom-sheet block below */

/* 7. Page header actions — ensure buttons wrap and don't overflow */
@media (max-width: 767px) {
  .page-header-actions { flex-wrap: wrap; width: 100%; }
  .page-header-actions .btn { flex: 1 1 auto; justify-content: center; min-width: 0; }
}

/* 8. KPI grid — single column on very small screens */
@media (max-width: 400px) {
  .kpi-grid, .kpi-grid-3 { grid-template-columns: 1fr !important; }
}

/* 9. Finance data-table — ensure horizontal scroll on mobile */
@media (max-width: 767px) {
  .card > .data-table { min-width: 500px; }
  .card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* 10. Hub hero — stack on very small screens */
@media (max-width: 420px) {
  .mhub-hero { padding: 14px 16px; }
  .mhub-payday-inner { padding: 8px 12px; }
  .mhub-hero-name { font-size: 17px; }
}

/* 11. Sidebar nav-group subitems — ensure they fit within 220px mobile sidebar */
@media (max-width: 767px) {
  .nav-group-items { margin-left: 16px; padding-left: 10px; }
  .nav-subitem { font-size: 12.5px; padding: 6px 8px; }
}

/* 12. Topbar page-title size on tablet */
@media (max-width: 1024px) {
  .page-title { font-size: 17px; }
}

/* 13. Doc actions buttons on narrow screens */
@media (max-width: 480px) {
  .mhub-doc-actions { flex-direction: column; }
  .mhub-doc-actions .mhub-btn { width: 100%; justify-content: center; }
}

/* ── Absence badges + action buttons in month table ─────────────────────────── */
.month-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.month-badge--vacation { background: #d1fae5; color: #065f46; }
.month-badge--sick     { background: #fee2e2; color: #991b1b; }
.month-badge--comp     { background: #e0e7ff; color: #3730a3; }
.month-badge--holiday  { background: #ede9fe; color: #6d28d9; }

.month-absence-note {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.month-action-group { display: flex; gap: 3px; flex-wrap: wrap; }
.month-btn-sick  { color: #dc2626 !important; border-color: #fca5a5 !important; }
.month-btn-comp  { color: #4338ca !important; border-color: #a5b4fc !important; }

/* ── Entity Picker ─────────────────────────────────────────────────────────── */
.entity-picker { position: relative; }
.entity-picker-trigger {
  width: 100%; text-align: left; background: var(--surface);
  border: 1px solid var(--border-dark); border-radius: 6px;
  padding: 8px 12px; cursor: pointer; display: flex; justify-content: space-between;
  align-items: center; font-size: .875rem; color: var(--text);
  transition: border-color .15s;
}
.entity-picker-trigger:hover { border-color: var(--primary, #6366f1); }
.entity-picker-trigger:focus { outline: none; border-color: var(--primary, #6366f1); box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.entity-picker-arrow { color: var(--text-muted, #6b7280); font-size: .75rem; flex-shrink: 0; margin-left: 8px; }
.entity-picker-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 200;
  background: var(--surface); border: 1px solid var(--border-dark);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12);
  max-height: 320px; display: flex; flex-direction: column;
}
.entity-picker-search-wrap { padding: 8px; border-bottom: 1px solid var(--border-dark); flex-shrink: 0; }
.entity-picker-search-wrap input {
  width: 100%; border: 1px solid var(--border-dark); border-radius: 6px;
  padding: 6px 10px; font-size: .875rem; outline: none; background: var(--surface);
  color: var(--text);
}
.entity-picker-search-wrap input:focus { border-color: var(--primary, #6366f1); }
.entity-picker-list { overflow-y: auto; flex: 1; }
.entity-picker-group-label {
  padding: 6px 12px 3px; font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted, #9ca3af); position: sticky; top: 0;
  background: var(--surface);
}
.entity-picker-item {
  padding: 7px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 1px;
  transition: background .1s;
}
.entity-picker-item:hover { background: var(--surface-hover); }
.entity-picker-item.selected { background: rgba(99,102,241,.08); }
.entity-picker-item-name { font-size: .875rem; color: var(--text); }
.entity-picker-item-meta { font-size: .75rem; color: var(--text-muted, #6b7280); }
.entity-picker-clear {
  padding: 7px 12px; cursor: pointer; font-size: .875rem; color: var(--text-muted, #6b7280);
  border-top: 1px solid var(--border-dark); text-align: center;
}
.entity-picker-clear:hover { background: var(--surface-hover); color: var(--danger, #ef4444); }
.entity-picker-no-results { padding: 16px 12px; text-align: center; font-size: .875rem; color: var(--text-muted, #9ca3af); }

/* User type badges */
.user-type-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: middle;
  margin-left: 6px;
}
.user-type-freelancer {
  background: #f97316;
  color: #fff;
}
.user-type-customer {
  background: #8b5cf6;
  color: #fff;
}
.user-type-talent {
  background: #ec4899;
  color: #fff;
}

/* ── Project Share Popover (Notion-style) ──────────────────────────────── */
.sp-wrap { position: relative; display: inline-flex; }

.sp-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans, 'Geist', sans-serif);
  color: var(--text-2);
  background: transparent;
  border: 1px solid var(--border-dark);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.sp-btn:hover { background: var(--surface-hover); color: var(--text-1); border-color: var(--text-3); }

.sp-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 600;
  background: var(--surface-3);
  color: var(--text-2);
  border-radius: 9px;
}

/* Panel */
.sp-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  background: var(--surface);
  border: 1px solid var(--border-dark);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.13), 0 2px 8px rgba(0,0,0,.06);
  z-index: 650;
  opacity: 0;
  transform: translateY(-4px) scale(.99);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
  overflow: hidden;
}
.sp-panel-open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

/* Head */
.sp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px 11px;
  border-bottom: 1px solid var(--border);
}
.sp-head-title { font-size: 13px; font-weight: 600; color: var(--text-1); letter-spacing: -0.01em; }
.sp-head-avatars { display: flex; align-items: center; }
.sp-head-av { margin-left: -5px; border: 2px solid var(--surface); border-radius: 50%; }
.sp-head-more {
  margin-left: -5px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  font-size: 10px; font-weight: 600;
  background: var(--surface-3); color: var(--text-2);
  border: 2px solid var(--surface); border-radius: 50%;
}

/* Search */
.sp-search-wrap { position: relative; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.sp-search-ico {
  position: absolute; left: 22px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); pointer-events: none;
}
.sp-search-input {
  width: 100%; height: 32px;
  padding: 0 10px 0 30px;
  font-size: 13px; font-family: inherit; color: var(--text-1);
  background: var(--surface-2);
  border: 1px solid transparent; border-radius: 6px;
  outline: none; box-sizing: border-box;
  transition: border-color 0.12s, background 0.12s;
}
.sp-search-input:focus { border-color: var(--accent); background: var(--surface); }
.sp-search-input::placeholder { color: var(--text-3); }

.sp-results {
  position: absolute; left: 12px; right: 12px; top: calc(100% - 4px);
  background: var(--surface); border: 1px solid var(--border-dark);
  border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.10);
  z-index: 10; overflow: hidden; display: none;
}
.sp-result {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; cursor: pointer; font-size: 13px; color: var(--text-1);
  transition: background 0.1s;
}
.sp-result:hover { background: var(--surface-hover); }
.sp-result-dis { opacity: .45; cursor: default; }
.sp-result-name { flex: 1; }
.sp-result-tag { font-size: 11px; color: var(--text-3); }

/* List */
.sp-list { max-height: 300px; overflow-y: auto; }
.sp-empty { padding: 16px; font-size: 13px; color: var(--text-3); text-align: center; }

.sp-row { padding: 10px 16px; border-bottom: 1px solid var(--border); }
.sp-row:last-child { border-bottom: none; }
.sp-row-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sp-row-left { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.sp-row-info { display: flex; align-items: center; gap: 5px; min-width: 0; }
.sp-row-name {
  font-size: 13px; font-weight: 500; color: var(--text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sp-row-right { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }

.sp-access-pill {
  font-size: 11px; color: var(--text-3);
  background: var(--surface-2); padding: 2px 6px; border-radius: 4px;
}
.sp-access-full { color: var(--accent); background: var(--accent-light); }

.sp-remove-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; padding: 0;
  background: transparent; border: none; border-radius: 4px;
  color: var(--text-3); cursor: pointer;
  opacity: 0; transition: opacity 0.12s, background 0.12s, color 0.12s;
}
.sp-row:hover .sp-remove-btn { opacity: 1; }
.sp-remove-btn:hover { background: #fee2e2; color: #ef4444; }

/* Section tags */
.sp-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.sp-tag {
  display: inline-flex; align-items: center;
  padding: 3px 8px; font-size: 11px; font-weight: 500; color: var(--text-3);
  background: transparent; border: 1px solid var(--border-dark); border-radius: 4px;
  cursor: pointer; user-select: none;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.sp-tag input { display: none; }
.sp-tag:hover { border-color: var(--text-3); color: var(--text-2); }
.sp-tag-on { color: var(--accent); background: var(--accent-light); border-color: var(--accent-light); }

/* ── Kalkulation — Precision flat-table standard ────────────────── */

/* KPI strip */
.kalpl-kpi-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}
.kalpl-kpi {
  background: var(--surface);
  padding: 14px 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
}
.kalpl-kpi::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--border);
  transition: background .25s;
}
.kalpl-kpi.kpi--revenue::before  { background: var(--accent, #1104c5); }
.kalpl-kpi.kpi--external::before { background: #f59e0b; }
.kalpl-kpi.kpi--internal::before { background: #6366f1; }
.kalpl-kpi.kpi--margin::before   { background: var(--success, #22c55e); }
.kalpl-kpi.kpi--margin.neg::before { background: var(--danger, #ef4444); }

.kalpl-kpi-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.kalpl-kpi-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  line-height: 1.1;
  transition: color .2s;
}
.kalpl-kpi-value.kalpl-kpi--positive { color: var(--success, #22c55e); }
.kalpl-kpi-value.kalpl-kpi--negative { color: var(--danger, #ef4444); }

/* Main table card */
.kalpl-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.kalpl-wrap { overflow-x: auto; }
.kalpl-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1060px;
  font-size: 12.5px;
}
.kalpl-table thead tr {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.kalpl-table th {
  padding: 7px 10px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .07em;
  white-space: nowrap;
}
.kalpl-table th.r { text-align: right; }

/* Body rows */
.kalpl-table tbody tr {
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  transition: background .1s;
}
.kalpl-table tbody tr:last-child { border-bottom: none; }
.kalpl-table tbody tr:hover { background: var(--surface-hover, color-mix(in srgb, var(--accent) 4%, transparent)); }
.kalpl-table tbody tr.kal-saving { opacity: .6; }
@keyframes kal-flash { 0%,100%{background:transparent} 30%{background:color-mix(in srgb,var(--accent) 12%,transparent)} }
.kalpl-table tbody tr.kal-saved { animation: kal-flash .55s ease; }

.kalpl-table td {
  padding: 5px 10px;
  vertical-align: middle;
}

/* Editable cells */
.kal-cell {
  outline: none;
  display: block;
  padding: 4px 5px;
  border-radius: 3px;
  min-width: 28px;
  transition: background .1s, outline .1s;
}
.kal-cell:focus {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  outline: 1.5px solid var(--accent);
}
.kal-cell.r { text-align: right; font-variant-numeric: tabular-nums; }

/* Calc cells (read-only computed) */
.kal-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  color: var(--text-2);
  font-weight: 500;
}

/* Person cell */
.kal-person {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.kal-person-sel {
  background: transparent;
  border: none;
  font-size: 11.5px;
  color: var(--text);
  cursor: pointer;
  padding: 3px 2px;
  font-family: inherit;
  max-width: 148px;
  width: 100%;
}
.kal-person-sel:focus { outline: 1.5px solid var(--accent); border-radius: 3px; }
.kal-person-sel option { background: var(--surface); }
.kal-rate-hint {
  font-size: 10px;
  color: var(--text-3);
  padding-left: 2px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  letter-spacing: .01em;
}

/* Gewinn pill */
.kal-gewinn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  min-width: 80px;
}
.kal-gewinn.pos { color: var(--success, #22c55e); }
.kal-gewinn.neg { color: var(--danger, #ef4444); }
.kal-gewinn-bar {
  display: block;
  height: 3px;
  border-radius: 2px;
  width: 28px;
  background: var(--border);
  overflow: hidden;
  flex-shrink: 0;
}
.kal-gewinn-fill {
  display: block;
  height: 100%;
  border-radius: 2px;
  transition: width .3s, background .3s;
}

/* Unit select */
.kal-unit-sel {
  background: transparent;
  border: none;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  padding: 3px 2px;
  font-family: inherit;
  width: 100%;
}
.kal-unit-sel:focus { outline: 1.5px solid var(--accent); border-radius: 3px; }
.kal-unit-sel option { background: var(--surface); }

/* Add-row — full-width tfoot button */
.kal-addrow-tr {
  cursor: pointer;
  border-top: 2px dashed var(--border);
  transition: background .15s, border-color .18s;
  outline: none;
}
.kal-addrow-tr:hover,
.kal-addrow-tr:focus-visible {
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  border-top-color: var(--accent);
}
.kal-addrow-tr:hover .kal-addrow-icon,
.kal-addrow-tr:focus-visible .kal-addrow-icon {
  background: var(--accent);
  color: #fff;
  transform: scale(1.1);
}
.kal-addrow-tr:hover .kal-addrow-label,
.kal-addrow-tr:focus-visible .kal-addrow-label {
  color: var(--accent);
}
.kal-addrow-tr td { padding: 0; }
.kal-addrow-inner {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
}
.kal-addrow-icon {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .15s, color .15s, transform .15s;
}
.kal-addrow-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: .01em;
  transition: color .15s;
}
.kal-save-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success); opacity: 0;
  transition: opacity .3s;
  margin-left: auto;
}
.kal-save-dot.active { opacity: 1; animation: dot-pulse 1s ease infinite; }
@keyframes dot-pulse { 0%,100%{opacity:.3} 50%{opacity:1} }

/* Summary footer bar */
.kalpl-footer {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border-top: 2px solid var(--border);
}
.kalpl-footer-item {
  background: var(--bg);
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.kalpl-footer-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-3);
}
.kalpl-footer-val {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.kalpl-footer-val.pos { color: var(--success, #22c55e); }
.kalpl-footer-val.neg { color: var(--danger, #ef4444); }

/* Empty state */
.kal-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

@media (max-width: 720px) {
  .kalpl-kpi-bar { grid-template-columns: 1fr 1fr; }
  .kalpl-footer  { grid-template-columns: 1fr 1fr; }
}

/* Keep old classes as aliases for backward compat (episode-summary block) */
.kalpl-kpi-value.positive { color: var(--success, #22c55e); }
.kalpl-kpi-value.negative { color: var(--danger, #ef4444); }
/* Episode summary block (podcast project kalkulation only) */
.kalpl-episode-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}
.kalpl-episode-summary-header {
  padding: 12px 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kalpl-episode-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  text-decoration: none;
  color: var(--text);
}
.kalpl-episode-row:last-child { border-bottom: none; }
.kalpl-episode-row:hover { background: var(--bg); }
.kalpl-episode-row-sum {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ===== alikeos — Improvements 2026-03-23 ===== */

/* ── Focus indicators (keyboard navigation) ────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent, #1104c5);
  outline-offset: 2px;
  border-radius: 3px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent, #1104c5);
  outline-offset: 2px;
}

/* ── Skip-to-content link (screen readers / keyboard) ──────────────────── */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent, #1104c5);
  color: #fff;
  padding: 8px 16px;
  border-radius: 0 0 8px 0;
  font-size: 13px;
  font-weight: 600;
  z-index: 10000;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}

/* ── Project number badge — more visible ───────────────────────────────── */
.project-number-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent, #1104c5);
  background: color-mix(in srgb, var(--accent, #1104c5) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent, #1104c5) 25%, transparent);
  border-radius: 4px;
  padding: 2px 7px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  white-space: nowrap;
}
.project-number-badge:hover {
  background: color-mix(in srgb, var(--accent, #1104c5) 18%, transparent);
  border-color: color-mix(in srgb, var(--accent, #1104c5) 45%, transparent);
}
.project-number-badge:active {
  transform: scale(0.94);
}
.project-number-badge .pnb-icon {
  opacity: 0;
  font-size: 0.65rem;
  transition: opacity 0.15s;
}
.project-number-badge:hover .pnb-icon {
  opacity: 0.7;
}

/* ── Podcast Header Card ─────────────────────────────────────────────── */
.podcast-header-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.podcast-header-inner {
  padding: 20px 24px 0;
}
.podcast-header-toprow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.podcast-back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.15s;
}
.podcast-back-link:hover { color: var(--text-2); }
.podcast-header-body {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}
.podcast-header-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-top: 2px;
}
.podcast-header-info { flex: 1; min-width: 0; }
.podcast-header-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.podcast-client-tag {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.podcast-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
  line-height: 1.35;
  margin: 0 0 6px;
}
.podcast-description-text {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.5;
  margin: 0;
}

/* Episode pipeline */
.podcast-pipeline {
  display: flex;
  align-items: center;
  gap: 0;
  border-top: 1px solid var(--border);
  padding: 0 0 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.podcast-pipeline::-webkit-scrollbar { display: none; }
.pp-step {
  flex: 1;
  min-width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  gap: 3px;
  opacity: 0.45;
  transition: opacity 0.2s;
}
.pp-step.pp-active { opacity: 1; }
.pp-count {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text-3);
  line-height: 1;
}
.pp-active .pp-count { color: inherit; }
.pp-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  white-space: nowrap;
}
.pp-sep {
  color: var(--border);
  font-size: 16px;
  flex-shrink: 0;
  user-select: none;
  padding: 0 2px;
}
.pp-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
  flex-shrink: 0;
  margin: 0 4px;
}
.pp-total .pp-count { color: var(--text-2); font-size: 18px; }
.pp-total { opacity: 1; min-width: 64px; }

@media (max-width: 640px) {
  .podcast-title { font-size: 18px; }
  .podcast-header-icon { display: none; }
  .pp-step { min-width: 60px; padding: 10px 4px; }
  .pp-count { font-size: 16px; }
}

/* ── Loading spinner ───────────────────────────────────────────────────── */
@keyframes alikeos-spin {
  to { transform: rotate(360deg); }
}
.alikeos-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-color, rgba(0,0,0,0.12));
  border-top-color: var(--accent, #1104c5);
  border-radius: 50%;
  animation: alikeos-spin 0.7s linear infinite;
  vertical-align: middle;
}

/* ── Error pages ── */
.error-page { display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:60vh; text-align:center; padding:40px 20px; }
.error-code { font-size:80px; font-weight:800; color:var(--accent); line-height:1; letter-spacing:-3px; margin-bottom:12px; }
.error-title { font-size:22px; font-weight:600; color:var(--text); margin-bottom:8px; }
.error-msg { font-size:15px; color:var(--text-2); margin-bottom:28px; }

/* ── Print stylesheet ──────────────────────────────────────────────────── */
@media print {
  .sidebar,
  .topbar,
  .flash-container,
  .notif-bell,
  .topbar-actions,
  .btn,
  .btn-primary,
  .btn-outline,
  .tab-bar,
  .filter-bar {
    display: none !important;
  }
  .main-wrapper {
    margin: 0 !important;
    padding: 0 !important;
  }
  .main-content {
    padding: 0 !important;
  }
  body {
    font-size: 11pt;
    color: #000;
    background: #fff;
  }
  a { color: inherit; text-decoration: none; }
  .card, .panel, .detail-card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
    break-inside: avoid;
  }
  table { width: 100%; border-collapse: collapse; }
  th, td { border: 1px solid #ddd; padding: 4px 8px; text-align: left; }
}

/* ── FullCalendar week numbers ─────────────────────────────────────────────── */
.fc .fc-daygrid-week-number {
  font-size: 9.5px !important;
  font-weight: 700 !important;
  font-family: 'Geist Mono', monospace !important;
  letter-spacing: .03em !important;
  color: var(--text-3) !important;
  background: var(--surface-2) !important;
  border: 1px solid var(--border) !important;
  border-radius: 4px !important;
  padding: 2px 5px !important;
  margin: 3px 2px 0 !important;
  text-decoration: none !important;
  display: inline-block !important;
  line-height: 1.4 !important;
  transition: color var(--transition), border-color var(--transition) !important;
}
.fc .fc-daygrid-week-number:hover {
  color: var(--accent) !important;
  border-color: var(--accent) !important;
}
/* Week-number + disabled-day: allow FC to collapse them via colgroup.
   NOTE: .fc-timegrid-axis is deliberately excluded — FC sizes it from
   the time-slot labels ("06 Uhr" etc.) which is wide enough for "Ganztag". */
.fc .fc-day-disabled.fc-daygrid-day,
.fc td.fc-week-number { min-width: 0 !important; }
/* Root cause: FC sets justify-content:flex-end on the axis frame, which pushes
   the cushion to the right edge of the narrow column — left portion ("Ga") gets
   clipped by overflow:hidden, leaving only "nztag" visible.
   Fix: flip to center so the badge is centred in the axis column. */
.fc .fc-timegrid-axis-frame {
  justify-content: center !important;
}
/* "Ganztag" all-day label — styled as a compact accent badge */
.fc .fc-timegrid-axis-cushion {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.44rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  max-width: none !important;
  line-height: 1.5;
  white-space: nowrap;
}
[data-theme="dark"] .fc .fc-daygrid-week-number {
  background: var(--surface-3) !important;
  border-color: var(--border-dark) !important;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .fc .fc-daygrid-week-number {
    background: var(--surface-3) !important;
    border-color: var(--border-dark) !important;
  }
}

/* ── iOS safe-area insets (notch / home-bar) ───────────────────────────────── */
@supports (padding: env(safe-area-inset-bottom)) {
  .sidebar {
    padding-bottom: env(safe-area-inset-bottom);
  }
  /* On landscape iOS the sidebar might be behind the notch */
  .sidebar {
    padding-left: env(safe-area-inset-left);
  }
  .main-wrapper {
    padding-bottom: env(safe-area-inset-bottom);
  }
  @media (max-width: 767px) {
    .topbar {
      padding-left: calc(16px + env(safe-area-inset-left));
      padding-right: calc(16px + env(safe-area-inset-right));
    }
  }
}

/* ── Touch target improvements (mobile) ────────────────────────────────────── */
@media (max-width: 1024px) {
  /* Nav items: minimum 44×44px tap target */
  .nav-item { min-height: 44px; }
  .sidebar.open .nav-item { min-height: 40px; }

  /* Buttons: comfortable tap size */
  .btn, .btn-primary, .btn-outline, .btn-ghost {
    min-height: 40px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .btn-sm { min-height: 34px; }
  .btn-xs { min-height: 28px; }

  /* Tab buttons */
  .tab-btn { min-height: 44px; }
}

/* ── FullCalendar mobile ───────────────────────────────────────────────────── */
@media (max-width: 767px) {
  /* Reduce toolbar button font size */
  .fc .fc-button { font-size: 11px !important; padding: 3px 8px !important; }
  .fc .fc-toolbar-title { font-size: 14px !important; }
  .fc .fc-toolbar.fc-header-toolbar { gap: 6px; flex-wrap: wrap; }
  /* List view: comfortable row height */
  .fc .fc-list-event td { padding: 10px 12px; }
  .fc .fc-list-day-cushion { padding: 6px 12px; }
  /* Week numbers hidden on very small screens */
  .fc .fc-daygrid-week-number { display: none !important; }
}
@media (max-width: 480px) {
  .fc .fc-prev-button.fc-button,
  .fc .fc-next-button.fc-button { width: 32px !important; height: 32px !important; }
}

/* ── Very large screens (2200px+): wider sidebar + more breathing room ─────── */
@media (min-width: 2200px) {
  :root { --sidebar-w: 260px; }
  .main-content { padding: 32px 48px; }
  .page-content  { padding: 40px 56px; }

  /* Dashboard: wider right panel so it doesn't look tiny beside ~1900px of content */
  .db-grid { grid-template-columns: 1fr 460px; }

  /* Finance forecast: allow one more column in the legend */
  .fc-chart-legend { grid-template-columns: repeat(3, 1fr) !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE BOTTOM NAVIGATION
═══════════════════════════════════════════════════════════════════════════ */
.mobile-bottom-nav { display: none; }

@media (max-width: 767px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 58px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(247,247,248,.96);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border-top: 1px solid var(--border);
    z-index: 95;
    align-items: stretch;
  }
  [data-theme="dark"] .mobile-bottom-nav { background: rgba(17,17,19,.96); }

  .mbn-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-3);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    padding: 6px 4px 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: 0.01em;
    transition: color .13s;
    -webkit-tap-highlight-color: transparent;
  }
  .mbn-item svg { width: 22px; height: 22px; flex-shrink: 0; }
  .mbn-item.active { color: var(--accent); }
  .mbn-item.active svg { stroke-width: 2.2; }

  /* Push content above bottom nav */
  .main-wrapper {
    padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Hide duplicate topbar hamburger — bottom nav handles the menu */
  .topbar-hamburger { display: none !important; }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mobile-bottom-nav { background: rgba(17,17,19,.96); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   BOTTOM-SHEET MODALS (mobile)
═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  .modal-overlay {
    padding: 0 !important;
    align-items: flex-end !important;
    /* Slightly darken backdrop for focus */
    background: rgba(0,0,0,.55) !important;
  }
  .modal, .modal-sm {
    border-radius: var(--radius-xl) var(--radius-xl) 0 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    max-height: 92dvh !important;
    overflow-y: auto;
    /* Slide up animation */
    animation: _sheet-up .22s cubic-bezier(.32,1,.32,1) both;
    /* Handle indicator */
    padding-top: 6px;
  }
  .modal::before, .modal-sm::before {
    content: '';
    display: block;
    width: 36px; height: 4px;
    background: var(--border-dark);
    border-radius: 2px;
    margin: 4px auto 10px;
  }
  .modal-header {
    padding: 6px 18px 14px !important;
    border-top: none !important;
  }
  .modal-body { padding: 16px 18px !important; }
  .modal-footer { padding: 12px 18px 20px !important; }

  /* Bottom-sheet slide-up keyframe */
  @keyframes _sheet-up {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CARD DENSITY — reduced padding on small screens
═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  .card-header  { padding: 11px 14px !important; }
  .card-body    { padding: 14px !important; }
  .card-footer  { padding: 10px 14px !important; }
  .section-card-body { padding: 14px !important; }
  .form-card-body    { padding: 14px 14px 4px !important; }

  /* Page content inner padding */
  .page-content { padding: 16px !important; }

  /* Section headers */
  .section-header { margin-bottom: 14px; }

  /* Page title size */
  .page-title-lg { font-size: 20px !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   TABLET ICON-SIDEBAR TOOLTIPS (768–1024px, sidebar collapsed to 60px)
═══════════════════════════════════════════════════════════════════════════ */
@media (min-width: 768px) and (max-width: 1024px) {
  .sidebar:not(.open) .nav-item {
    position: relative;
  }
  .sidebar:not(.open) .nav-item:hover::after {
    content: attr(data-tip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--sidebar-bg);
    color: rgba(255,255,255,.9);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0,0,0,.35);
    pointer-events: none;
    z-index: 200;
    border: 1px solid rgba(255,255,255,.08);
  }
  /* Tooltip arrow */
  .sidebar:not(.open) .nav-item:hover::before {
    content: '';
    position: absolute;
    left: calc(100% + 5px);
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: var(--sidebar-bg);
    pointer-events: none;
    z-index: 201;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOPBAR — tighter on small screens, hide non-essential items
═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  /* On very small screens, shrink topbar actions so page title is readable */
  .topbar { gap: 8px; padding: 0 12px; }
  .topbar-actions { gap: 4px; }

  /* Hide theme toggle on tiny screens (accessible via sidebar) */
  .topbar-actions .theme-toggle { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   FORM IMPROVEMENTS — better mobile UX
═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  /* Full-width modal footer buttons on mobile */
  .modal-footer { flex-direction: column-reverse; }
  .modal-footer .btn { width: 100%; justify-content: center; }
  .modal-footer .btn-text,
  .modal-footer .btn-ghost { width: auto; align-self: center; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LARGE MONITOR — content readable at 1920px+
═══════════════════════════════════════════════════════════════════════════ */
@media (min-width: 1800px) {
  :root { --sidebar-w: 240px; }
  .main-content { padding: 28px 40px; }
}

/* ── Click-to-copy project numbers ────────────────────────────────────────── */
.proj-num-copy {
  cursor: pointer;
  transition: opacity .15s;
  user-select: none;
}
.proj-num-copy:hover { opacity: .7; }
.proj-num-copy.copied::after {
  content: ' ✓';
  color: #22c55e;
  font-size: .8em;
}

/* ── Trigger autocomplete dropdown (/ and @ in task title) ── */
#trigger-dropdown {
  position: fixed;
  z-index: 9999;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  min-width: 240px;
  max-width: 320px;
  overflow: hidden;
  display: none;
}
.tdd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  font-size: .875rem;
  color: var(--text);
  transition: background 120ms;
}
.tdd-item:hover,
.tdd-item.active {
  background: var(--accent-light);
  color: var(--accent);
}
.tdd-av {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .6rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.tdd-icon {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: var(--accent-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tdd-empty {
  padding: 10px 14px;
  font-size: .8rem;
  color: var(--text-3);
}
@keyframes selectFlash {
  0%   { outline: 2px solid var(--accent); outline-offset: 2px; }
  100% { outline: 2px solid transparent; outline-offset: 4px; }
}
.select-flash { animation: selectFlash 600ms ease-out forwards; }

@keyframes dateRecognized {
  0%   { background: color-mix(in srgb, var(--accent) 18%, transparent); }
  100% { background: transparent; }
}
.date-recognized { animation: dateRecognized 700ms ease-out forwards; }

/* ── Wiki rendered Markdown ── */
.wiki-content { line-height: 1.7; color: var(--text); }
.wiki-content h1, .wiki-content h2, .wiki-content h3 {
  font-weight: 700; margin: 1.4em 0 .5em; color: var(--text);
}
.wiki-content h1 { font-size: 1.6rem; }
.wiki-content h2 { font-size: 1.25rem; border-bottom: 1px solid var(--border); padding-bottom: .3em; }
.wiki-content h3 { font-size: 1.05rem; }
.wiki-content p  { margin: .8em 0; }
.wiki-content ul, .wiki-content ol { padding-left: 1.5em; margin: .8em 0; }
.wiki-content li { margin: .3em 0; }
.wiki-content code {
  background: var(--surface-2); border-radius: 4px;
  padding: 2px 6px; font-family: 'Geist Mono', monospace; font-size: .85em;
}
.wiki-content pre {
  background: var(--surface-2); border-radius: 8px;
  padding: 16px; overflow-x: auto; margin: 1em 0;
}
.wiki-content pre code { background: none; padding: 0; }
.wiki-content table { border-collapse: collapse; width: 100%; margin: 1em 0; }
.wiki-content th, .wiki-content td {
  border: 1px solid var(--border); padding: 8px 12px; text-align: left;
}
.wiki-content th { background: var(--surface-2); font-weight: 600; }
.wiki-content blockquote {
  border-left: 3px solid var(--accent); margin: 1em 0;
  padding: .5em 1em; color: var(--text-2); background: var(--surface-2); border-radius: 0 6px 6px 0;
}
.wiki-content a { color: var(--accent); text-decoration: underline; }
.wiki-content img { max-width: 100%; border-radius: 8px; }

/* ═══════════════════════════════════════════════════════════════════════════
   PWA INSTALL TOAST
═══════════════════════════════════════════════════════════════════════════ */
#pwa-install-toast {
  position: fixed;
  bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  left: 12px; right: 12px;
  background: var(--sidebar-bg);
  color: rgba(255,255,255,.9);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  animation: _toast-up .25s cubic-bezier(.32,1,.32,1) both;
}
#pwa-install-toast span { flex: 1; line-height: 1.4; }
#pwa-install-toast button {
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  font-family: inherit;
  touch-action: manipulation;
  flex-shrink: 0;
}
#pwaInstallBtn { background: var(--accent); color: #fff; }
#pwaToastClose { background: rgba(255,255,255,.12); color: rgba(255,255,255,.7); }
@keyframes _toast-up {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOUCH UX — App-Feeling
═══════════════════════════════════════════════════════════════════════════ */

/* 1. Kein blaues Tap-Highlight auf allen interaktiven Elementen */
*, *::before, *::after {
  -webkit-tap-highlight-color: transparent;
}

/* 2. touch-action: manipulation — eliminiert 300ms Tap-Delay */
a, button, [role="button"], [type="button"], [type="submit"],
.nav-item, .nav-group-toggle, .tab-btn, .btn, .btn-icon,
.card, .mbn-item, .list-item-row, .data-table tbody tr,
.kanban-card, .notif-item, .dropdown-item {
  touch-action: manipulation;
}

/* 3. Press-Feedback (subtile Scale-Animation beim Antippen, nur Touch-Geräte) */
@media (hover: none) and (pointer: coarse) {
  /* Buttons */
  .btn:active, .btn-primary:active, .btn-outline:active {
    transform: scale(.97);
    transition: transform .08s;
  }
  .btn-icon:active {
    transform: scale(.88);
    transition: transform .08s;
    opacity: .7;
  }

  /* Cards: sanftes Press-Feedback */
  .card:active {
    transform: scale(.992);
    opacity: .88;
    transition: transform .1s, opacity .1s;
  }

  /* Listenzeilen */
  .list-item-row:active,
  .data-table tbody tr:active {
    background: var(--hover-bg) !important;
    transition: background .08s;
  }

  /* Bottom-Nav */
  .mbn-item:active {
    transform: scale(.88);
    transition: transform .1s;
    opacity: 1;
  }

  /* Kanban-Cards */
  .kanban-card:active {
    transform: scale(.97);
    box-shadow: var(--shadow-sm);
    transition: transform .1s;
  }

  /* Nav-Items */
  .nav-item:active {
    opacity: .65;
    transition: opacity .08s;
  }
}

/* 4. Overscroll-Behavior */
body {
  overscroll-behavior-y: none;
}
.modal {
  overscroll-behavior: contain;
}
.sidebar-nav {
  overscroll-behavior: contain;
}
.main-content {
  overscroll-behavior-y: auto;
}

/* 5. Smooth Scrolling + iOS momentum */
.main-content,
.modal-body {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
/* sidebar-nav intentionally WITHOUT scroll-behavior:smooth —
   JS setzt scrollTop direkt und braucht sofortiges Scrollen */
.sidebar-nav {
  -webkit-overflow-scrolling: touch;
}

/* ═══════════════════════════════════════════════════════════════════════════
   STICKY FORM FOOTER (Mobile)
═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  .form-sticky-footer {
    position: sticky;
    bottom: calc(58px + env(safe-area-inset-bottom, 0px));
    background: var(--bg);
    padding: 12px 0 4px;
    border-top: 1px solid var(--border);
    z-index: 10;
    margin-top: 8px;
  }
  .form-sticky-footer::before {
    content: '';
    position: absolute;
    top: -12px; left: 0; right: 0;
    height: 12px;
    background: linear-gradient(to top, var(--bg), transparent);
    pointer-events: none;
  }

  /* Utility: hide on mobile */
  .hide-on-mobile { display: none !important; }

  /* ── Timeline/Capacity: compact sticky columns on mobile ─── */
  .capacity-name-col {
    min-width: 110px !important;
    max-width: 110px;
  }
  .capacity-cap-col {
    min-width: 52px !important;
    max-width: 52px;
    left: 110px !important;
  }
  /* Shorter avatar + name in timeline */
  .capacity-table .user-cell { gap: 5px; }
  .capacity-table .user-cell .avatar { width: 22px; height: 22px; font-size: 8px; flex-shrink: 0; }
  .capacity-table .user-cell div > div:first-child { font-size: 11.5px; }
  .capacity-table .user-cell div > div:last-child { font-size: 9.5px; }
  /* Compact utilisation cell */
  .util-cell { gap: 2px; }
  .util-cap { font-size: 10px; }
  .util-bar-wrap { display: none; } /* hide bar on mobile – just show hours */

  /* ── Profile view: single-column, constrained width ─────── */
  .content-grid.two-col { grid-template-columns: 1fr !important; }
  .fin-tbl { font-size: .72rem; }
  .fin-tbl th, .fin-tbl td { padding: .35rem .6rem; }

  /* HR Hub – mobile padding + pill overflow */
  .mhub-card { padding: 14px 16px !important; }
  .mhub-hero { padding: 18px 16px !important; }
  .mhub-pill {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ── Unified Project Tab Bar ─────────────────────────────────────── */
.proj-tab-bar {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  gap: 0;
  position: relative;
  overflow-x: auto;
  scrollbar-width: none;
}
.proj-tab-bar::-webkit-scrollbar { display: none; }

.proj-tab-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-3);
  background: none;
  border: none;
  outline: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
  white-space: nowrap;
}
.proj-tab-btn:hover  { color: var(--text); }
.proj-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.proj-tab-gear-btn {
  margin-left: auto;
  flex-shrink: 0;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: none; cursor: pointer;
  color: var(--text-3); border-radius: var(--radius);
  transition: color .15s, background .15s;
  position: relative;
}
.proj-tab-gear-btn:hover    { color: var(--text); background: var(--surface-2); }
.proj-tab-gear-btn.has-tabs { color: var(--accent); }

/* Gear popover — position: fixed so overflow on .proj-tab-bar never clips it.
   top/right coords are set dynamically by toggleGearPopover() in tabs.js */
.tab-gear-popover {
  position: fixed;
  top: 0; right: 0;          /* overridden by JS on open */
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.25), 0 2px 6px rgba(0,0,0,.15);
  padding: 6px 0;
  min-width: 200px;
  z-index: 300;
  display: none !important;
  transform-origin: top right;
}
.tab-gear-popover.open {
  display: block !important;
  animation: gear-pop-in .14s ease;
}
@keyframes gear-pop-in {
  from { opacity: 0; transform: scale(.95) translateY(-4px); }
  to   { opacity: 1; transform: scale(1)  translateY(0); }
}
.tab-gear-popover-header {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-3);
  padding: 4px 14px 8px;
}
.tab-gear-option {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 14px; cursor: pointer;
  font-size: .85rem; color: var(--text-2);
  transition: background .12s;
}
.tab-gear-option:hover { background: var(--surface-2); }
.tab-gear-option input[type=checkbox] { accent-color: var(--accent); }

/* ===== UX Enhancements ===== */

/* ── Page Navigation Progress Bar ── */
#page-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 2px; z-index: 9999;
  background: var(--accent);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.2s ease, opacity 0.3s ease;
  pointer-events: none; opacity: 0;
}
#page-progress.running {
  opacity: 1;
  animation: progress-indeterminate 1.4s infinite cubic-bezier(0.4, 0, 0.2, 1);
}
#page-progress.done {
  opacity: 0;
  transform: scaleX(1);
  transition: transform 0.15s ease, opacity 0.4s ease 0.15s;
}
@keyframes progress-indeterminate {
  0%   { transform: scaleX(0);    margin-left: 0;    }
  50%  { transform: scaleX(0.4);  margin-left: 30%;  }
  100% { transform: scaleX(0.1);  margin-left: 100%; }
}

/* ── Button :active press (desktop) ── */
.btn:not(:disabled):active {
  transform: scale(0.97);
  transition: transform 0.07s ease, background var(--transition),
              border-color var(--transition), color var(--transition);
}
.btn-icon:not(:disabled):active {
  transform: scale(0.9);
  opacity: 0.75;
  transition: transform 0.07s ease;
}

/* ── Button Loading State ── */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn-loading::after {
  content: '';
  position: absolute;
  width: 13px; height: 13px;
  border: 2px solid currentColor;
  border-color: rgba(255,255,255,0.4) rgba(255,255,255,0.4) #fff #fff;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
  left: 50%; top: 50%;
  margin: -6.5px 0 0 -6.5px;
}
.btn-loading.btn-secondary::after,
.btn-loading.btn-ghost::after {
  border-color: var(--border-dark) var(--border-dark) var(--accent) var(--accent);
}
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

/* ── Table row hover with smooth transition ── */
.table tbody tr td,
.data-table tbody tr td {
  transition: background 0.1s ease;
}

/* ── Input / Select hover ── */
.form-input:hover:not(:focus):not(:disabled):not([readonly]),
.form-select:hover:not(:focus):not(:disabled) {
  border-color: var(--border-dark);
}

/* ── Sidebar active nav indicator ── */
.nav-item.active {
  box-shadow: inset 3px 0 0 var(--accent);
  font-weight: 550;
}

/* ── Smooth scroll ── */
html { scroll-behavior: smooth; }

/* ── Auto-growing textarea ── */
textarea.autogrow { resize: none; overflow: hidden; min-height: 38px; }

/* ── Link underline fade ── */
.table a, .data-table a {
  text-decoration: none;
  transition: color var(--transition);
}
.table a:hover, .data-table a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ===== HR Module Components ===== */

/* ── KPI Cards ── */
.hr-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.hr-kpi-grid-3 { grid-template-columns: repeat(3, 1fr); }
.hr-kpi {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  padding: 20px 24px 18px;
  position: relative;
  overflow: hidden;
}
.hr-kpi::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--kpi-color, var(--accent));
  opacity: 0.7;
}
.hr-kpi-value {
  font-family: 'Newake', 'Poppins', sans-serif;
  font-size: 42px;
  line-height: 1;
  color: var(--kpi-color, var(--accent));
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.hr-kpi-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: 0.01em;
}

/* ── Goal Cards ── */
.goal-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left: 3px solid var(--goal-color, var(--border-dark));
  box-shadow: var(--shadow-xs);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 10px;
  transition: box-shadow var(--transition), transform var(--transition);
}
.goal-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.goal-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.goal-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  line-height: 1.4;
}
.goal-desc {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 3px;
}
.goal-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.goal-progress-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
  cursor: pointer;
}
.goal-pct {
  font-size: 12px;
  font-weight: 700;
  width: 38px;
  text-align: right;
  color: var(--accent);
}

/* ── Progress Bar ── */
.prog-bar {
  background: var(--surface-2);
  border-radius: 99px;
  height: 5px;
  overflow: hidden;
}
.prog-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.prog-fill.success { background: var(--success); }
.prog-fill.warning { background: var(--warning); }
.prog-fill.danger  { background: var(--danger); }

/* ── Star Rating ── */
.star-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.star-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}
.star-label svg {
  transition: fill 0.1s ease, transform 0.1s ease, filter 0.1s ease;
  display: block;
}
.star-label:hover svg { transform: scale(1.2); }
.star-label span {
  font-size: 10px;
  color: var(--text-3);
}
input[type="radio"].star-input { display: none; }

/* ── Checklist Items ── */
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.check-item:last-child { border-bottom: none; }
.check-item:hover { background: var(--surface-hover); }
.check-item.is-done { opacity: 0.5; }
.check-circle {
  width: 22px; height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition);
}
.check-circle.done { background: var(--success); border: none; }
.check-circle.open { border: 2px solid var(--border-dark); }

/* ── Review Cycle Cards ── */
.review-cycle-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  margin-bottom: 10px;
  transition: box-shadow var(--transition), transform var(--transition);
}
.review-cycle-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.review-cycle-status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.review-cycle-status-dot.draft  { background: var(--text-3); }
.review-cycle-status-dot.active { background: var(--success); box-shadow: 0 0 0 3px rgba(34,197,94,0.2); }
.review-cycle-status-dot.closed { background: var(--text-3); }

/* ── Onboarding Instance Cards ── */
.ob-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  margin-bottom: 10px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--transition), transform var(--transition);
}
.ob-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
  color: inherit;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 60px 32px;
}
.empty-state-icon {
  font-size: 36px;
  opacity: 0.25;
  margin-bottom: 14px;
  display: block;
}
.empty-state-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.empty-state-body {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 20px;
}

/* ── Absence Type Chips ── */
.absence-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}
.absence-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Section divider ── */
.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 10px;
  margin-top: 4px;
}

/* ── Org Chart ── */
#org-chart-svg-container {
  overflow: auto;
  padding: 32px;
  min-height: 420px;
}
.org-node-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-xs);
  white-space: nowrap;
  min-width: 170px;
  transition: box-shadow 0.13s, border-color 0.13s, transform 0.13s;
}
.org-node-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--accent);
  transform: translateY(-2px);
  color: var(--text);
}
.org-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.org-name { font-size: 13px; font-weight: 600; }
.org-role { font-size: 11px; color: var(--text-2); margin-top: 1px; }
.org-dept-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 600;
  margin-top: 4px;
  border: 1px solid transparent;
}

/* ── Question cards (review form) ── */
.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.question-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  margin-right: 8px;
}
.question-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
}
.star-hint {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
}

/* ── Access Overview (ao-*) ─────────────────────────────────────────────── */
.ao-section { border-top: 1px solid var(--border); margin-top: 4px; }
.ao-toggle { display:flex; align-items:center; gap:6px; width:100%; padding:10px 16px; background:none; border:none; cursor:pointer; color:var(--text-2); font-size:12px; font-weight:600; text-transform:uppercase; letter-spacing:.05em; }
.ao-toggle:hover { color:var(--text-1); }
.ao-toggle svg { flex-shrink:0; }
.ao-chevron { transition:transform .2s; margin-left:auto !important; }
.ao-body { overflow:hidden; max-height:0; transition:max-height .25s ease; }
.ao-body.open { max-height:600px; }
.ao-list { padding:4px 0 8px; }
.ao-row { display:flex; align-items:center; gap:8px; padding:7px 16px; }
.ao-row:hover { background:var(--surface-hover); }
.ao-avatar { width:26px; height:26px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:10px; font-weight:600; color:#fff; flex-shrink:0; }
.ao-avatar-group { width:26px; height:26px; border-radius:6px; background:rgba(99,102,241,.15); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.ao-name { flex:1; font-size:13px; color:var(--text-1); min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ao-reason { font-size:11px; color:var(--text-3); white-space:nowrap; }
.ao-perm { font-size:10.5px; padding:1px 6px; border-radius:3px; background:rgba(255,255,255,.06); color:var(--text-muted); white-space:nowrap; flex-shrink:0; }
.ao-group-row { display:flex; align-items:center; gap:8px; padding:7px 16px; cursor:pointer; }
.ao-group-row:hover { background:var(--surface-hover); }
.ao-group-name { flex:1; font-size:13px; color:var(--text-1); font-weight:500; }
.ao-group-count { font-size:11px; color:var(--text-3); }
.ao-group-chevron { color:var(--text-3); transition:transform .18s; flex-shrink:0; }
.ao-group-chevron.open { transform:rotate(180deg); }
.ao-group-members { overflow:hidden; max-height:0; transition:max-height .2s ease; background:rgba(255,255,255,.02); }
.ao-group-members.open { max-height:400px; }
.ao-group-member { display:flex; align-items:center; gap:8px; padding:5px 16px 5px 28px; }
.ao-group-member-name { font-size:12.5px; color:var(--text-2); flex:1; }
.ao-skeleton { padding:4px 16px 8px; }
.ao-skeleton-row { height:34px; background:var(--surface-hover); border-radius:6px; margin-bottom:6px; animation:ao-pulse 1.2s ease-in-out infinite; }
.ao-empty { padding:12px 16px; font-size:12.5px; color:var(--text-3); text-align:center; }
@keyframes ao-pulse { 0%,100%{opacity:.4} 50%{opacity:.8} }

/* ── Mobile Responsiveness Fixes ──────────────────────────────────────────── */

/* Share panel: fixed 360px → full-width drawer from topbar on mobile */
@media (max-width: 767px) {
  .sp-wrap { position: static; }
  .sp-panel {
    position: fixed;
    top: var(--topbar-h);
    right: 0;
    left: 0;
    width: 100%;
    max-height: calc(100dvh - var(--topbar-h));
    border-radius: 0 0 var(--radius) var(--radius);
    border-left: none;
    border-right: none;
    border-top: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sp-list { max-height: none; }
  .sp-search-input { min-height: 44px; font-size: 16px; /* prevent iOS zoom */ }
}

/* Touch targets: buttons and form inputs minimum 44px on touch devices */
@media (max-width: 767px) {
  .btn { min-height: 44px; }
  .btn-lg { min-height: 48px; }
  .form-input, .form-select { min-height: 44px; font-size: 16px; /* prevent iOS zoom on focus */ }
  .btn-icon, .btn-icon-round { width: 44px; height: 44px; }
  .topbar-hamburger { width: 44px; height: 44px; }
}

/* Momentum scrolling on all horizontally-scrolling containers */
.data-table-wrap { -webkit-overflow-scrolling: touch; }
.kalpl-wrap { -webkit-overflow-scrolling: touch; }

/* Access overview section: full-width on mobile, no padding conflict */
@media (max-width: 767px) {
  .ao-section { margin: 0; border-radius: 0; }
  .ao-toggle { padding: 12px 16px; min-height: 44px; }
}

/* Finance tables: ensure horizontal scroll when content exceeds wrapper. */
.fin-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.fin-tbl { min-width: 720px; }

/* fin-compact: hide secondary columns (3,4,5) on mobile so key columns
   (Nummer, Kunde, Brutto, Status, Actions) fit without horizontal scroll.
   Opt-in via class="fin-tbl fin-compact". */
@media (max-width: 767px) {
  .fin-tbl.fin-compact th:nth-child(3),
  .fin-tbl.fin-compact td:nth-child(3),
  .fin-tbl.fin-compact th:nth-child(4),
  .fin-tbl.fin-compact td:nth-child(4),
  .fin-tbl.fin-compact th:nth-child(5),
  .fin-tbl.fin-compact td:nth-child(5) { display: none; }
  .fin-tbl.fin-compact { min-width: 0; }
}

/* All other responsive polish (calendar, projects, modals,
   tablet portrait, print, reduced-motion) lives in
   static/css/responsive-enhance.css, loaded after main.css in base.html. */
