/* PIVO ONE — 02 MODERN design system */
:root {
  --primary: #1677FF; --primary-hover: #0F63D9; --primary-soft: #EAF2FF; --primary-ink: #0B4FB3;
  --bg: #F7F9FC; --surface: #FFFFFF; --text: #172033; --text-2: #667085; --text-3: #98A2B3; --border: #E6EAF0; --border-2: #D0D5DD;
  --success: #12B76A; --success-soft: #E7F8F0; --warning: #F79009; --warning-soft: #FFF4E5; --danger: #F04438; --danger-soft: #FEECEB; --info-soft: #EAF2FF;
  --purple: #7A5AF8; --purple-soft: #F0EDFF; --teal: #0E9384; --teal-soft: #E4F5F3;
  --radius-card: 14px; --radius-btn: 10px; --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(23, 32, 51, 0.05); --shadow-md: 0 4px 12px rgba(23, 32, 51, 0.06);
  --sidebar-w: 240px; --header-h: 56px; --bottomnav-h: 64px;
  --font: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.55; -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body { min-height: 100vh; }
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 16px; color: var(--text); }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 20px; } h2 { font-size: 17px; } h3 { font-size: 15px; } h4 { font-size: 14px; }
p { margin: 0; }
img { max-width: 100%; }
::selection { background: var(--primary-soft); }

/* ---------- Layout ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border); position: fixed; top: 0; bottom: 0; left: 0; display: flex; flex-direction: column; z-index: 20; }
.sidebar .brand { height: var(--header-h); display: flex; align-items: center; gap: 10px; padding: 0 20px; border-bottom: 1px solid var(--border); }
.sidebar nav { padding: 12px; flex: 1; overflow-y: auto; }
.sidebar .nav-section { font-size: 11px; color: var(--text-3); font-weight: 700; letter-spacing: 0.08em; padding: 14px 10px 6px; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; cursor: pointer; margin-bottom: 2px; }
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary-ink); font-weight: 700; }
.nav-item .badge-dot { margin-left: auto; }
.sidebar .me { padding: 14px 16px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; }
.topbar { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar .title { font-weight: 700; font-size: 16px; }
.content { padding: 24px; max-width: 1200px; }
.mobile-header { display: none; }
.bottomnav { display: none; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .topbar { display: none; }
  .mobile-header { display: flex; position: sticky; top: 0; z-index: 10; height: var(--header-h); align-items: center; justify-content: space-between; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
  .content { padding: 16px; padding-bottom: calc(var(--bottomnav-h) + 24px); }
  .bottomnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: var(--bottomnav-h); background: var(--surface); border-top: 1px solid var(--border); z-index: 20; padding-bottom: env(safe-area-inset-bottom); }
  .bottomnav .tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10px; color: var(--text-2); cursor: pointer; position: relative; }
  .bottomnav .tab.active { color: var(--primary); font-weight: 700; }
  .bottomnav .tab .badge-dot { position: absolute; top: 8px; right: calc(50% - 16px); }
}

/* ---------- Components ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-sm); padding: 18px; }
.card.pad-0 { padding: 0; overflow: hidden; }
.card + .card { margin-top: 14px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card-title h3 { display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3, .grid-4, .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-2.stack-m { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .grid-4.tight-m, .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stack > * + * { margin-top: 14px; }
.stack-sm > * + * { margin-top: 8px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12px; }
.xs { font-size: 11px; }
.bold { font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.center { text-align: center; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.hide-m { } .show-m { display: none; }
@media (max-width: 900px) { .hide-m { display: none !important; } .show-m { display: initial; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: var(--radius-btn); border: 1px solid transparent; font-weight: 700; font-size: 15px; cursor: pointer; background: var(--primary); color: #fff; transition: background .15s, box-shadow .15s; white-space: nowrap; }
.btn:hover { background: var(--primary-hover); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border-2); }
.btn.secondary:hover { background: var(--bg); }
.btn.soft { background: var(--primary-soft); color: var(--primary-ink); }
.btn.soft:hover { background: #DCE9FF; }
.btn.success { background: var(--success); } .btn.success:hover { background: #0FA35C; }
.btn.danger { background: var(--danger); } .btn.danger:hover { background: #D92D20; }
.btn.warning { background: var(--warning); }
.btn.ghost { background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--bg); color: var(--text); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.xs { min-height: 30px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn.icon { padding: 0; width: 40px; min-height: 40px; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 18px; white-space: nowrap; background: var(--bg); color: var(--text-2); border: 1px solid var(--border); }
.chip.primary { background: var(--primary-soft); color: var(--primary-ink); border-color: transparent; }
.chip.success { background: var(--success-soft); color: #027A48; border-color: transparent; }
.chip.warning { background: var(--warning-soft); color: #B54708; border-color: transparent; }
.chip.danger { background: var(--danger-soft); color: #B42318; border-color: transparent; }
.chip.purple { background: var(--purple-soft); color: #5925DC; border-color: transparent; }
.chip.teal { background: var(--teal-soft); color: #0E9384; border-color: transparent; }
.chip.dark { background: var(--text); color: #fff; border-color: transparent; }
.badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); display: inline-block; }
.badge-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

.field { display: block; }
.field + .field { margin-top: 14px; }
.field .label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.field .label .req { color: var(--danger); font-size: 11px; }
.field .hint { font-size: 12px; color: var(--text-2); margin-top: 5px; }
.input, .select, .textarea { width: 100%; min-height: 48px; border: 1px solid var(--border-2); border-radius: var(--radius-btn); padding: 10px 14px; background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.15); }
.input.error { border-color: var(--danger); }
.textarea { min-height: 96px; resize: vertical; }
.select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23667085' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.select-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.select-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.select-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.opt { min-height: 48px; border: 1px solid var(--border-2); border-radius: var(--radius-btn); background: var(--surface); padding: 8px 12px; font-weight: 500; cursor: pointer; text-align: center; color: var(--text); transition: all .12s; font-size: 14px; }
.opt:hover { border-color: var(--primary); }
.opt.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-ink); font-weight: 700; }
.opt.sm { min-height: 40px; font-size: 13px; }
.file-box { border: 1.5px dashed var(--border-2); border-radius: var(--radius-card); padding: 18px; text-align: center; background: var(--bg); cursor: pointer; }
.file-box.on { border-style: solid; border-color: var(--success); background: var(--success-soft); }
.file-box input { display: none; }
.file-preview { width: 100%; max-height: 260px; object-fit: contain; border-radius: var(--radius-sm); margin-top: 10px; background: #fff; }

.notice { border-radius: var(--radius-card); padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.notice .t { font-weight: 700; margin-bottom: 2px; }
.notice.info { background: var(--info-soft); color: var(--primary-ink); }
.notice.success { background: var(--success-soft); color: #027A48; }
.notice.warning { background: var(--warning-soft); color: #B54708; }
.notice.danger { background: var(--danger-soft); color: #B42318; }

.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.kpi .ic { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.kpi .v { font-size: 22px; font-weight: 700; line-height: 1.1; }
.kpi .v small { font-size: 12px; font-weight: 500; color: var(--text-2); margin-left: 2px; }
.kpi .l { font-size: 12px; color: var(--text-2); }

.progress { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--success); border-radius: 4px; transition: width .3s; }
.progress.primary > i { background: var(--primary); }
.progress.warning > i { background: var(--warning); }

.steps { display: flex; align-items: center; justify-content: space-between; position: relative; padding: 4px 8px; }
.steps:before { content: ''; position: absolute; left: 32px; right: 32px; top: 18px; height: 2px; background: var(--border); }
.step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; z-index: 1; }
.step .dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border-2); background: var(--surface); display: flex; align-items: center; justify-content: center; color: var(--text-3); font-size: 12px; font-weight: 700; }
.step.done .dot { background: var(--success); border-color: var(--success); color: #fff; }
.step.cur .dot { border-color: var(--primary); color: var(--primary); }
.step .lb { font-size: 12px; font-weight: 700; }
.step .sub { font-size: 11px; color: var(--text-2); }
.step.done .sub { color: #027A48; }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.list > li:first-child { border-top: 0; padding-top: 0; }
.list > li:last-child { padding-bottom: 0; }
.list.tap > li { cursor: pointer; margin: 0 -18px; padding: 12px 18px; }
.list.tap > li:hover { background: var(--bg); }
.ic-box { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-ink); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; overflow: hidden; object-fit: cover; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; color: var(--text-2); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--bg); white-space: nowrap; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.tap { cursor: pointer; } .tbl tr.tap:hover td { background: var(--bg); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tabs .tab { padding: 10px 14px; font-weight: 700; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-size: 13px; }
.tabs .tab.active { color: var(--primary); border-color: var(--primary); }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-weight: 700; color: var(--text-2); cursor: pointer; font-size: 13px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.modal-bg { position: fixed; inset: 0; background: rgba(23, 32, 51, 0.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 640px) { .modal-bg { align-items: center; } }
.modal { background: var(--surface); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 20px; }
@media (min-width: 640px) { .modal { border-radius: 18px; } }
.toast { position: fixed; bottom: calc(var(--bottomnav-h) + 16px); left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 700; z-index: 60; box-shadow: var(--shadow-md); max-width: 90vw; }
@media (min-width: 900px) { .toast { bottom: 24px; } }
.overlay { position: fixed; inset: 0; background: rgba(247, 249, 252, 0.85); z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--border) 25%, #F0F2F5 50%, var(--border) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; height: 14px; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.empty { text-align: center; color: var(--text-2); padding: 28px 12px; font-size: 13px; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }

.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendar .dow { text-align: center; font-size: 11px; color: var(--text-2); font-weight: 700; padding: 4px 0; }
.calendar .day { min-height: 44px; border: 1px solid var(--border); border-radius: 8px; padding: 4px; font-size: 12px; background: var(--surface); cursor: pointer; position: relative; }
.calendar .day.blank { border-color: transparent; background: transparent; cursor: default; }
.calendar .day.ok { background: var(--success-soft); border-color: var(--success); color: #027A48; font-weight: 700; }
.calendar .day.ng { background: var(--danger-soft); border-color: var(--danger); color: #B42318; font-weight: 700; }
.calendar .day.today { outline: 2px solid var(--primary); outline-offset: -2px; }
.calendar.big .day { min-height: 84px; cursor: default; }
.calendar .day .n { font-weight: 700; }
.calendar .day .ev { font-size: 10px; line-height: 1.3; padding: 2px 4px; border-radius: 4px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--primary-soft); color: var(--primary-ink); }
.calendar .day .ev.draft { background: var(--warning-soft); color: #B54708; }
.calendar .day .ev.short { background: var(--danger-soft); color: #B42318; }
.calendar .day .ev.off { background: var(--bg); color: var(--text-2); }

.hero-store { display: flex; gap: 14px; }
.hero-store .thumb { width: 96px; height: 96px; border-radius: 12px; background: linear-gradient(135deg, var(--primary-soft), #DCE9FF); display: flex; align-items: center; justify-content: center; color: var(--primary); flex-shrink: 0; }
.big-check { min-height: 64px; font-size: 17px; }
.gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.gate .card { width: 100%; max-width: 420px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 900; letter-spacing: 0.04em; font-size: 16px; color: var(--text); }
.logo i { width: 22px; height: 22px; border-radius: 6px; background: var(--primary); display: inline-block; position: relative; }
.logo i:after { content: ''; position: absolute; left: 6px; top: 6px; width: 10px; height: 10px; border-radius: 2px; background: #fff; transform: skewX(-12deg); }
.photo-frame { width: 100%; max-width: 320px; aspect-ratio: 3/4; border-radius: 16px; overflow: hidden; background: var(--bg); margin: 0 auto; position: relative; border: 1px solid var(--border); }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.photo-frame .cam { position: absolute; right: 12px; bottom: 12px; width: 44px; height: 44px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-md); }
.map-box { height: 120px; border-radius: 12px; background: repeating-linear-gradient(45deg, #EEF3FA 0 8px, #F7F9FC 8px 16px); display: flex; align-items: center; justify-content: center; color: var(--text-2); font-size: 12px; border: 1px solid var(--border); }
.dev-bar { background: #172033; color: #fff; font-size: 12px; padding: 6px 12px; display: flex; gap: 10px; align-items: center; justify-content: center; }
.dev-bar select { font-size: 12px; min-height: 28px; border-radius: 6px; padding: 2px 6px; }
.split-32 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.split-23 { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
@media (max-width: 900px) { .split-32, .split-23 { grid-template-columns: 1fr; } }
