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

/* AGRAVIS Ost – Design-Tokens (tenants/agravis-ost/assets/css/styles.css :root) */
:root {
  /* Marke */
  --accent-color: #2F7A2B;        /* Primär: Buttons, aktive Zustände, Links (5.3:1 auf Weiß) */
  --accent-hover: #245F21;        /* Hover, Dashboard-Hero-Fläche */
  --accent-soft: rgba(47,122,43,0.10); /* aktive Nav, Pills */
  --brand-logo-green: #5DB847;    /* nur Logo/Illustration, NICHT für Text auf Weiß */
  --brand-logo-yellow: #E6E600;   /* nur im Logo verwenden */
  --thumb-bg: #eef6ec;            /* Icon-/Bild-Thumbnails, Info-Panels */
  --thumb-border: #d3e6cf;
  --accent-border-soft: #bcdab6;  /* sekundäre Buttons mit Akzent-Text */
  --hero-text-muted: #dcebd8;     /* Text auf --accent-hover */
  --hero-eyebrow: #cfe6c9;
  --title-color: #1a2e19;         /* Seitentitel */
  /* Neutrale */
  --text-primary: #0f172a; --text-secondary: #475569; --text-muted: #94a3b8;
  --bg-primary: #ffffff; --bg-secondary: #f6f8f3; --bg-tertiary: #f1f5f9;
  --border-color: #e2e8f0; --border-light: #f1f5f9;
  /* Status (systemweit fix) */
  --success: #059669; --success-bg: #d1fae5; --success-text: #065f46;
  --warning: #f59e0b; --warning-bg: #fef3c7; --warning-text: #92400e;
  --info-bg: #dbeafe; --info-text: #1e40af;
  --danger: #dc2626; --danger-strong: #b91c1c; --danger-bg: #fee2e2; --danger-text: #991b1b; --danger-border: #fecaca;
  --neutral-bg: #f1f5f9; --neutral-text: #64748b;
  --lease-alert-bg: #fff7ed; --lease-alert-border: #fed7aa; --lease-alert-fill: #ea580c; --lease-alert-text: #9a3412;
  /* Form */
  --radius-sm: 6px; --radius-md: 8px; --radius-box: 10px; --radius-lg: 14px; --radius-hero: 16px; --radius-modal: 18px;
  --shadow-card: 0 1px 2px rgba(20,48,18,0.04), 0 6px 20px rgba(20,48,18,0.05);
  --shadow-pop: 0 12px 32px rgba(15,23,42,0.14);
  --shadow-modal: 0 24px 64px rgba(15,23,42,0.25);
  --topbar-brandline: inset 0 3px 0 var(--accent-color);
  /* Typo: DM Sans (Google Fonts) 400/500/600/700 */
  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --fs-xs: 0.6875rem; --fs-sm: 0.75rem; --fs-body-sm: 0.8125rem; --fs-body: 0.875rem; --fs-base: 0.9375rem;
  --fs-h3: 1.0625rem; --fs-title: 1.625rem; --fs-hero: 1.75rem;
  /* Layout */
  --sidebar-width: 260px; --main-padding: 1.75rem 2rem; --breakpoint-mobile: 992px;
}

/* Kompatibilitäts-Aliase für die von Eurogate übernommenen Komponenten.
   Radien bleiben laut Handoff identisch zu Eurogate (8/10/14) – die Token-Werte
   6/8/14 aus design-tokens.css gelten nur für neue AGRAVIS-Bausteine (--radius-box/-hero/-modal). */
:root {
  --accent-color-dark: var(--accent-hover);
  --primary-color: var(--accent-color);
  --secondary-color: var(--brand-logo-green);
  --radius-sm: 8px; --radius-md: 10px; --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(20,48,18,0.04);
  --shadow-md: 0 4px 12px rgba(20,48,18,0.06);
  --shadow-lg: 0 8px 24px rgba(20,48,18,0.08);
}

* {
  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;
}

/* ===== Responsive: Sidebar als Off-Canvas auf schmalen Bildschirmen ===== */
.sidebar { transition: transform 0.3s ease; }

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
    margin-right: 0.75rem;
    padding: 0.25rem;
    border-radius: 6px;
}
.sidebar-toggle:hover { color: var(--accent-color); }

.topbar-left { display: flex; align-items: center; min-width: 0; }
.topbar-left .page-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    z-index: 999;
}

@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); box-shadow: 0 0 40px rgba(0, 0, 0, 0.2); }
    .sidebar-overlay.show { display: block; }
    .main-wrapper { margin-left: 0 !important; }
    .sidebar-toggle { display: inline-flex; align-items: center; }
}

@media (max-width: 576px) {
    main { padding: 1rem !important; }
    .topbar { padding: 0.75rem 1rem !important; }
    .dual-grid { grid-template-columns: 1fr !important; }
}

/* Checkout-Formular-Zeilen: 2-spaltig, auf Handy 1-spaltig (Felder sonst zu schmal) */
.recipient-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0.625rem; }
.checkout-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.875rem; padding: 0.75rem 0 0 3rem; }
@media (max-width: 768px) {
    .recipient-fields { grid-template-columns: 1fr; }
    .checkout-form-grid { grid-template-columns: 1fr; padding-left: 0; }
}
