@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

:root {
  --lb-blue: #1d4f91;
  --lb-blue-dark: #153a6b;
  --lb-blue-light: #e6eef8;
}

* { box-sizing: border-box; }
body { font-family: 'Montserrat', system-ui, sans-serif; margin: 0; background: #f3f5f9; color: #222; }
.topbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
          background: var(--lb-blue); padding: 10px 16px; }
.topbar a { color: #fff; text-decoration: none; }
.topbar .brand { font-weight: 600; }
.topbar .links a { margin-left: 14px; }
main { max-width: 900px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.3rem; }
.card { background: #fff; border-radius: 10px; padding: 16px; margin-bottom: 16px; box-shadow: 0 1px 6px rgba(0,0,0,.06); }
input[type=text], input[type=password] { padding: 8px; font-size: 1rem; font-family: inherit; border: 1px solid #ccc; border-radius: 6px; width: 100%; max-width: 280px; }
button { padding: 8px 12px; font-size: .95rem; font-family: inherit; border: none; border-radius: 6px; background: var(--lb-blue); color: #fff; cursor: pointer; }
button:hover { background: var(--lb-blue-dark); }
button.secondary { background: #6c757d; }
button.secondary:hover { background: #5a6268; }
button.danger { background: #b00020; }
button.danger:hover { background: #8c0019; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid #eee; vertical-align: middle; }
td form { display: inline; }
.msg { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }
.msg.ok { background: var(--lb-blue-light); color: var(--lb-blue-dark); }
.msg.err { background: #fde2e4; color: #b00020; }
.form-row { margin-bottom: 10px; }
.badge { background: var(--lb-blue); color: #fff; font-size: .75rem; padding: 2px 6px; border-radius: 4px; }

/* Login-Seite */
.login-page { display: grid; place-items: center; min-height: 100vh; }
.login-page form { background: #fff; padding: 24px; border-radius: 12px; width: min(320px, 90vw);
                   box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.login-page h1 { font-size: 1.2rem; margin: 0 0 16px; color: var(--lb-blue); }
.login-page input, .login-page button { width: 100%; max-width: none; padding: 10px; margin-bottom: 12px; font-size: 1rem; }

/* Toolbar */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.toolbar h1 { margin: 0; margin-right: auto; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters input { max-width: 200px; }
select, input[type=date] { padding: 8px; font-size: 1rem; font-family: inherit; border: 1px solid #ccc; border-radius: 6px; background: #fff; }
a.button { display: inline-block; padding: 8px 12px; border-radius: 6px; background: var(--lb-blue); color: #fff; text-decoration: none; }
a.button:hover { background: var(--lb-blue-dark); }

/* Board mit Branchen-Spalten */
main:has(.board) { max-width: none; }
.board { display: flex; gap: 10px; overflow-x: auto; align-items: flex-start; padding-bottom: 12px; }
.col { flex: 0 0 240px; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.col-head { display: flex; justify-content: space-between; padding: 8px 10px; font-weight: 600; background: #ddd; }
.col-head .count { font-weight: 500; font-size: .85rem; }
.b-BV { background: #f39a3c; }
.b-LX { background: #f7e04b; }
.b-SC { background: #3fa45b; color: #fff; }
.b-EX { background: #e0453a; color: #fff; }
.b-RO { background: #3b6fd1; color: #fff; }
.b-TB { background: #9b8ec4; color: #fff; }
.row { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid #f0f0f0;
       color: inherit; text-decoration: none; font-size: .85rem; }
.row:hover { background: var(--lb-blue-light); }
.row .name { flex: 1; min-width: 0; }
.row .date { color: #888; font-size: .75rem; }
.row.leader { background: #f7f7f7; }
.col-sub { padding: 4px 10px; font-size: .75rem; font-weight: 600; text-transform: uppercase; color: #777; background: #eee; }
.tag { background: #888; color: #fff; font-size: .7rem; font-weight: 600; padding: 1px 5px; border-radius: 3px; }

/* Diät-Badges */
.diet { display: inline-block; margin-left: 4px; font-size: .65rem; font-weight: 700; padding: 0 4px; border-radius: 3px; vertical-align: middle; }
.diet-v { background: #cde8c4; color: #2d5a23; }
.diet-g { background: #f3cfd8; color: #7a2a3d; }
.diet-l { background: #cfe2f6; color: #234a75; }
.diet-x { background: #ffe08a; color: #6b5200; }

/* Personen-Formular */
.person-form label { display: block; font-size: .85rem; font-weight: 500; }
.person-form input[type=text], .person-form input[type=date], .person-form select { display: block; width: 100%; max-width: none; margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
fieldset { border: 1px solid #e3e3e3; border-radius: 8px; margin: 0 0 16px; padding: 10px 14px; }
legend { font-weight: 600; padding: 0 4px; }
label.check { display: inline-flex; align-items: center; gap: 6px; margin: 4px 16px 4px 0; font-weight: 400; }
.lead-row { display: flex; justify-content: space-between; border-bottom: 1px solid #f3f3f3; }
.lead-row .fav { color: #777; }
.hint { display: block; color: #777; font-weight: 400; margin-top: 4px; }
.actions { display: flex; align-items: center; gap: 14px; }
.danger-zone { margin-top: 8px; }

/* Aktivitäten-Liste */
h2.section { font-size: 1rem; color: #666; margin: 20px 0 8px; }
.activity-card { display: block; color: inherit; text-decoration: none; }
.activity-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.activity-title { font-weight: 600; }
.activity-meta { font-size: .85rem; color: #666; margin-top: 4px; }
.empty { color: #888; }

/* Formular Preise */
.price-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 6px 0; border-bottom: 1px solid #f3f3f3; }
.price-row label.check { min-width: 160px; }
.person-form .price-row .price { display: flex; align-items: center; gap: 6px; font-weight: 400; }
.person-form .price-row .price input { width: 70px; margin-top: 0; }

/* Raster-Ansicht */
.toolbar .dates { font-size: .85rem; font-weight: 400; color: #666; margin-left: 6px; }
.stand { font-size: .85rem; color: #b00020; font-weight: 600; }
.summary-bar { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: .9rem; padding: 10px 16px; }
.sum-open { color: #b00020; }
.grid-board .col { flex-basis: 300px; }
.col-head.grid-head { display: grid; grid-template-columns: 1fr 44px 52px; gap: 0; }
.col-head.grid-head.list { grid-template-columns: 1fr 44px; }
.col-head.grid-head span:not(:first-child) { text-align: center; }
.col-price { font-size: .75rem; color: #666; padding: 4px 10px; background: #fafafa; border-bottom: 1px solid #eee; }
.grid-row { display: grid; grid-template-columns: 1fr 44px 52px; border-bottom: 1px solid #f0f0f0; font-size: .85rem; }
.grid-row.list { grid-template-columns: 1fr 44px; }
.grid-row .name { padding: 6px 10px; min-width: 0; }
.cell { display: flex; align-items: center; justify-content: center; border: none; border-left: 1px solid #eee;
        border-radius: 0; padding: 0; min-height: 34px; background: #fff; color: #222;
        font: inherit; font-weight: 700; cursor: pointer; }
.cell:hover { background: var(--lb-blue-light); }
.cell.busy { opacity: .5; }
.cell.s-X { background: #d8f0dc; color: #1d5a2c; }
.cell.s-EXC { background: #9e9e9e; color: #fff; font-size: .7rem; }
.cell.s-O { background: #fff3b0; color: #6b5200; }
.cell.p-none, .cell.ref { background: #cfcfcf; cursor: default; }
.cell.ref { font-size: .7rem; color: #555; }
.cell.p-paid { color: #1d7a32; }
.cell.p-open { background: #e0453a; color: #fff; }
.cell.p-refund { background: #ffe08a; color: #6b5200; }
.col-foot { padding: 6px 10px; font-weight: 700; font-size: .85rem; }

/* Notizen */
.name-btn { background: none; border: none; padding: 0; margin: 0; font: inherit; color: inherit;
            text-align: left; cursor: pointer; border-radius: 0; }
.name-btn:hover { background: none; color: var(--lb-blue); }
.name-btn.has-note { text-decoration: underline; text-decoration-color: var(--lb-blue);
                     text-decoration-thickness: 2px; text-underline-offset: 3px; }
.note-dialog { border: none; border-radius: 12px; padding: 20px; width: min(400px, 92vw);
               box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.note-dialog::backdrop { background: rgba(20, 30, 50, .45); }
.note-dialog h3 { margin: 0 0 12px; font-size: 1rem; }
.note-dialog textarea { width: 100%; padding: 8px; font: inherit; border: 1px solid #ccc; border-radius: 6px;
                        resize: vertical; margin-bottom: 12px; }
.note-dialog .actions { flex-wrap: wrap; gap: 8px; }

/* Notiz-Box beim Drüberfahren (nur am PC) */
.name-btn { position: relative; }

@media (hover: hover) {
  .name-btn.has-note:hover::after {
    content: attr(data-note);
    position: absolute; left: 0; top: calc(100% + 8px); z-index: 20;
    width: max-content; max-width: 220px;
    padding: 6px 10px; border-radius: 6px;
    background: var(--lb-blue-dark); color: #fff;
    font-size: .8rem; font-weight: 500; line-height: 1.35; white-space: normal;
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
    pointer-events: none;
    animation: note-pop .12s ease-out;
  }
  .name-btn.has-note:hover::before {
    content: ''; position: absolute; left: 12px; top: calc(100% + 2px); z-index: 21;
    border: 6px solid transparent; border-top: 0; border-bottom-color: var(--lb-blue-dark);
    pointer-events: none;
  }
}

@keyframes note-pop {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: none; }
}

/* Spalten dürfen die Box nicht abschneiden */
.grid-board .col { overflow: visible; }
.grid-board .col-head { border-radius: 8px 8px 0 0; }
.grid-board .col-foot { border-radius: 0 0 8px 8px; }