/* ===== Step 2: navigation, roster, schedule, sheet ===== */

/* demo bar + view-as switch */
.demo-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; }
.demo-bar .demo-pill { margin-top: 0; }
.viewas { display: inline-flex; align-items: center; gap: 4px; background: var(--card); border-radius: 999px; padding: 3px; box-shadow: var(--shadow); font-size: 13px; font-weight: 800; }
.viewas > span { color: var(--muted); padding: 0 6px 0 8px; }
.viewas button { padding: 5px 10px; border-radius: 999px; color: var(--muted); }
.viewas button[aria-pressed="true"] { background: var(--sage); color: var(--olive-dark); }

/* buttons */
.btn {
  min-height: 46px; padding: 0 18px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 800; font-size: 16px; background: var(--card);
  border: 2px solid var(--line); color: var(--olive-dark);
}
.btn.primary { background: var(--olive); border-color: var(--olive); color: #fff; --icon-fill: transparent; }
.btn.primary:hover { background: var(--olive-hover); border-color: var(--olive-hover); }
.btn.ghost { border-color: transparent; background: none; }
.btn.danger { color: var(--danger-ink); }
.btn.danger.confirm { background: var(--peach); }
.round-btn {
  width: 44px; height: 44px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow);
  font-size: 26px; font-weight: 800; line-height: 1; color: var(--olive-dark); display: grid; place-items: center; padding-bottom: 3px;
}

/* headings */
.page-head h1, .roster-top h1 { font-size: 28px; margin: 14px 0 4px; font-weight: 900; color: var(--olive-dark); }
.hint { font-size: 14px; color: var(--muted); font-weight: 600; text-align: center; margin: 14px 0; }
.hint.left { text-align: left; margin: 6px 0 12px; }
.today-tag { font-style: normal; font-size: 12px; font-weight: 900; background: var(--gold); color: var(--gold-ink); padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: 2px; }
.empty-note { color: var(--muted); font-weight: 700; padding: 10px 12px; margin: 0; display: flex; align-items: center; gap: 8px; }
.empty-note.warn { background: var(--peach); color: var(--peach-ink); border-radius: 14px; margin: 4px 8px 8px; --icon-fill: var(--card); }

/* week navigation */
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0; }
.week-label { text-align: center; line-height: 1.2; }
.week-label b { display: block; font-size: 18px; }
.week-label span, .week-label button { font-size: 13px; font-weight: 800; color: var(--muted); }
.week-label button { color: var(--olive); text-decoration: underline; padding: 2px; }

/* staff: my week */
.total-card {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin-bottom: 12px;
  background: var(--olive-soft); border-radius: 16px; color: var(--olive-dark); font-weight: 700; --icon-fill: var(--card);
}
.week-list { padding: 6px; }
.week-row { display: flex; gap: 12px; padding: 10px; border-radius: 16px; align-items: flex-start; }
.week-row.is-today { background: var(--butter-soft); outline: 2px solid var(--butter); }
.week-row.muted .info b { color: var(--muted); font-weight: 700; }
.week-row .info { flex: 1; min-width: 0; padding-top: 4px; }
.week-row .info b { display: block; font-size: 17px; }
.week-row .info > span { color: var(--muted); font-size: 14px; font-weight: 600; }
.bg-none { background: var(--chip); color: var(--muted); }
.mates { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--olive-dark); }
.avatar-row.small .avatar { width: 30px; height: 30px; font-size: 12px; border-width: 2px; }
.avatar-row.small .avatar + .avatar { margin-left: -8px; }

/* manager phone: day strip + team cards */
.day-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 14px; }
.day-pill {
  display: flex; flex-direction: column; align-items: center; padding: 8px 0 6px; border-radius: 16px;
  background: var(--card); box-shadow: var(--shadow); line-height: 1.1; min-height: 66px;
}
.day-pill span { font-size: 11.5px; font-weight: 800; text-transform: uppercase; color: var(--muted); }
.day-pill b { font-size: 19px; font-weight: 900; margin: 2px 0; }
.day-pill small { font-size: 10.5px; font-weight: 800; color: var(--muted); }
.day-pill.is-today { outline: 2px solid var(--gold); }
.day-pill.sel { background: var(--olive); }
.day-pill.sel span, .day-pill.sel b, .day-pill.sel small { color: #fff; }
.day-title { font-size: 18px; margin: 0 2px 10px; color: var(--olive-dark); }
.off-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; font-weight: 800; color: var(--muted); margin: 0 2px 12px; }
.off-chip { background: var(--peach); color: var(--peach-ink); padding: 3px 10px; border-radius: 999px; }
.team-card { padding: 6px 6px 8px; margin-bottom: 12px; }
.team-head { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 10px 4px; }
.team-head h3 { margin: 0; font-size: 17px; color: var(--olive-dark); }
.team-head span { font-size: 13px; font-weight: 800; color: var(--muted); }
.roster-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 14px; text-align: left; }
.roster-row:hover { background: var(--cream); }
.roster-row .avatar { border: 0; }
.roster-row .info { flex: 1; min-width: 0; }
.roster-row .info b { display: block; font-size: 16px; }
.roster-row .info span { font-size: 14px; color: var(--muted); font-weight: 700; }
.type-tag { font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; color: var(--olive-dark); }
.fab {
  position: fixed; z-index: 11; right: max(16px, calc(50vw - 240px + 16px));
  bottom: calc(92px + env(safe-area-inset-bottom));
  width: 62px; height: 62px; border-radius: 50%; background: var(--olive); color: #fff;
  display: grid; place-items: center; box-shadow: 0 6px 16px rgba(74, 86, 36, .3);
}

/* ===== Computer: sidebar + wide grid ===== */
.sidebar { display: none; }
@media (min-width: 900px) {
  body.with-sidebar .sidebar {
    display: flex; flex-direction: column; gap: 18px;
    position: fixed; inset: 0 auto 0 0; width: 220px; padding: 22px 14px;
    background: var(--card); border-right: 1px solid var(--line); z-index: 12;
  }
  .sidebar .logo { width: 120px; margin: 0 8px 8px; }
  .sidebar nav { display: flex; flex-direction: column; gap: 4px; }
  .sidebar .tab { flex-direction: row; gap: 10px; padding: 8px 10px; font-size: 16px; justify-content: flex-start; }
  .sidebar .tab .ico { width: 44px; }
  body.with-sidebar .tabbar { display: none; }
  body.with-sidebar .app { margin-left: 220px; padding-bottom: 40px; }
  body.with-sidebar .app:not(.wide) { margin-left: max(220px, calc(50vw - 240px + 110px)); }
  body.with-sidebar .toast { bottom: 28px; margin-left: 110px; }
  .app.wide { max-width: none; padding: 16px 28px 40px; }
}

.roster-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.roster-top h1 { margin-top: 0; }
.roster-tools { display: flex; align-items: center; gap: 16px; }
.roster-tools .week-nav { margin: 0; gap: 14px; }
.grid-wrap { overflow-x: auto; padding: 4px; }
.roster-grid { display: grid; grid-template-columns: 190px repeat(7, minmax(104px, 1fr)) 92px; min-width: 1010px; }
.rg-corner, .rg-day { padding: 10px 8px; font-weight: 800; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.rg-corner.foot { border-top: 1px solid var(--line); }
.rg-day { text-align: center; line-height: 1.15; }
.rg-day b { display: block; font-size: 20px; color: var(--ink); letter-spacing: 0; }
.rg-day.is-today { background: var(--butter); border-radius: 14px 14px 0 0; color: var(--butter-ink); }
.rg-team { grid-column: 1 / -1; padding: 14px 10px 6px; font-weight: 900; font-size: 15px; color: var(--olive); border-top: 1px solid var(--line); }
.rg-name { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-top: 1px solid var(--line-soft); }
.rg-name .avatar { width: 36px; height: 36px; font-size: 13px; border: 0; }
.rg-name b { display: block; font-size: 15px; line-height: 1.2; }
.rg-name small { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.mgr { font-style: normal; font-size: 10.5px; font-weight: 900; background: var(--olive-soft); color: var(--olive-dark); padding: 1px 6px; border-radius: 6px; vertical-align: 1px; }
.rg-cell {
  min-height: 52px; padding: 5px; border-top: 1px solid var(--line-soft); border-left: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 4px; justify-content: center; position: relative;
}
.rg-cell.is-today { background: var(--butter-soft); }
.rg-cell.is-off { background: repeating-linear-gradient(-45deg, var(--peach-hatch), var(--peach-hatch) 6px, var(--peach-soft) 6px, var(--peach-soft) 12px); }
.rg-cell.drop-over { background: var(--olive-soft); outline: 2px dashed var(--olive); outline-offset: -3px; border-radius: 10px; }
.off-tag { font-size: 12px; font-weight: 900; color: var(--danger-ink); text-align: center; }
.shift-chip {
  width: 100%; padding: 7px 6px; border-radius: 10px; font-size: 13.5px; font-weight: 800; color: var(--ink);
  cursor: grab; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: transform .1s ease, box-shadow .1s ease;
}
.shift-chip:hover { box-shadow: 0 2px 8px rgba(74, 86, 36, .18); transform: translateY(-1px); }
.shift-chip.dragging { opacity: .4; }
.cell-add {
  width: 100%; height: 38px; border-radius: 10px; color: var(--olive); opacity: 0;
  display: grid; place-items: center; border: 2px dashed var(--line-strong); --icon-fill: transparent;
}
.rg-cell:hover .cell-add, .cell-add:focus-visible { opacity: 1; }
@media (hover: none) { .cell-add { opacity: .5; } }
.rg-count { text-align: center; padding: 10px 4px; font-size: 13px; font-weight: 800; color: var(--muted); border-top: 1px solid var(--line); }

/* ===== Bottom sheet (phone) / dialog (computer) ===== */
.sheet {
  border: 0; padding: 0; background: var(--card); color: var(--ink);
  width: 100%; max-width: 480px; margin: auto auto 0; border-radius: 26px 26px 0 0;
  max-height: 92dvh;
}
.sheet::backdrop { background: rgba(46, 51, 34, .35); }
.sheet[open] { animation: sheet-up .22s ease-out; }
@keyframes sheet-up { from { transform: translateY(30px); opacity: 0; } }
@media (min-width: 700px) { .sheet { margin: auto; border-radius: 24px; } }
.sheet form { padding: 10px 20px calc(20px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }
.sheet-grip { width: 44px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 2px; }
.sheet h2 { margin: 0; font-size: 22px; color: var(--olive-dark); font-weight: 900; }
.sheet label { display: flex; flex-direction: column; gap: 5px; font-size: 14px; font-weight: 800; color: var(--muted); }
.sheet input, .sheet select {
  font: inherit; font-size: 17px; font-weight: 700; color: var(--ink);
  min-height: 50px; padding: 0 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--cream);
  width: 100%;
}
.sheet input:focus, .sheet select:focus { outline: none; border-color: var(--olive); background: var(--card); }
.sheet .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.soft-warn { margin: 0 0 6px; padding: 10px 12px; border-radius: 14px; background: var(--peach); color: var(--peach-ink); font-weight: 700; font-size: 15px; display: flex; gap: 8px; align-items: flex-start; --icon-fill: var(--card); }
.form-error { margin: 0; color: var(--danger-ink); font-weight: 800; font-size: 15px; }
.sheet-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 4px; }
.sheet-actions .right { display: flex; gap: 8px; }

/* toast kinds */
.toast.info { background: var(--toast-info); }
.toast.warn { background: var(--peach); color: var(--peach-ink); }

/* placeholder screens */
.placeholder { text-align: center; padding: 40px 20px; margin-top: 24px; color: var(--olive-dark); }
.placeholder .ico { width: 84px; height: 84px; border-radius: 26px; background: var(--sage); display: grid; place-items: center; margin: 0 auto 10px; }
.placeholder h1 { margin: 6px 0; font-size: 24px; }
.placeholder p { margin: 0; color: var(--muted); font-weight: 700; }

/* ===== Draft and publish ===== */
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); box-shadow: 0 3px 0 var(--gold-dark); }
.btn.gold:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--gold-dark); }
.btn.ghost.confirm { background: var(--peach); color: var(--peach-ink); }

.publish-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  background: var(--butter); border: 2px dashed var(--gold); border-radius: 18px;
  padding: 12px 14px; margin: 0 0 14px;
}
.publish-bar .pb-text b { display: block; font-size: 17px; color: var(--butter-ink); }
.publish-bar .pb-text span { font-size: 14px; font-weight: 700; color: var(--butter-ink2); }
.publish-bar .pb-actions { display: flex; gap: 6px; margin-left: auto; }
.publish-bar.ok {
  background: var(--olive-soft); border: 0; justify-content: flex-start; gap: 10px;
  font-size: 14px; font-weight: 700; color: var(--olive-dark); padding: 10px 14px; --icon-fill: none;
}
.publish-bar.ok svg { color: var(--ok); flex: none; }

/* draft shifts: dashed outline + gold corner dot */
.shift-chip.draft, .shift-chip.edited {
  background: var(--card); outline: 2px dashed var(--gold); outline-offset: -2px; position: relative;
}
.shift-chip.draft i, .shift-chip.edited i {
  position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold);
}
.shift-chip.removed {
  background: var(--line-soft); color: var(--muted); text-decoration: line-through; cursor: pointer;
  outline: 2px dashed var(--line-strong); outline-offset: -2px;
}
.legend-draft { background: var(--card) !important; outline: 2px dashed var(--gold); outline-offset: -2px; }
.legend .legend-draft { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 5px; vertical-align: -1px; }

.day-pill { position: relative; }
.draft-dot { position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.draft-tag { background: var(--card); color: var(--butter-ink); outline: 2px dashed var(--gold); outline-offset: -2px; }
.roster-row.draft, .roster-row.edited { background: var(--butter-soft); }
.roster-row.removed { opacity: .65; }
.roster-row.removed .info b, .roster-row.removed .info span { text-decoration: line-through; }
.roster-row.removed .draft-tag { outline-color: var(--line-strong); color: var(--muted); }

.draft-note { margin: 0; font-size: 14px; font-weight: 700; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.draft-note i { width: 14px; height: 14px; flex: none; border-radius: 4px; outline: 2px dashed var(--gold); outline-offset: -2px; }

.publish-sheet { padding: 10px 20px calc(20px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }
.pub-list { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.pub-list li { background: var(--butter); color: var(--butter-ink); font-weight: 700; padding: 6px 12px; border-radius: 999px; }
.pub-people-label { margin: 0; font-weight: 800; color: var(--muted); font-size: 14px; }
.pub-people { display: flex; flex-wrap: wrap; gap: 8px; }
.pub-people span { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; background: var(--cream); padding: 4px 12px 4px 4px; border-radius: 999px; }
.pub-people .avatar { width: 32px; height: 32px; font-size: 12px; border: 0; }

/* ===== hours totals ===== */
.rg-team { display: flex; justify-content: space-between; align-items: baseline; }
.rg-team b { font-size: 13px; color: var(--muted); font-weight: 800; padding-right: 10px; }
.rg-total-head { background: var(--olive-soft); border-radius: 14px 14px 0 0; color: var(--olive-dark); }
.rg-total-head b { font-size: 15px; color: var(--olive-dark); }
.rg-total { display: grid; place-items: center; border-top: 1px solid var(--line-soft); border-left: 1px solid var(--line); background: var(--olive-softer); }
.hrs { font-weight: 900; font-size: 15px; color: var(--olive-dark); padding: 3px 10px; border-radius: 999px; }
.hrs.over { background: var(--peach); color: var(--peach-ink); }
.rg-count { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.rg-count b { font-size: 15px; color: var(--olive-dark); }
.rg-count span { font-size: 12px; }
.rg-grand { background: var(--olive); border-radius: 0 0 14px 14px; }
.rg-grand b, .rg-grand span { color: #fff; }
.week-sum { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; }
.week-sum .stat { padding: 10px 14px; min-width: 120px; }
.week-sum .stat b { font-size: 20px; }
.day-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 12px; }
.day-sum span { background: var(--card); box-shadow: var(--shadow); border-radius: 16px; padding: 8px 10px; font-size: 12.5px; font-weight: 800; color: var(--muted); display: flex; flex-direction: column; }
.day-sum b { font-size: 19px; color: var(--olive-dark); }
.over-text { color: var(--danger-ink); font-weight: 900; }
.hrs-mini { font-size: 12px; font-weight: 800; color: var(--muted); background: var(--chip); padding: 1px 7px; border-radius: 999px; margin-left: 4px; vertical-align: 2px; }
.hrs-mini.over { background: var(--peach); color: var(--peach-ink); }
