/* Volteo Vertrieb – Style */
:root {
  --gruen: #16a34a;
  --gruen-d: #15803d;
  --gruen-l: #f0fdf4;
  --grau: #6b7280;
  --grau-l: #f9fafb;
  --border: #e5e7eb;
  --sidebar-w: 220px;
  --danger: #dc2626;
  --warn: #d97706;
  --info: #2563eb;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; font-size: 14px; background: #f3f4f6; color: #111827; }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: #111827; color: #fff; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; height: 100vh; z-index: 100; overflow-y: auto; }
.main { margin-left: var(--sidebar-w); flex: 1; padding: 28px; max-width: 1100px; }

/* Sidebar */
.sidebar-logo { padding: 20px 16px 12px; border-bottom: 1px solid #1f2937; }
.logo-volt { color: #16a34a; font-size: 22px; font-weight: 900; letter-spacing: -1px; }
.logo-eo   { color: #fff;    font-size: 22px; font-weight: 900; }
.logo-sub  { color: #4ade80; font-size: 10px; letter-spacing: 2px; margin-top: 2px; }
.sidebar-user { padding: 12px 16px; border-bottom: 1px solid #1f2937; }
.sidebar-user .name { font-weight: 700; font-size: 13px; }
.sidebar-user .role { font-size: 11px; color: #9ca3af; }
.sidebar-nav { flex: 1; padding: 8px 0; }
.nav-section { font-size: 10px; color: #4b5563; text-transform: uppercase; letter-spacing: 1px; padding: 12px 16px 4px; }
.nav-a { display: flex; align-items: center; gap: 10px; padding: 9px 16px; color: #d1d5db; text-decoration: none; font-size: 13px; font-weight: 500; transition: .15s; }
.nav-a:hover, .nav-a.active { background: #1f2937; color: #fff; }
.nav-a.active { border-left: 3px solid #16a34a; }
.nav-icon { font-size: 15px; width: 20px; text-align: center; }
.sidebar-footer { padding: 12px 16px; border-top: 1px solid #1f2937; }
.btn-logout { width: 100%; padding: 8px; background: #1f2937; color: #9ca3af; border: none; border-radius: 6px; cursor: pointer; font-size: 12px; }
.btn-logout:hover { color: #fff; }

/* Notification Badge */
.notif-badge { background: #ef4444; color: #fff; border-radius: 9999px; font-size: 10px; padding: 1px 6px; margin-left: auto; }

/* Cards */
.card { background: #fff; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.08); padding: 24px; margin-bottom: 20px; }
.card h3 { font-size: 14px; font-weight: 700; color: #374151; margin-bottom: 16px; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(160px,1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.stat-val  { font-size: 28px; font-weight: 800; color: #111827; }
.stat-lbl  { font-size: 12px; color: #6b7280; margin-top: 4px; }
.stat-card.gruen .stat-val { color: #16a34a; }
.stat-card.warn  .stat-val { color: #d97706; }

/* Page Header */
.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-title { font-size: 1.4rem; font-weight: 800; }
.page-sub   { font-size: 13px; color: #6b7280; margin-top: 2px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: .15s; }
.btn-primary { background: #16a34a; color: #fff; }
.btn-primary:hover { background: #15803d; }
.btn-secondary { background: #f3f4f6; color: #374151; border: 1px solid #e5e7eb; }
.btn-secondary:hover { background: #e5e7eb; }
.btn-danger { background: #fee2e2; color: #dc2626; }
.btn-danger:hover { background: #fecaca; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Form */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid.cols3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid.cols1 { grid-template-columns: 1fr; }
.fg { display: flex; flex-direction: column; gap: 5px; }
.fg label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: #555; }
.fg input, .fg select, .fg textarea { padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px; font-family: inherit; }
.fg input:focus, .fg select:focus { outline: none; border-color: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.1); }
.fg textarea { resize: vertical; min-height: 80px; }
.fg .hint { font-size: 11px; color: #9ca3af; }

/* Toggle Buttons */
.toggle-row { display: flex; gap: 8px; flex-wrap: wrap; }
.toggle-btn { padding: 7px 16px; border: 1px solid #d1d5db; border-radius: 20px; background: #fff; cursor: pointer; font-size: 13px; font-weight: 500; transition: .15s; }
.toggle-btn.active { background: #16a34a; color: #fff; border-color: #16a34a; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 10px 12px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: #6b7280; border-bottom: 2px solid #e5e7eb; white-space: nowrap; }
td { padding: 12px 12px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
tr:hover td { background: #f9fafb; }

/* Status Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 9999px; font-size: 11px; font-weight: 700; }
.badge-neu         { background: #dbeafe; color: #1d4ed8; }
.badge-eingereicht { background: #fef9c3; color: #854d0e; }
.badge-belieferung { background: #d1fae5; color: #065f46; }
.badge-abgerechnet { background: #ede9fe; color: #5b21b6; }
.badge-storniert   { background: #fee2e2; color: #991b1b; }
.badge-ausstehend  { background: #fef3c7; color: #92400e; }
.badge-ausgezahlt  { background: #d1fae5; color: #065f46; }

/* Provision Preview */
.prov-box { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px; padding: 16px; }
.prov-box .prov-brutto { font-size: 13px; color: #555; }
.prov-box .prov-vp { font-size: 28px; font-weight: 800; color: #16a34a; }
.prov-box .prov-label { font-size: 11px; color: #6b7280; }

/* Autocomplete Dropdown */
.ac-wrap { position: relative; }
.ac-dd { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid #d1d5db; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 300; max-height: 220px; overflow-y: auto; }
.ac-item { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid #f3f4f6; }
.ac-item:hover { background: #f0fdf4; }
.ac-item .ac-name { font-weight: 600; }
.ac-item .ac-meta { font-size: 12px; color: #6b7280; }

/* Modal */
.modal-bg { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 500; align-items: center; justify-content: center; }
.modal-bg.open { display: flex; }
.modal { background: #fff; border-radius: 14px; padding: 28px; width: 90%; max-width: 600px; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: #9ca3af; padding: 4px; }

/* Signature Canvas */
.sig-wrap { border: 2px dashed #d1d5db; border-radius: 10px; background: #fafafa; position: relative; }
.sig-wrap canvas { display: block; width: 100%; touch-action: none; }
.sig-clear { position: absolute; top: 8px; right: 8px; background: #fff; border: 1px solid #d1d5db; border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; }

/* Toast */
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); padding: 12px 24px; border-radius: 12px; font-size: 14px; font-weight: 600; z-index: 9999; box-shadow: 0 4px 20px rgba(0,0,0,.2); transition: opacity .3s; pointer-events: none; opacity: 0; color: #fff; }

/* Anbieter Chips */
.anbieter-chip { display: inline-block; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 700; color: #fff; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .3s; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .hamburger { display: flex !important; }
}
.hamburger { display: none; position: fixed; top: 12px; left: 12px; z-index: 200; background: #111827; color: #fff; border: none; border-radius: 8px; padding: 8px 12px; font-size: 18px; cursor: pointer; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 90; }
.sidebar-overlay.open { display: block; }
