/* ========== Design System - Admin Panel ========== */
/* Primary: #005bbf, Background: #f7f9fb, Text: #191c1e */

:root {
  --primary: #005bbf;
  --primary-hover: #004a9f;
  --primary-container: #1a73e8;
  --primary-light: rgba(0, 91, 191, 0.08);
  --surface: #f7f9fb;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #f2f4f6;
  --surface-container: #eceef0;
  --surface-container-high: #e6e8ea;
  --surface-container-highest: #e0e3e5;
  --surface-dim: #d8dadc;
  --on-surface: #191c1e;
  --on-surface-variant: #414754;
  --outline: #727785;
  --outline-variant: #c1c6d6;
  --error: #ba1a1a;
  --error-container: #ffdad6;
  --on-error: #ffffff;
  --secondary: #515f74;
  --secondary-container: #d5e3fc;
  --tertiary: #9e4300;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
  --font-headline: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-body: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--on-surface);
  line-height: 1.5;
  min-height: 100vh;
}
h1, h2, h3, h4 { font-family: var(--font-headline); font-weight: 700; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ========== Layout ========== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: var(--surface-container-low);
  border-right: 1px solid var(--surface-container-high);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s;
}
.sidebar-brand {
  padding: 24px 20px;
  border-bottom: 1px solid var(--surface-container-high);
}
.sidebar-brand h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--on-surface);
  letter-spacing: -0.5px;
}
.sidebar-brand span {
  font-size: 11px;
  font-weight: 600;
  color: var(--on-surface-variant);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--on-surface-variant);
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 4px;
  transition: all 0.15s;
}
.nav-item:hover {
  background: var(--surface-container-high);
  color: var(--on-surface);
  text-decoration: none;
}
.nav-item.active {
  background: var(--surface-container-lowest);
  color: var(--primary);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.nav-icon {
  font-size: 18px;
  width: 20px;
  text-align: center;
}

/* Main Content */
.main-content {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  background: var(--surface-container-lowest);
  border-bottom: 1px solid var(--surface-container-high);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-container-low);
  border-radius: var(--radius-lg);
  padding: 8px 16px;
  width: 320px;
}
.topbar-search input {
  border: none;
  background: none;
  outline: none;
  font-size: 13px;
  width: 100%;
  color: var(--on-surface);
}
.topbar-search input::placeholder { color: var(--outline); }
.topbar-right {
  display: flex;
  align-items: center;
  gap: 24px;
}
.topbar-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--on-surface-variant);
  cursor: pointer;
  transition: background 0.15s;
}
.topbar-icon:hover { background: var(--surface-container); }
.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.topbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}
.topbar-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--on-surface);
}
.topbar-user {
  position: relative;
}
.topbar-arrow {
  font-size: 10px;
  color: var(--on-surface-variant);
  margin-left: 2px;
  transition: transform 0.2s;
}
.user-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  min-width: 140px;
  z-index: 1000;
  overflow: hidden;
}
.user-dropdown.show {
  display: block;
}
.user-dropdown-item {
  display: block;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--on-surface);
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
}
.user-dropdown-item:hover {
  background: var(--surface-container);
  text-decoration: none;
}
.user-dropdown-item--danger { color: var(--error); }
.user-dropdown-item.disabled { opacity: 0.4; cursor: not-allowed; }
.dropdown-icon { margin-right: 18px; }
.user-dropdown-divider {
  height: 1px;
  background: var(--surface-container-high);
  margin: 4px 0;
}
.topbar-avatar-img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

/* ========== Notifications ========== */
.notify-wrap {
  position: relative;
  cursor: pointer;
}
.notify-icon {
  font-size: 20px;
  line-height: 1;
  display: block;
  padding: 6px;
  border-radius: 50%;
  transition: background 0.15s;
}
.notify-icon:hover { background: var(--surface-container); }
.notify-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  background: var(--error);
  color: #fff;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  pointer-events: none;
}
.notify-panel {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  width: 320px;
  background: var(--surface-container-lowest);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  overflow: hidden;
}
.notify-panel.show { display: block; }
.notify-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--surface-container-high);
  font-size: 13px;
  font-weight: 700;
}
.notify-mark-all {
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
  font-weight: 500;
}
.notify-mark-all:hover { text-decoration: underline; }
.notify-list { max-height: 320px; overflow-y: auto; }
.notify-empty {
  padding: 32px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--outline);
}
.notify-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.12s;
  border-bottom: 1px solid var(--surface-container);
}
.notify-item:hover { background: var(--surface-container-low); }
.notify-item--unread { background: rgba(0,91,191,0.03); }
.notify-item-icon { font-size: 20px; flex-shrink: 0; }
.notify-item-body { flex: 1; min-width: 0; }
.notify-item-title {
  font-size: 13px;
  color: var(--on-surface);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notify-item-time {
  font-size: 11px;
  color: var(--outline);
  margin-top: 2px;
}
.notify-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--surface-container) 25%, var(--surface-container-high) 50%, var(--surface-container) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
}
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-line { height: 14px; margin-bottom: 10px; }
.skeleton-line:last-child { width: 60%; margin-bottom: 0; }
.skeleton-avatar { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
.skeleton-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--surface-container); }
.skeleton-body { flex: 1; }

/* ========== Profile Page ========== */
.profile-avatar-section {
  text-align: center;
  margin-bottom: 32px;
}
.profile-avatar-wrap {
  position: relative;
  display: inline-block;
  cursor: pointer;
}
.profile-avatar-img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--surface-container-high);
}
.profile-avatar-placeholder {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 700;
  border: 3px solid var(--surface-container-high);
}
.profile-avatar-edit {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  border: 2px solid #fff;
}
.profile-field-row {
  display: flex;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--surface-container);
}
.profile-field-label {
  width: 80px;
  font-size: 13px;
  font-weight: 600;
  color: var(--on-surface-variant);
  flex-shrink: 0;
}
.profile-field-value {
  flex: 1;
  font-size: 14px;
  color: var(--on-surface);
}
.profile-field-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--on-surface);
  max-width: 260px;
}
.profile-field-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.profile-field-btn {
  margin-left: 10px;
  padding: 8px 14px;
  font-size: 12px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  transition: opacity 0.15s;
}
.profile-field-btn:hover { opacity: 0.85; }
.profile-field-btn:disabled { opacity: 0.4; cursor: default; }
.profile-field-error {
  font-size: 11px;
  color: var(--error);
  margin-top: 4px;
  margin-left: 80px;
}

/* ========== Settings Page ========== */
.settings-section {
  margin-bottom: 32px;
}
.settings-section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--on-surface);
}
.password-strength {
  height: 4px;
  border-radius: 2px;
  margin-top: 6px;
  transition: width 0.3s, background 0.3s;
}
.password-strength--weak { width: 33%; background: var(--error); }
.password-strength--medium { width: 66%; background: #f0a020; }
.password-strength--strong { width: 100%; background: #137333; }
.settings-table {
  width: 100%;
  border-collapse: collapse;
}
.settings-table th,
.settings-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--surface-container);
  font-size: 13px;
}
.settings-table th {
  font-size: 11px;
  font-weight: 700;
  color: var(--on-surface-variant);
  text-transform: uppercase;
  background: var(--surface-container-low);
}
.tag-current {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
.bind-status {
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 100px;
  font-weight: 600;
}
.bind-status--bound { background: #e6f4ea; color: #137333; }
.bind-status--unbound { background: #f2f4f6; color: var(--outline); }
.bind-status--unsupported { background: #fef7e0; color: #b06000; }

/* Page Content */
.page-content {
  padding: 32px;
  flex: 1;
}

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-header h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

/* ========== Cards ========== */
.card {
  background: var(--surface-container-lowest);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 20px;
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-body);
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary {
  background: var(--surface-container-low);
  color: var(--on-surface);
}
.btn-secondary:hover { background: var(--surface-container); }
.btn-danger {
  background: var(--error);
  color: var(--on-error);
}
.btn-danger:hover { opacity: 0.9; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--outline-variant);
  color: var(--on-surface-variant);
}
.btn-outline:hover { background: var(--surface-container-low); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }

/* Copy button */
.copy-btn {
  cursor: pointer;
  font-size: 13px;
  opacity: 0.5;
  transition: opacity 0.15s;
  user-select: none;
  padding: 2px;
}
.copy-btn:hover { opacity: 1; }
.copy-btn:active { transform: scale(0.9); }

/* ========== Tables ========== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-container-high);
}
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface-container-lowest);
}
thead {
  background: var(--surface-container-low);
}
th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--surface-container-high);
  white-space: nowrap;
}
td {
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--surface-container);
  color: var(--on-surface);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-container-low); }

/* ========== Forms ========== */
.form-group {
  margin-bottom: 20px;
}
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--on-surface-variant);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--surface-container-high);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-family: var(--font-body);
  background: var(--surface-container-lowest);
  color: var(--on-surface);
  transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.form-textarea { min-height: 100px; resize: vertical; }
.form-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23727885' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.form-hint {
  font-size: 11px;
  color: var(--outline);
  margin-top: 4px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ========== Badges / Tags ========== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
}
.badge-success { background: #e6f4ea; color: #137333; }
.badge-warning { background: #fef7e0; color: #b06000; }
.badge-danger { background: #fce8e6; color: #c5221f; }
.badge-info { background: #e8f0fe; color: #1967d2; }
.badge-neutral { background: #f2f4f6; color: #414754; }

/* ========== Switch / Toggle ========== */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute;
  inset: 0;
  background: var(--surface-dim);
  border-radius: 100px;
  cursor: pointer;
  transition: 0.2s;
}
.switch-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}
.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }

/* ========== Modal ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(25, 28, 30, 0.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s;
}
.modal {
  background: var(--surface-container-lowest);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 520px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s;
}
.modal h3 { font-size: 20px; margin-bottom: 16px; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ========== Pagination ========== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  font-size: 13px;
  color: var(--on-surface-variant);
}
.pagination-btns {
  display: flex;
  gap: 4px;
}
.page-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--surface-container-high);
  background: var(--surface-container-lowest);
  cursor: pointer;
  font-size: 12px;
  color: var(--on-surface-variant);
  transition: all 0.15s;
}
.page-btn:hover { background: var(--surface-container-low); }
.page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ========== Toolbar ========== */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ========== Grid Cards (for video) ========== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.media-card {
  background: var(--surface-container-lowest);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s;
  border: 1px solid var(--surface-container-high);
}
.media-card:hover { box-shadow: var(--shadow-md); }
.media-thumb {
  width: 100%;
  height: 160px;
  background: var(--surface-container-low);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: var(--outline-variant);
  position: relative;
}
.media-body { padding: 16px; }
.media-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--on-surface);
  margin-bottom: 4px;
}
.media-meta {
  font-size: 12px;
  color: var(--on-surface-variant);
  margin-bottom: 12px;
}
.media-actions {
  display: flex;
  gap: 8px;
}

/* ========== Empty State ========== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--on-surface-variant);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state p { font-size: 14px; margin-bottom: 4px; }

/* ========== Checkbox ========== */
.checkbox-cell { width: 40px; }
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ========== Toast ========== */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 300;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-weight: 600;
  font-size: 13px;
  animation: slideUp 0.2s;
}
.toast-success { background: #e6f4ea; color: #137333; }
.toast-error { background: #fce8e6; color: #c5221f; }
.toast-info { background: #e8f0fe; color: #1967d2; }

/* ========== Tabs ========== */
.tab-bar {
  display: flex;
  gap: 4px;
  background: var(--surface-container-low);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 24px;
}
.tab {
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--on-surface-variant);
  border: none;
  background: none;
  transition: all 0.15s;
}
.tab:hover { color: var(--on-surface); }
.tab.active {
  background: var(--surface-container-lowest);
  color: var(--on-surface);
  box-shadow: var(--shadow-sm);
}

/* ========== Upload Zone ========== */
.upload-zone {
  border: 2px dashed var(--outline-variant);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--surface-container-low);
}
.upload-zone:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.upload-zone .upload-icon { font-size: 48px; margin-bottom: 12px; }
.upload-zone p { font-size: 14px; color: var(--on-surface-variant); }

/* ========== Status Dropdown (inline) ========== */
.status-badge-clickable {
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s;
}
.status-badge-clickable:hover {
  opacity: 0.8;
}
.status-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 100;
  background: var(--surface-container-lowest);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  padding: 4px;
  min-width: 100px;
}
.status-dropdown-item {
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s;
}
.status-dropdown-item:hover {
  background: var(--primary-light);
}
.status-dropdown-item.active {
  background: var(--primary-light);
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .form-row { grid-template-columns: 1fr; }
  .topbar-search { width: 200px; }
}

/* ========== Template Cards (V2) ========== */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.template-card {
  background: var(--surface-container-lowest);
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-container-high);
  overflow: hidden;
  transition: box-shadow 0.15s;
}
.template-card:hover { box-shadow: var(--shadow-md); }
.template-card-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.template-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--on-surface);
}
.template-card-preview {
  height: 200px;
  background: var(--surface-container-low);
  border-top: 1px solid var(--surface-container-high);
  border-bottom: 1px solid var(--surface-container-high);
  overflow: hidden;
}
.template-card-preview iframe {
  width: 640px;
  height: 396px;
  border: none;
  pointer-events: none;
  transform: scale(0.5);
  transform-origin: top left;
}
.template-card-meta-row {
  padding: 12px 16px;
  font-size: 11px;
  color: var(--on-surface-variant);
  display: flex;
  gap: 16px;
}
.template-card-actions {
  padding: 0 16px 14px;
  display: flex;
  gap: 8px;
}
.template-preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(25, 28, 30, 0.6);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s;
}
.template-preview-modal {
  background: var(--surface-container-lowest);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}
.template-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--surface-container-high);
  gap: 12px;
}
.template-preview-header h3 { font-size: 16px; margin: 0; white-space: nowrap; }
.template-preview-header select {
  padding: 6px 10px;
  border: 1px solid var(--surface-container-high);
  border-radius: var(--radius-sm);
  font-size: 12px;
  background: var(--surface-container-lowest);
  color: var(--on-surface);
  min-width: 140px;
}
.template-preview-body {
  flex: 1;
  overflow: hidden;
  min-height: 500px;
}
.template-preview-body iframe {
  width: 100%;
  height: 100%;
  min-height: 500px;
  border: none;
}
.template-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--on-surface-variant);
}
.template-empty .empty-icon { font-size: 48px; margin-bottom: 12px; }

/* Code preview */
.code-preview-body {
  padding: 16px;
  max-height: 60vh;
  overflow: auto;
  background: var(--surface-container-low);
}
.code-preview-body pre {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  color: var(--on-surface);
}

/* Upload zone compact (shown above template grid) */
.upload-zone--compact {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.upload-zone--active {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* Template type badge inline */
.template-card-header .badge {
  flex-shrink: 0;
}

/* Slow spin animation for card status indicator circle */
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.animate-spin-slow {
  animation: spin-slow 8s linear infinite;
  transform-origin: center center;
}

/* Bind form inline layout */
.bind-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.form-input--sm {
  width: 140px;
  padding: 6px 10px;
  font-size: 13px;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--on-surface-variant, #666);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--primary, #4f46e5);
  text-decoration: none;
  cursor: pointer;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .breadcrumb-sep { color: var(--on-surface-variant, #999); }
.breadcrumb .breadcrumb-current { color: var(--on-surface, #222); font-weight: 600; }

/* Step page header */
.step-header {
  margin-bottom: 24px;
}
.step-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--on-surface, #222);
  margin-bottom: 8px;
}
.step-desc {
  font-size: 14px;
  color: var(--on-surface-variant, #666);
  line-height: 1.6;
}

/* Verification options */
.verify-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 480px;
}
.verify-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: var(--surface, #fff);
}
.verify-option:hover {
  border-color: var(--primary, #4f46e5);
  box-shadow: 0 0 0 3px var(--primary-light, rgba(79,70,229,.1));
}
.verify-option .verify-option-icon {
  font-size: 24px;
  flex-shrink: 0;
}
.verify-option .verify-option-label {
  font-weight: 600;
  font-size: 15px;
  color: var(--on-surface, #222);
}
.verify-option .verify-option-detail {
  font-size: 13px;
  color: var(--on-surface-variant, #888);
}

/* 6-digit code input boxes */
.code-boxes {
  display: flex;
  gap: 10px;
  margin: 12px 0 20px;
}
.code-box {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  font-family: 'Cascadia Code', 'Fira Code', monospace;
  border: 2px solid var(--border, #d0d0d0);
  border-radius: 8px;
  outline: none;
  background: var(--surface, #fff);
  color: var(--on-surface, #222);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.code-box:focus {
  border-color: var(--primary, #4f46e5);
  box-shadow: 0 0 0 3px var(--primary-light, rgba(79,70,229,.12));
}
.code-box--error {
  border-color: var(--error, #e53e3e);
  box-shadow: 0 0 0 3px rgba(229,62,62,.12);
}

/* Security main page status rows */
.security-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border, #eee);
  gap: 16px;
}
.security-row:last-child { border-bottom: none; }
.security-row-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--on-surface, #222);
  flex-shrink: 0;
  min-width: 80px;
}
.security-row-value {
  flex: 1;
  font-size: 14px;
  color: var(--on-surface-variant, #666);
}
.security-row .btn { flex-shrink: 0; }

/* Step action bar */
.step-actions {
  margin-top: 28px;
  display: flex;
  gap: 12px;
}

/* Bottom hint text */
.verify-hint {
  margin-top: 20px;
  font-size: 13px;
  color: var(--on-surface-variant, #999);
  max-width: 480px;
  line-height: 1.6;
}
.verify-hint a {
  color: var(--primary, #4f46e5);
  text-decoration: none;
}
.verify-hint a:hover { text-decoration: underline; }

/* ========== Map Picker ========== */
.map-search-bar {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  background: var(--surface-container-low, #f1f5f9);
  border-radius: 12px 12px 0 0;
  align-items: center;
  border: 1px solid var(--outline-variant, #e2e8f0);
  border-bottom: none;
}
.map-search-input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--outline-variant, #e2e8f0);
  border-radius: 10px;
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
  background: var(--surface-container-lowest, #fff);
  color: var(--on-surface, #222);
  transition: border-color 0.2s;
}
.map-search-input:focus {
  border-color: var(--primary, #4f46e5);
  box-shadow: 0 0 0 3px var(--primary-light, rgba(79,70,229,.12));
}

/* POI search result items */
.poi-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--surface-container, #f1f5f9);
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: background 0.15s;
}
.poi-item:hover { background: var(--surface-container-low, #f8fafc); }
.poi-item:last-child { border-bottom: none; }
.poi-num {
  color: var(--primary, #4f46e5);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 13px;
}
.poi-body { flex: 1; min-width: 0; }
.poi-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--on-surface, #1e293b);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.poi-addr {
  font-size: 12px;
  color: var(--on-surface-variant, #64748b);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.poi-arrow {
  color: var(--outline-variant, #94a3b8);
  flex-shrink: 0;
  font-size: 16px;
  margin-top: 2px;
}

.search-results-hint {
  padding: 12px 16px;
  font-size: 12px;
  color: var(--outline-variant, #94a3b8);
  text-align: center;
}

.coord-display {
  margin-top: 6px;
  font-size: 12px;
  color: var(--on-surface-variant, #94a3b8);
}
