/* ═══════════════════════════════════════════════
   E-Bike Manager - Apple-inspired Design System
   ═══════════════════════════════════════════════ */

:root {
  --ebm-bg: #f5f5f7;
  --ebm-card: #ffffff;
  --ebm-text: #1d1d1f;
  --ebm-text-secondary: #86868b;
  --ebm-text-tertiary: #aeaeb2;
  --ebm-blue: #0071e3;
  --ebm-blue-hover: #0077ed;
  --ebm-blue-light: rgba(0,113,227,.08);
  --ebm-green: #34c759;
  --ebm-red: #ff3b30;
  --ebm-orange: #ff9500;
  --ebm-cyan: #5ac8fa;
  --ebm-gray: #8e8e93;
  --ebm-border: rgba(0,0,0,.06);
  --ebm-shadow-sm: 0 1px 3px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.06);
  --ebm-shadow-md: 0 4px 14px rgba(0,0,0,.06), 0 2px 6px rgba(0,0,0,.04);
  --ebm-shadow-lg: 0 12px 40px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);
  --ebm-radius: 12px;
  --ebm-radius-lg: 18px;
  --ebm-radius-sm: 8px;
  --ebm-transition: .2s cubic-bezier(.25,.1,.25,1);
}

/* Base */
.ebm-panel {
  font-family: 'SF Pro Text', 'SF Pro Icons', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: var(--ebm-text);
  line-height: 1.47059;
  letter-spacing: -.022em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.ebm-panel *, .ebm-panel *::before, .ebm-panel *::after { box-sizing: border-box; }

/* ═══ LOGIN ═══════════════════════════════ */
.ebm-login-wrap {
  display: flex; justify-content: center; align-items: center;
  min-height: 560px; padding: 48px 20px;
}
.ebm-login-box {
  width: 100%; max-width: 400px;
  background: var(--ebm-card);
  border-radius: var(--ebm-radius-lg);
  box-shadow: var(--ebm-shadow-lg);
  overflow: hidden;
}
.ebm-login-header {
  text-align: center; padding: 48px 36px 28px;
  background: var(--ebm-card);
}
.ebm-login-icon {
  width: 64px; height: 64px; margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--ebm-blue), #40a9ff);
  border-radius: 16px; display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: #fff;
  box-shadow: 0 4px 16px rgba(0,113,227,.25);
}
.ebm-login-header h2 {
  margin: 0 0 6px; font-size: 24px; font-weight: 700;
  color: var(--ebm-text); letter-spacing: -.02em;
}
.ebm-login-header p {
  margin: 0; font-size: 15px; color: var(--ebm-text-secondary); font-weight: 400;
}
.ebm-login-form { padding: 8px 36px 36px; }
.ebm-login-field { margin-bottom: 18px; }
.ebm-login-field label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--ebm-text); margin-bottom: 6px;
}
.ebm-login-pass-wrap { position: relative; }
.ebm-login-pass-wrap .ebm-input { padding-right: 48px; }
.ebm-pass-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 18px;
  opacity: .4; transition: opacity var(--ebm-transition);
}
.ebm-pass-toggle:hover { opacity: .8; }
.ebm-login-remember {
  margin-bottom: 24px; font-size: 13px; color: var(--ebm-text-secondary);
}
.ebm-login-remember input { margin-right: 6px; accent-color: var(--ebm-blue); }
.ebm-login-submit {
  width: 100%; justify-content: center; font-size: 16px;
  padding: 14px; font-weight: 600; border-radius: var(--ebm-radius) !important;
}
.ebm-login-error {
  margin: 0 36px 8px; padding: 12px 16px;
  background: #fff2f2; border: none; border-radius: var(--ebm-radius-sm);
  color: var(--ebm-red); font-size: 14px; text-align: center; font-weight: 500;
}
.ebm-login-footer {
  padding: 18px 36px 28px; text-align: center;
  font-size: 12px; color: var(--ebm-text-tertiary);
  border-top: 1px solid var(--ebm-border);
}
.ebm-login-footer p { margin: 0; }

/* ═══ HEADER (Glassmorphism) ══════════════ */
.ebm-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
  padding: 20px 28px;
  background: rgba(255,255,255,.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--ebm-border);
  border-radius: var(--ebm-radius-lg);
  margin-bottom: 24px;
}
.ebm-panel-header__title {
  margin: 0; font-size: 21px; font-weight: 700;
  color: var(--ebm-text); letter-spacing: -.02em;
}
.ebm-panel-header__user {
  font-size: 13px; color: var(--ebm-text-secondary); font-weight: 400;
}
.ebm-logout-link {
  color: var(--ebm-blue); text-decoration: none; font-weight: 500;
}
.ebm-logout-link:hover { text-decoration: underline; }

/* Denied */
.ebm-panel-denied {
  text-align: center; padding: 80px 24px;
  background: var(--ebm-card); border-radius: var(--ebm-radius-lg);
  box-shadow: var(--ebm-shadow-sm);
}

/* ═══ BUTTONS (Pill shape) ════════════════ */
.ebm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border: none; border-radius: 980px;
  background: var(--ebm-blue-light); color: var(--ebm-blue);
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: all var(--ebm-transition); text-decoration: none;
  white-space: nowrap; font-family: inherit;
}
.ebm-btn:hover { background: rgba(0,113,227,.14); }
.ebm-btn-primary { background: var(--ebm-blue); color: #fff; }
.ebm-btn-primary:hover { background: var(--ebm-blue-hover); }
.ebm-btn-danger { background: rgba(255,59,48,.1); color: var(--ebm-red); border: none; }
.ebm-btn-danger:hover { background: rgba(255,59,48,.18); }
.ebm-btn-sm { padding: 6px 14px; font-size: 12px; }
.ebm-btn-lg { padding: 14px 32px; font-size: 16px; font-weight: 600; }
.ebm-btn:disabled { opacity: .35; cursor: not-allowed; }

/* ═══ INPUTS ══════════════════════════════ */
.ebm-input, .ebm-select {
  width: 100%; padding: 10px 14px;
  border: 1px solid rgba(0,0,0,.1); border-radius: var(--ebm-radius-sm);
  font-size: 15px; color: var(--ebm-text); background: var(--ebm-card);
  transition: all var(--ebm-transition); font-family: inherit;
}
.ebm-input:focus, .ebm-select:focus {
  outline: none; border-color: var(--ebm-blue);
  box-shadow: 0 0 0 4px rgba(0,113,227,.12);
}
.ebm-input-lg { font-size: 18px; padding: 14px 18px; font-weight: 600; }
textarea.ebm-input { resize: vertical; line-height: 1.5; }
.ebm-input::placeholder { color: var(--ebm-text-tertiary); }

/* ═══ TOOLBAR ═════════════════════════════ */
.ebm-toolbar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  padding: 16px 0; margin-bottom: 8px;
}
.ebm-toolbar__search { display: flex; gap: 8px; flex: 1; min-width: 250px; }
.ebm-toolbar__search .ebm-input {
  max-width: 400px; border-radius: 980px; padding-left: 18px;
}
.ebm-toolbar .ebm-select {
  width: auto; min-width: 180px; border-radius: 980px; padding: 10px 18px;
}
.ebm-toolbar .ebm-btn { border-radius: 980px; }

/* Stats */
.ebm-stats {
  font-size: 13px; color: var(--ebm-text-secondary); margin-bottom: 12px; font-weight: 500;
}

/* ═══ TABLE (Card style) ══════════════════ */
.ebm-table-wrap {
  background: var(--ebm-card);
  border-radius: var(--ebm-radius-lg);
  box-shadow: var(--ebm-shadow-sm);
  overflow: hidden;
}
.ebm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ebm-table th {
  text-align: left; padding: 12px 16px;
  font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--ebm-text-secondary);
  background: rgba(0,0,0,.02);
  border-bottom: 1px solid var(--ebm-border);
  white-space: nowrap;
}
.ebm-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--ebm-border);
  vertical-align: middle;
}
.ebm-table tr:last-child td { border-bottom: none; }
.ebm-table tr:hover td { background: var(--ebm-blue-light); }
.ebm-table img.ebm-thumb {
  width: 48px; height: 48px; object-fit: cover;
  border-radius: 10px; border: none;
}
.ebm-center {
  text-align: center; color: var(--ebm-text-tertiary);
  padding: 48px !important; font-size: 15px;
}

/* ═══ BADGES (Subtle pastels) ═════════════ */
.ebm-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border-radius: 980px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.ebm-badge-verfuegbar { background: rgba(52,199,89,.12); color: #248a3d; }
.ebm-badge-reserviert { background: rgba(255,149,0,.12); color: #c93400; }
.ebm-badge-verkauft { background: rgba(255,59,48,.1); color: var(--ebm-red); }
.ebm-badge-in_aufbereitung { background: rgba(90,200,250,.12); color: #0071a4; }
.ebm-badge-in_wartung { background: rgba(142,142,147,.12); color: #636366; }
.ebm-badge-ausgeblendet { background: rgba(0,0,0,.06); color: var(--ebm-text-secondary); }
.ebm-badge-unbekannt { background: rgba(0,0,0,.04); color: var(--ebm-text-tertiary); }
.ebm-badge-public { background: rgba(52,199,89,.12); color: #248a3d; }
.ebm-badge-internal { background: rgba(255,149,0,.12); color: #c93400; }
.ebm-badge-draft { background: rgba(0,0,0,.04); color: var(--ebm-text-secondary); }

/* Quick Status Dropdown */
.ebm-qs { position: relative; display: inline-block; }
.ebm-qs-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 6px);
  z-index: 100; background: var(--ebm-card);
  border-radius: var(--ebm-radius); padding: 6px;
  box-shadow: var(--ebm-shadow-lg); min-width: 200px;
  border: 1px solid var(--ebm-border);
}
.ebm-qs-menu.open { display: block; }
.ebm-qs-menu button {
  display: block; width: 100%; padding: 10px 14px;
  border: none; background: none; text-align: left;
  cursor: pointer; border-radius: var(--ebm-radius-sm);
  font-size: 14px; color: var(--ebm-text);
  transition: background var(--ebm-transition);
}
.ebm-qs-menu button:hover { background: var(--ebm-blue-light); }
.ebm-actions-cell { white-space: nowrap; }
.ebm-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  vertical-align: middle;
}

/* ═══ PAGINATION ══════════════════════════ */
.ebm-pagination {
  display: flex; justify-content: center; gap: 4px; padding: 24px 0;
}
.ebm-page-btn {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%;
  background: transparent; cursor: pointer; font-size: 14px; font-weight: 500;
  color: var(--ebm-text-secondary);
  transition: all var(--ebm-transition);
}
.ebm-page-btn:hover { background: var(--ebm-blue-light); color: var(--ebm-blue); }
.ebm-page-btn.active { background: var(--ebm-blue); color: #fff; }

/* ═══ FORM ════════════════════════════════ */
.ebm-form-header {
  display: flex; align-items: center; gap: 16px; margin-bottom: 24px;
}
.ebm-form-header h3 {
  margin: 0; font-size: 21px; font-weight: 700;
  color: var(--ebm-text); letter-spacing: -.02em;
}
/* Segmented Control Tabs */
.ebm-tabs {
  display: flex; flex-wrap: wrap; gap: 0;
  margin-bottom: 28px;
  background: rgba(0,0,0,.04);
  border-radius: var(--ebm-radius-sm);
  padding: 3px;
}
.ebm-tab {
  padding: 9px 18px; border: none; background: none;
  cursor: pointer; font-size: 13px; font-weight: 500;
  color: var(--ebm-text-secondary);
  border-radius: 7px; margin: 0;
  transition: all var(--ebm-transition);
}
.ebm-tab:hover { color: var(--ebm-text); }
.ebm-tab.active {
  background: var(--ebm-card); color: var(--ebm-text);
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  font-weight: 600;
}
.ebm-tab-panel { display: none; }
.ebm-tab-panel.active { display: block; }

.ebm-field { margin-bottom: 20px; }
.ebm-field label {
  display: block; margin-bottom: 6px;
  font-size: 13px; font-weight: 600; color: var(--ebm-text);
}
.ebm-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.ebm-section-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
  color: var(--ebm-text-secondary);
  margin: 32px 0 16px; padding-bottom: 10px;
  border-bottom: 1px solid var(--ebm-border);
}
.ebm-import-box {
  margin-top: 28px;
  padding: 22px;
  border: 1px solid var(--ebm-border);
  border-radius: var(--ebm-radius);
  background: rgba(0,0,0,.015);
}
.ebm-import-box__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.ebm-import-box__header .ebm-section-label { margin-top: 0; }
.ebm-import-box__hint {
  margin: 0;
  font-size: 13px;
  color: var(--ebm-text-secondary);
}
.ebm-import-box__note {
  min-height: 20px;
  font-size: 13px;
  color: var(--ebm-text-secondary);
}
.ebm-form-actions {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 24px 0; margin-top: 32px;
  border-top: 1px solid var(--ebm-border);
}
.ebm-save-status {
  font-size: 14px; color: var(--ebm-green); font-weight: 500;
}

/* ═══ UPLOAD ══════════════════════════════ */
.ebm-upload-zone {
  border: 2px dashed rgba(0,0,0,.1);
  border-radius: var(--ebm-radius-lg); padding: 28px;
  text-align: center; background: rgba(0,0,0,.015);
  transition: all var(--ebm-transition);
}
.ebm-upload-zone:hover {
  border-color: var(--ebm-blue);
  background: var(--ebm-blue-light);
}
#ebm-main-preview img {
  max-width: 280px; max-height: 200px; object-fit: cover;
  border-radius: var(--ebm-radius); margin-bottom: 16px;
  box-shadow: var(--ebm-shadow-md);
}
.ebm-gallery-grid {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: 16px; justify-content: center;
}
.ebm-gallery-item { position: relative; width: 96px; height: 96px; }
.ebm-gallery-item img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: var(--ebm-radius);
  box-shadow: var(--ebm-shadow-sm);
}
.ebm-gallery-rm {
  position: absolute; top: -5px; right: -5px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--ebm-red); color: #fff;
  border: 2px solid var(--ebm-card);
  font-size: 11px; line-height: 16px; text-align: center;
  cursor: pointer; transition: transform var(--ebm-transition);
}
.ebm-gallery-rm:hover { transform: scale(1.15); }

/* ═══ TOAST (Blur) ════════════════════════ */
.ebm-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 10000;
  padding: 14px 24px; border-radius: var(--ebm-radius);
  color: #fff; font-weight: 500; font-size: 14px;
  box-shadow: var(--ebm-shadow-lg);
  animation: ebm-toast-in .35s cubic-bezier(.25,.1,.25,1);
  backdrop-filter: blur(12px);
}
.ebm-toast-success { background: rgba(52,199,89,.92); }
.ebm-toast-error { background: rgba(255,59,48,.92); }
@keyframes ebm-toast-in {
  from { transform: translateY(16px) scale(.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* ═══ RESPONSIVE ══════════════════════════ */
@media (max-width: 768px) {
  .ebm-panel-header { flex-direction: column; text-align: center; padding: 16px 20px; }
  .ebm-toolbar { flex-direction: column; }
  .ebm-toolbar__search { min-width: 100%; }
  .ebm-toolbar__search .ebm-input { max-width: 100%; }
  .ebm-grid-2 { grid-template-columns: 1fr; }
  .ebm-import-box__header { flex-direction: column; }
  .ebm-tabs { gap: 0; }
  .ebm-tab { padding: 8px 12px; font-size: 12px; }
  .ebm-form-actions { flex-direction: column; }
  .ebm-form-actions .ebm-btn { width: 100%; }
  .ebm-table { font-size: 13px; }
  .ebm-table th:nth-child(n+4), .ebm-table td:nth-child(n+4) { display: none; }
  .ebm-table th:last-child, .ebm-table td:last-child { display: table-cell; }
  .ebm-login-box { margin: 0; }
  .ebm-login-form { padding: 8px 24px 28px; }
  .ebm-login-header { padding: 36px 24px 20px; }
}
