/* ===================================================== Beartaria Admin === */
:root {
  --navy: #16263b; --orange: #f58220; --teal: #17838c; --red: #e8443b;
  --green: #2f9e57; --ink: #1c2733; --ink-soft: #5b6875; --line: #e2e6ea;
  --bg: #f4f6f8; --card: #fff; --radius: 12px; --shadow: 0 1px 3px rgba(16,27,43,.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.5; }
a { color: var(--teal); text-decoration: none; }
img { max-width: 100%; }

.a-top {
  background: var(--navy); color: #fff; padding: 12px 16px;
  display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30;
}
.a-top .crest { width: 30px; height: 30px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,.2); }
.a-top b { font-size: 15px; }
.a-top .sp { flex: 1; }
.a-top a, .a-top button { color: rgba(255,255,255,.85); font-size: 13px; background: none; border: 0; cursor: pointer; padding: 6px 8px; }
.a-top .btn-logout { border: 1px solid rgba(255,255,255,.3); border-radius: 8px; }

.a-nav { background: #fff; border-bottom: 1px solid var(--line); overflow-x: auto; white-space: nowrap; position: sticky; top: 54px; z-index: 20; scrollbar-width: none; }
.a-nav::-webkit-scrollbar { display: none; }
.a-nav a { display: inline-block; padding: 12px 15px; color: var(--ink-soft); font-weight: 600; font-size: 14px; border-bottom: 3px solid transparent; }
.a-nav a.active { color: var(--navy); border-bottom-color: var(--orange); }

.a-wrap { max-width: 860px; margin: 0 auto; padding: 18px 16px 60px; }
.a-wrap h1 { font-size: 22px; margin: 4px 0 16px; }
.a-flash { background: #e7f6ec; border: 1px solid #b6e2c4; color: #1d6b39; padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }

.a-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.a-card + .a-card { margin-top: 16px; }
.a-card .hd { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.a-card .hd h2 { margin: 0; font-size: 16px; }
.a-card .hd .sp { flex: 1; }
.a-card .bd { padding: 16px; }

.a-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 15px; border-radius: 9px; border: 0; font-weight: 700; font-size: 14px; cursor: pointer; background: var(--navy); color: #fff; }
.a-btn.orange { background: var(--orange); }
.a-btn.teal { background: var(--teal); }
.a-btn.ghost { background: #eef1f4; color: var(--ink); }
.a-btn.danger { background: #fdeceb; color: var(--red); }
.a-btn.sm { padding: 6px 11px; font-size: 13px; }
.a-btn.block { display: flex; width: 100%; justify-content: center; }

.a-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.a-stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.a-stat b { display: block; font-size: 30px; color: var(--navy); }
.a-stat span { color: var(--ink-soft); font-size: 13px; }

.a-list { list-style: none; margin: 0; padding: 0; }
.a-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.a-row:last-child { border-bottom: 0; }
.a-row .grow { flex: 1; min-width: 0; }
.a-row .grow b { font-size: 15px; }
.a-row .grow small { color: var(--ink-soft); display: block; }
.a-row .actions { display: flex; gap: 6px; flex: none; }
.pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #eef1f4; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .4px; }
.pill.main { background: #fdeede; color: #a85400; }
.pill.field { background: #e5f6f2; color: #0f6b60; }
.pill.late { background: #ece5f5; color: #5b3a87; }
.pill.food { background: #fdeceb; color: #b0342c; }
.pill.goods { background: #fdeede; color: #a85400; }
.pill.off { background: #f1d9d7; color: #a5342c; }

label.f { display: block; margin-bottom: 14px; }
label.f > span { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; color: var(--ink); }
label.f small { font-weight: 400; color: var(--ink-soft); }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], input[type=email], input[type=color], select, textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 9px; font-size: 15px; font-family: inherit; background: #fff; color: var(--ink);
}
input[type=color] { height: 44px; padding: 4px; }
textarea { min-height: 90px; resize: vertical; }
.f-row { display: flex; gap: 12px; flex-wrap: wrap; }
.f-row > label.f { flex: 1; min-width: 140px; }
.f-check { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-weight: 600; font-size: 14px; }
.f-check input { width: 18px; height: 18px; }
.form-actions { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.hintbox { background: #fff8e8; border: 1px solid #f3e2b0; color: #7a5a12; padding: 10px 12px; border-radius: 9px; font-size: 13px; margin-bottom: 14px; }

/* login */
.a-login { max-width: 360px; margin: 12vh auto 0; padding: 0 20px; text-align: center; }
.a-login .crest { width: 72px; height: 72px; border-radius: 50%; box-shadow: 0 4px 16px rgba(0,0,0,.15); margin-bottom: 14px; }
.a-login h1 { font-size: 20px; }
.a-login .err { background: #fdeceb; color: var(--red); border: 1px solid #f3c9c5; border-radius: 9px; padding: 9px; font-size: 14px; margin-bottom: 12px; }

/* map editor */
.editor-stage { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #cfe3a9; touch-action: none; height: 60vh; }
.editor-canvas { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.editor-canvas img { max-width: none; pointer-events: none; display: block; }
.epin { position: absolute; transform: translate(-50%, -50%); z-index: 3; cursor: grab; }
.epin.sel .ed { outline: 3px solid #fff; box-shadow: 0 0 0 5px var(--orange); }
.epin .ed { width: 24px; height: 24px; border-radius: 50%; background: var(--orange); border: 2px solid #fff; box-shadow: 0 2px 5px rgba(0,0,0,.4); display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 800; }
.editor-tools { position: absolute; right: 8px; bottom: 8px; display: flex; flex-direction: column; gap: 6px; z-index: 6; }
.editor-tools button { width: 36px; height: 36px; border: 0; border-radius: 8px; background: rgba(22,38,59,.9); color: #fff; font-size: 18px; }
.mk-hint { font-size: 12.5px; color: var(--ink-soft); margin: 8px 0; }
