/* hailo land admin — palette matches the app (src/theme.ts) */
:root {
  --bg: #FFFDF9;
  --bg-alt: #FBF6EF;
  --card: #FFFFFF;
  --sky: #CFE6F6;
  --sky-deep: #8FBEE0;
  --blush: #F6D9E3;
  --blush-deep: #E7A9C0;
  --butter: #FBEBB5;
  --ink: #3B3A45;
  --ink-soft: #6B6976;
  --ink-faint: #A6A3B0;
  --divider: #EFE7DA;
  --lock-bg: rgba(231, 169, 192, 0.16);
  --lock-text: #B5567D;
  --danger: #C1573E;
  --danger-bg: rgba(193, 87, 62, 0.1);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --shadow: 0 8px 24px rgba(183, 154, 142, 0.14);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#app { min-height: 100vh; }

.loading-screen {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.spinner {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 3px solid var(--sky);
  border-top-color: var(--sky-deep);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Auth screen ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, #EAF4FB 0%, #FFFDF9 55%, #FFFDF9 100%);
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 36px 32px;
  text-align: center;
}
.auth-eyebrow {
  font-size: 12px;
  letter-spacing: 1.5px;
  color: var(--ink-soft);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.auth-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 4px;
}
.auth-sub {
  color: var(--ink-soft);
  font-size: 14px;
  margin: 0 0 24px;
}
.auth-card input {
  width: 100%;
  margin-bottom: 10px;
}
.auth-card button {
  width: 100%;
  margin-top: 6px;
}
.auth-error {
  color: var(--lock-text);
  background: var(--lock-bg);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  margin-top: 14px;
  text-align: left;
}
.auth-note {
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 18px;
  line-height: 1.5;
}

/* ---------- Shell ---------- */
.shell {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--card);
  border-right: 1px solid var(--divider);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.brand {
  font-size: 20px;
  font-weight: 700;
  padding: 0 8px 4px;
}
.brand .halo { color: var(--sky-deep); }
.brand-sub {
  font-size: 11px;
  color: var(--ink-faint);
  padding: 0 8px 20px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  border: none;
  background: none;
  text-align: left;
  width: 100%;
}
.nav-item:hover { background: var(--bg-alt); }
.nav-item.active { background: var(--sky); color: var(--ink); }
.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--divider);
}
.signed-in-as {
  font-size: 12px;
  color: var(--ink-faint);
  padding: 0 8px 8px;
  word-break: break-all;
}
.sign-out-btn {
  width: 100%;
  background: none;
  border: 1px solid var(--divider);
  border-radius: var(--radius-pill);
  padding: 8px 12px;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
}
.sign-out-btn:hover { background: var(--bg-alt); }

.main {
  flex: 1;
  padding: 32px 40px;
  max-width: 1000px;
}
.main-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.main-title { font-size: 24px; font-weight: 700; margin: 0 0 4px; }
.main-sub { color: var(--ink-soft); font-size: 14px; margin: 0; }

/* ---------- Buttons ---------- */
button {
  font-family: inherit;
  cursor: pointer;
}
.btn {
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 700;
}
.btn:hover { opacity: 0.9; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
  background: var(--sky);
  color: var(--ink);
}

.btn-quick {
  display: block;
  width: 100%;
  background: var(--blush-deep);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 700;
  margin: 4px 0 14px;
  text-align: center;
}
.btn-quick:hover { opacity: 0.9; }
.btn-ghost {
  background: none;
  border: 1px solid var(--divider);
  color: var(--ink-soft);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
}
.btn-ghost:hover { background: var(--bg-alt); }
.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: none;
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
}
.btn-danger:hover { opacity: 0.85; }
.btn-sm { padding: 7px 12px; font-size: 12px; }

/* ---------- Table / list ---------- */
.rows {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--divider);
}
.row:last-child { border-bottom: none; }
.row-thumb {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: var(--sky);
  flex-shrink: 0;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sky-deep);
  font-size: 18px;
  overflow: hidden;
}
.row-thumb img, .row-thumb video { width: 100%; height: 100%; object-fit: cover; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 700; font-size: 14px; margin: 0 0 2px; }
.row-meta { font-size: 12px; color: var(--ink-faint); }
.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  margin-right: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-hidden { background: var(--bg-alt); color: var(--ink-faint); }
.badge-premium { background: var(--lock-bg); color: var(--lock-text); }
.row-actions { display: flex; gap: 8px; flex-shrink: 0; }
.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--ink-faint);
}

/* ---------- Form / modal ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(59, 58, 69, 0.35);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  z-index: 50;
}
.form-panel {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 32px;
  width: 100%;
  max-width: 560px;
}
.form-panel h2 { margin: 0 0 20px; font-size: 20px; }
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
input[type="text"], input[type="number"], input[type="email"], input[type="password"],
textarea, select {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--divider);
  background: var(--bg-alt);
  font-size: 14px;
  color: var(--ink);
  font-family: inherit;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--sky-deep);
  background: #fff;
}
.field-hint { font-size: 11px; color: var(--ink-faint); margin-top: 4px; }
.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
}
.checkbox-field label { margin: 0; text-transform: none; font-weight: 600; font-size: 13px; }
.checkbox-row { display: flex; gap: 24px; margin-bottom: 16px; }
.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--divider);
}
.form-actions-right { display: flex; gap: 10px; }
.form-error {
  color: var(--lock-text);
  background: var(--lock-bg);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 16px;
}

.media-preview {
  width: 100%;
  max-height: 180px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 8px;
  background: var(--bg-alt);
}
.media-preview img, .media-preview video { width: 100%; max-height: 180px; object-fit: cover; display: block; }
.media-preview audio { width: 100%; padding: 20px 12px; }

.practice-item {
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 10px;
  background: var(--bg-alt);
}
.practice-item .field { margin-bottom: 8px; }
.practice-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.practice-item-header span { font-size: 12px; font-weight: 700; color: var(--ink-faint); }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
  z-index: 100;
}

@media (max-width: 720px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--divider);
    padding: 12px;
  }
  .brand, .brand-sub, .sidebar-footer { display: none; }
  .nav-item { white-space: nowrap; width: auto; }
  .main { padding: 20px; }
}

.upload-status {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.set-thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.set-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
}
.set-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.set-thumb.is-cover {
  border-color: #4a90d9;
}
.set-thumb-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 11px;
  text-align: center;
  padding: 2px 0;
  border-radius: 4px;
}

.badge-set {
  background: #eef4fb;
  color: #2a5a8c;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
  font-weight: 600;
}
.set-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 16px 16px 76px;
}
.set-strip-thumb {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  flex-shrink: 0;
}
.set-strip-thumb.is-cover {
  border-color: #4a90d9;
}
.set-strip-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.set-thumb-badge {
  position: absolute;
  bottom: 2px;
  left: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 9px;
  text-align: center;
  padding: 1px 0;
  border-radius: 3px;
}
.set-cover-btn {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  font-size: 9px;
  line-height: 1.2;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.15s;
}
.set-strip-thumb:hover .set-cover-btn {
  opacity: 1;
}
.set-remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 11px;
  line-height: 16px;
  padding: 0;
  cursor: pointer;
}

textarea.longtext{min-height:420px;font-size:16px;line-height:1.6}
