:root {
  --brand: #4f46e5;
  --brand-2: #06b6d4;
  --brand-grad: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --ink: #0f172a;
  --muted: #64748b;
  --border: #e6e8ef;
}

[data-bs-theme="dark"] {
  --surface: #0f172a;
  --surface-2: #111a30;
  --ink: #e2e8f0;
  --muted: #94a3b8;
  --border: #1e293b;
}

body {
  background: var(--surface-2);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1 0 auto; }

.app-navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.admin-navbar {
  background: linear-gradient(90deg, #0f172a 0%, #1e293b 100%) !important;
}
.admin-navbar .nav-link { color: rgba(255,255,255,.75); }
.admin-navbar .nav-link.active,
.admin-navbar .nav-link:hover { color: #fff; }
.admin-body { background: #f1f5f9; }
[data-bs-theme="dark"] .admin-body { background: #0b1220; }

.brand-badge {
  display: inline-flex;
  width: 32px; height: 32px;
  align-items: center; justify-content: center;
  border-radius: 8px;
  background: var(--brand-grad);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  margin-right: 4px;
}

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

.stat-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform .15s ease, box-shadow .15s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}
.stat-card .icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 22px;
}
.stat-card .label { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.stat-card .value { font-size: 1.5rem; font-weight: 700; }

.tool-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.2rem;
  height: 100%;
  text-decoration: none;
  color: inherit;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.tool-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand);
  box-shadow: 0 10px 28px rgba(79, 70, 229, .12);
}
.tool-card .tool-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--brand-grad); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: .6rem;
}
.tool-card .tool-price {
  font-size: .78rem; color: var(--brand); font-weight: 600;
}

.auth-shell {
  min-height: calc(100vh - 56px);
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}
.auth-card {
  width: 100%; max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2rem;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .08);
}
.auth-card h1 { font-size: 1.5rem; font-weight: 700; }

.app-footer {
  background: var(--surface);
  color: var(--muted);
}

.btn-primary {
  background: var(--brand-grad);
  border: none;
}
.btn-primary:hover { filter: brightness(1.05); }

.table thead th {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  background: var(--surface-2);
}

.badge-soft { background: rgba(79, 70, 229, .1); color: var(--brand); }

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 2rem;
  text-align: center;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone.is-dragover { border-color: var(--brand); background: rgba(79,70,229,.06); }

.color-swatch {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: inline-block;
  cursor: pointer;
}
.color-swatch.is-active { box-shadow: 0 0 0 3px var(--brand); }

.preview-img {
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background-image: linear-gradient(45deg, #ddd 25%, transparent 25%),
                    linear-gradient(-45deg, #ddd 25%, transparent 25%),
                    linear-gradient(45deg, transparent 75%, #ddd 75%),
                    linear-gradient(-45deg, transparent 75%, #ddd 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0px;
}
