/* ============================================================
   Jarvis Dashboard — WebArs Design-System
   Hell, Blau-Akzent, Bebas Neue + DM Sans
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Hintergrund */
  --bg:         #f0f0f1;
  --surface:    #f8f8f9;
  --surface-2:  #ffffff;

  /* Linien */
  --border:        rgba(0, 0, 0, 0.09);
  --border-strong: rgba(0, 0, 0, 0.18);

  /* Text */
  --text:   #0d0d0d;
  --muted:  rgba(0, 0, 0, 0.50);
  --dim:    rgba(0, 0, 0, 0.32);

  /* Akzent (WebArs Blue) */
  --accent:       #1840FF;
  --accent-hover: #102fc8;
  --accent-soft:  rgba(24, 64, 255, 0.08);
  --accent-ring:  rgba(24, 64, 255, 0.20);

  /* Semantik */
  --success: #16a34a;
  --warning: #f59e0b;
  --danger:  #dc2626;
  --danger-soft: #fef2f2;

  /* Radius */
  --r-sm: 4px;
  --r:    8px;
  --r-lg: 12px;
  --r-xl: 16px;

  /* Schatten (sparsam) */
  --shadow:      0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-lg:   0 12px 40px rgba(0,0,0,0.08);

  /* Typografie */
  --font-display: 'Bebas Neue', 'Inter', sans-serif;
  --font-body:    'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, Menlo, monospace;

  /* Layout */
  --nav-h:  72px;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100%;
}

/* ============================================================
   HEADER
   ============================================================ */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  padding: 0 32px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-sm {
  width: 38px;
  height: 38px;
  background: var(--text);
  color: var(--surface-2);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px;
  line-height: 1;
  padding-top: 4px;
}

.header-title {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 0.08em;
  color: var(--text);
  font-weight: 400;
  padding-top: 3px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.uhrzeit {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.btn-logout {
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: transparent;
  transition: all 0.15s ease;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.btn-logout:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface);
}

/* ============================================================
   LAYOUT
   ============================================================ */
main.layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  height: calc(100vh - var(--nav-h));
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  background: var(--surface);
}

.widget {
  background: var(--surface-2);
  border-radius: var(--r);
  padding: 22px;
  border: 1px solid var(--border);
}

.widget-title {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 16px;
}

.widget-title::before { content: '{ '; }
.widget-title::after  { content: ' }'; }

.datum {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 0.02em;
  line-height: 1;
}

.wochentag {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.liste-placeholder {
  color: var(--muted);
  font-size: 13px;
}

/* Listen-Items */
.termin-item,
.projekt-item,
.person-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.termin-item:last-child,
.projekt-item:last-child,
.person-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.termin-item:first-child,
.projekt-item:first-child,
.person-item:first-child {
  padding-top: 0;
}

.termin-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.termin-zeit {
  font-family: var(--font-mono);
  color: var(--accent);
  min-width: 48px;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 600;
  padding-top: 2px;
}

.termin-titel {
  color: var(--text);
  flex: 1;
}

.termin-heute {
  font-weight: 600;
}

.termin-heute .termin-titel::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}

.projekt-name {
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
}

.projekt-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.deadline-urgent {
  color: var(--danger) !important;
  font-weight: 600;
}

.person-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.person-name {
  color: var(--text);
  font-weight: 500;
}

.person-tage {
  color: var(--muted);
  font-size: 11px;
  font-family: var(--font-mono);
}

.person-tage.lang {
  color: var(--warning);
}

.keine-daten {
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
}

/* ============================================================
   CHAT
   ============================================================ */
.chat-section {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--surface-2);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.08em;
  color: var(--text);
}

.btn-clear {
  font-size: 11px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 7px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.btn-clear:hover {
  color: var(--danger);
  border-color: var(--danger);
}

.chat-verlauf {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scroll-behavior: smooth;
}

.msg {
  max-width: 78%;
  border-radius: var(--r-lg);
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  animation: msgFadeIn 0.3s ease;
}

@keyframes msgFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.msg-du {
  background: var(--accent);
  color: var(--surface-2);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.msg-jarvis {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.msg-label {
  font-size: 10px;
  font-weight: 600;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.msg-du .msg-label     { color: rgba(255,255,255,0.7); }
.msg-jarvis .msg-label { color: var(--accent); }

.msg-typing {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-style: italic;
}

.msg-typing::after {
  content: '...';
  animation: dots 1.4s infinite;
  letter-spacing: 0.2em;
  margin-left: 2px;
}

@keyframes dots {
  0%, 20%   { opacity: 0.2; }
  40%       { opacity: 0.7; }
  60%, 100% { opacity: 1; }
}

/* Vorschlag-Buttons */
.btn-leiste {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 32px 0;
}

.vorschlag-btn {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  font-weight: 500;
}

.vorschlag-btn:hover {
  background: var(--accent);
  color: var(--surface-2);
  border-color: var(--accent);
}

/* Chat-Eingabe */
.chat-input-bereich {
  border-top: 1px solid var(--border);
  padding: 18px 32px;
  background: var(--surface-2);
}

.chat-eingabe-zeile {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.chat-eingabe {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 16px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  line-height: 1.5;
  resize: none;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  max-height: 140px;
}

.chat-eingabe::placeholder {
  color: var(--muted);
}

.chat-eingabe:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.senden-btn {
  background: var(--accent);
  color: var(--surface-2);
  border: none;
  border-radius: var(--r);
  width: 44px;
  height: 44px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.senden-btn:hover {
  background: var(--accent-hover);
}

.senden-btn:disabled {
  background: var(--muted);
  cursor: default;
}

/* ============================================================
   VOICE-UI (Mic + Toggle-Buttons)
   ============================================================ */
.mic-btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  width: 44px;
  height: 44px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: inherit;
}
.mic-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.mic-btn.recording {
  background: var(--danger);
  color: var(--surface-2);
  border-color: var(--danger);
  animation: mic-pulse 1.2s ease-in-out infinite;
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.45); }
  50%      { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
}

.btn-toggle {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 7px 14px;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.btn-toggle:hover {
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-toggle.active {
  background: var(--accent);
  color: var(--surface-2);
  border-color: var(--accent);
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* ============================================================
   AUTH-SEITEN (Login · Setup · Reset)
   ============================================================ */
.auth-page {
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  text-align: center;
  margin-bottom: 36px;
}

.auth-logo-circle {
  width: 64px;
  height: 64px;
  background: var(--text);
  color: var(--surface-2);
  border-radius: var(--r);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 36px;
  margin-bottom: 18px;
  padding-top: 6px;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 34px;
  letter-spacing: 0.04em;
  color: var(--text);
  font-weight: 400;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.55;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}

.form-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 16px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

.form-input::placeholder {
  color: var(--muted);
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-input.code {
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  text-align: center;
  font-size: 16px;
}

.btn-primary,
.btn-danger {
  border: none;
  border-radius: var(--r);
  padding: 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 6px;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.btn-primary {
  background: var(--accent);
  color: var(--surface-2);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-danger {
  background: var(--danger);
  color: var(--surface-2);
}

.btn-danger:hover {
  background: #b91c1c;
}

.alert {
  border-radius: var(--r);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--danger);
}

.alert-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #b45309;
}

.auth-foot {
  display: block;
  text-align: center;
  margin-top: 22px;
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.auth-foot:hover {
  color: var(--accent);
}

.auth-hinweis {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-top: 20px;
  line-height: 1.6;
}

.icon-danger {
  width: 56px;
  height: 56px;
  background: var(--danger-soft);
  border: 1px solid #fecaca;
  border-radius: var(--r);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: var(--danger);
  margin-bottom: 18px;
  font-weight: 700;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --nav-h: 56px;
  }

  header {
    padding: 0 16px;
    height: var(--nav-h);
  }

  .header-title {
    font-size: 20px;
  }

  .uhrzeit {
    display: none;
  }

  main.layout {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - var(--nav-h));
    overflow: hidden;
  }

  .sidebar {
    display: none;
  }

  .chat-section {
    flex: 1;
    height: 100%;
    min-height: 0;
  }

  .chat-verlauf {
    padding: 16px;
  }

  .chat-input-bereich {
    padding: 12px 16px;
  }

  .chat-header {
    padding: 14px 16px;
    font-size: 17px;
  }

  .msg {
    max-width: 92%;
  }

  .btn-leiste {
    padding: 8px 16px 0;
  }

  .auth-card {
    padding: 32px 20px;
  }
}
