/* Barplan3000 Extern – Seitenlayout im Look des Barplans.
   Farben kommen ausschließlich aus den gemeinsamen Variablen (p3k.css / theme.css), damit Hell/Dunkel funktioniert. */
body { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: 57px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center;
  padding: 0 20px; gap: 14px; flex-shrink: 0; position: sticky; top: 0; z-index: 30; }
.topbar-logo { font-family: var(--p3k-head); font-size: 20px; font-weight: 700; letter-spacing: 2px; color: var(--text); text-transform: uppercase; text-decoration: none; white-space: nowrap; }
.topbar-logo span { color: var(--red2); }
.topbar-logo small { font-family: var(--p3k-mono); font-size: 11px; font-weight: 400; letter-spacing: 1px; color: var(--muted); margin-left: 6px; }
.topbar-title { font-size: 13px; color: var(--muted); font-family: var(--p3k-mono); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.topbar-user { font-size: 12px; color: var(--muted); font-family: var(--p3k-mono); text-decoration: none; }
.topbar-user:hover { color: var(--text); }
.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 24px; border-bottom: 1px solid var(--border); background: var(--surface); }
.page-header h1 { margin: 0; font-size: 1.3rem; }
.page-header .crumbs { font-size: 13px; }
.page-header .crumbs a { color: var(--muted); text-decoration: none; }
.page-header .crumbs a:hover { color: var(--text); }
.page-header .crumbs .sep { color: var(--muted); margin: 0 6px; }
.page-header .crumbs .cur { color: var(--accent); }
.page-body { padding: 24px; }
.page-body.narrow { max-width: 1100px; margin: 0 auto; width: 100%; }
.flash-box { padding: 14px 24px 0; }
.flash-box .alert { margin-bottom: 8px; }
.alert-login { border-left: 3px solid var(--accent); background: var(--surface2); font-family: var(--p3k-mono); font-size: 14px; word-break: break-all; }
.small-mono { font-family: var(--p3k-mono); font-size: 12px; }
.muted { color: var(--muted); }
code { color: var(--red2); background: var(--surface2); padding: 1px 5px; border-radius: 3px; word-break: break-all; }
.login-box { max-width: 400px; margin: 10vh auto; padding: 0 16px; width: 100%; }

/* Bar-Karten im Setup */
.bar-card .card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pos-chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); border-left-width: 4px; border-radius: 3px; padding: 1px 4px 1px 8px; font-size: 12px; margin: 0 4px 4px 0; background: var(--surface2); }
.pos-chip button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 3px; line-height: 1; }
.pos-chip button:hover { color: var(--danger); }
.times-table input[type=time] { width: 100px; }

/* ── Dienstplan ── */
.main-content.plan-page { height: calc(100vh - 57px); overflow: hidden; }
.plan-wrap { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.plan-note { padding: 8px 14px 0; }
.plan-note .alert { margin: 0; padding: 6px 12px; }
.plan-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 14px; background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.plan-top .sp { flex: 1; }
.plan-main { display: flex; flex: 1; overflow: hidden; }
.gantt-wrap { flex: 1; overflow: auto; position: relative; }
.side-panel { width: 220px; flex-shrink: 0; background: var(--surface); border-left: 1px solid var(--border); overflow-y: auto; }
.win-tab, .bar-chip { padding: 5px 12px; border-radius: 6px; font-size: 11px; font-family: var(--p3k-mono); border: 1px solid var(--border);
  color: var(--muted); background: transparent; text-decoration: none; cursor: pointer; white-space: nowrap; transition: all .12s; }
.win-tab:hover, .bar-chip:hover { border-color: var(--accent); color: var(--accent); }
.win-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.bar-chip.on { border-color: var(--accent); color: var(--text); background: var(--surface2); }
.bar-chip .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.bar-chip .dot.offen { background: var(--amber); } .bar-chip .dot.eingereicht { background: var(--info); } .bar-chip .dot.freigegeben { background: var(--success); }
.top-label { font-size: 10px; font-family: var(--p3k-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }

.g { display: grid; position: relative; min-width: max-content; user-select: none; -webkit-user-select: none; }
.g-bh { position: sticky; top: 0; z-index: 7; height: 28px; background: var(--surface2); border-bottom: 1px solid var(--border); border-right: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--p3k-head); font-weight: 700; letter-spacing: 1px; text-transform: uppercase; font-size: 13px; }
.g-h { position: sticky; z-index: 5; background: var(--surface); border-bottom: 2px solid var(--border); border-right: 1px solid var(--border);
  padding: 5px 6px 4px; text-align: center; font-size: 12px; font-weight: 600; min-width: 92px; }
.g-h .bar { height: 3px; border-radius: 2px; margin-top: 4px; }
.g-corner { position: sticky; left: 0; z-index: 9; background: var(--surface); border-right: 1px solid var(--border); border-bottom: 2px solid var(--border); }
.g-tcol { position: sticky; left: 0; z-index: 4; background: var(--surface); border-right: 1px solid var(--border); }
.g-t { height: var(--rh, 22px); font-size: 10px; color: var(--muted); font-family: var(--p3k-mono); padding: 0 6px; border-top: 1px solid transparent; }
.g-t.full { color: var(--text); font-weight: 700; font-size: 11px; border-top: 1px solid var(--p3k-rule3); }
.g-c { position: relative; border-right: 1px solid var(--p3k-rule); cursor: crosshair;
  background-image: linear-gradient(to bottom, transparent calc(var(--rh, 22px) - 1px), var(--p3k-rule2) 0), linear-gradient(to bottom, var(--p3k-rule3) 1px, transparent 1px);
  background-size: 100% var(--rh, 22px), 100% calc(var(--rh, 22px) * 2); background-repeat: repeat-y; }
.g-c.bar-end { border-right: 2px solid var(--border); }
.ov { position: absolute; left: 0; right: 0; pointer-events: none; font-size: 10px; color: var(--muted); text-align: center; font-family: var(--p3k-mono); overflow: hidden; }
.ov.closed { background: repeating-linear-gradient(135deg, var(--p3k-hatch) 0 6px, transparent 6px 12px); }
.ov.prep { background: color-mix(in srgb, var(--amber) 10%, transparent); }
.ov.clean { background: color-mix(in srgb, var(--violet-t) 12%, transparent); }
.ov.sel { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.blk { position: absolute; left: 2px; right: 2px; border-radius: 5px; color: #fff; padding: 3px 6px; overflow: hidden; cursor: pointer;
  border: 1px solid rgba(255,255,255,.2); box-shadow: 0 2px 6px rgba(0,0,0,.3); font-size: 12px; }
.blk b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.blk small { opacity: .85; display: block; font-size: 10px; line-height: 1.25; font-family: var(--p3k-mono); }
.blk .rz { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; cursor: ns-resize; background: rgba(0,0,0,.18); }
.blk:hover { filter: brightness(1.08); }
.ro .blk, .g-c.ro .blk { cursor: default; }
.g-c.ro { cursor: default; }

.sp-section { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.sp-title { font-size: 10px; font-family: var(--p3k-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.sp-person { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 5px 8px; border-radius: 5px; cursor: pointer; font-size: 12px; border: 1px solid transparent; margin-bottom: 3px; }
.sp-person:hover { background: var(--surface2); border-color: var(--border); }
.sp-person.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.sp-role { font-size: 9px; font-family: var(--p3k-mono); color: var(--muted); }
.plan-toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--accent); padding: 9px 16px; border-radius: 6px; z-index: 2000; display: none; max-width: 90vw; }
@media (max-width: 800px) { .side-panel { display: none; } .page-body { padding: 14px; } .topbar { padding: 0 12px; } }
