* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(180deg, #f8f1e4 0%, #f4ead7 100%);
  color: #2f2118;
}
button, input, textarea, select { font: inherit; }
.hidden { display: none !important; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 280px 1fr; transition: grid-template-columns .22s ease; }
.app-shell.sidebar-collapsed { grid-template-columns: 88px 1fr; }
.sidebar { position: relative; background: linear-gradient(180deg, #2f2118 0%, #4a3429 100%); color: #fff; padding: 28px 20px; display: flex; flex-direction: column; }
.sidebar-toggle { position: absolute; top: 18px; right: 14px; width: 34px; height: 34px; border: 0; border-radius: 999px; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; font-size: 20px; line-height: 1; }
.brand { display: flex; gap: 14px; align-items: center; margin-bottom: 28px; }
.brand-mark { width: 52px; height: 52px; border-radius: 16px; background: #c95b32; display: grid; place-items: center; font-size: 26px; font-weight: 800; flex-shrink: 0; }
.brand-copy { min-width: 0; }
.brand-title { font-size: 22px; font-weight: 800; }
.brand-subtitle { font-size: 13px; opacity: .78; }
.nav { display: grid; gap: 10px; }
.nav-item { border: 0; background: rgba(255,255,255,.08); color: #fff; padding: 14px 16px; border-radius: 14px; text-align: left; cursor: pointer; display: flex; align-items: center; gap: 12px; }
.nav-icon-text { width: 24px; text-align: center; font-weight: 800; flex-shrink: 0; }
.nav-label { white-space: nowrap; }
.nav-item.active { background: linear-gradient(135deg, #ef8256 0%, #c95b32 100%); }
.sidebar-footer { margin-top: auto; opacity: .75; font-size: 13px; }
.app-shell.sidebar-collapsed .sidebar { padding-left: 14px; padding-right: 14px; }
.app-shell.sidebar-collapsed .brand { justify-content: center; }
.app-shell.sidebar-collapsed .brand-copy,
.app-shell.sidebar-collapsed .nav-label,
.app-shell.sidebar-collapsed .sidebar-footer { display: none; }
.app-shell.sidebar-collapsed .nav-item { justify-content: center; padding-left: 0; padding-right: 0; }
.app-shell.sidebar-collapsed .sidebar-toggle { transform: rotate(180deg); }
.main { padding: 28px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.topbar h1 { margin: 0 0 8px; font-size: 32px; }
.topbar p { margin: 0; color: #7b5a4b; }
.session-chip { padding: 10px 14px; border-radius: 999px; background: #fff; box-shadow: 0 8px 24px rgba(88,50,28,.08); }
.panel { background: rgba(255,255,255,.86); backdrop-filter: blur(10px); border: 1px solid rgba(184,109,65,.14); border-radius: 24px; padding: 22px; box-shadow: 0 16px 40px rgba(88,50,28,.08); margin-bottom: 18px; }
.panel-header h2 { margin: 0 0 6px; font-size: 22px; }
.panel-header p { margin: 0; color: #7b5a4b; }
.row { display: flex; justify-content: space-between; align-items: end; gap: 12px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.login-qr-wrap { display: flex; align-items: center; gap: 20px; margin-top: 18px; flex-wrap: wrap; }
.login-qr-box { width: 240px; min-height: 240px; display: grid; place-items: center; }
.qr-outer { width: 220px; height: 220px; border-radius: 28px; padding: 16px; background: linear-gradient(180deg, #fffef9 0%, #f8eddc 100%); box-shadow: inset 0 0 0 1px rgba(184,109,65,.12), 0 12px 30px rgba(88,50,28,.08); }
.qr-inner { width: 100%; height: 100%; border-radius: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border: 2px dashed rgba(201,91,50,.25); background: rgba(255,255,255,.78); text-align: center; }
.qr-canvas { width: 168px; height: 168px; padding: 8px; border-radius: 16px; background: #fffdf7; box-shadow: 0 6px 16px rgba(88,50,28,.08); }
.qr-canvas img,
.qr-canvas canvas { display: block; width: 152px !important; height: 152px !important; }
.qr-code-text { font-size: 15px; font-weight: 800; letter-spacing: .5px; color: #c95b32; padding: 0 10px; word-break: break-all; }
.qr-caption { font-size: 12px; color: #8a6a55; padding: 0 16px; }
.login-qr-actions { flex: 1; min-width: 240px; display: grid; gap: 12px; }
.login-status { color: #5b463b; font-weight: 700; }
.qr-placeholder { width: 220px; height: 220px; border-radius: 28px; display: grid; place-items: center; background: linear-gradient(180deg, #fffef9 0%, #f8eddc 100%); color: #8a6a55; box-shadow: inset 0 0 0 1px rgba(184,109,65,.12); }
.stat-card { background: linear-gradient(180deg, #fffdf7 0%, #f8eddc 100%); border-radius: 20px; padding: 18px; border: 1px solid rgba(184,109,65,.12); }
.stat-label { color: #8a6a55; font-size: 14px; }
.stat-value { font-size: 34px; font-weight: 800; margin-top: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.form-grid.login-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: grid; gap: 8px; font-size: 14px; color: #5b463b; }
label.full { grid-column: 1 / -1; }
input, textarea, select { width: 100%; border: 1px solid #ddcfbf; border-radius: 14px; padding: 13px 14px; background: #fff; outline: none; }
input:focus, textarea:focus, select:focus { border-color: #c95b32; box-shadow: 0 0 0 4px rgba(201,91,50,.12); }
.actions { display: flex; gap: 12px; margin-top: 18px; }
.primary-btn, .secondary-btn { border: 0; border-radius: 14px; padding: 13px 18px; cursor: pointer; font-weight: 700; }
.primary-btn { background: linear-gradient(135deg, #c95b32 0%, #ef8256 100%); color: #fff; }
.secondary-btn { background: #fff; color: #5b463b; border: 1px solid #ddcfbf; }
.notice { margin-top: 14px; color: #8a6a55; font-size: 13px; }
.list { display: grid; gap: 12px; margin-top: 18px; }
.list-item { background: #fff; border: 1px solid rgba(184,109,65,.12); border-radius: 18px; padding: 16px; display: flex; justify-content: space-between; gap: 12px; }
.designer-activity-item { align-items: center; }
.item-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.action-inline-btn { padding: 9px 13px; border-radius: 12px; font-size: 13px; }
.quick-grid { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.create-head-row { align-items: flex-start; }
.head-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mini-tabs { display: inline-flex; padding: 4px; border-radius: 999px; background: #f7ecdf; border: 1px solid rgba(184,109,65,.14); }
.mini-tab { border: 0; background: transparent; color: #7b5a4b; padding: 10px 16px; border-radius: 999px; cursor: pointer; font-weight: 700; }
.mini-tab.active { background: linear-gradient(135deg, #c95b32 0%, #ef8256 100%); color: #fff; }
.activity-pane { display: none; }
.activity-pane.active { display: block; }
.detail-two-column { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 18px; margin-top: 18px; align-items: start; }
.detail-column { min-width: 0; }
.compact-form-grid { gap: 12px; margin-top: 0; }
.rules-panel { background: linear-gradient(180deg, #fffdf7 0%, #f8eddc 100%); border: 1px solid rgba(184,109,65,.12); border-radius: 18px; padding: 16px; }
.rules-title { font-size: 18px; font-weight: 800; color: #5b463b; margin-bottom: 6px; }
.rules-subtitle { color: #8a6a55; font-size: 13px; margin-bottom: 14px; line-height: 1.6; }
.map-editor-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(360px, .65fr); gap: 16px; margin-top: 18px; align-items: start; }
.map-editor-left, .map-editor-right { min-width: 0; }
.map-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.content-map-panel { background: #fff; border: 1px solid rgba(184,109,65,.12); border-radius: 18px; padding: 16px; }
.activity-map-stage { margin-top: 12px; min-height: 520px; border-radius: 18px; background: linear-gradient(180deg, #f8f1e4 0%, #efe2c9 100%); border: 1px solid rgba(184,109,65,.14); position: relative; overflow: hidden; }
.activity-map-canvas { position: absolute; inset: 0; cursor: crosshair; }
.activity-marker-layer { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.dom-map-marker { position: absolute; width: 38px; height: 38px; margin-left: -19px; margin-top: -38px; border: 2px solid #c95b32; border-radius: 50%; background: #fff; box-shadow: 0 10px 18px rgba(88,50,28,.22); cursor: grab; pointer-events: auto; font-size: 22px; line-height: 32px; padding: 0; }
.dom-map-marker:active, .activity-map-stage.dragging-marker .dom-map-marker { cursor: grabbing; }
.dom-map-marker.draft { border-color: #1976d2; }
.content-dashboard, .linked-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.content-card { background: #fff; border: 1px solid rgba(184,109,65,.12); border-radius: 18px; padding: 16px; }
.content-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; color: #5b463b; }
.muted-card { grid-column: 1 / -1; }
.compact-list { display: grid; gap: 10px; }
.compact-list-item { padding: 12px 14px; border-radius: 14px; background: #fcf8f1; border: 1px solid rgba(184,109,65,.1); color: #5b463b; }
.point-list-btn { width: 100%; text-align: left; cursor: pointer; }
.point-list-btn.active { border-color: #c95b32; background: #fff1e8; color: #8b3d1f; }
.editor-tip { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: #fff8e6; color: #7b5a4b; border: 1px solid rgba(184,109,65,.14); font-size: 14px; }
.upload-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: -6px; }
.upload-row input[type="file"] { flex: 1; min-width: 240px; }
.upload-status { font-size: 13px; color: #8a6a55; }
.list-meta { color: #8a6a55; font-size: 13px; margin-top: 6px; }
.code-block { background: #2f2118; color: #f5ead0; border-radius: 18px; padding: 16px; overflow: auto; }
@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 10; }
  .cards, .form-grid, .detail-two-column, .content-dashboard, .linked-editor-grid, .map-editor-grid { grid-template-columns: 1fr; }
  .head-actions { width: 100%; justify-content: space-between; }
}
