:root {
  --paper: #f4f6f4;
  --surface: #ffffff;
  --surface-2: #fbfcfb;
  --ink: #1b2320;
  --muted: #67716d;
  --line: #e2e6e1;
  --petrol: #0e6e63;
  --petrol-dark: #0a5249;
  --petrol-soft: #e4f0ee;
  --amber: #b9791f;
  --amber-soft: #f6ecda;
  --blue: #2b5a8c;
  --red: #a23b34;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(27, 35, 32, .05), 0 8px 24px rgba(27, 35, 32, .06);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }
a { color: var(--petrol); }

.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

/* Sidebar */
.sidebar {
  background: var(--ink);
  color: #d9ded9;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: baseline; gap: 8px; margin-bottom: 24px; padding: 0 8px; }
.brand .mark {
  font-weight: 700; letter-spacing: -.02em; font-size: 17px; color: #fff;
}
.brand .mark em { color: var(--petrol); font-style: normal; }
.brand .sub { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #7f8a85; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px; color: #c3cac5;
  background: none; border: 0; width: 100%; text-align: left; font-size: 14px;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--petrol); color: #fff; }
.nav-item .ico { width: 8px; height: 8px; border-radius: 2px; background: currentColor; opacity: .55; }
.nav-item.active .ico { opacity: 1; }
.side-foot { margin-top: auto; font-size: 11px; color: #6d7772; padding: 0 8px; }
.side-foot button { background:none;border:0;color:#8f9a94;font-size:11px;padding:0;text-decoration:underline;}

/* Main */
.main { padding: 26px 32px 60px; max-width: 1120px; }
.view-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 16px; flex-wrap: wrap; }
.view-head h1 { font-size: 22px; letter-spacing: -.01em; margin: 0; }
.view-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

.btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 500;
}
.btn:hover { border-color: #cfd5cf; }
.btn.primary { background: var(--petrol); border-color: var(--petrol); color: #fff; }
.btn.primary:hover { background: var(--petrol-dark); }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.sm { padding: 5px 10px; font-size: 13px; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.grid { display: grid; gap: 14px; }

/* Cockpit gauges */
.gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 22px; }
.gauge { padding: 16px; }
.gauge .num { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.gauge .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-top: 8px; }
.gauge .bar { height: 3px; border-radius: 2px; background: var(--line); margin-top: 12px; overflow: hidden; }
.gauge .bar i { display: block; height: 100%; background: var(--petrol); }

/* Job list */
.filters { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.filters input[type=text] { flex: 1; min-width: 180px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
select { padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: var(--surface); }

.joblist { display: flex; flex-direction: column; }
.jobrow {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.jobrow:last-child { border-bottom: 0; }
.jobrow:hover { background: var(--surface-2); }
.jobrow .title { font-weight: 600; }
.jobrow .meta { grid-column: 1; color: var(--muted); font-size: 13px; }
.jobrow .right { grid-row: 1 / span 2; display: flex; align-items: center; gap: 10px; }
.star { background: none; border: 0; font-size: 16px; color: var(--line); }
.star.on { color: var(--amber); }

.pill { font-size: 11px; padding: 3px 9px; border-radius: 20px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.pill.neu { background: #eef0ee; color: #5a635f; }
.pill.interessant { background: var(--petrol-soft); color: var(--petrol-dark); }
.pill.beworben { background: #e6eef6; color: var(--blue); }
.pill.gespraech { background: var(--amber-soft); color: var(--amber); }
.pill.absage { background: #f4e6e5; color: var(--red); }
.pill.angebot { background: #e3f2e8; color: #1f7a42; }
.pill.source { background: #f0f1ef; color: var(--muted); font-weight: 500; }

/* Drawer */
.drawer-bg { position: fixed; inset: 0; background: rgba(27,35,32,.34); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40; }
.drawer-bg.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: min(680px, 96vw);
  background: var(--surface); box-shadow: -8px 0 30px rgba(27,35,32,.14);
  transform: translateX(100%); transition: transform .24s ease; z-index: 50;
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer header { padding: 20px 24px; border-bottom: 1px solid var(--line); }
.drawer header h2 { margin: 0 0 4px; font-size: 19px; }
.drawer header .emp { color: var(--muted); }
.drawer .body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.drawer .close { position: absolute; top: 16px; right: 18px; background: none; border: 0; font-size: 22px; color: var(--muted); }
.section-t { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 22px 0 8px; }
.desc { white-space: pre-wrap; font-size: 14px; color: #333c38; max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: var(--surface-2); }
textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-family: inherit; font-size: 14px; resize: vertical; }
.status-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 4px; }
.status-row button { border: 1px solid var(--line); background: var(--surface); border-radius: 20px; padding: 5px 12px; font-size: 13px; }
.status-row button.active { border-color: var(--petrol); background: var(--petrol-soft); color: var(--petrol-dark); font-weight: 600; }
.gen-out { white-space: pre-wrap; font-size: 14px; border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: var(--surface-2); margin-top: 10px; }

/* Forms / lists */
.row-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.row-item:last-child { border-bottom: 0; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.field input, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font-size: 14px; font-family: inherit; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.muted { color: var(--muted); font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 48px 20px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px; z-index: 60; opacity: 0; transition: opacity .2s; }
.toast.show { opacity: 1; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; }
.btn:not(.primary) .spinner { border-color: rgba(27,35,32,.25); border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .brand { width: 100%; margin-bottom: 8px; }
  .side-foot { display: none; }
  .main { padding: 20px 16px 60px; }
  .form-grid { grid-template-columns: 1fr; }
}
