:root{
  --green:#9bc321;
  --gray-50:#f6f6f6;
  --gray-100:#ececec;
  --gray-300:#d4d4d4;
  --gray-500:#a8aaac;
  --gray-900:#171717;
  --bg:var(--gray-50);
  --surface:#fff;
  --text:var(--gray-900);
  --muted:#666;
  --radius:12px;
  --shadow:0 20px 60px rgba(0,0,0,.08);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:'Montserrat', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  background:var(--bg);
  color:var(--text);
  line-height:1.5;
}
a{color:var(--gray-900);text-underline-offset:3px}
.container{width:min(1080px,92vw);margin:0 auto;padding:28px}
.card{background:var(--surface);border-radius:var(--radius);box-shadow:var(--shadow);padding:24px}
header.site{background:linear-gradient(180deg,#fff,#fafafa);border-bottom:1px solid var(--gray-100)}
header.site .wrap{display:flex;justify-content:space-between;align-items:center;gap:16px}
.brand{display:flex;align-items:center;gap:10px;font-weight:900;letter-spacing:.06em}
.brand span{font-size:28px}
.brand .brand-logo{height:64px;width:auto;display:block}
.brand .mark{width:22px;height:22px;background:var(--green);border-radius:6px;box-shadow:0 0 0 3px rgba(155,195,33,.15)}
.brand-block{display:flex;flex-direction:column;gap:4px}
.brand-title{}
.brand-greeting{margin:0;font-weight:700;letter-spacing:.01em}
h1{font-weight:900;letter-spacing:.01em;margin:0 0 8px}
.auth-title{font-weight:900;letter-spacing:.01em;margin:0 0 8px;font-size:2em}
h2{font-weight:700;margin:16px 0 8px}
label{display:block;margin:14px 0 6px;font-weight:600}
input[type=text],input[type=password],input[type=email]{
  width:100%;padding:12px 14px;border:1px solid var(--gray-300);border-radius:10px;font-size:16px;outline:none
}
button,.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  padding:12px 16px;border-radius:10px;border:1px solid transparent;font-weight:700;cursor:pointer
}
.btn-stack{
  flex-direction:column;
  align-items:center;
  text-align:center;
  gap:4px;
}
.btn-stack .btn-label{font-size:inherit;}
.btn-stack .btn-count{font-size:inherit;color:#d00000;font-weight:700;line-height:1.2;}
.btn-primary{background:var(--green);color:#fff}
.btn-secondary{background:#fff;color:var(--gray-900);border-color:var(--gray-300)}
.btn-danger{background:#b91c1c;color:#fff;border-color:#b91c1c}
.modal{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:rgba(0,0,0,.35);
  opacity:0;
  pointer-events:none;
  transition:opacity .15s ease-in-out;
  z-index:60;
}
.modal[aria-hidden="false"]{opacity:1;pointer-events:auto}
.modal-backdrop{position:absolute;inset:0}
.modal-dialog{
  position:relative;
  width:min(480px,100%);
  background:#fff;
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
  z-index:1;
}
.modal-header,.modal-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:16px;border-bottom:1px solid var(--gray-100)}
.modal-footer{border-top:1px solid var(--gray-100);border-bottom:none;justify-content:flex-end}
.modal-body{padding:16px;font-size:15px}
.modal-close{background:none;border:none;font-size:22px;line-height:1;cursor:pointer;padding:4px;color:var(--muted)}
#btn-orders,#btn-complaints{
  background:#fff;
  color:#000;
  border:2px solid var(--green);
}
#btn-orders .btn-count,#btn-complaints .btn-count{color:var(--text)}
.msg{margin-top:12px;color:#b91c1c;font-weight:600}
.muted{color:var(--muted)}
.auth{display:grid;place-items:center;min-height:100vh;
  background: linear-gradient(180deg,#fff 0,#f7f8f8 100%)
}
.auth-card{width:min(440px,92vw)}
/* dezente Solarform-Anmutung (abgerundete Kacheln) */
.solarform{
  --s:20px;
  background:none
}
.table{width:100%;border-collapse:collapse}
.table th,.table td{padding:12px;border-bottom:1px solid var(--gray-100)}
.table th{text-align:left;color:var(--gray-500);font-size:14px}
.portal-table th{text-align:center}
.portal-table td{text-align:left}
.portal-table .sticky-left{position:sticky;left:0;background:var(--surface);z-index:2;box-shadow:2px 0 4px rgba(0,0,0,.04)}
.portal-table .sticky-right{position:sticky;right:0;background:var(--surface);z-index:2;box-shadow:-2px 0 4px rgba(0,0,0,.04)}
.portal-table .chat-cell{min-width:96px;display:flex;align-items:center;justify-content:flex-end;padding-right:12px}
.orders-table tbody tr:nth-child(even){background:linear-gradient(90deg,rgba(0,0,0,.015),rgba(0,0,0,.015))}
.glow{ text-shadow:0 0 22px rgba(155,195,33,.55) }
/* Floating Chat-Button */
.chat-button{
  position:fixed;
  right:24px;
  bottom:24px;
  width:56px;
  height:56px;
  border-radius:999px;
  border:none;
  background:var(--green);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:var(--shadow);
  cursor:pointer;
  font-size:24px;
  z-index:40;
}
.chat-button:hover{
  filter:brightness(1.05);
  transform:translateY(-1px);
}
.chat-button:disabled{
  opacity:.4;
  cursor:not-allowed;
}

/* Chat-Overlay */
.chat-modal{
  position:fixed;
  inset:0;
  display:none;
  align-items:flex-end;
  justify-content:flex-end;
  z-index:39;
  pointer-events:none;
}
.chat-modal.open{
  display:flex;
  pointer-events:auto;
}
.chat-modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.25);
}
.chat-modal-dialog{
  position:relative;
  margin:0 24px 96px;
  width:min(420px,calc(100% - 48px));
  max-height:70vh;
  background:var(--surface);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.chat-header{
  padding:10px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--gray-100);
}
.chat-title{
  margin:0;
  font-size:15px;
}
.chat-close{
  border:none;
  background:transparent;
  font-size:20px;
  line-height:1;
  cursor:pointer;
}
.chat-messages{
  padding:12px 14px;
  background:var(--gray-50);
  overflow-y:auto;
  flex:1;
  font-size:14px;
}
.chat-system{
  margin:0;
  color:var(--muted);
  font-size:13px;
}
.chat-message{
  margin-bottom:10px;
}
.chat-message-me .chat-bubble{
  background:#e7f4ce;
}
.chat-meta{
  font-size:11px;
  color:var(--muted);
  margin-bottom:2px;
}
.chat-bubble{
  display:inline-block;
  padding:8px 12px;
  border-radius:16px;
  background:#fff;
  max-width:100%;
  word-wrap:break-word;
}
.chat-form{
  display:flex;
  align-items:flex-end;
  gap:8px;
  padding:8px 10px 10px;
  border-top:1px solid var(--gray-100);
  background:#fff;
}
.chat-input{
  flex:1;
  min-height:40px;
  max-height:80px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--gray-300);
  font-family:inherit;
  font-size:14px;
  resize:vertical;
}
.chat-send-btn{
  border:none;
  border-radius:999px;
  padding:8px 16px;
  background:var(--green);
  color:#fff;
  font-weight:600;
  cursor:pointer;
}
.chat-send-btn:disabled{
  opacity:.6;
  cursor:not-allowed;
}
.order-chat-btn{position:relative;font-size:18px;padding:8px 12px;border:1px solid var(--green);border-radius:10px;background:var(--green);color:#fff;cursor:pointer}
.order-chat-btn.order-chat-unread::after{
  content:'';
  position:absolute;
  top:4px;
  right:4px;
  width:10px;
  height:10px;
  border-radius:50%;
  background:#d00000;
  box-shadow:0 0 0 2px #fff;
}
.orders-table th:last-child,
.orders-table td:last-child,
.complaints-table th:last-child,
.complaints-table td:last-child{ text-align:right }
