/* ── Schadensmeldung Applet Design System ──────────────────────── */
:root {
  --accent:        #4F46E5;
  --accent-d:      #4338CA;
  --accent-dim:    rgba(79,70,229,.16);
  --accent-border: rgba(79,70,229,.35);

  --sel-bg:     #C7D2FE;
  --sel-border: rgba(79,70,229,.5);
  --sel-color:  #3730A3;

  --cta-bg:    #4F46E5;
  --cta-color: #fff;

  --bg:        #0B2027;
  --surface:   #102b33;
  --surface-2: #183540;
  --surface-3: #1f404e;

  --border:   #1f404e;
  --border-1: #1f404e;
  --border-2: #2d5261;

  --text:      #edeef0;
  --text-main: #edeef0;
  --text-muted:#8b9199;
  --text-sub:  #8b9199;

  --danger:    #f87171;
  --danger-bg: rgba(248,113,113,.10);
  --danger-border: rgba(248,113,113,.28);

  --warning:   #f0c040;
  --warning-bg: rgba(240,192,64,.09);
  --warning-border: rgba(240,192,64,.30);

  --success:   #3dd68c;
  --success-bg: rgba(61,214,140,.10);
  --success-border: rgba(61,214,140,.28);

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;
}

[data-theme="light"] {
  --accent:        #4F46E5;
  --accent-d:      #4338CA;
  --accent-dim:    rgba(79,70,229,.07);
  --accent-border: rgba(79,70,229,.22);

  --sel-bg:     #EEF2FF;
  --sel-border: rgba(79,70,229,.3);
  --sel-color:  #4F46E5;

  --cta-bg:    #4F46E5;
  --cta-color: #fff;

  --bg:        #f4f6f9;
  --surface:   #ffffff;
  --surface-2: #edf0f5;
  --surface-3: #e2e8f0;

  --border:   #1b1e26;
  --border-1: rgba(0, 0, 0, 0.08);
  --border-2: rgba(0, 0, 0, 0.14);

  --text:      #1b1e26;
  --text-main: #1b1e26;
  --text-muted:#576070;
  --text-sub:  #576070;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header & Nav */
.header-bar, header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  row-gap: 8px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
  font-size: 1.05rem;
}

.header-brand {
  font-size: 1.05rem;
  font-weight: 700;
  color: #40c5d4;
  letter-spacing: -.01em;
  white-space: nowrap;
}

.obj-badge {
  font-size: .88rem;
  font-weight: 400;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--accent), var(--accent-d));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  flex-shrink: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Main Container & Shell */
.app-container {
  max-width: 540px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px;
  box-sizing: border-box;
  flex: 1;
}

/* Multi-step progress bar */
.wizard-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  position: relative;
}

.progress-track {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--surface-3);
  transform: translateY(-50%);
  z-index: 1;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

.step-node {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  z-index: 2;
  border: 3px solid var(--surface-1);
  transition: all 0.2s ease;
}

.step-node.active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.step-node.completed {
  background: var(--success);
  color: #ffffff;
}

/* Wizard Section Cards */
.wizard-card {
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.step-header {
  margin-bottom: 24px;
}

.step-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 6px 0;
}

.step-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0;
}

/* Choice Cards (Location & Urgency) */
.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

@media (max-width: 540px) {
  .choice-grid {
    grid-template-columns: 1fr;
  }
}

.choice-option {
  position: relative;
}

.choice-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-box {
  border: 1.5px solid var(--border-2);
  background: var(--surface-3);
  border-radius: var(--r-md);
  padding: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
  height: 100%;
  box-sizing: border-box;
}

.choice-box:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.choice-option input[type="radio"]:checked + .choice-box {
  border-color: var(--accent);
  background: var(--accent-glow);
  box-shadow: 0 0 0 2px var(--accent);
}

.choice-box-urgent:hover,
.choice-option input[type="radio"][value="urgent"]:checked + .choice-box {
  border-color: var(--warning);
  background: var(--warning-bg);
  box-shadow: 0 0 0 2px var(--warning);
}

.choice-title {
  font-weight: 600;
  font-size: 0.98rem;

}

.choice-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Form Controls & Inputs */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-sub);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Photo Upload & Preview Grid */
.photo-drop-zone {
  border: 2px dashed var(--border-2);
  border-radius: var(--r-md);
  padding: 24px;
  text-align: center;
  background: var(--surface-3);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.photo-drop-zone:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.photo-thumb-wrap {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border-2);
}

.photo-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-thumb-del {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

/* Summary Review Box */
.review-summary-card {
  background: var(--surface-3);
  border-radius: var(--r-md);
  padding: 18px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.review-item-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
}

.review-item-val {
  font-size: 0.95rem;
  color: var(--text-main);
  margin-top: 4px;
}

/* Success Confirmation Screen */
.success-card {
  text-align: center;
  padding: 36px 24px;
}

.success-icon-badge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--success-bg);
  border: 2px solid var(--success);
  color: var(--success);
  font-size: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

/* Alert Boxes */
.alert-box {
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 0.9rem;
  margin-bottom: 20px;
  line-height: 1.5;
}

.alert-box.err {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: #fca5a5;
}

/* Admin Ticket List & Cards */
.ticket-card {
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.ticket-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.ticket-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-new { background: rgba(59, 130, 246, 0.18); color: #60a5fa; }
.badge-in_progress { background: var(--warning-bg); color: var(--warning); }
.badge-done { background: var(--success-bg); color: var(--success); }
.badge-urgent { background: var(--danger-bg); color: #f87171; border: 1px solid var(--danger-border); }

/* Wizard Action Buttons — Standardized via Shared Design Tokens */
.wizard-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-1);
}

.wizard-step .btn-primary,
.wizard-step .btn-secondary,
.wizard-actions .btn-primary,
.wizard-actions .btn-secondary {
  border-radius: var(--r-md);
  padding: 12px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  height: 44px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.wizard-step .btn-primary,
.wizard-actions .btn-primary {
  background: var(--cta-bg);
  color: var(--cta-color);
  border: none;
}

.wizard-step .btn-primary:hover,
.wizard-actions .btn-primary:hover {
  background: var(--accent-d);
}

.wizard-step .btn-secondary,
.wizard-actions .btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-2);
}

.wizard-step .btn-secondary:hover,
.wizard-actions .btn-secondary:hover {
  background: var(--border-2);
}

#btn-admin-refresh {
  width: auto !important;
  flex: 0 0 auto !important;
  height: 38px !important;
  padding: 8px 16px !important;
  font-size: 0.85rem !important;
  border-radius: var(--r-md, 10px) !important;
}

/* Ticket Detail Modal Backdrop & Panel */
.ticket-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.ticket-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.ticket-modal-backdrop .modal-panel {
  max-width: 620px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  box-sizing: border-box;
  transform: translateY(12px);
  transition: transform 0.2s ease;
}

.ticket-modal-backdrop.active .modal-panel {
  transform: translateY(0);
}
