/* ============================================================
   elico Akquise-CRM · App-Stylesheet (elico Designsystem)
   ============================================================ */

@font-face { font-family:'Geomanist'; src:url('../fonts/geomanist/geomanist-light.woff2')   format('woff2'); font-weight:300; font-display:swap; }
@font-face { font-family:'Geomanist'; src:url('../fonts/geomanist/geomanist-regular.woff2') format('woff2'); font-weight:400; font-display:swap; }
@font-face { font-family:'Geomanist'; src:url('../fonts/geomanist/geomanist-medium.woff2')  format('woff2'); font-weight:500; font-display:swap; }
@font-face { font-family:'Geomanist'; src:url('../fonts/geomanist/geomanist-bold.woff2')    format('woff2'); font-weight:700; font-display:swap; }

:root{
  --bg:#08090a; --bg-soft:#0d0f12; --surface:#111317; --surface-2:#15181d; --surface-3:#202733;
  --text:#f5f5f2; --text-soft:#d9d9d2; --muted:#b8b8ae; --muted-2:#747e8d;
  --line:rgba(255,255,255,.10); --line-strong:rgba(255,255,255,.16);
  --brand:#e25304; --brand-rgb:226,83,4; --brand-2:#ff7a1b; --brand-dark:#ac3e03; --brand-soft:rgba(226,83,4,.13);
  --ok:#4ade80; --warn:#f59e0b; --danger:#f87171; --info:#28B8DA; --accent-teal:#02ab84;
  --radius-sm:8px; --radius-md:12px; --radius-lg:16px; --radius-xl:24px; --radius-pill:999px;
  --shadow:0 30px 80px rgba(0,0,0,.34); --shadow-soft:0 18px 50px rgba(0,0,0,.24);
  --sidebar-w:260px; --transition:.22s cubic-bezier(.4,0,.2,1); --ease:cubic-bezier(.2,.8,.2,1);
}

*,*::before,*::after{box-sizing:border-box;}
html{font-size:16px;}
body{margin:0;min-height:100vh;background:var(--bg);color:var(--text);
  font-family:'Geomanist',system-ui,-apple-system,'Segoe UI',Arial,sans-serif;font-size:16px;line-height:1.6;
  -webkit-font-smoothing:antialiased;}
a{color:inherit;text-decoration:none;}
ul,ol{margin:0;padding:0;list-style:none;}
button{font:inherit;cursor:pointer;}
::selection{background:rgba(var(--brand-rgb),.35);color:#fff;}
h1,h2,h3,h4{margin:0;}
input,select,textarea{font-family:inherit;}

/* ---------- Shell ---------- */
.app-shell{display:flex;min-height:100vh;}
.sidebar{position:fixed;top:0;left:0;height:100vh;width:var(--sidebar-w);background:var(--surface);
  border-right:1px solid var(--line);display:flex;flex-direction:column;z-index:100;transition:transform var(--transition);}
.main-wrap{flex:1;margin-left:var(--sidebar-w);min-width:0;}
#cstage{max-width:1240px;margin:0 auto;padding:34px 36px 80px;}

.side-brand{display:flex;align-items:center;justify-content:space-between;padding:22px 20px 16px;}
.logo{font-weight:800;letter-spacing:-.03em;font-size:22px;color:#fff;}
.logo span{color:var(--brand);}
.side-close{display:none;background:transparent;border:0;color:var(--muted);transform:rotate(180deg);}

.side-nav{flex:1;overflow-y:auto;padding:6px 12px;}
.nav-group-label{padding:14px 10px 6px;color:var(--muted-2);font-size:11px;font-weight:800;
  text-transform:uppercase;letter-spacing:.1em;border-top:1px solid var(--line);margin-top:8px;}
.nav-group-label:first-child{border-top:0;margin-top:0;}
.nav-link{position:relative;display:flex;align-items:center;gap:11px;padding:9px 10px;border-radius:var(--radius-md);
  color:var(--muted);font-size:14.5px;font-weight:600;transition:background var(--transition),color var(--transition);}
.nav-link:hover{background:var(--surface-2);color:var(--text);}
.nav-link.active{background:var(--brand-soft);color:var(--brand-2);}
.nav-link.active::before{content:"";position:absolute;left:-12px;top:8px;bottom:8px;width:3px;border-radius:0 3px 3px 0;background:var(--brand);}
.nav-ic{display:inline-flex;width:20px;height:20px;flex:0 0 20px;}

.side-foot{padding:12px;border-top:1px solid var(--line);}
.side-user{display:flex;align-items:center;gap:10px;padding:8px 10px 12px;}
.avatar{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;font-weight:800;color:#fff;
  background:linear-gradient(135deg,var(--brand),var(--brand-2));flex:0 0 36px;}
.side-user-meta{min-width:0;}
.su-name{font-weight:700;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.su-mail{color:var(--muted-2);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}

/* ---------- Topbar (mobil) ---------- */
.topbar{display:none;align-items:center;gap:14px;padding:14px 18px;border-bottom:1px solid var(--line);
  position:sticky;top:0;background:rgba(8,9,10,.82);backdrop-filter:blur(16px);z-index:60;}
.topbar-title{font-weight:800;}
.burger{display:flex;flex-direction:column;gap:4px;background:transparent;border:0;padding:4px;}
.burger span{width:22px;height:2px;background:var(--text);border-radius:2px;}

/* ---------- Seitenkopf ---------- */
.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:24px;flex-wrap:wrap;}
.page-title{font-size:clamp(26px,3vw,36px);font-weight:900;letter-spacing:-.04em;}
.page-sub{color:var(--muted);font-size:14px;margin-top:4px;}
.page-actions{display:flex;gap:10px;flex-wrap:wrap;}

/* ---------- Buttons ---------- */
.btn,.btn-ghost,.btn-danger{display:inline-flex;align-items:center;justify-content:center;gap:8px;
  border-radius:var(--radius-pill);border:1px solid transparent;font-weight:800;font-size:14px;
  min-height:44px;padding:0 18px;transition:transform var(--ease) .18s,background var(--ease) .18s,border-color var(--ease) .18s;}
.btn{color:#fff;background:linear-gradient(135deg,var(--brand),var(--brand-2));box-shadow:0 14px 36px rgba(var(--brand-rgb),.22);}
.btn:hover{transform:translateY(-2px);color:#fff;}
.btn-ghost{color:#fff;background:rgba(255,255,255,.06);border-color:var(--line);}
.btn-ghost:hover{transform:translateY(-2px);border-color:var(--line-strong);color:#fff;}
.btn-danger{color:#fff;background:rgba(248,113,113,.14);border-color:rgba(248,113,113,.4);}
.btn-danger:hover{background:rgba(248,113,113,.22);}
.btn-sm{min-height:36px;padding:0 13px;font-size:13px;}
.btn-icon{min-height:36px;width:36px;padding:0;}
.btn svg,.btn-ghost svg,.btn-danger svg{width:16px;height:16px;}

/* ---------- Karten ---------- */
.card{border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--surface);box-shadow:var(--shadow-soft);}
.card:hover{border-color:var(--line-strong);}
.card-pad{padding:24px;}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 22px;border-bottom:1px solid var(--line);}
.card-head h2{font-size:17px;font-weight:800;}
.card-body{padding:20px 22px;}

/* ---------- Stat-Kacheln ---------- */
.stat-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:24px;}
.stat{display:flex;flex-direction:column;justify-content:space-between;min-height:120px;padding:20px;
  border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--surface);transition:transform var(--transition),border-color var(--transition);}
.stat:hover{transform:translateY(-2px);border-color:var(--line-strong);background:var(--surface-2);}
.stat-ic{width:34px;height:34px;border-radius:var(--radius-sm);display:grid;place-items:center;color:var(--brand-2);background:var(--brand-soft);}
.stat-ic svg{width:18px;height:18px;}
.stat-num{font-size:32px;font-weight:900;letter-spacing:-.03em;line-height:1;margin-top:14px;}
.stat-label{color:var(--muted);font-size:13px;font-weight:700;margin-top:6px;}
.stat-sub{color:var(--muted-2);font-size:12px;margin-top:2px;}

/* ---------- Tabellen ---------- */
.table-wrap{overflow-x:auto;border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--surface);box-shadow:var(--shadow-soft);}
.table{width:100%;border-collapse:collapse;min-width:640px;}
.table thead th{padding:13px 16px;background:rgba(255,255,255,.025);color:var(--muted);font-size:11px;font-weight:800;
  text-transform:uppercase;letter-spacing:.05em;text-align:left;border-bottom:1px solid var(--line);white-space:nowrap;}
.table tbody td{padding:12px 16px;border-bottom:1px solid var(--line);font-size:14px;color:var(--text);vertical-align:middle;}
.table tbody tr{transition:background var(--transition);}
.table tbody tr:hover{background:rgba(255,255,255,.03);}
.table tbody tr:last-child td{border-bottom:0;}
.t-row-link{cursor:pointer;}

/* ---------- Kontakt-Zelle ---------- */
.c-cell{display:flex;align-items:center;gap:11px;}
.c-av{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;font-weight:800;font-size:13px;color:#fff;
  background:linear-gradient(135deg,#3a3f4a,#2a2e36);flex:0 0 34px;}
.c-name{font-weight:700;}
.c-mail{color:var(--muted-2);font-size:12.5px;}

/* ---------- Formulare ---------- */
.input,.select,textarea.input{width:100%;padding:10px 12px;background:var(--surface-2);border:1px solid var(--line);
  border-radius:var(--radius-sm);color:var(--text);font-size:14px;outline:none;color-scheme:dark;
  transition:border-color var(--transition),box-shadow var(--transition);}
.input:focus,.select:focus,textarea.input:focus{border-color:rgba(var(--brand-rgb),.5);box-shadow:0 0 0 3px rgba(var(--brand-rgb),.12);}
.input::placeholder{color:var(--muted-2);}
textarea.input{resize:vertical;line-height:1.6;}
.label{display:block;margin-bottom:6px;color:var(--muted);font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.03em;}
.label .req{color:var(--brand);}
.field{margin-bottom:16px;}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:16px;}
.form-row{display:flex;gap:12px;align-items:flex-end;flex-wrap:wrap;}
.hint{color:var(--muted-2);font-size:12.5px;margin-top:6px;line-height:1.55;}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;}

/* ---------- Badges / Pills ---------- */
.pill{display:inline-flex;align-items:center;gap:6px;padding:5px 11px;border:1px solid var(--line);
  border-radius:var(--radius-pill);background:var(--surface-2);color:var(--muted);font-size:12px;font-weight:700;}
.badge{display:inline-flex;align-items:center;gap:5px;padding:4px 10px;border-radius:var(--radius-pill);
  font-size:11px;font-weight:800;border:1px solid var(--bd,var(--line));background:var(--bgc,var(--surface-2));color:var(--cl,var(--muted));}
.badge-ok{--cl:var(--ok);--bd:rgba(74,222,128,.35);--bgc:rgba(74,222,128,.12);}
.badge-warn{--cl:var(--warn);--bd:rgba(245,158,11,.35);--bgc:rgba(245,158,11,.12);}
.badge-danger{--cl:var(--danger);--bd:rgba(248,113,113,.35);--bgc:rgba(248,113,113,.12);}
.badge-info{--cl:var(--info);--bd:rgba(40,184,218,.35);--bgc:rgba(40,184,218,.12);}
.badge-muted{--cl:var(--muted);--bd:var(--line);--bgc:var(--surface-3);}
.badge-brand{--cl:var(--brand-2);--bd:rgba(var(--brand-rgb),.42);--bgc:var(--brand-soft);}

/* ---------- Flash ---------- */
.flash-wrap{margin-bottom:20px;display:flex;flex-direction:column;gap:10px;}
.flash{padding:12px 16px;border-radius:var(--radius-md);font-size:14px;font-weight:600;border:1px solid var(--line);}
.flash-ok{background:rgba(74,222,128,.1);border-color:rgba(74,222,128,.3);color:#bbf7d0;}
.flash-err{background:rgba(248,113,113,.1);border-color:rgba(248,113,113,.3);color:#fecaca;}
.flash-info{background:rgba(40,184,218,.1);border-color:rgba(40,184,218,.3);color:#bae6fd;}

/* ---------- Empty ---------- */
.empty{text-align:center;padding:60px 24px;color:var(--muted-2);}
.empty svg{width:46px;height:46px;opacity:.5;margin-bottom:14px;}
.empty h3{color:var(--text);font-size:18px;font-weight:800;margin-bottom:6px;}

/* ---------- Toolbar ---------- */
.toolbar{display:flex;gap:10px;align-items:center;margin-bottom:18px;flex-wrap:wrap;}
.toolbar .search{position:relative;flex:1;min-width:200px;max-width:420px;}
.toolbar .search svg{position:absolute;left:12px;top:50%;transform:translateY(-50%);width:18px;height:18px;color:var(--muted-2);}
.toolbar .search .input{padding-left:38px;}
.spacer{flex:1;}

/* ---------- Modal ---------- */
.modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.6);backdrop-filter:blur(4px);z-index:200;display:none;}
.modal-overlay.open{display:block;}
.modal{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:201;width:92vw;max-width:560px;max-height:88vh;
  background:var(--surface);border:1px solid var(--line-strong);border-radius:var(--radius-xl);box-shadow:var(--shadow);
  display:none;flex-direction:column;overflow:hidden;}
.modal.open{display:flex;}
.modal.wide{max-width:780px;}
.modal-header{display:flex;align-items:center;justify-content:space-between;padding:18px 22px;border-bottom:1px solid var(--line);}
.modal-header h2{font-size:18px;font-weight:800;}
.modal-close{width:32px;height:32px;border:1px solid var(--line);border-radius:var(--radius-sm);background:transparent;color:var(--muted);display:grid;place-items:center;}
.modal-body{padding:22px;overflow-y:auto;}
.modal-foot{display:flex;justify-content:flex-end;gap:10px;padding:16px 22px;border-top:1px solid var(--line);}

/* ---------- Kanban ---------- */
.kanban{display:flex;gap:14px;overflow-x:auto;padding-bottom:14px;align-items:flex-start;}
.kphase-label{font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.1em;color:var(--muted-2);margin:0 6px 8px;}
.kcol{flex:0 0 270px;width:270px;background:var(--bg-soft);border:1px solid var(--line);border-radius:var(--radius-lg);display:flex;flex-direction:column;max-height:72vh;}
.kcol.setter{border-top:3px solid var(--info);}
.kcol.closer{border-top:3px solid var(--brand);}
.kcol-head{display:flex;align-items:center;justify-content:space-between;padding:13px 14px;border-bottom:1px solid var(--line);}
.kcol-head .ktitle{font-weight:800;font-size:14px;}
.kcol-head .kcount{font-size:12px;color:var(--muted-2);background:var(--surface-3);border-radius:var(--radius-pill);padding:2px 9px;font-weight:700;}
.kcards{padding:10px;display:flex;flex-direction:column;gap:9px;overflow-y:auto;min-height:60px;flex:1;}
.kcards.dragover{background:rgba(var(--brand-rgb),.06);}
.kcard{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-md);padding:12px;cursor:grab;transition:border-color var(--transition),transform var(--transition);}
.kcard:hover{border-color:var(--line-strong);}
.kcard.dragging{opacity:.5;}
.kcard .kc-name{font-weight:700;font-size:14px;}
.kcard .kc-company{color:var(--muted-2);font-size:12.5px;margin-top:2px;}
.kcard .kc-foot{display:flex;align-items:center;justify-content:space-between;margin-top:10px;}
.kcard .kc-val{font-weight:800;color:var(--brand-2);font-size:13px;}
.won .kcol-head .ktitle{color:var(--ok);}
.lost .kcol-head .ktitle{color:var(--danger);}

/* ---------- Timeline ---------- */
.timeline{position:relative;padding-left:26px;}
.timeline::before{content:"";position:absolute;left:9px;top:4px;bottom:4px;width:2px;background:var(--line);}
.tl-item{position:relative;padding:0 0 18px;}
.tl-dot{position:absolute;left:-26px;top:1px;width:20px;height:20px;border-radius:50%;background:var(--surface-3);
  border:2px solid var(--surface);display:grid;place-items:center;color:var(--muted);}
.tl-dot svg{width:11px;height:11px;}
.tl-dot.brand{background:var(--brand-soft);color:var(--brand-2);}
.tl-dot.ok{background:rgba(74,222,128,.15);color:var(--ok);}
.tl-dot.info{background:rgba(40,184,218,.15);color:var(--info);}
.tl-text{font-size:14px;}
.tl-time{color:var(--muted-2);font-size:12px;margin-top:1px;}

/* ---------- Heatmap ---------- */
.heat{display:grid;grid-template-columns:38px repeat(24,1fr);gap:3px;min-width:680px;}
.heat .hh{font-size:10px;color:var(--muted-2);text-align:center;}
.heat .hd{font-size:11px;color:var(--muted);display:flex;align-items:center;font-weight:700;}
.heat .hc{aspect-ratio:1;border-radius:3px;background:var(--surface-3);}
.heat-legend{display:flex;align-items:center;gap:8px;margin-top:12px;color:var(--muted-2);font-size:12px;}
.heat-legend .lc{width:16px;height:16px;border-radius:3px;}

/* ---------- Sequenz-Schritte ---------- */
.step-card{border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--surface);margin-bottom:14px;overflow:hidden;}
.step-top{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 18px;border-bottom:1px solid var(--line);background:var(--surface-2);}
.step-no{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:var(--brand-soft);color:var(--brand-2);font-weight:800;font-size:14px;flex:0 0 30px;}
.step-wait{display:flex;align-items:center;gap:6px;color:var(--muted);font-size:13px;}
.step-body{padding:18px;}
.wait-divider{display:flex;align-items:center;gap:10px;color:var(--muted-2);font-size:12.5px;margin:0 0 14px 14px;}
.wait-divider::before{content:"";width:2px;height:22px;background:var(--line);border-radius:2px;}

/* utility */
.row-flex{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.muted{color:var(--muted);}
.muted-2{color:var(--muted-2);}
.tiny{font-size:12px;}
.mt0{margin-top:0;} .mt8{margin-top:8px;} .mt16{margin-top:16px;} .mt24{margin-top:24px;}
.mb0{margin-bottom:0;} .mb8{margin-bottom:8px;} .mb16{margin-bottom:16px;}
.txt-right{text-align:right;}
.nowrap{white-space:nowrap;}
.two-col{display:grid;grid-template-columns:1.6fr 1fr;gap:22px;align-items:start;}

/* ---------- Responsive ---------- */
@media (max-width:1100px){ .stat-grid{grid-template-columns:repeat(2,1fr);} .two-col{grid-template-columns:1fr;} }
@media (max-width:820px){
  .sidebar{transform:translateX(-100%);box-shadow:var(--shadow);}
  .sidebar.open{transform:translateX(0);}
  .main-wrap{margin-left:0;}
  .topbar{display:flex;}
  .side-close{display:inline-flex;}
  #cstage{padding:22px 18px 80px;}
  .grid-2{grid-template-columns:1fr;}
}
@media (prefers-reduced-motion:reduce){ *{transition:none!important;} }
