:root {
  --ink: #18312d;
  --ink-soft: #5d6d69;
  --ink-faint: #8b9794;
  --green-950: #103a33;
  --green-900: #17483f;
  --green-800: #215a4f;
  --green-700: #347266;
  --green-500: #78a294;
  --green-200: #c9ddd5;
  --green-100: #e4eee9;
  --green-50: #f0f6f3;
  --cream: #f6f3ed;
  --cream-deep: #ece7de;
  --surface: #fffdf9;
  --surface-strong: #ffffff;
  --rose: #d69d95;
  --rose-soft: #f2d8d2;
  --rose-pale: #f9ebe7;
  --apricot: #f1bd72;
  --apricot-soft: #f8e5c5;
  --blue: #7297a5;
  --blue-soft: #e3edf0;
  --danger: #b65555;
  --danger-soft: #f8e5e2;
  --success: #2f7962;
  --success-soft: #e1f1ea;
  --line: #e6e3dc;
  --shadow-sm: 0 2px 10px rgb(32 53 47 / 5%);
  --shadow-md: 0 12px 35px rgb(32 53 47 / 10%);
  --shadow-lg: 0 24px 70px rgb(22 55 48 / 18%);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --sidebar-width: 248px;
  --mobile-nav-height: 74px;
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Noto Sans CJK SC", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.is-hidden {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--cream);
  touch-action: pan-x pan-y;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 84% 0%, rgb(233 183 174 / 13%), transparent 27rem),
    var(--cream);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgb(52 114 102 / 25%);
  outline-offset: 2px;
}

a {
  color: inherit;
}

.svg-sprite {
  position: fixed;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.offline-banner {
  position: fixed;
  z-index: 1000;
  top: 0;
  right: 0;
  left: 0;
  padding: 8px 16px;
  background: var(--ink);
  color: #fff;
  text-align: center;
  font-size: 12px;
}

/* Authentication */

.auth-gate {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: calc(28px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 15% 12%, rgb(214 157 149 / 20%), transparent 24rem),
    radial-gradient(circle at 90% 85%, rgb(120 162 148 / 20%), transparent 28rem),
    var(--cream);
}

.auth-card {
  width: min(100%, 430px);
  border: 1px solid rgb(23 72 63 / 8%);
  border-radius: var(--radius-xl);
  background: rgb(255 253 249 / 94%);
  padding: 38px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 38px;
}

.auth-brand strong,
.auth-brand small {
  display: block;
}

.auth-brand strong {
  font-family: "Songti SC", "STSong", serif;
  font-size: 21px;
  letter-spacing: 0.12em;
}

.auth-brand small {
  margin-top: -2px;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.17em;
}

.auth-eyebrow {
  margin: 0 0 8px;
  color: var(--rose);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.auth-card h1 {
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(31px, 8vw, 40px);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.auth-message {
  min-height: 24px;
  margin: 9px 0 24px;
  color: var(--ink-soft);
}

.auth-form {
  display: grid;
  gap: 17px;
}

.auth-submit {
  width: 100%;
  min-height: 49px;
  justify-content: center;
  margin-top: 3px;
}

.auth-submit:disabled {
  cursor: wait;
  opacity: 0.65;
}

.auth-error {
  margin: -4px 0 0;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  padding: 9px 11px;
  color: var(--danger);
  font-size: 13px;
}

.auth-footnote {
  margin: 25px 0 0;
  color: var(--ink-faint);
  text-align: center;
  font-size: 11px;
}

.sync-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.sync-state::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--apricot);
  content: "";
}

.sync-state.synced::before {
  background: var(--success);
}

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

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

/* Sidebar */

.sidebar {
  position: fixed;
  z-index: 30;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  border-right: 1px solid rgb(23 72 63 / 8%);
  background: rgb(255 253 249 / 88%);
  padding: 28px 18px 20px;
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 38px;
  padding: 0 8px;
  background: transparent;
  text-align: left;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px 14px 14px 5px;
  background: var(--green-900);
  color: #fff;
  transform: rotate(-2deg);
}

.brand-mark .icon {
  width: 25px;
  height: 25px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: "Songti SC", "STSong", serif;
  font-size: 21px;
  letter-spacing: 0.12em;
}

.brand small {
  margin-top: -2px;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.17em;
}

.sidebar-nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  position: relative;
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 13px;
  width: 100%;
  border-radius: 13px;
  background: transparent;
  padding: 0 13px;
  color: var(--ink-soft);
  text-align: left;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-item:hover {
  background: var(--green-50);
  color: var(--green-900);
}

.nav-item.active {
  background: var(--green-900);
  color: #fff;
  box-shadow: 0 7px 18px rgb(23 72 63 / 17%);
}

.nav-item.active::before {
  position: absolute;
  left: -18px;
  width: 4px;
  height: 22px;
  border-radius: 0 4px 4px 0;
  background: var(--rose);
  content: "";
}

.nav-item span:not(.nav-count) {
  font-size: 14px;
  font-weight: 600;
}

.nav-count {
  min-width: 24px;
  margin-left: auto;
  border-radius: 999px;
  background: var(--rose-soft);
  padding: 2px 7px;
  color: #8e514d;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
}

.nav-item.active .nav-count {
  background: rgb(255 255 255 / 16%);
  color: #fff;
}

.sidebar-bottom {
  display: grid;
  gap: 13px;
  margin-top: auto;
}

.demo-profile {
  display: grid;
  grid-template-columns: 38px 1fr 18px;
  align-items: center;
  gap: 10px;
  width: 100%;
  border-top: 1px solid var(--line);
  background: transparent;
  padding: 17px 7px 0;
  text-align: left;
}

.demo-profile strong,
.demo-profile small {
  display: block;
}

.demo-profile strong {
  font-size: 13px;
}

.demo-profile small {
  color: var(--ink-faint);
  font-size: 11px;
}

.demo-profile > .icon {
  width: 16px;
  color: var(--ink-faint);
}

.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--green-100);
  color: var(--green-900);
  font-size: 12px;
  font-weight: 800;
}

.avatar-owner {
  width: 38px;
  height: 38px;
  background: var(--rose-soft);
  color: #7d514e;
}

/* Main workspace */

.workspace {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.screen {
  width: min(100%, 1280px);
  margin: 0 auto;
  padding: 34px 42px 60px;
}

.page-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.page-title-wrap {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--green-700);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-title {
  margin: 0;
  font-family: "Songti SC", "STSong", Georgia, serif;
  font-size: clamp(27px, 3vw, 38px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.16;
}

.page-subtitle {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

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

.icon-button {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
}

.icon-button:hover {
  border-color: var(--green-200);
  color: var(--green-900);
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--rose);
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 13px;
  padding: 0 17px;
  font-size: 13px;
  font-weight: 700;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.primary-button {
  background: var(--green-900);
  color: #fff;
  box-shadow: 0 8px 18px rgb(23 72 63 / 16%);
}

.primary-button:hover {
  background: var(--green-800);
  transform: translateY(-1px);
}

.secondary-button {
  border: 1px solid var(--green-200);
  background: var(--green-50);
  color: var(--green-900);
}

.secondary-button:hover {
  background: var(--green-100);
}

.ghost-button {
  background: transparent;
  color: var(--ink-soft);
}

.ghost-button:hover {
  background: var(--cream);
  color: var(--ink);
}

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

.full-button {
  width: 100%;
}

.text-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 4px;
  background: transparent;
  color: var(--green-700);
  font-size: 12px;
  font-weight: 700;
}

.text-button .icon {
  width: 15px;
  height: 15px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Dashboard */

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(290px, 0.8fr);
  gap: 24px;
}

.dashboard-main,
.dashboard-side {
  display: grid;
  align-content: start;
  gap: 22px;
  min-width: 0;
}

.hero-card {
  position: relative;
  min-height: 218px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 92% 10%, rgb(255 255 255 / 13%) 0 8%, transparent 8.5%),
    radial-gradient(circle at 80% 72%, rgb(233 183 174 / 25%) 0 15%, transparent 15.5%),
    linear-gradient(135deg, var(--green-950), var(--green-800));
  padding: 27px 30px;
  color: #fff;
  box-shadow: var(--shadow-md);
}

.hero-card::after {
  position: absolute;
  right: -32px;
  bottom: -58px;
  width: 220px;
  height: 220px;
  border: 1px solid rgb(255 255 255 / 13%);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgb(255 255 255 / 4%), 0 0 0 58px rgb(255 255 255 / 3%);
  content: "";
}

.hero-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.hero-label {
  color: rgb(255 255 255 / 70%);
  font-size: 12px;
  font-weight: 600;
}

.period-pill {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 5px;
  border: 1px solid rgb(255 255 255 / 15%);
  border-radius: 999px;
  background: rgb(255 255 255 / 9%);
  padding: 0 12px;
  color: rgb(255 255 255 / 82%);
  font-size: 11px;
}

.hero-amount {
  position: relative;
  z-index: 1;
  margin: 18px 0 8px;
  font-size: clamp(37px, 5vw, 53px);
  font-weight: 740;
  letter-spacing: -0.045em;
  line-height: 1;
}

.hero-delta {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgb(255 255 255 / 72%);
  font-size: 12px;
}

.hero-delta strong {
  color: #bfe3d4;
}

.hero-stats {
  position: absolute;
  z-index: 2;
  right: 29px;
  bottom: 25px;
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 22px;
}

.hero-stat {
  min-width: 92px;
}

.hero-stat span,
.hero-stat strong {
  display: block;
}

.hero-stat span {
  color: rgb(255 255 255 / 58%);
  font-size: 10px;
}

.hero-stat strong {
  margin-top: 3px;
  font-size: 18px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.metric-card {
  min-width: 0;
  border: 1px solid rgb(23 72 63 / 6%);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.metric-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  background: var(--green-100);
  color: var(--green-800);
}

.metric-icon.rose {
  background: var(--rose-pale);
  color: #a56962;
}

.metric-icon.apricot {
  background: var(--apricot-soft);
  color: #9a6724;
}

.metric-icon .icon {
  width: 17px;
}

.metric-note {
  color: var(--ink-faint);
  font-size: 10px;
}

.metric-value {
  display: block;
  overflow: hidden;
  margin-top: 14px;
  font-size: clamp(20px, 2.5vw, 27px);
  font-weight: 760;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-label {
  display: block;
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 11px;
}

.content-card {
  border: 1px solid rgb(23 72 63 / 6%);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.content-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 21px 13px;
}

.content-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 750;
}

.content-card-subtitle {
  margin: 3px 0 0;
  color: var(--ink-faint);
  font-size: 11px;
}

.timeline-list {
  margin: 0;
  padding: 3px 20px 17px;
  list-style: none;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 52px 14px minmax(0, 1fr);
  gap: 10px;
  min-height: 67px;
  padding: 8px 0;
}

.timeline-item:not(:last-child)::after {
  position: absolute;
  top: 34px;
  bottom: -8px;
  left: 68px;
  width: 1px;
  background: var(--line);
  content: "";
}

.timeline-time {
  padding-top: 3px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
}

.timeline-dot {
  position: relative;
  z-index: 1;
  width: 11px;
  height: 11px;
  margin-top: 5px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--green-500);
  box-shadow: 0 0 0 1px var(--green-200);
}

.timeline-dot.rose {
  background: var(--rose);
  box-shadow: 0 0 0 1px var(--rose-soft);
}

.timeline-content {
  min-width: 0;
}

.timeline-content button {
  display: block;
  overflow: hidden;
  width: 100%;
  background: transparent;
  padding: 0;
  color: var(--ink);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 680;
}

.timeline-content p {
  overflow: hidden;
  margin: 3px 0 0;
  color: var(--ink-faint);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 3px 18px 18px;
}

.quick-action {
  display: flex;
  min-height: 76px;
  align-items: center;
  gap: 12px;
  border-radius: var(--radius-md);
  background: var(--cream);
  padding: 13px;
  color: var(--ink);
  text-align: left;
}

.quick-action:hover {
  background: var(--green-50);
}

.quick-action-icon {
  display: grid;
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  background: var(--surface);
  color: var(--green-800);
  box-shadow: var(--shadow-sm);
}

.quick-action strong,
.quick-action small {
  display: block;
}

.quick-action strong {
  font-size: 12px;
}

.quick-action small {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 9px;
}

.upcoming-list {
  display: grid;
  gap: 1px;
  padding: 0 12px 13px;
}

.upcoming-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  border-radius: 13px;
  background: transparent;
  padding: 10px;
  text-align: left;
}

.upcoming-row:hover {
  background: var(--cream);
}

.date-tile {
  display: grid;
  width: 40px;
  height: 45px;
  place-items: center;
  border-radius: 12px;
  background: var(--green-50);
  color: var(--green-900);
  line-height: 1;
}

.date-tile span,
.date-tile strong {
  display: block;
}

.date-tile span {
  align-self: end;
  padding-bottom: 2px;
  font-size: 9px;
  font-weight: 700;
}

.date-tile strong {
  align-self: start;
  font-size: 15px;
}

.upcoming-info {
  min-width: 0;
}

.upcoming-info strong,
.upcoming-info small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upcoming-info strong {
  font-size: 12px;
}

.upcoming-info small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 10px;
}

.upcoming-amount {
  font-size: 12px;
  font-weight: 750;
}

.insight-card {
  overflow: hidden;
  background: linear-gradient(145deg, #fff8f5, var(--surface));
}

.insight-body {
  display: flex;
  gap: 14px;
  padding: 0 20px 20px;
}

.insight-graphic {
  position: relative;
  display: grid;
  width: 73px;
  height: 73px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 24px 24px 24px 8px;
  background: var(--rose-soft);
  color: #9c645d;
}

.insight-graphic .icon {
  width: 30px;
  height: 30px;
}

.insight-copy p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.65;
}

.insight-copy strong {
  color: var(--ink);
}

.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--cream-deep);
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--green-700);
}

/* Generic lists and filters */

.toolbar {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 17px;
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 520px;
}

.search-box .icon {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 17px;
  height: 17px;
  color: var(--ink-faint);
  transform: translateY(-50%);
}

.search-input,
.field-input,
.field-select,
.field-textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-strong);
  box-shadow: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.search-input {
  height: 46px;
  padding: 0 14px 0 42px;
}

.search-input::placeholder,
.field-input::placeholder,
.field-textarea::placeholder {
  color: #a7aeac;
}

.search-input:focus,
.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  border-color: var(--green-500);
  outline: 0;
  box-shadow: 0 0 0 3px rgb(120 162 148 / 15%);
}

.filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  min-height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(255 253 249 / 65%);
  padding: 0 13px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
}

.filter-chip.active {
  border-color: var(--green-900);
  background: var(--green-900);
  color: #fff;
}

.list-summary {
  margin: 0 0 11px;
  color: var(--ink-faint);
  font-size: 11px;
}

/* Orders */

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

.order-card {
  display: grid;
  min-width: 0;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 14px;
  border: 1px solid rgb(23 72 63 / 7%);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 17px;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.order-card:hover {
  border-color: var(--green-200);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.order-date-block {
  display: grid;
  width: 58px;
  height: 61px;
  place-items: center;
  border-radius: 17px;
  background: var(--green-50);
  color: var(--green-900);
  line-height: 1;
}

.order-date-block.today {
  background: var(--rose-pale);
  color: #945b55;
}

.order-date-block span,
.order-date-block strong {
  display: block;
}

.order-date-block span {
  align-self: end;
  padding-bottom: 3px;
  font-size: 10px;
  font-weight: 750;
}

.order-date-block strong {
  align-self: start;
  font-size: 21px;
}

.order-card-main {
  min-width: 0;
}

.order-card-title-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.order-card-title {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 750;
}

.order-card-customer {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.order-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 13px;
  margin-top: 12px;
  color: var(--ink-faint);
  font-size: 10px;
}

.order-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.order-card-meta .icon {
  width: 13px;
  height: 13px;
}

.order-card-side {
  display: flex;
  min-width: 82px;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 11px;
}

.order-price {
  font-size: 15px;
  font-weight: 780;
}

.order-profit {
  color: var(--success);
  font-size: 10px;
}

.status-badge,
.payment-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.status-draft,
.status-pending {
  background: var(--cream-deep);
  color: #716c63;
}

.status-confirmed,
.status-purchase {
  background: var(--blue-soft);
  color: #547783;
}

.status-making,
.status-ready {
  background: var(--apricot-soft);
  color: #956522;
}

.status-delivery {
  background: var(--rose-pale);
  color: #995f58;
}

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

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

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

.payment-partial {
  background: var(--apricot-soft);
  color: #8f601f;
}

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

.empty-state {
  display: grid;
  min-height: 270px;
  place-items: center;
  border: 1px dashed var(--green-200);
  border-radius: var(--radius-lg);
  background: rgb(255 253 249 / 48%);
  padding: 35px;
  text-align: center;
}

.empty-state-icon {
  display: grid;
  width: 62px;
  height: 62px;
  margin: 0 auto 14px;
  place-items: center;
  border-radius: 21px 21px 21px 7px;
  background: var(--green-100);
  color: var(--green-800);
}

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

.empty-state p {
  max-width: 320px;
  margin: 7px auto 17px;
  color: var(--ink-soft);
  font-size: 12px;
}

/* Calendar */

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1.3fr) minmax(280px, 0.7fr);
  gap: 20px;
}

.calendar-card {
  padding: 21px;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.calendar-month {
  font-size: 17px;
  font-weight: 760;
}

.calendar-controls {
  display: flex;
  gap: 5px;
}

.calendar-control {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: var(--cream);
  color: var(--ink-soft);
}

.calendar-control .icon {
  width: 15px;
}

.calendar-control.prev .icon {
  transform: rotate(180deg);
}

.calendar-weekdays,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar-weekdays {
  margin-bottom: 7px;
}

.calendar-weekdays span {
  color: var(--ink-faint);
  text-align: center;
  font-size: 10px;
  font-weight: 650;
}

.calendar-day {
  position: relative;
  min-height: 76px;
  border-top: 1px solid var(--line);
  background: transparent;
  padding: 9px 7px;
  text-align: left;
}

.calendar-day:hover,
.calendar-day.selected {
  background: var(--green-50);
}

.calendar-day.other-month {
  color: #b8bfbd;
}

.calendar-day-number {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  font-size: 11px;
}

.calendar-day.today .calendar-day-number {
  background: var(--green-900);
  color: #fff;
  font-weight: 750;
}

.calendar-dots {
  display: flex;
  gap: 3px;
  margin: 7px 0 0 6px;
}

.calendar-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rose);
}

.calendar-dot:nth-child(2) {
  background: var(--green-500);
}

.calendar-dot:nth-child(3) {
  background: var(--apricot);
}

.agenda-card {
  min-width: 0;
}

.agenda-date {
  padding: 20px 20px 8px;
}

.agenda-date strong,
.agenda-date span {
  display: block;
}

.agenda-date strong {
  font-family: "Songti SC", "STSong", serif;
  font-size: 20px;
}

.agenda-date span {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 10px;
}

.agenda-list {
  display: grid;
  gap: 9px;
  padding: 10px 14px 15px;
}

.agenda-order {
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr) auto;
  gap: 11px;
  border-radius: 14px;
  background: var(--cream);
  padding: 12px;
  text-align: left;
}

.agenda-accent {
  border-radius: 99px;
  background: var(--rose);
}

.agenda-order strong,
.agenda-order small {
  display: block;
}

.agenda-order strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.agenda-order small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 10px;
}

.agenda-order > span:last-child {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.agenda-empty {
  padding: 36px 20px 48px;
  color: var(--ink-faint);
  text-align: center;
  font-size: 12px;
}

/* Customers */

.customer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.customer-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
  border: 1px solid rgb(23 72 63 / 7%);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 16px;
  text-align: left;
  box-shadow: var(--shadow-sm);
}

.customer-card:hover {
  border-color: var(--green-200);
  box-shadow: var(--shadow-md);
}

.customer-card .avatar {
  width: 46px;
  height: 46px;
}

.customer-info {
  min-width: 0;
}

.customer-info strong,
.customer-info small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-info strong {
  font-size: 13px;
}

.customer-info small {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 10px;
}

.customer-stats {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 9px;
}

.customer-card > .icon {
  width: 15px;
  color: var(--ink-faint);
}

/* Expenses */

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--line);
}

.summary-strip-item {
  background: var(--surface);
  padding: 17px 20px;
}

.summary-strip-item span,
.summary-strip-item strong {
  display: block;
}

.summary-strip-item span {
  color: var(--ink-faint);
  font-size: 10px;
}

.summary-strip-item strong {
  margin-top: 4px;
  font-size: 20px;
}

.expense-list {
  overflow: hidden;
  border: 1px solid rgb(23 72 63 / 7%);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.expense-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 14px 18px;
}

.expense-row:not(:last-child) {
  border-bottom: 1px solid var(--line);
}

.expense-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 13px;
  background: var(--rose-pale);
  color: #a46c65;
}

.expense-icon .icon {
  width: 17px;
}

.expense-info {
  min-width: 0;
}

.expense-info strong,
.expense-info small {
  display: block;
}

.expense-info strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.expense-info small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 10px;
}

.expense-amount {
  font-size: 13px;
  font-weight: 750;
}

/* Reports */

.report-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 13px;
  margin-bottom: 20px;
}

.report-kpi {
  border: 1px solid rgb(23 72 63 / 7%);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 17px;
  box-shadow: var(--shadow-sm);
}

.report-kpi span,
.report-kpi strong,
.report-kpi small {
  display: block;
}

.report-kpi span {
  color: var(--ink-faint);
  font-size: 10px;
}

.report-kpi strong {
  margin-top: 7px;
  font-size: 22px;
}

.report-kpi small {
  margin-top: 3px;
  color: var(--success);
  font-size: 9px;
}

.reports-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: 20px;
}

.chart-card {
  padding-bottom: 20px;
}

.bar-chart {
  display: grid;
  min-height: 270px;
  grid-template-columns: repeat(6, 1fr);
  align-items: end;
  gap: 15px;
  padding: 20px 23px 0;
}

.bar-group {
  display: grid;
  height: 230px;
  grid-template-rows: 1fr 19px;
  gap: 8px;
}

.bars {
  display: flex;
  height: 100%;
  align-items: end;
  justify-content: center;
  gap: 5px;
  border-bottom: 1px solid var(--line);
}

.bar {
  width: min(17px, 36%);
  min-height: 4px;
  border-radius: 6px 6px 2px 2px;
  background: var(--green-700);
  transition: height 400ms ease;
}

.bar.profit {
  background: var(--rose);
}

.bar-label {
  color: var(--ink-faint);
  text-align: center;
  font-size: 9px;
}

.chart-legend {
  display: flex;
  gap: 16px;
  padding: 0 23px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 9px;
}

.legend-swatch {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--green-700);
}

.legend-swatch.rose {
  background: var(--rose);
}

.cost-chart-body {
  display: grid;
  place-items: center;
  padding: 12px 20px 22px;
}

.donut {
  position: relative;
  display: grid;
  width: 150px;
  height: 150px;
  place-items: center;
  border-radius: 50%;
}

.donut::after {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--surface);
  content: "";
}

.donut-center {
  position: absolute;
  z-index: 1;
  text-align: center;
}

.donut-center strong,
.donut-center span {
  display: block;
}

.donut-center strong {
  font-size: 17px;
}

.donut-center span {
  color: var(--ink-faint);
  font-size: 9px;
}

.cost-legend {
  display: grid;
  width: 100%;
  gap: 9px;
  margin-top: 22px;
}

.cost-legend-row {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 10px;
}

.cost-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.cost-legend-row strong {
  color: var(--ink);
  font-size: 10px;
}

/* More and settings */

.more-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.more-card {
  display: grid;
  min-height: 128px;
  align-content: space-between;
  border: 1px solid rgb(23 72 63 / 7%);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 17px;
  text-align: left;
  box-shadow: var(--shadow-sm);
}

.more-card:hover {
  border-color: var(--green-200);
  transform: translateY(-1px);
}

.more-card-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 13px;
  background: var(--green-100);
  color: var(--green-800);
}

.more-card:nth-child(2n) .more-card-icon {
  background: var(--rose-pale);
  color: #a46c65;
}

.more-card strong,
.more-card small {
  display: block;
}

.more-card strong {
  margin-top: 15px;
  font-size: 13px;
}

.more-card small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 10px;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.7fr);
  gap: 20px;
}

.settings-card {
  overflow: hidden;
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 17px 20px;
}

.settings-row:not(:last-child) {
  border-bottom: 1px solid var(--line);
}

.settings-row strong,
.settings-row small {
  display: block;
}

.settings-row strong {
  font-size: 12px;
}

.settings-row small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 10px;
}

.settings-value {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
}

.demo-notice {
  border-radius: var(--radius-lg);
  background: var(--green-900);
  padding: 23px;
  color: #fff;
}

.demo-notice .icon {
  width: 29px;
  height: 29px;
  color: var(--rose-soft);
}

.demo-notice h3 {
  margin: 13px 0 7px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 19px;
}

.demo-notice p {
  margin: 0 0 17px;
  color: rgb(255 255 255 / 68%);
  font-size: 11px;
  line-height: 1.65;
}

.demo-notice .secondary-button {
  width: 100%;
  border-color: rgb(255 255 255 / 15%);
  background: rgb(255 255 255 / 10%);
  color: #fff;
}

/* Modals */

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  overflow-y: auto;
  background: rgb(12 37 32 / 48%);
  padding: 24px;
  backdrop-filter: blur(5px);
  animation: fade-in 160ms ease;
}

.modal-panel {
  width: min(100%, 680px);
  max-height: min(90vh, 850px);
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: modal-in 200ms ease;
}

.modal-panel.modal-narrow {
  width: min(100%, 470px);
}

.modal-panel.modal-wide {
  width: min(100%, 820px);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 18px 21px;
}

.modal-header-main {
  min-width: 0;
}

.modal-header h2 {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Songti SC", "STSong", serif;
  font-size: 21px;
}

.modal-header p {
  margin: 3px 0 0;
  color: var(--ink-faint);
  font-size: 10px;
}

.modal-close {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  background: var(--cream);
  color: var(--ink-soft);
}

.modal-close .icon {
  width: 18px;
}

.modal-body {
  max-height: calc(min(90vh, 850px) - 145px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 21px 25px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  background: rgb(255 253 249 / 96%);
  padding: 13px 21px calc(13px + env(safe-area-inset-bottom));
}

.form-section {
  margin-bottom: 24px;
}

.form-section:last-child {
  margin-bottom: 0;
}

.form-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 13px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 780;
}

.form-section-title .number {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 8px;
  background: var(--green-100);
  color: var(--green-800);
  font-size: 9px;
}

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

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.form-field.full {
  grid-column: 1 / -1;
}

.field-label {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 650;
}

.field-label .required {
  color: var(--rose);
}

.field-input,
.field-select {
  height: 44px;
  padding: 0 12px;
}

.field-select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-faint) 50%), linear-gradient(135deg, var(--ink-faint) 50%, transparent 50%);
  background-position: calc(100% - 16px) 19px, calc(100% - 11px) 19px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  padding-right: 30px;
}

.field-textarea {
  min-height: 82px;
  resize: vertical;
  padding: 11px 12px;
}

.field-hint {
  color: var(--ink-faint);
  font-size: 9px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  border-radius: 13px;
  background: var(--cream);
  padding: 4px;
}

.segment {
  min-height: 36px;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
}

.segment.active {
  background: var(--surface);
  color: var(--green-900);
  box-shadow: var(--shadow-sm);
}

.calculation-card {
  border-radius: var(--radius-md);
  background: var(--green-50);
  padding: 16px;
}

.calculation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.calculation-row strong {
  color: var(--ink);
}

.calculation-row.total {
  margin-top: 7px;
  border-top: 1px solid var(--green-200);
  padding-top: 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
}

.calculation-row.profit strong {
  color: var(--success);
}

.profit-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.profit-preview-item {
  border-radius: 11px;
  background: rgb(255 255 255 / 65%);
  padding: 10px;
}

.profit-preview-item span,
.profit-preview-item strong {
  display: block;
}

.profit-preview-item span {
  color: var(--ink-faint);
  font-size: 9px;
}

.profit-preview-item strong {
  margin-top: 2px;
  font-size: 15px;
}

.upload-placeholder {
  display: grid;
  min-height: 92px;
  place-items: center;
  border: 1px dashed var(--green-200);
  border-radius: 14px;
  background: var(--green-50);
  color: var(--green-700);
  text-align: center;
}

.upload-placeholder .icon {
  width: 23px;
  height: 23px;
}

.upload-placeholder span {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  font-weight: 650;
}

/* Order detail */

.detail-hero {
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: linear-gradient(140deg, var(--green-900), var(--green-700));
  padding: 20px;
  color: #fff;
}

.detail-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.detail-hero .status-badge {
  background: rgb(255 255 255 / 15%);
  color: #fff;
}

.detail-hero-label {
  color: rgb(255 255 255 / 62%);
  font-size: 9px;
}

.detail-hero-amount {
  margin-top: 4px;
  font-size: 28px;
  font-weight: 780;
}

.detail-progress {
  margin-top: 18px;
}

.detail-progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  color: rgb(255 255 255 / 70%);
  font-size: 9px;
}

.detail-progress .progress-track {
  background: rgb(255 255 255 / 14%);
}

.detail-progress .progress-bar {
  background: var(--rose-soft);
}

.detail-section {
  margin-top: 20px;
}

.detail-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}

.detail-section-title {
  margin: 0;
  font-size: 12px;
  font-weight: 760;
}

.detail-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.detail-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 13px;
}

.detail-row:not(:last-child) {
  border-bottom: 1px solid var(--line);
}

.detail-row > .icon {
  width: 16px;
  color: var(--green-700);
}

.detail-row strong,
.detail-row small {
  display: block;
}

.detail-row strong {
  font-size: 11px;
}

.detail-row small {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 9px;
}

.detail-row-value {
  color: var(--ink-soft);
  text-align: right;
  font-size: 10px;
  font-weight: 650;
}

.detail-finance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.detail-finance-item {
  border-radius: 13px;
  background: var(--cream);
  padding: 12px;
}

.detail-finance-item span,
.detail-finance-item strong {
  display: block;
}

.detail-finance-item span {
  color: var(--ink-faint);
  font-size: 9px;
}

.detail-finance-item strong {
  margin-top: 3px;
  font-size: 14px;
}

.detail-finance-item.profit strong {
  color: var(--success);
}

.note-box {
  border-radius: 13px;
  background: var(--rose-pale);
  padding: 13px;
  color: #725651;
  font-size: 10px;
  line-height: 1.65;
}

/* Install modal */

.install-visual {
  display: grid;
  margin: 3px 0 22px;
  place-items: center;
}

.phone-mock {
  position: relative;
  width: 148px;
  height: 274px;
  overflow: hidden;
  border: 7px solid #253c37;
  border-radius: 31px;
  background: linear-gradient(150deg, #e6efe9, #f7e4df);
  box-shadow: var(--shadow-md);
}

.phone-island {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 50%;
  width: 52px;
  height: 14px;
  border-radius: 99px;
  background: #253c37;
  transform: translateX(-50%);
}

.phone-screen-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px 9px;
  padding: 40px 13px;
}

.phone-app-icon {
  display: grid;
  gap: 3px;
  justify-items: center;
  color: #52645f;
  font-size: 5px;
}

.phone-app-icon::before {
  width: 27px;
  height: 27px;
  border-radius: 7px;
  background: rgb(255 255 255 / 72%);
  content: "";
}

.phone-app-icon.lemontree::before {
  background: var(--green-900) url("icon.svg") center / cover;
  box-shadow: 0 3px 9px rgb(23 72 63 / 25%);
}

.install-steps {
  display: grid;
  gap: 11px;
}

.install-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
}

.install-step-number {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 9px;
  background: var(--green-100);
  color: var(--green-800);
  font-size: 10px;
  font-weight: 800;
}

.install-step strong,
.install-step small {
  display: block;
}

.install-step strong {
  font-size: 11px;
}

.install-step small {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 9px;
}

/* Toast */

.toast-root {
  position: fixed;
  z-index: 300;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 9px;
  pointer-events: none;
}

.toast {
  display: flex;
  min-width: 240px;
  max-width: 360px;
  align-items: center;
  gap: 10px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 14px;
  background: var(--ink);
  padding: 12px 15px;
  color: #fff;
  box-shadow: var(--shadow-lg);
  font-size: 11px;
  animation: toast-in 220ms ease;
}

.toast .icon {
  width: 17px;
  color: #bfe3d4;
}

/* Mobile bottom nav */

.mobile-nav {
  display: none;
}

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

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

@media (max-width: 1080px) {
  :root {
    --sidebar-width: 218px;
  }

  .screen {
    padding-right: 28px;
    padding-left: 28px;
  }

  .dashboard-layout,
  .reports-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-side .content-card:first-child {
    grid-column: 1 / -1;
  }

  .customer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .auth-gate {
    align-items: center;
    padding-right: 16px;
    padding-left: 16px;
  }

  .auth-card {
    border-radius: 24px;
    padding: 30px 22px;
  }

  .auth-brand {
    margin-bottom: 31px;
  }

  body {
    background: var(--cream);
  }

  .sidebar {
    display: none;
  }

  .workspace {
    margin-left: 0;
  }

  .screen {
    width: 100%;
    padding: calc(18px + env(safe-area-inset-top)) 16px calc(var(--mobile-nav-height) + 32px + env(safe-area-inset-bottom));
  }

  .page-topbar {
    margin-bottom: 21px;
  }

  .eyebrow {
    margin-bottom: 3px;
    font-size: 9px;
  }

  .page-title {
    font-size: 27px;
  }

  .page-subtitle {
    max-width: 245px;
    margin-top: 4px;
    font-size: 10px;
  }

  .topbar-actions .primary-button .button-label {
    display: none;
  }

  .topbar-actions .primary-button {
    width: 44px;
    padding: 0;
  }

  .icon-button {
    border: 0;
    background: var(--surface);
  }

  .dashboard-layout {
    display: block;
  }

  .dashboard-main,
  .dashboard-side {
    display: grid;
    gap: 15px;
  }

  .dashboard-side {
    grid-template-columns: 1fr;
    margin-top: 15px;
  }

  .dashboard-side .content-card:first-child {
    grid-column: auto;
  }

  .hero-card {
    min-height: 211px;
    border-radius: 24px;
    padding: 23px 22px;
  }

  .hero-card::after {
    right: -76px;
    bottom: -72px;
  }

  .hero-amount {
    margin-top: 19px;
    font-size: 43px;
  }

  .hero-stats {
    right: auto;
    bottom: 20px;
    left: 22px;
    gap: 28px;
  }

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

  .metric-card {
    border-radius: 17px;
    padding: 13px 11px;
  }

  .metric-icon {
    width: 29px;
    height: 29px;
    border-radius: 9px;
  }

  .metric-note {
    display: none;
  }

  .metric-value {
    margin-top: 11px;
    font-size: 17px;
  }

  .metric-label {
    font-size: 9px;
  }

  .content-card {
    border-radius: 19px;
  }

  .content-card-header {
    padding: 17px 17px 11px;
  }

  .timeline-list {
    padding-right: 16px;
    padding-left: 16px;
  }

  .quick-actions {
    padding-right: 14px;
    padding-left: 14px;
  }

  .quick-action {
    min-height: 69px;
    padding: 10px;
  }

  .quick-action-icon {
    width: 35px;
    height: 35px;
  }

  .quick-action small {
    display: none;
  }

  .order-grid,
  .customer-grid,
  .more-grid {
    grid-template-columns: 1fr;
  }

  .toolbar {
    gap: 8px;
  }

  .toolbar > .secondary-button .button-label {
    display: none;
  }

  .toolbar > .secondary-button {
    width: 46px;
    padding: 0;
  }

  .order-card {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 11px;
    border-radius: 18px;
    padding: 14px;
  }

  .order-date-block {
    width: 52px;
    height: 57px;
    border-radius: 15px;
  }

  .order-card-title {
    font-size: 13px;
  }

  .order-card-side {
    min-width: 68px;
  }

  .order-price {
    font-size: 13px;
  }

  .order-profit {
    display: none;
  }

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

  .calendar-card {
    overflow: hidden;
    padding: 17px 10px;
  }

  .calendar-header {
    padding: 0 7px;
  }

  .calendar-day {
    min-height: 53px;
    padding: 6px 3px;
  }

  .calendar-day-number {
    width: 23px;
    height: 23px;
    margin: 0 auto;
  }

  .calendar-dots {
    justify-content: center;
    margin: 4px 0 0;
  }

  .summary-strip {
    grid-template-columns: 1fr 1fr;
  }

  .summary-strip-item:last-child {
    grid-column: 1 / -1;
  }

  .report-kpis {
    grid-template-columns: repeat(2, 1fr);
    gap: 9px;
  }

  .report-kpi {
    padding: 14px;
  }

  .report-kpi strong {
    font-size: 19px;
  }

  .bar-chart {
    min-height: 228px;
    gap: 7px;
    padding: 15px 14px 0;
  }

  .bar-group {
    height: 194px;
  }

  .more-card {
    min-height: 88px;
    grid-template-columns: 42px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 12px;
  }

  .more-card strong {
    margin-top: 0;
  }

  .more-card::after {
    color: var(--ink-faint);
    content: "›";
    font-size: 21px;
  }

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

  .modal-panel,
  .modal-panel.modal-narrow,
  .modal-panel.modal-wide {
    width: 100%;
    max-height: 100dvh;
    border-radius: 24px 24px 0 0;
    animation: sheet-in 220ms ease;
  }

  .modal-panel.modal-full-mobile {
    height: 100dvh;
    border-radius: 0;
  }

  .modal-header {
    padding: calc(13px + env(safe-area-inset-top)) 16px 12px;
  }

  .modal-panel:not(.modal-full-mobile) .modal-header {
    padding-top: 16px;
  }

  .modal-body {
    max-height: calc(100dvh - 134px - env(safe-area-inset-top));
    padding: 17px 16px 24px;
  }

  .modal-full-mobile .modal-body {
    max-height: calc(100dvh - 137px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  .modal-footer {
    padding-right: 16px;
    padding-left: 16px;
  }

  .modal-footer .primary-button {
    flex: 1;
  }

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

  .form-field.mobile-half {
    grid-column: auto;
  }

  .form-grid.mobile-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-finance-grid {
    gap: 6px;
  }

  .detail-finance-item {
    padding: 10px 8px;
  }

  .detail-finance-item strong {
    font-size: 12px;
  }

  .toast-root {
    right: 13px;
    bottom: calc(var(--mobile-nav-height) + 14px + env(safe-area-inset-bottom));
    left: 13px;
  }

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

  .mobile-nav {
    position: fixed;
    z-index: 50;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    min-height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
    grid-template-columns: 1fr 1fr 72px 1fr 1fr;
    align-items: start;
    border-top: 1px solid rgb(23 72 63 / 8%);
    background: rgb(255 253 249 / 94%);
    padding: 8px 8px env(safe-area-inset-bottom);
    box-shadow: 0 -9px 25px rgb(24 49 45 / 6%);
    backdrop-filter: blur(18px);
  }

  .mobile-nav-item {
    display: grid;
    min-width: 0;
    height: 52px;
    place-items: center;
    gap: 1px;
    background: transparent;
    color: var(--ink-faint);
    font-size: 9px;
  }

  .mobile-nav-item .icon {
    width: 20px;
    height: 20px;
  }

  .mobile-nav-item.active {
    color: var(--green-900);
    font-weight: 750;
  }

  .mobile-add {
    display: grid;
    width: 57px;
    height: 57px;
    place-self: start center;
    place-items: center;
    border: 5px solid var(--surface);
    border-radius: 50%;
    background: var(--green-900);
    color: #fff;
    box-shadow: 0 8px 20px rgb(23 72 63 / 25%);
    transform: translateY(-20px);
  }

  .mobile-add .icon {
    width: 23px;
    height: 23px;
  }
}

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

@media (max-width: 380px) {
  .screen {
    padding-right: 12px;
    padding-left: 12px;
  }

  .hero-card {
    padding-right: 18px;
    padding-left: 18px;
  }

  .metric-grid {
    gap: 6px;
  }

  .metric-card {
    padding: 11px 8px;
  }

  .order-card {
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 12px 10px;
  }

  .order-date-block {
    width: 46px;
  }

  .order-card-meta span:last-child {
    display: none;
  }

  .quick-action {
    gap: 8px;
  }
}

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