/* ============================================================
   MAIL-KLICKER V2 – STYLE.CSS
   Design System: Corporate Trust (Vanilla CSS)
   ============================================================ */

/* ============================================================
   0. IMPORTS & DESIGN TOKENS
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Colors */
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --primary: #4F46E5;
  --primary-dark: #4338CA;
  --secondary: #7C3AED;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --accent: #10B981;
  --border: #E2E8F0;
  --border-light: #F1F5F9;

  /* Legacy color compat */
  --blue: #0047FF;
  --blue-dark: #0035CC;
  --green: #22D65E;
  --gray-bg: #f0f2f5;
  --badge-bg: #E6EEFF;

  /* Placeholder colors */
  --placeholder-bg: #fef3c7;
  --placeholder-border: #f59e0b;
  --placeholder-text: #92400e;

  /* Bilanz row colors */
  --row-pending-bg: #FFFBEB;
  --row-pending-border: #F59E0B;
  --row-assigned-bg: #ECFDF5;
  --row-assigned-border: #10B981;

  /* Typography */
  --font: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(79, 70, 229, 0.06);
  --shadow-card: 0 4px 20px -2px rgba(79, 70, 229, 0.1);
  --shadow-card-hover: 0 10px 25px -5px rgba(79, 70, 229, 0.15), 0 8px 10px -6px rgba(79, 70, 229, 0.1);
  --shadow-button: 0 4px 14px 0 rgba(79, 70, 229, 0.3);
  --shadow-topbar: 0 2px 12px rgba(79, 70, 229, 0.06);

  /* Transitions */
  --transition: all 0.2s ease;
  --transition-long: all 0.4s ease;
}

/* ============================================================
   1. RESET & BASE
   ============================================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
}

/* ============================================================
   2. BACKGROUND DECORATION (Atmospheric Blobs)
   ============================================================ */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

body::before {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  top: -150px;
  right: -100px;
}

body::after {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  bottom: -100px;
  left: -100px;
}

/* ============================================================
   3. TOP-BAR (Startseite)
   ============================================================ */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 16px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-topbar);
}

.top-bar h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================================
   4. MANDANT SELECTOR
   ============================================================ */
.mandant-selector {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mandant-selector label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
}

.mandant-selector select {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-width: 240px;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-main);
  background: var(--surface);
  cursor: pointer;
  transition: var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748B' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.mandant-selector select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* ============================================================
   5. CARDS (Startseite)
   ============================================================ */
.cards-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 48px 32px;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.card {
  background: var(--surface);
  padding: 32px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  opacity: 0;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-4px);
  border-color: var(--primary);
}

.card:hover::before {
  opacity: 1;
}

.card-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(124, 58, 237, 0.08));
}

.card h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}

.card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.6;
}

.card-fields {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.card-fields li {
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(124, 58, 237, 0.06));
  color: var(--primary);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(79, 70, 229, 0.12);
}

/* ============================================================
   6. COMPOSE-TOPBAR (shared across LCL, MSB, Bilanz)
   ============================================================ */
.compose-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-topbar);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.back-link:hover {
  background: rgba(79, 70, 229, 0.06);
}

.back-link::before {
  content: '\2190';
  font-size: 1.1rem;
}

.mandant-display {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.mandant-name {
  font-weight: 700;
  color: var(--text-main);
}

/* ============================================================
   7. COMPOSE-SUBJECT
   ============================================================ */
.compose-subject {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 32px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.subject-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

#subject-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
  word-break: break-word;
}

/* ============================================================
   8. COMPOSE-FIELDS
   ============================================================ */
.compose-fields {
  padding: 28px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.field-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.field-row:last-child {
  margin-bottom: 0;
}

.field-label {
  width: 120px;
  min-width: 120px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.field-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text-main);
  background: var(--surface);
  transition: var(--transition);
}

.field-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.field-input::placeholder {
  color: #94A3B8;
}

/* ============================================================
   9. ZEITRAUM-BUTTONS (shared)
   ============================================================ */
.field-row--zeitraum {
  align-items: flex-start;
}

.zeitraum-btn-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  flex: 1;
}

.zeitraum-btn {
  padding: 8px 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.zeitraum-btn:hover {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.04);
}

.zeitraum-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-button);
  font-weight: 600;
}

/* ============================================================
   10. COMPOSE-PREVIEW
   ============================================================ */
.compose-preview {
  padding: 24px 32px;
  position: relative;
  z-index: 1;
}

.preview-header {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

#preview-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  font-size: 0.9rem;
  line-height: 1.7;
  white-space: pre-wrap;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  min-height: 120px;
}

.placeholder-unfilled {
  background: var(--placeholder-bg);
  border: 1px dashed var(--placeholder-border);
  color: var(--placeholder-text);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.85rem;
}

/* ============================================================
   11. COMPOSE-ACTIONS
   ============================================================ */
.compose-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 32px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(79, 70, 229, 0.06);
}

.action-btn {
  padding: 10px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.action-btn--primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: var(--shadow-button);
}

.action-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.action-btn--secondary {
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--border);
}

.action-btn--secondary:hover {
  background: rgba(79, 70, 229, 0.04);
  border-color: var(--primary);
}

/* ============================================================
   12. MSB – MALO-LIST
   ============================================================ */
.field-row--malo-list {
  align-items: flex-start;
}

.malo-list-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.malo-textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.85rem;
  color: var(--text-main);
  resize: vertical;
  transition: var(--transition);
  line-height: 1.5;
}

.malo-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.malo-list-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#malo-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.malo-clear-btn {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.malo-clear-btn:hover {
  border-color: #EF4444;
  color: #EF4444;
  background: rgba(239, 68, 68, 0.04);
}

/* ============================================================
   13. BILANZ – TABLE WIDGET
   ============================================================ */
.field-row--bilanz-table {
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
}

.field-row--bilanz-table .field-label {
  width: auto;
}

.bilanz-table-widget {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Paste Area */
.bilanz-paste-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bilanz-paste-area.collapsed .bilanz-bulk-textarea {
  min-height: 40px;
  height: 40px;
}

.bilanz-bulk-textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.85rem;
  color: var(--text-main);
  resize: vertical;
  transition: var(--transition);
}

.bilanz-bulk-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.bilanz-parse-btn {
  align-self: flex-start;
  padding: 7px 16px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.bilanz-parse-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-button);
}

/* Assign Area */
.bilanz-assign-area {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.bilanz-assign-area.visible {
  display: flex;
}

.bilanz-assign-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

.bilanz-assign-toolbar label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

.bilanz-assign-toolbar select {
  flex: 1;
  min-width: 200px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.8rem;
  color: var(--text-main);
  background: var(--surface);
}

.bilanz-batch-btn {
  padding: 6px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.bilanz-batch-btn:hover {
  background: var(--primary-dark);
}

/* Assign List */
.bilanz-assign-list {
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 2px;
}

.bilanz-assign-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--row-pending-border);
  border-radius: var(--radius-md);
  background: var(--row-pending-bg);
  transition: var(--transition);
  flex-wrap: wrap;
}

.bilanz-assign-row.assigned {
  border-color: var(--row-assigned-border);
  background: var(--row-assigned-bg);
}

.bilanz-assign-row input[type="checkbox"] {
  cursor: pointer;
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.bilanz-row-malo {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  min-width: 200px;
}

.bilanz-row-reason {
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.78rem;
  color: var(--text-main);
  background: var(--surface);
  min-width: 180px;
}

.bilanz-row-kwh {
  display: none;
  align-items: center;
  gap: 6px;
}

.bilanz-row-kwh.visible {
  display: flex;
}

.bilanz-kwh-input {
  width: 110px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.8rem;
  color: var(--text-main);
}

.bilanz-kwh-input:focus {
  outline: none;
  border-color: var(--primary);
}

.bilanz-kwh-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.bilanz-row-freitext {
  display: none;
  width: 100%;
  padding-left: 26px;
}

.bilanz-row-freitext.visible {
  display: block;
}

.bilanz-freitext-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.82rem;
  color: var(--text-main);
  resize: none;
}

.bilanz-freitext-input:focus {
  outline: none;
  border-color: var(--primary);
}

.bilanz-row-delete {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bilanz-row-delete:hover {
  border-color: #EF4444;
  color: #EF4444;
  background: rgba(239, 68, 68, 0.04);
}

/* Add Single */
.bilanz-add-single {
  display: flex;
  gap: 8px;
  align-items: center;
}

.bilanz-add-single input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.85rem;
  color: var(--text-main);
}

.bilanz-add-single input:focus {
  outline: none;
  border-color: var(--primary);
}

.bilanz-add-single-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bilanz-add-single-btn:hover {
  background: var(--primary-dark);
}

/* Status */
.bilanz-status {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  padding-top: 4px;
}

/* ============================================================
   14. NOTIFICATION
   ============================================================ */
.notification {
  position: fixed;
  top: 80px;
  right: 32px;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--surface);
  z-index: 1000;
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 4s forwards;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  max-width: 420px;
}

.notification--success {
  background: linear-gradient(135deg, var(--accent), #059669);
}

.notification--info {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.notification--warning {
  background: linear-gradient(135deg, #F59E0B, #D97706);
}

.notification--error {
  background: linear-gradient(135deg, #EF4444, #DC2626);
}

@keyframes slideIn {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateY(-10px); }
}

/* ============================================================
   15. VALIDATION DIALOG
   ============================================================ */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
}

.dialog-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.dialog-box h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-main);
}

.dialog-box p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.6;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ============================================================
   16. VIEW MANAGEMENT
   ============================================================ */
.view {
  display: none;
}

.view.active {
  display: block;
}

/* ============================================================
   17. PREVIEW TABLE (Bilanz)
   ============================================================ */
.preview-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.85rem;
}

.preview-table th,
.preview-table td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}

.preview-table th {
  background: var(--bg);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.preview-table td:first-child {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.8rem;
  white-space: nowrap;
}

/* ============================================================
   18. RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .cards-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .top-bar {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    padding: 14px 16px;
  }

  .cards-container {
    grid-template-columns: 1fr;
    padding: 24px 16px;
  }

  .card {
    padding: 24px;
  }

  .compose-topbar {
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
  }

  .compose-subject {
    flex-direction: column;
    gap: 4px;
    padding: 12px 16px;
  }

  .compose-fields {
    padding: 20px 16px;
  }

  .field-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .field-label {
    width: auto;
    min-width: auto;
  }

  .zeitraum-btn-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .compose-preview {
    padding: 20px 16px;
  }

  #preview-body {
    padding: 20px;
  }

  .compose-actions {
    flex-direction: column;
    padding: 12px 16px;
  }

  .compose-actions .action-btn {
    width: 100%;
    justify-content: center;
  }

  .bilanz-assign-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ============================================================
   19. SCROLLBAR STYLING
   ============================================================ */
.bilanz-assign-list::-webkit-scrollbar {
  width: 6px;
}

.bilanz-assign-list::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 3px;
}

.bilanz-assign-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.bilanz-assign-list::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ============================================================
   20. ACCESSIBILITY
   ============================================================ */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
