/* ═══════════════════════════════════════════════════════════════════════
   NetDoc – Design System v3  |  Plandent Branding
   CSS Custom Properties zentral definiert in :root / [data-theme="dark"]
   ═══════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Reset ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ══════════════════════════════════════════════════════════════════════
   DESIGN TOKENS – Light Mode
   ══════════════════════════════════════════════════════════════════════ */
:root {
  /* Plandent Brand Palette */
  --brand-900:   #1A5C3A;
  --brand-700:   #2D8659;
  --brand-500:   #3D9E6E;
  --brand-400:   #4CAF50;
  --brand-200:   #A8D5B8;
  --brand-50:    #EBF7F1;

  /* Semantic */
  --primary:     var(--brand-700);
  --primary-hover: var(--brand-900);
  --success:     #16a34a;
  --danger:      #dc2626;
  --danger-hover:#b91c1c;
  --warning:     #d97706;
  --info:        #2563eb;

  /* Surfaces */
  --bg:          #f0f7f3;
  --surface:     #ffffff;
  --surface-2:   #f8fdf9;
  --surface-3:   #f1f9f4;

  /* Text */
  --text-primary:  #111827;
  --text-secondary:#374151;
  --text-muted:    #6B7280;
  --text-disabled: #9CA3AF;

  /* Borders */
  --border:      #D1E8DC;
  --border-focus:#4CAF50;

  /* Shadows */
  --shadow-xs:   0 1px 2px rgba(0,0,0,.05);
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:   0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
  --shadow-lg:   0 10px 25px rgba(0,0,0,.1), 0 4px 10px rgba(0,0,0,.06);
  --shadow-xl:   0 20px 40px rgba(0,0,0,.14);

  /* Radii */
  --r-sm:  4px;
  --r-md:  8px;
  --r-lg:  12px;
  --r-xl:  16px;
  --r-full:9999px;

  /* Spacing scale */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px;
  --sp-4: 16px; --sp-5: 20px; --sp-6: 24px;
  --sp-8: 32px; --sp-10:40px; --sp-12:48px;

  /* Nav */
  --nav-h: 60px;

  /* Typography */
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-size-base: 14px;
  --font-size-sm:   12px;
  --font-size-lg:   16px;

  /* Transitions */
  --t-fast: 120ms ease;
  --t-mid:  200ms ease;
  --t-slow: 300ms ease;
}

/* ══════════════════════════════════════════════════════════════════════
   DARK MODE
   ══════════════════════════════════════════════════════════════════════ */
[data-theme="dark"] {
  --brand-900:   #1a5c3a;   /* Header/Footer/TableHeader in dark mode */
  --brand-700:   #4CAF50;
  --brand-500:   #66BB6A;
  --brand-400:   #81C784;
  --brand-200:   #2D6B45;
  --brand-50:    #1a2e22;

  --primary:     #4CAF50;
  --primary-hover:#66BB6A;

  --bg:          #0d1f14;
  --surface:     #1a2e1f;
  --surface-2:   #1f3828;
  --surface-3:   #243d2d;

  --text-primary:  #F0FDF4;
  --text-secondary:#D1FAE5;
  --text-muted:    #86EFAC;
  --text-disabled: #4B7A5E;

  --border:      #2D4A38;
  --border-focus:#4CAF50;

  --shadow-xs:   0 1px 2px rgba(0,0,0,.3);
  --shadow-sm:   0 1px 3px rgba(0,0,0,.4);
  --shadow-md:   0 4px 6px rgba(0,0,0,.4);
  --shadow-lg:   0 10px 25px rgba(0,0,0,.5);
}

/* Font size variants */
.font-size-small  { --font-size-base: 13px; }
.font-size-normal { --font-size-base: 14px; }
.font-size-large  { --font-size-base: 16px; }

/* Font family variants */
.font-system     { --font: system-ui, -apple-system, sans-serif; }
.font-inter      { --font: 'Inter', sans-serif; }
.font-roboto     { --font: 'Roboto', sans-serif; }
.font-opensans   { --font: 'Open Sans', sans-serif; }
.font-lato       { --font: 'Lato', sans-serif; }
.font-montserrat { --font: 'Montserrat', sans-serif; }

/* ── Base ─────────────────────────────────────────────────────────────── */
html { font-size: var(--font-size-base); scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  transition: background var(--t-mid), color var(--t-mid);
}
a { color: var(--primary); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--primary-hover); }
code {
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: .85em;
  background: var(--surface-3);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
}

/* ══════════════════════════════════════════════════════════════════════
   NAV
   ══════════════════════════════════════════════════════════════════════ */
.navbar {
  height: var(--nav-h);
  background: var(--brand-900);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-6);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 1px 0 rgba(255,255,255,.06), var(--shadow-md);
}

.nav-left  { display: flex; align-items: center; flex: 1; gap: 0; }
.nav-right { display: flex; align-items: center; gap: var(--sp-3); flex-shrink: 0; }

.nav-brand {
  display: flex; align-items: center; gap: var(--sp-2);
  text-decoration: none; margin-right: var(--sp-6); flex-shrink: 0;
}
.nav-logo { height: 34px; width: auto; object-fit: contain; border-radius: var(--r-sm); }

.nav-links { display: flex; gap: 2px; align-items: center; }
.nav-link {
  color: rgba(255,255,255,.75);
  padding: 6px 12px;
  border-radius: var(--r-md);
  font-size: .875rem;
  font-weight: 500;
  transition: background var(--t-fast), color var(--t-fast);
}
.nav-link:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-link.active { background: rgba(255,255,255,.15); color: #fff; }

/* Theme toggle */
.theme-toggle {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--r-full);
  padding: 5px 10px;
  cursor: pointer;
  color: rgba(255,255,255,.85);
  font-size: .8rem;
  display: flex; align-items: center; gap: 4px;
  transition: background var(--t-fast);
}
.theme-toggle:hover { background: rgba(255,255,255,.2); }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: inline; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: inline; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.nav-username {
  color: rgba(255,255,255,.8);
  font-size: .85rem;
  font-weight: 500;
  display: flex; align-items: center; gap: 6px;
}

.btn-logout {
  background: var(--danger);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: var(--r-md);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t-fast), transform var(--t-fast);
  font-family: var(--font);
}
.btn-logout:hover { background: var(--danger-hover); transform: translateY(-1px); }

.nav-hamburger {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: 4px; color: white; margin-left: var(--sp-2);
}
.nav-mobile-menu {
  display: none;
  position: absolute; top: var(--nav-h); left: 0; right: 0;
  background: var(--brand-900);
  padding: var(--sp-3) var(--sp-4);
  flex-direction: column; gap: 2px;
  box-shadow: var(--shadow-lg); z-index: 199;
  border-top: 1px solid rgba(255,255,255,.08);
}
.nav-mobile-menu.open { display: flex; }

/* ── Layout ────────────────────────────────────────────────────────────── */
.main-container {
  flex: 1; max-width: 1440px; width: 100%;
  margin: 0 auto; padding: var(--sp-6) var(--sp-6) var(--sp-10);
}
.footer {
  background: var(--brand-900);
  color: rgba(255,255,255,.9);   /* Footer text white */
  text-align: center;
  padding: var(--sp-4) var(--sp-4);
  font-size: .8rem;
}

/* ── Page Header ──────────────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap;
  gap: var(--sp-3); margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border);
}
.page-header-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.page-title {
  font-size: 1.5rem; font-weight: 700;
  color: var(--text-primary); letter-spacing: -.02em;
}

/* ── Cards ────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-6);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--sp-4);
  transition: background var(--t-mid), border-color var(--t-mid), box-shadow var(--t-mid);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-title {
  font-size: 1rem; font-weight: 600;
  color: var(--primary); margin-bottom: var(--sp-4);
  display: flex; align-items: center; gap: var(--sp-2);
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px;
  border-radius: var(--r-md);
  font-size: .875rem; font-weight: 500;
  font-family: var(--font);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
  text-decoration: none; white-space: nowrap; line-height: 1.4;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }

.btn-primary   { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-secondary { background: var(--brand-500); color: #fff; border-color: var(--brand-500); }
.btn-secondary:hover { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.btn-success   { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #15803d; color: #fff; }
.btn-danger    { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-hover); color: #fff; }
.btn-outline   { background: transparent; color: var(--primary); border-color: var(--border); }
.btn-outline:hover { background: var(--brand-50); border-color: var(--brand-400); }
.btn-sm        { padding: 4px 10px; font-size: .8rem; }
.btn-block     { width: 100%; justify-content: center; }
.btn:disabled  { opacity: .45; cursor: not-allowed; transform: none; }

/* ── Forms ────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: var(--sp-4); }
.form-group label {
  display: block; font-size: .8rem; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 6px; letter-spacing: .01em;
}
.form-control {
  width: 100%; padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-family: var(--font); font-size: .9rem;
  color: var(--text-primary); background: var(--surface);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-mid);
}
.form-control:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(76,175,80,.15);
}
.form-control::placeholder { color: var(--text-disabled); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-control-inline {
  padding: 4px 8px; border: 1.5px solid var(--border); border-radius: var(--r-sm);
  font-size: .82rem; font-family: var(--font); background: var(--surface);
  color: var(--text-primary); cursor: pointer;
  transition: border-color var(--t-fast);
}
.form-control-inline:focus { outline: none; border-color: var(--brand-400); }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--sp-4); }
.form-actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-5); }
.required { color: var(--danger); }

/* ── Tables ───────────────────────────────────────────────────────────── */
.table-wrapper { padding: 0; overflow-x: auto; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.data-table thead th {
  background: var(--brand-900);
  color: rgba(255,255,255,.92);
  padding: 10px 14px; text-align: left;
  font-weight: 600; font-size: .78rem;
  letter-spacing: .04em; text-transform: uppercase;
  white-space: nowrap;
}
.data-table thead th:first-child { border-radius: var(--r-md) 0 0 0; }
.data-table thead th:last-child  { border-radius: 0 var(--r-md) 0 0; }
.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--t-fast);
}
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--brand-50); }
.data-table tbody tr.row-inactive { opacity: .5; }
.data-table td { padding: 10px 14px; vertical-align: middle; color: var(--text-secondary); }
.data-table td:first-child { color: var(--text-primary); font-weight: 500; }
.data-table tbody tr:nth-child(even) { background: var(--surface-2); }
.data-table tbody tr:nth-child(even):hover { background: var(--brand-50); }
.action-col { text-align: right; white-space: nowrap; }
.table-footer-note {
  font-size: .78rem; color: var(--text-muted);
  padding: var(--sp-3) 14px; border-top: 1px solid var(--border);
}

/* ── Tabs ─────────────────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 2px; flex-wrap: wrap;
  border-bottom: 2px solid var(--border); margin-bottom: var(--sp-5);
}
.tab-btn {
  padding: 8px 16px; border: none; background: transparent;
  font-size: .875rem; font-family: var(--font); cursor: pointer;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: color var(--t-fast), border-color var(--t-fast);
  border-radius: var(--r-sm) var(--r-sm) 0 0;
}
.tab-btn:hover { color: var(--primary); background: var(--brand-50); }
.tab-btn.active { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Section Header ────────────────────────────────────────────────────── */
.section-header {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: var(--sp-3);
}
.section-header h2 {
  font-size: 1rem; font-weight: 600; color: var(--primary);
}

/* ── Empty State ────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; color: var(--text-muted); font-style: italic;
  padding: var(--sp-8); background: var(--surface-2);
  border: 1.5px dashed var(--border); border-radius: var(--r-lg);
}

/* ── Info Grid (Kunden-Detail) ──────────────────────────────────────────── */
.info-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp-3) var(--sp-6); padding: var(--sp-4) var(--sp-5);
}
.info-grid > div { display: flex; flex-direction: column; gap: 3px; }
.info-full { grid-column: 1 / -1; }
.info-label {
  font-size: .7rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .06em;
}

/* ── Search ─────────────────────────────────────────────────────────────── */
.search-bar-wrapper { padding: var(--sp-4) var(--sp-5); }
.search-form { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.search-input { flex: 1; max-width: 500px; }

/* ── Alerts ─────────────────────────────────────────────────────────────── */
.alert {
  padding: 10px 16px; border-radius: var(--r-md);
  margin-bottom: var(--sp-3); font-size: .875rem;
  display: flex; align-items: center; gap: var(--sp-2);
  border-left: 4px solid;
}
.alert-success { background: #d1fae5; border-color: #059669; color: #065f46; }
.alert-error   { background: #fee2e2; border-color: var(--danger); color: #991b1b; }
[data-theme="dark"] .alert-success { background: #0f3a20; color: #6ee7b7; }
[data-theme="dark"] .alert-error   { background: #3a0f0f; color: #fca5a5; }

/* ── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: var(--r-full);
  font-size: .72rem; font-weight: 600; letter-spacing: .02em;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-muted   { background: var(--surface-3); color: var(--text-muted); }
.badge-info    { background: #dbeafe; color: #1e40af; }
.role-badge    { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--r-full); font-size: .7rem; font-weight: 700; }
.role-admin       { background: #fef3c7; color: #92400e; }
.role-technician  { background: var(--brand-50); color: var(--brand-900); }
[data-theme="dark"] .badge-success  { background: #064e2a; color: #6ee7b7; }
[data-theme="dark"] .role-admin     { background: #3d2800; color: #fbbf24; }
[data-theme="dark"] .role-technician{ background: var(--brand-50); color: var(--brand-400); }

/* ── Modals ─────────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); backdrop-filter: blur(4px);
  z-index: 500; align-items: flex-start; justify-content: center;
  padding: var(--sp-8) var(--sp-4) var(--sp-4); overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--shadow-xl);
  width: 100%; max-width: 680px;
  display: flex; flex-direction: column;
  animation: modalIn .18s ease;
}
@keyframes modalIn {
  from { transform: translateY(-12px) scale(.98); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--sp-4) var(--sp-5) var(--sp-3);
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1rem; font-weight: 600; color: var(--primary); }
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 1.1rem; color: var(--text-muted); padding: 4px;
  border-radius: var(--r-sm); transition: color var(--t-fast), background var(--t-fast);
}
.modal-close:hover { color: var(--danger); background: #fee2e2; }
.modal-body { padding: var(--sp-5); }
.modal-footer {
  display: flex; gap: var(--sp-2); padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--border);
  background: var(--surface-2); border-radius: 0 0 var(--r-xl) var(--r-xl);
}

/* ═══════════════════════════════════════════════════════════════════════
   LOGIN PAGE  –  Modernes, zentriertes Design mit logo2.png
   ═══════════════════════════════════════════════════════════════════════ */
.login-body {
  background: linear-gradient(135deg, #0d2e1a 0%, #1a5c3a 45%, #2d8659 100%);
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: var(--sp-4);
  position: relative; overflow: hidden;
}
/* Decorative blobs */
.login-body::before, .login-body::after {
  content: '';
  position: absolute; border-radius: 50%;
  background: rgba(76,175,80,.08);
}
.login-body::before { width: 600px; height: 600px; top: -200px; right: -200px; }
.login-body::after  { width: 400px; height: 400px; bottom: -150px; left: -150px; }

.login-wrapper { width: 100%; max-width: 420px; position: relative; z-index: 1; }
.login-card {
  background: rgba(255,255,255,.97);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,.1);
  padding: var(--sp-8) var(--sp-8) var(--sp-10);
  animation: fadeUp .35s ease;
}
@keyframes fadeUp {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
[data-theme="dark"] .login-card {
  background: rgba(26,46,32,.97);
  box-shadow: var(--shadow-xl);
}
.login-header { text-align: center; margin-bottom: var(--sp-8); }
.login-logo   { max-height: 60px; max-width: 220px; object-fit: contain; margin-bottom: var(--sp-4); }
.login-title  { font-size: 1.75rem; font-weight: 800; color: var(--primary); letter-spacing: -.03em; }
.login-subtitle {
  color: var(--text-muted); font-size: .875rem; margin-top: var(--sp-1);
}
.login-form {
  display: flex; flex-direction: column; gap: var(--sp-4);
}
.login-form .form-control { padding: 11px 14px; font-size: .95rem; }
.login-form .btn-primary {
  padding: 12px; font-size: 1rem; font-weight: 600;
  margin-top: var(--sp-2); letter-spacing: .01em;
}

/* ── Font + Size settings (Admin) ────────────────────────────────────── */
.font-option-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: var(--sp-3); margin-top: var(--sp-2);
}
.font-option, .size-option {
  border: 2px solid var(--border); border-radius: var(--r-md);
  padding: var(--sp-3); cursor: pointer; text-align: center;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
  user-select: none;
}
.font-option:hover, .size-option:hover {
  border-color: var(--brand-400); background: var(--brand-50); transform: translateY(-1px);
}
.font-option.selected, .size-option.selected {
  border-color: var(--primary); background: var(--brand-50);
  box-shadow: 0 0 0 3px rgba(76,175,80,.15);
}
.font-option input[type="radio"], .size-option input[type="radio"] { display: none; }
.font-preview { font-size: 1.2rem; font-weight: 700; color: var(--primary); }
.font-name    { font-size: .72rem; color: var(--text-muted); margin-top: 3px; }
.size-option-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--sp-3); margin-top: var(--sp-2); }
.logo-preview { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-4); display: inline-block; }
.logo-preview img { max-height: 64px; max-width: 240px; object-fit: contain; }
.divider { border: none; border-top: 1px solid var(--border); margin: var(--sp-5) 0; }

/* ── Helpers ─────────────────────────────────────────────────────────── */
.text-muted  { color: var(--text-muted); }
.text-center { text-align: center; }


/* ── Dark Mode: Explicit overrides for #1a5c3a elements ────────────────────── */
[data-theme="dark"] .navbar           { background: #1a5c3a; }
[data-theme="dark"] .footer           { background: #1a5c3a; color: #ffffff; }
[data-theme="dark"] .data-table thead th { background: #1a5c3a; }
[data-theme="dark"] .nav-mobile-menu  { background: #1a5c3a; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; align-items: center; }
  .main-container { padding: var(--sp-4); }
}
@media (max-width: 640px) {
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .data-table { font-size: .8rem; }
  .tabs { gap: 1px; }
  .tab-btn { padding: 7px 10px; font-size: .8rem; }
  .nav-right .nav-username { display: none; }
  .login-card { padding: var(--sp-6); }
  .page-title { font-size: 1.25rem; }
}


/* ══════════════════════════════════════════════════════════════════════════════
   SORTIERBARE ABSCHNITTE (PDF-Reihenfolge)
   ══════════════════════════════════════════════════════════════════════════════ */
.sortable-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 1rem 0;
}

.sortable-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 5px;
  background: var(--card-bg);
  cursor: default;
  user-select: none;
  transition: background 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.sortable-item.dragging {
  opacity: 0.35;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.sortable-item.drag-over {
  background: #e8f5ee;
  box-shadow: 0 0 0 2px #2D8659;
}

[data-theme="dark"] .sortable-item.drag-over {
  background: #1a4a30;
}

.drag-handle {
  color: #bbb;
  cursor: grab;
  font-size: 1.2rem;
  padding: 0 4px;
  line-height: 1;
}
.drag-handle:active { cursor: grabbing; }

.sortable-label {
  flex: 1;
  font-weight: 500;
  font-size: 0.95rem;
}

.sortable-controls {
  display: flex;
  gap: 4px;
}

.sortable-controls .btn {
  padding: 3px 8px;
  font-size: 0.75rem;
  line-height: 1;
}

.sort-save-hint {
  color: var(--success, #2D8659);
  font-size: 0.82rem;
  margin-left: 0.75rem;
  font-weight: 500;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-2px); }
  to   { opacity: 1; transform: translateY(0); }
}
