/* Janus — shared styles for the kiosk (iPad) and admin console. */

/* Dark blue theme matching the Janus clipboard logo. */
:root {
  --bg: #0b1220;
  --panel: #131d33;
  --panel-soft: #1a2745;
  --line: #28395c;
  --text: #e8eef9;
  --muted: #8fa3c8;
  --accent: #3b82f6;
  --accent-strong: #2563eb;
  --accent-soft: rgba(59, 130, 246, 0.16);
  --danger: #e05d5d;
  --danger-soft: rgba(224, 93, 93, 0.14);
  --warn: #e0a13f;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(2, 8, 20, 0.4), 0 4px 16px rgba(2, 8, 20, 0.25);
}

* { box-sizing: border-box; }

/* keep the hidden attribute authoritative over display:grid/flex rules */
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

p, h1, h2, h3, dl, dd, dt, ul { margin: 0; padding: 0; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }
.muted { color: var(--muted); }

/* ---------- top bar ---------- */

.header-stack {
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.4rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

/* single exception-report entry point, floating under the clock */
.report-bar {
  display: flex;
  justify-content: flex-end;
  padding: 0.55rem 1.4rem;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.report-mode-btn {
  border: 1px solid rgba(224, 93, 93, 0.65);
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 999px;
  padding: 0.55rem 1.4rem;
  font-size: 1rem;
  font-weight: 700;
}
.report-mode-btn.active {
  border-color: var(--line);
  background: var(--panel-soft);
  color: var(--text);
}

.brand { display: flex; align-items: center; gap: 0.7rem; flex: 1; min-width: 0; }
.brand-mark { font-size: 1.9rem; }
img.brand-mark { width: 2.4rem; height: 2.4rem; display: block; }
.brand-title { font-weight: 700; font-size: 1.05rem; }
.brand-store { color: var(--muted); font-size: 0.85rem; }

.clock { text-align: right; }
.clock-date { color: var(--muted); font-size: 0.95rem; }
.clock-time { font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }

.lang-toggle {
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--text);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-size: 0.9rem;
}

/* ---------- layout ---------- */

#main { max-width: 60rem; margin: 0 auto; padding: 1.2rem 1.2rem 3rem; }
.view { display: grid; gap: 1rem; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
}

.panel-title { font-size: 1rem; color: var(--muted); font-weight: 600; }

/* ---------- landing ---------- */

.landing-panel { text-align: center; padding: 2.4rem 1.4rem; }

.landing-status {
  font-size: 1.3rem;
  font-weight: 700;
  min-height: 1.6rem;
  margin-bottom: 1rem;
}
.landing-status.active { color: var(--accent); }

.qr-block { display: grid; justify-items: center; gap: 1rem; }
.qr-image {
  width: min(58vw, 20rem);
  height: auto;
  background: #fff;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.qr-hint { color: var(--muted); font-size: 1.05rem; }

.outside-block { display: grid; justify-items: center; gap: 0.9rem; }
.outside-icon { font-size: 3rem; }
.outside-title { font-size: 1.25rem; font-weight: 700; }
.window-list { display: grid; gap: 0.4rem; }
.window-list div { display: flex; gap: 1rem; justify-content: center; }
.window-list dt { color: var(--muted); }
.window-list dd { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- checklist ---------- */

.welcome-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--accent-soft);
  border: 1px solid rgba(59, 130, 246, 0.45);
  border-radius: var(--radius);
  padding: 0.9rem 1.2rem;
}
.welcome-text { font-size: 1.15rem; font-weight: 700; }
.welcome-actions { display: flex; gap: 0.5rem; }

.shift-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.7rem; }
.shift-chip {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.shift-empty { padding: 0.3rem 0; }

.checklist-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}
.progress { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.item-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.6rem;
}
@media (max-width: 640px) {
  .item-list { grid-template-columns: minmax(0, 1fr); }
}

.item-category-header {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 0.5rem;
  padding-left: 0.2rem;
}
.item-category-header:first-child { margin-top: 0; }

.item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 0.35rem 0.7rem 0.35rem 0.35rem;
}
.item-done { border-color: rgba(59, 130, 246, 0.55); background: var(--accent-soft); }
.item-exception { border-color: rgba(224, 93, 93, 0.55); background: var(--danger-soft); }

.item-main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: none;
  border: none;
  color: var(--text);
  text-align: left;
  padding: 0.6rem 0.4rem;
  font-size: 1.1rem;
  min-height: 3.1rem;
}

.item-box {
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  border: 2px solid var(--muted);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.15rem;
}
.item-done .item-box { border-color: var(--accent); background: var(--accent); color: #fff; }
/* reported items: greyed-out box, no more checking */
li.item-exception .item-box {
  border-color: #55648a;
  background: #39445e;
  color: #9fb0cd;
}
li.item-exception .item-main { cursor: default; }

.item-label { line-height: 1.45; }

/* report mode: checkboxes hidden, labels shift left, report button per item */
.item-list.report-mode .item-box { display: none; }
.item-list.report-mode .item-main { padding-left: 0.55rem; cursor: default; }

.item-report-btn {
  flex: none;
  border: 1px solid rgba(224, 93, 93, 0.6);
  color: var(--danger);
  background: none;
  border-radius: 10px;
  padding: 0.55rem 0.95rem;
  font-size: 0.95rem;
  margin-right: 0.3rem;
}
.item-report-btn.reported {
  border-color: var(--line);
  color: var(--muted);
  background: var(--panel);
  cursor: default;
}

p.item-exception {
  flex-basis: 100%;
  border: none;
  background: none;
  color: var(--danger);
  font-size: 0.92rem;
  padding: 0 0.5rem 0.55rem 3.4rem;
}
.item-list.report-mode p.item-exception { padding-left: 0.9rem; }

/* ---------- submit ---------- */

.submit-area { margin-top: 1.1rem; display: grid; gap: 0.5rem; }
.note-label { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.9rem; }

.note-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  padding: 0.7rem 0.8rem;
  resize: vertical;
}

.primary-btn {
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  border-radius: 12px;
  padding: 0.95rem;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
.primary-btn:disabled { opacity: 0.35; cursor: default; }

.ghost-btn {
  border: 1px solid var(--line);
  background: none;
  color: var(--text);
  border-radius: 10px;
  padding: 0.55rem 1rem;
  font-size: 0.95rem;
}

.danger-btn {
  border: none;
  background: var(--danger);
  color: #fff;
  font-weight: 700;
  border-radius: 10px;
  padding: 0.65rem 1.2rem;
  font-size: 1rem;
}

/* ---------- done ---------- */

.done-panel { text-align: center; padding: 3rem 1.5rem; display: grid; gap: 0.9rem; justify-items: center; }
.done-icon { font-size: 3.2rem; }
.done-title { font-size: 1.5rem; font-weight: 700; }

/* ---------- history ---------- */

.history-list { display: grid; gap: 0.7rem; }
.history-entry {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 0.8rem 1rem;
  display: grid;
  gap: 0.35rem;
}
.history-head { font-weight: 600; }
.history-exceptions { color: var(--danger); font-size: 0.95rem; }
.history-note { font-size: 0.92rem; }

/* ---------- modal / toast ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 8, 18, 0.72);
  display: grid;
  place-items: center;
  padding: 1.2rem;
  z-index: 20;
}

.modal {
  width: min(30rem, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem;
  display: grid;
  gap: 0.8rem;
}
.modal-title { font-size: 1.15rem; }
.modal-item { color: var(--warn); font-weight: 600; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; }

.toast {
  position: fixed;
  bottom: 1.4rem;
  left: 50%;
  transform: translateX(-50%);
  background: #1a2745;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
  padding: 0.7rem 1.3rem;
  font-size: 0.95rem;
  z-index: 30;
  max-width: 90vw;
}

/* ---------- admin ---------- */

.admin-nav { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.admin-nav button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  font-size: 0.95rem;
}
.admin-nav button.active { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }

/* admin console uses the full desktop width */
body.admin #main { max-width: 100rem; }

/* two-column admin layout on wide screens; each column scrolls on its own */
.col { display: grid; gap: 1rem; align-content: start; }
@media (min-width: 900px) {
  .view.two-col { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; }

  body.admin { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
  body.admin .topbar { flex: none; }
  body.admin #main {
    flex: 1;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 1rem;
  }
  body.admin #main > .admin-nav,
  body.admin #main > .form-field { flex: none; }
  body.admin #main > section { flex: 1; min-height: 0; overflow-y: auto; }
  body.admin #main > section.two-col { overflow: hidden; }
  body.admin .two-col .col {
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
    padding-right: 0.3rem;
    scrollbar-width: thin;
  }
}

.nav-badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.3rem;
  height: 1.3rem;
  margin-left: 0.4rem;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0 0.3rem;
}

.draft-bar,
.pending-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
.draft-bar {
  background: rgba(224, 161, 63, 0.12);
  border: 1px solid rgba(224, 161, 63, 0.5);
  color: var(--warn);
}
.pending-note {
  background: var(--accent-soft);
  border: 1px solid rgba(59, 130, 246, 0.45);
  color: #9cc1fd;
}

.approval-lines { display: grid; gap: 0.2rem; color: var(--muted); font-size: 0.92rem; }
.approval-lines .add { color: #7fd0a5; }
.approval-lines .del { color: var(--danger); }

.form-grid { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.form-field { display: grid; gap: 0.3rem; }
.form-field label { color: var(--muted); font-size: 0.85rem; }
.form-field input, .form-field select, .form-field textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  padding: 0.6rem 0.7rem;
  width: 100%;
}

.form-field textarea { resize: vertical; font-family: inherit; }

.flow-tabs { display: flex; gap: 0.5rem; margin: 0.8rem 0; }
.flow-tabs button {
  border: 1px solid var(--line);
  background: none;
  color: var(--muted);
  border-radius: 10px;
  padding: 0.5rem 1.2rem;
}
.flow-tabs button.active { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }

.admin-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  padding: 0.55rem 0.8rem;
}
.admin-item-label { flex: 1; min-width: 0; }
.admin-item-label small { display: block; color: var(--muted); }
.admin-item-badge {
  flex: none;
  font-size: 0.8rem;
  color: #9cc1fd;
  border: 1px solid rgba(59, 130, 246, 0.45);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
}
.icon-btn {
  border: 1px solid var(--line);
  background: none;
  color: var(--text);
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  font-size: 0.9rem;
}
.icon-btn.danger { color: var(--danger); border-color: rgba(217, 72, 72, 0.45); }

.report-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  padding: 0.7rem 0.9rem;
  display: grid;
  gap: 0.3rem;
}
.report-head { display: flex; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; font-weight: 600; }
.report-status-submitted { color: var(--accent); }
.report-status-in_progress { color: var(--warn); }
.report-items { color: var(--muted); font-size: 0.92rem; }
.report-items .ex { color: var(--danger); }

.table-scroll { overflow-x: auto; }

@media (max-width: 640px) {
  .clock-time { font-size: 1.3rem; }
  .topbar { padding: 0.7rem 0.9rem; }
  #main { padding: 0.9rem 0.8rem 2.4rem; }
}
