:root {
  --green: #38554a;
  --green-deep: #2b423a;
  --green-soft: #46685b;
  --coral: #e07a5f;
  --coral-deep: #c9684f;
  --sage: #a9b8a4;
  --sage-soft: #c9d3c4;
  --sage-deep: #86977f;
  --cream: #f6f1e7;
  --cream-deep: #efe8d9;
  --paper: #fffdf9;
  --ink: #22302a;
  --muted: #5f6f66;
  --line: #e7e0d1;
  --amber: #d99a44;
  --go: #5e9a6f;
  --grey: #9ba69e;
  --ok: #2f6b48;
  --bad: #b84530;
  --radius: 16px;
  --radius-lg: 20px;
  /* teplejší, měkčí stín (odstín do hněda místo čistě černé) */
  --shadow: 0 1px 2px rgba(74, 58, 40, 0.04), 0 10px 30px rgba(74, 58, 40, 0.07);
  --display: 'Bricolage Grotesque', 'Trebuchet MS', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  /* jemné teplé nádechy v rozích — vřelost bez vizuálního šumu */
  background:
    radial-gradient(1100px 520px at 88% -140px, rgba(224, 122, 95, .055), transparent 62%),
    radial-gradient(950px 560px at -120px 30%, rgba(169, 184, 164, .12), transparent 60%),
    var(--cream);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(224, 122, 95, .28);
}

button {
  font: inherit;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 236px;
  flex: 0 0 236px;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  background: linear-gradient(180deg, var(--green) 0%, var(--green-deep) 100%);
  color: #eef2ec;
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 0 4px 4px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.brand svg {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  display: block;
}

.brand b {
  display: block;
  color: #fff;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .2px;
  line-height: 1.05;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: var(--sage-soft);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.nav-eyebrow {
  font-size: 10px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--sage);
  margin: 26px 8px 8px;
  font-weight: 600;
}

.nav-list {
  display: grid;
  gap: 2px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #dde6dd;
  text-align: left;
  font-size: 14.5px;
  font-weight: 500;
  margin-bottom: 2px;
}

.nav-btn .nb-ico {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  opacity: 0.85;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav-btn .nb-ico svg {
  width: 100%;
  height: 100%;
}
.nav-btn .nb-count {
  margin-left: auto;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.14);
  padding: 1px 6px;
  border-radius: 20px;
  color: #fff;
  font-weight: 600;
}
.nav-btn.active .nb-count {
  background: rgba(0, 0, 0, 0.16);
}

.nav-btn.active {
  background: var(--coral);
  color: #fff;
}

.nav-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.nav-btn:not(.active):not(:disabled):hover {
  background: var(--green-soft);
  color: #fff;
  cursor: pointer;
}

.group-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0 0;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.group-btn {
  min-height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 4px 9px;
  background: transparent;
  color: #dfe7df;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.group-btn.active {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.group-btn[data-group-filter="eas"].active {
  background: var(--green-deep);
}

.group-btn[data-group-filter="ass"].active {
  background: var(--coral);
}

.group-btn[data-group-filter="ask"].active {
  background: #b9852f;
}

.group-btn[data-group-filter="das"].active {
  background: var(--sage);
  color: var(--green-deep);
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.session-card {
  min-height: 52px;
  margin-bottom: 10px;
  padding: 8px 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12.5px;
  cursor: pointer;
  transition: background .12s;
}

.session-card:hover {
  background: rgba(255, 255, 255, 0.14);
}

.session-card b {
  display: block;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-card span {
  color: var(--sage-soft);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .7px;
}

/* Sync indikátor */
.sync {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--sage-soft);
  margin-bottom: 10px;
  padding: 0 2px;
}
.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--go);
  flex: 0 0 7px;
}
.sync.saving .sync-dot { background: var(--amber); }
.sync.error .sync-dot { background: var(--coral); }

.btn {
  width: 100%;
  min-height: 38px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: background .14s ease, box-shadow .14s ease, transform .14s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn svg,
.pd-back svg {
  width: 16px;
  height: 16px;
}

.btn + .btn {
  margin-top: 8px;
}

.btn-primary {
  background: linear-gradient(180deg, var(--coral) 0%, var(--coral-deep) 130%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(224, 122, 95, .28);
}

.btn-primary:hover {
  background: var(--coral-deep);
}

.btn-ghost {
  background: transparent;
  color: var(--green);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  background: var(--cream-deep);
  border-color: var(--sage);
}

.sidebar .btn-ghost {
  background: transparent;
  color: #dfe7df;
  border-color: rgba(255, 255, 255, 0.2);
}

.sidebar .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.main {
  flex: 1;
  min-width: 0;
  margin-left: 236px;
  padding: 52px 48px 96px;
  max-width: 1180px;
}

.view-head {
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0;
  color: var(--coral-deep);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1, h1.view-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: 30px;
  margin: 5px 0 0;
  letter-spacing: -.3px;
  color: var(--ink);
  line-height: 1.15;
}

.head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.view-sub {
  max-width: 68ch;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14.5px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.card {
  padding: 17px 19px;
}

.pad {
  padding: 18px 20px;
}

.wide {
  grid-column: 1 / -1;
}

h2 {
  margin: 0 0 12px;
  color: var(--green-deep);
  font-size: 18px;
}

.panel-body {
  font-size: 14px;
}

.panel-note {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.muted {
  color: var(--muted);
}

.ok {
  color: var(--ok);
  font-weight: 850;
}

.bad {
  color: var(--bad);
  font-weight: 850;
}

.readonly-mode .collection-panel form.write-form,
.readonly-mode .collection-panel form.comment-form,
.readonly-mode .collection-panel .create-panel {
  display: none;
}

.kv {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 7px 14px;
  margin: 0;
}

.kv dt {
  color: var(--muted);
  font-weight: 800;
}

.kv dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.steps {
  margin: 0;
  padding-left: 21px;
}

.steps li {
  margin: 7px 0;
}

.steps .done {
  color: var(--ok);
  font-weight: 750;
}

.collection-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.small-btn {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 11px;
  background: var(--cream-deep);
  color: var(--green-deep);
  font-weight: 800;
  cursor: pointer;
}

.small-btn:hover {
  background: var(--cream);
}

.collection-panel {
  min-height: 160px;
}

.load-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  padding: 30px 18px;
}
.load-error p { margin: 0; }
.load-error .btn { min-width: 160px; }

#collection-view > .card {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#collection-view.is-detail .collection-head {
  display: none;
}

#collection-view.view-people .collection-head,
#collection-view.view-projects .collection-head,
#collection-view.view-meetings .collection-head,
#collection-view.view-tasks .collection-head,
#collection-view.view-workload .collection-head,
#collection-view.view-ideas .collection-head,
#collection-view.view-directChats .collection-head {
  display: none;
}

.collection-hero {
  margin-bottom: 20px;
}

.collection-hero .eyebrow {
  color: var(--coral-deep);
  font-weight: 700;
  letter-spacing: 2px;
}

.meet-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.meet-chip {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--green-deep);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.meet-chip:hover { background: var(--cream); }
.meet-chip.on { background: var(--coral); border-color: var(--coral); color: #fff; }

.item-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.item-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  background: #fbfaf7;
}

.item-card-click {
  cursor: pointer;
}

.item-card-click:hover {
  border-color: var(--sage);
  background: #fff;
}

.item-card h3 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 16px;
}

.item-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--cream-deep);
  color: var(--green-deep);
  font-size: 12px;
  font-weight: 750;
}

.workload-row {
  display: grid;
  gap: 8px;
}

.workload-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.workload-head h3 {
  margin: 0;
}

.workload-head strong {
  color: var(--green-deep);
  font-size: 22px;
  line-height: 1;
}

.workload-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--cream-deep);
}

.workload-bar span {
  display: block;
  min-width: 4px;
  height: 100%;
  border-radius: inherit;
}

.workload-bar .ok {
  background: var(--ok);
}

.workload-bar .warn {
  background: #b9852f;
}

.workload-bar .bad {
  background: var(--bad);
}

.workload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.workload-preview span {
  max-width: 100%;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--cream);
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1.5px dashed rgba(134, 151, 127, .4);
  border-radius: var(--radius);
  background: rgba(255, 253, 249, .5);
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
  padding: 22px;
}

.detail-card {
  display: grid;
  gap: 16px;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.detail-head h2 {
  margin-bottom: 0;
}

.detail-section {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.detail-section h3 {
  margin: 0 0 9px;
  color: var(--green-deep);
  font-size: 16px;
}

.project-detail {
  gap: 18px;
}

.project-hero {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.project-hero h2 {
  margin: 2px 0 8px;
  font-size: 28px;
  line-height: 1.12;
}

.project-hero p {
  max-width: 78ch;
  margin: 0;
  color: var(--muted);
}

.project-focus-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.project-focus-grid article,
.project-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfaf7;
}

.project-focus-grid article {
  padding: 12px;
}

.project-focus-grid span,
.finance-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.project-focus-grid b {
  display: block;
  margin-top: 4px;
  color: var(--green-deep);
  font-size: 16px;
  overflow-wrap: anywhere;
}

.project-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr);
  gap: 14px;
  align-items: start;
}

.project-main,
.project-side {
  display: grid;
  gap: 14px;
}

.project-panel {
  padding: 15px;
}

.project-panel h3,
.project-panel h4 {
  margin: 0;
  color: var(--green-deep);
}

.project-panel h3 {
  font-size: 17px;
}

.project-panel h4 {
  margin-bottom: 8px;
  font-size: 14px;
}

.project-panel > p {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.project-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.project-task-list,
.project-mini-list,
.project-person-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.project-task-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 9px 0 0;
  cursor: pointer;
}

.project-task-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.project-task-row.done {
  opacity: 0.62;
}

.project-task-check {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ok);
  font-size: 12px;
  font-weight: 900;
}

.project-task-main {
  min-width: 0;
}

.project-task-main b,
.project-task-main small {
  display: block;
  overflow-wrap: anywhere;
}

.project-task-main small {
  color: var(--muted);
  font-size: 12px;
}

.project-task-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.project-mini-list li {
  display: grid;
  grid-template-columns: minmax(86px, 0.32fr) minmax(0, 1fr);
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.project-mini-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.project-mini-list span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.project-person-list li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.project-person-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.project-person-list li > span:last-child {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
}

.person-dot {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--green-deep);
  font-size: 11px;
  font-weight: 900;
}

.finance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.finance-grid span {
  border-radius: 10px;
  padding: 10px;
  background: var(--cream);
}

.finance-grid b {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
}

.mini-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mini-list li {
  display: grid;
  grid-template-columns: minmax(120px, 0.36fr) minmax(0, 1fr);
  gap: 12px;
  padding: 9px 10px;
  border-radius: 9px;
  background: #fbfaf7;
}

.mini-list b {
  overflow-wrap: anywhere;
}

.mini-list span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.comment-form {
  display: grid;
  gap: 10px;
}

.comment-form textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.comment-form textarea:focus {
  outline: 2px solid rgba(224, 115, 88, 0.22);
  border-color: var(--coral);
}

.comment-form .small-btn {
  justify-self: start;
}

.create-panel {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px dashed rgba(47, 85, 69, .22);
  border-radius: 8px;
  background: rgba(255, 250, 241, .58);
}

.create-panel h3 {
  margin: 0 0 10px;
  color: var(--green-deep);
  font-size: 16px;
}

.write-form {
  display: grid;
  gap: 10px;
}

.field {
  display: grid;
  gap: 5px;
}

.field label,
.field-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid rgba(224, 115, 88, 0.22);
  border-color: var(--coral);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.write-form .small-btn {
  justify-self: start;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 750;
}

.check-row input {
  width: 16px;
  height: 16px;
}

.check-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.audit-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  background: #fbfaf7;
}

.audit-main h3 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 16px;
}

.audit-main p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}

.audit-meta {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 5px 12px;
  margin: 0;
  font-size: 13px;
}

.audit-meta dt {
  color: var(--muted);
  font-weight: 800;
}

.audit-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* Debug log — skrytý v produkci */
.log-card {
  display: none;
}

pre {
  margin: 0;
  padding: 16px 18px;
  overflow: auto;
  color: var(--ink);
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

/* === Toast notifikace === */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--green-deep);
  color: #fff;
  padding: 11px 20px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  opacity: 0;
  pointer-events: none;
  transition: .22s;
  z-index: 60;
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* === Stat karty přehled === */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.stat .big {
  font-family: var(--display);
  font-weight: 800;
  font-size: 38px;
  line-height: 1;
  letter-spacing: -1px;
}
.stat .lab {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 8px;
  font-weight: 500;
}
.stat.accent .big { color: var(--coral); }
.stat.warn .big { color: var(--amber); }
.stat .corner {
  position: absolute;
  right: -12px;
  top: -12px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  opacity: .07;
}
.badge-over {
  font-size: 11px;
  font-weight: 600;
  color: var(--coral-deep);
  background: #fbeee9;
  border-radius: 20px;
  padding: 2px 7px;
  margin-left: 6px;
}

/* === Dashboard dvousloupcový grid === */
.dash-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 22px;
  margin-top: 0;
}
.dash-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}
.dash-grow { flex: 1 1 auto; }

/* === Řádky tline (úkoly ve výpisu) === */
.tline {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
  border-radius: 8px;
  transition: background .1s;
}
.tline:first-of-type { border-top: 0; }
.tline:hover { background: var(--cream); }
.tdate {
  flex: 0 0 84px;
  font-weight: 700;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}
.tdate.over { color: var(--coral-deep); }
.tbody { flex: 1; min-width: 0; }
.tt { font-size: 14px; font-weight: 600; color: var(--ink); }
.tdet { font-size: 12.5px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tk-dl { flex: 0 0 auto; text-align: right; font-size: 13px; font-weight: 700; }
.tk-dl small { display: block; font-size: 10.5px; font-weight: 500; color: var(--muted); }
.tk-dl.over { color: var(--coral-deep); }
.over-tag { color: var(--coral-deep); font-weight: 700; }

/* === Aktivní projekty — řádkový přehled === */
.pj-line {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 8px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  border-radius: 8px;
  transition: background .1s;
}
.pj-line:first-of-type { border-top: 0; }
.pj-line:hover { background: var(--cream); }
.pj-line .pn { font-size: 14px; font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pj-line .pn-num { color: var(--muted); margin-right: 4px; font-weight: 700; }
.pj-line .po { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; }

/* === Meetcard / porady === */
.meetcard {
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: border-color .12s;
}
.meetcard:hover { border-color: var(--sage); }
.mc-date {
  flex: 0 0 auto;
  text-align: center;
  background: var(--green);
  color: #fff;
  border-radius: 11px;
  padding: 9px 13px;
  line-height: 1;
}
.mc-date.future { background: var(--amber); }
.mc-date .d { font-family: var(--display); font-weight: 800; font-size: 22px; }
.mc-date .my { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; margin-top: 3px; color: rgba(255,255,255,.8); }
.meetcard-body { flex: 1; min-width: 0; }
.meetslot-label { font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.meetcard-when { font-size: 14px; font-weight: 600; color: var(--ink); }
.meetcard-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.meetslot { background: var(--paper); }
.meetslot-none { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* === Panel title === */
.panel-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  margin: 0 0 2px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.empty-mini {
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 0;
}

/* === Pill soft === */
.pill-soft {
  background: var(--cream-deep);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

/* === Task karta přehled === */
.tk {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  border-radius: 8px;
  transition: background .1s;
}
.tk:first-of-type { border-top: 0; }
.tk:hover { background: var(--cream); }
.tk-main { flex: 1; min-width: 0; }
.tk-title { font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 3px; align-items: center; }

.mobile-session-only {
  display: none !important;
}
.mobile-welcome-bar-only {
  display: none;
}

/* === Mobilní responzivita === */
@media (max-width: 860px) {
  /* Záchranná síť proti horizontálnímu přetečení (clip = nerozbije sticky ani scroll). */
  html, body { overflow-x: clip; }
  .main { max-width: 100%; }
  .mobile-session-only {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin-left: auto;
  }
  .btn-mobile-logout {
    background: transparent;
    border: none;
    color: var(--cream);
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background .12s, color .12s;
  }
  .btn-mobile-logout:hover {
    background: rgba(255, 255, 255, 0.15);
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .project-actions {
    width: 100% !important;
    flex: 1 1 100% !important;
  }
  .project-actions .btn,
  .project-actions .pd-back {
    flex: 1 1 auto !important;
    justify-content: center !important;
  }
  .floating-chat-fab {
    bottom: calc(86px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .floating-chat-panel {
    bottom: calc(78px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .floating-chat-dock, .floating-chat-dock.hub-open {
    display: none !important;
  }
  .frow {
    grid-template-columns: 1fr !important;
  }
  .modal-foot {
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
    gap: 8px !important;
  }
  .modal-foot .btn {
    flex: 1 1 auto;
  }

  .app-shell {
    flex-direction: column;
    margin-top: 0;
  }
  .sidebar {
    position: fixed;
    left: 0; right: 0;
    top: 0;
    bottom: auto;
    height: auto;
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 8px 16px;
    padding-top: calc(8px + env(safe-area-inset-top, 0px));
    gap: 9px;
    z-index: 40;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    overflow: visible;
  }
  .brand { padding: 0; }
  .brand svg { width: 44px; height: 44px; flex: 0 0 44px; }
  .brand b { font-size: 16px; line-height: 1; }
  .brand small { display: none; }
  .nav-eyebrow { display: none; }
  .sidebar-foot { display: none; }
  .group-filter { display: none; }
  /* spodní navigační tab bar */
  .nav-list {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    gap: 2px;
    background: var(--green-deep);
    border-top: 1px solid rgba(255,255,255,.14);
    box-shadow: 0 -3px 14px rgba(0,0,0,.16);
    padding: 6px 5px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    z-index: 45;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-welcome-bar-only {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(6px + env(safe-area-inset-bottom, 0px) / 2);
    text-align: center;
    font-size: 9px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    pointer-events: none;
    line-height: 1;
  }
  .nav-btn {
    flex: 1 1 0;
    min-width: 46px;
    margin: 0;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 3px;
    border-radius: 11px;
    font-size: 9.5px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.05;
  }
  .nav-btn .nb-ico { display: block; width: 21px; height: 21px; flex: 0 0 21px; margin: 0; }
  .nav-btn .nb-count { display: none; }
  .nav-list-secondary { display: none; }
  .main {
    margin-left: 0;
    margin-top: calc(56px + env(safe-area-inset-top, 0px));
    padding: 20px 16px calc(110px + env(safe-area-inset-bottom, 0px));
  }
  /* Finance button nesmí být výrazně větší než ostatní tlačítka */
  .project-actions [data-proj-finance] {
    flex: 1 1 auto !important;
    max-width: none;
  }
  h1, h1.view-title { font-size: 24px; }
  .stat-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
  .stat { padding: 13px; }
  .stat .big { font-size: 26px; }
  .stat .lab { font-size: 11px; }
  .dash-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 16px; }
  .grid { grid-template-columns: 1fr; }
}

/* Přehled / dashboard */
.dash-hero {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-deep) 100%);
  color: var(--cream);
  border-radius: 18px;
  padding: 22px 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.dash-hero.muted,
.dash-hero.bad {
  background: var(--paper);
  color: var(--muted);
  box-shadow: none;
  border: 1px solid var(--line);
}
.dash-hero.bad {
  color: var(--bad);
  border-color: var(--bad);
}
.dash-hello {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.dash-sub {
  margin-top: 4px;
  opacity: 0.92;
  font-size: 0.92rem;
}

/* dash-grid je definován výše v sekci stat karet */

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.card-head h2 {
  margin: 0;
}
.pill {
  background: var(--coral);
  color: var(--green-deep);
  font-weight: 700;
  font-size: 0.8rem;
  min-width: 1.5rem;
  text-align: center;
  padding: 1px 9px;
  border-radius: 999px;
}
.pill:empty {
  display: none;
}

.dash-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dash-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.dash-row:hover {
  background: var(--sage-soft);
}
.dash-row-main {
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-row-side {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.dash-meta {
  color: var(--muted);
  font-size: 0.82rem;
}
.dash-more {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 6px 2px 0;
}

.dash-stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.dash-stat {
  display: flex;
  flex-direction: column;
}
.dash-stat b {
  font-size: 1.6rem;
  color: var(--green-deep);
  line-height: 1;
}
.dash-stat span {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 2px;
}

@media (max-width: 900px) {
  .project-focus-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-layout,
  .project-two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .project-focus-grid {
    grid-template-columns: 1fr;
  }

  .project-task-row {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .project-task-tags {
    grid-column: 2;
    justify-content: flex-start;
  }
}

.foot-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: 0;
  color: #cdd6cd;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: .12s;
  font-family: inherit;
  margin-top: 4px;
}
.foot-btn:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.foot-btn.active {
  background: var(--coral);
  color: #fff;
  border-color: var(--coral);
}

@media (max-width: 480px) {
  .stat-row {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 400px) {
  .login-card {
    padding: 32px 20px !important;
  }
  .login-title {
    font-size: 40px !important;
  }
}
