/* Panel for managing 3D platforms. Light and dark themes via tokens; one
   accent colour per site is set on the root as --accent by app.js. */

:root {
  --accent: #00A98F;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #fcfcfd;
  --surface-3: #f1f2f5;
  --line: #e6e8ec;
  --ink: #1c2230;
  --ink-soft: #5b6472;
  --ink-faint: #9aa1ad;
  --mix-base: #ffffff;
  --field-bg: #ffffff;
  --pill-bg: #eceef1;
  --tpl-bg: #fbfdfc;
  --tpl-old-bg: #fafafa;
  --notice-bg: #fff7e6;
  --notice-line: #f3d98a;
  --notice-ink: #8a5a00;
  --box-border: #cdd2da;
  --remove-hover-bg: #fbeaea;
  --remove-hover-ink: #d23b3b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 25, 35, .04), 0 8px 24px rgba(20, 25, 35, .06);
}

:root[data-theme="dark"] {
  --bg: #0f1216;
  --surface: #171b21;
  --surface-2: #1b2027;
  --surface-3: #232a33;
  --line: #2b323c;
  --ink: #e7eaee;
  --ink-soft: #9aa3b0;
  --ink-faint: #6b7480;
  --mix-base: #171b21;
  --field-bg: #11151a;
  --pill-bg: #232a33;
  --tpl-bg: #14191e;
  --tpl-old-bg: #15181d;
  --notice-bg: #2a2310;
  --notice-line: #5c4a1e;
  --notice-ink: #e9c46a;
  --box-border: #3a4350;
  --remove-hover-bg: #3a1f1f;
  --remove-hover-ink: #f0a3a3;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.app {
  display: grid;
  grid-template-columns: 264px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  gap: 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px;
}

.brand-dot {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #11151a);
  flex: none;
  transition: background .2s ease;
}

.brand-title { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.brand-sub { font-size: 12px; color: var(--ink-soft); }

.theme-toggle {
  margin-left: auto;
  border: 1px solid var(--line);
  background: var(--surface-3);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 7px;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink-soft); }

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  width: 100%;
  transition: background .15s ease, color .15s ease;
}

.nav-item:hover { background: var(--surface-3); color: var(--ink); }

.nav-item.active {
  background: color-mix(in srgb, var(--item-accent) 14%, var(--mix-base));
  color: var(--ink);
  font-weight: 600;
}

.nav-swatch {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--item-accent);
  flex: none;
}

.nav-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-soft);
  background: var(--surface-3);
  padding: 1px 7px;
  border-radius: 999px;
}

.nav-item.active .nav-count {
  background: color-mix(in srgb, var(--item-accent) 26%, var(--mix-base));
}

.nav-count.done { color: var(--item-accent); font-weight: 700; }

/* Sidebar notes (shared across all platforms) */
.side-notes { display: flex; flex-direction: column; gap: 7px; }
.side-notes-head { display: flex; align-items: center; justify-content: space-between; }
.side-notes-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-soft);
  font-weight: 700;
}
.side-notas {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--surface-2);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.side-notas:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.hint { font-size: 11px; color: var(--ink-soft); margin: 2px 0 0; line-height: 1.4; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: filter .15s ease, background .15s ease;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: var(--surface-3); color: var(--ink); }
.btn-ghost:hover { filter: brightness(.97); }

.saved { font-size: 12px; color: var(--accent); font-weight: 600; }

/* Content */
.content {
  padding: 32px 40px 64px;
  max-width: 860px;
  width: 100%;
}

.content-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

h1 {
  font-size: 26px;
  letter-spacing: -.02em;
  margin: 0 0 2px;
}

.site-link {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.site-link:hover { text-decoration: underline; }

.progress { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.progress-bar {
  flex: 1;
  height: 7px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 999px;
  transition: width .25s ease;
}
.progress-text { font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 18px;
}

.card-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-soft);
  margin: 0 0 14px;
  font-weight: 700;
}

.instrucoes { font-size: 14.5px; line-height: 1.6; color: var(--ink); }
.instrucoes h4 { font-size: 14px; margin: 18px 0 6px; color: var(--accent); }
.instrucoes h4:first-child { margin-top: 0; }
.instrucoes p { margin: 0 0 10px; }
.instrucoes ul { margin: 0 0 12px; padding-left: 20px; }
.instrucoes li { margin: 4px 0; }
.instrucoes em { color: var(--ink-soft); }

.instrucoes .notice {
  background: var(--notice-bg);
  border: 1px solid var(--notice-line);
  color: var(--notice-ink);
  border-radius: 9px;
  padding: 10px 13px;
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0 0 16px;
}
.instrucoes .notice strong { color: var(--notice-ink); }

.instrucoes .tpl {
  border: 1px solid var(--line);
  background: var(--tpl-bg);
  border-radius: 9px;
  padding: 12px 14px;
  margin: 10px 0 14px;
}
.instrucoes .tpl p { margin: 0 0 8px; font-size: 13.5px; }
.instrucoes .tpl p:last-child { margin-bottom: 0; }
.instrucoes .tpl ul { margin: 6px 0 0; }
.instrucoes .tpl li { font-size: 13px; }
.instrucoes .tpl a { color: var(--accent); }
.instrucoes .tpl-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--mix-base));
  padding: 2px 9px;
  border-radius: 999px;
  margin-bottom: 9px;
}
.instrucoes .tpl-old { background: var(--tpl-old-bg); }
.instrucoes .tpl-old .tpl-tag { color: var(--notice-ink); background: var(--notice-bg); }
.instrucoes .tpl-old p { color: var(--ink-soft); }

/* Checklist */
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 9px;
  cursor: pointer;
  transition: background .12s ease;
}
.check:hover { background: var(--surface-2); }

.check input { position: absolute; opacity: 0; pointer-events: none; }

.box {
  width: 20px;
  height: 20px;
  border: 2px solid var(--box-border);
  border-radius: 6px;
  flex: none;
  margin-top: 1px;
  display: grid;
  place-items: center;
  transition: border-color .15s ease, background .15s ease;
}
.box svg { width: 12px; height: 12px; opacity: 0; transform: scale(.6); transition: opacity .12s ease, transform .12s ease; }

.check input:checked + .box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .box svg { opacity: 1; transform: scale(1); }

.check-text { font-size: 14.5px; line-height: 1.45; }
.check input:checked ~ .check-text { color: var(--ink-soft); text-decoration: line-through; }

.empty { color: var(--ink-soft); font-size: 14px; margin: 4px 2px; }

/* Link lists (buckets) */
.lists-help { font-size: 13px; color: var(--ink-soft); margin: -6px 0 16px; line-height: 1.5; }
.lists { display: flex; flex-direction: column; gap: 16px; }

.bucket {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 14px 16px;
  background: var(--surface-2);
}

.bucket-head { display: flex; align-items: center; gap: 10px; }
.bucket-name { font-size: 14px; font-weight: 700; }
.bucket-export {
  margin-left: auto;
  border: 1px solid var(--line);
  background: var(--field-bg);
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, opacity .15s ease;
}
.bucket-export:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.bucket-export:disabled { opacity: .4; cursor: not-allowed; }

.bucket-count {
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--ink-soft);
}
.bucket-count.has {
  background: color-mix(in srgb, var(--accent) 18%, var(--mix-base));
  color: var(--accent);
}

.bucket-hint { font-size: 12.5px; color: var(--ink-soft); margin: 6px 0 10px; line-height: 1.45; }

.bucket-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  background: var(--field-bg);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.bucket-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

.bucket-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.bucket-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 10px;
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: 7px;
}
.bucket-item-text {
  flex: 1;
  font-size: 13px;
  color: var(--ink);
  word-break: break-all;
  text-decoration: none;
}
a.bucket-item-text { color: var(--accent); }
a.bucket-item-text:hover { text-decoration: underline; }

.bucket-remove {
  flex: none;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.bucket-remove:hover { background: var(--remove-hover-bg); color: var(--remove-hover-ink); }

/* Responsive */
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: column;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-item { width: auto; }
  .nav-count { display: none; }
  .content { padding: 24px 18px 48px; }
  .content-head { flex-direction: column; align-items: flex-start; }
  .progress { width: 100%; }
}
