/* =====================================================================
   Minimal UI v7.4.0 design language · native CSS implementation
   云账通财务系统基础组件
   ===================================================================== */

@font-face {
  font-family: 'Roboto';
  src: url('../fonts/Roboto-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Roboto';
  src: url('../fonts/Roboto-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --m-primary-lighter: #c8fad6;
  --m-primary-light: #5be49b;
  --m-primary: #00a76f;
  --m-primary-dark: #007867;
  --m-primary-darker: #004b50;
  --m-primary-soft: rgba(0, 167, 111, 0.08);
  --m-primary-soft-2: rgba(0, 167, 111, 0.14);
  --m-secondary: #8e33ff;
  --m-info: #00b8d9;
  --m-success: #22c55e;
  --m-warning: #ffab00;
  --m-error: #ff5630;

  --m-grey-50: #fcfdfd;
  --m-grey-100: #f9fafb;
  --m-grey-200: #f4f6f8;
  --m-grey-300: #dfe3e8;
  --m-grey-400: #c4cdd5;
  --m-grey-500: #919eab;
  --m-grey-600: #637381;
  --m-grey-700: #454f5b;
  --m-grey-800: #1c252e;
  --m-grey-900: #141a21;

  --m-bg: #f5f7f8;
  --m-bg-elevated: #ffffff;
  --m-paper: #ffffff;
  --m-paper-soft: #fbfcfd;
  --m-text: #1c252e;
  --m-text-secondary: #637381;
  --m-text-disabled: #919eab;
  --m-border: rgba(145, 158, 171, 0.2);
  --m-border-strong: rgba(145, 158, 171, 0.32);
  --m-divider: rgba(145, 158, 171, 0.16);
  --m-shadow-xs: 0 1px 2px rgba(28, 37, 46, 0.05);
  --m-shadow-sm: 0 2px 6px rgba(28, 37, 46, 0.05), 0 1px 2px rgba(28, 37, 46, 0.03);
  --m-shadow-md: 0 10px 30px -12px rgba(28, 37, 46, 0.18), 0 2px 8px rgba(28, 37, 46, 0.04);
  --m-shadow-lg: 0 24px 64px -24px rgba(28, 37, 46, 0.28), 0 8px 24px rgba(28, 37, 46, 0.06);
  --m-shadow-green: 0 8px 22px -8px rgba(0, 167, 111, 0.48);

  --m-radius-xs: 6px;
  --m-radius-sm: 10px;
  --m-radius-md: 14px;
  --m-radius-lg: 18px;
  --m-radius-xl: 24px;

  --m-font: 'Roboto', 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --m-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  --m-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --m-sidebar-width: 272px;
  --m-topbar-height: 72px;
}

[data-theme='dark'] {
  color-scheme: dark;
  --m-bg: #0f141a;
  --m-bg-elevated: #161d25;
  --m-paper: #1c252e;
  --m-paper-soft: #202a34;
  --m-text: #ffffff;
  --m-text-secondary: #9aa7b4;
  --m-text-disabled: #637381;
  --m-border: rgba(145, 158, 171, 0.2);
  --m-border-strong: rgba(145, 158, 171, 0.36);
  --m-divider: rgba(145, 158, 171, 0.14);
  --m-primary-soft: rgba(91, 228, 155, 0.1);
  --m-primary-soft-2: rgba(91, 228, 155, 0.16);
  --m-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.28);
  --m-shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.24);
  --m-shadow-md: 0 16px 40px -18px rgba(0, 0, 0, 0.7);
  --m-shadow-lg: 0 32px 80px -32px rgba(0, 0, 0, 0.8);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background: var(--m-bg);
  color: var(--m-text);
  font-family: var(--m-font);
  font-size: 14px;
  line-height: 1.57;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.25s var(--m-ease), color 0.25s var(--m-ease);
}

body.m-scroll-lock {
  overflow: hidden;
}

h1,
h2,
h3,
h4,
h5,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
}
h2 {
  font-size: 22px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -0.015em;
}
h3 {
  font-size: 18px;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: -0.01em;
}
h4 {
  font-size: 16px;
  line-height: 1.45;
  font-weight: 700;
}

a {
  color: var(--m-primary);
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

img,
svg {
  display: block;
  max-width: 100%;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

::selection {
  background: var(--m-primary-light);
  color: #003b2f;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-thumb {
  background: rgba(145, 158, 171, 0.34);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-track {
  background: transparent;
}

.m-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
}
.m-icon svg {
  width: 100%;
  height: 100%;
}
.m-icon--sm {
  width: 16px;
  height: 16px;
}
.m-icon--lg {
  width: 24px;
  height: 24px;
}

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
.m-btn {
  --btn-h: 40px;
  position: relative;
  display: inline-flex;
  height: var(--btn-h);
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--m-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
  transition: background-color 0.18s var(--m-ease), border-color 0.18s var(--m-ease),
    box-shadow 0.18s var(--m-ease), transform 0.12s var(--m-ease), color 0.18s var(--m-ease);
}
.m-btn:hover {
  transform: translateY(-1px);
}
.m-btn:active {
  transform: translateY(0);
}
.m-btn:focus-visible {
  outline: 2px solid var(--m-primary-light);
  outline-offset: 2px;
}
.m-btn:disabled,
.m-btn[aria-disabled='true'] {
  opacity: 0.5;
  pointer-events: none;
}
.m-btn .m-icon {
  width: 18px;
  height: 18px;
}
.m-btn--primary {
  background: var(--m-primary);
  color: #fff;
  box-shadow: var(--m-shadow-green);
}
.m-btn--primary:hover {
  background: var(--m-primary-dark);
}
.m-btn--secondary {
  background: var(--m-paper);
  border-color: var(--m-border);
  color: var(--m-text);
  box-shadow: var(--m-shadow-xs);
}
.m-btn--secondary:hover {
  background: var(--m-grey-100);
  border-color: var(--m-border-strong);
}
[data-theme='dark'] .m-btn--secondary:hover {
  background: #232e38;
}
.m-btn--soft {
  background: var(--m-primary-soft);
  color: var(--m-primary-dark);
}
[data-theme='dark'] .m-btn--soft {
  color: var(--m-primary-light);
}
.m-btn--soft:hover {
  background: var(--m-primary-soft-2);
}
.m-btn--ghost {
  color: var(--m-text-secondary);
}
.m-btn--ghost:hover {
  background: var(--m-grey-100);
  color: var(--m-text);
}
[data-theme='dark'] .m-btn--ghost:hover {
  background: #232e38;
}
.m-btn--danger {
  background: rgba(255, 86, 48, 0.1);
  color: #b71d18;
}
.m-btn--danger:hover {
  background: rgba(255, 86, 48, 0.18);
}
.m-btn--dark {
  background: var(--m-grey-800);
  color: #fff;
}
.m-btn--dark:hover {
  background: var(--m-grey-900);
}
.m-btn--sm {
  --btn-h: 32px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 13px;
}
.m-btn--lg {
  --btn-h: 48px;
  padding: 0 22px;
  border-radius: 12px;
  font-size: 15px;
}
.m-btn--block {
  width: 100%;
}
.m-btn--icon {
  width: var(--btn-h);
  padding: 0;
}
.m-btn--round {
  border-radius: 999px;
}
.m-btn.is-loading {
  color: transparent !important;
  pointer-events: none;
}
.m-btn.is-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: m-spin 0.7s linear infinite;
}
.m-btn--secondary.is-loading::after,
.m-btn--ghost.is-loading::after {
  border-color: var(--m-border-strong);
  border-top-color: var(--m-primary);
}

/* ---------------------------------------------------------------------
   Cards / surfaces
   --------------------------------------------------------------------- */
.m-card {
  background: var(--m-paper);
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius-lg);
  box-shadow: var(--m-shadow-xs);
}
.m-card--elevated {
  box-shadow: var(--m-shadow-md);
  border-color: transparent;
}
.m-card--flush {
  overflow: hidden;
}
.m-card--hover {
  transition: transform 0.2s var(--m-ease), box-shadow 0.2s var(--m-ease),
    border-color 0.2s var(--m-ease);
}
.m-card--hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--m-shadow-md);
  border-color: rgba(0, 167, 111, 0.22);
}
.m-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 0;
}
.m-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.m-card-sub {
  margin-top: 4px;
  color: var(--m-text-secondary);
  font-size: 12.5px;
}
.m-card-body {
  padding: 20px 22px;
}
.m-card-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--m-divider);
  background: var(--m-paper-soft);
  border-radius: 0 0 var(--m-radius-lg) var(--m-radius-lg);
}
.m-surface {
  background: var(--m-paper-soft);
  border: 1px solid var(--m-divider);
  border-radius: var(--m-radius-md);
}

/* ---------------------------------------------------------------------
   Form controls
   --------------------------------------------------------------------- */
.m-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.m-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--m-text);
  font-size: 13px;
  font-weight: 600;
}
.m-label .m-required {
  color: var(--m-error);
}
.m-hint {
  color: var(--m-text-secondary);
  font-size: 12px;
}
.m-error-text {
  color: var(--m-error);
  font-size: 12px;
}
.m-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.m-input-wrap > .m-icon {
  position: absolute;
  left: 13px;
  color: var(--m-text-disabled);
  pointer-events: none;
}
.m-input-wrap > .m-icon + .m-input {
  padding-left: 42px;
}
.m-input-wrap .m-input-action {
  position: absolute;
  right: 6px;
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--m-text-disabled);
}
.m-input-wrap .m-input-action:hover {
  background: var(--m-grey-100);
  color: var(--m-text);
}
[data-theme='dark'] .m-input-wrap .m-input-action:hover {
  background: #28323d;
}

.m-input,
.m-select,
.m-textarea {
  width: 100%;
  min-height: 43px;
  padding: 10px 13px;
  border: 1px solid var(--m-border-strong);
  border-radius: 10px;
  background: var(--m-paper);
  color: var(--m-text);
  font-size: 14px;
  transition: border-color 0.18s var(--m-ease), box-shadow 0.18s var(--m-ease),
    background-color 0.18s var(--m-ease);
}
.m-input::placeholder,
.m-textarea::placeholder {
  color: var(--m-text-disabled);
}
.m-input:hover,
.m-select:hover,
.m-textarea:hover {
  border-color: var(--m-grey-400);
}
.m-input:focus,
.m-select:focus,
.m-textarea:focus {
  outline: none;
  border-color: var(--m-primary);
  box-shadow: 0 0 0 3px rgba(0, 167, 111, 0.12);
}
.m-input[aria-invalid='true'],
.m-textarea[aria-invalid='true'] {
  border-color: var(--m-error);
  box-shadow: 0 0 0 3px rgba(255, 86, 48, 0.1);
}
.m-textarea {
  min-height: 96px;
  resize: vertical;
}
.m-select {
  appearance: none;
  padding-right: 38px;
  background-image: linear-gradient(45deg, transparent 50%, var(--m-text-secondary) 50%),
    linear-gradient(135deg, var(--m-text-secondary) 50%, transparent 50%);
  background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.m-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--m-text-secondary);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.m-checkbox input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--m-primary);
}
.m-switch {
  position: relative;
  display: inline-flex;
  width: 40px;
  height: 22px;
  border: 0;
  border-radius: 99px;
  background: var(--m-grey-300);
  transition: background-color 0.2s var(--m-ease);
}
.m-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(28, 37, 46, 0.2);
  transition: transform 0.2s var(--m-ease);
}
.m-switch[aria-checked='true'] {
  background: var(--m-primary);
}
.m-switch[aria-checked='true']::after {
  transform: translateX(18px);
}

/* ---------------------------------------------------------------------
   Chips / badges / avatars
   --------------------------------------------------------------------- */
.m-chip {
  display: inline-flex;
  height: 26px;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border-radius: 7px;
  background: var(--m-grey-200);
  color: var(--m-grey-700);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.m-chip--primary {
  background: var(--m-primary-soft);
  color: var(--m-primary-dark);
}
.m-chip--success {
  background: rgba(34, 197, 94, 0.12);
  color: #118d57;
}
.m-chip--warning {
  background: rgba(255, 171, 0, 0.14);
  color: #b76e00;
}
.m-chip--danger {
  background: rgba(255, 86, 48, 0.12);
  color: #b71d18;
}
.m-chip--info {
  background: rgba(0, 184, 217, 0.12);
  color: #006c9c;
}
[data-theme='dark'] .m-chip--primary {
  color: var(--m-primary-light);
}
[data-theme='dark'] .m-chip--success {
  color: #77ed8b;
}
[data-theme='dark'] .m-chip--warning {
  color: #ffd666;
}
[data-theme='dark'] .m-chip--danger {
  color: #ffac82;
}
.m-chip .m-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.m-avatar {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--m-primary-light), var(--m-primary-dark));
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex: 0 0 auto;
}
.m-avatar img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}
.m-avatar--sm {
  width: 32px;
  height: 32px;
  font-size: 12px;
}
.m-avatar--lg {
  width: 52px;
  height: 52px;
  font-size: 17px;
}
.m-avatar--xl {
  width: 72px;
  height: 72px;
  font-size: 23px;
}
.m-avatar--square {
  border-radius: 14px;
}

/* ---------------------------------------------------------------------
   Tables
   --------------------------------------------------------------------- */
.m-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--m-radius-md);
}
.m-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
  white-space: nowrap;
}
.m-table th {
  padding: 11px 16px;
  background: var(--m-grey-100);
  color: var(--m-text-secondary);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--m-border);
}
.m-table th:first-child {
  border-top-left-radius: 10px;
}
.m-table th:last-child {
  border-top-right-radius: 10px;
}
.m-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--m-divider);
  vertical-align: middle;
}
.m-table tbody tr {
  transition: background-color 0.15s var(--m-ease);
}
.m-table tbody tr:hover {
  background: var(--m-grey-50);
}
[data-theme='dark'] .m-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}
.m-table tbody tr:last-child td {
  border-bottom: 0;
}
.m-table .is-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.m-table .m-table-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

/* ---------------------------------------------------------------------
   Tabs / segmented
   --------------------------------------------------------------------- */
.m-tabs {
  display: flex;
  gap: 20px;
  border-bottom: 1px solid var(--m-border);
}
.m-tab {
  position: relative;
  border: 0;
  background: none;
  padding: 0 0 12px;
  color: var(--m-text-secondary);
  font-size: 13.5px;
  font-weight: 600;
}
.m-tab::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: transparent;
}
.m-tab.is-active {
  color: var(--m-text);
}
.m-tab.is-active::after {
  background: var(--m-primary);
}
.m-segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: var(--m-grey-200);
  gap: 2px;
}
[data-theme='dark'] .m-segmented {
  background: #28323d;
}
.m-segmented button {
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--m-text-secondary);
  font-size: 12.5px;
  font-weight: 600;
}
.m-segmented button.is-active {
  background: var(--m-paper);
  color: var(--m-text);
  box-shadow: var(--m-shadow-xs);
}

/* ---------------------------------------------------------------------
   Progress
   --------------------------------------------------------------------- */
.m-progress {
  position: relative;
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--m-grey-200);
}
[data-theme='dark'] .m-progress {
  background: #2b3641;
}
.m-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--m-primary-light), var(--m-primary));
  transition: width 0.5s var(--m-ease);
}
.m-progress--warning > span {
  background: linear-gradient(90deg, #ffd666, var(--m-warning));
}
.m-progress--danger > span {
  background: linear-gradient(90deg, #ffac82, var(--m-error));
}

/* ---------------------------------------------------------------------
   Modal / drawer / toast
   --------------------------------------------------------------------- */
.m-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(20, 26, 33, 0.5);
  backdrop-filter: blur(4px);
  animation: m-fade-in 0.18s var(--m-ease);
}
.m-modal {
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid var(--m-border);
  border-radius: 20px;
  background: var(--m-paper);
  box-shadow: var(--m-shadow-lg);
  animation: m-modal-in 0.22s var(--m-ease);
}
.m-modal--wide {
  max-width: 720px;
}
.m-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 0;
}
.m-modal-title {
  font-size: 18px;
  font-weight: 700;
}
.m-modal-body {
  padding: 18px 24px;
  color: var(--m-text-secondary);
}
.m-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 24px 22px;
}
.m-icon-btn {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--m-text-secondary);
  transition: background-color 0.15s var(--m-ease), color 0.15s var(--m-ease);
}
.m-icon-btn:hover {
  background: var(--m-grey-100);
  color: var(--m-text);
}
[data-theme='dark'] .m-icon-btn:hover {
  background: #28323d;
}
.m-icon-btn--sm {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}
.m-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(20, 26, 33, 0.48);
  backdrop-filter: blur(2px);
  animation: m-fade-in 0.18s var(--m-ease);
}
.m-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 901;
  width: min(86vw, 320px);
  overflow: auto;
  background: var(--m-paper);
  box-shadow: var(--m-shadow-lg);
  animation: m-slide-left 0.22s var(--m-ease);
}
.m-toast-stack {
  position: fixed;
  top: 82px;
  left: 50%;
  z-index: 1200;
  display: flex;
  width: min(92vw, 420px);
  flex-direction: column;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}
.m-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--m-border);
  border-radius: 12px;
  background: var(--m-paper);
  color: var(--m-text);
  box-shadow: var(--m-shadow-md);
  font-size: 13px;
  font-weight: 500;
  animation: m-toast-in 0.24s var(--m-ease);
  pointer-events: auto;
}
.m-toast .m-icon {
  color: var(--m-primary);
  margin-top: 1px;
}
.m-toast--error .m-icon {
  color: var(--m-error);
}
.m-toast--warning .m-icon {
  color: var(--m-warning);
}
.m-toast--success .m-icon {
  color: var(--m-success);
}
.m-toast.is-leaving {
  animation: m-toast-out 0.18s var(--m-ease) forwards;
}

/* ---------------------------------------------------------------------
   Empty / skeleton / alert
   --------------------------------------------------------------------- */
.m-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}
.m-empty-icon {
  display: flex;
  width: 60px;
  height: 60px;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  border-radius: 20px;
  background: var(--m-primary-soft);
  color: var(--m-primary);
}
.m-empty-icon .m-icon {
  width: 28px;
  height: 28px;
}
.m-empty-title {
  color: var(--m-text);
  font-size: 14px;
  font-weight: 700;
}
.m-empty-desc {
  max-width: 300px;
  margin-top: 5px;
  color: var(--m-text-secondary);
  font-size: 12.5px;
  line-height: 1.7;
}
.m-empty .m-btn {
  margin-top: 16px;
}
.m-skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: var(--m-grey-200);
}
[data-theme='dark'] .m-skeleton {
  background: #28323d;
}
.m-skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  animation: m-shimmer 1.4s infinite;
}
[data-theme='dark'] .m-skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
}
.m-alert {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 11px;
  background: var(--m-primary-soft);
  color: var(--m-primary-dark);
  font-size: 12.5px;
  line-height: 1.6;
}
[data-theme='dark'] .m-alert {
  color: var(--m-primary-light);
}
.m-alert--warning {
  background: rgba(255, 171, 0, 0.12);
  color: #b76e00;
}
.m-alert--danger {
  background: rgba(255, 86, 48, 0.1);
  color: #b71d18;
}

/* ---------------------------------------------------------------------
   Misc
   --------------------------------------------------------------------- */
.m-divider {
  height: 1px;
  background: var(--m-divider);
}
.m-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.m-dot--pulse {
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
  animation: m-pulse 2s infinite;
}
.m-kbd {
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 1px solid var(--m-border);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--m-paper);
  color: var(--m-text-secondary);
  font-family: var(--m-mono);
  font-size: 10px;
}
.m-link {
  color: var(--m-primary);
  font-weight: 600;
  cursor: pointer;
}
.m-link:hover {
  text-decoration: underline;
}
.m-mono {
  font-family: var(--m-mono);
  font-variant-numeric: tabular-nums;
}
.m-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.m-muted {
  color: var(--m-text-secondary);
}
.m-amount {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.u-flex { display: flex; }
.u-items-center { align-items: center; }
.u-justify-between { justify-content: space-between; }
.u-gap-4 { gap: 4px; }
.u-gap-8 { gap: 8px; }
.u-gap-12 { gap: 12px; }
.u-gap-16 { gap: 16px; }
.u-grow { flex: 1; }
.u-text-right { text-align: right; }
.u-text-center { text-align: center; }
.u-mt-8 { margin-top: 8px; }
.u-mt-12 { margin-top: 12px; }
.u-mt-16 { margin-top: 16px; }
.u-mt-24 { margin-top: 24px; }
.u-mb-16 { margin-bottom: 16px; }
.u-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;
}

@keyframes m-spin { to { transform: rotate(360deg); } }
@keyframes m-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes m-modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes m-slide-left {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}
@keyframes m-toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes m-toast-out {
  to { opacity: 0; transform: translateY(-6px); }
}
@keyframes m-shimmer { 100% { transform: translateX(100%); } }
@keyframes m-pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
@keyframes m-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes m-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.m-animate-rise { animation: m-rise 0.4s var(--m-ease) both; }

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