:root {
  color-scheme: light;
  --bg: #f4f6f2;
  --card: #fff;
  --ink: #182821;
  --sub: #56645b;
  --line: #e0e8e0;
  --brand: #22644f;
  --brand-deep: #153e32;
  --radius: 17px;
  --shadow: 0 2px 3px #173c3005, 0 8px 25px #173c3005;
  font-family: 'DM Sans', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; font-size: 14px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, strong { font-family: Manrope, 'DM Sans', system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
button, select, input, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled { opacity: .65; cursor: wait; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid #639a84; outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.loading { padding: 5rem 1.5rem; color: var(--sub); text-align: center; }
.layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100dvh; padding: 27px 17px 17px; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 6; overflow-y: auto; }
.brand { display: inline-flex; gap: 10px; align-items: center; width: fit-content; }
.sidebar .brand { margin-left: 10px; }
.brand img { width: 40px; height: 40px; }
.brand strong { display: block; font-size: 24px; font-weight: 800; letter-spacing: -1.35px; line-height: 1.05; }
.brand-dot { color: var(--brand); }
.brand small { display: block; margin-top: 3px; color: #526359; font-size: 8px; font-weight: 800; letter-spacing: 2.1px; }
.nav-main { margin-top: 29px; }
.nav-label { display: block; color: #55665c; font-size: 9px; font-weight: 800; letter-spacing: 1.45px; padding: 15px 11px 10px; }
.nav-label:not(:first-child) { margin-top: 12px; }
.nav-link { display: flex; gap: 11px; align-items: center; width: 100%; color: #536156; font-size: 13px; font-weight: 700; text-align: left; border: 0; background: transparent; border-radius: 9px; padding: 11.5px 11px; margin: 2px 0; }
.nav-link:hover { background: #eef5ef; color: var(--brand-deep); }
.nav-link.active { background: #e1efe5; color: #1a604b; }
.sidebar-bottom { margin-top: auto; padding-top: 23px; }
.profile { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.profile > span:last-child { min-width: 0; }
.profile strong, .profile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile strong { font-size: 12px; }
.profile small { color: var(--sub); margin-top: 3px; font-size: 11px; }
.avatar, .customer-avatar { display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; width: 34px; height: 34px; background: #e2efe6; color: #23654f; font-weight: 800; font-size: 11px; }
.logout { margin-top: 8px; }
.workspace { min-width: 0; }
.topbar { height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 31px; border-bottom: 1px solid var(--line); background: #fff; }
.top-left, .top-actions { display: flex; align-items: center; gap: 11px; }
.top-left { color: var(--sub); font-size: 12px; }
.top-left b { color: var(--ink); }
.top-actions .btn { min-height: 33px; padding: 7px 11px; font-size: 11px; }
.demo-pill { color: #28634f; background: #e8f2e9; padding: 5px 8px; border-radius: 99px; font-weight: 800; font-size: 9px; letter-spacing: .7px; white-space: nowrap; }
.content { width: min(100%, 1510px); margin: 0 auto; padding: 27px 31px 0; }
.mobile-menu, .backdrop { display: none !important; }
.hero, .welcome-intro {
  color: #fff;
  background-color: #153e32;
  background-image: linear-gradient(90deg, #0b2b22 0%, #0b2b22ee 26%, #102e238c 52%, #102e230c 86%), url('/images/zalstudio-studio.webp');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center 56%;
  border-radius: 21px;
  overflow: hidden;
}
.hero { min-height: 264px; display: flex; align-items: center; box-shadow: 0 9px 24px #14332821; }
.hero-content { padding: 34px 38px; max-width: 610px; }
.hero-tag { display: inline-block; color: #e1eddf; font-size: 10px; font-weight: 800; letter-spacing: 1.6px; }
.hero h1 { font-size: clamp(35px, 4.6vw, 53px); line-height: 1.1; font-weight: 800; letter-spacing: -.047em; margin: 9px 0; overflow-wrap: anywhere; }
.hero p { line-height: 1.6; max-width: 370px; color: #e6f0e9; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.btn { min-height: 39px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 13px; border: 1px solid transparent; border-radius: 9px; font-weight: 750; font-size: 12px; line-height: 1.2; white-space: nowrap; transition: background .15s ease, box-shadow .15s ease; }
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 3px 6px #1c644824; }
.btn.primary:hover { background: var(--brand-deep); }
.btn.secondary, .icon-btn { border-color: #d8e5dc; color: #295540; background: #fff; }
.btn.secondary:hover, .icon-btn:hover { background: #eaf4ed; }
.btn.white { background: #fff; color: #1d513e; }
.btn.white:hover { background: #ecf4ee; }
.btn.hero-secondary { color: #fff; background: #fff2; border-color: #fff5; }
.btn.hero-secondary:hover { background: #fff4; }
.btn.plain { color: #245b45; background: transparent; padding: 6px 9px; min-height: 32px; }
.btn.plain:hover { background: #e6f1e9; }
.icon-btn { display: inline-grid; place-items: center; border: 1px solid #d8e5dc; border-radius: 9px; width: 35px; height: 35px; flex: 0 0 auto; }
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin: 18px 0; }
.summary.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card, .metric { min-width: 0; border: 1px solid #e0e8e0; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.metric { padding: 16px; min-height: 130px; }
.metric-top { display: flex; align-items: center; gap: 9px; color: var(--sub); font-size: 12px; line-height: 1.25; font-weight: 750; min-width: 0; }
.symbol { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; flex: 0 0 auto; }
.symbol.sage, .customer-avatar.sage { background: #e4efe5; color: #28664e; }
.symbol.blue, .customer-avatar.blue { background: #e8efff; color: #4269db; }
.symbol.orange, .customer-avatar.orange { background: #fff0df; color: #a25613; }
.symbol.green, .customer-avatar.green { background: #e5f7ef; color: #178160; }
.metric > strong { display: block; font-size: clamp(18px, 2vw, 26px); letter-spacing: -.7px; line-height: 1.15; margin: 11px 0 4px; font-weight: 800; overflow-wrap: anywhere; }
.metric > small { color: var(--sub); font-size: 11px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.84fr) minmax(250px, 1fr); gap: 16px; align-items: stretch; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 17px 19px; }
.card-head h2, .section-title { font-size: 16px; font-weight: 800; letter-spacing: -.32px; }
.card-head p { color: var(--sub); font-size: 12px; margin-top: 4px; line-height: 1.5; }
.card-head select, .filter-bar select { min-height: 34px; padding: 6px 9px; border-radius: 8px; border: 1px solid #dce7df; color: #4e6257; background: #fff; font-size: 11px; }
.chart-total { padding: 0 19px; font: 800 26px Manrope, sans-serif; letter-spacing: -.75px; }
.chart { padding: 6px 15px 7px 19px; }
.chart svg { display: block; width: 100%; max-height: 189px; }
.chart svg line { stroke: #e7eee8; stroke-dasharray: 4 4; }
.chart svg text { fill: #5a6b60; font: 11px 'DM Sans', system-ui, sans-serif; }
.chart svg circle:hover { r: 6; }
.referral-card { padding: 0 19px 17px; }
.referral-card .card-head { padding-left: 0; padding-right: 0; }
.code-box { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 11px 11px 11px 13px; border: 1px dashed #a9c8b4; border-radius: 10px; background: #f3f8f2; margin: 3px 0 13px; }
.code-box small, .code-box strong { display: block; }
.code-box small { font-size: 9px; letter-spacing: 1px; color: #486555; font-weight: 800; margin-bottom: 4px; }
.code-box strong { font-size: 16px; letter-spacing: .35px; color: #205b45; overflow-wrap: anywhere; }
.referral-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.referral-actions .btn { flex: 1 1 auto; }
.micro { display: flex; gap: 6px; align-items: flex-start; color: var(--sub); font-size: 11px; margin-top: 13px; line-height: 1.45; }
.micro svg { flex: 0 0 auto; color: #376e57; }
.latest { margin-top: 17px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; white-space: nowrap; font-size: 12px; }
th { color: #55675c; background: #f6f8f4; font-weight: 750; font-size: 11px; }
th, td { padding: 11px 14px; border-top: 1px solid #e9eee8; }
th:first-child, td:first-child { padding-left: 19px; }
tbody tr:hover { background: #fafcf9; }
td:last-child { text-align: right; }
.td-sub, .person small { display: block; color: var(--sub); margin-top: 3px; font-size: 11px; }
.person { display: flex; align-items: center; gap: 8px; }
.service-text { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; }
.service-text.sage { color: #23634b; }
.service-text.orange { color: #8e511a; }
.service-text.blue { color: #3c60b9; }
.chip { display: inline-flex; gap: 5px; align-items: center; padding: 5px 7px; border-radius: 99px; font-size: 10px; font-weight: 750; white-space: nowrap; }
.chip i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.chip.neutral { background: #edf0ed; color: #526056; }
.chip.green { background: #e4f8ed; color: #137352; }
.chip.blue { background: #edf1ff; color: #3c57ab; }
.chip.orange { background: #fff1df; color: #96520e; }
.chip.sage { background: #e3efe6; color: #255e47; }
.page-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-end; margin: 3px 0 19px; }
.page-head h1 { font-size: 32px; font-weight: 800; letter-spacing: -1.1px; }
.page-head p { margin-top: 6px; color: var(--sub); line-height: 1.55; }
.filter-bar { display: flex; align-items: center; gap: 9px; padding: 13px 17px; }
.search { max-width: 310px; flex: 1 1 auto; display: flex; gap: 7px; align-items: center; padding: 0 10px; border: 1px solid #dce7df; border-radius: 8px; color: var(--sub); }
.search input { border: 0; min-width: 0; width: 100%; background: transparent; color: var(--ink); min-height: 33px; font-size: 12px; }
.search:focus-within { outline: 2px solid #78a991; outline-offset: 1px; }
.search input:focus-visible { outline: none; }
.referral-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.how ol { list-style: none; padding: 0 19px 12px; margin: 0; }
.how li { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 13px; }
.how li > span { background: #e1efe5; color: #28694e; border-radius: 50%; display: grid; place-items: center; width: 25px; height: 25px; flex: 0 0 auto; font-weight: 750; font-size: 11px; }
.how li p { margin-top: 4px; color: var(--sub); font-size: 12px; line-height: 1.45; }
.section-title { margin: 22px 0 10px; }
.services-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.service-tile { padding: 16px; }
.service-tile h3 { margin-top: 11px; font-size: 14px; }
.service-tile p { color: var(--sub); margin-top: 5px; line-height: 1.45; font-size: 12px; }
.rate { float: right; color: #235e46; background: #e6f1e9; border-radius: 20px; padding: 5px 9px; font-size: 12px; }
.settings-card { max-width: 660px; padding: 14px 18px 18px; }
.rate-row { display: flex; align-items: center; gap: 10px; padding: 9px 0 12px; border-bottom: 1px solid var(--line); margin-bottom: 9px; }
.rate-row small { display: block; margin-top: 3px; color: var(--sub); }
.rate-input { display: flex; gap: 5px; align-items: center; margin-left: auto; }
.rate-input input { width: 78px; }
.empty { text-align: center; padding: 29px 17px; }
.empty .symbol { margin-bottom: 9px; }
.empty h3 { font-size: 14px; }
.empty p { color: var(--sub); font-size: 12px; max-width: 390px; margin: 5px auto 0; line-height: 1.55; }
footer { padding: 21px 0 17px; font-size: 11px; color: var(--sub); }
footer span { padding: 0 3px; }
.field { display: block; color: #334e40; font-weight: 750; font-size: 12px; margin-bottom: 12px; }
.field small { color: var(--sub); font-weight: 500; }
.field input, .field select, .field textarea, .rate-input input, .copy-fallback { display: block; width: 100%; margin-top: 5px; min-height: 38px; border: 1px solid #cfddd2; border-radius: 8px; padding: 8px 10px; color: var(--ink); background: #fff; font-weight: 500; }
.rate-input input { width: 78px; }
.field textarea { resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #627467; }
.checkbox { display: flex; align-items: flex-start; gap: 7px; color: var(--sub); font-size: 12px; line-height: 1.5; margin: 10px 0 13px; }
.checkbox input { margin-top: 3px; accent-color: var(--brand); }
.form-error { color: #9f2338; background: #ffedf1; border-radius: 8px; padding: 9px; margin-bottom: 10px; font-size: 12px; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.bottom-action { margin-top: 9px; }
dialog { border: 1px solid var(--line); border-radius: 17px; padding: 18px; width: min(500px, calc(100vw - 26px)); max-height: calc(100dvh - 26px); color: var(--ink); box-shadow: 0 16px 60px #13282040; }
dialog::backdrop { background: #142e2483; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; padding-bottom: 14px; }
.modal-head h2 { font-size: 21px; letter-spacing: -.55px; }
.modal-head p { color: var(--sub); margin-top: 4px; font-size: 12px; line-height: 1.5; }
.details { margin: 0 0 14px; }
.details > div { display: grid; grid-template-columns: minmax(115px, 1fr) 1.5fr; gap: 9px; border-bottom: 1px solid var(--line); padding: 7px 0; align-items: start; }
.details dt { color: var(--sub); font-size: 12px; }
.details dd { margin: 0; overflow-wrap: anywhere; }
.details a { color: #235f49; }
.details a svg { vertical-align: middle; }
#toast { position: fixed; z-index: 10; bottom: 18px; right: 18px; max-width: calc(100vw - 36px); padding: 11px 14px; background: #1c3c31; color: #fff; border-radius: 9px; box-shadow: 0 8px 22px #172f2540; opacity: 0; transform: translateY(8px); transition: .16s ease; pointer-events: none; }
#toast.visible { opacity: 1; transform: none; }
.welcome { max-width: 1390px; margin: 0 auto; padding: 0 35px 40px; }
.welcome > header { height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.welcome-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr); gap: clamp(18px, 3vw, 44px); align-items: center; padding: 34px 0; }
.welcome-intro {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 526px;
  padding: clamp(22px, 4vw, 58px);
  background-image: linear-gradient(0deg, #0b2b22 0%, #0b2b22f2 15%, #102e2350 64%, #102e2300 100%), url('/images/zalstudio-studio.webp');
  background-position: 64% center;
}
.welcome-intro h1 { max-width: 620px; margin: 9px 0 12px; font-size: clamp(38px, 5.3vw, 68px); font-weight: 800; letter-spacing: -.06em; line-height: 1.03; }
.welcome-intro p { color: #e7efe6; line-height: 1.55; font-size: clamp(14px, 1.4vw, 17px); max-width: 440px; }
.welcome-services { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 19px; }
.welcome-services > span { display: flex; align-items: center; gap: 5px; border: 1px solid #ffffff56; background: #163f34; padding: 4px 8px 4px 4px; border-radius: 9px; font-size: 11px; font-weight: 750; }
.welcome-services .symbol { width: 25px; height: 25px; border-radius: 6px; background: #d4e5d9; color: #20543f; }
.welcome-services .symbol svg { width: 15px; height: 15px; }
.welcome-card { padding: clamp(19px, 3vw, 36px); }
.welcome-card .field input, .welcome-card .field select { min-height: 43px; }
.welcome-card .btn { min-height: 42px; }
.welcome-card h2 { font-size: 22px; font-weight: 800; letter-spacing: -.55px; margin-bottom: 8px; }
.welcome-card p { color: var(--sub); line-height: 1.55; margin-bottom: 12px; }
.welcome-card .btn { width: 100%; }
.fallback { margin: 40px auto; max-width: 520px; }
.fallback .form-actions { justify-content: center; margin: 0 0 18px; }
@media (max-width: 1120px) {
  .layout { grid-template-columns: 202px minmax(0, 1fr); }
  .content, .topbar { padding-left: 23px; padding-right: 23px; }
  .summary { gap: 9px; }
  .metric { padding: 12px; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: 230px; height: 100dvh; transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility .2s; }
  .sidebar.open { transform: none; visibility: visible; }
  .welcome { padding-inline: 20px; }
  .welcome-grid { gap: 14px; }
  .mobile-menu { display: inline-grid !important; }
  .backdrop { display: block !important; position: fixed; inset: 0; padding: 0; border: 0; background: #152c2470; z-index: 5; }
}
@media (max-width: 640px) {
  .content { padding: 14px 13px 0; }
  .topbar { height: 59px; padding: 0 13px; }
  .top-left { gap: 6px; }
  .top-left > span, .top-left > svg, .demo-pill { display: none; }
  .top-actions { gap: 4px; }
  .top-actions .btn { padding: 6px; }
  .hero { min-height: 236px; background-position: 66% center; background-image: linear-gradient(90deg, #0b2b22fa 0%, #0b2b22d9 50%, #102e2363 100%), url('/images/zalstudio-studio.webp'); }
  .hero-content { padding: 20px 16px; }
  .hero p { max-width: 290px; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 12px 0; }
  .summary.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { min-height: 105px; }
  .metric-top { gap: 6px; font-size: 11px; }
  .metric .symbol { width: 30px; height: 30px; }
  .metric .symbol svg { width: 16px; height: 16px; }
  .dashboard-grid, .referral-grid, .services-grid { grid-template-columns: 1fr; gap: 11px; }
  .latest { margin-top: 12px; }
  .page-head { flex-wrap: wrap; }
  .page-head h1 { font-size: 27px; }
  .card-head { padding: 14px; }
  .referral-card { padding: 0 14px 14px; }
  .filter-bar { padding: 10px; }
  .welcome { padding: 0 14px 24px; }
  .welcome > header { height: 67px; }
  .welcome-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 15px 0; }
  .welcome-intro { min-height: 350px; padding: 18px; border-radius: 16px; }
  .welcome-intro h1 { font-size: clamp(31px, 8.8vw, 49px); }
  .referral-welcome .welcome-intro { min-height: 284px; }
  .welcome-card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
.page-actions, .task-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.task-strip { margin: 0 0 16px; }
.task-strip .btn { background: #eaf3eb; border-color: #d1e1d4; color: #235a43; }
.payment-heading { font-size: 14px; margin: 0 0 5px; }
.payment-list { margin: 0 0 14px; padding: 0; list-style: none; }
.payment-list li { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding: 7px 0; }
.payment-list small { display: block; color: var(--sub); overflow-wrap: anywhere; }
.payment-list li > span:last-child { white-space: nowrap; color: var(--sub); font-size: 12px; }
.filter-bar { flex-wrap: wrap; }
.rate-row small, .details dd { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .filter-bar .search { flex: 1 0 100%; max-width: none; }
  .filter-bar > label:not(.search) { flex: 1; }
  .filter-bar select { width: 100%; }
  .top-actions .btn { min-height: 36px; }
}
