/* =============================================================================
   Cardex — design system (dashboard + admin shell)
   ============================================================================= */

@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400..700;1,9..40,400..700&display=swap");

:root {
  --cx-font: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --cx-mono: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;

  --cx-ink: #0c1222;
  --cx-ink-soft: #3d4f6f;
  --cx-muted: #647896;
  --cx-line: rgba(12, 18, 34, 0.08);
  --cx-line-strong: rgba(12, 18, 34, 0.12);

  --cx-surface: #ffffff;
  --cx-surface-2: #f4f6fb;
  --cx-elevated: rgba(255, 255, 255, 0.72);

  --cx-accent: #0ea5a8;
  --cx-accent-deep: #0d6f71;
  --cx-accent-glow: rgba(14, 165, 168, 0.35);

  --cx-sidebar: #0b1220;
  --cx-sidebar-2: #121a2e;
  --cx-sidebar-text: #e8edf7;
  --cx-sidebar-muted: rgba(232, 237, 247, 0.55);

  --cx-danger: #e11d48;
  --cx-warn: #f59e0b;
  --cx-success: #059669;

  --cx-radius-sm: 10px;
  --cx-radius: 16px;
  --cx-radius-lg: 22px;

  --cx-shadow: 0 4px 24px rgba(8, 15, 35, 0.06);
  --cx-shadow-hover: 0 16px 48px rgba(8, 15, 35, 0.1);

  --cx-sidebar-w: 280px;
  --cx-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--cx-font);
}

/* ----------------------------------------------------------------------------- 
   App shell (.dash-body)
   ----------------------------------------------------------------------------- */
.dash-body {
  min-height: 100vh;
  color: var(--cx-ink);
  background-color: #eef1f8;
  background-image:
    radial-gradient(1200px 600px at 12% -10%, rgba(14, 165, 168, 0.14), transparent 55%),
    radial-gradient(900px 500px at 88% 0%, rgba(99, 102, 241, 0.1), transparent 50%),
    linear-gradient(180deg, #eef1f8 0%, #e4e9f4 100%);
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Desktop: keep sidebar in view; only main column scrolls */
@media (min-width: 921px) {
  html {
    height: 100%;
  }

  body.dash-body {
    height: 100%;
    overflow: hidden;
  }

  .app-shell {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .dash-sidebar {
    overflow-y: auto;
    overscroll-behavior: contain;
    min-height: 0;
  }

  .dash-main {
    overflow-y: auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
  }
}

/* --- Mobile menu --- */
.dash-menu-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 1200;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--cx-line-strong);
  border-radius: 12px;
  background: var(--cx-surface);
  box-shadow: var(--cx-shadow);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--cx-ink);
  transition: transform 0.2s var(--cx-ease), box-shadow 0.2s var(--cx-ease);
}

.dash-menu-toggle:hover {
  transform: scale(1.03);
  box-shadow: var(--cx-shadow-hover);
}

.dash-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 22, 0.55);
  backdrop-filter: blur(3px);
  z-index: 1090;
}

/* --- Sidebar --- */
.dash-sidebar {
  width: var(--cx-sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 22px 0 12px;
  background: linear-gradient(165deg, var(--cx-sidebar) 0%, var(--cx-sidebar-2) 48%, #0d1424 100%);
  color: var(--cx-sidebar-text);
  box-shadow: 8px 0 40px rgba(6, 10, 22, 0.25);
  position: relative;
  z-index: 1100;
}

.dash-nav-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 0 16px;
}

.dash-nav-group {
  margin: 0 10px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dash-nav-group:last-of-type {
  border-bottom: none;
}

.dash-nav-group__summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 8px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--cx-sidebar-muted);
  user-select: none;
}

.dash-nav-group__summary::-webkit-details-marker {
  display: none;
}

.dash-nav-group__summary::after {
  content: "▾";
  font-size: 0.65rem;
  opacity: 0.65;
  transition: transform 0.2s var(--cx-ease);
}

.dash-nav-group[open] > .dash-nav-group__summary::after {
  transform: rotate(-180deg);
}

.dash-nav-group__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 4px 12px;
}

.dash-nav-group__body .dash-nav-link {
  margin: 0;
}

.dash-sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cpath fill='%23ffffff' fill-opacity='0.03' d='M40 0L80 40L40 80L0 40Z'/%3E%3C/svg%3E");
  opacity: 0.5;
  pointer-events: none;
}

.dash-brand {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 0 22px 22px;
  margin: 0 14px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dash-brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.dash-brand-title {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.dash-brand-sub {
  font-size: 0.72rem;
  color: var(--cx-sidebar-muted);
  margin-top: 4px;
  line-height: 1.35;
}

.dash-nav {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0 14px;
}

.dash-nav-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cx-sidebar-muted);
  margin: 22px 12px 8px;
}

.dash-nav-label:first-child {
  margin-top: 4px;
}

.dash-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  margin: 0 2px;
  border-radius: var(--cx-radius-sm);
  color: var(--cx-sidebar-text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 0.18s var(--cx-ease), border-color 0.18s var(--cx-ease), color 0.18s var(--cx-ease);
}

.dash-nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.06);
}

.dash-nav-link.is-active {
  background: linear-gradient(90deg, rgba(14, 165, 168, 0.25), rgba(14, 165, 168, 0.05));
  border-color: rgba(14, 165, 168, 0.35);
  color: #f0fffe;
  font-weight: 600;
}

.dash-nav-link--muted {
  opacity: 0.75;
  margin-top: 6px;
}

/* --- Main column --- */
.dash-main {
  flex: 1;
  min-width: 0;
  padding: 36px clamp(20px, 4vw, 48px) 120px;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
  position: relative;
}

.dash-main::after {
  content: "";
  position: fixed;
  width: 420px;
  height: 420px;
  right: -120px;
  bottom: 15%;
  background: radial-gradient(circle, rgba(14, 165, 168, 0.12), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.dash-main > * {
  position: relative;
  z-index: 1;
}

.dash-main-header {
  margin-bottom: 28px;
}

.dash-main-header h1 {
  margin: 0 0 10px;
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--cx-ink);
  line-height: 1.2;
}

.dash-lead {
  margin: 0;
  color: var(--cx-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 42rem;
}

/* --- Home hero --- */
.dash-main-header--hero {
  text-align: center;
  padding: 8px 0 4px;
}

.dash-hero-card {
  margin: 0 auto 32px;
  max-width: 640px;
  padding: clamp(24px, 4vw, 40px) clamp(22px, 4vw, 40px);
  background: var(--cx-elevated);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--cx-radius-lg);
  box-shadow: var(--cx-shadow), 0 0 0 1px rgba(12, 18, 34, 0.04) inset;
}

.dash-hero-logo-wrap {
  margin-bottom: 16px;
}

.dash-hero-logo {
  height: 72px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(14, 165, 168, 0.25));
}

.dash-hero-card h1 {
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
  background: linear-gradient(120deg, var(--cx-ink) 0%, var(--cx-accent-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.dash-welcome {
  font-size: 1.05rem;
  margin: 0 0 8px;
  color: var(--cx-ink-soft);
}

.dash-welcome strong {
  color: var(--cx-ink);
  font-weight: 700;
}

.dash-meta {
  margin: 0 0 14px;
  font-size: 0.82rem;
  color: var(--cx-muted);
}

.dash-meta strong {
  color: var(--cx-ink-soft);
  font-weight: 600;
}

.dash-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cx-accent-deep);
  background: rgba(14, 165, 168, 0.12);
  border: 1px solid rgba(14, 165, 168, 0.22);
}

.dash-hero-card .dash-lead {
  margin: 14px auto 0;
  max-width: 36rem;
}

/* --- Bento panels --- */
.dash-panels {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.dash-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px 22px;
  min-height: 148px;
  background: var(--cx-surface);
  border: 1px solid var(--cx-line);
  border-radius: var(--cx-radius);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--cx-shadow);
  overflow: hidden;
  transition: transform 0.22s var(--cx-ease), box-shadow 0.22s var(--cx-ease), border-color 0.22s var(--cx-ease);
}

.dash-panel::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--cx-accent), #6366f1);
  opacity: 0;
  transition: opacity 0.22s var(--cx-ease);
}

.dash-panel:hover {
  transform: translateY(-4px);
  box-shadow: var(--cx-shadow-hover);
  border-color: rgba(14, 165, 168, 0.25);
}

.dash-panel:hover::before {
  opacity: 1;
}

.dash-panel-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(14, 165, 168, 0.12), rgba(99, 102, 241, 0.08));
  margin-bottom: 12px;
}

.dash-panel h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--cx-ink);
}

.dash-panel p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--cx-muted);
  line-height: 1.5;
}

.dash-panel-arrow {
  margin-top: auto;
  padding-top: 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cx-accent);
  letter-spacing: 0.04em;
}

/* --- Toolbar / tables / forms --- */
.dash-toolbar {
  margin-bottom: 16px;
}

.dash-search {
  width: 100%;
  max-width: 340px;
  padding: 11px 16px;
  border: 1px solid var(--cx-line-strong);
  border-radius: var(--cx-radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--cx-surface);
  box-shadow: 0 1px 3px rgba(8, 15, 35, 0.04);
}

.dash-search:focus {
  outline: none;
  border-color: var(--cx-accent);
  box-shadow: 0 0 0 3px var(--cx-accent-glow);
}

.dash-table-wrap {
  overflow-x: auto;
  background: var(--cx-surface);
  border: 1px solid var(--cx-line);
  border-radius: var(--cx-radius);
  box-shadow: var(--cx-shadow);
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.dash-table th,
.dash-table td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--cx-line);
}

.dash-table th {
  background: var(--cx-surface-2);
  font-weight: 600;
  color: var(--cx-ink-soft);
  cursor: pointer;
  user-select: none;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dash-table tbody tr:hover td {
  background: rgba(14, 165, 168, 0.04);
}

.dash-link {
  color: var(--cx-accent-deep);
  font-weight: 600;
  text-decoration: none;
}

.dash-link:hover {
  text-decoration: underline;
}

.dash-form-card {
  max-width: 520px;
  background: var(--cx-surface);
  border: 1px solid var(--cx-line);
  border-radius: var(--cx-radius);
  padding: 26px 28px 30px;
  box-shadow: var(--cx-shadow);
}

.dash-form-card label {
  display: block;
  margin-top: 16px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cx-muted);
}

.dash-form-card label:first-of-type {
  margin-top: 0;
}

.dash-form-card input,
.dash-form-card select,
.dash-form-card textarea {
  width: 100%;
  margin-top: 8px;
  padding: 11px 14px;
  border: 1px solid var(--cx-line-strong);
  border-radius: var(--cx-radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--cx-surface-2);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dash-form-card input:focus,
.dash-form-card select:focus,
.dash-form-card textarea:focus {
  outline: none;
  border-color: var(--cx-accent);
  box-shadow: 0 0 0 3px var(--cx-accent-glow);
  background: var(--cx-surface);
}

.dash-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--cx-ink-soft);
}

.dash-check input {
  width: auto;
  margin: 0;
}

.dash-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.dash-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  border-radius: var(--cx-radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s var(--cx-ease), box-shadow 0.15s var(--cx-ease);
}

.dash-btn:active {
  transform: scale(0.98);
}

.dash-btn--primary {
  background: linear-gradient(135deg, #14b8a6, var(--cx-accent-deep));
  color: #fff;
  box-shadow: 0 4px 16px var(--cx-accent-glow);
}

.dash-btn--primary:hover {
  box-shadow: 0 6px 24px var(--cx-accent-glow);
}

.dash-btn--ghost {
  background: var(--cx-surface);
  color: var(--cx-ink-soft);
  border: 1px solid var(--cx-line-strong);
}

.dash-flash {
  padding: 14px 18px;
  border-radius: var(--cx-radius-sm);
  margin-bottom: 18px;
  font-size: 0.9rem;
}

.dash-flash--ok {
  background: rgba(5, 150, 105, 0.1);
  color: var(--cx-success);
  border: 1px solid rgba(5, 150, 105, 0.25);
}

.dash-flash--err {
  background: rgba(225, 29, 72, 0.08);
  color: var(--cx-danger);
  border: 1px solid rgba(225, 29, 72, 0.22);
}

/* --- Feedback strip --- */
.feedback-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 999;
}

.feedback-footer--shell {
  left: var(--cx-sidebar-w);
  right: 0;
  width: auto;
  height: 68px;
  margin: 0;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, var(--cx-sidebar) 0%, #152038 50%, var(--cx-sidebar-2) 100%);
  color: var(--cx-sidebar-text);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 -8px 32px rgba(6, 10, 22, 0.2);
}

.feedback-slider {
  width: 100%;
  max-width: 720px;
  height: 100%;
  overflow: hidden;
}

.feedback-item {
  display: none;
  padding: 8px 12px;
  line-height: 1.45;
  text-align: center;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.92);
}

.feedback-item.active {
  display: block;
  animation: cxFade 0.45s var(--cx-ease);
}

@keyframes cxFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Legacy buttons (other pages / future) --- */
.cardex-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 22px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--cx-radius-sm);
  background: linear-gradient(135deg, #14b8a6, var(--cx-accent-deep));
  color: #fff;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--cx-accent-glow);
  transition: transform 0.18s var(--cx-ease), box-shadow 0.18s var(--cx-ease);
}

.cardex-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px var(--cx-accent-glow);
}

.cardex-btn.disabled {
  opacity: 0.45;
  pointer-events: none;
  box-shadow: none;
}

.announcement-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  padding: 12px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--cx-radius-sm);
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.account-btn {
  background: linear-gradient(135deg, #e11d48, #be123c);
  color: #fff;
  padding: 12px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--cx-radius-sm);
  text-decoration: none;
}

.change-btn {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

/* --- Responsive --- */
@media (max-width: 920px) {
  .dash-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .dash-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-102%);
    transition: transform 0.28s var(--cx-ease);
  }

  .dash-sidebar-overlay {
    display: none;
  }

  body.dash-sidebar-open .dash-sidebar {
    transform: translateX(0);
  }

  body.dash-sidebar-open .dash-sidebar-overlay {
    display: block;
  }

  .dash-main {
    padding-top: 72px;
    padding-bottom: 100px;
  }

  .feedback-footer--shell {
    left: 0;
  }
}

@media (max-width: 768px) {
  .dash-panels {
    grid-template-columns: 1fr;
  }

  .feedback-footer--shell {
    height: auto;
    min-height: 64px;
    padding: 10px 14px;
  }
}

/* =============================================================================
   User list page (user_list.php)
   ============================================================================= */

.dash-main--users {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  max-width: min(1320px, 100%);
  width: 100%;
  margin: 0 auto;
  padding: 12px clamp(12px, 2vw, 28px) 16px;
}

.dash-list-card--stretch {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.dash-list-pagehead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--cx-line);
  background: linear-gradient(180deg, var(--cx-surface) 0%, var(--cx-surface-2) 100%);
  flex-shrink: 0;
}

.dash-list-pagehead-text h1 {
  margin: 0 0 2px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--cx-ink);
  line-height: 1.2;
}

.dash-list-pagehead-meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--cx-muted);
  line-height: 1.4;
}

.dash-list-pagehead-meta strong {
  color: var(--cx-ink-soft);
  font-weight: 600;
}

.dash-list-pagehead-cta {
  flex-shrink: 0;
}

.dash-search--wide {
  width: 100%;
  max-width: 100%;
}

.dash-list-card--stretch .dash-list-toolbar {
  padding: 9px 18px;
  gap: 8px 14px;
  flex-shrink: 0;
}

.dash-list-card--stretch .dash-list-toolbar-left {
  flex: 1 1 200px;
  max-width: min(520px, 100%);
}

.dash-list-card--stretch .dash-filter-hint {
  margin-top: 3px;
  font-size: 0.7rem;
}

.dash-list-card--stretch .dash-table-scroll {
  flex: 1 1 auto;
  min-height: 180px;
  max-height: none;
  overflow: auto;
}

.dash-empty--in-card {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: 28px 20px;
  margin: 0;
  border: none;
  background: transparent;
}

.dash-list-card {
  background: var(--cx-surface);
  border: 1px solid var(--cx-line);
  border-radius: var(--cx-radius);
  box-shadow: var(--cx-shadow);
  overflow: hidden;
}

.dash-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--cx-line);
  background: linear-gradient(180deg, var(--cx-surface-2) 0%, var(--cx-surface) 100%);
}

.dash-list-toolbar-left {
  flex: 1;
  min-width: 200px;
  max-width: 400px;
}

.dash-list-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.dash-user-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--cx-ink-soft);
  white-space: nowrap;
}

.dash-user-count span {
  color: var(--cx-accent-deep);
}

.dash-filter-hint {
  font-size: 0.75rem;
  color: var(--cx-muted);
  margin-top: 6px;
}

.dash-table-scroll {
  overflow: auto;
  max-height: min(70vh, 720px);
  -webkit-overflow-scrolling: touch;
}

.dash-table--users {
  min-width: 860px;
  width: 100%;
}

.dash-table--users th,
.dash-table--users td {
  padding: 9px 12px;
  font-size: 0.8125rem;
}

.dash-table--users thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: 0 1px 0 var(--cx-line-strong);
  font-size: 0.72rem;
  padding-top: 8px;
  padding-bottom: 8px;
}

.dash-table--users tbody tr:nth-child(even) td {
  background: rgba(14, 165, 168, 0.03);
}

.dash-table--users tbody tr:hover td {
  background: rgba(14, 165, 168, 0.08);
}

.dash-table--users td:first-child,
.dash-table--users th:first-child {
  width: 48px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--cx-muted);
  font-weight: 600;
  font-size: 0.8rem;
}

.dash-table--users th.th-num {
  cursor: default;
  text-transform: none;
  letter-spacing: 0;
}

.dash-table--users th.th-sort {
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.dash-table--users th.th-sort:hover {
  color: var(--cx-accent-deep);
  background: rgba(14, 165, 168, 0.08);
}

.dash-table--users th.th-sort.is-sorted {
  color: var(--cx-accent-deep);
  background: rgba(14, 165, 168, 0.1);
}

.dash-table--users .col-email {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-table--users .col-name {
  font-weight: 600;
  color: var(--cx-ink);
}

.dash-table--users .col-user {
  font-family: var(--cx-mono);
  font-size: 0.82rem;
  font-weight: 500;
}

.dash-table--users .col-action {
  width: 100px;
  text-align: right;
}

.dash-btn-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 8px;
  text-decoration: none;
  background: rgba(14, 165, 168, 0.12);
  color: var(--cx-accent-deep);
  border: 1px solid rgba(14, 165, 168, 0.28);
  transition: background 0.15s ease, transform 0.15s ease;
}

.dash-btn-inline:hover {
  background: rgba(14, 165, 168, 0.2);
  transform: translateY(-1px);
}

.dash-badge-role {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.12);
  color: #4338ca;
  border: 1px solid rgba(99, 102, 241, 0.22);
}

.dash-badge-role--admin {
  background: rgba(14, 165, 168, 0.12);
  color: var(--cx-accent-deep);
  border-color: rgba(14, 165, 168, 0.25);
}

.dash-badge-role--super {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.3);
}

.dash-badge-status {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.dash-badge-status--active {
  background: rgba(5, 150, 105, 0.12);
  color: var(--cx-success);
  border: 1px solid rgba(5, 150, 105, 0.28);
}

.dash-badge-status--inactive {
  background: rgba(100, 116, 139, 0.12);
  color: var(--cx-muted);
  border: 1px solid var(--cx-line-strong);
}

.dash-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--cx-muted);
}

.dash-empty h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  color: var(--cx-ink-soft);
}

.dash-empty p {
  margin: 0;
  font-size: 0.9rem;
}

.dash-query-error {
  padding: 16px 20px;
  background: rgba(225, 29, 72, 0.08);
  border-bottom: 1px solid rgba(225, 29, 72, 0.2);
  color: var(--cx-danger);
  font-size: 0.88rem;
}

.dash-table--users th.th-sort.is-sorted--asc::after,
.dash-table--users th.th-sort.is-sorted--desc::after {
  font-size: 0.65em;
  margin-left: 4px;
  opacity: 0.85;
}

.dash-table--users th.th-sort.is-sorted--asc::after {
  content: "▲";
}

.dash-table--users th.th-sort.is-sorted--desc::after {
  content: "▼";
}

@media (max-width: 920px) {
  .dash-main--users {
    padding-bottom: 96px;
  }

  .dash-list-pagehead {
    flex-direction: column;
    align-items: stretch;
  }

  .dash-list-pagehead-cta {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .dash-list-card--stretch .dash-table-scroll {
    flex: none;
    min-height: 200px;
    max-height: min(56vh, 520px);
  }
}

/* --- General Cardex shell: full width main (no side gutter), flush to sidebar --- */
.dash-main.dash-main--fluid.gc-legacy-main {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 12px clamp(10px, 1.75vw, 22px) 72px;
  align-self: stretch;
}

@media (max-width: 920px) {
  .dash-main.dash-main--fluid.gc-legacy-main {
    padding-top: 70px;
    padding-bottom: 88px;
  }
}

/* --- General Cardex hub (general_cardex/index) --- */
.dash-main--fluid {
  max-width: min(1240px, 100%);
}

/* Home dashboard: use full main column width; compact top bar */
.dash-main--dashboard-wide.dash-main--fluid {
  max-width: none;
}

.dash-home-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  width: 100%;
  padding: 14px 20px;
  margin-bottom: 18px;
  background: var(--cx-elevated);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--cx-line);
  border-radius: var(--cx-radius);
  box-shadow: var(--cx-shadow);
}

.dash-home-topbar.gc-page-topbar {
  padding: 10px 14px;
  margin-bottom: 8px;
}

.dash-home-topbar__left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  flex: 1 1 auto;
}

.dash-home-topbar__logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 12px rgba(14, 165, 168, 0.2));
}

.dash-home-topbar__titles {
  min-width: 0;
}

.dash-home-topbar__company {
  margin: 0 0 4px;
  font-size: clamp(1rem, 2vw, 1.22rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--cx-ink);
  line-height: 1.25;
}

.dash-home-topbar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 0.85rem;
  color: var(--cx-muted);
}

.dash-home-topbar__hello strong {
  color: var(--cx-ink);
  font-weight: 600;
}

.dash-home-topbar__sep {
  color: var(--cx-line-strong);
  user-select: none;
}

.dash-home-topbar__dept {
  font-weight: 600;
  color: var(--cx-ink-soft);
}

.dash-home-topbar__tagline {
  margin: 0;
  flex: 0 1 min(440px, 100%);
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--cx-muted);
  text-align: right;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 720px) {
  .dash-home-topbar__tagline {
    text-align: left;
    flex-basis: 100%;
  }
}

.gc-announcement--below-topbar {
  margin: -6px 0 20px;
}

/* General Cardex shell: raise requisition etc. — extra tight top */
.dash-main.dash-main--fluid.gc-legacy-main.gc-main--content-tight {
  padding-bottom: 56px;
}

@media (min-width: 921px) {
  .dash-main.dash-main--fluid.gc-legacy-main.gc-main--content-tight {
    padding-top: 8px;
  }
}

@media (max-width: 920px) {
  .dash-main.dash-main--fluid.gc-legacy-main.gc-main--content-tight {
    padding-top: 64px;
  }
}

.gc-page-topbar {
  margin-bottom: 0;
}

.dash-form-card.dash-form-card--hub-wide {
  max-width: none;
  width: 100%;
  box-sizing: border-box;
}

.gc-stack {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.gc-section-title {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--cx-ink);
}

.gc-card-intro {
  margin: 0 0 14px;
  font-size: 0.88rem;
  color: var(--cx-muted);
  line-height: 1.55;
}

.gc-announcement {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: var(--cx-radius-sm);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.06));
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-left-width: 4px;
  border-left-color: var(--cx-warn);
}

.gc-announcement__text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--cx-ink-soft);
  line-height: 1.5;
}

.gc-table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gc-btn-compact {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.gc-btn-compact.is-busy,
.gc-btn-compact:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

body.hub-req-busy {
  overflow: hidden;
}

.hub-busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
}

body.hub-req-busy .hub-busy-overlay {
  display: flex;
}

.hub-busy-overlay__box {
  min-width: min(320px, 90vw);
  padding: 28px 32px;
  text-align: center;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.22);
}

.hub-busy-overlay__spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  border: 3px solid #e2e8f0;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: hub-busy-spin 0.75s linear infinite;
}

@keyframes hub-busy-spin {
  to {
    transform: rotate(360deg);
  }
}

.hub-busy-overlay__text {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #1e3a5f;
}

.hub-busy-overlay__hint {
  margin: 0;
  font-size: 0.82rem;
  color: #64748b;
}

.gc-row-warn td {
  background: rgba(225, 29, 72, 0.07) !important;
}

.gc-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.gc-status--Pending {
  background: rgba(245, 158, 11, 0.18);
  color: #b45309;
}

.gc-status--Approved {
  background: rgba(14, 165, 168, 0.15);
  color: var(--cx-accent-deep);
}

.gc-status--Issued {
  background: rgba(5, 150, 105, 0.15);
  color: var(--cx-success);
}

.gc-status--Other {
  background: var(--cx-surface-2);
  color: var(--cx-muted);
}

.gc-em-dash {
  color: var(--cx-muted);
  font-size: 0.85rem;
}

.gc-feedback-actions {
  margin-top: 16px;
}

.gc-feedback {
  max-width: 560px;
}

.gc-hero-compact .dash-hero-logo {
  height: 64px;
}

@media (max-width: 900px) {
  .gc-table-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

/* --- Register / account forms in shell --- */
.dash-register-page {
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}

.dash-register-card .dash-register-title {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--cx-ink);
}

.dash-register-lead {
  margin: 0 0 18px;
  font-size: 0.88rem;
}

.dash-register-card .dash-form-actions {
  margin-top: 8px;
}

/* --- Home hub: low stock slideshow (above feedback) --- */
.dash-low-stock-show {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #fffefb 0%, #fff 38%, #f8fafc 100%);
  border: 1px solid rgba(225, 29, 72, 0.12);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.06);
}

.dash-low-stock-show__head {
  position: relative;
  z-index: 1;
}

.dash-low-stock-show__empty {
  padding: 28px 20px;
  text-align: center;
  color: var(--cx-muted);
  font-size: 0.95rem;
  background: var(--cx-surface-2);
  border-radius: var(--cx-radius-sm);
  border: 1px dashed rgba(12, 18, 34, 0.12);
}

.dash-low-stock-show__chrome {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0;
  align-items: stretch;
  min-height: 220px;
}

.dash-low-stock-show__viewport {
  position: relative;
  min-height: 220px;
  border-radius: var(--cx-radius-sm);
  background: var(--cx-surface);
  border: 1px solid var(--cx-line);
  overflow: hidden;
}

.dash-low-stock-slide {
  position: absolute;
  inset: 0;
  padding: 0;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateX(12px);
  transition: opacity 0.45s var(--cx-ease), transform 0.45s var(--cx-ease), visibility 0s linear 0.45s;
  display: flex;
  flex-direction: column;
}

.dash-low-stock-slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition: opacity 0.45s var(--cx-ease), transform 0.45s var(--cx-ease), visibility 0s linear 0s;
  z-index: 1;
}

.dash-low-stock-slide__accent {
  height: 5px;
  background: linear-gradient(90deg, #f43f5e, #f97316, #fbbf24);
  flex-shrink: 0;
}

.dash-low-stock-slide__body {
  padding: 18px 22px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dash-low-stock-slide__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dash-low-stock-slide__code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #be123c;
  background: rgba(244, 63, 94, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
}

.dash-low-stock-slide__link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--cx-accent-deep);
  text-decoration: none;
}

.dash-low-stock-slide__link:hover {
  text-decoration: underline;
}

.dash-low-stock-slide__name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--cx-ink);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.dash-low-stock-slide__spec {
  margin: 0;
  font-size: 0.84rem;
  color: var(--cx-muted);
  line-height: 1.45;
}

.dash-low-stock-slide__metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px 16px;
  margin: 6px 0 0;
  padding: 12px 14px;
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.dash-low-stock-slide__metrics div {
  margin: 0;
}

.dash-low-stock-slide__metrics dt {
  margin: 0 0 2px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

.dash-low-stock-slide__metrics dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--cx-ink);
}

.dash-low-stock-slide__dd--warn {
  color: #c2410c !important;
}

.dash-low-stock-slide__dd--alert {
  color: #b91c1c !important;
}

.dash-low-stock-slide__bar {
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-top: 4px;
}

.dash-low-stock-slide__bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f43f5e, #fb923c);
  transition: width 0.5s var(--cx-ease);
}

.dash-low-stock-slide__bar-caption {
  margin: 0;
  font-size: 0.78rem;
  color: var(--cx-muted);
}

.dash-low-stock-show__arrow {
  align-self: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  margin: 0 6px;
  border: none;
  border-radius: 12px;
  background: var(--cx-surface-2);
  color: var(--cx-ink);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}

.dash-low-stock-show__arrow:hover {
  background: #1e3a5f;
  color: #fff;
}

.dash-low-stock-show__arrow:active {
  transform: scale(0.96);
}

.dash-low-stock-show__dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.dash-low-stock-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: #cbd5e1;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.dash-low-stock-dot:hover {
  background: #94a3b8;
  transform: scale(1.15);
}

.dash-low-stock-dot.is-active {
  background: linear-gradient(135deg, #f43f5e, #f97316);
  transform: scale(1.25);
}

@media (max-width: 720px) {
  .dash-low-stock-show__chrome {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .dash-low-stock-show__arrow {
    display: none;
  }

  .dash-low-stock-show__viewport {
    min-height: 260px;
  }

  .dash-low-stock-slide__metrics {
    grid-template-columns: 1fr 1fr;
  }
}

/* Module switcher + picker (unified portal) */
.cx-module-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 20px;
  flex-wrap: wrap;
}
.cx-module-tabs__btn {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--cx-ink-soft);
  background: var(--cx-surface);
  border: 1px solid var(--cx-line-strong);
}
.cx-module-tabs__btn.is-active {
  background: var(--cx-accent);
  color: #fff;
  border-color: var(--cx-accent);
}
.cx-mod-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 6px;
  margin-right: 8px;
  vertical-align: middle;
}
.cx-mod-badge--gen { background: #dbeafe; color: #1e40af; }
.cx-mod-badge--eng { background: #ffedd5; color: #c2410c; }
.cx-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.cx-picker-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px;
  border-radius: var(--cx-radius);
  border: 1px solid var(--cx-line-strong);
  background: var(--cx-surface);
  text-decoration: none;
  color: var(--cx-ink);
  transition: box-shadow 0.2s var(--cx-ease), border-color 0.2s;
}
.cx-picker-card:hover {
  box-shadow: var(--cx-shadow-hover);
  border-color: var(--cx-accent);
}
.cx-picker-card__icon { font-size: 1.8rem; }
.dash-main .form-panel {
  background: var(--cx-surface);
  border-radius: var(--cx-radius);
  box-shadow: var(--cx-shadow);
  padding: 28px 32px;
  max-width: none;
}
