/* Shorttrack Hub – Basis-Styles (Tablet + PC) */
:root {
  --accent: #1f4e79; --accent-2: #2d6da3;
  --bg: #f5f7fa; --card: #ffffff; --line: #e3e8ee;
  --text: #22303c; --muted: #6b7a88;
  --green: #1e7d43; --red: #b3261e; --violet: #5b3fa8; --blue: #1f5eb3;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 16px;
}

/* ---- Navigation ---- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 250px; background: var(--card);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 20;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 18px 16px; border-bottom: 1px solid var(--line); }
.brand .logo {
  background: var(--accent); color: #fff; border-radius: 10px; width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
}
.brand small { display: block; color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.sidebar ul { list-style: none; margin: 10px 0; padding: 0; flex: 1; overflow-y: auto; }
.sidebar li a {
  display: block; padding: 12px 18px; color: var(--text); text-decoration: none;
  border-left: 3px solid transparent; font-weight: 500;
}
.sidebar li a:hover { background: #eef3f8; }
.sidebar li.active a { border-left-color: var(--accent); color: var(--accent); background: #eaf1f8; }
.userbox { border-top: 1px solid var(--line); padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.userbox small { display: block; color: var(--muted); }
.btn-out { font-size: 13px; color: var(--red); text-decoration: none; }
.navtoggle { display: none; }

.content { margin-left: 250px; padding: 28px 32px 60px; }
.content-plain { margin: 0 auto; max-width: 460px; padding: 40px 20px; }
.pagetitle { font-size: 26px; margin: 0 0 20px; }

/* ---- Karten, Tabellen ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-bottom: 18px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.kpi .num { font-size: 30px; font-weight: 700; color: var(--accent); }
.kpi .lbl { color: var(--muted); font-size: 14px; }
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.list th { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.month-h { margin: 22px 0 8px; color: var(--muted); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.comp-row { display: flex; gap: 16px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; }
.comp-date { min-width: 56px; text-align: center; }
.comp-date b { display: block; font-size: 22px; }
.comp-date span { color: var(--muted); font-size: 13px; }
.comp-main { flex: 1; }
.comp-main .meta { color: var(--muted); font-size: 14px; margin-top: 2px; }

/* ---- Badges, Buttons, Formulare ---- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.b-blue { background: #e3edfa; color: var(--blue); }
.b-green { background: #e2f3e8; color: var(--green); }
.b-violet { background: #ece6f9; color: var(--violet); }
.b-red { background: #fbe4e2; color: var(--red); }
.b-grey { background: #edf0f3; color: var(--muted); }
.btn {
  display: inline-block; background: var(--accent); color: #fff; border: 0; cursor: pointer;
  padding: 11px 20px; border-radius: 9px; font-size: 15px; font-weight: 600; text-decoration: none;
}
.btn:hover { background: var(--accent-2); }
.btn.secondary { background: #edf0f3; color: var(--text); }
label { display: block; font-weight: 600; margin: 14px 0 6px; }
input, select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px;
  font: inherit; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-2); border-color: var(--accent-2); }
.error { background: #fbe4e2; color: var(--red); border-radius: 9px; padding: 10px 14px; margin: 12px 0; }
.ok { background: #e2f3e8; color: var(--green); border-radius: 9px; padding: 10px 14px; margin: 12px 0; }

/* ---- OPC-Editor ---- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tab {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; color: var(--muted);
}
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.block-h { display: flex; justify-content: space-between; align-items: center; margin: 18px 0 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.crit { display: grid; grid-template-columns: 1.4fr auto auto 1fr; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.crit-l { font-size: 15px; }
.crit-l small { color: var(--muted); }
.crit-n { display: flex; flex-direction: column; gap: 2px; }
.crit-n small { color: var(--muted); font-size: 11px; }
.notes { display: flex; gap: 4px; }
.noteb {
  width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; font: inherit; font-weight: 700; cursor: pointer;
}
.noteb.sel { background: var(--accent); border-color: var(--accent); color: #fff; }
.noteb.sel.ng { background: var(--green); border-color: var(--green); }
.noteb.sel.ny { background: #b28704; border-color: #b28704; }
.noteb.sel.no { background: #c25e00; border-color: #c25e00; }
.noteb.sel.nr { background: var(--red); border-color: var(--red); }
.tabs.sticky { position: sticky; top: 0; z-index: 15; background: var(--bg); padding: 8px 0; }
.tab .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--red); margin-left: 5px; vertical-align: middle; }
.eval-card { padding: 14px 18px; }
.eval-headrow { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.eval-role { min-width: 175px; }
.eval-name { flex: 1; min-width: 180px; }
.eval-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.bem.warn { border-color: var(--red); background: #fff5f4; }
.hint { color: var(--muted); font-size: 14px; }
.okline { color: var(--green); font-weight: 600; }
ul.problems { margin: 8px 0; padding-left: 18px; color: var(--red); }
ul.problems li { margin: 3px 0; list-style: none; }
.submitgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
select.ok-sel { border-color: var(--green); background: #f0faf4; }
select.bad-sel { border-color: var(--red); background: #fff5f4; }
.crit-b { grid-template-columns: 1.4fr auto 1fr; }
#opc-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: #fff; padding: 12px 20px; border-radius: 10px;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 100; max-width: 90vw;
}
#opc-toast.show { opacity: 1; transform: translateX(-50%); }
#opc-toast.warn { background: var(--red); }
.kennz { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.inlinecheck { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; margin: 6px 12px 6px 0; }
.inlinecheck input { width: 20px; height: 20px; }
.loggrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; align-items: center; }
.btn-s { padding: 5px 10px; font-size: 13px; }
@media (max-width: 900px) {
  .crit { grid-template-columns: 1fr; }
  .crit-b { grid-template-columns: 1fr; }
  .loggrid { grid-template-columns: 1fr 1fr; }
  .submitgrid { grid-template-columns: 1fr; }
  .noteb { width: 46px; height: 46px; }   /* Touch-Ziele Tablet */
}
@media print {
  .sidebar, .navtoggle, .tabs, .btn, .noteb:not(.sel), #sync-badge, #opc-toast { display: none !important; }
  .content { margin: 0; padding: 0; }
  .tabpane { display: block !important; }
  .bogen { display: block !important; }         /* alle Bögen ausklappen */
  .card { break-inside: avoid; border: 1px solid #ccc; }
  body { background: #fff; font-size: 12px; }
}

/* ---- Tablet / Mobil ---- */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; width: 270px; }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.25); }
  .navtoggle {
    display: block; position: fixed; top: 12px; left: 12px; z-index: 30;
    background: var(--card); border: 1px solid var(--line); border-radius: 9px;
    font-size: 20px; padding: 8px 12px; cursor: pointer;
  }
  .content { margin-left: 0; padding: 64px 16px 40px; }
}
