/* Member dashboard and staff workspace */

/* ---------- App bar ---------- */
.appbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
}
.appbar-in { display: flex; align-items: center; justify-content: space-between; gap: .6rem; min-height: 60px; }
.brand { display: inline-flex; gap: .55rem; align-items: center; text-decoration: none; color: var(--ink); font-family: var(--f-head); font-weight: 700; font-size: 1.12rem; }
.brand img { width: 34px; height: 34px; border-radius: 7px; }
.appbar-actions { display: flex; align-items: center; gap: .45rem; }
.appbar .theme-switch { color: var(--ink-soft); border-color: var(--line); }
.bell { position: relative; }
.bell .count {
  position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: var(--bad); color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; font-family: var(--f-body);
}
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--paper-2); border: 1.5px solid var(--line); display: grid; place-items: center; font-family: var(--f-head); font-weight: 700; color: var(--wood); }

.demo-banner { background: var(--warn-bg); border-bottom: 1px dashed var(--warn); font-size: .9rem; padding: .45rem 0; }
.demo-banner a { font-weight: 700; }

/* ---------- Page ---------- */
.app-main { padding-block: 1.2rem calc(110px + env(safe-area-inset-bottom)); }
.page-head { margin-bottom: 1.2rem; }
.page-head h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.page-head p { color: var(--muted); margin-top: .2rem; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 1.8rem 0 .7rem; }
.section-title h2 { font-size: 1.3rem; }
.back-link { display: inline-flex; align-items: center; gap: .35rem; color: var(--ink-soft); text-decoration: none; font-family: var(--f-type); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; margin-bottom: .6rem; }
.back-link svg { width: 16px; height: 16px; }

/* ---------- Floating dock ---------- */
.dock {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
  bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex; gap: 2px; padding: 6px;
  background: var(--ink); border-radius: 20px;
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .6);
  width: min(100% - 20px, 520px);
}
:root[data-theme="dark"] .dock { background: #2a2018; border: 1px solid var(--line); }
.dock a {
  flex: 1; display: grid; justify-items: center; gap: 2px; padding: .45rem .2rem; border-radius: 14px;
  color: #d9ccb4; text-decoration: none; font-size: .68rem; font-family: var(--f-type); letter-spacing: .04em; font-weight: 700; text-transform: uppercase;
  min-height: 52px; align-content: center; position: relative;
}
.dock a svg { width: 22px; height: 22px; }
.dock a[aria-current="page"] { background: var(--gold); color: #1b130b; }
.dock a .dot { position: absolute; top: 6px; right: calc(50% - 18px); width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }

/* ---------- Cards ---------- */
.svc-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.svc-card { display: grid; grid-template-columns: auto 1fr; gap: .9rem; align-items: start; text-decoration: none; color: inherit; }
.svc-card .badge-ring { --size: 62px; }
.svc-card h3 { font-size: 1.1rem; }
.svc-card .sub { font-size: .9rem; color: var(--muted); margin: .1rem 0 .5rem; }
a.card:hover { border-color: var(--line); transform: translateY(-1px); }
a.card { transition: transform .12s ease; }

.banner { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: center; padding: 1rem 1.1rem; border-radius: var(--r); margin-bottom: 1rem; }
.banner .badge-ring { --size: 56px; }
.banner-mind { background: var(--paper-2); border: 1.5px dashed var(--line); }
.banner h3 { font-size: 1.12rem; }
.banner p { font-size: .96rem; color: var(--ink-soft); }
.banner .row { margin-top: .5rem; }

.today { display: grid; gap: .7rem; }
.clip-row { display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: center; padding: .8rem; border: 1px solid var(--line-soft); border-radius: var(--r); background: var(--card); }
.clip-row .k { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--paper-2); font-family: var(--f-type); font-weight: 700; font-size: .8rem; color: var(--wood); }
.clip-row .when { font-size: .88rem; color: var(--muted); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; font-size: .96rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.stat-row { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.stat { padding: .8rem .9rem; border-radius: var(--r); background: var(--paper-2); border: 1px solid var(--line-soft); }
.stat .n { font-family: var(--f-head); font-weight: 800; font-size: 1.6rem; line-height: 1.1; }
.stat .l { font-size: .82rem; color: var(--muted); }

.list { display: grid; gap: .55rem; }
.item { display: grid; grid-template-columns: 1fr auto; gap: .6rem; align-items: start; padding: .8rem .9rem; border: 1px solid var(--line-soft); border-radius: var(--r); background: var(--card); }
.item h4 { font-family: var(--f-body); font-weight: 700; font-size: 1rem; }
.item p { font-size: .93rem; color: var(--ink-soft); }
.item .meta { font-size: .82rem; color: var(--muted); }
.item.unread { border-left: 4px solid var(--gold); }

.empty { padding: 1.4rem; text-align: center; color: var(--muted); border: 1.5px dashed var(--line); border-radius: var(--r); }

.slots { display: flex; flex-wrap: wrap; gap: .5rem; }
.slot-btn { min-height: 44px; padding: .4rem .8rem; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); text-align: left; font-size: .9rem; }
.slot-btn strong { display: block; font-family: var(--f-type); font-size: .8rem; }
.slot-btn:hover { border-color: var(--wood); }

.pip-num { margin-left: .5rem; font-size: .9rem; color: var(--ink-soft); }

/* Record flow */
.drop {
  display: grid; justify-items: center; gap: .5rem; padding: 1.4rem; text-align: center;
  border: 2px dashed var(--line); border-radius: var(--r); background: var(--paper-2); cursor: pointer;
}
.drop svg { width: 36px; height: 36px; color: var(--wood); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.preview video { width: 100%; max-height: 260px; border-radius: var(--r); background: #000; }
.trade { border: 1px solid var(--line-soft); border-radius: var(--r); padding: .9rem; background: var(--paper-2); margin-bottom: .7rem; }
.trade-grid { display: grid; gap: .6rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.trade-grid .field { margin-bottom: 0; }
.trade-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }

/* Chat */
.chat { display: grid; gap: .5rem; max-height: 58vh; overflow-y: auto; padding: .4rem; }
.msg { max-width: 82%; padding: .55rem .8rem; border-radius: 14px; background: var(--card); border: 1px solid var(--line-soft); font-size: .96rem; white-space: pre-wrap; word-wrap: break-word; }
.msg.me { justify-self: end; background: var(--wood); color: #fbf5ea; border-color: var(--wood-deep); }
:root[data-theme="dark"] .msg.me { background: #5a3d26; }
.msg .t { display: block; font-size: .72rem; opacity: .75; margin-top: .2rem; }
.chat-form { display: flex; gap: .5rem; margin-top: .7rem; }
.chat-form textarea { min-height: 46px; height: 46px; }

/* Plan view */
.plan-rules { display: grid; gap: .45rem; }
.plan-rules div { display: grid; grid-template-columns: minmax(130px, 38%) 1fr; gap: .8rem; padding: .5rem 0; border-bottom: 1px dashed var(--line-soft); font-size: .95rem; }
.plan-rules dt { color: var(--muted); }
.plan-rules dd { margin: 0; white-space: pre-wrap; }

.sheet-wide { width: min(100% - 1.5rem, 820px); }
.sheet-title { font-size: 1.3rem; }

/* ---------- Staff workspace (laptop) ---------- */
.staff-shell { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 61px); }
.staff-nav { border-right: 1px solid var(--line-soft); padding: 1rem .7rem; position: sticky; top: 61px; height: calc(100vh - 61px); overflow-y: auto; background: var(--paper-2); }
.staff-nav a { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .55rem .7rem; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: .96rem; }
.staff-nav a[aria-current="page"] { background: var(--card); box-shadow: var(--shadow); font-weight: 700; }
.staff-nav h3 { font-family: var(--f-type); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 1rem .7rem .3rem; }
.staff-nav .n { font-size: .75rem; background: var(--gold); color: #1b130b; border-radius: 10px; padding: 0 .45rem; font-weight: 700; }
.staff-main { padding: 1.4rem 1.6rem 3rem; min-width: 0; }
.review-split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.review-split video { width: 100%; border-radius: var(--r); background: #000; max-height: 70vh; }
.mark-row { display: grid; grid-template-columns: 1fr auto; gap: .6rem; align-items: center; padding: .55rem 0; border-bottom: 1px dashed var(--line-soft); }
.mark-row .val { font-size: .88rem; color: var(--muted); white-space: pre-wrap; }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg label { padding: .35rem .6rem; font-size: .8rem; font-family: var(--f-type); font-weight: 700; cursor: pointer; border-right: 1px solid var(--line); }
.seg label:last-child { border-right: 0; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label:has(input:checked) { background: var(--ink); color: var(--paper); }
.seg label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: -3px; }
.staff-mobile-note { display: none; }

@media (max-width: 900px) {
  .staff-shell { grid-template-columns: 1fr; }
  .staff-nav { position: static; height: auto; display: flex; flex-wrap: wrap; gap: .2rem; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .staff-nav h3 { display: none; }
  .staff-main { padding: 1rem; }
  .review-split { grid-template-columns: 1fr; }
  .staff-mobile-note { display: block; }
}
@media (max-width: 520px) {
  .trade-grid { grid-template-columns: 1fr 1fr; }
  .appbar .theme-switch span { display: none; }
  .kv { grid-template-columns: 1fr; gap: 0 1rem; }
  .kv dt { margin-top: .4rem; }
}

.h-sm { font-size: 1.15rem; }
.stack-tight > * + * { margin-top: .3rem; }
.sk-title { height: 2.2rem; width: 60%; }
.sk-block { height: 8rem; }
@media (max-width: 520px) {
  .item { grid-template-columns: 1fr; }
  .item > .stack-tight, .item > .meta { display: flex; flex-wrap: wrap; gap: .3rem; }
  .item > .stack-tight > * + * { margin-top: 0; }
}

.staff-bar { padding-inline: 1rem; }
.mt { margin-top: 1rem; }
