/* LEAD-Tool Styles – modernes Layout mit Seitenleiste (v1.2.0) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

* { box-sizing: border-box; }
:root {
  --green: #16a34a;
  --green-dark: #15803d;
  --green-deep: #14532d;
  --accent: #84cc16;
  --bg: #f2f5f3;
  --card: #ffffff;
  --border: #e4e9e5;
  --text: #1c2721;
  --muted: #71847a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 40, 26, .05), 0 4px 16px rgba(16, 40, 26, .06);
  --shadow-lg: 0 8px 30px rgba(16, 40, 26, .12);
}
body {
  margin: 0;
  font-family: 'Inter', -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background:
    radial-gradient(1200px 400px at 80% -10%, rgba(132, 204, 22, .08), transparent),
    radial-gradient(900px 400px at 0% 0%, rgba(22, 163, 74, .07), transparent),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; margin: 1.2rem 0 1rem; }
h2 { font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; margin: 1.2rem 0 .5rem; }

/* ---------- App-Layout mit Seitenleiste ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex: 0 0 232px;
  background: linear-gradient(180deg, #0f3d22 0%, #14532d 55%, #16613a 100%);
  color: #fff; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; z-index: 50;
  box-shadow: 4px 0 24px rgba(20, 83, 45, .25);
}
.brand {
  display: flex; align-items: center; gap: .55rem;
  font-weight: 800; font-size: 1.1rem; letter-spacing: -.02em;
  padding: 1.1rem 1.1rem .9rem; white-space: nowrap;
}
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px; font-size: 1.05rem;
  background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.sidenav { display: flex; flex-direction: column; gap: .15rem; padding: .4rem .7rem; flex: 1; overflow-y: auto; }
.sidenav a {
  color: #b9dcc3; padding: .55rem .7rem; border-radius: 10px;
  display: flex; align-items: center; gap: .65rem;
  font-size: .9rem; font-weight: 500; white-space: nowrap;
  transition: background .15s, color .15s;
}
.sidenav a:hover { color: #fff; background: rgba(255, 255, 255, .09); text-decoration: none; }
.sidenav a.active {
  color: #fff; background: rgba(255, 255, 255, .15); font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}
.nicon { width: 18px; height: 18px; flex: 0 0 18px; opacity: .9; }
.sidenav .badge {
  margin-left: auto; background: #f97316; color: #fff; border-radius: 999px;
  font-size: .68rem; font-weight: 700; padding: .1rem .45rem;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .2);
}
.userbox {
  display: flex; gap: .6rem; align-items: center; color: #d9ecdf; font-size: .85rem;
  padding: .8rem .9rem; border-top: 1px solid rgba(255, 255, 255, .12);
}
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%; flex: 0 0 32px;
  background: linear-gradient(135deg, var(--green), var(--accent));
  color: #fff; font-size: .78rem; font-weight: 700; letter-spacing: .02em;
}
.uname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userbox .logout {
  color: #fff; background: rgba(255, 255, 255, .12);
  border-radius: 9px; padding: .35rem .45rem; display: inline-flex;
  transition: background .15s;
}
.userbox .logout:hover { background: rgba(255, 255, 255, .22); text-decoration: none; }
.userbox .logout .nicon { width: 15px; height: 15px; }

/* ---------- Container & Karten ---------- */
.container { flex: 1; min-width: 0; max-width: 1240px; margin: 0 auto; padding: .5rem 1.6rem 3rem; }
.appfooter { text-align: center; padding: 1.2rem; color: #8a978d; font-size: .78rem; opacity: .85; }

@media (max-width: 860px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%; flex: 0 0 auto; height: auto; position: sticky; top: 0;
    flex-direction: row; align-items: center; gap: .3rem;
    box-shadow: 0 2px 18px rgba(20, 83, 45, .3);
  }
  .brand { padding: .6rem .7rem; }
  .brand-name { display: none; }
  .sidenav { flex-direction: row; overflow-x: auto; padding: .3rem .3rem; scrollbar-width: none; }
  .sidenav::-webkit-scrollbar { display: none; }
  .sidenav a .lbl { display: none; }
  .sidenav a { padding: .55rem .6rem; }
  .userbox { border-top: 0; padding: .5rem .7rem; }
  .uname { display: none; }
  .container { padding: .5rem 1rem 3rem; }
}
.flash { padding: .8rem 1.1rem; border-radius: var(--radius); margin: .9rem 0; font-size: .92rem; box-shadow: var(--shadow); }
.flash-success { background: #ecfdf3; color: #166534; border: 1px solid #bbf0cd; }
.flash-error { background: #fef1f1; color: #b42121; border: 1px solid #f8caca; }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.2rem; margin-bottom: 1.1rem;
  box-shadow: var(--shadow);
}
.grid { display: grid; gap: 1.1rem; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 800px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ---------- Tabellen ---------- */
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
th, td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--border); font-size: .9rem; vertical-align: top; }
th { background: #f7faf8; font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #f7fbf8; }
.card table { box-shadow: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  color: #fff; border: 0; padding: .55rem 1.05rem; border-radius: 11px;
  cursor: pointer; font-size: .9rem; font-weight: 600; font-family: inherit;
  box-shadow: 0 2px 8px rgba(22, 163, 74, .3);
  transition: transform .12s, box-shadow .12s, filter .12s;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(22, 163, 74, .38); text-decoration: none; color: #fff; }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-sec { background: #f0f3f1; color: #33473c; box-shadow: inset 0 0 0 1px var(--border); }
.btn-sec:hover { background: #e5eae6; color: #1c2721; box-shadow: inset 0 0 0 1px #d3dcd6; }
.btn-danger { background: linear-gradient(135deg, #ef4444, #b91c1c); box-shadow: 0 2px 8px rgba(185, 28, 28, .3); }
.btn-sm { padding: .3rem .65rem; font-size: .8rem; border-radius: 9px; }
.btn-wa { background: linear-gradient(135deg, #25d366, #128c7e); box-shadow: 0 2px 8px rgba(18, 140, 126, .3); }
.btn-sms { background: linear-gradient(135deg, #38bdf8, #0369a1); box-shadow: 0 2px 8px rgba(3, 105, 161, .3); }

/* ---------- Formulare ---------- */
label { display: block; font-size: .8rem; font-weight: 500; color: var(--muted); margin: .7rem 0 .25rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=datetime-local], input[type=url], select, textarea {
  width: 100%; padding: .55rem .7rem; border: 1.5px solid var(--border);
  border-radius: 10px; font-size: .92rem; background: #fbfdfb; font-family: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--green); background: #fff;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, .13);
}
textarea { min-height: 110px; resize: vertical; }
.inline-form { display: inline; }

.pill {
  display: inline-block; padding: .16rem .65rem; border-radius: 999px;
  font-size: .74rem; font-weight: 600; color: #fff; letter-spacing: .01em;
}
.muted { color: var(--muted); font-size: .84rem; }

/* ---------- Pipeline-Board ---------- */
.board { display: flex; gap: .9rem; overflow-x: auto; padding: .2rem .2rem 1.2rem; }
.board-col {
  min-width: 240px; flex: 0 0 240px;
  background: rgba(255, 255, 255, .55); backdrop-filter: blur(4px);
  border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem;
}
.board-col h3 {
  font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  margin: .35rem .35rem .7rem; display: flex; justify-content: space-between; color: #33473c;
}
.board-card {
  background: #fff; border: 1px solid var(--border); border-radius: 11px;
  padding: .6rem .7rem; margin-bottom: .55rem; font-size: .86rem;
  box-shadow: 0 1px 3px rgba(16, 40, 26, .07);
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.board-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: #c9e5d2; }
.board-card .who { font-weight: 600; }

/* Drag & Drop */
.board-card[draggable=true] { cursor: grab; }
.board-card.dragging { opacity: .45; transform: rotate(2deg); cursor: grabbing; }
.board-col.dragover {
  background: rgba(22, 163, 74, .1);
  border-color: var(--green);
  box-shadow: inset 0 0 0 2px rgba(22, 163, 74, .35);
}
.board-col .col-empty {
  border: 2px dashed #d6e5da; border-radius: 11px; padding: .9rem .5rem;
  text-align: center; color: var(--muted); font-size: .8rem;
}

/* ---------- Kennzahlen ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .9rem; margin-bottom: 1.1rem; }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem .8rem; text-align: center; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.stat::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--green), var(--accent));
}
.stat .num { font-size: 1.75rem; font-weight: 800; letter-spacing: -.03em; color: var(--green-dark); }
.stat .cap { font-size: .76rem; font-weight: 500; color: var(--muted); margin-top: .15rem; }

/* ---------- Login ---------- */
.login-wrap { max-width: 400px; margin: 9vh auto; padding: 0 1rem; }
.login-wrap .brand-big {
  text-align: center; font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em;
  color: var(--green-deep); margin-bottom: 1.2rem;
}
.login-wrap .card { padding: 1.6rem; box-shadow: var(--shadow-lg); }

/* ---------- Timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { border-left: 2px solid #d6e5da; padding: .35rem 0 .75rem 1rem; margin-left: .5rem; position: relative; }
.timeline li::before {
  content: ''; position: absolute; left: -6px; top: .55rem;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 0 3px rgba(22, 163, 74, .15);
}
.timeline .t-meta { font-size: .75rem; color: var(--muted); margin-top: .15rem; }

.actions-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .7rem 0; }

footer { opacity: .8; }
