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

/* ── 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:        #0f0f10;
  --text-2:      #6b6b72;
  --text-3:      #ababaf;

  /* 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 — Indigo */
  --accent:       #5b5cf6;
  --accent-dark:  #4a4be0;
  --accent-light: rgba(91,92,246,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:        #f0f0f0;
  --text-2:      rgba(240,240,240,0.55);
  --text-3:      rgba(240,240,240,0.28);

  /* 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:      #7c7df0;
  --accent-dark: #6a6be8;
  --accent-light: rgba(124,125,240,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:        #f0f0f0;
    --text-2:      rgba(240,240,240,0.55);
    --text-3:      rgba(240,240,240,0.28);

    /* 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:      #7c7df0;
    --accent-dark: #6a6be8;
    --accent-light: rgba(124,125,240,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; }
body {
  font-family: 'Geist', -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 { line-height: 1.25; letter-spacing: -0.3px; }
.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; }
.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;
  filter: brightness(0) invert(1); object-fit: contain;
}

/* 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; }
.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-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); }

/* ===== 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.5px; line-height: 1.2;
  margin-bottom: 3px; color: var(--text);
}
/* legacy alias */
.section-title { font-size: 22px; font-weight: 700; letter-spacing: -0.4px; 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-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(34,197,94,0.10); color: #16803a; }
.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); }

/* ===== 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-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(6, minmax(180px, 1fr));
  gap: 14px;
}

.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="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: var(--success); }
.pipeline-col[data-status="completed"]       .pipeline-col-header { border-color: var(--text-3); opacity: 0.6; }

.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: 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(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 {
  display: flex; gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto; 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 4px; }
.util-row-compact {
  grid-template-columns: 110px 1fr 50px;
  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.4px; color: var(--text); line-height: 1.2;
}
.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;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }

.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;
}
.tab-btn:hover  { color: var(--text); background: var(--surface-hover); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
a.tab-btn { text-decoration: none; }
.tab-pane         { display: none; }
.tab-pane.active  { display: block; }

/* ===== 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.4px; 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; }

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

  .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(91,92,246,0.1);  color: var(--accent); border-color: rgba(91,92,246,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.3px; }
.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; }

/* ===== Calendar page ===== */
.calendar-layout {
  display: grid; grid-template-columns: 220px 1fr; gap: 20px;
  align-items: start;
}
.calendar-sidebar { display: flex; flex-direction: column; gap: 16px; }
.calendar-main { min-width: 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; background: inherit; z-index: 1; }
.capacity-cap-col { min-width: 80px; text-align: center !important; }
.capacity-day-col { min-width: 100px; }
.capacity-today-header .day-label { color: var(--accent); font-weight: 700; }
.capacity-today-header .day-date  { color: var(--accent); }
.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; }
.capacity-cell-content { display: flex; flex-direction: column; gap: 3px; }
.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;
}
.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) 6%, transparent) !important; }
.capacity-today .capacity-cell-content { border-left: 2px solid var(--accent); padding-left: 4px; }

/* Drag-to-create range highlight */
.capacity-cell { position: relative; }
.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; }

/* Horizontal scroll */
.capacity-table-wrap { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
.page-content { overflow: visible !important; }

/* ===== 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: #f0f0f0; color: #222; }

.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:#f0f0f0; color:#222;    border-color:#ddd; }
.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 charts grid */
.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: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

/* 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.4px; color: var(--text); line-height: 1.2;
}
.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: 300px;
}
@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;
}
