* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font:
    14px/1.6 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 28px;
  line-height: 1.3;
  letter-spacing: -0.9px;
}
h2 {
  font-size: 17px;
  letter-spacing: -0.3px;
}
h3 {
  font-size: 14px;
}
small,
.small {
  font-size: 12px;
}
.muted {
  color: var(--muted-foreground);
}
.icon {
  flex-shrink: 0;
  vertical-align: middle;
}
.flex {
  display: flex;
  align-items: center;
  gap: 10px;
}
.between {
  justify-content: space-between;
}
.stack {
  display: grid;
  gap: 20px;
}
.hidden,
[hidden] {
  display: none !important;
}
.skip-link {
  position: fixed;
  top: -60px;
  left: 12px;
  z-index: 100;
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 10px;
}
.skip-link:focus {
  top: 12px;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  height: 100dvh;
  overflow: hidden;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  z-index: 20;
}
.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  height: 76px;
  flex-shrink: 0;
  padding: 0 24px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: 9px;
  font-size: 20px;
  font-weight: 650;
  flex-shrink: 0;
}
.brand-name {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.4px;
}
.brand-sub {
  display: block;
  font-size: 11px;
  color: var(--muted-foreground);
  font-weight: 400;
}
.nav {
  padding: 16px 14px;
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.nav-title {
  padding: 0 12px;
  margin: 0 0 10px;
  font-size: 11px;
  color: var(--muted-foreground);
}
.nav-group + .nav-group {
  margin-top: 30px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  border-radius: 6px;
  padding: 9px 12px;
  margin: 3px 0;
  color: var(--muted-foreground);
  font-weight: 500;
}
.nav-link:hover {
  background: var(--accent);
  color: var(--foreground);
}
.nav-link.active {
  background: var(--accent);
  color: var(--foreground);
}
.nav-link .icon {
  width: 17px;
  height: 17px;
}
.nav-link.active:after {
  content: "";
  margin-left: auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--foreground);
}
.sidebar-bottom {
  flex-shrink: 0;
  max-height: 45dvh;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
}
.sidebar-note {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--muted);
  font-size: 12px;
  color: var(--muted-foreground);
}
.sidebar-note strong {
  display: block;
  color: var(--foreground);
  font-weight: 500;
  margin-bottom: 3px;
}
.avatar {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.user-meta {
  flex: 1;
  min-width: 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.user-meta small {
  display: block;
  overflow-wrap: anywhere;
}
.workspace {
  width: calc(100% - var(--sidebar-width));
  min-width: 0;
  container: admin-workspace / inline-size;
  margin-left: var(--sidebar-width);
  min-height: 100dvh;
}
.topbar {
  height: 65px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
}
.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.topbar-crumb {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-crumb .icon {
  width: 12px;
  height: 12px;
  color: var(--muted-foreground);
}
.divider {
  height: 18px;
  border-left: 1px solid var(--border);
}
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--foreground);
  height: 34px;
  min-width: 34px;
}
.icon-button:hover {
  background: var(--accent);
}
.content {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 36px 24px 30px;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.page-heading p {
  color: var(--muted-foreground);
  margin-top: 7px;
}
.page-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--secondary);
  color: var(--secondary-foreground);
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
}
.button.primary {
  background: var(--primary);
  color: var(--primary-foreground);
}
.button.outline {
  border-color: var(--border);
  background: var(--background);
}
.button.ghost {
  background: transparent;
}
.button.danger {
  background: var(--destructive);
  color: white;
}
.button:hover {
  filter: brightness(0.96);
}
.button.outline:hover,
.button.ghost:hover {
  background: var(--accent);
}
.button .icon {
  width: 16px;
  height: 16px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border);
  background: var(--muted);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 11px;
  line-height: 1.5;
  white-space: nowrap;
}
.badge.active {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 8%, var(--background));
  border-color: color-mix(in srgb, var(--success) 20%, var(--border));
}
.badge.pending {
  color: var(--warning);
  background: color-mix(in srgb, var(--warning) 8%, var(--background));
}
.badge.inactive {
  color: var(--muted-foreground);
}
.demo-badge {
  font-size: 11px;
  color: var(--muted-foreground);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 4px;
}
.card {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card);
  color: var(--card-foreground);
}
.card-head {
  padding: 22px 24px 0;
}
.card-head p {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted-foreground);
}
.card-body {
  padding: 24px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.metric {
  padding: 21px 22px;
}
.metric-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
}
.metric-label .icon {
  width: 16px;
  height: 16px;
  color: var(--muted-foreground);
}
.metric-value {
  font-size: 31px;
  font-weight: 650;
  letter-spacing: -1px;
  margin: 9px 0 1px;
  line-height: 1.3;
}
.metric-hint {
  font-size: 11px;
  color: var(--muted-foreground);
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}
.chart {
  height: 250px;
  display: flex;
  align-items: stretch;
  gap: 18px;
  padding: 18px 12px 0 42px;
  position: relative;
}
.chart-grid {
  position: absolute;
  inset: 18px 12px 33px 42px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}
.chart-line {
  border-top: 1px dashed var(--border);
  position: relative;
}
.chart-line span {
  position: absolute;
  left: -40px;
  top: -10px;
  font-size: 10px;
  color: var(--muted-foreground);
}
.chart-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  z-index: 1;
  min-width: 0;
  gap: 10px;
}
.chart-track {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 0;
}
.chart-bar {
  width: 70%;
  max-width: 48px;
  background: var(--primary);
  border-radius: 4px 4px 0 0;
  position: relative;
  min-height: 4px;
}
.chart-bar span {
  position: absolute;
  left: 50%;
  top: -24px;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 500;
  color: var(--muted-foreground);
}
.chart-column small {
  height: 23px;
  font-size: 11px;
  white-space: nowrap;
  color: var(--muted-foreground);
}
.quick-links {
  display: grid;
  gap: 9px;
}
.quick-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
}
.quick-link:hover {
  background: var(--accent);
}
.quick-link > .icon:last-child {
  margin-left: auto;
  width: 14px;
  height: 14px;
  color: var(--muted-foreground);
}
.quick-link strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
}
.quick-link small {
  display: block;
  color: var(--muted-foreground);
  font-size: 11px;
}
.activity {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.activity-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  font-size: 12px;
}
.activity-item small {
  display: block;
  color: var(--muted-foreground);
}
.activity-marker {
  margin-top: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ring);
  flex-shrink: 0;
}
.table-card {
  overflow: hidden;
}
.table-toolbar {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.filters {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.search-field {
  position: relative;
}
.search-field .icon {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 16px;
  height: 16px;
  color: var(--muted-foreground);
}
.search-field input {
  padding-left: 34px;
  width: 240px;
}
.input,
.select,
.textarea {
  border: 1px solid var(--input);
  border-radius: 6px;
  background: var(--background);
  color: var(--foreground);
  padding: 8px 11px;
  width: 100%;
  min-height: 37px;
  font-size: 13px;
}
.select {
  width: auto;
}
.textarea {
  resize: vertical;
  min-height: 100px;
}
.input::placeholder {
  color: var(--muted-foreground);
}
.filters .select {
  max-width: 145px;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}
th {
  text-align: left;
  font-size: 12px;
  color: var(--muted-foreground);
  font-weight: 500;
  height: 43px;
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--muted) 35%, var(--background));
  padding: 8px 20px;
}
td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: color-mix(in srgb, var(--muted) 40%, var(--background));
}
th .sort-button {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  display: flex;
  gap: 7px;
  align-items: center;
}
.checkbox {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  vertical-align: middle;
}
.table-person {
  display: flex;
  align-items: center;
  gap: 11px;
}
.table-person strong {
  font-size: 13px;
  font-weight: 500;
  display: block;
}
.table-person small {
  color: var(--muted-foreground);
  font-size: 11px;
}
.table-actions {
  text-align: right;
}
.table-actions .button {
  min-height: 28px;
  padding: 3px 8px;
  font-size: 12px;
}
.table-footer {
  border-top: 1px solid var(--border);
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--muted-foreground);
}
.pagination {
  display: flex;
  align-items: center;
  gap: 7px;
}
.pagination .button {
  padding: 4px 10px;
  min-height: 30px;
}
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  background: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--border);
}
.state {
  padding: 65px 24px;
  text-align: center;
  white-space: normal;
}
.state .icon {
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  color: var(--muted-foreground);
}
.state p {
  color: var(--muted-foreground);
  margin: 5px 0 16px;
}
.form-layout {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  width: 100%;
  max-width: none;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.field {
  display: grid;
  gap: 6px;
}
.field.full {
  grid-column: 1/-1;
}
.field label {
  font-size: 13px;
  font-weight: 500;
}
.required {
  color: var(--destructive);
}
.hint {
  font-size: 12px;
  color: var(--muted-foreground);
}
.field-error {
  font-size: 12px;
  color: var(--destructive);
}
.field-error:empty {
  display: none;
}
[aria-invalid="true"] {
  border-color: var(--destructive);
}
.form-section + .form-section {
  border-top: 1px solid var(--border);
  margin-top: 28px;
  padding-top: 24px;
}
.form-section h3 {
  margin-bottom: 16px;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid var(--border);
  padding: 18px 24px;
}
.help-list {
  padding-left: 18px;
  color: var(--muted-foreground);
  font-size: 12px;
}
.help-list li {
  margin: 10px 0;
}
.settings-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 32px;
}
.settings-nav a {
  display: block;
  padding: 8px 12px;
  margin: 3px 0;
  font-size: 13px;
  border-radius: 6px;
}
.settings-nav a:hover,
.settings-nav a.active {
  background: var(--accent);
}
.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.switch-row small {
  display: block;
  color: var(--muted-foreground);
}
.theme-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.theme-option {
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 15px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.component-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.component-demo {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.callout {
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--muted);
  padding: 13px 16px;
  font-size: 12px;
  color: var(--muted-foreground);
}
.modal {
  padding: 0;
  background: var(--background);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: min(520px, calc(100% - 32px));
  max-height: calc(100dvh - 40px);
  box-shadow: 0 20px 80px #0003;
}
.modal::backdrop,
.drawer::backdrop {
  background: #0006;
}
.modal-head {
  padding: 24px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}
.modal-head h2 {
  font-size: 19px;
}
.modal-head p {
  font-size: 13px;
  margin-top: 5px;
}
.modal-body {
  padding: 20px 24px;
}
.modal-body:empty {
  padding: 12px;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}
.toast-region {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  display: grid;
  gap: 8px;
  max-width: min(430px, calc(100% - 32px));
}
.toast {
  border: 1px solid var(--border);
  padding: 12px 14px;
  background: var(--background);
  border-radius: 8px;
  box-shadow: 0 5px 25px #0001;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.toast.error > .icon {
  color: var(--destructive);
}
.toast.success > .icon {
  color: var(--success);
}
.toast .icon-button {
  margin-left: auto;
  height: 24px;
  min-width: 24px;
}
.account-menu {
  position: relative;
}
.account-menu summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
}
.account-menu summary::-webkit-details-marker {
  display: none;
}
.account-panel {
  position: absolute;
  right: 0;
  top: 45px;
  width: 220px;
  background: var(--popover);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 30px #0001;
  z-index: 30;
  padding: 6px;
}
.account-panel .button {
  display: flex;
  width: 100%;
  justify-content: flex-start;
}
.account-info {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 5px;
}
.footer {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  color: var(--muted-foreground);
  font-size: 11px;
}
.drawer {
  padding: 0;
  position: fixed;
  inset: 0 auto 0 0;
  margin: 0;
  border: 0;
  width: 280px;
  max-width: 85vw;
  height: 100dvh;
  max-height: 100dvh;
  background: var(--background);
  color: var(--foreground);
}
.drawer .sidebar {
  position: static;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
}
.drawer-close {
  position: absolute;
  right: 8px;
  top: 10px;
}
.mobile-only {
  display: none;
}
.collapsed {
  --sidebar-width: 76px;
}
.collapsed > .sidebar .brand {
  padding: 0 20px;
}
.collapsed > .sidebar .brand-copy,
.collapsed > .sidebar .nav-title,
.collapsed > .sidebar .nav-text,
.collapsed > .sidebar .sidebar-note,
.collapsed > .sidebar .user-meta,
.collapsed > .sidebar .nav-link:after {
  display: none;
}
.collapsed > .sidebar .nav-link {
  justify-content: center;
  padding: 12px;
}
.collapsed > .sidebar .sidebar-bottom {
  padding: 16px 20px;
}
.auth-layout {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.auth-story {
  background: var(--primary);
  color: var(--primary-foreground);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
}
.auth-story .brand-mark {
  background: var(--primary-foreground);
  color: var(--primary);
}
.auth-story h2 {
  font-size: 38px;
  line-height: 1.4;
  letter-spacing: -1.2px;
  margin-bottom: 20px;
}
.auth-story p {
  max-width: 430px;
  opacity: 0.75;
}
.auth-pattern {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin: 48px 0;
}
.auth-pattern span {
  height: 58px;
  border: 1px solid currentColor;
  border-radius: 6px;
  opacity: 0.12;
}
.auth-pattern span:nth-child(4n) {
  opacity: 0.32;
  background: currentColor;
}
.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px;
  position: relative;
}
.auth-form {
  width: 100%;
  max-width: 360px;
}
.auth-form h1 {
  font-size: 25px;
}
.auth-form > p {
  margin: 8px 0 28px;
}
.auth-form form {
  display: grid;
  gap: 18px;
}
.auth-form .button {
  width: 100%;
  min-height: 40px;
}
.auth-theme {
  position: absolute;
  right: 24px;
  top: 24px;
}
.auth-note {
  font-size: 12px;
  color: var(--muted-foreground);
  text-align: center;
  margin-top: 20px;
}
.error-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
}
.error-code {
  font-size: 100px;
  letter-spacing: -7px;
  font-weight: 700;
  color: var(--muted-foreground);
  line-height: 1.3;
}
.error-page h1 {
  margin-top: 12px;
}
.error-page p {
  margin: 12px 0 25px;
  color: var(--muted-foreground);
}
@media (max-width: 1150px) {
  .metrics {
    gap: 12px;
  }
  .metric {
    padding: 18px;
  }
  .dashboard-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  }
  .form-layout {
    grid-template-columns: minmax(0, 1fr) 260px;
  }
  .content {
    padding: 28px 24px;
  }
  .topbar {
    padding: 0 24px;
  }
}
@media (max-width: 900px) {
  body > .sidebar {
    display: none;
  }
  .workspace {
    width: 100%;
    margin-left: 0;
  }
  .mobile-only {
    display: inline-flex;
  }
  .desktop-only {
    display: none;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .form-layout {
    grid-template-columns: 1fr;
  }
  .form-aside {
    order: 2;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .auth-layout {
    grid-template-columns: 1fr;
  }
  .auth-story {
    display: none;
  }
}
@media (max-width: 600px) {
  h1 {
    font-size: 24px;
  }
  .content {
    padding: 24px 16px;
  }
  .topbar {
    padding: 0 16px;
    gap: 8px;
  }
  .topbar-crumb > a,
  .topbar-crumb > .icon {
    display: none;
  }
  .topbar-left,
  .topbar-right {
    gap: 8px;
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 22px;
  }
  .page-actions {
    width: 100%;
  }
  .metric {
    padding: 16px;
  }
  .metric-value {
    font-size: 27px;
  }
  .metric-hint {
    font-size: 10px;
  }
  .table-toolbar {
    padding: 14px;
    align-items: stretch;
  }
  .filters {
    width: 100%;
  }
  .search-field {
    width: 100%;
  }
  .search-field input {
    width: 100%;
  }
  .table-footer {
    flex-direction: column;
    align-items: flex-start;
  }
  .pagination {
    width: 100%;
    justify-content: space-between;
  }
  .form-grid,
  .component-grid,
  .settings-layout {
    grid-template-columns: 1fr;
  }
  .settings-nav {
    display: flex;
    overflow: auto;
  }
  .settings-nav a {
    white-space: nowrap;
  }
  .settings-layout {
    gap: 15px;
  }
  .card-body {
    padding: 20px;
  }
  .card-head {
    padding: 20px 20px 0;
  }
  .form-actions {
    padding: 16px 20px;
  }
  .chart {
    gap: 9px;
    padding-left: 30px;
  }
  .chart-grid {
    left: 30px;
  }
  .chart-line span {
    left: -30px;
  }
  .chart-bar {
    width: 80%;
  }
  .chart-bar span {
    font-size: 10px;
  }
  .footer {
    gap: 15px;
  }
  .auth-main {
    padding: 28px 22px;
  }
  .account-menu .account-label {
    display: none;
  }
  .bulk-bar {
    flex-wrap: wrap;
  }
  .toast-region {
    right: 16px;
    bottom: 16px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .button,
  .nav-link,
  .quick-link {
    transition: background-color 0.15s;
  }
  .toast {
    animation: appear 0.15s ease-out;
  }
  @keyframes appear {
    from {
      opacity: 0;
      transform: translateY(5px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
/* v1.1: persistent navigation and component gallery */
html.app-booting body > main[data-title] {
  visibility: hidden;
}
.topbar {
  position: relative;
}
.navigation-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--ring);
}
.content {
  min-height: calc(100dvh - 65px);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.gallery-nav {
  display: flex;
  gap: 6px;
  padding-bottom: 24px;
  flex-wrap: wrap;
}
.gallery-nav a {
  padding: 8px 14px;
  border-radius: 6px;
  color: var(--muted-foreground);
  font-size: 13px;
}
.gallery-nav a.active {
  background: var(--accent);
  color: var(--foreground);
  font-weight: 500;
}
.gallery-section {
  scroll-margin-top: 24px;
}
.demo-description {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 14px;
}
.code-example {
  padding: 14px;
  margin: 12px 0 0;
  border-radius: 6px;
  background: var(--muted);
  border: 1px solid var(--border);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font:
    12px/1.7 ui-monospace,
    monospace;
}
.separator {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}
.avatar.large {
  width: 48px;
  height: 48px;
  font-size: 16px;
}
.avatar.small {
  width: 25px;
  height: 25px;
  font-size: 10px;
}
.avatar-group {
  display: flex;
  padding-left: 6px;
}
.avatar-group .avatar {
  margin-left: -6px;
  border: 2px solid var(--background);
}
.breadcrumb-demo {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}
.breadcrumb-demo a {
  color: var(--muted-foreground);
}
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 7px;
  background: var(--muted);
  width: fit-content;
}
.tab {
  border: 0;
  background: transparent;
  color: var(--muted-foreground);
  padding: 7px 13px;
  border-radius: 5px;
  font-size: 13px;
}
.tab[aria-selected="true"] {
  background: var(--background);
  color: var(--foreground);
  box-shadow: 0 1px 3px #0001;
}
.tab-panel {
  padding-top: 18px;
  min-height: 100px;
}
.accordion {
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
}
.accordion details + details {
  border-top: 1px solid var(--border);
}
.accordion summary {
  padding: 13px 15px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}
.accordion details > p {
  padding: 0 15px 15px;
  color: var(--muted-foreground);
  font-size: 12px;
}
.alert {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 7px;
  display: flex;
  gap: 10px;
  font-size: 13px;
}
.alert p {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 4px;
}
.alert.error {
  border-color: var(--destructive);
  color: var(--destructive);
}
.scroll-area {
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 14px;
}
.scroll-area p {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.scroll-area p:last-child {
  border: 0;
}
[data-tooltip] {
  position: relative;
}
.tooltip-text {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 8px;
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  z-index: 5;
}
[data-tooltip]:hover .tooltip-text,
[data-tooltip]:focus-visible .tooltip-text {
  display: block;
}
.input-group {
  display: flex;
  align-items: stretch;
}
.input-addon {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px 0 0 6px;
  color: var(--muted-foreground);
  font-size: 12px;
}
.input-group .input {
  border-radius: 0 6px 6px 0;
}
.password-group {
  position: relative;
}
.password-group .input {
  padding-right: 60px;
}
.password-group button {
  position: absolute;
  right: 8px;
  top: 4px;
}
.switch {
  appearance: none;
  width: 36px;
  height: 21px;
  border-radius: 20px;
  background: var(--input);
  position: relative;
  cursor: pointer;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.switch::before {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--background);
  top: 2px;
  left: 2px;
  box-shadow: 0 1px 2px #0002;
}
.switch:checked {
  background: var(--primary);
}
.switch:checked::before {
  left: 17px;
  background: var(--primary-foreground);
}
.choice-list {
  display: grid;
  gap: 12px;
}
.choice-list label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
}
input[type="radio"],
input[type="range"] {
  accent-color: var(--primary);
}
.otp {
  display: flex;
  gap: 8px;
}
.otp input {
  width: 38px;
  height: 43px;
  text-align: center;
  padding: 6px;
  font-size: 18px;
}
.toggle-button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--ring);
  color: var(--foreground);
}
.tag-choice {
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}
.tag-choice:has(input:checked) {
  background: var(--accent);
  border-color: var(--ring);
}
.file-drop {
  display: block;
  padding: 25px 16px;
  border: 1px dashed var(--ring);
  border-radius: 7px;
  background: var(--muted);
  cursor: pointer;
  text-align: center;
}
.file-drop input {
  display: block;
  max-width: 100%;
  margin: 15px auto 0;
  font-size: 12px;
}
.file-preview-image {
  max-width: 100%;
  max-height: 150px;
  border-radius: 6px;
  margin-top: 12px;
}
.progress {
  width: 100%;
  height: 8px;
  accent-color: var(--primary);
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--muted);
}
.progress::-webkit-progress-bar {
  background: var(--muted);
}
.progress::-webkit-progress-value {
  background: var(--primary);
  border-radius: 10px;
}
.skeleton {
  height: 13px;
  background: var(--muted);
  border-radius: 5px;
}
.skeleton.circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.skeleton-demo {
  display: grid;
  gap: 12px;
  padding: 20px 0;
}
.popover-demo {
  margin: 0;
  padding: 18px;
  border: 1px solid var(--border);
  background: var(--popover);
  color: var(--foreground);
  border-radius: 8px;
  box-shadow: 0 8px 30px #0002;
  max-width: 290px;
}
.popover-demo:popover-open {
  position: fixed;
  inset: 38% auto auto 50%;
  transform: translateX(-50%);
}
.sheet {
  inset: 0 0 0 auto;
  margin: 0;
  height: 100dvh;
  max-height: 100dvh;
  max-width: 90vw;
  width: 400px;
  border-radius: 0;
  display: none;
}
.sheet[open] {
  display: flex;
  flex-direction: column;
}
.sheet .modal-body {
  flex: 1;
}
.command-results {
  padding-top: 12px;
  max-height: 300px;
  overflow: auto;
}
.command-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 0;
  width: 100%;
  background: transparent;
  color: var(--foreground);
  text-align: left;
  border-radius: 5px;
  font-size: 13px;
}
.command-item:hover,
.command-item:focus-visible {
  background: var(--accent);
}
.command-item .icon:last-child {
  margin-left: auto;
  width: 14px;
}
kbd {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10px;
  background: var(--muted);
  color: var(--muted-foreground);
}
.demo-steps {
  display: flex;
  gap: 20px;
  color: var(--muted-foreground);
  font-size: 12px;
}
.demo-steps .current {
  color: var(--foreground);
  font-weight: 600;
}
@media (prefers-reduced-motion: no-preference) {
  .skeleton {
    animation: skeleton-pulse 1.4s ease-in-out infinite;
  }
  @keyframes skeleton-pulse {
    50% {
      opacity: 0.4;
    }
  }
}
@media (max-width: 600px) {
  .otp {
    gap: 5px;
  }
  .otp input {
    width: 34px;
  }
  .gallery-nav a {
    padding: 7px 10px;
  }
}

/* Respond to the usable workspace width, including collapsed sidebars. */
.workspace main,
.workspace .card,
.form-layout > *,
.settings-layout > *,
.component-grid > * {
  min-width: 0;
}
@container admin-workspace (max-width: 850px) {
  .dashboard-grid,
  .component-grid,
  .form-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
@container admin-workspace (max-width: 650px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .settings-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .settings-nav {
    display: flex;
    flex-wrap: wrap;
  }
}

/* v1.2：共用弹窗反馈与轻量动效，不增加运行依赖。 */
:root { --motion-fast: 150ms; --motion-panel: 180ms; --motion-ease: cubic-bezier(.2,.8,.2,1); }
.brand-logo { width: 28px; height: 28px; object-fit: contain; }
.dialog-error { margin: 0 24px 16px; color: var(--destructive); border-color: var(--destructive); }
.form-error { margin: 16px 24px; color: var(--destructive); }
@media (prefers-reduced-motion: no-preference) {
  body > .sidebar { transition: width var(--motion-panel) var(--motion-ease); }
  .workspace { transition: margin-left var(--motion-panel) var(--motion-ease), width var(--motion-panel) var(--motion-ease); }
  .modal[open] { animation: modal-enter var(--motion-panel) var(--motion-ease) both; }
  .drawer[open] { animation: drawer-enter var(--motion-panel) var(--motion-ease) both; }
  .sheet[open] { animation: sheet-enter var(--motion-panel) var(--motion-ease) both; }
  .modal.is-closing { animation: modal-leave var(--motion-fast) ease-in both; }
  .drawer.is-closing { animation: drawer-leave var(--motion-fast) ease-in both; }
  .sheet.is-closing { animation: sheet-leave var(--motion-fast) ease-in both; }
  @keyframes modal-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  @keyframes modal-leave { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(6px); } }
  @keyframes drawer-enter { from { transform: translateX(-100%); } to { transform: none; } }
  @keyframes drawer-leave { from { transform: none; } to { transform: translateX(-100%); } }
  @keyframes sheet-enter { from { transform: translateX(100%); } to { transform: none; } }
  @keyframes sheet-leave { from { transform: none; } to { transform: translateX(100%); } }
}
