/* Connect2 Management-Portal v2 — behutsam modernisierte Fassung des Alt-Designs */
:root {
  --sidebar-bg: #14181b;
  --sidebar-active: #232a2e;
  --sidebar-text: #d7dee2;
  --accent: #2f6f7e;
  --accent-soft: #eaf3f5;
  --bg: #f2f4f5;
  --card: #ffffff;
  --text: #1f2528;
  --muted: #6b7780;
  --border: #dde3e6;
  --danger: #b3372f;
  --ok: #2e7d4f;
  --warn: #a06a00;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 25, 30, 0.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; text-decoration: none; }
.sidebar .brand img { max-width: 150px; height: auto; }
.menu-title { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: #8a969d; margin: 4px 8px 10px; }
.nav-links { list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block;
  padding: 9px 12px;
  margin-bottom: 2px;
  border-radius: 8px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-weight: 500;
}
.nav-links a:hover { background: rgba(255, 255, 255, 0.06); }
.nav-links a.active { background: var(--sidebar-active); color: #fff; }
.sidebar-bottom { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.08); font-size: 13px; }
.sidebar-bottom .user-name { font-weight: 600; color: #fff; }
.sidebar-bottom .user-role { color: #8a969d; margin-bottom: 8px; }
.sidebar-bottom a { color: #9fb6bd; text-decoration: none; display: inline-block; margin-top: 6px; }
.sidebar-bottom a:hover { color: #fff; }
.version-note { color: #5f6a70; font-size: 11px; margin-top: 10px; }

/* ---------- Hauptbereich ---------- */
.app-shell { flex: 1; padding: 28px 34px; max-width: 1500px; }
.page-eyebrow { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
h1 { margin: 2px 0 4px; font-size: 28px; }
.page-sub { color: var(--muted); margin: 0 0 22px; }
h2 { font-size: 19px; margin: 0 0 6px; }
h3 { font-size: 16px; margin: 18px 0 8px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 20px;
}
.card-sub { color: var(--muted); font-size: 13.5px; margin: 0 0 14px; }

.tile-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 20px; }
.tile { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); }
.tile .tile-label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.tile .tile-value { font-size: 20px; font-weight: 700; margin-top: 4px; }
.tile .tile-note { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* ---------- Formulare ---------- */
form.stacked label, .field label { display: block; font-size: 12.5px; font-weight: 600; color: #3d4850; margin-bottom: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 18px; }
.form-grid .field-wide { grid-column: 1 / -1; }
input[type="text"], input[type="number"], input[type="date"], input[type="datetime-local"],
input[type="email"], input[type="password"], select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: #fff;
  color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
input[readonly] { background: #f5f7f8; color: var(--muted); }
textarea { min-height: 70px; resize: vertical; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.checkbox-row input { width: auto; }

button, .btn {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .btn:hover { background: #f2f5f6; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #275d6a; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #932d26; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--accent); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: #fafbfc; }
td.number, th.number { text-align: right; white-space: nowrap; }
tr:hover td { background: #fbfcfd; }
table input, table select { min-width: 60px; padding: 5px 7px; }

/* ---------- Sonstiges ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-draft { background: #eef1f3; color: #4a565e; }
.badge-commissioned { background: #e3f0e8; color: var(--ok); }
.badge-warn { background: #fdf3e0; color: var(--warn); }
.badge-info { background: var(--accent-soft); color: var(--accent); }

.messages { list-style: none; margin: 0 0 18px; padding: 0; }
.messages li { padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; font-weight: 500; }
.messages .success { background: #e3f0e8; color: var(--ok); }
.messages .error { background: #f9e5e3; color: var(--danger); }
.messages .warning { background: #fdf3e0; color: var(--warn); }
.messages .info { background: var(--accent-soft); color: var(--accent); }

.detail-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.detail-tabs a {
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
}
.detail-tabs a.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.section-title { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 22px 0 10px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.hint { color: var(--muted); font-size: 13px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 1100px) { .two-col { grid-template-columns: 1fr; } }

/* ---------- Login ---------- */
.login-body { display: flex; align-items: stretch; min-height: 100vh; width: 100%; background: var(--sidebar-bg); }
.login-panel { width: 420px; background: #fff; padding: 60px 46px; display: flex; flex-direction: column; justify-content: center; }
.login-panel img { max-width: 200px; margin-bottom: 26px; }
.login-visual { flex: 1; background-size: cover; background-position: center; min-height: 100vh; }
.login-error { background: #f9e5e3; color: var(--danger); padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-weight: 500; }
.login-panel form label { margin-top: 12px; }
.login-panel button { margin-top: 20px; width: 100%; }

/* ---------- Projekt-Karten ---------- */
.project-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.project-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; background: #fff; box-shadow: var(--shadow); display: block; text-decoration: none; color: var(--text); }
.project-card:hover { border-color: var(--accent); }
.project-card .pc-name { font-weight: 700; margin-bottom: 3px; }
.project-card .pc-meta { color: var(--muted); font-size: 13px; }

/* Kompakte Eingabetabellen (Schichten / Revierzeilen) — passen ohne
   Seitwärts-Scrollen auf uebliche Bildschirmbreiten */
table.compact { table-layout: auto; }
table.compact th { font-size: 10.5px; letter-spacing: 0.03em; padding: 6px 5px; white-space: nowrap; }
table.compact td { padding: 5px 5px; }
table.compact input { padding: 6px 6px; }
table.compact input.day-input { width: 46px; min-width: 46px; text-align: center; padding: 6px 2px; }
table.compact input.num-input { width: 72px; min-width: 72px; }
table.compact input.factor-input { width: 64px; min-width: 64px; }
table.compact input.label-input { min-width: 110px; width: 100%; }
table.compact input[type="datetime-local"] { width: 168px; min-width: 168px; padding: 6px 4px; font-size: 13px; }
table.compact input[type="checkbox"] { width: auto; }
table.compact td.number { font-size: 13px; }
table.compact .day-group { background: #f4f7f8; }

.history-list { max-height: 420px; overflow-y: auto; }
.history-item { border-bottom: 1px solid var(--border); padding: 8px 2px; font-size: 13.5px; }
.history-item .hi-meta { color: var(--muted); font-size: 12px; }

.result-highlight { background: var(--accent-soft); border-radius: 8px; padding: 12px 16px; font-size: 15px; }
.result-highlight strong { font-size: 20px; }
