/* ═══════════════════════════════════════
   RICCO SHIFT — DESIGN TOKENS
═══════════════════════════════════════ */
:root {
  /* Brand colors */
  --green-deep:   #00422E;  /* Logo deep green, primary text */
  --green-mid:    #1F6B4D;  /* Secondary accent, links, hover */
  --green-light:  #5C9279;  /* Soft/disabled green */
  --cream:        #F8EFE5;  /* Logo cream, background */
  --cream-light:  #FAF5EC;  /* Page background (slightly lighter) */
  --cream-pure:   #FFFFFF;  /* Card background */

  /* Semantic aliases */
  --bg:    var(--cream-light);
  --s1:    var(--cream-pure);
  --s2:    #F5EBDC;  /* slightly warmer than bg */
  --s3:    #ECE1CF;
  --b1:    #E8DCC9;  /* soft border */
  --b2:    #D8C9B0;
  --b3:    #B89F7E;
  --t1:    var(--green-deep);  /* main text */
  --t2:    #4A5C50;  /* secondary text (muted green) */
  --t3:    #8B958C;  /* tertiary/placeholder */
  --accent:     var(--green-deep);    /* primary actions */
  --accent2:    var(--green-mid);     /* hover/focus */
  --accent-dim: rgba(0, 66, 46, 0.08); /* light fill */
  --accent-soft:rgba(0, 66, 46, 0.04);
  --green:      #4A8F6E;
  --green-dim:  rgba(74, 143, 110, 0.12);
  --red:        #C84B4B;
  --red-dim:    rgba(200, 75, 75, 0.08);
  --blue:       #4A7EA0;
  --blue-dim:   rgba(74, 126, 160, 0.08);
  /* Backward compat (some code still references --gold etc.) */
  --gold:       var(--accent);
  --gold2:      var(--accent2);
  --golddim:    var(--accent-dim);
  --greendim:   var(--green-dim);
  --reddim:     var(--red-dim);
  --bluedim:    var(--blue-dim);

  --r: 14px; --rs: 10px;
  --mono: 'DM Mono', 'Courier New', monospace;
  --sans: 'Sora', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --script: 'Pacifico', cursive;
  --sat: env(safe-area-inset-top);
  --sab: env(safe-area-inset-bottom);
}

/* ═══════════════════════════════════════ RESET ═══════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg); color: var(--t1);
  min-height: 100%; font-size: 15px; line-height: 1.5;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}
button { font-family: var(--sans); cursor: pointer; -webkit-appearance: none; color: inherit; }
input, textarea, select {
  font-family: var(--sans);
  font-size: 16px;
  -webkit-appearance: none;
  border-radius: 0;
  color: var(--t1);
}
textarea { resize: none; }

/* ═══════════════════════════════════════ GLOBAL LOADER ═══════════════════════════════════════ */
#global-loader {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(248, 239, 229, 0.92); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
}
.loader-inner { text-align: center; }
.loader-spin {
  width: 36px; height: 36px;
  border: 3px solid var(--b1); border-top-color: var(--accent);
  border-radius: 50%; margin: 0 auto 12px;
  animation: spin 1s linear infinite;
}
.loader-text { font-family: var(--mono); font-size: 11px; letter-spacing: 2px; color: var(--accent); text-transform: uppercase; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════ TOAST ═══════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: calc(90px + var(--sab));
  left: 50%; transform: translateX(-50%) translateY(20px);
  padding: 12px 20px; border-radius: 28px;
  font-size: 13px; font-weight: 500;
  background: var(--s1); border: 1px solid var(--b2); color: var(--t1);
  box-shadow: 0 8px 24px rgba(0,66,46,.18);
  opacity: 0; transition: all .25s ease;
  z-index: 9000; pointer-events: none;
  white-space: nowrap; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-ok  { border-color: var(--green); color: var(--green); background: var(--cream-pure); }
.toast-err { border-color: var(--red);   color: var(--red);   background: var(--cream-pure); }

/* ═══════════════════════════════════════ PULL TO REFRESH ═══════════════════════════════════════ */
.pull-indicator {
  position: fixed; top: calc(60px + var(--sat));
  left: 50%; transform: translateX(-50%) translateY(-60px);
  padding: 8px 16px;
  background: var(--cream-pure); border: 1px solid var(--b1);
  border-radius: 20px;
  display: flex; align-items: center; gap: 8px;
  opacity: 0;
  z-index: 150; pointer-events: none;
  transition: opacity .15s;
  box-shadow: 0 2px 8px rgba(0,66,46,.12);
  white-space: nowrap;
}
.pull-spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--b2); border-top-color: var(--accent);
  border-radius: 50%;
  transition: transform .2s;
  flex-shrink: 0;
}
.pull-indicator::after {
  content: 'Pull to refresh';
  font-size: 12px; color: var(--t3);
  font-family: var(--mono);
}
.pull-indicator.ready::after { content: 'Release to refresh'; color: var(--accent); }
.pull-indicator.ready .pull-spinner { border-top-color: var(--accent); transform: rotate(180deg); }
.pull-indicator.refreshing .pull-spinner { animation: spin .8s linear infinite; }
.pull-indicator.refreshing::after { content: 'Syncing…'; color: var(--accent); }

/* ═══════════════════════════════════════ LOGIN ═══════════════════════════════════════ */
#login {
  min-height: 100dvh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px calc(24px + var(--sab));
  background:
    radial-gradient(circle at 20% 10%, rgba(0,66,46,.04), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(0,66,46,.04), transparent 50%),
    var(--bg);
}
.brand-stack {
  text-align: center;
  margin-bottom: 44px;
  display: flex; flex-direction: column;
  align-items: center;
}
.brand-ricco {
  font-family: var(--script);
  font-size: 64px;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -1px;
  position: relative;
  padding: 0 10px;
}
.brand-ricco::before {
  content: '';
  position: absolute;
  top: -4px; left: 50%;
  width: 110%; height: 70%;
  border: 2.5px solid var(--accent);
  border-radius: 50%;
  transform: translateX(-50%) rotate(-12deg);
  opacity: .55;
  pointer-events: none;
}
.brand-shift {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 8px;
  color: var(--accent);
  margin-top: 14px;
  font-weight: 500;
}

.login-box { width: 100%; max-width: 380px; background: var(--cream-pure); border: 1px solid var(--b1); border-radius: var(--r); padding: 24px; box-shadow: 0 4px 16px rgba(0,66,46,.06); }
.role-switch { display: flex; gap: 6px; margin-bottom: 24px; background: var(--bg); padding: 4px; border-radius: var(--rs); border: 1px solid var(--b1); }
.role-btn {
  flex: 1; padding: 11px 0; border: none; border-radius: 6px;
  background: transparent; color: var(--t3); font-size: 14px;
  transition: all .2s; min-height: 44px;
}
.role-btn.on { background: var(--accent); color: var(--cream); font-weight: 500; }
.fl { margin-bottom: 14px; }
.fl label { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--t3); margin-bottom: 7px; }
.fi {
  width: 100%; background: var(--bg); border: 1px solid var(--b1);
  border-radius: var(--rs); padding: 13px 14px; color: var(--t1);
  outline: none; transition: border-color .2s; appearance: none;
  min-height: 48px;
}
.fi:focus { border-color: var(--accent); }
.fi option { background: var(--cream-pure); color: var(--t1); }
.btn-login {
  width: 100%; padding: 15px;
  background: var(--accent); color: var(--cream); border: none; border-radius: var(--rs);
  font-size: 15px; font-weight: 600; letter-spacing: .5px;
  transition: all .2s; min-height: 50px;
}
.btn-login:active { background: var(--accent2); transform: scale(.99); }

/* ═══════════════════════════════════════ APP SHELL ═══════════════════════════════════════ */
#app { display: none; flex-direction: column; min-height: 100dvh; }
#app.on { display: flex; }
.topbar {
  position: sticky; top: 0; z-index: 200;
  padding: calc(8px + var(--sat)) 14px 8px;
  min-height: calc(52px + var(--sat));
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg);
  border-bottom: 1px solid var(--b1);
}
.topbar-brand { display: flex; align-items: baseline; gap: 6px; }
.topbar-ricco {
  font-family: var(--script);
  font-size: 22px; line-height: 1;
  color: var(--accent);
  letter-spacing: -.5px;
}
.topbar-shift {
  font-family: var(--mono);
  font-size: 10px; letter-spacing: 3px;
  color: var(--accent);
  font-weight: 500;
}
.topbar-right { display: flex; align-items: center; gap: 8px; }
.user-tag { font-family: var(--mono); font-size: 12px; color: var(--t2); }
.btn-out {
  padding: 8px 12px; border: 1px solid var(--b2); border-radius: 6px;
  background: transparent; color: var(--t3); font-size: 12px;
  transition: all .2s; min-height: 36px;
}
.btn-out:active { border-color: var(--red); color: var(--red); }

.navrow { display: none; }

/* ═══════════════════════════════════════ BOTTOM TAB BAR ═══════════════════════════════════════ */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 200;
  display: flex; align-items: stretch;
  background: var(--cream-pure);
  border-top: 1px solid var(--b1);
  padding-bottom: var(--sab);
  box-shadow: 0 -2px 12px rgba(0,66,46,.06);
}
.tab {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  border: none; background: transparent;
  padding: 8px 4px 6px;
  color: var(--t3); font-size: 11px;
  position: relative;
  min-height: 56px;
  transition: color .15s;
}
.tab-icon {
  font-size: 22px; line-height: 1;
  filter: grayscale(.4) opacity(.7);
  transition: all .15s;
}
.tab-label {
  font-size: 10px; letter-spacing: .3px;
  font-family: var(--mono); text-transform: uppercase;
}
.tab.on { color: var(--accent); }
.tab.on .tab-icon { filter: none; transform: translateY(-1px); }
.tab:active { background: var(--accent-soft); }
.tab-dot {
  position: absolute; top: 6px; right: calc(50% - 18px);
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red);
  border: 1.5px solid var(--cream-pure);
}

.pages {
  flex: 1; overflow: hidden; position: relative;
}
.page {
  display: none; position: absolute; inset: 0;
  overflow-y: auto;
  padding: 14px 14px calc(100px + var(--sab));
  animation: fadeUp .22s ease;
  -webkit-overflow-scrolling: touch;
}
.page.on { display: block; }
@keyframes fadeUp { from { opacity:0; transform:translateY(5px); } to { opacity:1; transform:translateY(0); } }
.page::-webkit-scrollbar { width: 3px; }
.page::-webkit-scrollbar-thumb { background: var(--b2); border-radius: 10px; }

/* ═══════════════════════════════════════ SHARED ═══════════════════════════════════════ */
.row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cap { font-family: var(--mono); font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--t3); }
.card { background: var(--cream-pure); border: 1px solid var(--b1); border-radius: var(--r); }
.empty { text-align: center; padding: 40px 16px; color: var(--t3); font-size: 13px; }
.empty-icon { font-size: 36px; margin-bottom: 12px; }

.rule-hint {
  font-size: 11px; color: var(--t2);
  padding: 10px 12px; margin-bottom: 12px;
  background: var(--accent-soft); border-radius: var(--rs); line-height: 1.7;
  border-left: 3px solid var(--accent);
}
.modal-hint {
  font-size: 11px; color: var(--t3);
  margin: 6px 0 12px; line-height: 1.6; font-style: italic;
}
.staff-counter { margin-left: auto; font-size: 12px; color: var(--t3); font-family: var(--mono); }
.success-box { background: var(--green-dim); border-radius: var(--rs); padding: 12px; margin-bottom: 12px; }

.btn {
  padding: 9px 14px; border: 1px solid var(--b2); border-radius: 8px;
  background: var(--cream-pure); color: var(--t2); font-size: 13px;
  transition: all .15s; min-height: 38px;
}
.btn:active { background: var(--s2); }
.btn.accent { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.btn.danger { border-color: transparent; color: var(--red); background: var(--red-dim); font-size: 12px; padding: 7px 12px; min-height: 34px; }
.btn-primary {
  padding: 11px 20px; background: var(--accent); color: var(--cream);
  border: none; border-radius: 8px; font-size: 14px; font-weight: 600;
  transition: all .15s; min-height: 44px;
}
.btn-primary:active { background: var(--accent2); transform: scale(.99); }

.ic-btn {
  width: 36px; height: 36px; border: none; background: transparent;
  border-radius: 8px; color: var(--t3); font-size: 15px; cursor: pointer;
  transition: all .15s; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ic-btn:active { background: var(--accent-soft); color: var(--t1); }
.ic-btn.on { color: var(--accent); }

.inp {
  width: 100%; background: var(--bg); border: 1px solid var(--b1);
  border-radius: var(--rs); padding: 12px 14px; color: var(--t1);
  outline: none; transition: border-color .2s; margin-bottom: 8px;
  min-height: 46px;
}
.inp:focus { border-color: var(--accent); }
.inp.nobm { margin-bottom: 0; }
textarea.inp { min-height: 90px; line-height: 1.55; padding-top: 10px; }

.check-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--t3); cursor: pointer;
  padding: 6px 0; min-height: 38px;
}
.check-label input { accent-color: var(--accent); width: 18px; height: 18px; }

/* ═══════════════════════════════════════ EMPLOYEE SHIFT ═══════════════════════════════════════ */
.shift-card { padding: 18px; margin-bottom: 10px; }
.shift-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; gap: 12px; flex-wrap: wrap; }
.shift-name { font-size: 16px; font-weight: 600; }
.shift-time { font-family: var(--mono); font-size: 13px; color: var(--accent); background: var(--accent-dim); padding: 6px 14px; border-radius: 24px; }
.shift-role { font-size: 13px; color: var(--t2); margin-top: 2px; }
.shift-with { font-size: 12px; color: var(--t3); margin-top: 6px; line-height: 1.5; }
.shift-with span { font-family: var(--mono); }

.smemo-card { background: var(--cream-pure); border: 1px solid var(--b1); border-left: 3px solid var(--blue); border-radius: var(--rs); padding: 12px 14px; margin: 10px 0; }
.smemo-label { font-family: var(--mono); font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--blue); margin-bottom: 6px; }
.smemo-text { font-size: 13px; line-height: 1.6; color: var(--t2); white-space: pre-wrap; }

.todo-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.todo-item {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--cream-pure); border: 1px solid var(--b1);
  border-radius: var(--rs); padding: 14px 14px;
  transition: opacity .2s; min-height: 50px;
}
.todo-item.done { opacity: .5; background: var(--accent-soft); }
.pdot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; margin-top: 8px; }
.pdot.high { background: var(--red); }
.pdot.med { background: var(--accent); }
.pdot.low { background: var(--t3); }
.chk {
  width: 24px; height: 24px;
  border: 1.5px solid var(--b2); border-radius: 6px;
  flex-shrink: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .18s;
  background: var(--cream-pure);
}
.chk.on { background: var(--accent); border-color: var(--accent); }
.chk.on::after { content: '✓'; font-size: 14px; color: var(--cream); font-weight: 700; }
.todo-txt { flex: 1; font-size: 14px; line-height: 1.4; padding-top: 3px; }
.todo-txt.done { text-decoration: line-through; color: var(--t3); }

/* ═══════════════════════════════════════ MEMOS ═══════════════════════════════════════ */
.memo-card {
  border-left: 3px solid var(--accent); border-radius: var(--r);
  padding: 15px 16px; margin-bottom: 10px; position: relative;
}
.memo-card.pinned { border-left-color: var(--red); background: linear-gradient(to right, var(--red-dim), transparent 80%); }
.memo-meta { font-family: var(--mono); font-size: 11px; color: var(--t3); margin-bottom: 8px; padding-right: 80px; }
.memo-title { font-size: 14px; font-weight: 500; margin-bottom: 8px; padding-right: 80px; }
.memo-body { font-size: 13px; line-height: 1.65; color: var(--t2); white-space: pre-wrap; }
.new-tag { display: inline-block; font-size: 10px; padding: 2px 7px; border-radius: 20px; background: var(--red-dim); color: var(--red); border: 1px solid var(--red); margin-left: 7px; vertical-align: middle; }
.pin-badge { display: inline-block; font-size: 10px; padding: 2px 8px; border-radius: 20px; background: var(--red-dim); color: var(--red); margin-bottom: 8px; }

/* ═══════════════════════════════════════ NOTES SEARCH & TAGS ═══════════════════════════════════════ */
.notes-search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--cream-pure);
  border: 1px solid var(--b1);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 10px;
}
.notes-search-icon { font-size: 15px; flex-shrink: 0; }
.notes-search-inp {
  flex: 1; border: none; background: transparent;
  font-size: 14px; color: var(--t1); outline: none;
}
.notes-search-inp::placeholder { color: var(--t3); }
.notes-search-clear {
  background: transparent; border: none;
  color: var(--t3); font-size: 18px;
  padding: 0 4px; cursor: pointer; flex-shrink: 0;
}

.note-tags-bar {
  display: flex; gap: 6px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
  margin-bottom: 12px;
  scrollbar-width: none;
}
.note-tags-bar::-webkit-scrollbar { display: none; }
.note-tag-pill {
  flex-shrink: 0;
  padding: 6px 14px; border-radius: 20px;
  background: var(--cream-pure); border: 1px solid var(--b1);
  color: var(--t2); font-size: 12px; font-weight: 500;
  white-space: nowrap; transition: all .15s;
}
.note-tag-pill.on { background: var(--accent); border-color: var(--accent); color: white; }
.note-tag-pill:active { opacity: .8; }

.note-group { margin-bottom: 18px; }
.note-group-label {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--accent); padding: 8px 2px 6px;
}

.note-tags-row {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 10px 14px 0;
}
.note-tag {
  padding: 3px 10px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 11px; font-weight: 500;
  border: 1px solid var(--accent-dim);
}

/* ═══════════════════════════════════════ NOTE VIDEO ═══════════════════════════════════════ */
.note-video-wrap {
  width: 100%; aspect-ratio: 16/9;
  border-radius: var(--r) var(--r) 0 0;
  overflow: hidden; background: #000;
}
.note-video-frame {
  width: 100%; height: 100%;
  border: none;
}
.memo-card-actions { position: absolute; top: 10px; right: 10px; display: flex; gap: 2px; }

.compose { padding: 14px; margin-bottom: 18px; }
.compose-label { font-family: var(--mono); font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--t3); margin-bottom: 9px; }
.compose-row { display: flex; justify-content: flex-end; margin-top: 9px; }

/* ═══════════════════════════════════════ NOTES ═══════════════════════════════════════ */
.rsearch {
  width: 100%; background: var(--cream-pure); border: 1px solid var(--b1);
  border-radius: var(--rs); padding: 12px 14px; color: var(--t1);
  outline: none; margin-bottom: 14px; transition: border-color .2s;
  min-height: 46px;
}
.rsearch:focus { border-color: var(--accent); }
.note-card { border-radius: var(--r); margin-bottom: 10px; overflow: hidden; cursor: pointer; position: relative; }
.note-card.pinned { border-color: var(--accent); }
.note-card.pinned::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--accent); }
.note-card .pin-badge { position: absolute; top: 10px; right: 10px; z-index: 2; margin: 0; background: var(--accent-dim); color: var(--accent); border: 1px solid var(--accent); }
.note-photo-wrap { width: 100%; height: 200px; overflow: hidden; border-radius: var(--r) var(--r) 0 0; position: relative; }
.note-photo { width: 100%; height: 200px; object-fit: cover; display: block; }
.note-photo-add {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px; border-bottom: 1px dashed var(--b2); cursor: pointer;
  transition: background .2s; min-height: 50px;
}
.note-photo-add:active { background: var(--bg); }
.note-head { padding: 14px 16px; }
.note-title { font-size: 15px; font-weight: 500; }
.note-body { display: none; padding: 0 16px 14px; border-top: 1px solid var(--b1); }
.note-body.on { display: block; padding-top: 14px; }
.note-mgr-head { padding: 12px 14px; display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--b1); }
.note-title-inp { flex: 1; background: transparent; border: none; color: var(--t1); font-size: 15px; font-weight: 500; outline: none; padding: 4px 0; min-height: 32px; }
.note-actions { display: flex; gap: 0; }
.note-mgr-body { padding: 12px 14px; font-size: 13px; line-height: 1.6; color: var(--t2); white-space: pre-wrap; max-height: 120px; overflow: hidden; position: relative; }
.note-mgr-body::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 30px; background: linear-gradient(transparent, var(--cream-pure)); pointer-events: none; }
.rphoto-btn { position: absolute; top: 10px; padding: 6px 12px; background: rgba(0,66,46,.7); border: 1px solid var(--b2); border-radius: 6px; color: var(--cream); font-size: 12px; cursor: pointer; min-height: 32px; }
.rphoto-btn:active { background: rgba(0,66,46,.85); }
.rphoto-btn.r8 { right: 8px; }
.rphoto-btn.r60 { right: 80px; }
.photo-drop { width: 100%; height: 140px; border: 1.5px dashed var(--b2); border-radius: var(--rs); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all .2s; overflow: hidden; text-align: center; margin-bottom: 3px; background: var(--bg); }
.photo-drop:active, .photo-drop.drag { border-color: var(--accent); background: var(--accent-dim); }

/* ═══════════════════════════════════════ FEEDBACK ═══════════════════════════════════════ */
.fb-emp-card {
  border-radius: var(--r); margin-bottom: 11px;
  overflow: hidden;
  background: var(--cream-pure);
  border: 1px solid var(--b1);
  padding: 14px 15px;
}
.fb-emp-card.fb-pinned { border-left: 3px solid var(--accent); }
.fb-emp-card.fb-done { opacity: .65; }
.fb-meta { font-family: var(--mono); font-size: 11px; color: var(--t3); margin-bottom: 6px; }
.fb-text { font-size: 14px; line-height: 1.55; color: var(--t1); }
.fb-reply { background: var(--accent-dim); border-radius: 8px; padding: 10px 12px; font-size: 13px; color: var(--t2); line-height: 1.55; margin-top: 10px; }
.fb-reply-cap { font-family: var(--mono); font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.reply-row { display: flex; gap: 8px; margin-top: 10px; }
.reply-inp { flex: 1; background: var(--bg); border: 1px solid var(--b1); border-radius: 6px; padding: 10px 12px; color: var(--t1); outline: none; min-height: 44px; }
.reply-inp:focus { border-color: var(--accent); }
.btn-reply { padding: 10px 16px; background: var(--accent); color: var(--cream); border: none; border-radius: 6px; font-size: 13px; font-weight: 600; flex-shrink: 0; min-height: 44px; }
.fb-done-badge {
  display: inline-block; font-size: 10px;
  padding: 1px 7px; border-radius: 10px;
  background: var(--accent-dim); color: var(--accent);
  font-weight: 500; margin-left: 6px;
}
.fb-emp-actions {
  display: flex; gap: 6px; margin-top: 10px;
  padding-top: 10px; border-top: 1px solid var(--b1);
}
/* Feedback photo attachments */
.fb-photo-previews {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 4px 0;
}
.fb-photo-preview-item {
  position: relative; flex-shrink: 0;
}
.fb-photo-preview-img {
  width: 64px; height: 64px; border-radius: 8px;
  object-fit: cover; border: 1px solid var(--b1);
  display: block;
}
.fb-photo-preview-del {
  position: absolute; top: 2px; right: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(0,0,0,.6); color: white;
  border: none; font-size: 11px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
}
.fb-photo-btn {
  min-height: 40px; padding: 8px 14px;
  font-size: 16px; border-radius: 8px;
}
.fb-photo-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 10px;
}
.fb-photo-thumb {
  width: 72px; height: 72px; border-radius: 8px;
  object-fit: cover; border: 1px solid var(--b1);
  cursor: pointer; transition: opacity .15s;
}
.fb-photo-thumb:active { opacity: .75; }

/* ═══════════════════════════════════════ WEEK NAVIGATION ═══════════════════════════════════════ */
.week-nav {
  display: flex; align-items: stretch; gap: 8px;
  margin-bottom: 12px;
  background: var(--cream-pure);
  border: 1px solid var(--b1);
  border-radius: var(--r);
  overflow: hidden;
}
.wn-btn {
  background: transparent; border: none;
  color: var(--accent); font-size: 22px;
  padding: 10px 20px; min-height: 50px;
  transition: all .15s;
  font-weight: 600;
}
.wn-btn:active { background: var(--accent-dim); }
.wn-label {
  flex: 1; padding: 8px 4px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
}
.wn-range { font-size: 16px; font-weight: 600; color: var(--accent); line-height: 1.2; }
.wn-year { font-size: 11px; color: var(--t3); font-family: var(--mono); margin-top: 2px; display: flex; align-items: center; gap: 8px; }
.wn-now {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  background: var(--accent-dim); color: var(--accent);
  font-size: 10px; letter-spacing: .5px; font-weight: 500;
}
.btn-jump-today {
  display: block; margin: 0 auto 12px;
  background: var(--cream-pure); border: 1px solid var(--accent2);
  color: var(--accent2); border-radius: 20px;
  padding: 7px 18px; font-size: 12px; font-weight: 500;
  min-height: 34px;
}
.btn-jump-today:active { background: var(--accent-dim); }

/* ═══════════════════════════════════════ WEEK QUICK ACTIONS (under day pills) ═══════════════════════════════════════ */
.week-quick-actions {
  display: flex; align-items: center; justify-content: center;
  gap: 12px;
  margin: -4px 0 14px;
  padding: 6px 8px;
}
.qa-link {
  background: transparent; border: none;
  color: var(--accent); font-size: 12px;
  padding: 6px 10px; min-height: 32px;
  font-family: var(--mono); font-weight: 500;
  letter-spacing: .3px;
  border-bottom: 1px dashed transparent;
  transition: all .15s;
}
.qa-link:active { border-bottom-color: var(--accent); color: var(--accent2); }
.qa-sep { color: var(--t3); font-size: 14px; }

/* ═══════════════════════════════════════ PDF WEEK SELECTOR ═══════════════════════════════════════ */
.pdf-week-selector {
  background: var(--bg);
  border: 1px solid var(--b1);
  border-radius: var(--rs);
  padding: 4px;
  margin-bottom: 8px;
}
.pwk-nav {
  display: flex; align-items: center; gap: 4px;
}
.pwk-arrow {
  background: var(--cream-pure); border: 1px solid var(--b1);
  color: var(--accent); font-size: 20px;
  width: 40px; height: 44px; border-radius: 8px;
  flex-shrink: 0; font-weight: 600;
  transition: all .15s;
}
.pwk-arrow:active { background: var(--accent-dim); }
.pwk-info {
  flex: 1; text-align: center; padding: 4px;
}
.pwk-range { font-size: 15px; font-weight: 600; color: var(--accent); line-height: 1.2; }
.pwk-sub {
  font-family: var(--mono); font-size: 10px; color: var(--t3);
  margin-top: 3px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.pwk-tag {
  padding: 2px 7px; border-radius: 10px;
  font-size: 10px; letter-spacing: .5px; font-weight: 500;
}
.pwk-tag.past { background: var(--s2); color: var(--t3); }
.pwk-tag.future { background: var(--blue-dim); color: var(--blue); }

.pwk-jump {
  display: flex; gap: 6px;
  margin-top: 6px;
  padding: 0 4px 2px;
}
.pwk-jump-btn {
  flex: 1; background: transparent;
  border: 1px solid var(--b1); border-radius: 6px;
  color: var(--t3); font-size: 12px;
  padding: 7px 10px; min-height: 32px;
  transition: all .15s;
}
.pwk-jump-btn:active { background: var(--accent-dim); }
.pwk-jump-btn.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); font-weight: 500; }

/* ═══════════════════════════════════════ WEEK PICKER ═══════════════════════════════════════ */
.week-row { display: flex; gap: 7px; padding: 8px 0 12px; overflow-x: auto; scrollbar-width: none; }
.week-row::-webkit-scrollbar { display: none; }
.day-pill {
  flex-shrink: 0; padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--b1); background: var(--cream-pure); color: var(--t3);
  transition: all .18s; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 56px; min-height: 50px;
}
.day-pill-name { font-size: 12px; font-weight: 500; }
.day-pill-date { font-family: var(--mono); font-size: 10px; opacity: .8; }
.day-pill.today { border-color: var(--accent); color: var(--accent); }
.day-pill.sel { background: var(--accent); border-color: var(--accent); color: var(--cream); }
.day-pill.sel .day-pill-name { font-weight: 600; }
.day-heading { font-size: 18px; font-weight: 500; padding: 4px 0 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--t1); }
.today-badge { font-family: var(--mono); font-size: 11px; padding: 3px 9px; border-radius: 20px; background: var(--accent-dim); color: var(--accent); }

/* ═══════════════════════════════════════ WEEK ACTIONS ═══════════════════════════════════════ */
.week-actions {
  display: flex; gap: 8px;
  margin-bottom: 12px;
}
.btn-week {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 12px;
  background: var(--cream-pure);
  border: 1px solid var(--accent);
  border-radius: 10px;
  color: var(--accent);
  font-size: 13px; font-weight: 500;
  min-height: 42px;
  transition: all .15s;
}
.btn-week:active {
  background: var(--accent-dim);
  transform: scale(.99);
}

/* ═══════════════════════════════════════ MGR SHIFT GROUP BLOCK ═══════════════════════════════════════ */
.msblock {
  border-radius: var(--r);
  margin-bottom: 18px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,66,46,.06);
  border: 1px solid var(--b1);
}
.msblock.empty { opacity: .8; }

/* Header — strong tinted band */
.sg-header {
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--accent-dim) 0%, transparent 100%);
  border-bottom: 2px solid var(--accent);
}
.sg-title { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.sg-emoji { font-size: 22px; }
.sg-name { font-size: 16px; font-weight: 600; flex: 1; color: var(--accent); letter-spacing: .2px; }
.sg-count {
  font-family: var(--mono); font-size: 12px;
  padding: 4px 11px; border-radius: 20px;
  background: var(--accent); color: var(--cream);
  font-weight: 600;
}
.sg-desc { font-size: 11px; color: var(--t2); font-style: italic; }

/* Section labels inside the card */
.msblock .section-label {
  display: block;
  font-family: var(--mono);
  font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--accent);
  padding: 10px 14px 6px;
  background: var(--accent-soft);
}

/* Staff list section */
.sg-staff-list {
  padding: 4px 14px 12px;
  background: var(--cream-pure);
  border-bottom: 3px solid var(--s2);
}
.sg-empty { font-size: 13px; color: var(--t3); padding: 14px 6px; font-style: italic; text-align: center; }
.staff-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--b1);
  min-height: 56px;
}
.staff-row:last-of-type { border-bottom: none; }
.staff-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; min-width: 0; max-width: 100%; color: var(--t1); }
.staff-role { font-size: 11px; color: var(--t3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; max-width: 50%; }
.staff-role:empty { display: none; }
.staff-time { font-family: var(--mono); font-size: 11px; color: var(--accent); background: var(--accent-dim); padding: 4px 10px; border-radius: 12px; white-space: nowrap; font-weight: 500; }
.staff-row .ic-btn { width: 32px; height: 32px; }
.sg-add-btn {
  width: 100%; margin-top: 12px;
  border: 1.5px dashed var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
  min-height: 42px;
}

/* Memo section */
.smemo-editor {
  position: relative;
  background: #FFFBF5;
  border-bottom: 3px solid var(--s2);
}
.smemo-editor::before {
  content: 'SHIFT MEMO';
  display: block;
  font-family: var(--mono);
  font-size: 10px; letter-spacing: 1.5px;
  color: var(--blue);
  padding: 10px 14px 4px;
  background: var(--blue-dim);
}
.smemo-ta {
  width: 100%; background: transparent; border: none;
  color: var(--t1); font-size: 14px; line-height: 1.6;
  padding: 8px 14px 12px; outline: none;
  min-height: 50px; max-height: 140px; overflow-y: auto;
}
.smemo-ta::placeholder { color: var(--t3); font-style: italic; }
.smemo-dot { position: absolute; top: 12px; right: 12px; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); opacity: .6; }

/* Todos section */
.quick-list {
  padding: 0; min-height: 2px;
  background: var(--cream-pure);
}
.quick-list::before {
  content: 'SHARED TASKS';
  display: block;
  font-family: var(--mono);
  font-size: 10px; letter-spacing: 1.5px;
  color: var(--accent);
  padding: 10px 14px 4px;
  background: var(--accent-soft);
}
.quick-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--b1);
  transition: background .12s;
  min-height: 44px;
}
.quick-row:last-of-type { border-bottom: none; }
.quick-row:active { background: var(--bg); }
.qdot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.qdel { border: none; background: transparent; color: var(--red); font-size: 22px; cursor: pointer; padding: 4px 8px; flex-shrink: 0; line-height: 1; min-width: 32px; min-height: 32px; }
.hint-row { font-size: 13px; color: var(--t3); padding: 14px; font-style: italic; text-align: center; }
.qadd-row {
  display: flex; align-items: stretch;
  border-top: 2px solid var(--s2);
  border-bottom: 3px solid var(--s2);
  background: var(--bg);
  min-height: 48px;
}
.qpri {
  border: none; border-right: 1px solid var(--b1);
  background: transparent; color: var(--accent);
  font-family: var(--mono); font-size: 11px;
  padding: 10px 8px; outline: none; flex-shrink: 0;
  appearance: none; width: 64px; text-align: center; cursor: pointer;
  font-weight: 600;
}
.qinp { flex: 1; border: none; background: transparent; color: var(--t1); font-size: 14px; padding: 12px 14px; outline: none; }
.qinp::placeholder { color: var(--t3); }
.qadd-btn {
  border: none; border-left: 1px solid var(--b1);
  background: transparent; color: var(--accent);
  font-size: 24px; padding: 5px 18px; flex-shrink: 0; min-width: 50px;
  font-weight: 700;
}
.qadd-btn:active { background: var(--accent-dim); }

.qbulk-btn {
  border: none; border-left: 1px solid var(--b1);
  background: transparent; color: var(--accent2);
  font-size: 18px; padding: 5px 14px; flex-shrink: 0;
  font-weight: 600;
}
.qbulk-btn:active { background: var(--accent-soft); }

/* Danger variant of quick action link */
.qa-link.qa-danger { color: var(--red); }
.qa-link.qa-danger:active { border-bottom-color: var(--red); }

/* ═══════════════════════════════════════ BULK ADD MODAL ═══════════════════════════════════════ */
.modal.modal-fullscreen {
  height: 92dvh;
  max-height: 92dvh;
}
.bulk-pri-row {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
}
.bulk-pri-opt {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; color: var(--t2);
  padding: 6px 10px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--b1);
  cursor: pointer;
  min-height: 36px;
}
.bulk-pri-opt input { margin: 0; accent-color: var(--accent); }
.bulk-pri-opt .pdot { margin: 0; }
.bulk-pri-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

.bulk-textarea {
  flex: 1;
  min-height: 140px;
  resize: none !important;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 0;
}

.bulk-preview {
  background: var(--bg);
  border: 1px solid var(--b1);
  border-radius: var(--rs);
  padding: 10px 12px;
  max-height: 35vh;
  overflow-y: auto;
}
.bulk-preview-label {
  font-family: var(--mono);
  font-size: 10px; letter-spacing: 1.5px;
  color: var(--accent);
  margin-bottom: 6px;
  text-transform: uppercase;
}
.bulk-preview-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px;
  border-bottom: 1px dashed var(--b1);
  font-size: 13px; color: var(--t1);
  line-height: 1.4;
}
.bulk-preview-item:last-child { border-bottom: none; }
.bulk-preview-item { cursor: pointer; transition: background .12s; }
.bulk-preview-item:active { background: var(--bg); }
.bulk-header-item {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
}
.bulk-type-tag {
  font-family: var(--mono); font-size: 9px;
  padding: 2px 6px; border-radius: 3px;
  background: var(--accent); color: white;
  letter-spacing: .5px;
}
.bulk-type-hint {
  font-family: var(--mono); font-size: 9px;
  color: var(--t3); padding: 2px 6px;
  letter-spacing: .5px; text-transform: uppercase;
}

/* ═══════════════════════════════════════ TODO GROUPS ═══════════════════════════════════════ */
.todo-group {
  border-bottom: 1px solid var(--b1);
}
.todo-group:last-child { border-bottom: none; }
.todo-group-head {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px;
  background: var(--accent-soft);
  cursor: pointer;
  transition: background .15s;
  user-select: none;
  min-height: 44px;
}
.todo-group-head:active { background: var(--accent-dim); }
.todo-group-chevron {
  font-size: 14px; color: var(--accent);
  transition: transform .2s;
  flex-shrink: 0;
}
.todo-group.collapsed .todo-group-chevron { transform: rotate(-90deg); }
.todo-group-title {
  flex: 1;
  font-size: 13px; font-weight: 600;
  color: var(--accent);
  letter-spacing: .2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.todo-group-progress {
  font-family: var(--mono); font-size: 11px;
  padding: 3px 9px; border-radius: 12px;
  background: var(--cream-pure);
  color: var(--accent);
  font-weight: 500;
  flex-shrink: 0;
}
.todo-group.all-done .todo-group-progress {
  background: var(--accent);
  color: white;
}
.todo-group-del {
  background: transparent; border: none;
  color: var(--t3); font-size: 14px;
  padding: 4px 6px;
  flex-shrink: 0;
  min-width: 28px; min-height: 28px;
  transition: color .15s;
}
.todo-group-del:active { color: var(--red); }
.todo-group-bar {
  height: 2px;
  background: var(--cream-pure);
  overflow: hidden;
  transition: opacity .2s;
}
.todo-group-bar-fill {
  height: 100%;
  background: var(--accent);
  transition: width .3s;
}
.todo-group.all-done .todo-group-bar-fill { background: var(--accent2); }
.todo-group-body {
  background: var(--cream-pure);
  max-height: 2000px;
  overflow: hidden;
  transition: max-height .3s ease;
}
.todo-group.collapsed .todo-group-body {
  max-height: 0;
}
.todo-group.collapsed .todo-group-bar { opacity: .3; }

/* Done state for quick-row */
.quick-row.done { opacity: .55; }
.quick-row.done .qdot { opacity: .4; }

/* Employee todo "done by" indicator */
.todo-by {
  font-family: var(--mono); font-size: 10px;
  color: var(--accent);
  padding: 2px 7px; border-radius: 10px;
  background: var(--accent-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Actions footer */
.shift-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 12px 14px;
  background: var(--s2);
}
.shift-actions .btn {
  font-size: 12px; padding: 8px 12px; min-height: 36px;
  background: var(--cream-pure);
}

.msec { background: var(--cream-pure); border: 1px solid var(--b1); border-radius: var(--r); padding: 16px; margin-bottom: 16px; }

/* ═══════════════════════════════════════ IMPORT ═══════════════════════════════════════ */
.csv-box { border: 1px solid var(--accent); border-radius: var(--r); padding: 14px; margin-bottom: 14px; background: var(--cream-pure); }
.csv-toggle { display: flex; align-items: center; justify-content: space-between; cursor: pointer; min-height: 44px; }
.csv-chevron { color: var(--t3); font-size: 22px; transition: transform .2s; padding: 0 8px; }
.csv-panel { display: none; margin-top: 13px; }
.csv-steps { background: var(--bg); border-radius: var(--rs); padding: 12px; margin-bottom: 12px; font-size: 12px; color: var(--t2); line-height: 1.9; }
.ocr-spin { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--b2); border-top-color: var(--accent); border-radius: 50%; vertical-align: middle; margin-right: 6px; animation: spin .8s linear infinite; }

.pdf-day-label { font-family: var(--mono); font-size: 12px; color: var(--accent); margin-bottom: 6px; font-weight: 500; }
.pdf-group-label { font-size: 12px; color: var(--t2); margin: 8px 0 4px; }
.pdf-row { display: grid; grid-template-columns: 1fr 1.2fr auto; gap: 8px; align-items: center; padding: 7px 12px; background: var(--bg); border: 1px solid var(--b1); border-radius: 6px; margin-bottom: 4px; font-size: 12px; min-height: 36px; }
.pdf-row-name { color: var(--t1); font-weight: 500; }
.pdf-row-role { color: var(--t3); font-size: 11px; }
.pdf-row-time { font-family: var(--mono); color: var(--accent); font-size: 11px; }

/* ═══════════════════════════════════════ STAFF ═══════════════════════════════════════ */
.emp-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--cream-pure); border: 1px solid var(--b1);
  border-radius: var(--rs); padding: 10px 14px; margin-bottom: 8px;
  min-height: 56px;
}
.adm-row { border-color: var(--accent); background: linear-gradient(to right, var(--accent-dim), transparent 60%); }
.emp-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--s2); border: 1px solid var(--b2);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; color: var(--t2); flex-shrink: 0;
}
.emp-avatar.gold { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.owner-tag { display: inline-block; margin-left: 8px; font-family: var(--mono); font-size: 9px; padding: 2px 7px; border-radius: 10px; background: var(--accent); color: var(--cream); vertical-align: middle; font-weight: 600; }

/* ═══════════════════════════════════════ TASKS PAGE ═══════════════════════════════════════ */
.tasks-controls {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 12px; flex-wrap: wrap;
}
.tasks-date {
  background: var(--cream-pure); border: 1px solid var(--b1);
  border-radius: 8px; padding: 8px 12px; color: var(--t1);
  font-size: 13px; outline: none; min-height: 40px;
  font-family: var(--mono); flex: 1; min-width: 130px;
}
.tasks-date:focus { border-color: var(--accent); }
.view-switch {
  display: flex; background: var(--cream-pure);
  border: 1px solid var(--b1); border-radius: 8px;
  padding: 3px; gap: 2px;
}
.vsw {
  border: none; background: transparent;
  padding: 7px 12px; border-radius: 6px;
  color: var(--t3); font-size: 12px;
  cursor: pointer; transition: all .15s;
  min-height: 34px; font-weight: 500;
}
.vsw.on { background: var(--accent); color: var(--cream); }
.tasks-date-label {
  font-size: 14px; font-weight: 500; color: var(--t1);
  padding: 4px 0 14px; display: flex; align-items: center; gap: 10px;
}

.task-shift-card { padding: 14px; margin-bottom: 12px; }
.task-shift-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.task-shift-name { font-size: 15px; font-weight: 600; flex: 1; color: var(--t1); }
.task-shift-pct { font-family: var(--mono); font-size: 12px; padding: 4px 10px; border-radius: 20px; background: var(--accent-dim); color: var(--accent); font-weight: 500; }
.task-progress { height: 6px; background: var(--s2); border-radius: 3px; overflow: hidden; margin-bottom: 10px; }
.task-progress-bar { height: 100%; background: var(--accent); transition: width .3s ease; }
.task-shift-staff { font-size: 12px; color: var(--t2); margin-bottom: 10px; font-family: var(--mono); }
.task-list-mini { display: flex; flex-direction: column; gap: 4px; }
.task-row-mini { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: var(--bg); border-radius: 6px; font-size: 12px; min-height: 36px; }
.task-row-mini.done { opacity: .6; }
.task-row-mini.done .task-text { text-decoration: line-through; color: var(--t3); }
.task-check { color: var(--accent); font-weight: 700; width: 16px; }
.task-row-mini:not(.done) .task-check { color: var(--t3); }
.task-text { flex: 1; color: var(--t1); }
.task-by { font-family: var(--mono); font-size: 10px; color: var(--t3); white-space: nowrap; }

.task-flat-list { display: flex; flex-direction: column; gap: 6px; }
.task-flat-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; background: var(--cream-pure);
  border: 1px solid var(--b1); border-radius: var(--rs);
  min-height: 56px;
}
.task-flat-row.done { opacity: .55; background: var(--accent-soft); }
.task-flat-row .pdot { margin-top: 6px; }
.task-flat-main { flex: 1; min-width: 0; }
.task-flat-text { font-size: 13px; color: var(--t1); margin-bottom: 3px; line-height: 1.4; }
.task-flat-row.done .task-flat-text { text-decoration: line-through; }
.task-flat-meta { font-size: 11px; color: var(--t3); font-family: var(--mono); line-height: 1.4; }

.task-staff-card { padding: 12px 14px; margin-bottom: 10px; }
.task-staff-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.task-staff-name { font-size: 14px; font-weight: 600; color: var(--t1); }
.task-staff-shifts { font-size: 11px; color: var(--t3); margin-top: 2px; }
.task-staff-count { font-family: var(--mono); font-size: 11px; padding: 4px 10px; border-radius: 20px; background: var(--green-dim); color: var(--green); white-space: nowrap; }
.task-staff-list { display: flex; flex-direction: column; gap: 3px; padding-top: 4px; border-top: 1px solid var(--b1); }
.task-staff-item { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 6px 8px; min-height: 32px; }

/* ═══════════════════════════════════════ MODAL ═══════════════════════════════════════ */
#modal-root { position: fixed; inset: 0; z-index: 999; pointer-events: none; }
#modal-root > * { pointer-events: auto; }
.modal-back { position: fixed; inset: 0; background: rgba(0,66,46,.35); backdrop-filter: blur(2px); animation: fadeIn .2s; }
.modal {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--cream-pure); border-top: 1px solid var(--b1);
  border-radius: 16px 16px 0 0;
  max-height: 88dvh;
  padding-bottom: var(--sab);
  display: flex; flex-direction: column;
  animation: slideUp .28s cubic-bezier(.32,.72,0,1);
  box-shadow: 0 -8px 32px rgba(0,66,46,.18);
}
.modal::before {
  content: ''; position: absolute; top: 6px; left: 50%;
  transform: translateX(-50%);
  width: 40px; height: 4px;
  background: var(--b2); border-radius: 4px;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-head { padding: 18px 18px 12px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--b1); flex-shrink: 0; }
.modal-head h3 { font-size: 16px; font-weight: 500; color: var(--t1); }
.modal-x { width: 36px; height: 36px; border: none; background: var(--s2); border-radius: 50%; color: var(--t2); font-size: 20px; cursor: pointer; }
.modal-x:active { background: var(--s3); }
.modal-body { padding: 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.tpl-card { background: var(--bg); border: 1px solid var(--b1); border-radius: var(--rs); padding: 12px 14px; margin-bottom: 10px; }
.tpl-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; gap: 8px; }
.tpl-name { font-size: 14px; font-weight: 500; color: var(--t1); }
.tpl-meta { font-family: var(--mono); font-size: 10px; color: var(--t3); margin-top: 2px; }
.tpl-items { display: flex; flex-direction: column; gap: 4px; }
.tpl-item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--t2); }
.tpl-more { font-size: 11px; color: var(--t3); font-style: italic; margin-top: 2px; }

/* ═══════════════════════════════════════ TABLET ═══════════════════════════════════════ */
@media (min-width: 768px) {
  .page { padding: 24px; max-width: 800px; margin: 0 auto; }
  .topbar { padding-left: 24px; padding-right: 24px; }
  .tabbar { max-width: 600px; left: 50%; transform: translateX(-50%); border-radius: 16px 16px 0 0; }
}

/* ═══════════════════════════════════════ CHECK-IN PHOTOS ═══════════════════════════════════════ */
.checkin-section {
  background: var(--cream-pure);
  border: 1px solid var(--b1);
  border-radius: var(--r);
  margin-top: 12px;
  overflow: hidden;
}
.checkin-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--b1);
}
.checkin-title {
  font-size: 13px; font-weight: 600; color: var(--accent);
}
.checkin-progress {
  font-family: var(--mono); font-size: 11px; color: var(--accent);
  padding: 3px 9px; border-radius: 12px;
  background: var(--cream-pure);
}
.checkin-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--b1);
  min-height: 56px;
  transition: opacity .2s;
}
.checkin-row:last-child { border-bottom: none; }
.checkin-spot-info {
  display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0;
}
.checkin-spot-status {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  border: 2px solid var(--b1);
  color: var(--t3);
  flex-shrink: 0;
  transition: all .2s;
}
.checkin-spot-status.done {
  background: var(--accent); border-color: var(--accent);
  color: white;
}
.checkin-spot-name {
  font-size: 13px; font-weight: 500; color: var(--t1);
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.checkin-done-info {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.checkin-by {
  font-size: 10px; color: var(--accent);
  font-family: var(--mono);
  white-space: nowrap;
  max-width: 80px; overflow: hidden; text-overflow: ellipsis;
}
.checkin-thumb {
  width: 44px; height: 44px; border-radius: 8px;
  object-fit: cover; cursor: pointer;
  border: 1px solid var(--b1);
  transition: opacity .15s;
}
.checkin-thumb:active { opacity: .7; }
.checkin-upload-btn, .checkin-retake-btn {
  display: inline-flex; align-items: center;
  padding: 8px 12px; border-radius: 8px;
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.checkin-upload-btn {
  background: var(--accent); color: white;
  border: none;
}
.checkin-upload-btn:active { opacity: .85; }
.checkin-retake-btn {
  background: var(--bg); color: var(--t2);
  border: 1px solid var(--b1);
  font-size: 11px;
}
.checkin-retake-btn:active { background: var(--s2); }

/* Manager checkin page */
.checkin-mgr-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0;
}

/* ═══════════════════════════════════════ NOTE MULTI-PHOTO ═══════════════════════════════════════ */
.note-multi-photos {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 10px 10px 0;
}
.note-photo-item {
  position: relative; flex-shrink: 0;
}
.note-photo-thumb {
  width: 80px; height: 80px; border-radius: 8px;
  object-fit: cover; cursor: pointer;
  border: 1px solid var(--b1);
  transition: opacity .15s;
  display: block;
}
.note-photo-thumb:active { opacity: .75; }
.note-photo-del {
  position: absolute; top: 3px; right: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: white;
  border: none; font-size: 12px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.note-photo-add-btn {
  width: 80px; height: 80px; border-radius: 8px;
  border: 2px dashed var(--b1);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px; cursor: pointer;
  color: var(--t3); font-size: 20px;
  transition: border-color .15s;
}
.note-photo-add-btn:active { border-color: var(--accent); }

/* Note card thumbnail row (employee list view) */
.note-thumb-row {
  display: flex; gap: 4px; padding: 8px 10px 0;
  align-items: center;
}
.note-thumb {
  width: 56px; height: 56px; border-radius: 6px;
  object-fit: cover; border: 1px solid var(--b1);
}
.note-thumb-more {
  width: 56px; height: 56px; border-radius: 6px;
  background: var(--s2); color: var(--t3);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.note-video-badge {
  font-size: 11px; color: var(--blue);
  padding: 6px 12px 0;
}
.note-arrow {
  color: var(--t3); font-size: 18px; flex-shrink: 0;
}
.note-preview {
  font-size: 13px; color: var(--t3);
  padding: 4px 14px 12px;
  line-height: 1.5;
}

/* Note detail thumbnail grid (thumbnails, not full size) */
.note-detail-thumb-grid {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 10px 10px 0;
  background: var(--cream-pure);
}
.note-detail-thumb {
  width: 100px; height: 100px;
  object-fit: cover; border-radius: 8px;
  cursor: pointer; border: 1px solid var(--b1);
  transition: opacity .15s;
  flex-shrink: 0;
}
.note-detail-thumb:active { opacity: .75; }

/* Photo viewer */
.photo-viewer-modal {
  height: 90dvh; max-height: 90dvh; background: #000;
}
.photo-viewer-modal .modal-head {
  background: rgba(0,0,0,.7); border-bottom-color: rgba(255,255,255,.1);
  color: white;
}
.photo-viewer-modal .modal-x { color: white; }
.photo-viewer-body {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 8px; overflow: hidden;
  background: #000;
}
.photo-viewer-img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; border-radius: 4px;
}
.photo-viewer-thumbs {
  display: flex; gap: 4px; padding: 8px;
  overflow-x: auto; background: rgba(0,0,0,.8);
  -webkit-overflow-scrolling: touch;
}
.photo-viewer-thumb {
  width: 52px; height: 52px; flex-shrink: 0;
  object-fit: cover; border-radius: 6px;
  opacity: .5; cursor: pointer;
  border: 2px solid transparent;
  transition: all .15s;
}
.photo-viewer-thumb.on { opacity: 1; border-color: white; }


/* ═══════════════════════════════════════ NOTE MANAGER CARD (sectioned) ═══════════════════════════════════════ */
.note-card-mgr {
  background: var(--cream-pure);
  border: 1px solid var(--b1);
  border-radius: var(--r);
  margin-bottom: 14px;
  overflow: hidden;
}
.note-card-mgr.pinned { border-left: 3px solid var(--accent); }

.note-mgr-section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--b1);
}
.note-mgr-section:last-child { border-bottom: none; }

.note-mgr-header-section {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg);
}

.note-mgr-section-label {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 1.5px; color: var(--t3);
  margin-bottom: 8px; text-transform: uppercase;
}

.note-card-mgr .note-title-inp {
  flex: 1;
  background: transparent;
  border: none;
  font-size: 16px; font-weight: 600;
  color: var(--t1); padding: 4px 0;
  outline: none;
}
.note-card-mgr .note-title-inp:focus {
  border-bottom: 1px solid var(--accent);
}

.note-card-mgr .note-actions {
  display: flex; gap: 2px; flex-shrink: 0;
}

.note-card-mgr .note-mgr-body {
  font-size: 14px; line-height: 1.6;
  color: var(--t1);
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* ═══════════════════════════════════════ NOTE DETAIL (employee modal) ═══════════════════════════════════════ */
.note-detail-title {
  font-size: 22px; font-weight: 600;
  color: var(--t1);
  padding: 16px 16px 4px;
  line-height: 1.3;
}
.note-detail-tags {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 14px 16px 0;
}
.note-detail-body {
  font-size: 15px; line-height: 1.8;
  color: var(--t1);
  white-space: pre-wrap;
  padding: 12px 16px 16px;
  word-wrap: break-word;
}
.note-detail-section {
  border-top: 1px solid var(--b1);
  padding: 14px 16px;
  background: var(--cream-pure);
}
.note-detail-section .note-mgr-section-label {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 1.5px; color: var(--t3);
  margin-bottom: 10px; text-transform: uppercase;
}

/* ═══════════════════════════════════════ FEEDBACK DATE FILTER ═══════════════════════════════════════ */
.fb-date-filter {
  background: var(--cream-pure);
  border: 1px solid var(--b1);
  border-radius: var(--r);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.fb-date-filter-label {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 1.5px; color: var(--t3);
  margin-bottom: 8px; text-transform: uppercase;
}
.fb-date-filter-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.fb-date-inp {
  flex: 1; min-height: 36px;
  font-size: 13px; padding: 6px 10px;
  margin: 0;
}
.fb-retention-note {
  font-size: 11px; color: var(--t3);
  line-height: 1.5;
  padding-top: 6px;
  border-top: 1px solid var(--b1);
  margin-top: 4px;
}
