:root {
  --bg: #F1F1F1;
  --card: #ffffff;
  --line: #E3E3E0;
  --line2: #eeeeea;
  --ink: #1D1E20;
  --muted: #6B6E73;
  --accent: #DE1B5D;
  --accent-text: #C4164F;
  --accent-dark: #C4164F;
  --accent-soft: #FCE4EC;
  --night: #0D1B2B;
  --warn: #b4400c;
  --ok: #1d7a47;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'DM Sans', system-ui, -apple-system, sans-serif; font-size: 15px; }
a { color: var(--accent-text); }
h1, h2, h3, .kpi-v { font-family: Roboto, system-ui, sans-serif; letter-spacing: -.2px; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

.shell { display: flex; min-height: 100vh; }
.side { width: 230px; flex: none; background: var(--card); border-right: 1px solid var(--line); padding: 24px 14px; position: sticky; top: 0; height: 100vh; }
.brand { font-size: 17px; font-weight: 700; padding: 0 10px 22px; display: flex; align-items: center; gap: 10px; }
.brand-logo { height: 30px; width: auto; display: block; }
.brand-sub { font: 600 11px 'DM Sans', sans-serif; letter-spacing: 2px; text-transform: uppercase; color: var(--accent-text); align-self: flex-end; padding-bottom: 2px; }
.login-brand { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 6px; }
.login-brand img { height: 44px; width: auto; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav .soon { height: 40px; padding: 0 12px; border-radius: 10px; display: flex; align-items: center; gap: 10px; text-decoration: none; color: #3c4047; }
.ni { display: inline-flex; color: #8a8f98; }
.nav a.on .ni { color: var(--accent-text); }
.nav a:hover { background: #f1f1ee; }
.nav a.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.nav .soon { color: #6B6E73; cursor: default; }
.nav .soon::after { content: 'bald'; margin-left: auto; font-size: 11px; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.main { flex: 1; min-width: 0; padding: 30px 40px 60px; }

.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.head h1 { margin: 0; font-size: 28px; font-weight: 700; }
.head .date { font-size: 14px; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.btn { height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid #dcdcd7; background: #fff; font-weight: 600; font-size: 14px; cursor: pointer; }
.btn:hover { background: #f6f6f3; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 999px; }
.btn.danger { color: var(--warn); }
.field { height: 40px; border: 1px solid #dcdcd7; border-radius: 10px; padding: 0 12px; background: #fff; width: 100%; }
textarea.field { height: auto; min-height: 70px; padding: 10px 12px; resize: vertical; }
.field:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
label.lbl { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.card { background: var(--card); border-radius: var(--radius); padding: 18px 20px; box-shadow: 0 1px 2px rgba(20,22,26,.04), 0 4px 14px rgba(20,22,26,.04); border: 1px solid #ecece8; }
.card h2 { margin: 0 0 8px; font-size: 16px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card .empty { color: var(--muted); font-size: 14px; padding: 8px 0; }
.card.soon { border: 1px dashed #d9d9d3; background: rgba(255,255,255,.5); box-shadow: none; }
.card.soon .h2i { color: #8a8f98; }
.h2i { display: inline-flex; align-items: center; gap: 8px; }
.h2i svg { color: var(--accent-text); }
.count { font-size: 12px; font-weight: 700; min-width: 24px; height: 24px; padding: 0 8px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); display: inline-flex; align-items: center; justify-content: center; }
.av { border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; letter-spacing: .3px; }
.kb { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: none; background: #f1f1ee; color: #5b5f66; }
.k-anruf { background: #E4E8EE; color: #0D1B2B; }
.k-mail { background: #FCE4EC; color: #C4164F; }
.k-persoenlich { background: #DFF3E4; color: #1D7A47; }
.k-notiz { background: #E3E3E0; color: #1D1E20; }
.k-angebot, .k-rechnung { background: #fdeee5; color: #b4400c; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 1px solid #ecece8; border-radius: var(--radius); padding: 16px 18px; display: flex; gap: 14px; align-items: center; box-shadow: 0 1px 2px rgba(20,22,26,.04), 0 4px 14px rgba(20,22,26,.04); }
.kpi-ic { width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.kpi-v { font-size: 24px; font-weight: 700; line-height: 1.1; }
.kpi-l { font-size: 13px; color: var(--muted); }
.kpi-s { font-size: 12px; font-weight: 600; margin-top: 2px; background: none !important; }
.c-warn { background: #fdeee5; color: #b4400c; }
.c-blue { background: #FCE4EC; color: #C4164F; }
.c-green { background: #DFF3E4; color: #1D7A47; }
.c-purple { background: #E4E8EE; color: #0D1B2B; }
.cust-head .who { display: flex; gap: 16px; align-items: center; }
.list a { flex-direction: row !important; align-items: center; gap: 12px; }
.list .li { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.main { background: transparent; }

.row { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line2); }
.row:last-child { border-bottom: none; }
.row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.row .s { font-size: 13px; color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 5px; background: var(--accent); flex: none; }
.dot.late { background: var(--warn); }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: #f1f1ee; color: var(--muted); white-space: nowrap; }
.badge.late { background: #fdebe2; color: var(--warn); }

/* Kundenansicht: drei Spalten */
.cust { display: grid; grid-template-columns: 300px minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.list { background: var(--card); border-radius: var(--radius); overflow: hidden; }
.list .search { padding: 14px; border-bottom: 1px solid var(--line2); display: flex; flex-direction: column; gap: 8px; }
.list a { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-bottom: 1px solid var(--line2); text-decoration: none; color: var(--ink); }
.list a:hover { background: #f7f7f5; }
.list a.on { background: var(--accent-soft); }
.list a .s { font-size: 13px; color: var(--muted); }
.list .scroll { max-height: calc(100vh - 220px); overflow-y: auto; }
.kind { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.capture { display: flex; flex-direction: column; gap: 10px; }
.capture .line { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.capture .line select, .capture .line input[type=date] { width: auto; }
.tl .item { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line2); }
.tl .item:last-child { border-bottom: none; }
.tl .when { width: 92px; flex: none; font-size: 13px; color: var(--muted); }
.tl .body { flex: 1 1 260px; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.tl .tools { display: flex; gap: 6px; align-items: flex-start; }
.form { display: flex; flex-direction: column; gap: 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12px; padding: 3px 9px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); }

dialog { border: none; border-radius: 16px; padding: 0; width: min(520px, 94vw); box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
dialog::backdrop { background: rgba(20, 22, 26, 0.35); }
.dlg { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.dlg h2 { margin: 0 0 4px; font-size: 18px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.show { opacity: 1; }
.err { color: var(--warn); font-size: 14px; }

/* Login */
.login { max-width: 380px; margin: 14vh auto 0; padding: 0 20px; display: flex; flex-direction: column; gap: 14px; }
.login h1 { margin: 0; font-size: 26px; }

@media (max-width: 1180px) {
  .cust { grid-template-columns: 260px minmax(0, 1fr); }
  .cust > .side-info { grid-column: 2; }
}
@media (max-width: 820px) {
  .shell { flex-direction: column; }
  .side { width: auto; height: auto; position: static; border-right: none; border-bottom: 1px solid var(--line); padding: 12px; }
  .brand { padding: 0 6px 8px; }
  .nav { flex-direction: row; overflow-x: auto; }
  .nav a, .nav .soon { white-space: nowrap; }
  .nav .soon { display: none; }
  .main { padding: 18px 14px 50px; }
  .cust { grid-template-columns: 1fr; }
  .cust > .side-info { grid-column: auto; }
  .list .scroll { max-height: 40vh; }
  .two { grid-template-columns: 1fr; }
  .tl .when { width: 100%; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px; gap: 10px; }
  .kpi-ic { width: 34px; height: 34px; }
  .kpi-v { font-size: 20px; }
}

/* Baustein 2: Erfassen, Vorgänge, Board */
.capture-btn { width: 100%; height: 42px; margin: 0 0 16px; }
.fab { display: none; position: fixed; right: 18px; bottom: 22px; width: 58px; height: 58px; border-radius: 29px; border: none; background: var(--accent); color: #fff; box-shadow: 0 8px 22px rgba(222,27,93,.35); align-items: center; justify-content: center; z-index: 5; cursor: pointer; }
.fab svg { width: 26px; height: 26px; }
.st { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 7px; white-space: nowrap; background: #f1f1ee; color: #5b5f66; }
.st-anfrage { background: #FCE4EC; color: #C4164F; }
.st-angebot { background: #E4E8EE; color: #0D1B2B; }
.st-angenommen { background: #DFF3E4; color: #1D7A47; }
.st-rechnung { background: #1D1E20; color: #FFFFFF; }
.st-bezahlt { background: #1D7A47; color: #FFFFFF; }
.st-erledigt { background: #ececec; color: #5b5f66; }
.st-abgelehnt { background: #fdebe2; color: var(--warn); }
.deal-row .st-sel { width: auto; height: 34px; font-size: 13px; }
.board { display: grid; grid-template-columns: repeat(5, minmax(180px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.col { background: #efefeb; border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 240px; transition: background .15s; }
.col.over { background: #FCE4EC; outline: 2px dashed var(--accent); }
.col h2 { margin: 0 0 2px; font-size: 14px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.dcard { background: #fff; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; border: 1px solid #e8e8e4; box-shadow: 0 1px 2px rgba(20,22,26,.05); cursor: grab; }
.dcard.drag { opacity: .5; }
.dcard .dt { font-weight: 600; color: var(--ink); text-decoration: none; }
.dcard .dt:hover { color: var(--accent-text); }
.dcard .ds { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.dcard .dm { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dcard .dm .btn { margin-left: auto; }
.hits { display: flex; flex-direction: column; gap: 4px; }
.hit { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid #ecece8; background: #fff; text-align: left; cursor: pointer; color: var(--ink); }
.hit:hover { background: #FCE4EC; }
.hit .s { color: var(--muted); font-size: 13px; }
.hit.new { color: var(--accent-text); font-weight: 600; }
.chipbtn { height: 34px; padding: 0 12px; border-radius: 17px; border: 1px solid #dcdcd7; background: #fff; font-size: 13px; cursor: pointer; }
.chipbtn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chosen .row { border: 1px solid #F6C6D6; background: #FCE4EC; border-radius: 10px; padding: 8px 10px; }
dialog { width: min(600px, 94vw); }
@media (max-width: 820px) {
  .capture-btn { display: none; }
  .fab { display: flex; }
  .board { grid-template-columns: repeat(5, 260px); }
}

.drops { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.drop { border: 2px dashed currentColor; border-radius: var(--radius); padding: 14px; text-align: center; font-size: 13px; font-weight: 600; opacity: .7; }
.drop.over { opacity: 1; }
@media (max-width: 820px) { .drops { display: none; } }

/* swdski: nur ein pinker Hauptbutton pro Ansicht, der Seitenleisten-Button bleibt anthrazit */
.side .capture-btn { background: var(--ink); border-color: var(--ink); }
.side .capture-btn:hover { background: #000; border-color: #000; }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.dark:hover { background: #000; border-color: #000; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
@media (max-width: 820px) {
  /* Handy: der runde Plus-Knopf ist der pinke Hauptbutton, der Kopf-Button wird anthrazit */
  .head-capture { background: var(--ink) !important; border-color: var(--ink) !important; }
}

/* Baustein 3: Angebote */
.offers-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.offer-ed { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.items { display: flex; flex-direction: column; gap: 12px; }
.item-ed { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.item-ed > .count { margin-top: 8px; }
.item-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.item-line { display: grid; grid-template-columns: minmax(0, 1fr) 70px 100px 110px; gap: 8px; }
.item-tools { display: flex; flex-direction: column; gap: 4px; }
.item-tools .btn.small { width: 34px; padding: 0; }
.field.need { border-color: #F6C6D6; background: #FFF7FA; }
.offer-sum { display: flex; justify-content: space-between; align-items: center; background: var(--ink); color: #fff; border-radius: 12px; padding: 14px 18px; }
.offer-sum span { color: #C9CBCF; font-size: 14px; }
.offer-sum b { font-family: Roboto, system-ui, sans-serif; font-size: 22px; }
.pre { white-space: pre-line; color: #3A3C40; }
.steps { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.7; color: #3A3C40; }
.btn svg { flex: none; }
dialog.wide { width: min(980px, 96vw); }
.two.tpl { align-items: start; }
.two.tpl .form { display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 1100px) {
  .offers-grid, .offer-ed { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .item-line { grid-template-columns: 1fr 1fr; }
  .item-line input:first-child { grid-column: 1 / -1; }
  .two.tpl { grid-template-columns: 1fr; }
}
.deal-row { flex-wrap: wrap; }
.deal-row .grow { min-width: 180px; flex: 1 1 180px; }
/* Im Angebots-Editor ist „Als versendet markieren“ der pinke Hauptbutton */
body[data-route=angebote] .fab { display: none !important; }
/* Baustein 4: sevDesk */
.sev-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 10px; }
.sev-kpis div { background: var(--bg); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.sev-kpis b { font-family: Roboto, system-ui, sans-serif; font-size: 16px; }
.sev-kpis b.warn { color: var(--warn); }
.sev-kpis span { font-size: 12px; color: var(--muted); }
.hit .li { display: flex; flex-direction: column; gap: 1px; min-width: 0; text-align: left; }
/* Baustein 5: Postfach */
.linkish { background: none; border: none; padding: 0; cursor: pointer; text-align: left; color: inherit; font: inherit; }
.linkish:hover .t { color: var(--accent-text); }
.mail-row { align-items: flex-start; }
.mail-snippet { font-size: 13px; margin-top: 8px; padding: 10px 12px; background: var(--bg); border-radius: 10px; max-height: 260px; overflow: auto; }
/* Baustein 7: Termine */
.k-termin { background: #E4E8EE; color: #0D1B2B; }
.appt-days { display: flex; flex-direction: column; gap: 16px; }

/* Redesign A: Startseite als Baukasten */
.dash { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; grid-auto-flow: row dense; }
.w { min-width: 0; display: flex; flex-direction: column; }
.w-s { grid-column: span 1; }
.w-m { grid-column: span 2; }
.w-l { grid-column: span 4; }
.w.card { padding: 16px 18px; }
.w-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; font: 700 15px Roboto, system-ui, sans-serif; min-height: 28px; }
.w-b { min-width: 0; }
.w .row { padding: 9px 0; }
.w-sub { font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); margin: 12px 0 2px; }
.w-quiet { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); padding: 6px 0; }
.w-quiet svg { color: var(--ok); flex: none; }
.w-quiet a { margin-left: auto; font-weight: 600; }
.w-more { display: inline-block; font-size: 13px; font-weight: 600; margin-top: 6px; text-decoration: none; }
.w.bare .kpis { margin: 0; }
.w .kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
a.kpi { text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
a.kpi:hover { border-color: #F6C6D6; transform: translateY(-1px); }
.w-s .kpis { grid-template-columns: 1fr; }
.moneys { display: flex; flex-direction: column; gap: 8px; }
.money { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg); font-size: 13px; color: var(--muted); }
.money b { font: 700 18px Roboto, system-ui, sans-serif; color: var(--ink); white-space: nowrap; }
.money.ok { background: #DFF3E4; color: #1D7A47; }
.money.ok b { color: #1D7A47; }
.pipe { display: flex; flex-direction: column; gap: 7px; margin: 4px 0 2px; }
.pipe-row { display: grid; grid-template-columns: 130px minmax(40px, 1fr) 28px auto; align-items: center; gap: 10px; font-size: 13px; color: var(--ink); text-decoration: none; }
.pipe-row:hover .pl { color: var(--accent-text); }
.pipe-row .pb { height: 8px; border-radius: 4px; background: #f0f0ec; overflow: hidden; }
.pipe-row .pb i { display: block; height: 100%; min-width: 4px; border-radius: 4px; }
.pipe-row .pn { font-weight: 700; text-align: right; }
.pipe-row .pv { color: var(--muted); text-align: right; min-width: 70px; }
.w-s .pipe-row { grid-template-columns: 1fr 60px 22px; }
/* Anordnen */
.dash.editing .w { outline: 2px dashed #d9d9d3; outline-offset: -2px; cursor: grab; }
.dash.editing .w.bare { background: rgba(255,255,255,.6); border-radius: var(--radius); padding: 12px; }
.dash.editing .w.drag { opacity: .45; }
.dash.editing .w.over { outline-color: var(--accent); background: #FFF7FA; }
.dash.editing .w-b { pointer-events: none; opacity: .75; max-height: 260px; overflow: hidden; }
.w-tools { display: flex; align-items: center; gap: 4px; }
.w-grip { color: #a3a6ab; letter-spacing: -2px; padding: 0 4px; font-size: 14px; }
.wt { height: 28px; min-width: 28px; padding: 0 7px; border-radius: 8px; border: 1px solid #dcdcd7; background: #fff; font: 700 12px 'DM Sans', sans-serif; cursor: pointer; }
.wt:hover:not(:disabled) { background: #f6f6f3; }
.wt:disabled { opacity: .35; cursor: default; }
.wt.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.wt.hide { color: var(--warn); }
.w-size { display: inline-flex; gap: 2px; margin: 0 4px; }
.w-tray { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px; border: 1px dashed #cfcfc9; border-radius: var(--radius); font-size: 13px; }
@media (max-width: 1180px) {
  .dash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .w-s { grid-column: span 1; }
  .w-m, .w-l { grid-column: span 2; }
}
@media (max-width: 820px) {
  .dash { grid-template-columns: 1fr; gap: 12px; }
  .w-s, .w-m, .w-l { grid-column: auto; }
  .w-size { display: none; }
  .pipe-row { grid-template-columns: 1fr 70px 24px; }
  .pipe-row .pv { display: none; }
}

/* Redesign D: Arbeitsplatz (Reiter, Tabelle, Detail rechts) */
.ws { display: flex; flex-direction: column; gap: 12px; }
.ws-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ws-tabs { display: flex; gap: 2px; flex-wrap: wrap; background: #e7e7e3; padding: 3px; border-radius: 12px; }
.ws-tab { height: 32px; padding: 0 12px; border: none; border-radius: 9px; background: transparent; font-size: 13px; font-weight: 600; color: #4a4d53; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.ws-tab:hover { color: var(--ink); }
.ws-tab.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(20,22,26,.08); }
.ws-tab .n { font-size: 11px; font-weight: 700; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px; background: rgba(0,0,0,.06); display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.ws-tab.on .n { background: var(--accent-soft); color: var(--accent-text); }
.ws-tools { display: flex; gap: 8px; align-items: center; }
.ws-search { width: 260px; height: 38px; }
.ws-body { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.ws-table { padding: 0; overflow: auto; }
.ws-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ws-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 14px; height: 40px; border-bottom: 1px solid var(--line); background: #fafaf8; position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.ws-table th.num, .ws-table td.num { text-align: right; }
.th-btn { border: none; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.th-btn .arr { font-size: 11px; opacity: .35; }
.th-btn:hover { color: var(--ink); }
th.sorted .th-btn { color: var(--ink); }
th.sorted .arr { opacity: 1; color: var(--accent-text); }
.ws-table td { padding: 9px 14px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.ws-table tbody tr { cursor: default; transition: background .1s; }
.ws-table tbody tr:hover { background: #f8f8f6; }
.ws-table tbody tr.on { background: #FFF2F6; box-shadow: inset 3px 0 0 var(--accent); }
.ws-table tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ws-table tbody tr:last-child td { border-bottom: none; }
.ws-table .t { font-weight: 600; }
.ws-table .s { font-size: 12px; color: var(--muted); }
.ws-table .s.warn { color: var(--warn); font-weight: 600; }
.ws-table .c1 { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-table .mono { font-variant-numeric: tabular-nums; font-size: 13px; color: #3c4047; }
.ws-table .clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; color: var(--muted); }
.ws-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cw { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cw.r { align-items: flex-end; }
.cell-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ws-empty { text-align: center; color: var(--muted); padding: 34px 14px !important; }
.badge.today { background: var(--accent-soft); color: var(--accent-text); }
.ws-panel { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 18px; }
.ws-hint { color: var(--muted); font-size: 14px; padding: 20px 0; text-align: center; }
.p-head { display: flex; gap: 12px; align-items: center; }
.p-head .grow { flex: 1; min-width: 0; }
.p-head h2 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.p-head .s { font-size: 13px; color: var(--muted); }
.p-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.p-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.p-facts { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 7px 10px; margin: 0; font-size: 13px; padding: 12px 0; border-top: 1px solid var(--line2); border-bottom: 1px solid var(--line2); }
.p-facts dt { color: var(--muted); }
.p-facts dd { margin: 0; overflow-wrap: anywhere; }
.p-sec h3 { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.p-sec h3 .n { font-size: 11px; background: #f1f1ee; border-radius: 8px; padding: 1px 7px; letter-spacing: 0; }
.p-empty { font-size: 13px; color: var(--muted); }
.p-deal { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; margin-bottom: 6px; border: 1px solid #ecece8; border-radius: 10px; background: #fff; text-align: left; font: inherit; font-size: 13px; color: var(--ink); text-decoration: none; cursor: pointer; }
.p-deal:hover { border-color: #F6C6D6; background: #FFF7FA; }
.p-deal .t { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-deal b { font-size: 13px; white-space: nowrap; }
.p-note { display: flex; flex-direction: column; gap: 8px; }
.p-note textarea { min-height: 56px; }
.p-note .line { display: flex; gap: 6px; align-items: center; }
.p-note .line .field { height: 34px; font-size: 13px; padding: 0 8px; }
.p-note .line select { width: auto; flex: 1; }
.p-note .line input[type=date] { width: auto; flex: 1; }
.mini { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line2); font-size: 13px; }
.mini:last-of-type { border-bottom: none; }
.mini .kb { width: 28px; height: 28px; border-radius: 8px; }
.mini .kb svg { width: 14px; height: 14px; }
.mini .grow { flex: 1; min-width: 0; }
.mini .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mini .b { color: #3c4047; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini .s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.p-item { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 13px; border-bottom: 1px solid var(--line2); }
.p-item .t { font-weight: 600; min-width: 0; }
.p-item .s { color: var(--muted); white-space: nowrap; }
.offer-sum.small { padding: 10px 14px; margin-top: 10px; }
.offer-sum.small b { font-size: 17px; }
.seg { display: inline-flex; background: #e7e7e3; padding: 3px; border-radius: 999px; gap: 2px; }
.seg button { height: 34px; padding: 0 14px; border: none; border-radius: 999px; background: transparent; font: 600 13px 'DM Sans', sans-serif; color: #4a4d53; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(20,22,26,.1); }
.back { display: inline-block; margin-bottom: 14px; font-size: 14px; font-weight: 600; text-decoration: none; }
.cust.full { grid-template-columns: minmax(0, 1fr) 340px; }
@media (max-width: 1099px) {
  .ws-body { grid-template-columns: 1fr; }
  .ws-panel { display: none; }
  .ws-table tbody tr { cursor: pointer; }
}
@media (max-width: 1180px) { .cust.full { grid-template-columns: 1fr; } .cust.full > .side-info { grid-column: auto; } }
@media (max-width: 820px) {
  .ws-bar { flex-direction: column; align-items: stretch; }
  .ws-tabs { flex-wrap: nowrap; overflow-x: auto; }
  .ws-tab { flex: none; }
  .ws-search { width: 100%; }
  .ws-tools { width: 100%; }
  .ws-table .hide-s { display: none; }
  .ws-table td, .ws-table th { padding-left: 10px; padding-right: 10px; }
  .seg button { padding: 0 10px; }
}
a.btn, a.badge { text-decoration: none; color: inherit; }
a.btn:hover { color: inherit; }
.ws-table td { white-space: nowrap; }
.ws-table .cw .t, .ws-table .cell-who .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; display: block; }
.ws-table .c1 { display: block; max-width: 220px; }
.ws-table td .cw .s { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
@media (max-width: 1599px) { .ws-table .hide-m { display: none; } }
.dash.editing .w-h { flex-wrap: wrap; row-gap: 8px; }
.dash.editing .w-tools { flex-wrap: wrap; }
.w { overflow: hidden; }
.w-m .moneys, .w-l .moneys { flex-direction: row; }
.w-m .money, .w-l .money { flex: 1; flex-direction: column; align-items: flex-start; gap: 4px; }
@media (max-width: 820px) { .w-m .moneys, .w-l .moneys { flex-direction: column; } .w-m .money, .w-l .money { flex-direction: row; align-items: baseline; } }
.ws-table .only-s { display: none; }
@media (max-width: 820px) {
  .ws-table .only-s { display: block; }
  .ws-table .s.hide-s { display: none; }
  .w .kpis { grid-template-columns: 1fr 1fr; }
  .ws-table .cw .t, .ws-table .cell-who .t { max-width: 190px; }
}
@media (min-width: 1100px) and (max-width: 1599px) { .ws-body { grid-template-columns: minmax(0, 1fr) 320px; } }
@media (max-width: 1599px) {
  .ws-table td { padding: 9px 10px; }
  .ws-table th { padding: 0 10px; }
  .ws-table .cw .t, .ws-table .cell-who .t { max-width: 210px; }
  .ws-table .c1 { max-width: 170px; }
  .ws-table td .cw .s { max-width: 200px; }
}
.ws-table .only-m { display: none; }
@media (max-width: 1599px) { .ws-table .only-m { display: block; } }
@media (max-width: 1439px) { .ws-table .hide-l { display: none; } .main { padding-left: 28px; padding-right: 28px; } }
@media (max-width: 820px) { .ws-table .only-m { display: none; } .main { padding: 18px 14px 50px; } }
@media (max-width: 820px) {
  .ws-table td { padding: 9px 8px; }
  .ws-table th { padding: 0 8px; }
  .ws-table .cw .t, .ws-table .cell-who .t { max-width: 150px; }
  .ws-table td .cw .s { max-width: 150px; }
  .ws-table .st { font-size: 11px; padding: 3px 7px; }
}
@media (max-width: 820px) { .ws-table th { width: auto !important; } .ws-table .cell-who .av { display: none; } }
@media (max-width: 820px) { .ws-table .cw .t, .ws-table td .cw .s { max-width: 135px; } }
.p-head h2 { overflow-wrap: break-word; hyphens: auto; font-size: 17px; line-height: 1.25; }
.cw > .st { align-self: flex-start; }
.cw.r > .st { align-self: flex-end; }
/* Review-Fixes */
.dash { align-items: start; }
.ws-bar > *, .ws-tabs { min-width: 0; max-width: 100%; }
.p-note .line .field { min-width: 0; }
.p-note .line .btn { flex: none; }
.dash.editing .w-b { max-height: 220px; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
@media (min-width: 821px) {
  .dash { grid-auto-rows: 8px; row-gap: 0; align-items: start; }
  .dash > .w { margin-bottom: 16px; }
  .dash > .w-tray { margin-bottom: 16px; grid-row-end: span 8; }
}
