:root {
  --bg: #f4f7fb;
  --card: rgba(255,255,255,.92);
  --border: rgba(15,23,42,.10);
}

html.dark {
  --bg: #0b1020;
  --card: rgba(17,24,39,.92);
  --border: rgba(255,255,255,.10);
}

body {
  min-height: 100vh;
  font-family: 'Prompt', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(900px 440px at 105% -10%, rgba(60,140,243,.11), transparent 60%),
    radial-gradient(760px 420px at -10% 110%, rgba(5,190,138,.10), transparent 60%),
    var(--bg);
  color: #1f2937;
}

html.dark body { color: #e5e7eb; }

/* Font lock: the product uses the normal system/Prompt font everywhere.
   Keep legacy mono marker classes only for spacing/nowrap behavior, not font family. */
.hws-mono,
.font-mono,
.mono,
code,
kbd,
pre,
samp,
[style*="JetBrains Mono"],
[style*="monospace"],
[style*="ui-monospace"] {
  font-family: inherit !important;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  border-radius: 14px;
  padding: .6rem .85rem;
  font-size: .92rem;
  font-weight: 600;
  color: #4b5563;
}

.nav-link:hover { background: rgba(60,140,243,.10); color: #2563eb; }
html.dark .nav-link { color: #d1d5db; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  border-radius: 16px;
  background: #3c8cf3;
  color: white;
  padding: .72rem 1rem;
  font-weight: 700;
  box-shadow: 0 16px 30px -18px rgba(60,140,243,.75);
}

.btn-primary:hover { background: #2978df; }

.btn-ghost, .icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,.72);
  padding: .65rem .9rem;
  font-weight: 700;
}

.icon-btn { width: 42px; height: 42px; padding: 0; }
html.dark .btn-ghost, html.dark .icon-btn { background: rgba(17,24,39,.72); }

.card {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 24px 60px -34px rgba(15,23,42,.35);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,.84);
  padding: .78rem .95rem;
  outline: none;
}

.form-textarea { min-height: 120px; }
html.dark .form-input, html.dark .form-select, html.dark .form-textarea { background: rgba(15,23,42,.75); color: white; }
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: #3c8cf3; box-shadow: 0 0 0 4px rgba(60,140,243,.12); }

.admin-sidebar {
  position: fixed;
  inset: 16px auto 16px 16px;
  z-index: 40;
  display: none;
  width: 264px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--card);
}

@media (min-width: 1024px) {
  .admin-sidebar { display: flex; }
}

.admin-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  border-radius: 16px;
  padding: .72rem .9rem;
  color: #4b5563;
  font-weight: 700;
}

.admin-link:hover, .admin-link.active {
  background: rgba(60,140,243,.12);
  color: #2563eb;
}

html.dark .admin-link { color: #d1d5db; }
html.dark .admin-link:hover, html.dark .admin-link.active { color: white; }

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .25rem .6rem;
  font-size: .75rem;
  font-weight: 800;
}

.pill-success { background: rgba(5,190,138,.14); color: #04966e; }
.pill-warn { background: rgba(255,167,38,.16); color: #b66b00; }
.pill-danger { background: rgba(239,83,80,.14); color: #d33b38; }
.pill-info { background: rgba(60,140,243,.14); color: #2563eb; }

.mobile-card-list { display: grid; gap: .75rem; }
@media (min-width: 768px) {
  .mobile-card-list { display: none; }
}
@media (max-width: 767px) {
  .desktop-table-wrap { display: none; }
}

.dt-container .dt-search input, .dt-container .dt-length select {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .45rem .65rem;
  background: white;
}

html.dark .dt-container .dt-search input, html.dark .dt-container .dt-length select {
  background: #111827;
  color: white;
}


/* ============================================================
   Login page brand logo (lives in app.css — bridge.css not loaded here)
   ============================================================ */
.login-brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  padding: 8px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(60,140,243,.10), rgba(116,90,242,.08));
  box-shadow:
    inset 0 0 0 1px rgba(60,140,243,.18),
    0 8px 18px -10px rgba(60,140,243,.35);
  box-sizing: border-box;
  overflow: hidden;
}
.login-brand-logo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(15,23,42,.10));
}
html.dark .login-brand-logo {
  background: linear-gradient(135deg, rgba(60,140,243,.18), rgba(116,90,242,.14));
}

/* Password show/hide toggle (auto-injected by app.js for all input[type=password]) */
.hws-pw-wrap {
  position: relative;
  display: block;
}
.hws-pw-wrap > input.form-input {
  padding-right: 2.85rem;
}
.hws-pw-toggle {
  position: absolute;
  right: .5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.1rem;
  height: 2.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #6b7280;
  border-radius: 10px;
  font-size: .95rem;
  line-height: 1;
  padding: 0;
  transition: background .15s ease, color .15s ease;
}
.hws-pw-toggle:hover {
  background: rgba(60,140,243,.10);
  color: #3c8cf3;
}
.hws-pw-toggle:focus-visible {
  outline: 2px solid #3c8cf3;
  outline-offset: 2px;
}
html.dark .hws-pw-toggle {
  color: #94a3b8;
}
html.dark .hws-pw-toggle:hover {
  background: rgba(60,140,243,.18);
  color: #93c5fd;
}

/* Register page — compact avatar uploader */
.hws-register-avatar {
  position: relative;
  display: inline-flex;
  width: 96px;
  height: 96px;
  cursor: pointer;
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(60,140,243,.08), rgba(116,90,242,.08));
  border: 2px dashed rgba(60,140,243,.35);
  transition: border-color .2s ease, transform .15s ease, box-shadow .2s ease;
}
.hws-register-avatar:hover {
  border-color: #3c8cf3;
  transform: scale(1.03);
  box-shadow: 0 6px 18px rgba(60,140,243,.18);
}
.hws-register-avatar.is-set {
  border-style: solid;
  border-color: #3c8cf3;
}
.hws-register-avatar-preview {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #94a3b8;
}
.hws-register-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hws-register-avatar-overlay {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #3c8cf3;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  box-shadow: 0 2px 6px rgba(15,23,42,.25);
  pointer-events: none;
  border: 2px solid #ffffff;
}
html.dark .hws-register-avatar {
  background: linear-gradient(135deg, rgba(60,140,243,.14), rgba(116,90,242,.14));
  border-color: rgba(60,140,243,.4);
}
html.dark .hws-register-avatar-overlay {
  border-color: #0f172a;
}
