/* ═══════════════════════════════════════════════════════════════
   SMV Artikel-DB — Shared Styles
   Wird von dashboard.html, article.html, settings.html eingebunden
   ═══════════════════════════════════════════════════════════════ */

:root {
  --color-bg: #f5f6f8;
  --color-surface: #ffffff;
  --color-text: #1a1a2e;
  --color-text-muted: #6b7080;
  --color-text-faint: #8a8fa8;
  --color-border: #e6e8ef;
  --color-border-strong: #d7dae3;

  --color-primary: #4a9eff;
  --color-primary-hover: #3a8eef;
  --color-primary-soft: #eaf3ff;

  --color-success: #2e7d32;
  --color-success-soft: #e8f5e9;
  --color-warning: #e65100;
  --color-warning-soft: #fff3e0;
  --color-danger: #c62828;
  --color-danger-soft: #ffeaea;
  --color-draft: #9aa0a6;
  --color-draft-soft: #f1f3f4;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 1px rgba(16, 24, 40, 0.03);
  --shadow-md: 0 2px 6px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 8px 24px rgba(16, 24, 40, 0.10), 0 2px 4px rgba(16, 24, 40, 0.05);

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;

  --topbar-h: 56px;
}

/* ─── Topbar ──────────────────────────────────────────────────── */
.topnav {
  background: #1a1a2e;
  color: #fff;
  height: var(--topbar-h);
  display: flex;
  align-items: stretch;
  padding: 0 24px;
  gap: 4px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-md);
}
.topnav-brand {
  display: flex;
  align-items: center;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
  padding-right: 16px;
  margin-right: 8px;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}
.topnav-brand .topnav-brand-accent { color: var(--color-primary); margin-left: 6px; font-weight: 500; }
.topnav-links {
  display: flex;
  align-items: stretch;
  flex: 1;
  gap: 2px;
}
.topnav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  font-size: 13px;
  color: #c7cbd9;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.topnav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.04); }
.topnav-link.active { color: #fff; border-bottom-color: var(--color-primary); }
.topnav-link i { font-size: 12px; opacity: 0.85; }
.topnav-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--color-text-faint);
}
.topnav-right a { color: var(--color-text-faint); text-decoration: none; transition: color 0.12s; }
.topnav-right a:hover { color: #fff; }

/* ─── Toasts ──────────────────────────────────────────────────── */
#toastContainer {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: #fff;
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 12px 16px;
  min-width: 280px;
  max-width: 420px;
  font-size: 13px;
  color: var(--color-text);
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: toastSlideIn 0.22s ease-out;
}
.toast.leaving { animation: toastSlideOut 0.18s ease-in forwards; }
.toast-icon { flex: 0 0 auto; font-size: 14px; margin-top: 1px; }
.toast-body { flex: 1; line-height: 1.35; word-break: break-word; }
.toast-close { flex: 0 0 auto; background: none; border: none; color: var(--color-text-faint); cursor: pointer; font-size: 14px; padding: 0; margin-left: 4px; }
.toast-close:hover { color: var(--color-text); }
.toast.success { border-left-color: var(--color-success); }
.toast.success .toast-icon { color: var(--color-success); }
.toast.error { border-left-color: var(--color-danger); }
.toast.error .toast-icon { color: var(--color-danger); }
.toast.info { border-left-color: var(--color-primary); }
.toast.info .toast-icon { color: var(--color-primary); }
.toast.warn { border-left-color: var(--color-warning); }
.toast.warn .toast-icon { color: var(--color-warning); }
@keyframes toastSlideIn {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes toastSlideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(24px); opacity: 0; }
}

/* ─── Button-System ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.08s, box-shadow 0.12s;
  white-space: nowrap;
  line-height: 1;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn i { font-size: 11px; }

.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--color-primary-hover); }

.btn-dark { background: #1a1a2e; color: #fff; }
.btn-dark:hover:not(:disabled) { background: #2a2a4e; }

.btn-success { background: var(--color-success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #1e6823; }

.btn-ghost { background: transparent; color: var(--color-text-muted); border-color: var(--color-border); }
.btn-ghost:hover:not(:disabled) { background: #f8f9fc; color: var(--color-text); }

.btn-danger-ghost { background: transparent; color: var(--color-danger); border-color: var(--color-danger-soft); }
.btn-danger-ghost:hover:not(:disabled) { background: var(--color-danger-soft); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }

/* ═══════════════════════════════════════════════════════════════
   Mobile-First Responsive (Breakpoints: 480, 768, 1024)
   Basis = Mobile (small-phone); ab 768px Desktop-Variante.
   ═══════════════════════════════════════════════════════════════ */

/* Basis: iOS-Safe-Area + Touch-Targets */
html { -webkit-text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: transparent; }

/* Touch-Targets: alle Buttons und Form-Elemente ≥44px auf Mobile */
@media (max-width: 767px) {
  .btn { padding: 11px 16px; font-size: 14px; }
  .btn-sm { padding: 9px 14px; font-size: 13px; }
  .btn-xs { padding: 7px 12px; font-size: 12px; }

  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="search"],
  input[type="tel"],
  input[type="url"],
  select,
  textarea {
    min-height: 44px;
    font-size: 16px !important; /* verhindert iOS-Zoom beim Fokus */
    padding: 10px 12px;
  }

  /* Topbar anpassen: kompakter */
  .topnav {
    padding: 0 12px;
    height: 52px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .topnav-brand { font-size: 14px; padding-right: 10px; margin-right: 4px; }
  .topnav-brand .topnav-brand-accent { display: none; } /* Platz sparen */
  .topnav-link { padding: 0 10px; font-size: 12px; }
  .topnav-right { gap: 10px; font-size: 11px; }
  .topnav-right > *:not(:first-child):not(:last-child) { display: none; }

  /* Toasts: volle Breite unten */
  #toastContainer {
    right: 12px;
    left: 12px;
    bottom: 12px;
  }
  .toast { min-width: 0; max-width: none; }

  /* Common Utility: responsive-hide auf Mobile */
  .hide-mobile { display: none !important; }
}

/* Tablet + Desktop */
@media (min-width: 768px) {
  .show-mobile-only { display: none !important; }
}

/* Tabellen → responsive Cards auf Mobile */
@media (max-width: 767px) {
  table.responsive-cards thead { display: none; }
  table.responsive-cards, table.responsive-cards tbody,
  table.responsive-cards tr, table.responsive-cards td {
    display: block;
    width: 100%;
  }
  table.responsive-cards tr {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    padding: 12px;
    background: #fff;
  }
  table.responsive-cards td {
    border: none;
    padding: 6px 0;
    position: relative;
    padding-left: 40%;
  }
  table.responsive-cards td::before {
    content: attr(data-label);
    position: absolute;
    left: 0;
    top: 6px;
    width: 38%;
    color: var(--color-text-faint);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
  }
}
