/* ============================================================
   Eurogate Bestellportal — Design System
   Inspiriert von Mendo-Order base.html, mit Eurogate-Brand
   ============================================================ */

:root {
  /* Eurogate brand */
  --accent-color: #134094;
  --accent-color-dark: #0E2E6B;
  --primary-color: #134094;
  --secondary-color: #F39200;

  /* Sidebar */
  --sidebar-width: 260px;

  /* Text */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  /* Backgrounds */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;

  /* Borders */
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

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

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.9375rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-primary);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-color);
}

.sidebar-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 72px;
  gap: 4px;
}

.sidebar-logo-full {
  width: 100%;
  max-width: 180px;
  height: auto;
  display: block;
  margin-bottom: 10px;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.sidebar-brand-name {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
}

.sidebar-brand-sub {
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
  overflow-y: auto;
}

.nav-section {
  padding: 0.375rem 0.75rem;
  margin-top: 0.25rem;
}

.nav-section:first-child { margin-top: 0; }

.nav-section-title {
  color: var(--text-muted);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  padding: 0.375rem 0.875rem;
  margin-bottom: 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.5625rem 0.875rem;
  margin: 1px 0;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.875rem;
  position: relative;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.nav-link i {
  font-size: 1.125rem;
  width: 28px;
  margin-right: 10px;
  text-align: center;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.nav-link:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.nav-link:hover i { color: var(--text-secondary); }

.nav-link.active {
  background: color-mix(in srgb, var(--accent-color) 8%, transparent);
  color: var(--accent-color);
}

.nav-link.active i { color: var(--accent-color); }

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent-color);
  border-radius: 0 3px 3px 0;
}

.nav-link .nav-badge {
  margin-left: auto;
  font-size: 0.6875rem;
  padding: 0.2rem 0.5rem;
  font-weight: 700;
  border-radius: 5px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.nav-link.active .nav-badge {
  background: color-mix(in srgb, var(--accent-color) 14%, transparent);
  color: var(--accent-color);
}

.nav-link .nav-badge.alert {
  background: #ef4444;
  color: #fff;
}

.sidebar-footer {
  padding: 0.875rem;
  border-top: 1px solid var(--border-color);
}

.user-info {
  display: flex;
  align-items: center;
  padding: 0.625rem 0.75rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: var(--accent-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  flex-shrink: 0;
}

.user-details { flex: 1; min-width: 0; }

.user-name {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.8125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.user-role {
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.3;
}

/* ===== MAIN ===== */
.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.875rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.page-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.02em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.topbar-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  text-decoration: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
}

.topbar-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.topbar-btn .notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid #fff;
}

main {
  flex: 1;
  padding: 1.5rem;
  background: var(--bg-secondary);
}

/* ===== CARD ===== */
.card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 600;
  padding: 1rem 1.5rem;
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.card-body { padding: 1.5rem; }

/* ===== BUTTONS ===== */
.btn {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 0.5625rem 1.125rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  border: none;
  letter-spacing: -0.01em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4375rem;
  text-decoration: none;
  line-height: 1.2;
}

.btn-primary {
  background: var(--accent-color);
  color: #fff;
}

.btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent-color) 30%, transparent);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--border-color);
}

.btn-outline {
  background: transparent;
  color: var(--accent-color);
  border: 1.5px solid var(--accent-color);
}

.btn-outline:hover {
  background: var(--accent-color);
  color: #fff;
}

.btn-light {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1.5px solid var(--border-color);
}

.btn-light:hover {
  background: var(--bg-tertiary);
}

.btn-danger {
  background: #ef4444;
  color: #fff;
}

.btn-success {
  background: #10b981;
  color: #fff;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  border-radius: var(--radius-md);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

.btn-block {
  width: 100%;
}

/* ===== BADGES ===== */
.badge {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.6875rem;
  padding: 0.3rem 0.625rem;
  border-radius: 6px;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.badge-active   { background: #d1fae5; color: #065f46; }
.badge-pending  { background: #fef3c7; color: #92400e; }
.badge-shipping { background: #dbeafe; color: #1e40af; }
.badge-warning  { background: #fef3c7; color: #92400e; }
.badge-info     { background: #e0f2fe; color: #075985; }
.badge-muted    { background: #f1f5f9; color: #64748b; }
.badge-danger   { background: #fee2e2; color: #991b1b; }

/* ===== FORM ===== */
.form-label {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
  display: block;
}

.form-control,
.form-select {
  font-family: 'DM Sans', sans-serif;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5625rem 0.875rem;
  font-size: 0.9375rem;
  color: var(--text-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  background: var(--bg-primary);
  width: 100%;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color) 10%, transparent);
  outline: none;
}

/* ===== ALERT ===== */
.alert {
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  padding: 0.875rem 1.125rem;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
}

.alert i { font-size: 1.125rem; flex-shrink: 0; margin-top: 1px; }

.alert-info    { background: #eff6ff; color: #1e40af; }
.alert-success { background: #ecfdf5; color: #065f46; }
.alert-warning { background: #fffbeb; color: #92400e; }
.alert-danger  { background: #fef2f2; color: #991b1b; }

/* ===== UTILITY ===== */
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent-color); }
.text-success { color: #10b981; }
.text-danger { color: #ef4444; }
.text-warning { color: #f59e0b; }
.fw-700 { font-weight: 700; }
.fw-600 { font-weight: 600; }

/* Page load animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

main > *:first-child { animation: fadeIn 0.35s ease; }

/* ===== Bootstrap-Icons fallback subset (load full from CDN) ===== */
.bi { display: inline-block; line-height: 1; }

/* ===== Card-Links: Bootstrap-/Browser-Defaults überschreiben ===== */
/* <a class="shop-cat-card|product-card-mini|quick-card"> dürfen nicht
   wie blaue unterstrichene Links aussehen — alle in Card-Optik */
a.shop-cat-card,
a.product-card-mini,
a.quick-card,
a.action-card,
a.bundle-card,
a.recipient-card {
    text-decoration: none !important;
    color: var(--text-primary) !important;
}
a.shop-cat-card:hover,
a.product-card-mini:hover,
a.quick-card:hover,
a.action-card:hover,
a.bundle-card:hover,
a.recipient-card:hover {
    text-decoration: none !important;
    color: var(--text-primary) !important;
}
/* Untergeordnete Elemente (Label, Description, Spec, Price) erben
   weder Underline noch Standard-Link-Farbe — bewahren aber ihre
   eigenen Color-Vars (Akzent-Color für CTA, muted für Description) */
a.shop-cat-card *,
a.product-card-mini *,
a.quick-card *,
a.action-card * {
    text-decoration: none !important;
}
