/* ===================================================================
   Nexus Desk — brand-aligned design system
   Layered on top of Tailwind (CDN). Uses the teal → orange gradient
   from the logo as the signature brand accent.
   =================================================================== */

:root {
  /* Core brand hues lifted from the logo. */
  --nd-ink:       #0f172a; /* primary dark - navy/slate */
  --nd-ink-soft:  #1e293b;
  --nd-teal:      #0ea5e9;
  --nd-teal-2:    #14b8a6;
  --nd-orange:    #f97316;
  --nd-orange-2:  #fb923c;
  --nd-success:   #22c55e;
  --nd-warning:   #f59e0b;
  --nd-danger:    #ef4444;
  --nd-surface:   #f6f8fb;
  --nd-surface-2: #eef2f7;
  --nd-line:      #e2e8f0;
  --nd-line-2:    #cbd5e1;
  --nd-text:      #0f172a;
  --nd-muted:     #64748b;

  /* Signature brand gradient (used sparingly: accents, logo text,
     CTA hovers, hero headers). */
  --nd-gradient:      linear-gradient(90deg, #0ea5e9 0%, #14b8a6 45%, #f97316 100%);
  --nd-gradient-soft: linear-gradient(135deg, rgba(14,165,233,.12), rgba(249,115,22,.12));

  /* Shadows */
  --nd-shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --nd-shadow-md: 0 10px 25px -10px rgba(15, 23, 42, .18);
  --nd-shadow-lg: 0 25px 50px -12px rgba(15, 23, 42, .25);

  /* Radii */
  --nd-r-sm: .375rem;
  --nd-r-md: .5rem;
  --nd-r-lg: .75rem;
  --nd-r-xl: 1rem;
}

* { box-sizing: border-box; }
html, body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--nd-surface);
  color: var(--nd-text);
  font-size: 15px;
  line-height: 1.5;
}

/* -------------------------------------------------------------------
   Brand marks
   ------------------------------------------------------------------- */
.nd-brand-wordmark {
  background: var(--nd-gradient);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  font-weight: 800;
  letter-spacing: -.01em;
}
.nd-logo-img { display: block; object-fit: contain; }

/* -------------------------------------------------------------------
   Icons (Lucide via CDN)
   ------------------------------------------------------------------- */
[data-lucide], .nd-icon, .nd-icon svg, [data-lucide] svg {
  width: 1em; height: 1em;
  flex: none; stroke-width: 1.75;
}
.nd-icon-sm { font-size: .95rem; }
.nd-icon-md { font-size: 1.1rem; }
.nd-icon-lg { font-size: 1.5rem; }

.animate-spin { animation: nd-spin 1s linear infinite; }
@keyframes nd-spin { to { transform: rotate(360deg); } }

/* -------------------------------------------------------------------
   Cards
   ------------------------------------------------------------------- */
.nd-card {
  background: #fff;
  border: 1px solid var(--nd-line);
  border-radius: var(--nd-r-lg);
  box-shadow: var(--nd-shadow-sm);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.nd-card-hover:hover {
  box-shadow: var(--nd-shadow-md);
  border-color: #c7d2fe;
  transform: translateY(-1px);
}
.nd-card-gradient {
  background: var(--nd-gradient-soft), #fff;
  border: 1px solid rgba(14,165,233,.2);
}

/* -------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------- */
.nd-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .55rem .95rem; border-radius: var(--nd-r-md);
  font-weight: 500; font-size: .875rem; line-height: 1.2;
  transition: all .15s ease;
  border: 1px solid transparent;
  cursor: pointer; white-space: nowrap;
}
.nd-btn:disabled { opacity: .55; cursor: not-allowed; }

.nd-btn-primary   { background: var(--nd-ink);   color: #fff; }
.nd-btn-primary:hover:not(:disabled) { background: var(--nd-ink-soft); }

.nd-btn-secondary { background: #fff; border-color: var(--nd-line-2); color: var(--nd-ink); }
.nd-btn-secondary:hover:not(:disabled) { background: var(--nd-surface-2); border-color: #94a3b8; }

.nd-btn-accent    { background: var(--nd-teal);  color: #fff; }
.nd-btn-accent:hover:not(:disabled) { background: #0284c7; }

.nd-btn-orange    { background: var(--nd-orange); color: #fff; }
.nd-btn-orange:hover:not(:disabled) { background: #ea580c; }

.nd-btn-danger    { background: var(--nd-danger); color: #fff; }
.nd-btn-danger:hover:not(:disabled) { background: #b91c1c; }

.nd-btn-ghost     { background: transparent; color: var(--nd-muted); }
.nd-btn-ghost:hover:not(:disabled) { background: var(--nd-surface-2); color: var(--nd-ink); }

/* Brand CTA: gradient outline, fills on hover. */
.nd-btn-brand {
  color: #fff;
  background: var(--nd-gradient);
  background-size: 200% 100%;
  background-position: 0 0;
  border: 0;
  box-shadow: 0 6px 16px -6px rgba(14,165,233,.55);
}
.nd-btn-brand:hover:not(:disabled) {
  background-position: 100% 0;
  box-shadow: 0 10px 22px -6px rgba(249,115,22,.55);
}

.nd-btn-sm { padding: .35rem .7rem; font-size: .8rem; }
.nd-btn-lg { padding: .75rem 1.2rem; font-size: .95rem; }

/* Circular icon button (hamburger, close, etc.) */
.nd-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem;
  border-radius: .5rem; border: 1px solid var(--nd-line-2);
  background: #fff; color: var(--nd-ink);
  cursor: pointer; transition: background .15s ease, border-color .15s ease;
}
.nd-icon-btn:hover { background: var(--nd-surface-2); border-color: #94a3b8; }
.nd-icon-btn-ghost { border-color: transparent; background: transparent; }
.nd-icon-btn-ghost:hover { background: var(--nd-surface-2); border-color: transparent; }

/* -------------------------------------------------------------------
   Form fields
   ------------------------------------------------------------------- */
.nd-input, .nd-select, .nd-textarea {
  width: 100%;
  padding: .55rem .8rem;
  border-radius: var(--nd-r-md);
  border: 1px solid var(--nd-line-2);
  background: #fff;
  font-size: .875rem;
  color: var(--nd-ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.nd-input::placeholder, .nd-textarea::placeholder { color: #94a3b8; }
.nd-input:focus, .nd-select:focus, .nd-textarea:focus {
  outline: none; border-color: var(--nd-teal);
  box-shadow: 0 0 0 3px rgba(14,165,233,.18);
}
.nd-input:disabled { background: var(--nd-surface-2); color: var(--nd-muted); cursor: not-allowed; }

/* Input-with-leading-icon helper */
.nd-input-wrap { position: relative; }
.nd-input-wrap > [data-lucide],
.nd-input-wrap > .nd-icon {
  position: absolute; left: .75rem; top: 50%; transform: translateY(-50%);
  color: var(--nd-muted); font-size: 1.05rem; pointer-events: none;
}
.nd-input-wrap > .nd-input { padding-left: 2.3rem; }

/* -------------------------------------------------------------------
   Badges
   ------------------------------------------------------------------- */
.nd-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .7rem; font-weight: 600;
  padding: .2rem .55rem; border-radius: 9999px;
  line-height: 1;
}
.nd-badge-ok    { background: #dcfce7; color: #166534; }
.nd-badge-warn  { background: #fef3c7; color: #92400e; }
.nd-badge-bad   { background: #fee2e2; color: #991b1b; }
.nd-badge-muted { background: #e2e8f0; color: #334155; }
.nd-badge-brand { background: rgba(14,165,233,.12); color: #0369a1; }

/* -------------------------------------------------------------------
   Progress bar
   ------------------------------------------------------------------- */
.nd-progress {
  height: 8px; background: #e2e8f0; border-radius: 9999px; overflow: hidden;
}
.nd-progress > span {
  display: block; height: 100%;
  background: var(--nd-gradient);
  transition: width .3s ease;
}

/* -------------------------------------------------------------------
   Layout shell (dashboards)
   ------------------------------------------------------------------- */
.nd-shell { min-height: 100vh; }

.nd-sidebar {
  display: flex; flex-direction: column;
  padding: 1rem;
  background: #fff;
  border-right: 1px solid var(--nd-line);
}
.nd-sidebar-brand {
  display: flex; align-items: center; gap: .6rem;
  padding: .25rem .25rem 1rem;
  border-bottom: 1px solid var(--nd-line);
  margin-bottom: .75rem;
}
.nd-sidebar-brand .nd-logo-img { width: 32px; height: 32px; }
.nd-sidebar-brand .nd-brand-name { font-weight: 700; font-size: .95rem; color: var(--nd-ink); }
.nd-sidebar-brand .nd-brand-sub  { font-size: .7rem; color: var(--nd-muted); text-transform: capitalize; }

.nd-sidebar a {
  display: flex; align-items: center; gap: .65rem;
  padding: .55rem .7rem;
  border-radius: var(--nd-r-md);
  font-size: .875rem; color: #475569;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.nd-sidebar a:hover { background: var(--nd-surface-2); color: var(--nd-ink); }
.nd-sidebar a [data-lucide],
.nd-sidebar a .nd-icon { font-size: 1.05rem; color: #94a3b8; transition: color .15s ease; }
.nd-sidebar a:hover [data-lucide],
.nd-sidebar a:hover .nd-icon { color: var(--nd-teal); }
.nd-sidebar a.active {
  background: rgba(14,165,233,.1);
  color: var(--nd-teal);
  font-weight: 600;
}
.nd-sidebar a.active [data-lucide],
.nd-sidebar a.active .nd-icon { color: var(--nd-teal); }

.nd-topbar {
  background: #fff; border-bottom: 1px solid var(--nd-line);
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .75rem 1rem;
}
@media (min-width: 768px) { .nd-topbar { padding: .85rem 1.5rem; } }

.nd-topbar-title { font-weight: 600; color: var(--nd-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* -------------------------------------------------------------------
   Mobile drawer
   ------------------------------------------------------------------- */
.nd-drawer-backdrop { display: none; }

@media (max-width: 767px) {
  .nd-sidebar {
    position: fixed; top: 0; bottom: 0; left: 0;
    width: 16rem; z-index: 50;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: var(--nd-shadow-lg);
  }
  .nd-sidebar-open .nd-sidebar { transform: none; }
  .nd-drawer-backdrop {
    position: fixed; inset: 0; background: rgba(15,23,42,.5);
    z-index: 40; display: none;
    animation: nd-fade-in .18s ease-out;
  }
  .nd-sidebar-open .nd-drawer-backdrop { display: block; }
}

/* -------------------------------------------------------------------
   Tables (responsive horizontal scroll already handled by Tailwind
   `overflow-x-auto`; this adds the polish.)
   ------------------------------------------------------------------- */
.nd-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.nd-table th {
  text-align: left; font-size: .7rem; font-weight: 600;
  color: var(--nd-muted); text-transform: uppercase; letter-spacing: .05em;
  padding: .65rem .9rem; border-bottom: 1px solid var(--nd-line);
}
.nd-table td {
  padding: .75rem .9rem; border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.nd-table tr:last-child td { border-bottom: 0; }

/* -------------------------------------------------------------------
   Public landing page chrome
   ------------------------------------------------------------------- */
.nd-public-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--nd-line);
}
.nd-hero {
  background:
    radial-gradient(circle at 15% 15%, rgba(14,165,233,.12), transparent 55%),
    radial-gradient(circle at 85% 85%, rgba(249,115,22,.12), transparent 55%),
    #fff;
}
.nd-hero-card {
  background: linear-gradient(135deg, #0f172a 0%, #0b3a5c 50%, #164e63 100%);
  color: #fff;
  border: 1px solid #1e293b;
}
.nd-hero-card .nd-hero-kicker { color: #7dd3fc; }

/* Mobile nav for public landing */
.nd-public-nav-mobile { display: none; }
@media (max-width: 640px) {
  .nd-public-nav-desktop { display: none !important; }
  .nd-public-nav-mobile  { display: flex; }
}

/* Prose blocks on privacy / terms / POPIA */
.nd-prose { color: var(--nd-ink); line-height: 1.7; }
.nd-prose h1 { font-size: 2rem; font-weight: 800; margin: 0 0 1rem; letter-spacing: -.01em; }
.nd-prose h2 { font-size: 1.25rem; font-weight: 700; margin: 1.75rem 0 .5rem; color: var(--nd-ink); }
.nd-prose p  { color: #334155; margin: 0 0 1rem; }
.nd-prose ul { margin: 0 0 1rem 1.25rem; }
.nd-prose li { margin-bottom: .4rem; }
.nd-prose a  { color: var(--nd-teal); text-decoration: underline; }

/* -------------------------------------------------------------------
   Auth page (login, change-password, forgot) chrome
   ------------------------------------------------------------------- */
.nd-auth-bg {
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 10%, rgba(14,165,233,.18), transparent 55%),
    radial-gradient(circle at 90% 90%, rgba(249,115,22,.18), transparent 55%),
    var(--nd-surface);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.nd-auth-card { width: 100%; max-width: 26rem; }

/* -------------------------------------------------------------------
   Custom UI: toasts, modals, prompts, forms
   (replaces browser-native alert()/confirm()/prompt() app-wide.)
   ------------------------------------------------------------------- */

#nd-ui-root { position: fixed; inset: 0; pointer-events: none; z-index: 10000; }
#nd-ui-root > * { pointer-events: auto; }

/* Toasts */
.nd-toast-stack {
  position: fixed; right: 1rem; bottom: 1rem;
  display: flex; flex-direction: column; gap: .5rem;
  max-width: calc(100% - 2rem); width: 22rem;
  z-index: 10001;
}
.nd-toast {
  background: var(--nd-ink); color: #f8fafc;
  padding: .75rem 1rem; border-radius: .625rem;
  font-size: .875rem; line-height: 1.4;
  box-shadow: var(--nd-shadow-lg);
  display: flex; align-items: flex-start; gap: .6rem;
  animation: nd-toast-in .18s ease-out;
  border-left: 3px solid #64748b;
}
.nd-toast.nd-toast-leaving { animation: nd-toast-out .18s ease-in forwards; }
.nd-toast-success { border-left-color: var(--nd-success); }
.nd-toast-error   { border-left-color: var(--nd-danger); }
.nd-toast-warn    { border-left-color: var(--nd-warning); }
.nd-toast-info    { border-left-color: var(--nd-teal); }
.nd-toast-close {
  background: transparent; border: 0; color: #94a3b8; cursor: pointer;
  font-size: 1.1rem; line-height: 1; padding: 0 .15rem;
}
.nd-toast-close:hover { color: #fff; }
@keyframes nd-toast-in  { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes nd-toast-out { from { opacity: 1; } to   { transform: translateY(8px); opacity: 0; } }

/* Modals */
.nd-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; z-index: 10002;
  animation: nd-fade-in .15s ease-out;
}
@keyframes nd-fade-in { from { opacity: 0; } to { opacity: 1; } }

.nd-modal {
  background: #fff; border-radius: var(--nd-r-xl);
  width: 100%; max-width: 28rem;
  box-shadow: var(--nd-shadow-lg);
  overflow: hidden;
  animation: nd-modal-in .18s ease-out;
  max-height: calc(100vh - 2rem);
  display: flex; flex-direction: column;
}
@keyframes nd-modal-in {
  from { transform: translateY(8px) scale(.98); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.nd-modal-header {
  padding: 1rem 1.25rem .25rem; font-weight: 600; font-size: 1rem; color: var(--nd-ink);
}
.nd-modal-body   {
  padding: .25rem 1.25rem 1rem;
  color: #334155; font-size: .875rem; line-height: 1.5;
  white-space: pre-wrap;
  overflow-y: auto;
}
.nd-modal-body .nd-input, .nd-modal-body .nd-select, .nd-modal-body .nd-textarea { margin-top: .5rem; }
.nd-modal-fields { display: flex; flex-direction: column; gap: .75rem; margin-top: .75rem; }
.nd-modal-fields label {
  font-size: .7rem; color: var(--nd-muted); font-weight: 600;
  display: block; margin-bottom: .25rem; text-transform: uppercase; letter-spacing: .04em;
}
.nd-modal-footer {
  padding: .75rem 1.25rem;
  border-top: 1px solid var(--nd-line);
  background: var(--nd-surface);
  display: flex; gap: .5rem; justify-content: flex-end;
  flex-wrap: wrap;
}
.nd-modal-danger .nd-modal-header { color: #991b1b; }
.nd-modal-error {
  margin-top: .5rem; font-size: .8rem; color: #991b1b;
  background: #fef2f2; padding: .5rem .75rem; border-radius: .375rem;
  display: none;
}
.nd-modal-error.show { display: block; }

/* Segmented tab control (Policy pages: Privacy / Terms / POPIA) */
.nd-tab-btn {
  padding: .4rem .9rem; border-radius: .375rem;
  font-size: .8rem; font-weight: 500;
  color: var(--nd-muted); background: transparent; border: 0; cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}
.nd-tab-btn:hover { color: var(--nd-ink); }
.nd-tab-active {
  background: #fff; color: var(--nd-ink);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
}

/* Quill WYSIWYG (policy editors) */
.nd-quill { min-height: 260px; }
.nd-quill + .ql-toolbar,
.ql-toolbar.ql-snow {
  border-top-left-radius: .5rem; border-top-right-radius: .5rem;
  border-color: var(--nd-line-2);
}
.ql-container.ql-snow {
  border-bottom-left-radius: .5rem; border-bottom-right-radius: .5rem;
  border-color: var(--nd-line-2); min-height: 240px;
  font-size: .9rem; background: #fff;
}
.ql-editor { min-height: 240px; }

/* -------------------------------------------------------------------
   Utility: responsive data tables that collapse to card rows on phones
   (opt-in via class="nd-stack-mobile")
   ------------------------------------------------------------------- */
@media (max-width: 640px) {
  .nd-stack-mobile thead { display: none; }
  .nd-stack-mobile tr {
    display: block;
    padding: .75rem; border-bottom: 1px solid var(--nd-line);
  }
  .nd-stack-mobile td {
    display: flex; justify-content: space-between; gap: 1rem;
    padding: .25rem 0; border-bottom: 0;
  }
  .nd-stack-mobile td::before {
    content: attr(data-label);
    font-weight: 600; color: var(--nd-muted);
    text-transform: uppercase; font-size: .7rem; letter-spacing: .04em;
  }
}

/* -------------------------------------------------------------------
   Custom date picker (replaces native <input type="date">)
   ------------------------------------------------------------------- */
.nd-date-wrap { position: relative; width: 100%; }
.nd-date-raw  { /* hidden field; kept in DOM for x-model/form posts */ }

.nd-date-display {
  display: flex; align-items: center; gap: .5rem;
  width: 100%; cursor: pointer;
  padding: .55rem .8rem;
  border-radius: var(--nd-r-md);
  border: 1px solid var(--nd-line-2);
  background: #fff;
  font-size: .875rem; color: var(--nd-ink);
  text-align: left;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.nd-date-display:hover  { border-color: #94a3b8; }
.nd-date-display.is-open,
.nd-date-display:focus-visible {
  outline: none; border-color: var(--nd-teal);
  box-shadow: 0 0 0 3px rgba(14,165,233,.18);
}
.nd-date-display .nd-date-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nd-date-display.is-empty .nd-date-label { color: #94a3b8; }
.nd-date-display .nd-date-icon {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--nd-muted); font-size: 1rem;
}
.nd-date-display .nd-date-clear {
  display: none; align-items: center; justify-content: center;
  width: 1.1rem; height: 1.1rem; border-radius: 9999px;
  background: var(--nd-surface-2); color: var(--nd-muted);
  font-size: .75rem; line-height: 1; cursor: pointer;
}
.nd-date-display .nd-date-clear:hover { background: #e2e8f0; color: var(--nd-ink); }
.nd-date-display.has-value .nd-date-clear { display: inline-flex; }

.nd-date-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 50;
  width: 17rem; max-width: calc(100vw - 2rem);
  background: #fff;
  border: 1px solid var(--nd-line);
  border-radius: var(--nd-r-lg);
  box-shadow: var(--nd-shadow-lg);
  padding: .6rem;
  animation: nd-fade-in .12s ease-out;
}
.nd-date-head {
  display: flex; align-items: center; gap: .15rem;
  padding: .1rem 0 .5rem;
}
.nd-date-head .nd-date-title {
  flex: 1; text-align: center; font-size: .85rem; font-weight: 600; color: var(--nd-ink);
}
.nd-date-head .nd-date-nav {
  background: transparent; border: 0; cursor: pointer;
  width: 1.6rem; height: 1.6rem;
  border-radius: .35rem; color: var(--nd-muted);
  font-size: .9rem; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.nd-date-head .nd-date-nav:hover { background: var(--nd-surface-2); color: var(--nd-ink); }

.nd-date-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
}
.nd-date-dow {
  font-size: .65rem; color: var(--nd-muted); text-align: center;
  padding: .25rem 0; font-weight: 600; letter-spacing: .04em;
}
.nd-date-day {
  background: transparent; border: 0; cursor: pointer;
  padding: .35rem 0; border-radius: .3rem; font-size: .8rem;
  color: var(--nd-ink);
  transition: background .12s ease, color .12s ease;
}
.nd-date-day:hover { background: var(--nd-surface-2); }
.nd-date-day.is-today { color: var(--nd-teal); font-weight: 700; }
.nd-date-day.is-selected {
  background: var(--nd-teal); color: #fff; font-weight: 700;
  box-shadow: 0 2px 6px -2px rgba(14,165,233,.7);
}
.nd-date-day.is-selected.is-today { background: var(--nd-orange); box-shadow: 0 2px 6px -2px rgba(249,115,22,.7); }

.nd-date-actions {
  display: flex; justify-content: space-between; gap: .4rem;
  padding-top: .5rem; margin-top: .35rem;
  border-top: 1px solid var(--nd-line);
}
.nd-date-action {
  background: transparent; border: 0; cursor: pointer;
  padding: .3rem .65rem; border-radius: .3rem;
  font-size: .75rem; font-weight: 500; color: var(--nd-muted);
}
.nd-date-action:hover { background: var(--nd-surface-2); color: var(--nd-ink); }
.nd-date-action.is-primary { color: var(--nd-teal); font-weight: 600; }
.nd-date-action.is-primary:hover { background: rgba(14,165,233,.12); }

/* -------------------------------------------------------------------
   Custom select (replaces native <select class="nd-select">)
   ------------------------------------------------------------------- */
.nd-select-wrap { position: relative; width: 100%; }
/* hide the native select visually but keep it focusable / submittable */
select.nd-select.nd-select-native {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; pointer-events: none;
  padding: 0; border: 0; margin: 0;
}

.nd-select-trigger {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .55rem .8rem;
  border-radius: var(--nd-r-md);
  border: 1px solid var(--nd-line-2);
  background: #fff;
  font-size: .875rem; color: var(--nd-ink);
  cursor: pointer; text-align: left;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.nd-select-trigger:hover { border-color: #94a3b8; }
.nd-select-trigger.is-open,
.nd-select-trigger:focus-visible {
  outline: none; border-color: var(--nd-teal);
  box-shadow: 0 0 0 3px rgba(14,165,233,.18);
}
.nd-select-trigger .nd-select-value {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nd-select-trigger .nd-select-value.is-placeholder { color: #94a3b8; }
.nd-select-trigger .nd-select-chev {
  color: var(--nd-muted); display: inline-flex; align-items: center;
  transition: transform .15s ease;
}
.nd-select-trigger.is-open .nd-select-chev { transform: rotate(180deg); color: var(--nd-teal); }

.nd-select-pop {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--nd-line);
  border-radius: var(--nd-r-md);
  box-shadow: var(--nd-shadow-lg);
  z-index: 50;
  max-height: 16rem; overflow: auto;
  padding: .3rem;
  animation: nd-fade-in .12s ease-out;
}
.nd-select-item {
  display: block; width: 100%; text-align: left;
  background: transparent; border: 0; cursor: pointer;
  padding: .45rem .65rem; font-size: .875rem; border-radius: .3rem;
  color: var(--nd-ink);
}
.nd-select-item:hover { background: var(--nd-surface-2); }
.nd-select-item.is-selected {
  background: rgba(14,165,233,.12); color: var(--nd-teal); font-weight: 600;
}
.nd-select-item.is-disabled { opacity: .5; cursor: not-allowed; }

/* When the select is inside a modal we need to make sure the popover can
   escape without being clipped by the modal's body scroll. */
.nd-modal-body .nd-select-pop { max-height: 12rem; }

/* -------------------------------------------------------------------
   Auth page (login / change-password / forgot) safety-net
   -- browsers without app.css load order still render a centered card.
   ------------------------------------------------------------------- */
body.nd-auth-bg { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1rem; }
body.nd-auth-bg .nd-auth-card { width: 100%; max-width: 26rem; margin-left: auto; margin-right: auto; }
