/* group.css — Skupina, Uživatel, Oznámení (GROUP lane). Every rule is scoped to .grp-* classes; tokens from app.css. */

/* Skupina: left sub-menu + content column (TaskPark's col-menu) */
.grp-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; align-items: start; margin-top: 24px; }
.grp-sub ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hair); }
.grp-sub a { display: block; padding: 10px 12px; border-bottom: 1px solid var(--hair); color: var(--text-2); text-decoration: none; font-size: var(--fs-s); }
.grp-sub a:hover { color: var(--text); background: var(--bg-soft); }
.grp-sub a.on { color: var(--text); font-weight: var(--w-med); background: var(--bg-soft); box-shadow: inset 2px 0 0 var(--hair-strong); }
.grp-sub, .grp-content { min-width: 0; }
.grp-content > h1 { margin-top: 0; }
.grp-h2 { margin: 28px 0 14px; }

/* fieldsets: a legend with a hairline, like TaskPark's grouped form sections */
.grp-fs { border: 0; padding: 0; margin: 28px 0 0; min-width: 0; }
.grp-fs > legend { font-size: var(--fs-h2); padding: 0 0 8px; width: 100%; border-bottom: 1px solid var(--hair); margin-bottom: 16px; }
.grp-fs-help { margin: 0 0 14px; max-width: 75ch; }
.grp-num { max-width: 110px !important; text-align: right; }
.grp-short { max-width: 120px !important; }
.grp-mid { max-width: 220px !important; }
.grp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.grp-row .check { padding-top: 0; }
.grp-ro { display: inline-block; padding-top: 8px; font-weight: var(--w-med); }
.grp-cur { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.grp-cur label { font-size: var(--fs-s); color: var(--text-2); }
.grp-cur input { width: 90px; }
.grp-vars { margin: 8px 0 0 calc(var(--field-label-w) + 16px); font-size: var(--fs-s); }
.grp-vars p { margin: 0 0 6px; }
.grp-vars ul { margin: 0; padding-left: 18px; color: var(--text-2); }
.grp-vars code { color: var(--text); }

/* one-button POST forms that read as links ("[vypnout členství]", "Odstranit") */
.grp-inline { display: inline; margin: 0; }
.grp-linkbtn { background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; text-underline-offset: 2px;
               text-decoration-thickness: 1px; cursor: pointer; font-size: var(--fs-s); }
.grp-linkbtn:hover { text-decoration-thickness: 2px; }
.grp-acts-cell { display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.grp-acts-cell .btn { min-height: 30px; padding: 3px 12px; }

/* Uživatelé: cards */
.grp-add { margin: 0 0 8px; }
.grp-add > summary { list-style: none; display: inline-flex; }
.grp-add > summary::-webkit-details-marker { display: none; }
.grp-add[open] > summary { margin-bottom: 16px; }
.grp-add-box { border: 1px solid var(--hair); padding: 18px 20px 4px; background: var(--bg); max-width: 920px; }
.grp-add-box h2 { margin: 0 0 4px; }
.grp-add-box > .help { margin: 0 0 16px; }
.grp-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.grp-card { border: 1px solid var(--hair); padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 3px; background: var(--bg); min-width: 0; }
.grp-card .avatar, .grp-card .grp-photo { margin-bottom: 6px; }
.grp-card-name { font-size: 20px; line-height: 1.25; text-decoration: none; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grp-card-name:hover { text-decoration: underline; }
.grp-card-int { font-size: var(--fs-s); font-weight: var(--w-bold); }
.grp-card-meta { font-size: var(--fs-s); color: var(--text-2); }
.grp-card .grp-inline, .grp-me { margin-top: 4px; font-size: var(--fs-s); }
.grp-me { color: var(--text-2); }
.grp-card.off { background: var(--bg-soft); border-style: dashed; }
.grp-card.off .grp-card-name, .grp-card.off .grp-card-int { color: var(--text-2); }
.grp-card.off .avatar, .grp-card.off .grp-photo { filter: grayscale(1); opacity: .7; }
.grp-photo { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; display: inline-block; vertical-align: middle; }
.grp-photo.sm { width: 26px; height: 26px; }
.grp-photo-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.grp-photo-row input[type=file] { font-size: var(--fs-s); max-width: 100%; }

/* the temporary password, shown once */
.grp-once { max-width: 60ch; }
.grp-dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 16px 0; }
.grp-dl dt { color: var(--text-2); }
.grp-dl dd { margin: 0; }
.grp-pw { font-size: 22px; letter-spacing: .06em; padding: 4px 10px; border: 1px solid var(--hair-strong); border-radius: var(--radius);
          user-select: all; background: var(--bg-soft); }
.grp-warn { background: var(--warn-bg); color: var(--warn-fg); padding: 10px 14px; border-radius: var(--radius); }

/* Role a oprávnění: the matrix */
table.grp-matrix th[scope=row] { font-weight: var(--w-med); white-space: normal; border-bottom: 1px solid var(--hair); font-size: var(--fs); padding: 10px 12px; }
table.grp-matrix th small { display: block; font-weight: var(--w-reg); color: var(--text-2); font-size: var(--fs-xs); max-width: 60ch; }
table.grp-matrix .grp-c { text-align: center; width: 130px; }
table.grp-matrix thead small { display: block; font-weight: var(--w-reg); color: var(--text-2); font-size: var(--fs-xs); }
table.grp-matrix tbody tr:last-child th { border-bottom: 0; }
table.grp-matrix input:disabled { opacity: .55; }

/* Konfigurace, Štítky */
table.grp-acts td, table.grp-tags td { padding-top: 6px; padding-bottom: 6px; }
table.grp-acts input[type=text]:not(.grp-num) { min-width: 180px; }
table.grp-acts input[type=number] { max-width: 80px !important; }
.grp-color { width: 54px; height: 34px; padding: 2px; border: 1px solid var(--input-border); border-radius: var(--radius); background: var(--input-bg); cursor: pointer; }
table.grp-tags input[type=text] { min-width: 160px; max-width: 260px; }
.grp-tagadd .field { margin: 0; }
.grp-tagadd .grp-row input[type=text] { max-width: 280px; }
.muted { color: var(--text-2); }

/* Nastavení účtu */
.grp-userh1 { margin-bottom: 16px; }
.grp-userh1 span { color: var(--text-2); }
.grp-voc span { color: var(--text-2); }
.grp-tariffs input { max-width: 110px; }

/* Nedostupnost: one row of controls; "Do" shows only when Vícedenní is ticked (no script needed) */
.grp-unav { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.grp-unav .check { padding-top: 0; }
.grp-unav-end { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.grp-unav-end label { font-size: var(--fs-s); color: var(--text-2); }
.grp-unav-end select, .grp-unav select { width: auto; }
.grp-unav-desc { width: auto !important; flex: 1 1 220px; max-width: 320px; }
.grp-unav input[type=date] { width: 160px; }
.grp-unav-end { flex-wrap: nowrap; }
.grp-content .field-control > input[type=date], .grp-fs .field-control > input[type=date], .grp-unav-form input[type=date] { max-width: 180px; }
.grp-dash { color: var(--text-2); }
.grp-unav:not(:has(input[name=more_day]:checked)) .grp-more { display: none; }
.grp-unav-form .err { margin-top: 10px; }

/* Oznámení: the list */
.grp-msg-tools { margin-top: 0; }
.grp-msgs { list-style: none; margin: 0 0 16px; padding: 0; border: 1px solid var(--hair); background: var(--bg); }
.grp-msg { display: flex; align-items: flex-start; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--hair); }
.grp-msg:last-child { border-bottom: 0; }
.grp-msg-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.grp-msg-open { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; color: var(--text); display: flex; flex-direction: column; gap: 2px; width: 100%; }
.grp-msg-open:hover .grp-msg-text { text-decoration: underline; }
.grp-msg-task { font-size: var(--fs-s); color: var(--text-2); }
.grp-msg-meta { font-size: var(--fs-xs); color: var(--text-2); }
.grp-msg.unread { box-shadow: inset 3px 0 0 var(--hair-strong); }
.grp-msg.unread .grp-msg-text { font-weight: var(--w-bold); }
.grp-msg > .grp-inline { flex: none; padding-top: 2px; }

/* the header bell + drop-down (fragment from /message/quick) */
.grp-bell { position: relative; flex: none; }
.grp-bell-btn { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; background: none;
                color: var(--text); cursor: pointer; border-radius: 50%; }
.grp-bell-btn:hover { background: var(--bg-soft); }
.grp-bell-btn .ic { width: 20px; height: 20px; }
.grp-badge { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #c62828;   /* fixed red: 5.6:1 under white text in both themes */
             color: #fff; font-size: 11px; line-height: 17px; font-weight: var(--w-bold); text-align: center; }
.grp-msgpop { width: 360px; max-width: calc(100vw - 32px); padding-bottom: 0; }
.grp-msgpop .pop-head small { display: inline; margin-left: 6px; }
.grp-q-list { max-height: 420px; overflow-y: auto; }
.grp-msgpop .grp-inline { display: block; }
.grp-msgpop button.grp-q-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 16px; border-bottom: 1px solid var(--hair); }
.grp-q-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.grp-q-text { font-size: var(--fs-s); overflow-wrap: anywhere; }
.grp-q-item.unread .grp-q-text { font-weight: var(--w-bold); }
.grp-q-meta { font-size: var(--fs-xs); color: var(--text-2); }
.grp-q-empty { padding: 8px 16px 12px; margin: 0; color: var(--text-2); }
.grp-msgpop a.grp-q-all { text-align: center; padding: 10px 16px; font-size: var(--fs-s); text-decoration: underline; }

@media (max-width: 860px) {
  .grp-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 16px; }   /* minmax: the scrolling sub-menu must not widen the page */
  .grp-sub ul { display: flex; overflow-x: auto; border-top: 0; border-bottom: 1px solid var(--hair); scrollbar-width: thin; }
  .grp-sub a { border-bottom: 2px solid transparent; white-space: nowrap; padding: 8px 12px; margin-bottom: -1px; }
  .grp-sub a.on { box-shadow: none; background: none; border-bottom-color: var(--hair-strong); }
  .grp-vars { margin-left: 0; }
  .grp-bell { margin-left: auto; }
  .grp-bell + .umenu { margin-left: 0; }
  .grp-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .grp-card-name { font-size: 17px; }
  table.grp-matrix .grp-c { width: auto; }
}
@media (max-width: 600px) {
  .grp-cards { grid-template-columns: 1fr; }
  /* the permission matrix stays a table on a phone: a narrow grid of checkboxes reads better than cards */
  .grp-matrix-wrap { overflow-x: auto; }                     /* scrolls inside itself; never widens the page */
  table.grp-matrix { display: table; width: 100%; }
  table.grp-matrix tbody { display: table-row-group; }
  table.grp-matrix thead { display: table-header-group; }
  table.grp-matrix thead th { white-space: normal; font-size: var(--fs-xs); padding: 8px 4px; }
  table.grp-matrix tr { display: table-row; border: 0; padding: 0; margin: 0; }
  table.grp-matrix td, table.grp-matrix th { display: table-cell; padding: 8px 6px; width: auto; text-align: center; }
  table.grp-matrix th[scope=row] { text-align: left; font-size: var(--fs-s); }
  table.grp-matrix td::before { display: none; }
  table.grp-matrix th small { display: none; }
  .grp-msg { padding: 10px 12px; gap: 10px; }
  .grp-msg > .grp-inline { display: none; }
  .grp-unav-desc { max-width: none; flex: 1 1 100%; }
  .grp-unav-end { flex-wrap: wrap; }
}
