:root {
  --paper: #f4f1ea;
  --paper-deep: #e9e3d9;
  --ink: #181816;
  --muted: #6e6a61;
  --line: #d4cec3;
  --white: #fffdfa;
  --accent: #ed593e;
  --accent-dark: #bd321c;
  --green: #316b56;
  --amber: #9a5b16;
  --radius: 18px;
  --shadow: 0 24px 70px rgba(30, 26, 20, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, summary { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 18% 10%, #fff8ee 0, transparent 35%), var(--paper); }
.login-card { width: min(440px, 100%); background: var(--white); border: 1px solid var(--line); border-radius: 28px; padding: clamp(32px, 6vw, 54px); box-shadow: var(--shadow); }
.brand-mark { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--white); font: 700 30px/1 Georgia, serif; margin-bottom: 34px; }
.brand-mark.small { width: 40px; height: 40px; margin: 0; font-size: 21px; }
.eyebrow { margin: 0 0 8px; color: var(--accent-dark); text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 750; }
.login-card h1 { margin: 0; font: 500 clamp(36px, 8vw, 54px)/.98 Georgia, "Times New Roman", serif; letter-spacing: -.035em; }
.login-copy { margin: 20px 0 32px; color: var(--muted); line-height: 1.55; }
.login-card label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 9px; }
.login-card input { width: 100%; height: 54px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); padding: 0 16px; margin-bottom: 14px; }
.form-error { min-height: 20px; color: var(--accent-dark); font-size: 13px; margin: 12px 0 0; }

.topbar { height: 76px; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(18px, 4vw, 54px); background: rgba(244, 241, 234, .9); border-bottom: 1px solid var(--line); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; }
.brand small { color: var(--muted); font-size: 12px; margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 22px; color: var(--muted); font-size: 13px; }
.text-button { border: 0; background: transparent; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; padding: 8px 0; }

.workspace { max-width: 1540px; margin: 0 auto; padding: clamp(30px, 5vw, 74px) clamp(18px, 4vw, 54px) 80px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, .55fr); gap: clamp(28px, 4vw, 68px); align-items: start; }
.intro-row { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 30px; }
.intro-row h1 { margin: 0; max-width: 720px; font: 500 clamp(42px, 5.2vw, 76px)/.96 Georgia, "Times New Roman", serif; letter-spacing: -.045em; }
.button { min-height: 48px; border: 1px solid transparent; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 30px; padding: 0 22px; cursor: pointer; font-weight: 700; transition: transform .15s ease, background .15s ease, color .15s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--ink); color: var(--white); }
.button.primary:hover { background: var(--accent-dark); }
.button.secondary { border-color: var(--line); background: transparent; }
.button.full { width: 100%; }

.call-guide { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255, 253, 250, .55); margin-bottom: 22px; overflow: hidden; }
.call-guide summary { cursor: pointer; list-style: none; padding: 17px 20px; font-weight: 700; display: flex; justify-content: space-between; }
.call-guide summary::after { content: "+"; font-size: 22px; font-weight: 400; }
.call-guide[open] summary::after { content: "−"; }
.guide-grid { padding: 0 14px 14px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.guide-grid button { text-align: left; border: 1px solid var(--line); background: var(--white); border-radius: 12px; padding: 14px; cursor: pointer; }
.guide-grid button:hover { border-color: var(--ink); }

.call-form { background: var(--white); border: 1px solid var(--line); border-radius: 24px; padding: clamp(22px, 4vw, 44px); box-shadow: var(--shadow); }
.section-heading { display: flex; align-items: center; gap: 16px; padding: 30px 0 19px; border-top: 1px solid var(--line); margin-top: 28px; }
.section-heading:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.section-heading > span { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--paper-deep); font-size: 12px; font-weight: 750; }
.section-heading h2, .section-heading p { margin: 0; }
.section-heading h2 { font-size: 21px; }
.section-heading p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.form-grid { display: grid; gap: 14px; margin-bottom: 14px; }
.form-grid.three { grid-template-columns: 1.15fr 1fr 1fr; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.field { display: block; }
.field > span { display: block; font-size: 12px; font-weight: 750; margin: 0 0 8px 2px; color: #4d4942; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #fbfaf7; color: var(--ink); outline: 0; transition: border .15s ease, box-shadow .15s ease; }
.field input, .field select { height: 50px; padding: 0 14px; }
.field textarea { padding: 14px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus, .login-card input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(24, 24, 22, .08); }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 17px 0 14px; }
.check-card { position: relative; min-height: 78px; border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; align-items: center; gap: 12px; cursor: pointer; background: #fbfaf7; }
.check-card input { width: 20px; height: 20px; accent-color: var(--ink); }
.check-card strong, .check-card small { display: block; }
.check-card strong { font-size: 14px; }
.check-card small { color: var(--muted); font-size: 12px; margin-top: 4px; }
.check-card:has(input:checked) { border-color: var(--ink); background: #f0eee7; }
.check-card.urgent:has(input:checked) { border-color: var(--accent); background: #fff1ed; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 28px; margin-top: 30px; border-top: 1px solid var(--line); }
.form-actions p { max-width: 390px; color: var(--muted); font-size: 12px; line-height: 1.45; margin: 0; }

.queue-column { position: sticky; top: 104px; max-height: calc(100vh - 126px); display: flex; flex-direction: column; }
.queue-header { display: flex; align-items: end; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.queue-header h2 { margin: 0; font: 500 32px/1 Georgia, "Times New Roman", serif; }
.count-badge { background: var(--ink); color: var(--white); padding: 8px 12px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.filters { margin-bottom: 15px; }
.search input { width: 100%; height: 48px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); padding: 0 14px; outline: 0; }
.filter-tabs { display: flex; gap: 4px; margin-top: 8px; overflow-x: auto; }
.filter-tabs button { white-space: nowrap; border: 0; border-radius: 999px; background: transparent; color: var(--muted); padding: 8px 11px; cursor: pointer; font-size: 12px; font-weight: 700; }
.filter-tabs button.active { background: var(--paper-deep); color: var(--ink); }
.call-list { overflow: auto; display: grid; gap: 10px; padding: 2px 4px 14px 0; }
.call-card { border: 1px solid var(--line); border-radius: 16px; background: var(--white); padding: 17px; cursor: pointer; transition: border .15s ease, transform .15s ease; }
.call-card:hover, .call-card:focus { border-color: var(--ink); transform: translateY(-1px); outline: none; }
.call-card.is-urgent { border-left: 5px solid var(--accent); }
.call-card-top { display: flex; justify-content: space-between; gap: 14px; }
.call-card h3, .call-card p { margin: 0; }
.call-card h3 { font-size: 15px; }
.call-card-top p { color: var(--muted); font-size: 12px; margin-top: 3px; }
.call-card time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.call-reason { color: #4f4b44; font-size: 13px; line-height: 1.45; margin-top: 13px !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.call-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 14px; color: var(--muted); font-size: 11px; }
.call-meta span { background: var(--paper); border-radius: 999px; padding: 5px 8px; }
.call-meta .callback-pill { background: #e9f3ed; color: var(--green); }
.call-meta .status-erledigt { background: #e9f3ed; color: var(--green); }
.call-meta .status-in_bearbeitung { background: #fff0da; color: var(--amber); }
.empty-state { text-align: center; border: 1px dashed var(--line); border-radius: 16px; padding: 34px 20px; color: var(--muted); }
.empty-state > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #e3eee7; color: var(--green); margin: 0 auto 12px; }
.empty-state h3 { color: var(--ink); margin: 0; }
.empty-state p { font-size: 13px; margin: 6px 0 0; }
.team-directory { flex: 0 0 auto; border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.team-directory summary { cursor: pointer; font-weight: 700; font-size: 13px; }
.team-directory ul { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 7px; }
.team-directory li { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.team-directory strong, .team-directory small { display: block; }
.team-directory small { color: var(--muted); margin-top: 2px; }
.team-directory a { color: inherit; text-decoration: none; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 50; transform: translate(-50%, 18px); opacity: 0; pointer-events: none; background: var(--ink); color: var(--white); border-radius: 999px; padding: 12px 18px; font-size: 13px; transition: opacity .2s ease, transform .2s ease; box-shadow: var(--shadow); }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1040px) {
  .workspace { grid-template-columns: 1fr; }
  .queue-column { position: static; max-height: none; }
  .call-list { max-height: 520px; }
}

@media (max-width: 680px) {
  .topbar { height: 66px; }
  .topbar time { display: none; }
  .workspace { padding-top: 28px; }
  .intro-row { align-items: start; flex-direction: column; }
  .intro-row h1 { font-size: 46px; }
  .guide-grid, .form-grid.three, .form-grid.two, .choice-row { grid-template-columns: 1fr; }
  .call-form { padding: 22px 17px; border-radius: 18px; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .form-actions .button { width: 100%; }
  .queue-header { align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
