/* ============================================================================
   WMD Cloud — dashboard.css
   Design system for the admin dashboard (CONTRACTS.md §7).
   Native CSS, no dependencies. Mobile-first: base = mobile, min-width queries
   enhance upward; the 260px sidebar is a slide-over < 1024px.

   Class taxonomy (prefix wmd-):
     layout    wmd-shell / wmd-sidebar / wmd-main / wmd-topbar / wmd-content /
               wmd-footer / wmd-scrim / wmd-menu-btn
     blocks    wmd-brand(__logo/__name/__sub) wmd-nav wmd-nav-item wmd-sidebar-foot
               wmd-page-title wmd-account-form wmd-account-label wmd-topbar-right
               wmd-user-chip(__name/__role) wmd-status-dot wmd-logout-form
     components wmd-card(__head/__title/__sub/__body/__foot) wmd-stat-grid
               wmd-stat-card(__icon/__value/__label/__delta) wmd-btn(-primary/
               -ghost/-danger/-outline-danger/-sm/-lg/-block/-icon)(.is-loading)
               wmd-table(wrap) wmd-pill(-green/-amber/-red/-gray/-blue) wmd-badge
               wmd-form wmd-label wmd-input wmd-select wmd-textarea wmd-help
               wmd-error wmd-field wmd-check wmd-modal(__overlay/__panel/__head/
               __title/__close/__body/__foot) wmd-toast wmd-alert(-info/-success/
               -warn/-error) wmd-tabs wmd-tab wmd-searchbar wmd-pagination
               wmd-empty wmd-skeleton wmd-bars wmd-sequence-list wmd-progress
               wmd-uploader wmd-dropdown wmd-kv wmd-login-page
   ========================================================================== */

/* ----------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  --wmd-bg: #f6f7f9;
  --wmd-surface: #ffffff;
  --wmd-sidebar: #101828;
  --wmd-sidebar-active: rgba(16, 185, 129, .15);
  --wmd-accent: #10b981;
  --wmd-accent-strong: #059669;
  --wmd-text: #101828;
  --wmd-muted: #667085;
  --wmd-border: #e4e7ec;
  --wmd-danger: #dc2626;
  --wmd-amber: #d97706;
  --wmd-blue: #2563eb;

  --wmd-radius: 12px;
  --wmd-radius-sm: 8px;
  --wmd-radius-lg: 16px;
  --wmd-radius-pill: 999px;

  --wmd-shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --wmd-shadow-md: 0 4px 12px rgba(16, 24, 40, .08);
  --wmd-shadow-lg: 0 12px 32px rgba(16, 24, 40, .16);

  --wmd-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
              "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --wmd-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
              "Liberation Mono", monospace;

  --wmd-focus-ring: 0 0 0 3px rgba(16, 185, 129, .22);
  --wmd-danger-ring: 0 0 0 3px rgba(220, 38, 38, .15);

  --wmd-sidebar-w: 260px;
  --wmd-topbar-h: 60px;
  --wmd-ease: 180ms ease;
}

/* ----------------------------------------------------------------------------
   2. Reset-ish base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--wmd-font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--wmd-text);
  background: var(--wmd-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5 { margin: 0 0 .5em; line-height: 1.3; letter-spacing: -.01em; }
h1 { font-size: 20px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 600; }
h4 { font-size: 14px; font-weight: 600; }
h5 { font-size: 13px; font-weight: 600; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--wmd-accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg, video { max-width: 100%; }
img { height: auto; vertical-align: middle; }

button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
ul, ol { margin: 0 0 1em; padding-left: 1.4em; }
dl, dt, dd { margin: 0; }

code, kbd, pre { font-family: var(--wmd-mono); font-size: .92em; }
code { background: #f2f4f7; border: 1px solid var(--wmd-border); border-radius: 6px; padding: 1px 5px; }
pre { background: #f9fafb; border: 1px solid var(--wmd-border); border-radius: var(--wmd-radius-sm); padding: 12px; overflow-x: auto; }
pre code { background: none; border: 0; padding: 0; }

table { border-collapse: collapse; }
hr { border: 0; border-top: 1px solid var(--wmd-border); margin: 20px 0; }

:focus-visible { outline: 2px solid var(--wmd-accent); outline-offset: 2px; }

/* Body scroll lock while a modal / mobile nav is open (toggled by dashboard.js) */
body.wmd-no-scroll { overflow: hidden !important; }

/* ----------------------------------------------------------------------------
   3. Utilities
   -------------------------------------------------------------------------- */
.wmd-flex   { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wmd-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wmd-stack  { display: flex; flex-direction: column; gap: 14px; }
.wmd-grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }

.wmd-text-muted   { color: var(--wmd-muted); }
.wmd-text-danger  { color: var(--wmd-danger); }
.wmd-text-success { color: var(--wmd-accent-strong); }
.wmd-mono         { font-family: var(--wmd-mono); font-size: 12.5px; }
.wmd-truncate     { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wmd-mt-sm { margin-top: 8px; }
.wmd-mt-md { margin-top: 16px; }
.wmd-mb-sm { margin-bottom: 8px; }
.wmd-mb-md { margin-bottom: 16px; }

.wmd-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.wmd-icon { flex-shrink: 0; }

/* Generic scrollable panel (activity lists etc.) */
.wmd-scroll { overflow-y: auto; overscroll-behavior: contain; }
.wmd-scroll-sm { max-height: 320px; }
.wmd-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.wmd-scroll::-webkit-scrollbar-track { background: transparent; }
.wmd-scroll::-webkit-scrollbar-thumb { background: #d0d5dd; border-radius: 8px; }
.wmd-scroll::-webkit-scrollbar-thumb:hover { background: #98a2b3; }
.wmd-scroll { scrollbar-width: thin; scrollbar-color: #d0d5dd transparent; }

/* ----------------------------------------------------------------------------
   4. Shell layout (mobile-first)
   -------------------------------------------------------------------------- */
.wmd-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar: fixed 260px, dark, slide-over < 1024px */
.wmd-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 50;
  width: var(--wmd-sidebar-w);
  display: flex;
  flex-direction: column;
  background: var(--wmd-sidebar);
  color: rgba(255, 255, 255, .82);
  transform: translateX(-100%);
  transition: transform 200ms ease;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .18) transparent;
}
.wmd-sidebar::-webkit-scrollbar { width: 8px; }
.wmd-sidebar::-webkit-scrollbar-track { background: transparent; }
.wmd-sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 8px; }
.wmd-sidebar.is-open {
  transform: translateX(0);
  box-shadow: var(--wmd-shadow-lg);
}

/* Scrim behind the mobile slide-over */
.wmd-scrim {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(16, 24, 40, .55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease, visibility 200ms ease;
}
.wmd-scrim.is-open { opacity: 1; visibility: visible; }

/* Main column: fills the rest, footer sticks to bottom */
.wmd-main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 100vh;
}

.wmd-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  min-height: var(--wmd-topbar-h);
  padding: 8px 16px;
  background: var(--wmd-surface);
  border-bottom: 1px solid var(--wmd-border);
}

.wmd-content {
  flex: 1 1 auto;
  width: 100%;
  padding: 16px;
}

.wmd-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 14px 16px;
  border-top: 1px solid var(--wmd-border);
  color: var(--wmd-muted);
  font-size: 12.5px;
}

@media (min-width: 768px) {
  .wmd-content { padding: 20px 24px; }
  .wmd-topbar { padding: 10px 20px; }
  .wmd-footer { padding: 14px 20px; }
  h1 { font-size: 22px; }
}

@media (min-width: 1024px) {
  .wmd-sidebar { transform: translateX(0); box-shadow: none; }
  .wmd-scrim { display: none; }
  .wmd-menu-btn { display: none; }
  .wmd-main { margin-left: var(--wmd-sidebar-w); }
  .wmd-content { padding: 24px 28px; }
}

/* ----------------------------------------------------------------------------
   5. Sidebar internals
   -------------------------------------------------------------------------- */
.wmd-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.wmd-brand__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--wmd-accent), var(--wmd-accent-strong));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 4px 10px rgba(16, 185, 129, .35);
}
.wmd-brand__text { min-width: 0; }
.wmd-brand__name {
  display: block;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: #fff;
  line-height: 1.25;
}
.wmd-brand__sub {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, .55);
  line-height: 1.3;
}

.wmd-nav {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px;
  overflow-y: auto;
}

.wmd-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: rgba(255, 255, 255, .72);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--wmd-ease), color var(--wmd-ease);
}
.wmd-nav-item svg { flex-shrink: 0; }
.wmd-nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.wmd-nav-item.is-active {
  background: var(--wmd-sidebar-active);
  color: #fff;
  font-weight: 600;
}
.wmd-nav-item.is-active svg { color: var(--wmd-accent); }

.wmd-sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.wmd-sidebar-foot .wmd-nav-item { font-size: 13px; }
.wmd-logout-form { margin: 0; }

/* Ghost buttons inside the dark sidebar */
.wmd-sidebar .wmd-btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, .16);
  color: rgba(255, 255, 255, .78);
}
.wmd-sidebar .wmd-btn-ghost:hover {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .28);
  color: #fff;
}

/* ----------------------------------------------------------------------------
   6. Topbar pieces
   -------------------------------------------------------------------------- */
.wmd-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  flex-shrink: 0;
  border: 1px solid var(--wmd-border);
  border-radius: 10px;
  background: var(--wmd-surface);
  color: var(--wmd-text);
  transition: background var(--wmd-ease), border-color var(--wmd-ease);
}
.wmd-menu-btn:hover { background: #f2f4f7; border-color: #d0d5dd; }
.wmd-menu-btn svg { width: 20px; height: 20px; }

.wmd-page-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (min-width: 768px) { .wmd-page-title { font-size: 17px; } }

.wmd-account-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.wmd-account-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--wmd-muted);
  white-space: nowrap;
}
.wmd-account-form .wmd-select {
  width: auto;
  min-width: 150px;
  max-width: 240px;
}

.wmd-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.wmd-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 10px;
  background: #f2f4f7;
  border: 1px solid var(--wmd-border);
  border-radius: var(--wmd-radius-pill);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.wmd-user-chip__role {
  padding-left: 8px;
  border-left: 1px solid var(--wmd-border);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--wmd-muted);
  text-transform: capitalize;
}

.wmd-status-dot {
  width: 8px; height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--wmd-accent);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .18);
  animation: wmd-pulse 2.6s ease-in-out infinite;
}

@media (max-width: 639.98px) {
  .wmd-account-label { display: none; }
  .wmd-user-chip__role { display: none; }
  .wmd-account-form { order: 3; width: 100%; }
  .wmd-account-form .wmd-select { flex: 1 1 auto; max-width: none; }
}

/* ----------------------------------------------------------------------------
   7. Buttons
   -------------------------------------------------------------------------- */
.wmd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--wmd-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background var(--wmd-ease), border-color var(--wmd-ease),
              color var(--wmd-ease), box-shadow var(--wmd-ease),
              transform var(--wmd-ease);
}
.wmd-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.wmd-btn:hover { text-decoration: none; }
.wmd-btn:active { transform: translateY(1px); }

.wmd-btn-primary { background: var(--wmd-accent); color: #fff; box-shadow: var(--wmd-shadow-sm); }
.wmd-btn-primary:hover { background: var(--wmd-accent-strong); }

.wmd-btn-ghost { background: var(--wmd-surface); border-color: var(--wmd-border); color: var(--wmd-text); }
.wmd-btn-ghost:hover { background: #f9fafb; border-color: #d0d5dd; }

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

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

.wmd-btn-sm { padding: 6px 12px; font-size: 13px; border-radius: var(--wmd-radius-sm); }
.wmd-btn-sm svg { width: 14px; height: 14px; }
.wmd-btn-lg { padding: 12px 22px; font-size: 15px; border-radius: var(--wmd-radius); }
.wmd-btn-block { display: flex; width: 100%; }
.wmd-btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: 10px;
  justify-content: center;
}

.wmd-btn:disabled,
.wmd-btn[aria-disabled="true"] {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Loading state: label hidden, spinner overlay */
.wmd-btn.is-loading { position: relative; pointer-events: none; color: transparent; }
.wmd-btn.is-loading svg { opacity: 0; }
.wmd-btn.is-loading::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 16px; height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: wmd-spin .7s linear infinite;
}
.wmd-btn-ghost.is-loading::after,
.wmd-btn-outline-danger.is-loading::after {
  border-color: rgba(16, 24, 40, .18);
  border-top-color: var(--wmd-text);
}

/* Password reveal toggles (svgs come from wmd_icon('eye') / wmd_icon('eye-off')) */
[data-toggle-password] .wmd-icon-eye-off { display: none; }
[data-toggle-password].is-visible .wmd-icon-eye { display: none; }
[data-toggle-password].is-visible .wmd-icon-eye-off { display: inline-flex; }

/* ----------------------------------------------------------------------------
   8. Cards & stat grid
   -------------------------------------------------------------------------- */
.wmd-card {
  background: var(--wmd-surface);
  border: 1px solid var(--wmd-border);
  border-radius: var(--wmd-radius);
  box-shadow: var(--wmd-shadow-sm);
}
.wmd-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--wmd-border);
}
.wmd-card-title { margin: 0; font-size: 15px; font-weight: 600; }
.wmd-card-sub { margin: 2px 0 0; font-size: 12.5px; color: var(--wmd-muted); }
.wmd-card-body { padding: 18px 20px; }
.wmd-card-body > :first-child { margin-top: 0; }
.wmd-card-body > :last-child { margin-bottom: 0; }
.wmd-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 14px 20px;
  border-top: 1px solid var(--wmd-border);
}

.wmd-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.wmd-stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  background: var(--wmd-surface);
  border: 1px solid var(--wmd-border);
  border-radius: var(--wmd-radius);
  box-shadow: var(--wmd-shadow-sm);
}
.wmd-stat-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  flex-shrink: 0;
  border-radius: 11px;
  background: rgba(16, 185, 129, .12);
  color: var(--wmd-accent-strong);
}
.wmd-stat-card__icon svg { width: 20px; height: 20px; }
.wmd-stat-card__body { min-width: 0; }
.wmd-stat-card__value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.wmd-stat-card__label {
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--wmd-muted);
}
.wmd-stat-card__delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
}
.wmd-stat-card__delta-up   { color: var(--wmd-accent-strong); }
.wmd-stat-card__delta-down { color: var(--wmd-danger); }
.wmd-stat-card__delta-flat { color: var(--wmd-muted); }

.wmd-stat-card-green .wmd-stat-card__icon { background: rgba(16, 185, 129, .12); color: var(--wmd-accent-strong); }
.wmd-stat-card-amber .wmd-stat-card__icon { background: rgba(217, 119, 6, .12);  color: var(--wmd-amber); }
.wmd-stat-card-red   .wmd-stat-card__icon { background: rgba(220, 38, 38, .12);  color: var(--wmd-danger); }
.wmd-stat-card-blue  .wmd-stat-card__icon { background: rgba(37, 99, 235, .12); color: var(--wmd-blue); }
.wmd-stat-card-gray  .wmd-stat-card__icon { background: #f2f4f7; color: #475467; }

/* ----------------------------------------------------------------------------
   9. Tables
   -------------------------------------------------------------------------- */
.wmd-table-wrap {
  background: var(--wmd-surface);
  border: 1px solid var(--wmd-border);
  border-radius: var(--wmd-radius);
  box-shadow: var(--wmd-shadow-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
/* Optional vertical scroll region: sticky thead kicks in */
.wmd-table-wrap.is-scrollable { max-height: 460px; overflow-y: auto; }

.wmd-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 13.5px;
}
.wmd-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 14px;
  background: #f9fafb;
  border-bottom: 1px solid var(--wmd-border);
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--wmd-muted);
  white-space: nowrap;
}
.wmd-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--wmd-border);
  vertical-align: middle;
}
.wmd-table tbody tr { transition: background var(--wmd-ease); }
.wmd-table tbody tr:hover { background: #f9fafb; }
.wmd-table tbody tr:last-child td { border-bottom: 0; }

/* Sortable headers (dashboard.js toggles .is-asc / .is-desc) */
.wmd-table th[data-sort] { cursor: pointer; user-select: none; }
.wmd-table th[data-sort]:hover { color: var(--wmd-text); background: #f2f4f7; }
.wmd-table th[data-sort]::after { content: "\2195"; margin-left: 6px; font-size: 11px; opacity: .45; }
.wmd-table th.is-asc::after  { content: "\2191"; opacity: 1; color: var(--wmd-accent-strong); }
.wmd-table th.is-desc::after { content: "\2193"; opacity: 1; color: var(--wmd-accent-strong); }

/* < 720px: rows stack with data-label headers (dashboard.js fills data-label
   automatically from the thead) */
@media (max-width: 719.98px) {
  .wmd-table { min-width: 0; }
  .wmd-table-wrap { overflow: visible; }
  .wmd-table thead {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0; border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .wmd-table tbody,
  .wmd-table tr,
  .wmd-table td { display: block; width: 100%; }
  .wmd-table tr { padding: 6px 0; border-bottom: 1px solid var(--wmd-border); }
  .wmd-table tr:last-child { border-bottom: 0; }
  .wmd-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 7px 14px;
    border-bottom: 0;
    text-align: right;
  }
  .wmd-table td::before {
    content: attr(data-label);
    flex-shrink: 0;
    max-width: 45%;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--wmd-muted);
    overflow-wrap: anywhere;
  }
  .wmd-table td:not([data-label])::before,
  .wmd-table td[data-label=""]::before { display: none; }
}

/* ----------------------------------------------------------------------------
   10. Pills & badges
   -------------------------------------------------------------------------- */
.wmd-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border: 1px solid transparent;
  border-radius: var(--wmd-radius-pill);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.65;
  white-space: nowrap;
}
.wmd-pill::before {
  content: "";
  width: 6px; height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: currentColor;
}
.wmd-pill-green { background: #ecfdf3; color: #067647; border-color: #abefc6; }
.wmd-pill-amber { background: #fffaeb; color: #b54708; border-color: #fedf89; }
.wmd-pill-red   { background: #fef3f2; color: #b42318; border-color: #fecdca; }
.wmd-pill-gray  { background: #f2f4f7; color: #475467; border-color: var(--wmd-border); }
.wmd-pill-blue  { background: #eff8ff; color: #175cd3; border-color: #b2ddff; }

.wmd-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--wmd-border);
  border-radius: 6px;
  background: #f2f4f7;
  color: #344054;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.65;
  white-space: nowrap;
}
.wmd-badge-green { background: #ecfdf3; color: #067647; border-color: #abefc6; }
.wmd-badge-amber { background: #fffaeb; color: #b54708; border-color: #fedf89; }
.wmd-badge-red   { background: #fef3f2; color: #b42318; border-color: #fecdca; }
.wmd-badge-blue  { background: #eff8ff; color: #175cd3; border-color: #b2ddff; }
.wmd-badge-gray  { background: #f2f4f7; color: #475467; border-color: var(--wmd-border); }

/* ----------------------------------------------------------------------------
   11. Forms
   -------------------------------------------------------------------------- */
.wmd-field { margin-bottom: 16px; }
.wmd-field:last-child { margin-bottom: 0; }

.wmd-form-row { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 16px; }
.wmd-form-row:last-child { margin-bottom: 0; }

.wmd-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--wmd-text);
}

.wmd-input,
.wmd-select,
.wmd-textarea {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  background: var(--wmd-surface);
  color: var(--wmd-text);
  font-size: 14px;
  line-height: 1.45;
  transition: border-color var(--wmd-ease), box-shadow var(--wmd-ease), background var(--wmd-ease);
}
.wmd-textarea { min-height: 90px; resize: vertical; }
.wmd-input::placeholder,
.wmd-textarea::placeholder { color: #98a2b3; }

.wmd-input:focus,
.wmd-select:focus,
.wmd-textarea:focus {
  outline: none;
  border-color: var(--wmd-accent);
  box-shadow: var(--wmd-focus-ring);
}

.wmd-input:disabled,
.wmd-select:disabled,
.wmd-textarea:disabled {
  background: #f2f4f7;
  color: var(--wmd-muted);
  cursor: not-allowed;
  box-shadow: none;
}
.wmd-input[readonly],
.wmd-textarea[readonly] { background: #f9fafb; }

.wmd-input.is-invalid,
.wmd-select.is-invalid,
.wmd-textarea.is-invalid { border-color: var(--wmd-danger); }
.wmd-input.is-invalid:focus,
.wmd-select.is-invalid:focus,
.wmd-textarea.is-invalid:focus { border-color: var(--wmd-danger); box-shadow: var(--wmd-danger-ring); }

.wmd-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.wmd-select-sm { width: auto; padding: 6px 30px 6px 10px; font-size: 13px; border-radius: var(--wmd-radius-sm); }

.wmd-help { margin-top: 6px; font-size: 12.5px; color: var(--wmd-muted); }
.wmd-error { margin-top: 6px; font-size: 12.5px; font-weight: 500; color: var(--wmd-danger); }

input[type="checkbox"],
input[type="radio"] {
  width: 16px; height: 16px;
  accent-color: var(--wmd-accent);
}
.wmd-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
}

@media (min-width: 640px) {
  .wmd-form-row-2 { grid-template-columns: repeat(2, 1fr); }
  .wmd-form-row-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ----------------------------------------------------------------------------
   12. Modal
   -------------------------------------------------------------------------- */
.wmd-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.wmd-modal.is-open { display: flex; }

.wmd-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(16, 24, 40, .55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: wmd-fade-in .18s ease;
}

.wmd-modal__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 520px;
  max-height: min(85vh, 720px);
  background: var(--wmd-surface);
  border-radius: var(--wmd-radius-lg);
  box-shadow: var(--wmd-shadow-lg);
  overflow: hidden;
  animation: wmd-modal-in .18s ease;
}
.wmd-modal__panel--wide { max-width: 720px; }
.wmd-modal__panel--sm   { max-width: 400px; }

.wmd-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  padding: 16px 20px;
  border-bottom: 1px solid var(--wmd-border);
}
.wmd-modal__title { margin: 0; font-size: 15.5px; font-weight: 600; }
.wmd-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  flex-shrink: 0;
  border-radius: var(--wmd-radius-sm);
  color: var(--wmd-muted);
  transition: background var(--wmd-ease), color var(--wmd-ease);
}
.wmd-modal__close:hover { background: #f2f4f7; color: var(--wmd-text); }
.wmd-modal__close svg { width: 18px; height: 18px; }

.wmd-modal__body {
  padding: 18px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.wmd-modal__body > :first-child { margin-top: 0; }
.wmd-modal__body > :last-child { margin-bottom: 0; }

.wmd-modal__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  padding: 14px 20px;
  border-top: 1px solid var(--wmd-border);
  background: #f9fafb;
}
.wmd-modal__foot .wmd-btn-danger { margin-left: auto; }

.wmd-confirm-msg { font-size: 14px; }

/* ----------------------------------------------------------------------------
   13. Toasts
   -------------------------------------------------------------------------- */
.wmd-toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.wmd-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: #101828;
  color: #f2f4f7;
  border-left: 3px solid var(--wmd-blue);
  border-radius: 10px;
  box-shadow: var(--wmd-shadow-lg);
  font-size: 13.5px;
  pointer-events: auto;
  animation: wmd-toast-in .2s ease;
}
.wmd-toast__icon { display: inline-flex; flex-shrink: 0; margin-top: 1px; }
.wmd-toast__icon svg { width: 18px; height: 18px; }
.wmd-toast__msg { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.wmd-toast__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  flex-shrink: 0;
  border-radius: 6px;
  color: rgba(255, 255, 255, .6);
  transition: background var(--wmd-ease), color var(--wmd-ease);
}
.wmd-toast__close:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.wmd-toast__close svg { width: 14px; height: 14px; }

.wmd-toast-success { border-left-color: var(--wmd-accent); }
.wmd-toast-success .wmd-toast__icon { color: var(--wmd-accent); }
.wmd-toast-error { border-left-color: var(--wmd-danger); }
.wmd-toast-error .wmd-toast__icon { color: #f87171; }
.wmd-toast-info { border-left-color: var(--wmd-blue); }
.wmd-toast-info .wmd-toast__icon { color: #60a5fa; }

.wmd-toast.is-leaving { animation: wmd-toast-out .22s ease forwards; }

/* ----------------------------------------------------------------------------
   14. Alerts
   -------------------------------------------------------------------------- */
.wmd-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--wmd-border);
  border-radius: 10px;
  background: #f9fafb;
  color: var(--wmd-text);
  font-size: 13.5px;
}
.wmd-alert__icon { display: inline-flex; flex-shrink: 0; margin-top: 1px; }
.wmd-alert__icon svg { width: 17px; height: 17px; }
.wmd-alert__content { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }

.wmd-alert-info    { background: #eff8ff; border-color: #b2ddff; color: #175cd3; }
.wmd-alert-success { background: #ecfdf3; border-color: #abefc6; color: #067647; }
.wmd-alert-warn    { background: #fffaeb; border-color: #fedf89; color: #b54708; }
.wmd-alert-error   { background: #fef3f2; border-color: #fecdca; color: #b42318; }

/* ----------------------------------------------------------------------------
   15. Tabs
   -------------------------------------------------------------------------- */
.wmd-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--wmd-border);
  overflow-x: auto;
}
.wmd-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--wmd-muted);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: color var(--wmd-ease), border-color var(--wmd-ease);
}
.wmd-tab:hover { color: var(--wmd-text); text-decoration: none; }
.wmd-tab.is-active { color: var(--wmd-accent-strong); border-bottom-color: var(--wmd-accent); }

/* ----------------------------------------------------------------------------
   16. Searchbar
   -------------------------------------------------------------------------- */
.wmd-searchbar {
  position: relative;
  width: 100%;
  max-width: 340px;
}
.wmd-searchbar > .wmd-icon,
.wmd-searchbar > svg {
  position: absolute;
  top: 50%;
  left: 11px;
  width: 16px; height: 16px;
  transform: translateY(-50%);
  color: #98a2b3;
  pointer-events: none;
}
.wmd-searchbar .wmd-input { padding-left: 36px; }

/* ----------------------------------------------------------------------------
   17. Pagination
   -------------------------------------------------------------------------- */
.wmd-pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}
.wmd-pagination__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--wmd-border);
  border-radius: var(--wmd-radius-sm);
  background: var(--wmd-surface);
  color: var(--wmd-text);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--wmd-ease), border-color var(--wmd-ease), color var(--wmd-ease);
}
.wmd-pagination__item:hover { background: #f9fafb; border-color: #d0d5dd; text-decoration: none; }
.wmd-pagination__item.is-current {
  background: var(--wmd-accent);
  border-color: var(--wmd-accent);
  color: #fff;
  font-weight: 600;
}
.wmd-pagination__item.is-disabled {
  opacity: .45;
  cursor: not-allowed;
}
.wmd-pagination__ellipsis { padding: 0 2px; color: var(--wmd-muted); }

/* ----------------------------------------------------------------------------
   18. Empty states
   -------------------------------------------------------------------------- */
.wmd-empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--wmd-muted);
}
.wmd-empty__icon {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
  color: #98a2b3;
}
.wmd-empty__icon svg { width: 40px; height: 40px; }
.wmd-empty__title { margin: 0 0 4px; font-size: 15px; font-weight: 600; color: var(--wmd-text); }
.wmd-empty__message { margin: 0 auto; max-width: 46ch; font-size: 13.5px; }

/* ----------------------------------------------------------------------------
   19. Skeletons
   -------------------------------------------------------------------------- */
.wmd-skeleton {
  position: relative;
  display: block;
  height: 14px;
  overflow: hidden;
  background: #eaecf0;
  border-radius: var(--wmd-radius-sm);
}
.wmd-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65), transparent);
  animation: wmd-shimmer 1.5s infinite;
}
.wmd-skeleton--title  { height: 20px; width: 40%; }
.wmd-skeleton--text   { height: 12px; }
.wmd-skeleton--card   { height: 120px; border-radius: var(--wmd-radius); }
.wmd-skeleton--circle { width: 42px; height: 42px; border-radius: 50%; }

/* ----------------------------------------------------------------------------
   20. Bar charts (SVG rendered by Wmd.barChart)
   -------------------------------------------------------------------------- */
.wmd-bars { width: 100%; }
.wmd-bars svg { display: block; width: 100%; height: auto; }
.wmd-bars .wmd-bar { fill: var(--wmd-accent); transition: fill 150ms ease, opacity 150ms ease; }
.wmd-bars .wmd-bar:hover { fill: var(--wmd-accent-strong); }
.wmd-bars text { font-family: var(--wmd-font); font-size: 10.5px; fill: var(--wmd-muted); }
.wmd-bars .wmd-grid-line { stroke: var(--wmd-border); stroke-width: 1; }
.wmd-bars .wmd-bar-xlabel { font-size: 10px; }

/* ----------------------------------------------------------------------------
   21. Sequence list (numbered media order + reorder buttons)
   -------------------------------------------------------------------------- */
.wmd-sequence-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.wmd-sequence-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--wmd-surface);
  border: 1px solid var(--wmd-border);
  border-radius: 10px;
  transition: border-color var(--wmd-ease), box-shadow var(--wmd-ease), opacity var(--wmd-ease);
}
.wmd-sequence-item:hover { border-color: #d0d5dd; box-shadow: var(--wmd-shadow-sm); }
.wmd-sequence-item.is-saving { opacity: .6; pointer-events: none; }

.wmd-sequence-item__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(16, 185, 129, .12);
  color: var(--wmd-accent-strong);
  font-size: 12.5px;
  font-weight: 700;
}
.wmd-sequence-item__body { flex: 1 1 auto; min-width: 0; }
.wmd-sequence-item__title {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wmd-sequence-item__meta { margin-top: 1px; font-size: 12px; color: var(--wmd-muted); }
.wmd-sequence-item__actions { display: flex; gap: 4px; flex-shrink: 0; }

.wmd-move-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border: 1px solid var(--wmd-border);
  border-radius: var(--wmd-radius-sm);
  background: var(--wmd-surface);
  color: var(--wmd-muted);
  transition: background var(--wmd-ease), border-color var(--wmd-ease), color var(--wmd-ease);
}
.wmd-move-btn svg { width: 14px; height: 14px; }
.wmd-move-btn:hover:not(:disabled) { background: #f9fafb; border-color: #d0d5dd; color: var(--wmd-text); }
.wmd-move-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ----------------------------------------------------------------------------
   22. Progress
   -------------------------------------------------------------------------- */
.wmd-progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  background: #eaecf0;
  border-radius: var(--wmd-radius-pill);
}
.wmd-progress--sm { height: 5px; }
.wmd-progress__bar {
  height: 100%;
  background: var(--wmd-accent);
  border-radius: var(--wmd-radius-pill);
  transition: width 200ms ease;
}
.wmd-progress--amber .wmd-progress__bar { background: var(--wmd-amber); }
.wmd-progress--danger .wmd-progress__bar { background: var(--wmd-danger); }
.wmd-progress--blue .wmd-progress__bar { background: var(--wmd-blue); }

.wmd-progress-block { margin-bottom: 14px; }
.wmd-progress-block:last-child { margin-bottom: 0; }
.wmd-progress__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.wmd-progress__label { font-size: 12.5px; font-weight: 600; color: var(--wmd-text); }
.wmd-progress__value { font-size: 12px; font-weight: 600; color: var(--wmd-muted); font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------------------------------
   23. Uploader (dropzone + XHR progress driven by dashboard.js)
   -------------------------------------------------------------------------- */
.wmd-uploader {
  padding: 26px 20px;
  border: 2px dashed #d0d5dd;
  border-radius: var(--wmd-radius);
  background: #fcfcfd;
  text-align: center;
  transition: border-color var(--wmd-ease), background var(--wmd-ease);
}
.wmd-uploader.is-dragover {
  border-color: var(--wmd-accent);
  background: rgba(16, 185, 129, .07);
}
.wmd-uploader__icon { display: inline-flex; margin-bottom: 8px; color: #98a2b3; transition: color var(--wmd-ease); }
.wmd-uploader__icon svg { width: 34px; height: 34px; }
.wmd-uploader.is-dragover .wmd-uploader__icon { color: var(--wmd-accent-strong); }
.wmd-uploader__title { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.wmd-uploader__hint { margin: 0 0 12px; font-size: 12.5px; color: var(--wmd-muted); }

.wmd-file-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  margin-top: 10px;
  padding: 6px 10px;
  background: var(--wmd-surface);
  border: 1px solid var(--wmd-border);
  border-radius: var(--wmd-radius-sm);
  font-size: 13px;
  color: var(--wmd-muted);
  overflow-wrap: anywhere;
}
.wmd-file-meta:empty { display: none; }
.wmd-file-meta strong { color: var(--wmd-text); font-weight: 600; }

.wmd-upload-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.wmd-upload-progress[hidden] { display: none; }
.wmd-upload-progress .wmd-progress { flex: 1 1 auto; }
#wmd-upload-pct,
.wmd-upload-pct {
  min-width: 42px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--wmd-muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------------------------------
   24. Dropdown
   -------------------------------------------------------------------------- */
.wmd-dropdown { position: relative; display: inline-block; }
.wmd-dropdown__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 60;
  display: none;
  min-width: 180px;
  padding: 6px;
  background: var(--wmd-surface);
  border: 1px solid var(--wmd-border);
  border-radius: 10px;
  box-shadow: var(--wmd-shadow-lg);
}
.wmd-dropdown.is-open .wmd-dropdown__menu { display: block; animation: wmd-fade-in .15s ease; }
.wmd-dropdown__menu--left { right: auto; left: 0; }
.wmd-dropdown--up .wmd-dropdown__menu { top: auto; bottom: calc(100% + 6px); }

.wmd-dropdown__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--wmd-radius-sm);
  background: none;
  color: var(--wmd-text);
  font-size: 13.5px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--wmd-ease);
}
.wmd-dropdown__item svg { width: 15px; height: 15px; }
.wmd-dropdown__item:hover { background: #f2f4f7; text-decoration: none; }
.wmd-dropdown__item--danger { color: var(--wmd-danger); }
.wmd-dropdown__item--danger:hover { background: #fef3f2; }
.wmd-dropdown__divider { height: 1px; margin: 6px 4px; background: var(--wmd-border); }

/* ----------------------------------------------------------------------------
   25. Key/value lists
   -------------------------------------------------------------------------- */
.wmd-kv { display: flex; flex-direction: column; }
.wmd-kv__row {
  display: grid;
  grid-template-columns: minmax(120px, 200px) 1fr;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--wmd-border);
}
.wmd-kv__row:last-child { border-bottom: 0; }
.wmd-kv__key { padding-top: 1px; font-size: 12.5px; font-weight: 600; color: var(--wmd-muted); }
.wmd-kv__value { min-width: 0; font-size: 13.5px; overflow-wrap: anywhere; }
.wmd-kv__value .wmd-pill, .wmd-kv__value .wmd-badge { vertical-align: middle; }

@media (max-width: 599.98px) {
  .wmd-kv__row { grid-template-columns: 1fr; gap: 2px; }
}

/* ----------------------------------------------------------------------------
   26. Login page
   -------------------------------------------------------------------------- */
.wmd-login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: linear-gradient(160deg, #f8fafb 0%, #eef1f4 100%);
}
.wmd-login-card {
  width: 100%;
  max-width: 400px;
  padding: 30px 26px;
  background: var(--wmd-surface);
  border: 1px solid var(--wmd-border);
  border-radius: var(--wmd-radius-lg);
  box-shadow: var(--wmd-shadow-md);
}
.wmd-login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  text-align: center;
}
.wmd-login-brand .wmd-brand__logo { width: 46px; height: 46px; border-radius: 13px; }
.wmd-login-title { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.wmd-login-sub { margin: 2px 0 0; font-size: 13px; color: var(--wmd-muted); }
.wmd-login-foot { margin-top: 18px; font-size: 12px; color: var(--wmd-muted); text-align: center; }

/* ----------------------------------------------------------------------------
   27. Keyframes
   -------------------------------------------------------------------------- */
@keyframes wmd-spin { to { transform: rotate(360deg); } }

@keyframes wmd-shimmer { 100% { transform: translateX(100%); } }

@keyframes wmd-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes wmd-modal-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

@keyframes wmd-toast-in {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: none; }
}

@keyframes wmd-toast-out {
  to { opacity: 0; transform: translateX(16px); }
}

@keyframes wmd-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(16, 185, 129, .18); }
  50%      { box-shadow: 0 0 0 5px rgba(16, 185, 129, .10); }
}

/* ----------------------------------------------------------------------------
   28. Print-friendly tweaks
   -------------------------------------------------------------------------- */
@media print {
  .wmd-sidebar,
  .wmd-scrim,
  .wmd-topbar,
  .wmd-footer,
  .wmd-menu-btn,
  .wmd-account-form,
  .wmd-toasts,
  .wmd-modal,
  .wmd-pagination,
  .wmd-btn { display: none !important; }

  body { background: #fff; }
  .wmd-main { margin-left: 0 !important; min-height: 0 !important; }
  .wmd-content { padding: 0 !important; }
  .wmd-card,
  .wmd-table-wrap,
  .wmd-stat-card { box-shadow: none !important; }
  .wmd-table thead th { position: static; background: #fff; }
  .wmd-table tbody tr:hover { background: transparent; }
}

/* ----------------------------------------------------------------------------
   29. Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Compatibility layer — view-level helper classes (v1.0.0)
   Defines classes used by page views that layer on top of the core system.
   ========================================================================== */

.wmd-link { color: var(--wmd-accent-strong); text-decoration: none; }
.wmd-link:hover { text-decoration: underline; }

.wmd-text-xs { font-size: 12px; line-height: 1.4; }
.wmd-text-danger { color: var(--wmd-danger); font-weight: 600; }
.wmd-text-warning { color: var(--wmd-amber); font-weight: 600; }
.wmd-center { text-align: center; }

.wmd-inline-form { display: inline-flex; margin: 0; }
.wmd-flex { display: flex; align-items: center; }
.wmd-gap-sm { gap: 8px; }

.wmd-content-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 18px; }
.wmd-page-sub { margin: 0; font-size: 13.5px; color: var(--wmd-muted); }

.wmd-card-accent { border-color: var(--wmd-accent); box-shadow: 0 0 0 3px rgba(16, 185, 129, .12); }

.wmd-pairing-code {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 22px; letter-spacing: .12em; font-weight: 700;
  background: #ecfdf5; border: 1px dashed var(--wmd-accent);
  color: #065f46; padding: 12px 18px; border-radius: 10px;
  margin-bottom: 10px; user-select: all;
}

.wmd-activity-list { list-style: none; margin: 0; padding: 0; }
.wmd-activity-list li { display: flex; align-items: center; gap: 8px; padding: 7px 2px; border-bottom: 1px solid var(--wmd-border); }
.wmd-activity-list li:last-child { border-bottom: 0; }

.wmd-input-group { display: flex; gap: 6px; align-items: stretch; }
.wmd-input-group .wmd-input { flex: 1 1 auto; }

.wmd-login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.wmd-login-card {
  width: 100%; max-width: 420px; background: var(--wmd-surface);
  border: 1px solid var(--wmd-border); border-radius: 16px; padding: 30px;
  box-shadow: 0 10px 30px rgba(16, 24, 40, .10);
}
.wmd-login-form { margin-top: 18px; }

.wmd-progress-bar { height: 100%; width: 0; background: var(--wmd-accent); border-radius: 999px; transition: width .25s ease; }

.wmd-card__foot { padding: 12px 16px; border-top: 1px solid var(--wmd-border); }

.wmd-form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 720px) { .wmd-form-row-3 { grid-template-columns: 1fr; } }

.wmd-sequence-item.is-archived { opacity: .55; }

td a.wmd-link { font-family: inherit; }
