:root {
  --bg: #f5f1fb;
  --bg-deep: #efe8fa;
  --surface: #ffffff;
  --surface-soft: #faf7ff;
  --primary: #7b5cc4;
  --primary-dark: #6446ad;
  --primary-soft: #ede5fb;
  --primary-100: #f4efff;
  --accent: #c4a7f2;
  --accent-soft: #f0e9ff;
  --text: #2f283b;
  --text-soft: #575064;
  --muted: #8c8499;
  --line: #ebe4f4;
  --success: #4f9d83;
  --success-soft: #e8f5ef;
  --warning: #c98848;
  --warning-soft: #fbf0e2;
  --danger: #c66f83;
  --danger-soft: #fbe9ee;
  --info: #5b86b9;
  --info-soft: #eaf1fb;
  --shadow-sm: 0 8px 24px rgba(83, 57, 128, 0.06);
  --shadow: 0 20px 55px rgba(83, 57, 128, 0.1);
  --shadow-lg: 0 32px 90px rgba(83, 57, 128, 0.16);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;
  --radius-xl: 34px;
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

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

h1,
h2,
h3,
h4 {
  letter-spacing: -0.02em;
}

svg {
  display: block;
}

.hidden {
  display: none !important;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(8px);
  pointer-events: none;
}

.ambient-a {
  width: 520px;
  height: 520px;
  top: -220px;
  right: -140px;
  background: radial-gradient(circle, rgba(196, 167, 242, 0.4), transparent 68%);
}

.ambient-b {
  width: 620px;
  height: 620px;
  bottom: -340px;
  left: -240px;
  background: radial-gradient(circle, rgba(224, 208, 250, 0.48), transparent 70%);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.soft-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 99px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ---------- Login ---------- */

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 38px 24px;
}

.login-card {
  width: min(1120px, 100%);
  min-height: 660px;
  display: grid;
  grid-template-columns: 1.06fr 0.94fr;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.25, 1) both;
}

.login-brand {
  position: relative;
  overflow: hidden;
  padding: 44px 48px;
  display: flex;
  flex-direction: column;
  color: #fff;
  background:
    radial-gradient(circle at 88% 16%, rgba(255, 255, 255, 0.22), transparent 30%),
    radial-gradient(circle at 12% 92%, rgba(255, 221, 181, 0.2), transparent 32%),
    linear-gradient(145deg, #7b5cc4 0%, #8f6ed1 50%, #a987df 100%);
}

.login-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image: radial-gradient(rgba(255, 255, 255, 0.75) 0.8px, transparent 0.8px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, #000, transparent 66%);
  pointer-events: none;
}

.brand-lockup {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
}

.brand-lockup.light {
  color: #fff;
}

.brand-lockup strong {
  display: block;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

.login-brand .brand-lockup strong {
  font-size: 20px;
  letter-spacing: 0.06em;
}

.brand-lockup small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.brand-lockup.light small {
  color: rgba(255, 255, 255, 0.7);
}

.logo-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: block;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(73, 44, 122, 0.2);
}

.logo-mark svg {
  width: 100%;
  height: 100%;
}

.login-copy {
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding-top: 80px;
}

.login-copy .eyebrow {
  color: rgba(255, 255, 255, 0.68);
}

.login-copy h1 {
  margin-top: 16px;
  font-size: clamp(34px, 3.8vw, 52px);
  font-weight: 760;
  line-height: 1.16;
  letter-spacing: -0.045em;
}

.login-copy p {
  max-width: 390px;
  margin-top: 22px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  line-height: 1.9;
}

.login-features {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 34px;
}

.login-features span {
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.88);
  font-size: 11px;
  backdrop-filter: blur(8px);
}

.login-orbit {
  position: absolute;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  pointer-events: none;
}

.orbit-one {
  width: 360px;
  height: 360px;
  right: -170px;
  top: 120px;
}

.orbit-two {
  width: 210px;
  height: 210px;
  right: -70px;
  top: 195px;
}

.login-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 54px 56px;
  background: linear-gradient(180deg, #fff 0%, #fdfbff 100%);
}

.login-form-head h2 {
  margin-top: 13px;
  font-size: 28px;
  font-weight: 760;
  letter-spacing: -0.04em;
}

.login-form-head p {
  max-width: 340px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 30px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field > span,
.field-label {
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.field input,
.field select,
.field textarea,
.input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fcfaff;
  color: var(--text);
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.field input::placeholder,
.field textarea::placeholder,
.input::placeholder {
  color: #b5adbf;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.input:focus {
  border-color: #b79ce5;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(123, 92, 196, 0.09);
}

.field textarea {
  min-height: 84px;
  resize: vertical;
}

.form-error {
  min-height: 18px;
  color: var(--danger);
  font-size: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, #8666cf, #6e4fba);
  color: #fff;
  box-shadow: 0 10px 24px rgba(111, 79, 186, 0.24);
}

.btn-primary:hover {
  box-shadow: 0 14px 30px rgba(111, 79, 186, 0.3);
}

.btn-soft {
  border-color: #e6dcf8;
  background: var(--primary-100);
  color: var(--primary-dark);
}

.btn-soft:hover {
  background: var(--primary-soft);
}

.btn-ghost {
  border-color: var(--line);
  background: #fff;
  color: var(--text-soft);
}

.btn-ghost:hover {
  border-color: #d9c9f2;
  background: #fcfaff;
}

.btn-danger {
  border-color: #f0d2da;
  background: var(--danger-soft);
  color: var(--danger);
}

.btn-wide {
  width: 100%;
}

.btn-lg {
  min-height: 48px;
  border-radius: 14px;
  font-size: 14px;
}

.btn-sm {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 11.5px;
}

.btn-arrow {
  margin-left: auto;
  font-size: 16px;
  transition: transform 0.18s ease;
}

.btn > svg,
.section-link > svg,
.link-action > svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.btn:hover .btn-arrow {
  transform: translateX(3px);
}

.demo-accounts {
  margin-top: 26px;
}

.demo-title {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.demo-title i {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.demo-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: 0.16s ease;
}

.demo-chip:hover {
  border-color: #ccb8ed;
  background: var(--primary-100);
}

.demo-chip strong {
  font-size: 11.5px;
  color: var(--text);
}

.demo-chip small {
  font-size: 10px;
  color: var(--muted);
}

.login-foot {
  margin-top: 28px;
  color: #b6aec0;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.login-foot span {
  margin-left: 8px;
  color: #c9c1d2;
}

/* ---------- App shell ---------- */

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 20;
  top: 0;
  bottom: 0;
  left: 0;
  width: 252px;
  display: flex;
  flex-direction: column;
  padding: 24px 16px 18px;
  border-right: 1px solid rgba(231, 223, 243, 0.9);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(24px);
}

.sidebar .brand-lockup {
  padding: 0 8px;
}

.sidebar .logo-mark {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
}

.workspace-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 26px 4px 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  cursor: pointer;
}

.workspace-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8d6bd0;
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.workspace-switch span:nth-child(2) {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.workspace-switch small {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.workspace-switch strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chevron {
  margin-left: auto;
  color: var(--muted);
  font-size: 16px;
}

.main-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
}

.nav-label {
  padding: 14px 12px 6px;
  color: #b0a7ba;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 0 12px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: #6e6679;
  cursor: pointer;
  text-align: left;
  transition: 0.16s ease;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
  opacity: 0.82;
}

.nav-item span {
  font-size: 12.5px;
  font-weight: 600;
}

.nav-item:hover {
  background: #faf7ff;
  color: var(--primary-dark);
}

.nav-item.active {
  background: linear-gradient(135deg, #f0e8ff, #f7f2ff);
  color: var(--primary-dark);
  font-weight: 700;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--primary);
}

.nav-item .nav-count {
  margin-left: auto;
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 99px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 9px;
  text-align: center;
}

.sidebar-bottom {
  margin-top: auto;
}

.sidebar-note {
  position: relative;
  overflow: hidden;
  margin: 10px 4px 14px;
  padding: 15px 14px;
  border: 1px solid #eee4fb;
  border-radius: 16px;
  background:
    radial-gradient(circle at 92% 8%, rgba(196, 167, 242, 0.3), transparent 32%),
    linear-gradient(145deg, #fbf7ff, #f6efff);
}

.note-icon {
  display: inline-flex;
  color: #9c79d4;
  font-size: 15px;
}

.sidebar-note p {
  margin-top: 6px;
  color: #8a7e97;
  font-size: 10.5px;
  line-height: 1.65;
}

.user-mini {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.user-mini:hover {
  background: #faf7ff;
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 12px;
  background: linear-gradient(145deg, #efe6ff, #ddcdf7);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
}

.avatar.lg {
  width: 46px;
  height: 46px;
  flex-basis: 46px;
  border-radius: 15px;
  font-size: 15px;
}

.user-mini-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-mini-copy strong {
  overflow: hidden;
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-mini-copy small {
  color: var(--muted);
  font-size: 9.5px;
}

.logout-link {
  width: 100%;
  margin-top: 2px;
  padding: 7px;
  border: 0;
  background: transparent;
  color: #b2a9bc;
  font-size: 10px;
  cursor: pointer;
}

.logout-link:hover {
  color: var(--danger);
}

.main {
  min-height: 100vh;
  margin-left: 252px;
}

.topbar {
  position: sticky;
  z-index: 15;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 32px 14px;
  background: linear-gradient(180deg, rgba(245, 241, 251, 0.96), rgba(245, 241, 251, 0.78) 72%, transparent);
  backdrop-filter: blur(12px);
}

.topbar-title h1 {
  margin-top: 3px;
  font-size: 23px;
  font-weight: 760;
  letter-spacing: -0.035em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.global-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 230px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  transition: 0.16s ease;
}

.global-search:focus-within {
  border-color: #cbb7ec;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(123, 92, 196, 0.06);
}

.global-search svg {
  width: 16px;
  height: 16px;
  stroke: var(--muted);
  stroke-width: 1.7;
  fill: none;
}

.global-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 11.5px;
}

.global-search kbd {
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fbf9ff;
  color: #aaa1b5;
  font-family: inherit;
  font-size: 8px;
}

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text-soft);
  cursor: pointer;
}

.icon-btn:hover {
  border-color: #d8c8ef;
  background: #fff;
}

.icon-btn svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
}

.notify-dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 5px;
  height: 5px;
  border: 1.5px solid #fff;
  border-radius: 50%;
  background: #cb7890;
}

.content {
  max-width: 1480px;
  padding: 12px 32px 48px;
  animation: fade-up 0.35s ease both;
}

.mobile-nav {
  display: none;
}

/* ---------- Common content ---------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.page-head h2 {
  display: none;
  font-size: 22px;
  font-weight: 760;
}

.page-head.with-title h2 {
  display: block;
}

.page-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11.5px;
}

.page-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 30px;
  border-radius: var(--radius-lg);
  color: #fff;
  background:
    radial-gradient(circle at 78% 8%, rgba(255, 255, 255, 0.24), transparent 30%),
    radial-gradient(circle at 18% 110%, rgba(255, 221, 183, 0.22), transparent 32%),
    linear-gradient(135deg, #7657bd, #8d6cd0 55%, #a987df);
  box-shadow: 0 22px 55px rgba(103, 72, 167, 0.22);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  pointer-events: none;
}

.hero::before {
  width: 300px;
  height: 300px;
  right: -120px;
  top: -120px;
}

.hero::after {
  width: 180px;
  height: 180px;
  right: -48px;
  top: -60px;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-copy .eyebrow {
  color: rgba(255, 255, 255, 0.68);
}

.hero-copy h2 {
  margin-top: 9px;
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 730;
  letter-spacing: -0.04em;
  line-height: 1.2;
}

.hero-copy p {
  margin-top: 9px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
}

.hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hero .btn-ghost {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  backdrop-filter: blur(8px);
}

.hero .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.18);
}

.hero .btn-light {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 10px 24px rgba(53, 30, 96, 0.16);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 16px;
  border: 1px solid rgba(235, 228, 244, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -24px;
  top: -28px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--tint, var(--primary-100));
  opacity: 0.8;
}

.stat-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--tint, var(--primary-100));
  color: var(--tone, var(--primary));
}

.stat-icon svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
}

.stat-label {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
}

.stat-value {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  font-size: 26px;
  font-weight: 780;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.stat-sub {
  position: relative;
  z-index: 1;
  margin-top: 5px;
  color: #a39aad;
  font-size: 9.5px;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(320px, 0.82fr);
  gap: 14px;
  margin-top: 14px;
}

.card {
  border: 1px solid rgba(235, 228, 244, 0.92);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
}

.card-pad {
  padding: 20px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.section-head h3 {
  font-size: 14.5px;
  font-weight: 740;
}

.section-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}

.section-link:hover {
  color: var(--primary-dark);
}

.bar-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.bar-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 56px;
  align-items: center;
  gap: 10px;
}

.bar-name {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: #f2edf9;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #b99ce7, #7b5cc4);
  transform-origin: left;
  animation: grow 0.7s cubic-bezier(0.2, 0.7, 0.25, 1) both;
}

.bar-value {
  display: block;
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

.alert-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alert-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  background: #fcfaff;
  border: 1px solid #f1ebfa;
}

.alert-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #d39a61;
  box-shadow: 0 0 0 4px #fbf0e3;
}

.alert-copy {
  min-width: 0;
  flex: 1;
}

.alert-copy strong {
  display: block;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-copy small {
  color: var(--muted);
  font-size: 9.5px;
}

.alert-qty {
  color: #c28045;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.empty-mini {
  padding: 22px 10px;
  color: #aaa1b5;
  font-size: 10.5px;
  text-align: center;
}

/* ---------- Toolbars, tables, pills ---------- */

.toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.toolbar .search-field {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 220px;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.toolbar .search-field svg {
  width: 15px;
  height: 15px;
  stroke: var(--muted);
  stroke-width: 1.8;
  fill: none;
}

.toolbar .search-field input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 11.5px;
}

.select-mini {
  height: 36px;
  padding: 0 30px 0 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background-color: #fff;
  color: var(--text-soft);
  font-size: 11.5px;
  outline: 0;
}

.select-mini:focus {
  border-color: #cbb7ec;
  box-shadow: 0 0 0 4px rgba(123, 92, 196, 0.06);
}

.toolbar-spacer {
  flex: 1;
}

.table-card {
  overflow: hidden;
  border: 1px solid rgba(235, 228, 244, 0.9);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-sm);
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

.data-table th {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbf8ff;
  color: #9b92a7;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
}

.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #f4effa;
  color: var(--text-soft);
  font-size: 11.5px;
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 0.15s ease;
}

.data-table tbody tr:hover {
  background: #fcfaff;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.material-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 210px;
}

.material-thumb {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
  background: linear-gradient(145deg, #f3edff, #e8ddfb);
  color: #8b69c7;
  font-size: 11px;
  font-weight: 800;
}

.material-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.material-meta strong {
  overflow: hidden;
  color: var(--text);
  font-size: 11.8px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-meta small {
  color: var(--muted);
  font-size: 9.5px;
}

.code-text {
  color: #a49bad;
  font-size: 10px;
  letter-spacing: 0.03em;
}

.num {
  font-variant-numeric: tabular-nums;
}

.num-strong {
  color: var(--text);
  font-weight: 750;
}

.num-danger {
  color: var(--danger);
  font-weight: 750;
}

.num-success {
  color: var(--success);
  font-weight: 700;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 99px;
  background: var(--primary-100);
  color: var(--primary-dark);
  font-size: 9.5px;
  font-weight: 700;
  white-space: nowrap;
}

.pill.success {
  background: var(--success-soft);
  color: var(--success);
}

.pill.warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.pill.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.pill.info {
  background: var(--info-soft);
  color: var(--info);
}

.pill.neutral {
  background: #f2eff7;
  color: #8a8194;
}

.pill .pill-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.row-actions {
  display: flex;
  gap: 5px;
  align-items: center;
}

.link-action {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  padding: 3px 4px;
}

.link-action:hover {
  color: var(--primary-dark);
}

.link-action.danger {
  color: var(--danger);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  padding: 40px 20px;
  text-align: center;
}

.empty-illustration {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 24px;
  background: linear-gradient(145deg, #f3edff, #ebe1fb);
  color: #9b7bd0;
  font-size: 26px;
}

.empty-state h3 {
  margin-top: 16px;
  font-size: 15px;
}

.empty-state p {
  max-width: 340px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.empty-state .btn {
  margin-top: 16px;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  color: var(--muted);
  font-size: 11px;
}

.spinner {
  width: 18px;
  height: 18px;
  margin-right: 9px;
  border: 2px solid #e9e0f8;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ---------- Tabs ---------- */

.tabs {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.tab {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 10.8px;
  font-weight: 650;
  cursor: pointer;
}

.tab:hover {
  color: var(--primary-dark);
}

.tab.active {
  background: var(--primary-100);
  color: var(--primary-dark);
  font-weight: 750;
}

/* ---------- Forms / modal ---------- */

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-grid .span-2 {
  grid-column: span 2;
}

.inline-fields {
  display: flex;
  gap: 10px;
}

.inline-fields > * {
  flex: 1;
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(45, 35, 60, 0.35);
  backdrop-filter: blur(8px);
  animation: fade 0.2s ease both;
}

.modal {
  width: min(680px, 100%);
  max-height: min(86vh, 900px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-lg);
  animation: pop 0.25s cubic-bezier(0.2, 0.8, 0.25, 1) both;
}

.modal.wide {
  width: min(960px, 100%);
}

.modal-head {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid #f2edf8;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}

.modal-head h3 {
  font-size: 17px;
  font-weight: 750;
}

.modal-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
}

.modal-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
}

.modal-close:hover {
  background: #fbf8ff;
  color: var(--text);
}

.modal-body {
  padding: 20px 22px 22px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
}

.detail-block {
  padding: 14px;
  border: 1px solid #f0e9f8;
  border-radius: 14px;
  background: #fdfbff;
}

.detail-block h4 {
  margin-bottom: 9px;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 750;
}

.kv-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.kv-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 10.8px;
}

.kv-row span {
  color: var(--muted);
}

.kv-row strong {
  color: var(--text);
  font-weight: 650;
  text-align: right;
}

.mini-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mini-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 9px;
  background: #fff;
  border: 1px solid #f3eef9;
  font-size: 10.3px;
}

.mini-row span {
  color: var(--muted);
}

/* ---------- Order form ---------- */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 10.5px;
}

.breadcrumb button {
  border: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  padding: 0;
}

.order-form-card {
  padding: 22px;
}

.order-type-switch {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.type-card {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fdfbff;
  cursor: pointer;
}

.type-card.active {
  border-color: #cdb8ee;
  background: var(--primary-100);
  box-shadow: 0 0 0 3px rgba(123, 92, 196, 0.05);
}

.type-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #fff;
  color: var(--primary);
  font-size: 16px;
  font-weight: 700;
}

.type-card strong {
  display: block;
  font-size: 12px;
}

.type-card small {
  color: var(--muted);
  font-size: 9.5px;
}

.items-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0 9px;
}

.items-head h3 {
  font-size: 13px;
}

.item-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.6fr) 86px 96px 1fr 32px;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f4effa;
}

.item-row:last-child {
  border-bottom: 0;
}

.item-row select,
.item-row input {
  width: 100%;
  height: 35px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fcfaff;
  padding: 0 9px;
  font-size: 11px;
  outline: none;
}

.item-row select:focus,
.item-row input:focus {
  border-color: #cbb7ec;
  box-shadow: 0 0 0 3px rgba(123, 92, 196, 0.06);
}

.item-remove {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid #f1dde3;
  border-radius: 9px;
  background: #fff8fa;
  color: var(--danger);
  cursor: pointer;
}

.order-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #f1ebf8;
}

.order-total {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.order-total strong {
  color: var(--text);
  font-size: 22px;
  font-weight: 780;
  letter-spacing: -0.03em;
}

.order-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- Detail / timeline ---------- */

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
}

.detail-title h2 {
  font-size: 20px;
  font-weight: 760;
}

.detail-title p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
}

.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  border-top: 1px solid #f2edf8;
  border-bottom: 1px solid #f2edf8;
  background: #f2edf8;
}

.detail-stat {
  padding: 14px 18px;
  background: #fff;
}

.detail-stat small {
  color: var(--muted);
  font-size: 9.5px;
}

.detail-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  font-weight: 750;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-item {
  position: relative;
  padding: 0 0 18px 24px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 7px;
  height: 7px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 1px #cbb7ec;
}

.timeline-item::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 15px;
  bottom: 2px;
  width: 1px;
  background: #eee6f7;
}

.timeline-item:last-child::after {
  display: none;
}

.timeline-item strong {
  display: block;
  font-size: 11px;
}

.timeline-item small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9.5px;
}

/* ---------- Import ---------- */

.import-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
  align-items: start;
}

.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 190px;
  padding: 24px;
  border: 1.5px dashed #d4c2ef;
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 0%, rgba(196, 167, 242, 0.16), transparent 42%),
    #fdfbff;
  text-align: center;
  cursor: pointer;
  transition: 0.18s ease;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--primary);
  background: #faf6ff;
}

.drop-zone .drop-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--primary-100);
  color: var(--primary);
  font-size: 22px;
}

.drop-zone .drop-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.drop-zone h3 {
  margin-top: 12px;
  font-size: 14px;
}

.drop-zone p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10.5px;
}

.drop-zone small {
  margin-top: 10px;
  color: #b5acc0;
  font-size: 9px;
}

.mapping-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.mapping-grid .field {
  gap: 5px;
}

.mapping-grid select {
  height: 34px;
  padding: 0 8px;
  font-size: 10.5px;
}

.preview-scroll {
  max-height: 260px;
  overflow: auto;
  margin-top: 12px;
  border: 1px solid #eee7f7;
  border-radius: 13px;
}

.preview-scroll .data-table th,
.preview-scroll .data-table td {
  padding: 8px 10px;
  font-size: 10px;
}

.source-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.source-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid #f0e9f8;
  border-radius: 12px;
  background: #fdfbff;
}

.source-item strong {
  display: block;
  font-size: 11px;
}

.source-item small {
  color: var(--muted);
  font-size: 9.5px;
}

.note-box {
  padding: 12px 14px;
  border: 1px solid #eee4fb;
  border-radius: 13px;
  background: #fbf8ff;
  color: #8e819c;
  font-size: 10.3px;
  line-height: 1.75;
}

/* ---------- Settings ---------- */

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.role-card {
  padding: 12px;
  border: 1px solid #f0e9f8;
  border-radius: 12px;
  background: #fdfbff;
}

.role-card strong {
  display: block;
  font-size: 11px;
}

.role-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.6;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid #eee5f9;
  border-radius: 18px;
  background:
    radial-gradient(circle at 94% 8%, rgba(196, 167, 242, 0.2), transparent 32%),
    linear-gradient(145deg, #fdfbff, #f8f2ff);
}

.profile-card h3 {
  font-size: 16px;
}

.profile-card p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
}

/* ---------- Toast ---------- */

.toast-root {
  position: fixed;
  z-index: 200;
  top: 22px;
  right: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 230px;
  max-width: 360px;
  padding: 12px 14px;
  border: 1px solid #e9e1f4;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 40px rgba(60, 38, 96, 0.16);
  color: var(--text);
  font-size: 11.5px;
  backdrop-filter: blur(10px);
  animation: toast-in 0.28s ease both;
}

.toast::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--success);
}

.toast.error::before {
  background: var(--danger);
}

.toast.warning::before {
  background: var(--warning);
}

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
  .topbar {
    padding-inline: 24px;
  }

  .content {
    padding-inline: 24px;
  }

  .global-search {
    width: 180px;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .import-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  body {
    font-size: 13.5px;
  }

  .login-shell {
    padding: 0;
  }

  .login-card {
    min-height: 100vh;
    grid-template-columns: 1fr;
    border-radius: 0;
    border: 0;
  }

  .login-brand {
    min-height: 238px;
    padding: 24px 24px;
  }

  .login-copy {
    padding-top: 22px;
  }

  .login-copy h1 {
    font-size: 31px;
  }

  .login-copy p {
    display: none;
  }

  .login-features {
    margin-top: 12px;
  }

  .login-form-panel {
    padding: 26px 24px 34px;
  }

  .sidebar {
    display: none;
  }

  .main {
    margin-left: 0;
  }

  .topbar {
    padding: 16px 16px 10px;
    gap: 10px;
  }

  .topbar-title .eyebrow {
    font-size: 8.5px;
  }

  .topbar-title h1 {
    font-size: 20px;
  }

  .global-search,
  .topbar-actions .icon-btn {
    display: none;
  }

  .top-action {
    min-height: 34px;
    padding: 0 10px;
    font-size: 10.5px;
  }

  .content {
    padding: 8px 16px calc(96px + env(safe-area-inset-bottom));
  }

  .mobile-nav {
    position: fixed;
    z-index: 30;
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 7px 6px;
    border: 1px solid rgba(233, 225, 246, 0.9);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 18px 50px rgba(70, 45, 110, 0.16);
    backdrop-filter: blur(18px);
  }

  .mobile-nav .nav-item {
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-height: 48px;
    padding: 4px;
    border-radius: 13px;
    text-align: center;
  }

  .mobile-nav .nav-item span {
    font-size: 9px;
  }

  .mobile-nav .nav-item svg {
    width: 19px;
    height: 19px;
  }

  .mobile-nav .nav-item.active::before {
    display: none;
  }

  .mobile-nav .nav-item.active {
    background: var(--primary-100);
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 22px 20px;
  }

  .hero-copy h2 {
    font-size: 25px;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions .btn {
    flex: 1;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .stat-card {
    padding: 14px;
    border-radius: 16px;
  }

  .stat-value {
    font-size: 23px;
  }

  .two-col {
    gap: 10px;
    margin-top: 10px;
  }

  .card {
    border-radius: 20px;
  }

  .card-pad {
    padding: 15px;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .page-head-actions {
    width: 100%;
  }

  .page-head-actions .btn {
    flex: 1;
  }

  .toolbar {
    gap: 7px;
  }

  .toolbar .search-field {
    width: 100%;
    min-width: 0;
  }

  .toolbar-spacer {
    display: none;
  }

  .data-table {
    min-width: 740px;
  }

  .materials-table {
    min-width: 0;
    white-space: normal;
  }

  .materials-table th:nth-child(2),
  .materials-table td:nth-child(2),
  .materials-table th:nth-child(3),
  .materials-table td:nth-child(3),
  .materials-table th:nth-child(4),
  .materials-table td:nth-child(4),
  .materials-table th:nth-child(6),
  .materials-table td:nth-child(6),
  .materials-table th:nth-child(7),
  .materials-table td:nth-child(7) {
    display: none;
  }

  .materials-table th:nth-child(1),
  .materials-table td:nth-child(1) {
    width: 58%;
  }

  .materials-table th:nth-child(5),
  .materials-table td:nth-child(5) {
    width: 24%;
  }

  .materials-table th:nth-child(8),
  .materials-table td:nth-child(8) {
    width: 18%;
  }

  .desktop-only {
    display: none !important;
  }

  .materials-table .material-cell {
    min-width: 0;
  }

  .materials-table .material-meta strong {
    white-space: normal;
  }

  .table-card {
    border-radius: 18px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .span-2 {
    grid-column: span 1;
  }

  .item-row {
    grid-template-columns: 1fr 72px 30px;
    gap: 7px;
    padding: 9px 0;
  }

  .item-row .item-price,
  .item-row .item-batch {
    display: none;
  }

  .order-foot {
    flex-direction: column;
    align-items: stretch;
  }

  .order-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .detail-head {
    flex-direction: column;
  }

  .detail-stats {
    grid-template-columns: 1fr 1fr;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    padding: 10px;
    align-items: end;
  }

  .modal {
    max-height: 92vh;
    border-radius: 22px 22px 0 0;
  }

  .settings-grid,
  .role-grid {
    grid-template-columns: 1fr;
  }

  .mapping-grid {
    grid-template-columns: 1fr 1fr;
  }

  .toast-root {
    top: 12px;
    right: 12px;
    left: 12px;
  }

  .toast {
    min-width: 0;
    max-width: none;
  }
}

@media (max-width: 520px) {
  .login-copy h1 {
    font-size: 30px;
  }

  .login-features span:nth-child(3) {
    display: none;
  }

  .topbar-actions .top-action:first-of-type {
    display: none;
  }

  .stat-grid {
    gap: 8px;
  }

  .stat-value {
    font-size: 21px;
  }

  .bar-row {
    grid-template-columns: 64px minmax(0, 1fr) 48px;
    gap: 7px;
  }

  .mapping-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  .sidebar,
  .topbar,
  .mobile-nav,
  .detail-actions,
  .breadcrumb,
  .toast-root {
    display: none !important;
  }

  .main {
    margin-left: 0;
  }

  .content {
    padding: 0;
  }

  .card,
  .table-card {
    box-shadow: none;
    border-color: #ddd;
  }
}

/* ---------- Animations ---------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
