/* Energy Park Stundenkontrolle — UI */

* { box-sizing: border-box; }
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --ink: #1a1f24;
  --ink-2: #4a5159;
  --muted: #8a9099;
  --line: #e1e4e8;
  --accent: #f59e0b;      /* warmer Energy Park Ton */
  --accent-2: #b45309;
  --primary: #1a1f24;
  --danger: #c0392b;
  --ok: #16a34a;
  --warn: #d97706;
  --pill-bg: #eef0f4;
  --radius: 10px;
  --shadow: 0 4px 14px rgba(20,25,30,.08);
}

html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent-2); }
a.bold { font-weight: 600; }

h1, h2, h3 { color: var(--ink); margin: 0 0 .4em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 600; }
.subtitle { color: var(--muted); margin: 0; }
.muted { color: var(--muted); }
.muted.small { font-size: 12px; }

/* ── Topbar ────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; gap: 32px;
  background: var(--ink); color: #fff;
  padding: 10px 28px;
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: baseline; gap: 8px; color: #fff; }
.brand-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--accent); display: inline-block; align-self: center; box-shadow: 0 0 0 3px rgba(245,158,11,.25); }
.brand-name { font-weight: 700; letter-spacing: .2px; }
.brand-sub  { color: #c8cbd1; font-size: 12px; }
.mainnav { display: flex; gap: 4px; flex: 1; }
.mainnav a {
  color: #c8cbd1; padding: 8px 14px; border-radius: 8px;
  font-weight: 500; font-size: 14px;
}
.mainnav a.active { background: rgba(255,255,255,.08); color: #fff; }
.mainnav a:hover { color: #fff; }
.user-chip { display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; color: #c8cbd1; }
.user-chip span { color: #fff; font-weight: 500; }
.user-chip small { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; opacity: .7; }
.user-chip .logout { font-size: 12px; color: var(--accent); margin-top: 2px; }

/* ── Main wrap ────────────────────────────────────────── */
.page-wrap { max-width: 1280px; margin: 0 auto; padding: 28px; }
.page-title { margin-top: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.page-actions { display: flex; gap: 8px; }

/* ── Cards ────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.card-head {
  display: flex; justify-content: space-between; align-items: center;
  margin: -2px 0 12px;
}
.card-head h2 { margin: 0; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

/* ── KPIs ─────────────────────────────────────────────── */
.kpi-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 22px;
}
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px;
}
.kpi-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.kpi-value { font-size: 26px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.kpi.attention { border-color: var(--accent); }
.kpi.attention .kpi-value { color: var(--accent-2); }
.kpi.warn { border-color: var(--warn); }
.kpi.warn .kpi-value { color: var(--warn); }

/* ── Tables ───────────────────────────────────────────── */
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
table.data th { font-weight: 600; color: var(--ink-2); background: #fafbfc; font-size: 12px; text-transform: uppercase; letter-spacing: .3px; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.bold, table.data th.bold { font-weight: 600; }
table.data tbody tr:hover { background: #fafbfc; }
table.data tfoot td { font-weight: 600; border-top: 2px solid var(--ink); background: #f9fafb; }
table.data .empty { color: var(--muted); text-align: center; padding: 24px; }
table.data .note { color: var(--ink-2); font-size: 13px; }
table.data .row-actions { display: flex; gap: 6px; }
table.data.wide { display: block; overflow-x: auto; }

/* ── Pills ────────────────────────────────────────────── */
.pill {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  background: var(--pill-bg); font-size: 12px; font-weight: 500; color: var(--ink-2);
  text-transform: capitalize;
}
.pill.planned   { background: #e9eef5; color: #475569; }
.pill.done      { background: #fef3c7; color: var(--accent-2); }
.pill.review    { background: #fef3c7; color: var(--accent-2); }
.pill.closed    { background: #dcfce7; color: #166534; }
.pill.entry-submitted { background: #e0e7ef; color: #475569; }
.pill.entry-in_review { background: #fef3c7; color: var(--accent-2); }
.pill.entry-approved  { background: #dcfce7; color: #166534; }
.pill.entry-corrected { background: #fde68a; color: var(--accent-2); }
.pill.entry-rejected  { background: #fee2e2; color: var(--danger); }
.pill.on  { background: #dcfce7; color: #166534; }
.pill.off { background: #fee2e2; color: var(--danger); }
.warn { color: var(--warn); font-weight: 600; }

/* ── Buttons / forms ──────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 16px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
  font-size: 14px; font-weight: 500;
  cursor: pointer; transition: background .12s, border-color .12s, transform .03s;
}
.btn:hover { background: #f4f5f7; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: #0f1316; }
.btn.danger { color: var(--danger); border-color: #fcd2cc; background: #fff5f3; }
.btn.danger:hover { background: #fee5e1; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.big   { padding: 12px 22px; font-size: 16px; }
.btn.huge  { padding: 18px 28px; font-size: 18px; min-height: 60px; }

.form-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px; max-width: 920px;
}
label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 14px; }
label.check { display: flex; align-items: center; gap: 8px; }
input[type=text], input[type=email], input[type=password],
input[type=number], input[type=date], input[type=time],
select, textarea {
  display: block; width: 100%; margin-top: 4px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 15px; background: #fff; color: var(--ink);
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid #fcd9a1; border-color: var(--accent); background: #fff;
}
.grid-2 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.filters { display: flex; gap: 14px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
.filters label { margin-bottom: 0; }
.err { color: var(--danger); font-size: 13px; min-height: 1.2em; margin: 6px 0 0; }
.ok { color: var(--ok); font-size: 13px; }
.hidden { display: none !important; }

/* ── Banner ─────────────────────────────────── */
.banner {
  padding: 12px 16px; border-radius: var(--radius);
  margin-bottom: 16px; font-size: 14px;
  background: #fef3c7; color: var(--accent-2);
  border: 1px solid #fde68a;
}
.banner.muted { background: #f0f2f5; color: var(--ink-2); border-color: var(--line); }
.banner.ok { background: #dcfce7; color: #166534; border-color: #bbf7d0; }

/* ── Login ──────────────────────────────────── */
body.is-login { background: linear-gradient(135deg, #1a1f24 0%, #2d343c 100%); display:flex; align-items:center; justify-content:center; }
body.is-login main { padding: 0; width: 100%; }
.login-card {
  width: 380px; max-width: calc(100vw - 32px);
  margin: 32px auto; padding: 28px;
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow);
}
.login-brand { text-align: center; margin-bottom: 18px; }
.login-brand h1 { margin: 8px 0 0; }
.login-brand p { margin: 0; color: var(--muted); }
.login-pin { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; }
.login-pin form { display: flex; gap: 8px; }
.login-pin input { flex: 1; font-size: 20px; letter-spacing: 4px; text-align: center; }
.hint { font-size: 12px; color: var(--muted); margin: 16px 0 0; }
.hint code { background: #f0f2f5; padding: 1px 5px; border-radius: 4px; color: var(--ink); }

/* ── Event form / location selector ─────────── */
.loc-block { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 14px; }
.loc-block legend { padding: 0 6px; color: var(--ink-2); font-size: 13px; }
.loc-options { display: grid; gap: 10px; grid-template-columns: repeat(3, 1fr); margin-bottom: 12px; }
@media (max-width: 720px) { .loc-options { grid-template-columns: 1fr; } }
.loc-opt {
  display: flex; align-items: center; justify-content: center;
  padding: 14px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; cursor: pointer; font-weight: 500;
}
.loc-opt input { position: absolute; opacity: 0; pointer-events: none; }
.loc-opt.on { border-color: var(--accent); background: #fff7e8; box-shadow: 0 0 0 2px rgba(245,158,11,.18); }
.custom-loc { display: none; }
.custom-loc[data-show="on"] { display: block; }

/* ── Share / tablet link card ───────────────── */
.share-card {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: #fff7e8; border-color: #fcd9a1;
}
.share-card strong { display: block; }
.share-card p { margin: 0; }
.share-link { display: flex; gap: 8px; flex: 1; min-width: 280px; }
.share-link input { flex: 1; }

/* ── Approvals table inputs ─────────────────── */
table.approvals td input[type=time] { width: 95px; padding: 6px 8px; display: inline-block; margin-top: 0; }
table.approvals td input.break { width: 60px; padding: 6px 8px; display: inline-block; margin-left: 4px; }

/* ── Tablet view ────────────────────────────── */
body.is-tablet { background: #f4f5f7; }
.tablet-wrap { max-width: 1200px; margin: 0 auto; padding: 20px; }
.tablet-head { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tablet-head h1 { font-size: 22px; }
.tablet-grid {
  display: grid; gap: 18px;
  grid-template-columns: 280px 1fr;
}
@media (max-width: 900px) { .tablet-grid { grid-template-columns: 1fr; } }
.tablet-list {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  max-height: 70vh; overflow-y: auto;
}
.tablet-list h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.tablet-list ul { list-style: none; padding: 0; margin: 0; }
.tablet-list li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; }
.tablet-list li strong { font-size: 14px; }
.tablet-list li span { font-size: 12px; color: var(--muted); }
.tablet-form-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.tablet-form-wrap input, .tablet-form-wrap select, .tablet-form-wrap textarea {
  font-size: 17px; padding: 12px 14px;
}
.tablet-form-wrap .who { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.tablet-form-wrap .who legend { padding: 0 6px; color: var(--ink-2); }
.time-blocks { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 980px) { .time-blocks { grid-template-columns: 1fr; } }
.time-block {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  background: #fafbfc;
}
.time-block legend { padding: 0 6px; font-weight: 600; }
.time-block .calc { margin-top: 8px; font-weight: 700; font-size: 18px; color: var(--accent-2); }
.time-block.prep  { border-color: #d4d8e3; }
.time-block.event { border-color: #fcd9a1; background: #fff8ec; }
.time-block.post  { border-color: #d4d8e3; }
.total-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--ink); color: #fff; padding: 18px 22px; border-radius: var(--radius);
  margin: 18px 0; font-size: 18px; font-weight: 600;
}
.total-row .total-h { font-size: 28px; color: var(--accent); }
.tablet-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.success { background: #dcfce7; color: #166534; padding: 16px; border-radius: var(--radius); margin-top: 12px; display: flex; gap: 12px; align-items: center; }
.full { display: block; }
.person-select .new-person { margin-top: 8px; padding: 12px; border: 1px dashed var(--line); border-radius: 8px; background: #fafbfc; }

/* ── Bar stack chart ────────────────────────── */
.bar-stack { display: flex; height: 36px; border-radius: 8px; overflow: hidden; margin-top: 10px; box-shadow: inset 0 0 0 1px var(--line); }
.bar-stack .seg { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 600; }
.bar-stack .seg.prep  { background: #6b7280; }
.bar-stack .seg.event { background: var(--accent); }
.bar-stack .seg.post  { background: #475569; }

/* ── Error page ─────────────────────────────── */
.error-card { text-align: center; padding: 40px; }

/* ── Misc ───────────────────────────────────── */
.bold { font-weight: 600; }
.export-context label { display: block; }
