/* ============================================================
   Hovekamp Turmdrehkrane – zentrales Design-System
   Farbwelt aus dem Firmenlogo:
   Hellblau #2AA9E1 · Blau #0F70B7 · Dunkelblau #2B2E83 · Grau #B3B2B2
   ============================================================ */

:root {
  --hb-sky:   #2AA9E1;
  --hb-blue:  #0F70B7;
  --hb-navy:  #2B2E83;
  --hb-ink:   #10151c;
  --hb-text:  #1f2937;
  --hb-muted: #6b7280;
  --hb-gray:  #b3b2b2;
  --hb-line:  #e3e7ee;
  --hb-bg:    #f4f6fa;
  --hb-card:  #ffffff;
  --hb-danger:#dc2626;
  --hb-ok:    #16a34a;
  --hb-warn:  #d97706;
  --hb-grad:  linear-gradient(90deg, var(--hb-sky), var(--hb-blue) 55%, var(--hb-navy));
  --hb-radius: 12px;
  --hb-shadow: 0 1px 2px rgba(16,21,28,.05), 0 4px 16px rgba(16,21,28,.06);
  --hb-font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--hb-bg);
  color: var(--hb-text);
  font-family: var(--hb-font);
  font-size: 15px;
  line-height: 1.5;
}

/* ---------- Typografie ---------- */
h1, h2, h3 {
  color: var(--hb-ink);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
h1 { font-size: 24px; margin: 0 0 16px; }
h2 { font-size: 19px; margin: 22px 0 12px; }
h3 { font-size: 16px; margin: 16px 0 10px; }

/* Seitenüberschriften mit Akzentbalken */
.page-title,
main.hb-content > h1:first-child,
main.hb-content > h2:first-child {
  position: relative;
  padding-left: 14px;
}
.page-title::before,
main.hb-content > h1:first-child::before,
main.hb-content > h2:first-child::before {
  content: "";
  position: absolute;
  left: 0; top: 3px; bottom: 3px;
  width: 5px;
  border-radius: 4px;
  background: var(--hb-grad);
}

a { color: var(--hb-blue); }
a:hover { color: var(--hb-navy); }

hr { border: none; border-top: 1px solid var(--hb-line); margin: 20px 0; }

/* ---------- Header / Navigation ---------- */
.hb-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid var(--hb-line);
  box-shadow: 0 1px 8px rgba(16,21,28,.05);
}
.hb-header::after {
  content: "";
  display: block;
  height: 3px;
  background: var(--hb-grad);
}
.hb-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.hb-logo { display: flex; align-items: center; text-decoration: none; }
.hb-logo img { height: 44px; width: auto; display: block; }

.hb-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  flex: 1;
}
.hb-nav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 9px;
  text-decoration: none;
  color: var(--hb-text);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background .12s ease, color .12s ease;
}
.hb-nav a:hover { background: #eef4fb; color: var(--hb-blue); }
.hb-nav a.active {
  background: linear-gradient(135deg, var(--hb-blue), var(--hb-navy));
  color: #fff;
  box-shadow: 0 2px 8px rgba(15,112,183,.35);
}

.hb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.hb-user .hb-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--hb-muted);
  background: var(--hb-bg);
  border: 1px solid var(--hb-line);
  border-radius: 999px;
  padding: 6px 12px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hb-user .hb-user-chip::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--hb-ok);
  flex: 0 0 auto;
}
.nav-logout, .hb-logout {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid var(--hb-line);
  background: #fff;
  color: var(--hb-text);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all .12s ease;
}
.nav-logout:hover, .hb-logout:hover {
  border-color: #f3b4b4;
  background: #fef2f2;
  color: var(--hb-danger);
}

/* Alte Klassen kompatibel halten */
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 9px;
  text-decoration: none;
  color: var(--hb-text);
  font-size: 14px;
  font-weight: 600;
  transition: background .12s ease, color .12s ease;
}
.nav-btn:hover { background: #eef4fb; color: var(--hb-blue); }

/* ---------- Inhalt ---------- */
.hb-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.hb-card, .card {
  background: var(--hb-card);
  border: 1px solid var(--hb-line);
  border-radius: var(--hb-radius);
  box-shadow: var(--hb-shadow);
  padding: 18px 20px;
  margin-top: 14px;
}

.hb-footer {
  border-top: 1px solid var(--hb-line);
  color: var(--hb-muted);
  font-size: 12.5px;
  text-align: center;
  padding: 18px 16px 26px;
  background: #fff;
}

/* ---------- Formulare ---------- */
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="datetime-local"],
input[type="search"], input[type="file"], input:not([type]),
select, textarea {
  padding: 9px 12px;
  border: 1px solid #cfd6e0;
  border-radius: 9px;
  font-size: 14px;
  font-family: var(--hb-font);
  color: var(--hb-text);
  background: #fff;
  transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--hb-blue);
  box-shadow: 0 0 0 3px rgba(15,112,183,.15);
}
label { font-size: 13.5px; color: var(--hb-muted); font-weight: 600; }

button, .btn {
  font-family: var(--hb-font);
  font-size: 14px;
  font-weight: 600;
  padding: 9px 15px;
  border-radius: 9px;
  border: 1px solid #cfd6e0;
  background: #fff;
  color: var(--hb-text);
  cursor: pointer;
  transition: all .12s ease;
}
button:hover, .btn:hover {
  border-color: var(--hb-blue);
  color: var(--hb-blue);
  box-shadow: 0 2px 8px rgba(15,112,183,.15);
}
button[type="submit"], .btn-primary {
  background: linear-gradient(135deg, var(--hb-blue), var(--hb-navy));
  border-color: var(--hb-blue);
  color: #fff;
}
button[type="submit"]:hover, .btn-primary:hover {
  color: #fff;
  filter: brightness(1.08);
  box-shadow: 0 3px 12px rgba(15,112,183,.35);
}
button.danger, .btn-danger {
  background: #fff;
  border-color: #f3b4b4;
  color: var(--hb-danger);
}
button.danger:hover, .btn-danger:hover {
  background: #fef2f2;
  border-color: var(--hb-danger);
  color: var(--hb-danger);
}

/* ---------- Tabellen ---------- */
table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 14px;
}
.table, table {
  background: #fff;
  border: 1px solid var(--hb-line);
  border-radius: var(--hb-radius);
  overflow: hidden;
  box-shadow: var(--hb-shadow);
  margin-top: 12px;
}
th, .table th {
  background: linear-gradient(180deg, #f7f9fc, #eef2f8);
  color: var(--hb-ink);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .03em;
  text-align: left;
  padding: 11px 12px;
  border: none;
  border-bottom: 2px solid var(--hb-line);
}
td, .table td {
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid #edf0f5;
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: none; }
.table tbody tr:nth-child(even), tbody tr:nth-child(even) { background: #fafbfd; }
.table tbody tr:hover, tbody tr:hover { background: #f0f6fc; }

.table a { text-decoration: none; color: var(--hb-blue); font-weight: 600; }
.table a:hover { text-decoration: underline; }

.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.selected {
  background: #e3f1fb !important;
  box-shadow: inset 4px 0 0 var(--hb-blue);
}
.table tbody tr.clickable:hover {
  background: #e9f3fc !important;
  box-shadow: inset 4px 0 0 var(--hb-blue) !important;
}

/* Rechnung-Markierung (global, server gespeichert) */
tr.invoice-marked { background: #c9f7c9 !important; }
tr.invoice-marked td { background: transparent; }
.invoice-checkbox { width: 18px; height: 18px; cursor: pointer; }

/* ---------- Badges / Pills ---------- */
.hb-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--hb-line);
  background: var(--hb-bg);
  color: var(--hb-muted);
}
.hb-pill.ok   { background:#dcfce7; color:#166534; border-color:#bbf7d0; }
.hb-pill.bad  { background:#fee2e2; color:#991b1b; border-color:#fecaca; }
.hb-pill.warn { background:#fef3c7; color:#92400e; border-color:#fde68a; }
.hb-pill.blue { background:#e3f1fb; color:var(--hb-blue); border-color:#bfdcf2; }

/* ---------- Auth-Seiten (Login etc.) ---------- */
.hb-auth-wrap {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}
.hb-auth-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 1px solid var(--hb-line);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(16,21,28,.10);
  padding: 34px 32px 30px;
}
.hb-auth-card .hb-auth-logo { text-align: center; margin-bottom: 8px; }
.hb-auth-card .hb-auth-logo img { height: 58px; width: auto; }
.hb-auth-card h2 { text-align: center; margin: 6px 0 22px; font-size: 20px; }
.hb-auth-card form { display: flex; flex-direction: column; gap: 14px; }
.hb-auth-card form label { display: flex; flex-direction: column; gap: 5px; }
.hb-auth-card form button[type="submit"] { margin-top: 6px; padding: 11px; font-size: 15px; }
.hb-auth-links { text-align: center; margin-top: 18px; font-size: 13.5px; }
.hb-auth-links a { text-decoration: none; font-weight: 600; }
.hb-auth-error {
  background: #fee2e2; color: #991b1b; border: 1px solid #fecaca;
  border-radius: 9px; padding: 10px 13px; font-size: 13.5px; font-weight: 600;
  margin-bottom: 14px;
}
.hb-auth-info {
  background: #e3f1fb; color: var(--hb-navy); border: 1px solid #bfdcf2;
  border-radius: 9px; padding: 10px 13px; font-size: 13.5px; font-weight: 600;
  margin-bottom: 14px;
}

/* ---------- Responsiv ---------- */
@media (max-width: 900px) {
  .hb-header-inner { padding: 10px 12px; gap: 10px; }
  .hb-logo img { height: 36px; }
  .hb-nav a { padding: 7px 10px; font-size: 13px; }
  .hb-content { padding: 16px 12px 48px; }
  .hb-user .hb-user-chip { display: none; }
}
