/* Owner dashboard and rota planner. Colours come from the look's variables (--brand, --ink, --muted, --line). */

/* dashboard */
.dash h1 { margin-bottom: 0; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.kpi { background: #fff; border-radius: 18px; padding: 14px; color: var(--ink); display: block; }
.kpi.hero { grid-column: 1 / -1; padding: 18px 16px; }
.klab { font-size: 13px; color: var(--muted); font-weight: 600; }
.kbig { font-size: 38px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin: 4px 0; font-variant-numeric: tabular-nums; }
.kmid { font-size: 28px; font-weight: 800; letter-spacing: -.01em; margin: 2px 0; font-variant-numeric: tabular-nums; }
.ksub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.ksub b { color: var(--ink); }
.delta { font-weight: 700; border-radius: 999px; padding: 1px 7px; font-size: 12px; }
.delta.up { color: #15803d; background: #dcfce7; }
.delta.down { color: #b91c1c; background: #fee2e2; }
.card.star { padding: 16px; background: linear-gradient(135deg, #fff 60%, #fff7e0); }
.starname { font-size: 26px; font-weight: 800; margin: 4px 0 2px; }
.card.chart { padding: 12px 14px; }
.seg.small a { padding: 6px; font-size: 13px; }
.hrow { display: grid; grid-template-columns: 18px 92px 1fr auto; gap: 8px; align-items: center; padding: 7px 0; font-size: 14px; }
.hrow .hname.wide { grid-column: span 2; }
.hpos { color: var(--muted); font-weight: 700; font-size: 12px; text-align: right; }
.hname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.hbar { height: 14px; background: transparent; position: relative; }
.hbar span { display: block; height: 100%; background: var(--brand); border-radius: 0 4px 4px 0; }
.hrow:first-child .hbar span { opacity: 1; }
.hval { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; text-align: right; min-width: 74px; }
.vchart { display: flex; align-items: flex-end; gap: 4px; height: 170px; padding-top: 18px; }
.vcol { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.vbar { width: 100%; max-width: 22px; background: var(--brand); opacity: .55; border-radius: 4px 4px 0 0; }
.vcol.now .vbar { opacity: 1; }
.vval { font-size: 10px; color: var(--muted); margin-bottom: 3px; font-variant-numeric: tabular-nums; }
.vlab { font-size: 11px; color: var(--muted); margin-top: 4px; border-top: 1px solid var(--line); width: 100%; text-align: center; padding-top: 3px; }
.rotacard { display: flex; align-items: center; padding: 14px; color: var(--ink); }
.rotacard .grow { display: flex; flex-direction: column; flex: 1; }
.status.bad { background: #fee2e2; color: #991b1b; }
.btn.danger { color: #b91c1c; border-color: #fca5a5; }

/* rota: the page may be wide on a PC */
#app.wide { max-width: 1180px; }
#app.wide .tabs { max-width: 1180px; }
.rotahead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.rotahead h2 { margin: 0 4px; font-size: 20px; }
.rotahead .seg { margin: 0 0 0 auto; min-width: 150px; }
.navb { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #fff; font-size: 22px; color: var(--ink); border: 1px solid var(--line); }
.rstats { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0; }
.rs { font-size: 13px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: #fff; color: var(--ink); }
.rs.warn { background: #fef3c7; color: #92400e; }
.rs.bad { background: #fee2e2; color: #991b1b; }
.rs.ok { background: #dcfce7; color: #166534; }
.mini-btn.plain { border-color: var(--line); color: var(--brand); text-decoration: none; display: inline-block; }
.gridwrap { overflow-x: auto; background: #fff; border-radius: 16px; border: 1px solid var(--line); -webkit-overflow-scrolling: touch; }
.rgrid { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.rgrid th, .rgrid td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; padding: 0; }
.rgrid thead th { padding: 6px 2px; font-weight: 600; color: var(--muted); background: #fff; position: sticky; top: 0; }
.rgrid thead th span { display: block; font-size: 10px; text-transform: uppercase; }
.rgrid thead th b { display: block; font-size: 14px; color: var(--ink); }
.rgrid thead th.today b { background: var(--brand); color: #fff; border-radius: 999px; width: 24px; height: 24px; line-height: 24px; margin: 0 auto; }
.rgrid .bcol { position: sticky; left: 0; z-index: 2; background: #fff; text-align: left; padding: 6px 10px; min-width: 104px; }
.rgrid tbody .bcol b { display: block; font-size: 13px; }
.rgrid tbody .bcol span { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; }
.rgrid.month td { width: 38px; min-width: 38px; height: 44px; }
.rgrid.week td { min-width: 128px; height: 56px; padding: 4px; }
.rgrid td.shut, .rgrid th.shut { background: repeating-linear-gradient(135deg, #f3f4f6 0 6px, #e9eaee 6px 12px); }
.rgrid td.cell { cursor: pointer; position: relative; }
.rgrid td.cell:hover { background: #f5f7fa; }
.rgrid td.gap { background: #fffbeb; box-shadow: inset 0 0 0 2px #f59e0b; }
.rgrid td.gap span { color: #b45309; font-weight: 800; font-size: 10px; text-transform: uppercase; }
.rgrid td.dbl { background: #fef2f2; box-shadow: inset 0 0 0 2px #ef4444; }
.rgrid td.dbl i { position: absolute; top: 1px; right: 3px; color: #dc2626; font-style: normal; font-weight: 900; font-size: 12px; }
.chip { display: inline-block; border-radius: 8px; padding: 4px 6px; font-weight: 700; font-size: 11px; cursor: grab; user-select: none; }
.chip.ph { background: #dbeafe; color: #1e3a8a; }
.chip.lo { background: #ede9fe; color: #5b21b6; }
.rgrid.week .chip { display: block; font-size: 13px; padding: 6px 8px; text-align: left; }
.chip small { display: block; font-weight: 500; font-size: 11px; opacity: .8; }
.legend { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 2px; }
.lg { display: inline-block; min-width: 26px; height: 18px; border-radius: 4px; font-size: 10px; font-weight: 800; text-align: center; line-height: 18px; }
.lg.gap { background: #fffbeb; box-shadow: inset 0 0 0 2px #f59e0b; color: #b45309; padding: 0 4px; }
.lg.dbl { background: #fef2f2; box-shadow: inset 0 0 0 2px #ef4444; color: #dc2626; }
.lg.shut { background: repeating-linear-gradient(135deg, #f3f4f6 0 4px, #e2e4e8 4px 8px); }
.tray { background: #fff; border-radius: 16px; padding: 10px 12px; border: 1px dashed var(--line); }
.trayhint { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.trow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.trow > b { font-size: 12px; color: var(--muted); width: 100%; }
.chip.big { font-size: 13px; padding: 6px 10px; }
.chip.sel { outline: 3px solid var(--brand); outline-offset: 1px; }
/* fit a whole month on a 1280px screen */
#app.wide { max-width: 1440px; }
#app.wide .tabs { max-width: 1440px; }
.rgrid.month td { width: 35px; min-width: 35px; }
.rgrid.month .chip { padding: 3px 3px; font-size: 11px; }
.rgrid .bcol { min-width: 84px; padding: 6px 8px; }
/* short-dated stock */
.card.sd { padding: 14px; }
.sdtop { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.sdmeta { font-size: 14px; margin: 8px 0 6px; }
.sdthumbs { display: flex; gap: 8px; margin: 8px 0; }
.sdthumbs img { width: 96px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.sdact { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.card.sdslot { padding: 14px; }
.sdphoto { width: 100%; border-radius: 10px; margin: 10px 0 0; display: block; }
.kpi.warnk .kmid { color: #b45309; }
.kpi.badk .kmid { color: #b91c1c; }
