/* =========================================================
   Ãƒâ€¡engel Bulmaca Ã¢â‚¬â€ YÃƒÂ¶netim Paneli
   Klasik admin dÃƒÂ¼zeni
   ========================================================= */

:root {
  --sidebar-width: 252px;
  --topbar-height: 56px;

  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #f7f6f3;

  --border: #efece6;
  --border-strong: #e4e0d8;

  --text: #292d32;
  --text-soft: #4b525a;
  --muted: #6f675f;

  --accent: #f4d878;
  --accent-hover: #ebc342;
  --accent-border: #e2be4c;
  --accent-ink: #292d32;
  --accent-soft: #fdf6dc;
  --accent-soft-border: #f3dc8b;

  --primary: #9a6d0b;
  --primary-dark: #785306;
  --primary-soft: #fdf6dc;

  --sidebar: #16181b;
  --sidebar-border: transparent;
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-text: #d5d9df;
  --sidebar-muted: #7d848c;

  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --danger-border: #fecaca;
  --warning: #b45309;
  --warning-soft: #fffbeb;
  --warning-border: #fde68a;
  --success: #15803d;
  --success-soft: #f0fdf4;
  --success-border: #bbf7d0;

  --radius: 10px;
  --radius-sm: 7px;

  --shadow-sm: none;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04);

  --font: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9375rem;
  line-height: 1.5;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-dark);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 0.5rem;
  color: var(--text);
  font-weight: 600;
  line-height: 1.3;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

code {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-2);
  color: #334155;
  font-size: 0.85em;
}

/* ---------- shell ---------- */

.app {
  min-height: 100vh;
}

.nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  background: var(--sidebar);
}

.sidebar-brand {
  display: flex;
  flex: none;
  align-items: center;
  height: var(--topbar-height);
  padding: 0 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--sidebar-text);
}

.brand:hover {
  color: #ffffff;
}

.brand-mark {
  display: block;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: contain;
}



.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-text strong {
  color: #f8fafc;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-text small {
  color: #8b929a;
  font-size: 0.6875rem;
  font-weight: 500;
}

.side-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  padding: 10px 10px 16px;
}

.side-label {
  margin: 14px 10px 5px;
  color: var(--sidebar-muted);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.side-nav .side-label:first-child {
  margin-top: 4px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.side-link svg {
  flex: none;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.88;
}

.side-link:hover {
  color: #ffffff;
  background: var(--sidebar-hover);
}

.side-link.is-active {
  color: #16181b;
  background: #ffd60a;
  font-weight: 600;
}

.side-link.is-active svg {
  color: #16181b;
  opacity: 1;
  stroke-width: 2;
}

.sidebar-user {
  display: flex;
  flex: none;
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
}

.side-user {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  transition: background 0.15s ease, color 0.15s ease;
}

.side-user:hover {
  color: #ffffff;
  background: var(--sidebar-hover);
}

.side-user:focus-visible,
.side-logout:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 2px rgba(255, 214, 10, 0.7);
}

.side-user .avatar {
  background: #ffd60a;
  color: #16181b;
}

.side-user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.side-user-meta strong {
  overflow: hidden;
  color: #f8fafc;
  font-size: 0.8125rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-user-meta small {
  color: #8b929a;
  font-size: 0.6875rem;
}

.side-user-chevron {
  flex: none;
  width: 15px;
  height: 15px;
  margin-left: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.65;
}

.side-logout {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--sidebar-text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.side-logout svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.side-logout:hover {
  color: #fca5a5;
  background: rgba(220, 38, 38, 0.14);
}

.workspace {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  display: flex;
  flex: none;
  align-items: center;
  gap: 14px;
  height: var(--topbar-height);
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.menu-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 36px;
  height: 36px;
  padding: 9px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.menu-btn span {
  display: block;
  height: 2px;
  border-radius: 1px;
  background: var(--text-soft);
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.breadcrumb-sep {
  color: var(--border-strong);
}

.breadcrumb-current {
  overflow: hidden;
  color: var(--text);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 0.8125rem;
  font-weight: 600;
}

.nav-scrim {
  display: none;
}

.avatar-img {
  display: block;
  padding: 0;
  object-fit: cover;
  background: transparent !important;
  border: 0 !important;
}

.content {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px 24px;
}

.page {
  flex: 1;
  width: 100%;
  margin: 0 auto;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 14px;
}

.app-footer {
  width: 100%;
  margin: 24px 0 0;
  padding-top: 12px;
  color: var(--muted);
  font-size: 0.75rem;
  border-top: 1px solid var(--border);
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.text-warning-strong {
  color: var(--warning);
  font-weight: 600;
}

/* ---------- dashboard ---------- */

.dash-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 10px 14px;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.dash-toolbar-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 0.8125rem;
  font-weight: 500;
}

.dash-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-hover);
  box-shadow: 0 0 0 3px rgba(244, 216, 120, 0.35);
}

.dash-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

/* ---------- stats ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 16px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.stat:hover {
  color: var(--text);
  border-color: var(--accent-hover);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.stat-label {
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.stat-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-soft);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.stat:hover .stat-icon {
  background: var(--accent);
  border-color: var(--accent-border);
  color: var(--accent-ink);
}

.stat-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--border);
}

.stat-sub {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-arrow {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--muted);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.15s ease, color 0.15s ease;
}

.stat:hover .stat-arrow {
  color: var(--accent-ink);
  transform: translateX(2px);
}

/* ---------- dashboard grid & cards ---------- */

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
  gap: 16px;
  align-items: start;
}

.dash-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.dash-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.dash-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.dash-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.dash-card-title h2 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.dash-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  color: var(--text-soft);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.dash-link {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  font-size: 0.8125rem;
  font-weight: 500;
}

.dash-link svg {
  width: 14px;
  height: 14px;
  transition: transform 0.15s ease;
}

.dash-link:hover {
  color: var(--primary-dark);
}

.dash-link:hover svg {
  transform: translateX(2px);
}

.dash-card-body {
  padding: 14px 16px;
}

.dash-empty {
  padding: 28px 16px;
  color: var(--muted);
  font-size: 0.8125rem;
  text-align: center;
}

.dash-table-wrap {
  overflow-x: auto;
}

.dash-table {
  margin: 0;
  font-size: 0.84375rem;
}

.dash-table > :not(caption) > * > * {
  padding: 8px 14px;
}

.dash-table thead th {
  padding-top: 7px;
  padding-bottom: 7px;
  border-radius: 0 !important;
}

.dash-table thead th:first-child,
.dash-table tbody td:first-child {
  padding-left: 16px;
}

.dash-table thead th:last-child,
.dash-table tbody td:last-child {
  padding-right: 16px;
}

.dash-cat-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cat-icon-fallback {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--text-soft);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

.dash-cat-cell .cat-icon {
  width: 32px;
  height: 32px;
}

.dash-cat-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.dash-cat-meta strong {
  overflow: hidden;
  font-size: 0.84375rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-cat-meta small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-row-actions {
  white-space: nowrap;
}

.dash-row-actions .btn + .btn {
  margin-left: 4px;
}

.word-answer {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

.word-clue {
  max-width: 210px;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 0.8125rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- status & difficulty pills ---------- */

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  color: var(--text-soft);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.4;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill.is-active,
.status-pill.is-easy {
  color: #15803d;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.status-pill.is-inactive {
  color: var(--muted);
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.status-pill.is-medium {
  color: #b45309;
  background: #fffbeb;
  border-color: #fde68a;
}

.status-pill.is-hard {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}

/* ---------- difficulty distribution ---------- */

.diff-bar {
  display: flex;
  height: 7px;
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--surface-2);
  border-radius: 999px;
  gap: 2px;
}

.diff-seg {
  height: 100%;
  border-radius: 999px;
}

.diff-seg.is-easy {
  background: #16a34a;
}

.diff-seg.is-medium {
  background: #d97706;
}

.diff-seg.is-hard {
  background: #dc2626;
}

.diff-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.diff-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.diff-item:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border-strong);
}

.diff-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.diff-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.diff-dot.is-easy {
  background: #16a34a;
}

.diff-dot.is-medium {
  background: #d97706;
}

.diff-dot.is-hard {
  background: #dc2626;
}

.diff-val {
  font-size: 1.125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.diff-pct {
  color: var(--muted);
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
}

/* ---------- topic density list ---------- */

.topic-list {
  display: flex;
  flex-direction: column;
}

.topic-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 16px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.15s ease;
}

.topic-row:last-child {
  border-bottom: 0;
}

.topic-row:hover {
  color: var(--text);
  background: var(--surface-2);
}

.topic-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.topic-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.topic-cats {
  color: var(--muted);
}

.topic-count {
  color: var(--text);
  font-weight: 600;
}

.topic-bar {
  height: 4px;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: 999px;
}

.topic-bar-fill {
  display: block;
  height: 100%;
  background: var(--accent-hover);
  border-radius: 999px;
  opacity: 0.9;
}

.topic-row:hover .topic-bar-fill {
  opacity: 1;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  box-shadow: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.btn svg {
  flex: none;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(244, 216, 120, 0.38);
}

.btn-primary {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent-border);
  font-weight: 600;
}

.btn-primary:hover,
.btn-primary:active,
.btn-primary:focus-visible {
  color: var(--accent-ink);
  background: var(--accent-hover);
  border-color: #d4ad32;
}

.btn-outline-primary {
  color: var(--accent-ink);
  background: var(--surface);
  border-color: var(--border-strong);
}

.btn-outline-primary:hover,
.btn-outline-primary:active {
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-color: var(--accent-hover);
}

.btn-outline-secondary {
  color: var(--text-soft);
  background: var(--surface);
  border-color: var(--border-strong);
}

.btn-outline-secondary:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--text-soft);
}

.btn-outline-danger {
  color: var(--danger);
  background: var(--surface);
  border-color: var(--danger-border);
}

.btn-outline-danger:hover {
  color: #ffffff;
  background: var(--danger);
  border-color: var(--danger);
}

.btn-outline-warning {
  color: var(--warning);
  background: var(--surface);
  border-color: var(--warning-border);
}

.btn-outline-warning:hover {
  color: #ffffff;
  background: var(--warning);
  border-color: var(--warning);
}

.btn-link {
  height: auto;
  padding: 0 8px;
  color: var(--primary);
  background: transparent;
  border: 0;
}

.btn-link:hover {
  color: var(--primary-dark);
  background: transparent;
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 0.8125rem;
}

.table .d-inline {
  margin-left: 4px;
}

/* ---------- forms ---------- */

.page > form[method="post"] {
  max-width: 960px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.page form[method="get"] {
  margin-bottom: 16px;
}

.form-label {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--text-soft);
  font-size: 0.8125rem;
  font-weight: 500;
}

.form-control,
.form-select {
  display: block;
  width: 100%;
  height: 38px;
  padding: 8px 11px;
  color: var(--text);
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.875rem;
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-select {
  padding-right: 32px;
}

.form-select[multiple],
.form-select[size]:not([size="1"]) {
  height: auto;
  min-height: 180px;
  padding: 8px 12px;
}

.form-select[multiple] option {
  padding: 4px 6px;
  border-radius: 4px;
}

.form-control::placeholder {
  color: #9ca3af;
}

.form-control:focus,
.form-select:focus {
  color: var(--text);
  background-color: var(--surface);
  border-color: var(--accent-hover);
  box-shadow: 0 0 0 3px rgba(244, 216, 120, 0.32);
  outline: 0;
}

.form-control-sm,
.form-select-sm {
  height: 32px;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 0.8125rem;
}

.form-select-sm {
  padding-right: 28px;
}

textarea.form-control {
  height: auto;
  min-height: 110px;
}

.form-control.input-validation-error,
.form-select.input-validation-error {
  border-color: var(--danger);
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  margin-bottom: 0;
  padding-left: 0;
}

.form-check .form-check-input {
  position: static;
  float: none;
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  box-shadow: none;
}

.form-check-input:checked {
  background-color: var(--accent-ink);
  border-color: var(--accent-ink);
}

.form-check-input:focus {
  border-color: var(--accent-hover);
  box-shadow: 0 0 0 3px rgba(244, 216, 120, 0.32);
}

.form-check-label {
  color: var(--text);
  font-size: 0.875rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

input[type="file"].form-control {
  height: auto;
  padding: 6px 10px;
}

input[type="file"].form-control::file-selector-button {
  margin-right: 10px;
  padding: 6px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-soft);
  font-family: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}

.text-danger {
  color: var(--danger) !important;
}

span.text-danger,
.field-validation-error {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
}

.validation-summary-errors ul,
.text-danger ul {
  margin: 0 0 12px;
  padding: 10px 14px 10px 28px;
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
}

.text-muted {
  color: var(--muted) !important;
}

.word-row {
  margin-bottom: 8px;
  padding: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

#add-word {
  margin-top: 4px;
}

.icon-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.icon-fields {
  flex: 1;
  min-width: 0;
}

.icon-fields .text-muted {
  display: block;
  margin-top: 6px;
  font-size: 0.75rem;
}

.cat-icon {
  width: 36px;
  height: 36px;
  padding: 4px;
  object-fit: contain;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.cat-icon-lg {
  flex: none;
  width: 80px;
  height: 80px;
  padding: 10px;
  background: var(--surface-2);
  border-radius: 8px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  margin-bottom: 16px;
}

.filter-field {
  display: flex;
  flex-direction: column;
  min-width: 190px;
}

.filter-field .form-label {
  margin-bottom: 6px;
}

.filter-field .form-select,
.filter-field .form-control {
  min-width: 190px;
}

/* ---------- tables ---------- */

.table-shell {
  overflow-x: auto;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.table-shell .dt-container {
  color: var(--text);
}

.table {
  width: 100%;
  margin: 0;
  vertical-align: middle;
  font-size: 0.875rem;
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-border-color: var(--border);
  --bs-table-hover-bg: var(--surface-2);
  --bs-table-striped-bg: transparent;
}

.table > :not(caption) > * > * {
  padding: 9px 12px;
  background-color: transparent;
  border-bottom: 1px solid var(--border);
  box-shadow: none;
}

.table thead th {
  padding-top: 8px;
  padding-bottom: 8px;
  color: var(--muted);
  background-color: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.table thead th:first-child {
  border-top-left-radius: 5px;
  border-bottom-left-radius: 5px;
}

.table thead th:last-child {
  border-top-right-radius: 5px;
  border-bottom-right-radius: 5px;
}

.table tbody tr:last-child > * {
  border-bottom: 0;
}

.table tbody tr:hover > * {
  background: var(--surface-2);
}

.table code {
  padding: 2px 6px;
  background: var(--surface-2);
  color: #334155;
}

.dt-toolbar,
.dt-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dt-toolbar {
  padding-bottom: 10px;
}

.dt-footer {
  padding-top: 10px;
}

.dt-toolbar .dt-length label,
.dt-toolbar .dt-search label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 0.8125rem;
}

.dt-toolbar .dt-length select,
.dt-toolbar .dt-search input {
  height: 32px;
  color: var(--text);
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.8125rem;
}

.dt-toolbar .dt-length select {
  padding: 0 28px 0 10px;
}

.dt-toolbar .dt-search input {
  width: 220px;
  padding: 0 10px;
}

.dt-toolbar .dt-length select:focus,
.dt-toolbar .dt-search input:focus {
  border-color: var(--accent-hover);
  box-shadow: 0 0 0 3px rgba(244, 216, 120, 0.32);
  outline: 0;
}

.dt-footer .dt-info {
  padding: 0;
  color: var(--muted);
  font-size: 0.8125rem;
}

.dt-footer .dt-paging {
  margin: 0;
}

.dt-footer .pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dt-footer .page-item {
  margin: 0;
}

.dt-footer .page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
}

.dt-footer .page-link:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.dt-footer .page-item.active .page-link {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent-border);
  font-weight: 600;
}

.dt-footer .page-item.disabled .page-link {
  color: var(--muted);
  background: var(--surface);
  opacity: 0.5;
}

/* ---------- detail / callout ---------- */

.sheet {
  padding: 0 16px;
  margin: 0 0 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.sheet.row {
  margin-right: 0;
  margin-left: 0;
}

.sheet dt,
.sheet dd {
  padding-top: 12px;
  padding-bottom: 12px;
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.sheet dt {
  color: var(--muted);
  font-weight: 500;
}

.sheet .row > :last-child,
.sheet dt:last-of-type,
.sheet dd:last-of-type {
  border-bottom: 0;
}

.callout {
  max-width: 480px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.callout h1 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.callout p:last-child {
  margin: 0;
  color: var(--muted);
}

.callout .btn {
  margin-top: 20px;
}

.callout .error-ref {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
}

.brand-kicker {
  display: block;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- profile ---------- */

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.profile-card {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.profile-card h2 {
  margin: 0 0 6px;
  font-size: 1.0625rem;
  font-weight: 600;
}

.profile-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.profile-avatar {
  width: 52px;
  height: 52px;
  background: var(--accent);
  border: 1px solid var(--accent-border);
  color: var(--accent-ink);
  font-size: 1.125rem;
}

.profile-identity {
  min-width: 0;
}

.profile-identity h2 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-identity p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.profile-status {
  flex: none;
  margin-left: auto;
  padding: 4px 10px;
  color: var(--success);
  background: #ecfdf3;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.profile-list {
  margin: 0;
}

.profile-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.profile-list > div:last-child {
  border-bottom: 0;
}

.profile-list dt {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 500;
}

.profile-list dd {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: right;
  overflow-wrap: anywhere;
}

.profile-hint {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.875rem;
}

.profile-form .form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

/* ---------- alerts ---------- */

.alert {
  padding: 10px 14px;
  margin-bottom: 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.alert-danger {
  color: #b91c1c;
  background: var(--danger-soft);
  border-color: var(--danger-border);
}

.alert-success {
  color: #166534;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

/* ---------- guest / login ---------- */

.guest-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px;
}

.guest-main > .alert {
  width: 100%;
  max-width: 480px;
}

.login-body {
  min-height: 100vh;
  background: var(--bg);
}

.login-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: radial-gradient(900px 460px at 50% -20%, rgba(244, 216, 120, 0.24), transparent 60%), var(--bg);
}

.login-box {
  width: 100%;
  max-width: 400px;
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  margin-bottom: 18px;
}

.login-brand .brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 11px;
}

.login-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.login-brand-text strong {
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
}

.login-brand-text small {
  color: var(--muted);
  font-size: 0.6875rem;
}

.login-card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px -24px rgba(16, 24, 40, 0.22);
}

.login-card h1 {
  margin: 0 0 6px;
  font-size: 1.25rem;
  font-weight: 600;
}

.login-sub {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.875rem;
}

.login-card .btn {
  height: 42px;
  margin-top: 4px;
}

.login-foot {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
}

/* ---------- game board (WordNest mobile view) ---------- */

.game-shell {
  --wn-bg: #f3f1ec;
  --wn-paper: #ffffff;
  --wn-blocked: #e8e4dc;
  --wn-line: #e5e2dc;
  --wn-ink: #292d32;
  --wn-muted: #6f675f;
  --wn-green: #78bfa3;
  --wn-green-deep: #2f6d57;
  --wn-yellow: #f4d878;
  --wn-coral: #e88d86;
  --wn-backdrop: rgba(41, 45, 50, 0.32);
  max-width: 920px;
}

.game-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 10px 14px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.game-filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 !important;
}

.game-filter-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.game-filter-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.game-filter-item .form-select-sm {
  width: auto;
  min-width: 140px;
}

.game-toolbar-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.wn-workspace {
  display: grid;
  grid-template-columns: 400px minmax(280px, 1fr);
  gap: 20px;
  align-items: start;
}

/* Phone Device Frame */
.wn-phone-frame {
  position: relative;
  width: 400px;
  max-width: 100%;
  padding: 10px;
  background: #1c1f24;
  border: 2px solid #2d323a;
  border-radius: 42px;
  user-select: none;
}

.wn-phone-notch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 28px;
  padding: 0 18px 4px;
  color: #292d32;
  background: var(--wn-bg);
  border-top-left-radius: 32px;
  border-top-right-radius: 32px;
  font-size: 0.6875rem;
  font-weight: 700;
}

.wn-phone-island {
  width: 78px;
  height: 18px;
  background: #1c1f24;
  border-radius: 999px;
}

.wn-phone-status {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--wn-muted);
}

.wn-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 670px;
  background: var(--wn-bg);
  color: var(--wn-ink);
  border-bottom-left-radius: 32px;
  border-bottom-right-radius: 32px;
  overflow: hidden;
  outline: none;
}

.wn-play-col {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  padding: 6px 12px 4px;
}

/* stageHeaderBar */
.wn-stage-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: var(--wn-paper);
  border-radius: 12px;
}

.wn-cat-badge {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--wn-cat-accent, #78bfa3) 32%, #ffffff);
}

.wn-cat-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.wn-cat-fallback {
  color: var(--wn-ink);
  font-size: 0.875rem;
  font-weight: 700;
}

.wn-header-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.wn-puzzle-title {
  overflow: hidden;
  color: var(--wn-ink);
  font-size: 0.9375rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wn-puzzle-sub {
  overflow: hidden;
  color: var(--wn-muted);
  font-size: 0.6875rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wn-random-pill {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  color: var(--wn-ink);
  background: var(--wn-yellow);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.wn-random-pill:hover {
  color: var(--wn-ink);
  filter: brightness(0.97);
}

.wn-random-pill svg {
  width: 14px;
  height: 14px;
}

/* CurrentClueBannerView */
.wn-clue-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  color: var(--wn-ink);
  background: var(--wn-paper);
  border: 1px solid var(--wn-line);
  border-radius: 14px;
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
}

.wn-dir-pill {
  flex: none;
  padding: 3px 8px;
  color: var(--wn-green-deep);
  background: var(--wn-yellow);
  border: 1px solid var(--wn-line);
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.wn-banner-text {
  flex: 1;
  min-width: 0;
  color: var(--wn-ink);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.25;
}

/* CrosswordGridView */
.wn-grid-wrap {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  padding: 4px 0;
}

.wn-grid {
  --cell-size: 38px;
  --letter-size: 20px;
  --num-size: 9px;
  display: inline-grid;
  grid-template-columns: repeat(var(--cw-cols, 8), var(--cell-size));
  grid-template-rows: repeat(var(--cw-rows, 8), var(--cell-size));
  gap: 3px;
}

.wn-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--cell-size);
  height: var(--cell-size);
  padding: 0;
  color: var(--wn-ink);
  background: var(--wn-paper);
  border: 1px solid var(--wn-line);
  border-radius: 7px;
  font-family: var(--font);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.15s ease;
}

.wn-cell.is-blocked {
  background: transparent;
  border-color: transparent;
  pointer-events: none;
  cursor: default;
}

.wn-cell.tone-selected {
  background: var(--wn-yellow);
}

.wn-cell.tone-correct {
  background: var(--wn-green);
}

.wn-cell.tone-incorrect {
  background: var(--wn-coral);
}

.wn-cell.is-active {
  border: 2px solid var(--wn-ink);
}

.wn-cell-num {
  position: absolute;
  top: 2px;
  left: 3.5px;
  color: var(--wn-muted);
  font-size: var(--num-size);
  font-weight: 600;
  line-height: 1;
  pointer-events: none;
}

.wn-cell.tone-correct .wn-cell-num {
  color: var(--wn-green-deep);
}

.wn-cell.tone-selected .wn-cell-num,
.wn-cell.tone-incorrect .wn-cell-num {
  color: rgba(41, 45, 50, 0.6);
}

.wn-cell-letter {
  color: var(--wn-ink);
  font-size: var(--letter-size);
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

@keyframes wnPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes wnShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

.wn-cell.is-pulse .wn-cell-letter {
  animation: wnPulse 0.16s ease-in-out;
}

.wn-cell.is-shake {
  animation: wnShake 0.28s linear;
}

.wn-message {
  margin: 0;
  color: var(--wn-muted);
  font-size: 0.78125rem;
  font-weight: 500;
}

.wn-complete-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: var(--wn-paper);
  border: 1px solid var(--wn-line);
  border-radius: 14px;
  font-size: 0.8125rem;
  font-weight: 600;
}

.wn-complete-bar-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  color: var(--wn-ink);
  background: var(--wn-yellow);
  border: 1px solid var(--wn-line);
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
}

.wn-complete-bar-btn svg {
  width: 14px;
  height: 14px;
}

/* OnScreenKeyboardView */
.wn-keyboard {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px 8px 6px;
  background: var(--wn-bg);
}

.wn-key-actions {
  display: flex;
  gap: 4px;
}

.wn-action-key {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 38px;
  padding: 0 6px;
  color: var(--wn-ink);
  background: var(--wn-paper);
  border: 1px solid var(--wn-line);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
}

.wn-action-key.is-reset {
  flex: 0 0 46px;
}

.wn-action-key svg {
  width: 15px;
  height: 15px;
}

.wn-action-key:active,
.wn-key:active,
.wn-flat-btn:active {
  background: var(--wn-blocked);
}

.wn-key-row {
  display: flex;
  gap: 4px;
}

.wn-key-row.is-indented {
  padding: 0 12px;
}

.wn-key {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 39px;
  padding: 0;
  color: var(--wn-ink);
  background: var(--wn-paper);
  border: 1px solid var(--wn-line);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.96875rem;
  font-weight: 700;
  cursor: pointer;
}

.wn-key.is-delete {
  flex: 1.45;
}

.wn-key.is-delete svg {
  width: 17px;
  height: 17px;
}

.wn-home-indicator {
  width: 118px;
  height: 4px;
  margin: 4px auto 7px;
  background: rgba(41, 45, 50, 0.24);
  border-radius: 999px;
}

/* Overlays: ConfirmDialogView & CompletionModalView */
.wn-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--wn-backdrop);
}

.wn-dialog {
  width: 100%;
  padding: 18px;
  background: var(--wn-paper);
  border: 1px solid var(--wn-line);
  border-radius: 14px;
}

.wn-dialog.is-center {
  text-align: center;
}

.wn-dialog-title {
  margin: 0 0 6px;
  color: var(--wn-ink);
  font-size: 1.1875rem;
  font-weight: 700;
}

.wn-dialog-text {
  margin: 0 0 14px;
  color: var(--wn-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.wn-complete-dots {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 10px;
}

.wn-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.wn-dot.is-green {
  background: var(--wn-green);
}

.wn-dot.is-yellow {
  background: var(--wn-yellow);
}

.wn-complete-kicker {
  display: block;
  margin-bottom: 2px;
  color: var(--wn-muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.wn-complete-sub {
  margin: 0 0 14px;
  color: var(--wn-ink);
  font-size: 0.9375rem;
  font-weight: 600;
}

.wn-complete-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.wn-complete-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  background: var(--wn-bg);
  border: 1px solid var(--wn-line);
  border-radius: 8px;
}

.wn-complete-stat span {
  color: var(--wn-muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.wn-complete-stat strong {
  color: var(--wn-ink);
  font-size: 1.125rem;
  font-weight: 700;
}

.wn-dialog-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.wn-flat-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 10px;
  color: var(--wn-ink);
  background: var(--wn-paper);
  border: 1px solid var(--wn-line);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.wn-flat-btn svg {
  width: 15px;
  height: 15px;
}

.wn-flat-btn.is-green {
  background: var(--wn-green);
  color: var(--wn-ink);
}

.wn-flat-btn.is-coral {
  background: var(--wn-coral);
  color: var(--wn-ink);
}

/* Side Clues Panel */
.game-clues {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cw-clue-group {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.cw-clue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.cw-clue-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.cw-clue-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 295px;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  list-style: none;
}

.cw-clue {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-family: var(--font);
  font-size: 0.8125rem;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.cw-clue:hover {
  background: var(--surface-2);
  border-color: var(--border);
}

.cw-clue.is-active {
  color: var(--wn-ink);
  background: #fdf6dc;
  border-color: #f4d878;
}

.cw-clue-num {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 5px;
  color: var(--wn-ink);
  background: var(--wn-bg);
  border: 1px solid var(--wn-line);
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cw-clue.is-active .cw-clue-num {
  background: var(--wn-yellow);
}

.cw-clue.is-done .cw-clue-num {
  color: var(--wn-green-deep);
  background: var(--wn-green);
}

.cw-clue-text {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}

.cw-clue.is-done .cw-clue-text {
  color: var(--muted);
  text-decoration: line-through;
}

.cw-clue-len {
  flex: none;
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- modal ---------- */

.admin-modal .modal-content {
  border: 0;
  border-radius: 14px;
  box-shadow: 0 32px 80px -28px rgba(15, 23, 42, 0.35);
}

.admin-modal .modal-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.admin-modal .modal-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.admin-modal .modal-body {
  padding: 18px 20px;
}

.admin-modal .mb-3 {
  margin-bottom: 12px !important;
}

.admin-modal .form-actions {
  margin-top: 14px;
}

.admin-modal .btn-close {
  padding: 6px;
  font-size: 0.75rem;
  opacity: 0.45;
}

.admin-modal .btn-close:hover {
  opacity: 0.9;
}

.modal-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  color: var(--muted);
  font-size: 0.875rem;
}

/* ---------- collapsible mini sidebar ---------- */

.workspace {
  transition: none;
}

.sidebar {
  transition: none;
}

.sidebar-anim .sidebar,
.sidebar-anim .workspace {
  transition: width 0.2s ease, margin-left 0.2s ease;
}

/* reserve icon space before Lucide replaces <i> with <svg> */
.side-link i[data-lucide],
.side-logout i[data-lucide] {
  display: inline-block;
  flex: none;
  width: 17px;
  height: 17px;
}

.side-user-chevron {
  display: inline-block;
}

.collapse-btn i[data-lucide] {
  display: inline-block;
  width: 18px;
  height: 18px;
}

.collapse-btn {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.collapse-btn:hover {
  color: var(--text);
  background: var(--surface-2);
}

.collapse-btn svg {
  width: 18px;
  height: 18px;
}

@media (min-width: 992px) {
  .sidebar-mini {
    --sidebar-width: 72px;
  }

  .sidebar-mini .sidebar-brand {
    justify-content: center;
    padding: 0;
  }

  .sidebar-mini .brand-text,
  .sidebar-mini .side-text,
  .sidebar-mini .side-user-meta,
  .sidebar-mini .side-user-chevron {
    display: none;
  }

  .sidebar-mini .side-label {
    height: 1px;
    margin: 10px 14px;
    overflow: hidden;
    color: transparent;
    background: rgba(255, 255, 255, 0.1);
  }

  .sidebar-mini .side-link {
    justify-content: center;
    padding: 0;
  }

  .sidebar-mini .side-link svg {
    width: 19px;
    height: 19px;
  }

  .sidebar-mini .sidebar-user {
    flex-direction: column;
    padding: 10px 8px;
  }

  .sidebar-mini .side-user {
    flex: none;
    justify-content: center;
    padding: 4px;
  }
}

/* ---------- responsive ---------- */

@media (max-width: 1320px) {
  .stats {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 1080px) {
  .dash-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 991.98px) {
  .collapse-btn {
    display: none;
  }

  .sidebar {
    box-shadow: 0 0 32px rgba(15, 23, 42, 0.25);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .nav-toggle:checked ~ .sidebar {
    transform: translateX(0);
  }

  .nav-toggle:checked ~ .nav-scrim {
    position: fixed;
    inset: 0;
    z-index: 1035;
    display: block;
    background: rgba(15, 23, 42, 0.5);
  }

  .workspace {
    margin-left: 0;
  }

  .menu-btn {
    display: flex;
  }

  .topbar {
    padding: 0 16px;
  }

  .content {
    padding: 16px;
  }

  .app-footer {
    margin-top: 16px;
  }
}

@media (max-width: 900px) {
  .profile-grid,
  .wn-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .wn-phone-frame {
    margin: 0 auto;
  }

  .game-clues {
    max-height: none;
  }
}

@media (max-width: 767.98px) {
  .breadcrumb-sep,
  .breadcrumb-root {
    display: none;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .stat {
    padding: 14px;
  }

  .stat-icon {
    width: 34px;
    height: 34px;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .page-actions {
    flex-direction: column;
  }

  .page-actions .btn {
    width: 100%;
  }

  .filters {
    align-items: stretch;
  }

  .filter-field {
    flex: 1 1 100%;
    min-width: 0;
  }

  .filter-field .form-select,
  .filter-field .form-control {
    width: 100%;
    min-width: 0;
  }

  .filters > .btn {
    width: 100%;
  }

  .table-shell {
    padding: 12px;
  }

  .dt-toolbar,
  .dt-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .dt-toolbar .dt-length label,
  .dt-toolbar .dt-search label {
    justify-content: space-between;
  }

  .dt-toolbar .dt-search input {
    flex: 1;
    min-width: 0;
  }

  .page > form[method="post"] {
    padding: 16px;
  }

  .profile-card {
    padding: 16px;
  }

  .login-card {
    padding: 22px;
  }

  .admin-modal .modal-header {
    padding: 12px 14px;
  }

  .admin-modal .modal-body {
    padding: 14px;
  }
}

@media (max-width: 639.98px) {
  .form-control,
  .form-select,
  .dt-toolbar .dt-length select,
  .dt-toolbar .dt-search input {
    font-size: 1rem;
  }

  .dt-toolbar .dt-search input {
    width: 100%;
  }

  .cw-grid {
    --cell-size: 34px;
    gap: 3px;
    padding: 8px;
  }
}

@media (max-width: 479.98px) {
  .stats {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   Soft surface layer — fewer borders, gentle depth
   ========================================================= */

/* cards & panels: no border, very soft elevation */
.dash-toolbar,
.stat,
.dash-card,
.table-shell,
.sheet,
.callout,
.profile-card,
.login-card,
.game-toolbar,
.cw-clue-group,
.page > form[method="post"] {
  border: 0;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(41, 45, 50, 0.03), 0 6px 20px -12px rgba(41, 45, 50, 0.1);
}

.stat:hover {
  box-shadow: 0 1px 2px rgba(41, 45, 50, 0.04), 0 10px 26px -12px rgba(41, 45, 50, 0.16);
}

.dash-card-head,
.cw-clue-head,
.profile-card-head {
  border-bottom-color: #f3f1ec;
}

.cw-clue-head {
  background: transparent;
}

.stat-meta {
  border-top-color: #f3f1ec;
}

/* inner chips / tiles: fill instead of outline */
.stat-icon,
.dash-badge,
.cat-icon-fallback,
.diff-item,
.word-row,
.cat-icon,
.status-pill,
.cw-clue-num {
  border-color: transparent;
}

.stat-icon {
  border-radius: 10px;
}

/* tables: lighter row dividers, soft header */
.table > :not(caption) > * > * {
  border-bottom-color: #f3f1ec;
}

.table thead th {
  border-bottom: 0;
  background-color: #f7f6f3;
}

/* inputs: filled, borderless until focus */
.form-control,
.form-select,
.dt-toolbar .dt-length select,
.dt-toolbar .dt-search input {
  background-color: #f5f4f0;
  border-color: transparent;
  border-radius: 10px;
}

.form-control:hover,
.form-select:hover,
.dt-toolbar .dt-length select:hover,
.dt-toolbar .dt-search input:hover {
  background-color: #f0eee9;
}

.form-control:focus,
.form-select:focus,
.dt-toolbar .dt-length select:focus,
.dt-toolbar .dt-search input:focus {
  background-color: #ffffff;
  border-color: rgba(235, 195, 66, 0.7);
  box-shadow: 0 0 0 4px rgba(255, 214, 10, 0.16);
}

input[type="file"].form-control::file-selector-button {
  background: #ffffff;
  border: 0;
  border-radius: 7px;
}

.form-check .form-check-input {
  border-color: #d8d4cc;
  border-radius: 5px;
}

/* buttons: soft filled, no outlines */
.btn {
  border-radius: 10px;
}

.btn-sm {
  border-radius: 8px;
}

.btn-primary {
  border-color: transparent;
}

.btn-primary:hover,
.btn-primary:active,
.btn-primary:focus-visible {
  border-color: transparent;
}

.btn-outline-primary,
.btn-outline-secondary {
  color: var(--text);
  background: #f3f1ec;
  border-color: transparent;
}

.btn-outline-primary:hover,
.btn-outline-primary:active,
.btn-outline-secondary:hover,
.btn-outline-secondary:active {
  color: var(--text);
  background: #ebe8e1;
  border-color: transparent;
}

.btn-outline-danger {
  color: #c2410c;
  color: var(--danger);
  background: #fdf0ef;
  border-color: transparent;
}

.btn-outline-danger:hover {
  color: #ffffff;
  background: var(--danger);
  border-color: transparent;
}

.btn-outline-warning {
  background: #fdf6e3;
  border-color: transparent;
}

.btn-outline-warning:hover {
  border-color: transparent;
}

/* pagination */
.dt-footer .page-link {
  background: transparent;
  border-color: transparent;
  border-radius: 8px;
}

.dt-footer .page-link:hover {
  background: #f3f1ec;
  border-color: transparent;
}

.dt-footer .page-item.active .page-link {
  border-color: transparent;
}

/* topbar & alerts */
.topbar {
  border-bottom-color: transparent;
  box-shadow: 0 1px 0 rgba(41, 45, 50, 0.04);
}

.menu-btn {
  border-color: transparent;
  background: #f3f1ec;
}

.alert {
  border-color: transparent;
  border-radius: 10px;
}

.app-footer {
  border-top-color: transparent;
}

.admin-modal .modal-header {
  border-bottom-color: #f3f1ec;
}

.admin-modal .modal-content {
  border-radius: 16px;
}
