:root {
  --fl-bg: #f7f8fb;
  --fl-surface: #ffffff;
  --fl-text: #0f172a;
  --fl-muted: #64748b;
  --fl-border: #e2e8f0;
  --fl-primary: #2563eb;
  --fl-primary-soft: #dbeafe;
  --fl-accent-violet: #7c3aed;
  --fl-accent-emerald: #10b981;
  --fl-sidebar-w: 240px;
  --fl-radius: 14px;
  --fl-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --fl-shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body.theme-freelancer {
  margin: 0;
  font-family: "Montserrat", system-ui, -apple-system, sans-serif;
  background: var(--fl-bg);
  color: var(--fl-text);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.fl-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--fl-sidebar-w);
  background: var(--fl-surface);
  border-right: 1px solid var(--fl-border);
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  z-index: 10;
}

.fl-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
  font-weight: 700;
  font-size: 18px;
  color: var(--fl-text);
}

.fl-brand i {
  color: var(--fl-primary);
  font-size: 22px;
}

.fl-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fl-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--fl-muted);
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

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

.fl-nav a.active {
  background: var(--fl-primary-soft);
  color: var(--fl-primary);
}

.fl-nav i {
  width: 18px;
  text-align: center;
}

.fl-main {
  margin-left: var(--fl-sidebar-w);
  padding: 32px 40px;
  min-height: calc(100vh - 60px);
}

.fl-hero {
  background: linear-gradient(135deg, #60a5fa 0%, #38bdf8 55%, #67e8f9 100%);
  border-radius: var(--fl-radius);
  padding: 40px 48px;
  color: #0c2340;
  margin-bottom: 32px;
  box-shadow: var(--fl-shadow-md);
  position: relative;
  overflow: hidden;
}

.fl-hero::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -40px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  filter: blur(40px);
  pointer-events: none;
}

.fl-hero-inner { position: relative; z-index: 1; }

.fl-hero-eyebrow {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(12, 35, 64, 0.7);
  font-weight: 600;
  margin-bottom: 8px;
}

.fl-hero-title {
  font-size: 32px;
  margin: 0 0 12px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #0c2340;
}

.fl-hero-sub {
  font-size: 16px;
  color: rgba(12, 35, 64, 0.78);
  max-width: 540px;
  margin: 0;
  line-height: 1.55;
}

.fl-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.fl-card {
  background: var(--fl-surface);
  border: 1px solid var(--fl-border);
  border-radius: var(--fl-radius);
  padding: 28px 32px;
  box-shadow: var(--fl-shadow-sm);
}

.fl-card-empty {
  text-align: center;
  padding: 48px 32px;
}

.fl-card-icon {
  font-size: 36px;
  color: var(--fl-primary);
  margin-bottom: 16px;
}

.fl-card-empty h2 {
  margin: 0 0 12px;
  font-size: 22px;
}

.fl-card-empty p {
  color: var(--fl-muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
}

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

.fl-tile {
  background: var(--fl-surface);
  border: 1px solid var(--fl-border);
  border-radius: var(--fl-radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--fl-shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s;
}

.fl-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--fl-shadow-md);
}

.fl-tile h3 {
  margin: 4px 0 0;
  font-size: 17px;
}

.fl-tile p {
  margin: 0;
  color: var(--fl-muted);
  font-size: 14px;
  line-height: 1.5;
}

.fl-tile-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
}

.fl-tile-icon-blue { background: var(--fl-primary); }
.fl-tile-icon-violet { background: var(--fl-accent-violet); }
.fl-tile-icon-emerald { background: var(--fl-accent-emerald); }

.fl-soon {
  margin-top: 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fl-muted);
  font-weight: 600;
}

/* ============ STAT ROW ============ */
.fl-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.fl-stat {
  background: var(--fl-surface);
  border: 1px solid var(--fl-border);
  border-radius: var(--fl-radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--fl-shadow-sm);
}

.fl-stat-label {
  font-size: 12px;
  color: var(--fl-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.fl-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--fl-text);
  line-height: 1.1;
}

.fl-stat-delta {
  font-size: 12px;
  color: var(--fl-accent-emerald);
  font-weight: 600;
  margin-top: 4px;
}

.fl-stat-delta.down { color: #ef4444; }
.fl-stat-delta.flat { color: var(--fl-muted); }

/* ============ SECTION HEAD ============ */
.fl-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  gap: 12px;
}

.fl-section-head h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--fl-text);
}

.fl-section-head a {
  font-size: 13px;
  color: var(--fl-primary);
  font-weight: 600;
}

.fl-section-head a:hover {
  text-decoration: underline;
}

/* ============ TABLE ============ */
.fl-table-card {
  background: var(--fl-surface);
  border: 1px solid var(--fl-border);
  border-radius: var(--fl-radius);
  overflow: hidden;
  box-shadow: var(--fl-shadow-sm);
}

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

.fl-table thead th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--fl-muted);
  padding: 12px 16px;
  background: var(--fl-bg);
  border-bottom: 1px solid var(--fl-border);
}

.fl-table tbody tr {
  border-bottom: 1px solid var(--fl-border);
  transition: background 0.15s;
}

.fl-table tbody tr:last-child { border-bottom: none; }
.fl-table tbody tr:hover { background: #f8fafc; }

.fl-table td {
  padding: 14px 16px;
  vertical-align: middle;
}

.fl-table .col-title { font-weight: 600; }
.fl-table .col-title-sub {
  font-size: 12px;
  color: var(--fl-muted);
  font-weight: 500;
  margin-top: 2px;
}

.fl-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  padding: 5px 10px;
  border-radius: 999px;
  min-width: 44px;
}

.fl-score-high { background: #d1fae5; color: #047857; }
.fl-score-mid  { background: #dbeafe; color: #1d4ed8; }
.fl-score-low  { background: #f3f4f6; color: #4b5563; }

.fl-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--fl-bg);
  color: var(--fl-muted);
  border: 1px solid var(--fl-border);
}

.fl-pill-new { background: #fef3c7; color: #92580d; border-color: #fde68a; }
.fl-pill-remote { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }

.fl-row-action {
  color: var(--fl-primary);
  font-size: 13px;
  font-weight: 600;
}

.fl-row-action:hover { text-decoration: underline; }

/* ============ SPLIT ROW (activity + cvs) ============ */
.fl-split {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

.fl-panel {
  background: var(--fl-surface);
  border: 1px solid var(--fl-border);
  border-radius: var(--fl-radius);
  padding: 22px 24px;
  box-shadow: var(--fl-shadow-sm);
}

.fl-activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.fl-activity-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--fl-border);
  align-items: center;
}

.fl-activity-item:first-child { border-top: none; padding-top: 4px; }
.fl-activity-item:last-child { padding-bottom: 4px; }

.fl-activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #fff;
}

.fl-activity-icon.send   { background: var(--fl-primary); }
.fl-activity-icon.reply  { background: var(--fl-accent-emerald); }
.fl-activity-icon.match  { background: var(--fl-accent-violet); }
.fl-activity-icon.reject { background: #94a3b8; }
.fl-activity-icon.cv     { background: #f59e0b; }

.fl-activity-body { font-size: 14px; color: var(--fl-text); }
.fl-activity-body span { color: var(--fl-muted); }
.fl-activity-when {
  font-size: 11px;
  color: var(--fl-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  white-space: nowrap;
}

.fl-cv-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fl-cv-card-small {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--fl-border);
  border-radius: 10px;
  transition: border-color 0.15s, background 0.15s;
}

.fl-cv-card-small:hover {
  border-color: var(--fl-primary);
  background: #f8fafc;
}

.fl-cv-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--fl-primary-soft);
  color: var(--fl-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.fl-cv-name { font-weight: 600; font-size: 14px; }
.fl-cv-meta { font-size: 12px; color: var(--fl-muted); margin-top: 1px; }

.fl-cv-rev {
  font-size: 11px;
  color: var(--fl-muted);
  font-weight: 600;
}

.fl-cv-add {
  border-style: dashed;
  color: var(--fl-muted);
  justify-content: center;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px dashed var(--fl-border);
}

.fl-cv-add:hover {
  border-color: var(--fl-primary);
  color: var(--fl-primary);
  background: #f8fafc;
}

/* ============ RESPONSIVE for new components ============ */
@media (max-width: 960px) {
  .fl-stats { grid-template-columns: repeat(2, 1fr); }
  .fl-split { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .fl-stats { grid-template-columns: 1fr; }
  .fl-table thead { display: none; }
  .fl-table tbody tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding: 12px 16px; }
  .fl-table tbody td { padding: 2px 0; }
}

.fl-footer {
  margin-left: var(--fl-sidebar-w);
  padding: 16px 40px;
  border-top: 1px solid var(--fl-border);
  color: var(--fl-muted);
  font-size: 13px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  background: var(--fl-surface);
}

.fl-footer a { color: var(--fl-primary); }
.fl-footer-sep { opacity: 0.5; }

/* ============ MOBILE: Hamburger + Drawer-Sidebar ============ */
.fl-mobile-toggle,
.fl-backdrop { display: none; }

@media (max-width: 860px) {
  /* Hamburger oben links */
  .fl-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 80;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--fl-surface);
    border: 1px solid var(--fl-border);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.10);
    color: var(--fl-text);
    font-size: 17px;
    cursor: pointer;
    transition: background 150ms;
  }
  .fl-mobile-toggle:hover { background: var(--fl-bg); }

  /* Sidebar wird zum Slide-in-Drawer */
  .fl-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 220ms ease;
    z-index: 90;
    box-shadow: 8px 0 32px rgba(15, 23, 42, 0.18);
  }
  body.fl-nav-open .fl-sidebar { transform: translateX(0); }

  /* Backdrop dahinter */
  .fl-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 85;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
  }
  body.fl-nav-open .fl-backdrop {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  /* Body-Scroll blockieren, wenn Drawer offen */
  body.fl-nav-open { overflow: hidden; }

  /* Hauptbereich: volle Breite + Top-Padding für den Hamburger */
  .fl-main {
    margin-left: 0;
    padding: 64px 16px 56px;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Tabellen-Karten scrollen auf Mobile horizontal, statt zu überlaufen */
  .fl-table-card,
  .fl-panel {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }
  .fl-table-card .fl-table { min-width: 600px; }
  .fl-footer { margin-left: 0; padding: 16px 20px; justify-content: center; text-align: center; }

  /* Hero & Karten kompakter */
  .fl-hero { padding: 22px 20px; border-radius: 16px; }
  .fl-hero-title { font-size: 22px !important; }
  .fl-hero-sub { font-size: 13px; }

  /* Grids einspaltig (überschreibt inline grid-template-columns) */
  .fl-stats,
  .fl-split,
  .fl-tiles,
  .fl-tips,
  .fl-cv-grid { grid-template-columns: 1fr !important; gap: 12px; }
}

/* Tablet-Zwischenstufe für Stats: 2 statt 4/5 Spalten */
@media (min-width: 861px) and (max-width: 1100px) {
  .fl-stats { grid-template-columns: repeat(2, 1fr) !important; }
}
