/* 빠까 관리 — mobile first */
.pika-admin{
  --pad: 14px;
  box-sizing: border-box;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: calc(60px + 16px) var(--pad) 96px;
  color: #111827;
  -webkit-tap-highlight-color: transparent;
}
.pika-admin *,.pika-admin *::before,.pika-admin *::after{box-sizing:border-box}
.pika-admin h2{margin:0 0 6px;font-size:24px;font-weight:800;line-height:1.25}
.pika-admin .sub{color:#6b7280;font-size:14px;line-height:1.45;margin:0 0 16px}

.pika-tabs{
  position: sticky;
  top: 60px;
  z-index: 20;
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  gap: 8px;
  margin: 0 calc(var(--pad) * -1) 16px;
  padding: 10px var(--pad);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid #e5e7eb;
  scrollbar-width: none;
}
.pika-tabs::-webkit-scrollbar {
  display: none;
}
.pika-tabs button{
  flex: 0 0 auto;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 9999px;
  padding: 8px 18px;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
  min-height: 38px;
  color: #4b5563;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.pika-tabs button:hover{
  background: #f3f4f6;
  color: #111827;
}
.pika-tabs button.active{
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
  box-shadow: 0 2px 6px rgba(15,23,42,.15);
}

.pika-panel{display:none}
.pika-panel.active{display:block}

.stat-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.stat-card{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:16px;
  padding:12px;
  box-shadow:0 4px 14px rgba(16,24,40,.04);
}
.stat-card .label{font-size:11px;color:#6b7280;font-weight:800}
.stat-card .value{font-size:22px;font-weight:900;margin-top:4px;letter-spacing:-.02em}

.card{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:16px;
  padding:14px;
  margin-bottom:12px;
  box-shadow:0 4px 14px rgba(16,24,40,.04);
}
.card h3{margin:0 0 10px;font-size:15px}
.panel-desc{
  margin:0 0 12px;
  padding:10px 12px;
  background:#f9fafb;
  border:1px solid #e5e7eb;
  border-radius:12px;
  color:#4b5563;
  font-size:13px;
  line-height:1.55;
}
.panel-desc strong{color:#111827;font-weight:800}

.toolbar,.form-row{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:stretch;
  margin-bottom:10px;
}
.toolbar label{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:12px;
  font-weight:700;
  color:#4b5563;
  background:#f9fafb;
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:10px 12px;
  min-height:42px;
}
.toolbar input[type="text"],
.toolbar input:not([type]),
.toolbar select,
.form-row input,
.form-row select{
  flex:1 1 100%;
  width:100%;
  min-width:0;
  border:1px solid #d1d5db;
  border-radius:12px;
  padding:12px;
  font-size:15px;
  min-height:44px;
  background:#fafafa;
}
.toolbar button,.form-row button,.btn{
  border:0;
  background:#111;
  color:#fff;
  border-radius:12px;
  padding:12px 14px;
  font-weight:800;
  cursor:pointer;
  font-size:14px;
  min-height:44px;
  flex:1 1 auto;
}
.btn.secondary{background:#f3f4f6;color:#111}
.btn.danger{background:#fee2e2;color:#b91c1c}
.btn.small{padding:10px 12px;font-size:13px;min-height:40px;flex:0 0 auto}
.btn-row{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}

.list{display:flex;flex-direction:column;gap:10px}
.item{
  border:1px solid #eef2f7;
  background:#fafbfc;
  border-radius:14px;
  padding:12px;
}
.item .title-line{font-size:15px;font-weight:900;line-height:1.35;word-break:break-word}
.item .meta-line{margin-top:6px;font-size:12px;color:#6b7280;line-height:1.45;word-break:break-word}
.item .body-line{margin-top:8px;font-size:14px;line-height:1.45;word-break:break-word}
.item .actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.item .actions .btn{flex:1 1 calc(50% - 4px)}

.badge{display:inline-block;border-radius:999px;padding:3px 8px;font-size:11px;font-weight:800;margin:0 2px 2px 0}
.badge.ok{background:#ecfdf5;color:#047857}
.badge.off{background:#f3f4f6;color:#6b7280}
.badge.ppa{background:#ecfdf5;color:#047857}
.badge.kka{background:#fef2f2;color:#b91c1c}

.empty{color:#9ca3af;padding:20px 12px;text-align:center;font-size:13px}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;color:#6b7280;word-break:break-all}

#snackbar.pika-toast{
  visibility:hidden;
  left:50%;
  bottom:24px;
  transform:translateX(-50%);
  width:calc(100% - 32px);
  max-width:420px;
  margin:0;
  background:rgba(17,17,17,.94);
  color:#fff;
  text-align:center;
  border-radius:14px;
  padding:14px 16px;
  position:fixed;
  z-index:9999;
  font-weight:800;
  font-size:13px;
  box-shadow:0 10px 30px rgba(0,0,0,.25);
}
#snackbar.pika-toast.show{visibility:visible}

@media (max-width: 640px) {
  .pika-admin {
    padding: calc(60px + env(safe-area-inset-top, 0px) + 12px) 12px calc(80px + env(safe-area-inset-bottom, 0px));
  }
  .pika-tabs {
    top: calc(60px + env(safe-area-inset-top, 0px));
    margin: 0 -12px 16px;
    padding: 8px 12px 10px;
    gap: 6px;
  }
  .pika-tabs button {
    padding: 8px 14px;
    font-size: 13px;
    min-height: 38px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .card {
    padding: 14px 12px;
    border-radius: 12px;
  }
  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .toolbar input, .toolbar select {
    width: 100%;
    min-height: 42px;
    font-size: 14px;
  }
  .toolbar .btn {
    width: 100%;
    min-height: 42px;
    font-size: 14px;
  }
  .item .actions .btn {
    flex: 1 1 100%;
    min-height: 38px;
  }
}

@media (min-width:640px){
  .stat-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .toolbar input[type="text"],
  .toolbar input:not([type]),
  .toolbar select,
  .form-row input,
  .form-row select{flex:1 1 180px;width:auto}
  .toolbar button,.form-row button,.btn{flex:0 0 auto}
  .item .actions .btn{flex:0 0 auto}
}
@media (min-width:900px){
  .stat-grid{grid-template-columns:repeat(5,minmax(0,1fr))}
}
