/* ============================================================
   AGT CRM – Design System
   Farbe: Slate-Navy (#1E293B) + Amber-Gold (#F59E0B)
   Typo:  Plus Jakarta Sans (Display) + Inter (UI/Body)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap');

/* ── Custom Properties ─────────────────────────────────────── */
:root {
  /* Brand */
  --brand:          #1E293B;
  --brand-light:    #334155;
  --brand-xlight:   #475569;
  --accent:         #F59E0B;
  --accent-hover:   #D97706;
  --accent-pale:    #FEF3C7;
  --accent-ring:    rgba(245,158,11,0.18);

  /* Surfaces */
  --bg:             #F1F5F9;
  --surface:        #FFFFFF;
  --surface-2:      #F8FAFC;
  --border:         #E2E8F0;
  --border-strong:  #CBD5E1;

  /* Text */
  --text-head:      #0F172A;
  --text-body:      #475569;
  --text-muted:     #94A3B8;

  /* Semantic */
  --success:        #10B981;
  --success-pale:   #D1FAE5;
  --success-text:   #065F46;
  --danger:         #EF4444;
  --danger-pale:    #FEE2E2;
  --danger-text:    #991B1B;
  --info:           #0EA5E9;
  --info-pale:      #E0F2FE;
  --info-text:      #0C4A6E;

  /* Purple (Skills/Tags — beibehalten als sekundärer Akzent) */
  --purple:         #7C3AED;
  --purple-pale:    #EDE9FE;

  /* Shape */
  --radius-xs:  4px;
  --radius-sm:  6px;
  --radius:     8px;
  --radius-lg:  12px;
  --radius-xl:  16px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(15,23,42,0.04);
  --shadow-sm: 0 1px 4px rgba(15,23,42,0.07), 0 1px 2px rgba(15,23,42,0.04);
  --shadow:    0 2px 8px rgba(15,23,42,0.09), 0 1px 3px rgba(15,23,42,0.05);
  --shadow-md: 0 6px 20px rgba(15,23,42,0.13), 0 2px 6px rgba(15,23,42,0.06);
  --shadow-lg: 0 12px 40px rgba(15,23,42,0.16);

  /* Typography */
  --font-display: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-body);
  background: var(--bg);
  min-height: 100vh;
}
a { color: inherit; }
img { display: block; }

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  color: var(--text-head);
  line-height: 1.25;
}

/* ── Page Header (Nav-Bar) ──────────────────────────────────── */
.page-header {
  background: var(--brand);
  height: 58px;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
}
.page-header .logo {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.page-header .logo-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-bottom: 1px;
}
.page-header .header-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.01em;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ── Global Nav Bar ─────────────────────────────────────────── */
.page-nav {
  background: var(--brand);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  padding: 0 1.5rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  position: sticky;
  top: 58px;
  z-index: 199;
}
.page-nav-link {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  padding: 0.3rem 0.85rem;
  border-radius: 6px;
  transition: background 0.14s, color 0.14s;
  white-space: nowrap;
}
.page-nav-link:hover {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
}
.page-nav-link.active {
  background: var(--accent);
  color: #fff;
}

/* ── Main Content Area ──────────────────────────────────────── */
.page-main {
  max-width: 1140px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}
.page-main--narrow  { max-width: 720px; }
.page-main--medium  { max-width: 880px; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.14s, border-color 0.14s, box-shadow 0.14s, transform 0.1s;
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 1px 4px rgba(245,158,11,0.35);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 3px 10px rgba(245,158,11,0.4);
}

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

/* Ghost: default = solid, fixed-contrast colors so it stays readable on
   ANY surface (light cards, printed/forced-light themes, dark-reader
   extensions) — do not go back to transparent-white text here, it was
   invisible on light backgrounds. */
.btn-ghost {
  background: var(--surface-2);
  color: var(--text-body);
  border-color: var(--border-strong);
}
.btn-ghost:hover {
  background: var(--border);
  color: var(--text-head);
  border-color: var(--text-muted);
}

/* Inside the always-dark header/nav bar, keep the lighter "ghost on dark" look */
.page-header .btn-ghost,
.page-nav .btn-ghost {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.95);
  border-color: rgba(255,255,255,0.22);
}
.page-header .btn-ghost:hover,
.page-nav .btn-ghost:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border-color: rgba(255,255,255,0.35);
}

.btn-danger {
  background: var(--danger-pale);
  color: var(--danger-text);
  border-color: #FCA5A5;
}
.btn-danger:hover { background: #fee2e2; }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8125rem; }
.btn-xs { padding: 0.25rem 0.55rem; font-size: 0.75rem; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  transition: box-shadow 0.2s, transform 0.18s;
}
.card--hover:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card--flat { box-shadow: none; }

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  margin-bottom: 0.875rem;
}
.card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-head);
  line-height: 1.3;
}
.card-sub {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}
.card-footer {
  margin-top: 1rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--border);
}

/* ── Avatar ──────────────────────────────────────────────────── */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border);
}
.avatar-initials {
  border-radius: 50%;
  background: var(--purple-pale);
  color: var(--purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  flex-shrink: 0;
  border: 2px solid var(--purple-pale);
}
.avatar--sm  { width: 36px; height: 36px; font-size: 0.75rem; }
.avatar--md  { width: 48px; height: 48px; font-size: 0.95rem; }
.avatar--lg  { width: 80px; height: 80px; font-size: 1.4rem; border-radius: var(--radius); }
.avatar--xl  { width: 110px; height: 110px; font-size: 2rem; border-radius: var(--radius-lg); }

/* ── Badges & Tags ───────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.73rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.01em;
}
.badge-accent   { background: var(--accent-pale);   color: #92400E; }
.badge-purple   { background: var(--purple-pale);   color: var(--purple); }
.badge-success  { background: var(--success-pale);  color: var(--success-text); }
.badge-danger   { background: var(--danger-pale);   color: var(--danger-text); }
.badge-muted    { background: var(--surface-2);     color: var(--text-body); border: 1px solid var(--border); }
.badge-info     { background: var(--info-pale);     color: var(--info-text); }
.badge-brand    { background: var(--brand);         color: #fff; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-xs);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--purple-pale);
  color: var(--purple);
}
.tag-amber  { background: var(--accent-pale); color: #92400E; }
.tag-slate  { background: var(--surface-2); color: var(--text-body); border: 1px solid var(--border); }
.tag-success{ background: var(--success-pale); color: var(--success-text); }
.tag-danger { background: var(--danger-pale); color: var(--danger-text); }
.tag-info   { background: var(--info-pale); color: var(--info-text); }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-head);
  margin-bottom: 0.4rem;
}
.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.875rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text-head);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:disabled {
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: not-allowed;
}

select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394A3B8' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.25rem;
}
textarea.form-control { resize: vertical; min-height: 100px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form-row--3 { grid-template-columns: 1fr 1fr 1fr; }

/* ── Searchbar ────────────────────────────────────────────────── */
.searchbar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex: 1;
  min-width: 240px;
}
.searchbar-wrap {
  position: relative;
  flex: 1;
}
.searchbar-wrap svg,
.searchbar-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  width: 16px;
  height: 16px;
}
.searchbar input {
  width: 100%;
  padding: 0.575rem 0.875rem 0.575rem 2.3rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--text-head);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.searchbar input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.searchbar input::placeholder { color: var(--text-muted); }

/* ── Toolbar ──────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  align-items: center;
  flex-wrap: wrap;
}

/* ── Card Grid ────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 1.25rem;
}
.card-grid--wide { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

/* ── Empty State ──────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* ── Flash Messages ───────────────────────────────────────────── */
.flash {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
}
.flash-ok  { background: var(--success-pale); color: var(--success-text); border-color: #6EE7B7; }
.flash-err { background: var(--danger-pale);  color: var(--danger-text);  border-color: #FCA5A5; }
.flash-info{ background: var(--info-pale);    color: var(--info-text);    border-color: #7DD3FC; }

/* ── Section Heading ──────────────────────────────────────────── */
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.section-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-head);
}
.section-title--sm {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

/* ── Action Links (inside card footers) ─────────────────────── */
.action-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.action-link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-body);
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-xs);
  transition: background 0.14s, color 0.14s;
}
.action-link:hover {
  background: var(--surface-2);
  color: var(--text-head);
}
.action-link--primary {
  color: var(--purple);
}
.action-link--primary:hover {
  background: var(--purple-pale);
}
.action-link--danger { color: var(--danger); }
.action-link--danger:hover {
  background: var(--danger-pale);
  color: var(--danger-text);
}
.action-sep { color: var(--border-strong); padding: 0 0.1rem; user-select: none; }

/* ── Info Grid (detail pages) ────────────────────────────────── */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 2.5rem;
}
.info-item {}
.info-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.2rem;
}
.info-value {
  font-size: 0.9375rem;
  color: var(--text-head);
  font-weight: 500;
}

/* ── Page Hint ───────────────────────────────────────────────── */
.page-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  margin-bottom: 1.5rem;
}

/* ── Dashboard Nav Tiles ─────────────────────────────────────── */
.nav-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2.5rem;
}
.nav-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  padding: 1.5rem 1.5rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.15s, border-color 0.15s;
  position: relative;
  overflow: hidden;
}
.nav-tile::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s;
}
.nav-tile:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--accent);
}
.nav-tile:hover::after { transform: scaleX(1); }
.nav-tile-icon {
  font-size: 1.6rem;
  margin-bottom: 0.85rem;
  line-height: 1;
}
.nav-tile-label {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-head);
  margin-bottom: 0.2rem;
}
.nav-tile-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Divider ─────────────────────────────────────────────────── */
hr.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* ── Kanban specifics (minimal overrides, JS builds cards) ───── */
.kanban-col-header {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-head);
}

/* ── Responsive tweaks ───────────────────────────────────────── */
@media (max-width: 900px) {
  .form-row { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .nav-tiles { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .page-header { padding: 0 1rem; }
  .page-main { padding: 1.25rem 1rem 2rem; }
  .nav-tiles { grid-template-columns: 1fr; }
}
