:root {
  --bg: #f7f8fb;
  --panel: #ffffff;
  --text: #14161a;
  --muted: #6b7280;
  --soft: #f1f3f7;
  --line: #e6e8ef;
  --line-strong: #d4d8e3;
  --accent: #1e9bf0;
  --accent-dark: #0b77c5;
  --green: #17a673;
  --red: #ef4444;
  --pink: #fce7f3;
  --shadow: 0 18px 60px rgba(17, 24, 39, 0.08);
  --font-title: "Saira", "Work Sans", Arial, sans-serif;
  --font-text: "Work Sans", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:#fff;
  background-size: 26px 26px;
  color: var(--text);
  font-family: var(--font-text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(430px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.login-card h1 {
  font-family: var(--font-title);
  margin: 18px 0 8px;
  font-size: 30px;
  letter-spacing: 0;
}

.login-card p {
  color: var(--muted);
}

.app-shell {
  min-height: 100vh;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  padding: 16px 34px;
  border-bottom: 1px solid rgba(230, 232, 239, 0.88);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(18px);
}

.brand-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 17px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: #111827;
  color: #fff;
  font-family: var(--font-title);
  font-weight: 700;
}

.nav {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.nav-button {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 16px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}

.nav-button.active,
.nav-button:hover {
  border-color: var(--line);
  background: #fff;
  color: var(--text);
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.07);
}

.user-menu {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 10px;
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #eef2ff;
  color: #3730a3;
  font-weight: 700;
}

.main {
  width: min(1220px, calc(100% - 38px));
  margin: 0 auto;
  padding: 28px 0 54px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.home-head,
.admin-shell {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 18px;
  margin-bottom: 22px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.panel {
  padding: 20px;
}

.task-board {
  box-shadow: none;
      padding: 10px;
    overflow: hidden;
    border-radius: 10px;
    overflow: hidden;
    background: #F8F8F8;
}

.panel-header,
.board-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.eyebrow {
  font-family: var(--font-title);
  margin: 0 0 5px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  font-family: var(--font-title);
  margin-bottom: 0;
  font-size: 32px;
  line-height: 1.08;
  letter-spacing: 0;
  font-weight: 700;
}

h2 {
  font-family: var(--font-title);
  margin-bottom: 0;
  font-size: 17px;
  font-weight: 700;
}

h3 {
  font-family: var(--font-title);
  font-weight: 700;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  padding: 12px 13px;
  color: var(--text);
  background: #fff;
  outline: none;
}

textarea {
  min-height: 82px;
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(30, 155, 240, 0.13);
}

.checkline {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.checkline input,
.subitem input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.round-check {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin: 0;
}

.round-check input {
  position: absolute;
  opacity: 0;
  width:auto;
}

.round-check span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1.5px solid #cfd6e3;
  border-radius: 50%;
  color: transparent;
  background: #fff;
}

.round-check svg {
  width: 12px;
  height: 12px;
  stroke-width: 3;
}

.round-check input:checked + span {
  border-color: #17A673;
  background: #17A673;
  color: #fff;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  border: 0;
  padding: 0;
  margin: 8px 0 18px;
}

.segmented legend {
  grid-column: 1 / -1;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
}

.segmented label {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: #fff;
}

.segmented input {
  width: auto;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.tiny-button,
.icon-button,
.plus-button {
  border: 0;
  border-radius: 13px;
  min-height: 39px;
  padding: 10px 14px;
  font-weight: 700;
}

.primary-button {
  background: var(--text);
  color: #fff;
}

.secondary-button {
  background: var(--accent);
  color: #fff;
}

.ghost-button {
  background: var(--soft);
  color: var(--text);
}

.danger-button {
  background: #fee2e2;
  color: #991b1b;
}

.tiny-button {
  min-height: 32px;
  padding: 6px 10px;
  background: var(--pink);
  color: #be185d;
  font-size: 12px;
}

.icon-button {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
}

.plus-button {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 50%;
  background: #111827;
  color: #fff;
}

.compact {
  min-height: 38px;
  padding: 8px 13px;
}

.full {
  width: 100%;
}

.site-card-section {
  margin-bottom: 22px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 12px;
}

.site-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.site-card,
.empty-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 30px rgba(17, 24, 39, 0.06);
}

.site-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.site-card:hover,
.site-card.active {
  border-color: rgba(30, 155, 240, .42);
  box-shadow: 0 18px 42px rgba(30, 155, 240, 0.12);
  transform: translateY(-1px);
}

.site-card-top,
.site-card-progress,
.site-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.site-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: #eef6ff;
  color: var(--accent-dark);
  overflow: hidden;
}

.site-icon img,
.category-badge img,
.site-image-strip img,
.category-image-entry img {
  display: block;
  object-fit: cover;
}

.site-icon img {
  width: 100%;
  height: 100%;
}

.site-icon.small {
  width: 30px;
  height: 30px;
  border-radius: 10px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 5px #fef3c7;
}

.status-dot.done {
  background: var(--green);
  box-shadow: 0 0 0 5px #dcfce7;
}

.site-card h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0;
}

.site-card p {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.site-card-progress .progress {
  width: 100%;
  margin: 0;
}

.site-card-progress strong {
  font-size: 12px;
}

.site-card-meta {
  justify-content: flex-start;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.site-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.site-card-meta svg {
  width: 14px;
  height: 14px;
}

.site-image-strip {
  display: flex;
  gap: 6px;
}

.site-image-strip img,
.table-image-strip img {
  width: 28px;
  height: 28px;
  border: 2px solid #fff;
  border-radius: 10px;
  box-shadow: 0 6px 14px rgba(17, 24, 39, 0.12);
}

.table-image-strip {
  display: flex;
  gap: 5px;
  margin-top: 8px;
}

.table-image-strip img {
  width: 24px;
  height: 24px;
  border-radius: 8px;
}

.empty-card {
  padding: 18px;
  color: var(--muted);
}

.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.category-badge img {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.badge-general { background: #eef2ff; color: #4338ca; }
.badge-technical { background: #e0f2fe; color: #0369a1; }
.badge-performance { background: #dcfce7; color: #15803d; }
.badge-forms { background: #fae8ff; color: #a21caf; }
.badge-email { background: #fef3c7; color: #a16207; }
.badge-content { background: #fce7f3; color: #be185d; }
.badge-legal { background: #ede9fe; color: #6d28d9; }
.badge-tracking { background: #ccfbf1; color: #0f766e; }
.badge-seo { background: #dbeafe; color: #1d4ed8; }
.badge-wordpress { background: #e0f2fe; color: #075985; }
.badge-commerce { background: #ffedd5; color: #c2410c; }
.badge-shopify { background: #dcfce7; color: #166534; }
.badge-custom { background: #f1f5f9; color: #475569; }
.badge-other { background: #f3f4f6; color: #4b5563; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.stat {
  display: grid;
  grid-template-columns: auto 1fr;
  align-content: start;
  gap: 6px 12px;
  min-height: 118px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #fafbfe);
}

.stat-icon {
  grid-row: span 3;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #eef6ff;
  color: var(--accent-dark);
}

.stat-icon svg {
  width: 18px;
  height: 18px;
}

.stat strong {
  display: block;
  font-size: 27px;
  line-height: 1;
  font-weight: 700;
}

.stat span:not(.stat-icon) {
  font-weight: 700;
}

.stat small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.stat span,
.site-meta,
th,
.template-entry small {
  color: var(--muted);
}

.task-copy .task-meta span:not(.category-badge) {
  color: var(--muted);
}

.board-header {
    align-items: center;
    padding: 22px 24px 18px;
    margin-bottom: 20px;
    border-bottom: none;
    background: #ffffffa6;
    border-radius: 10px;
}

.site-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  font-weight: 600;
}

.site-meta span,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f1f5f9;
}

.platform-pill img,
.platform-pill svg {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

.score-ring {
  display: grid;
  align-content: center;
  justify-items: center;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background:
    radial-gradient(circle closest-side, #fff 72%, transparent 73%),
    conic-gradient(var(--accent) var(--score, 0%), #dbeafe 0);
  box-shadow: inset 0 0 0 1px rgba(30, 155, 240, 0.08);
}

.score-ring strong {
  line-height: 1;
  font-weight: 700;
}

.score-ring span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.task-list {
  display: grid;
  gap: 3px;
  padding: 0px;
  background: #F4F6F6;
}

.task-item {
  border: none;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 2px 0 rgba(33, 37, 41, 0.09);
  transition: box-shadow .18s ease, border-color .18s ease;
}

.task-item + .task-item {
  margin-top: 6px;
}

.task-item:hover {
  border-color: var(--line-strong);
  box-shadow: 0 12px 24px rgba(17, 24, 39, 0.06);
}

.task-item.is-na {
  background: #f3f4f6;
  border-style: dashed;
  opacity: .74;
}

.task-item.is-na .task-copy strong,
.task-item.is-na .task-meta {
  color: #8b95a5;
}

.task-item.is-na .round-check {
  pointer-events: none;
}

.task-item.is-na .tiny-button.active {
  background: #e5e7eb;
  color: #374151;
}

.task-main {
  display: grid;
  grid-template-columns: 22px 22px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 12px 14px;
}

.icon-only {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.caret {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
}

.task-copy strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.task-copy p,
.template-content p {
  margin: 5px 0 0;
  color: #606b7b;
  font-size: 12px;
  line-height: 1.45;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  font-size: 11px;
}

.task-meta span:not(.category-badge) {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
}

.task-item.is-done .task-copy strong,
.subitem.done {
  color: var(--muted);
  text-decoration: line-through;
}

.task-details {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px 68px;
}

.condition-box,
.subitems-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfe;
}

.condition-actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.icon-text {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.icon-text svg {
  width: 15px;
  height: 15px;
}

.condition-actions .active {
  background: #dbeafe;
  color: var(--accent-dark);
}

.subitem {
  display: grid;
  grid-template-columns: 18px auto 1fr;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
  color: #374151;
}

.comment-field {
  margin: 0;
}

.empty-board,
.empty-state {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 600;
}

.progress {
  display: inline-block;
  width: 130px;
  height: 8px;
  margin-right: 8px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
  vertical-align: middle;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--green);
}

.admin-list,
.template-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.admin-entry,
.template-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
}

.admin-entry {
  grid-template-columns: minmax(170px, 1fr) minmax(240px, 1.3fr) auto;
  align-items: center;
}

.platform-panel .admin-entry {
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 10px;
}

.platform-admin-title,
.table-site-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.platform-image-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  margin: 0;
}

.platform-panel .platform-image-form {
  grid-template-columns: 1fr;
}

.platform-panel .admin-entry > .danger-button {
  justify-self: end;
}

.platform-image-form input {
  min-height: 38px;
  padding: 9px 10px;
  border-radius: 11px;
}

.compact-filter {
  min-width: 220px;
  margin: 0;
}

.compact-filter select {
  min-height: 38px;
  padding: 8px 11px;
}

.template-entry {
  grid-template-columns: 26px 1fr auto;
}

.template-entry.dragging {
  opacity: .58;
}

.drag-handle {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
  cursor: grab;
}

.template-content strong,
.template-content small {
  display: block;
}

.template-subitems {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.template-subitem-row,
.add-subitem-form {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 10px;
  background: #f1f5f9;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
}

.add-subitem-form {
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  background: #fbfcfe;
}

.add-subitem-form input {
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  padding: 6px 8px;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  box-shadow: none;
}

.add-subitem-form input:focus {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(30, 155, 240, 0.1);
}

.add-subitem-form .plus-button {
  width: 26px;
  height: 26px;
  min-height: 26px;
}

.subitem-marker {
  width: 12px;
  height: 12px;
  margin-left: 3px;
  border-left: 2px solid #cbd5e1;
  border-bottom: 2px solid #cbd5e1;
  border-radius: 0 0 0 5px;
}

.subitem-marker.muted {
  opacity: .55;
}

.template-subitem-row button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.admin-category-preview {
  margin-top: 8px;
}

.category-image-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.category-image-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.category-image-entry span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.category-image-entry img {
  width: 30px;
  height: 30px;
  border-radius: 10px;
}

.empty-inline {
  color: var(--muted);
  font-size: 13px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.alert {
  margin-bottom: 16px;
  border: 1px solid #fed7aa;
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff7ed;
  color: #9a3412;
  font-weight: 600;
}

@media (max-width: 860px) {
  .top-nav,
  .home-head,
  .admin-shell,
  .form-row {
    grid-template-columns: 1fr;
  }

  .top-nav,
  .user-menu,
  .nav {
    justify-content: stretch;
  }

  .nav {
    overflow-x: auto;
  }

  .user-menu {
    display: grid;
    grid-template-columns: 1fr auto auto;
  }

  .board-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .task-details {
    padding-left: 14px;
  }

  .template-entry,
  .admin-entry,
  .task-main {
    grid-template-columns: auto 1fr;
  }

  .platform-image-form {
    grid-column: 1 / -1;
  }

  .task-main .task-copy,
  .task-main .tiny-button {
    grid-column: 1 / -1;
  }

  .row-actions,
  .tiny-button {
    grid-column: 1 / -1;
  }
}
