/* AuftragsManager – Compiled CSS */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* === VARIABLES === */
:root {
  --bg:           #0d1117;
  --surface:      #161b22;
  --surface-2:    #21262d;
  --border:       #30363d;
  --border-light: #3d444d;
  --primary:      #f0a500;
  --primary-dark: #c88500;
  --primary-glow: rgba(240, 165, 0, 0.15);
  --text:         #e6edf3;
  --text-muted:   #8b949e;
  --text-subtle:  #656d76;
  --success:      #3fb950;
  --warning:      #d29922;
  --danger:       #f85149;
  --info:         #388bfd;
  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
  --radius-sm:    6px;
  --radius-md:    10px;
  --radius-lg:    16px;
  --radius-xl:    24px;
  --sidebar-w:    260px;
  --header-h:     64px;
  --transition:   0.2s ease;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: #f5bc40; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }
::selection { background: var(--primary-glow); color: var(--primary); }

/* === LAYOUT === */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition);
}
.sidebar__logo {
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--header-h);
}
.logo-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.logo-text { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; }
.logo-text span { color: var(--primary); }
.sidebar__nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.sidebar__section-label {
  font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-subtle);
  padding: 8px 20px 4px;
  margin-top: 6px;
  display: block;
}
.sidebar__item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin: 1px 8px;
  color: var(--text-muted); font-size: 0.875rem; font-weight: 500;
  border-radius: var(--radius-md);
  transition: all 0.15s;
  position: relative;
}
.sidebar__item:hover { color: var(--text); background: var(--surface-2); }
.sidebar__item.active {
  color: var(--primary);
  background: var(--primary-glow);
}
.sidebar__item.active::before {
  content: '';
  position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--primary);
  border-radius: 0 999px 999px 0;
}
.nav-icon { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sidebar__badge {
  margin-left: auto;
  background: var(--primary); color: var(--bg);
  font-size: 0.65rem; font-weight: 700;
  padding: 2px 7px; border-radius: 999px;
}
.sidebar__footer { padding: 12px; border-top: 1px solid var(--border); font-size: 0.75rem; color: var(--text-subtle); text-align: center; }

.main-content { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; min-width: 0; }
.topbar {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px; gap: 12px;
  position: sticky; top: 0; z-index: 50;
}
.topbar__title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; flex: 1; }
.topbar__actions { display: flex; align-items: center; gap: 8px; }
.topbar__menu-btn { display: none; }

.page-content { flex: 1; padding: 24px; }
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); z-index: 99;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* === BUTTONS === */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 9px 16px; border-radius: var(--radius-md);
  font-size: 0.875rem; font-weight: 600;
  transition: all 0.15s; border: 1px solid transparent;
  white-space: nowrap; line-height: 1;
  text-decoration: none;
}
.btn--primary { background: var(--primary); color: var(--bg); border-color: var(--primary); }
.btn--primary:hover { background: #f5bc40; box-shadow: 0 4px 12px rgba(240,165,0,.35); transform: translateY(-1px); color: var(--bg); }
.btn--secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn--secondary:hover { background: var(--border); border-color: var(--border-light); }
.btn--ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn--ghost:hover { color: var(--text); background: var(--surface-2); }
.btn--danger { background: rgba(248,81,73,.15); color: var(--danger); border-color: rgba(248,81,73,.3); }
.btn--danger:hover { background: rgba(248,81,73,.25); border-color: var(--danger); }
.btn--success { background: rgba(63,185,80,.15); color: var(--success); border-color: rgba(63,185,80,.3); }
.btn--sm { padding: 6px 12px; font-size: 0.78rem; }
.btn--lg { padding: 12px 24px; font-size: 1rem; border-radius: var(--radius-lg); }
.btn--icon { padding: 8px; width: 36px; height: 36px; border-radius: var(--radius-md); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* === CARDS === */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color var(--transition);
}
.card:hover { border-color: var(--border-light); }
.card__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.card__title { font-family: var(--font-display); font-size: 0.95rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card__footer { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }

.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  position: relative; overflow: hidden;
  transition: all 0.25s;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--accent, var(--primary)); opacity: 0; transition: opacity .2s;
}
.stat-card:hover { border-color: var(--accent, var(--primary)); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.stat-card:hover::before { opacity: 1; }
.stat-card__icon { width: 44px; height: 44px; border-radius: var(--radius-md); background: var(--icon-bg, var(--primary-glow)); display: flex; align-items: center; justify-content: center; font-size: 1.25rem; margin-bottom: 16px; }
.stat-card__value { font-family: var(--font-display); font-size: 2rem; font-weight: 700; line-height: 1; margin-bottom: 4px; }
.stat-card__label { font-size: 0.875rem; color: var(--text-muted); }

/* === BADGES === */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge--offen          { color: #388bfd; background: rgba(56,139,253,.15); }
.badge--in_bearbeitung { color: #d29922; background: rgba(210,153,34,.15); }
.badge--abgeschlossen  { color: #3fb950; background: rgba(63,185,80,.15); }
.badge--primary        { color: var(--primary); background: var(--primary-glow); }

/* === TABLE === */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th { background: var(--surface-2); color: var(--text-subtle); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr.clickable { cursor: pointer; }

/* === FORMS === */
.form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-label { font-size: 0.875rem; font-weight: 500; color: var(--text-muted); }
.form-control {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-md); color: var(--text);
  padding: 10px 14px; font-size: 0.875rem;
  transition: all .15s; width: 100%;
}
.form-control::placeholder { color: var(--text-subtle); }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
select.form-control { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b949e' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
textarea.form-control { resize: vertical; min-height: 90px; }

/* === MODAL === */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
  z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; visibility: hidden; transition: all .25s;
}
.modal-backdrop.active { opacity: 1; visibility: visible; }
.modal-backdrop.active .modal { transform: scale(1) translateY(0); }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); width: 100%; max-width: 640px;
  max-height: 90vh; overflow-y: auto;
  transform: scale(.96) translateY(8px); transition: transform .25s;
  box-shadow: 0 8px 32px rgba(0,0,0,.6);
}
.modal__header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal__header h3 { font-size: 1.1rem; font-weight: 700; }
.modal__body { padding: 24px; }
.modal__footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.modal--lg { max-width: 860px; }
.modal--sm { max-width: 440px; }

/* === TOAST === */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 14px 18px; font-size: 0.875rem; box-shadow: 0 8px 24px rgba(0,0,0,.5);
  display: flex; align-items: center; gap: 10px;
  min-width: 260px; max-width: 380px;
  animation: slideInRight .3s ease;
}
.toast--success { border-left: 3px solid var(--success); }
.toast--error   { border-left: 3px solid var(--danger); }
.toast--warning { border-left: 3px solid var(--warning); }
.toast--info    { border-left: 3px solid var(--info); }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* === EMPTY STATE === */
.empty-state { text-align: center; padding: 64px 24px; color: var(--text-muted); }
.empty-state__icon { font-size: 3rem; margin-bottom: 16px; opacity: .5; }
.empty-state__title { font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; }
.empty-state__desc { font-size: 0.875rem; margin-bottom: 20px; }

/* === SKELETON === */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-md); }
.skeleton--text { height: 1em; margin-bottom: .5em; }
.skeleton--title { height: 1.5em; width: 60%; }
.skeleton--card { height: 120px; }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* === SEARCH BAR === */
.search-bar { position: relative; }
.search-bar .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-subtle); pointer-events: none; }
.search-bar input { padding: 8px 12px 8px 36px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text); font-size: 0.875rem; width: 220px; transition: all .2s; }
.search-bar input::placeholder { color: var(--text-subtle); }
.search-bar input:focus { outline: none; border-color: var(--primary); width: 280px; box-shadow: 0 0 0 3px var(--primary-glow); }

/* === UPLOAD === */
.upload-area { border: 2px dashed var(--border); border-radius: var(--radius-lg); padding: 40px; text-align: center; cursor: pointer; transition: all .25s; }
.upload-area:hover, .upload-area.dragover { border-color: var(--primary); background: var(--primary-glow); }
.upload-area__icon { font-size: 2.5rem; margin-bottom: 12px; }
.upload-area__text { color: var(--text-muted); font-size: 0.875rem; }
.upload-area__hint { font-size: 0.75rem; color: var(--text-subtle); margin-top: 4px; }

/* === IMAGE GRID === */
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.image-item { position: relative; aspect-ratio: 1; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border); cursor: pointer; }
.image-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.image-item:hover img { transform: scale(1.06); }
.image-item:hover .image-item__overlay { opacity: 1; }
.image-item__overlay { position: absolute; inset: 0; background: rgba(0,0,0,.65); display: flex; align-items: center; justify-content: center; gap: 8px; opacity: 0; transition: opacity .25s; }

/* === FINANCE ROWS === */
.finance-row { display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.finance-row:last-child { border-bottom: none; }
.finance-row__label { color: var(--text-muted); font-size: 0.875rem; }
.finance-row__value { font-family: var(--font-mono); font-weight: 600; text-align: right; }
.finance-row--total { margin-top: 8px; padding-top: 8px; border-top: 2px solid var(--border); }
.finance-row--total .finance-row__label { color: var(--text); font-weight: 600; }
.finance-row--total .finance-row__value { font-size: 1.2rem; color: var(--primary); }

/* === PROGRESS === */
.progress { height: 4px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress__bar { height: 100%; background: var(--primary); border-radius: 999px; transition: width .4s; }

/* === CHIPS === */
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 5px 13px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; cursor: pointer; border: 1px solid var(--border); color: var(--text-muted); background: transparent; transition: all .15s; }
.chip:hover { color: var(--text); border-color: var(--border-light); background: var(--surface-2); }
.chip.active { background: var(--primary-glow); color: var(--primary); border-color: rgba(240,165,0,.4); }

/* === PAGE LAYOUTS === */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 24px; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 360px; gap: 20px; }
.dashboard-header { margin-bottom: 24px; }
.dashboard-header h1 { font-size: 2rem; font-weight: 800; background: linear-gradient(135deg, var(--text) 30%, var(--primary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.dashboard-header p { color: var(--text-muted); margin-top: 4px; }
.finanz-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 24px; }
.chart-container { position: relative; height: 280px; }
.chart-container canvas { max-height: 280px; }
#map { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); }

/* === UTILITIES === */
.flex            { display: flex; }
.items-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.mt-md  { margin-top: 16px; }
.mt-lg  { margin-top: 24px; }
.mb-lg  { margin-bottom: 24px; }
.mb-xl  { margin-bottom: 32px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.text-muted  { color: var(--text-muted); }
.text-subtle { color: var(--text-subtle); }
.text-primary { color: var(--primary); }
.font-mono { font-family: var(--font-mono); }

/* === RESPONSIVE === */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .finanz-summary { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .topbar__menu-btn { display: flex !important; }
  .page-content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .stats-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .search-bar input { width: 160px; }
  .search-bar input:focus { width: 200px; }
}
@media (max-width: 600px) {
  .topbar__actions .filter-chips { display: none; }
  .modal { margin: 8px; }
}
