:root {
  color-scheme: dark;
  font: 15px/1.45 Inter, 'Segoe UI', sans-serif;
  --bg: #100d13;
  --side: #0d0a10;
  --panel: #19151d;
  --line: #302736;
  --text: #f8f4fa;
  --muted: #b6aabb;
  --pink: #f5a2e1;
  --violet: #cdb7ff;
  --mint: #a2dec7;
  background: var(--bg);
  color: var(--text);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; }
h1,h2,h3,p { margin: 0; }
h1,h2,h3,b,strong { font-weight: 650; }
button,input,select,textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .68; }
a { color: inherit; text-decoration: none; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; }
svg { width: 20px; height: 20px; flex: none; vertical-align: middle; }
small { color: var(--muted); }

.layout { min-height: 100dvh; display: grid; grid-template-columns: 239px minmax(0,1fr); }
.sidebar { position: sticky; top: 0; height: 100dvh; background: var(--side); border-right: 1px solid #27212d; display: flex; flex-direction: column; padding: 28px 19px 22px; gap: 46px; }
.brand { width: fit-content; display: flex; align-items: center; gap: 11px; }
.sidebar .brand { margin-left: 8px; }
.brand-logo { width: 43px; height: 43px; background: #fff; border-radius: 13px; display: grid; place-items: center; flex: none; box-shadow: 0 3px 22px #e95ec032; }
.brand-logo img { width: 33px; height: 33px; object-fit: contain; }
.brand b,.account b { display: block; font-size: 17px; line-height: 1.25; }
.brand small,.account small { display: block; font-size: 12px; margin-top: 3px; }
.sidebar nav { display: grid; gap: 8px; }
.nav-item { width: 100%; min-height: 44px; border: 1px solid transparent; border-radius: 11px; background: none; color: var(--muted); display: flex; align-items: center; gap: 11px; text-align: left; padding: 8px 12px; }
.nav-item:hover { background: #201923; color: var(--text); }
.nav-item.selected { color: #ffc2ed; background: #281b2b; border-color: #402a44; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 14px; }
.account { display: flex; align-items: center; gap: 10px; padding: 13px 6px 0; border-top: 1px solid var(--line); min-width: 0; }
.account div { min-width: 0; }
.account b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 37px; height: 37px; border-radius: 50%; color: #ffcbef; background: #482840; display: grid; place-items: center; flex: none; font-weight: 650; }
.workspace { width: 100%; max-width: 1500px; margin: 0 auto; padding: 23px clamp(22px,3.3vw,53px) 56px; }
.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; min-height: 29px; color: var(--muted); font-size: 13px; }
.demo-tag,.badge { width: fit-content; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; font-size: 11px; line-height: 1.25; font-weight: 600; }
.demo-tag { border: 1px solid #48354b; color: #e0c5e2; background: #211825; }
.demo-tag i,.badge i { display: block; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.hero { min-height: 300px; display: flex; align-items: center; border: 1px solid #4c2d4c; border-radius: 24px; overflow: hidden; background: #230f23 linear-gradient(90deg,#180f1a 2%,#200f2080 52%,transparent 83%); background-image: linear-gradient(90deg,#180e1bf2 0%,#180e1b9e 48%,#180e1b00 88%),url('/cloud.webp'); background-size: cover; background-position: center, center right; }
.hero-content { padding: clamp(24px,4.2vw,55px); }
.hero h1,.public-copy h1 { font-size: clamp(39px,4.1vw,65px); line-height: 1.025; letter-spacing: -.06em; }
.hero h1 span,.public-copy h1 span { color: var(--pink); }
.hero p,.public-copy p { color: #e2cde3; margin: 15px 0 23px; max-width: 420px; }
.button { min-height: 41px; border-radius: 10px; padding: 8px 14px; display: inline-flex; justify-content: center; align-items: center; gap: 9px; text-align: center; width: fit-content; font-weight: 650; font-size: 13px; border: 1px solid transparent; }
.button svg { width: 17px; height: 17px; }
.button.primary { color: #24121f; background: #f3ace2; }
.button.primary:hover { background: #ffd1f3; }
.button.secondary { color: var(--text); background: #241e29; border-color: #423647; }
.button.secondary:hover { background: #342838; }
.button.danger { background: #40212d; color: #ffc1ce; border-color: #683749; }
.button.danger:hover { background: #582935; }
.button.compact { min-height: 35px; padding: 6px 11px; }

.summary,.project-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.summary { margin-top: 17px; }
.metric,.project-card,.payments,.empty { border: 1px solid var(--line); background: var(--panel); border-radius: 16px; }
.metric { min-width: 0; display: flex; flex-direction: column; padding: 15px 17px; }
.metric-label { display: flex; align-items: center; min-width: 0; gap: 9px; color: var(--muted); font-size: 13px; }
.tile { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; flex: none; }
.metric .tile { width: 31px; height: 31px; border-radius: 9px; }
.tile svg { width: 17px; height: 17px; }
.pink { --accent: var(--pink); --tint: #49253f; }
.violet { --accent: var(--violet); --tint: #382b51; }
.mint { --accent: var(--mint); --tint: #1e3d36; }
.tile { color: var(--accent); background: var(--tint); }
.metric strong { font-size: clamp(21px,2.1vw,29px); letter-spacing: -.035em; margin-top: 7px; overflow-wrap: anywhere; }
.metric small { font-size: 12px; overflow-wrap: anywhere; }
.section { margin-top: 29px; }
.section-head,.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 13px; margin-bottom: 12px; }
.section-head h2 { font-size: 23px; letter-spacing: -.035em; }
.page-head { align-items: center; margin: 2px 0 22px; }
.page-head h1 { font-size: clamp(28px,4vw,46px); letter-spacing: -.045em; }
.text-button { color: var(--pink); background: none; border: none; white-space: nowrap; padding: 5px 0; font-size: 13px; }
.text-button:hover { text-decoration: underline; }
.text-button svg,.project-foot svg { width: 15px; height: 15px; }
.project-card { display: flex; flex-direction: column; text-align: left; min-width: 0; padding: 15px 16px 12px; }
.project-card:hover,.payment-row:hover { background: #241e29; }
.project-card:hover { border-color: #5a405d; }
.project-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; margin-bottom: 13px; }
.badge.active { color: #f3b5e4; background: #41273d; }
.badge.paid { color: #b4e9d6; background: #24423b; }
.badge.pending { color: #e6d6ff; background: #3d2d53; }
.badge.late { color: #ffc2cd; background: #512b39; }
.project-card strong,.project-card small { overflow-wrap: anywhere; }
.project-card strong { font-size: 16px; }
.project-card small { margin: 3px 0 13px; }
.progress-label { display: flex; width: 100%; align-items: baseline; justify-content: space-between; gap: 9px; color: var(--muted); font-size: 12px; margin: auto 0 5px; }
.progress-label b { color: var(--text); font-size: 12px; }
progress { display: block; width: 100%; height: 5px; border: 0; border-radius: 6px; overflow: hidden; appearance: none; background: #382e3d; }
progress::-webkit-progress-bar { background: #382e3d; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 6px; }
progress::-moz-progress-bar { background: var(--accent); }
.project-foot { width: 100%; display: flex; align-items: center; justify-content: space-between; color: var(--muted); margin-top: 11px; font-size: 12px; }
.project-foot span { display: flex; align-items: center; gap: 6px; }
.empty { margin: 0; padding: 20px; color: var(--muted); }

.payments { overflow: hidden; }
.payment-row,.client-row { width: 100%; display: grid; align-items: center; gap: 12px; text-align: left; padding: 12px 16px; border: 0; background: none; }
.payment-row { grid-template-columns: auto minmax(0,1.6fr) minmax(100px,1fr) minmax(83px,.7fr) minmax(90px,.75fr) auto; }
.client-row { grid-template-columns: auto minmax(0,1fr) auto auto; }
.payment-row + .payment-row,.client-row + .client-row { border-top: 1px solid var(--line); }
.payment-name { display: flex; flex-direction: column; overflow-wrap: anywhere; }
.payment-date { color: var(--muted); font-size: 13px; }
.payment-row > svg { color: var(--muted); width: 16px; }
.filters,.link-controls { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 13px; }

.public-header { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; padding: 24px clamp(19px,5vw,75px); gap: 14px; }
.public-cover { min-height: calc(100dvh - 91px); display: grid; align-items: center; background: linear-gradient(90deg,#100d13 3%,#100d13d9 37%,#100d1300 85%), linear-gradient(0deg,#100d13,transparent 38%,transparent 73%,#100d13), url('/cloud.webp') center right 23% / cover no-repeat; }
.public-copy { padding: 40px clamp(24px,10vw,155px) 70px; min-width: 0; }
.public-copy h1 { font-size: clamp(52px,9vw,125px); }
.login-form { max-width: 355px; margin-top: 25px; display: grid; gap: 13px; }
.loading { padding: 28px; color: var(--muted); }

dialog { padding: 0; border: 1px solid #533859; border-radius: 20px; background: #1c1621; color: var(--text); width: min(620px,calc(100% - 28px)); box-shadow: 0 25px 100px #000a; max-height: min(92dvh,850px); overflow: hidden; }
dialog::backdrop { background: #09060cb8; backdrop-filter: blur(5px); }
.dialog-body { padding: 22px; max-height: min(calc(92dvh - 2px),848px); overflow: auto; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 15px; }
.dialog-head h2 { font-size: 24px; line-height: 1.2; overflow-wrap: anywhere; }
.dialog-body h3 { margin: 17px 0 10px; font-size: 15px; }
.icon-button { display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: #2a222e; width: 34px; height: 34px; color: #e8d8ec; flex: none; }
.icon-button:hover { background: #3c2d40; }
.icon-button svg { width: 16px; height: 16px; }
.dialog-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 16px; }
.dialog-actions:empty { display: none; }
.dialog-actions.split { justify-content: space-between; }
.detail-intro { display: flex; align-items: center; gap: 11px; color: var(--muted); }
.detail-note { color: var(--muted); overflow-wrap: anywhere; white-space: pre-wrap; margin-bottom: 13px; }
.detail-facts { display: flex; flex-wrap: wrap; gap: 14px 24px; padding: 13px 0; }
.detail-facts dt { color: var(--muted); font-size: 13px; }
.detail-facts dd { margin: 0; font-size: 18px; font-weight: 650; }
.inline-info { display: flex; align-items: center; gap: 7px; color: var(--muted); margin-bottom: 12px; }
.inline-info svg { width: 16px; height: 16px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.steps li { display: flex; align-items: center; gap: 10px; min-width: 0; }
.steps li div { display: flex; flex-direction: column; overflow-wrap: anywhere; }
.step-marker { width: 32px; height: 32px; background: #322837; color: #e0cfe5; flex: none; display: grid; place-items: center; border-radius: 50%; font-size: 12px; }
.step-marker svg { width: 17px; height: 17px; }
.step-marker.done { color: var(--mint); background: #243e36; }
.step-marker.current { color: var(--pink); background: #502e49; }
.dialog-body .payment-row { grid-template-columns: auto minmax(0,1fr) auto; gap: 7px 10px; }
.dialog-body .payment-row .payment-date { grid-column: 2; grid-row: 2; }
.dialog-body .payment-row .badge { grid-column: 3; grid-row: 2; }
.dialog-body .payment-row > svg { display: none; }

#edit-form { display: grid; gap: 12px; }
label { display: grid; gap: 5px; font-size: 13px; color: #e7dbe9; }
input,textarea,select { width: 100%; min-width: 0; border: 1px solid #4b3a51; background: #140f18; border-radius: 9px; padding: 9px 11px; font-size: 16px; }
textarea { resize: vertical; }
.form-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-error { font-size: 13px; color: #ffb7c6; }
.form-error:empty { display: none; }
fieldset { margin: 0; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px 11px; }
legend { padding: 0 4px; color: #e7dbe9; font-size: 13px; }
#stages { display: grid; gap: 7px; margin: 8px 0; }
.stage-row { display: grid; align-items: center; grid-template-columns: 22px minmax(0,1fr) 34px; gap: 7px; }
.stage-row input[type='checkbox'] { height: 17px; width: 17px; accent-color: #e8a5dc; }
#toast:not(:empty) { position: fixed; z-index: 10; left: 50%; bottom: 18px; transform: translateX(-50%); text-align: center; max-width: calc(100% - 26px); width: max-content; padding: 10px 14px; border: 1px solid #82516f; border-radius: 11px; color: #ffe8f9; background: #422839; box-shadow: 0 8px 26px #0008; }

@media (max-width: 1050px) {
  .layout { grid-template-columns: 185px minmax(0,1fr); }
  .sidebar { padding-inline: 13px; }
  .hero { min-height: 272px; }
}
@media (max-width: 860px) {
  .layout { display: block; }
  .sidebar { z-index: 2; height: auto; padding: 11px 16px; display: flex; align-items: center; flex-direction: row; justify-content: space-between; flex-wrap: wrap; gap: 10px; border-right: none; border-bottom: 1px solid var(--line); }
  .sidebar .brand { margin: 0; }
  .sidebar nav { display: flex; gap: 3px; }
  .nav-item { min-height: 38px; width: auto; padding: 6px 8px; font-size: 12px; gap: 5px; }
  .nav-item svg { width: 16px; height: 16px; }
  .sidebar-bottom { margin: 0; }
  .sidebar-bottom .account { display: none; }
  .sidebar-bottom:empty,.sidebar-bottom:not(:has(button)) { display: none; }
  .workspace { padding-top: 16px; }
}
@media (max-width: 580px) {
  .sidebar { gap: 8px; }
  .sidebar nav { order: 3; display: flex; width: 100%; gap: 5px; }
  .sidebar nav button { flex: 1; justify-content: center; }
  .workspace { padding-inline: 13px; }
  .top { margin-bottom: 10px; }
  .hero { min-height: 245px; border-radius: 18px; background-image: linear-gradient(90deg,#180e1bf2 0%,#180e1baf 55%,#180e1b40 100%),url('/cloud.webp'); background-position: center,65% center; }
  .hero h1 { font-size: clamp(34px,9vw,47px); }
  .hero-content { padding: 22px 19px; }
  .hero p { margin-block: 11px 17px; font-size: 14px; }
  .summary { gap: 6px; margin-top: 10px; }
  .metric { padding: 8px; border-radius: 11px; }
  .metric-label { gap: 4px; font-size: 11px; line-height: 1.12; }
  .metric .tile { width: 24px; height: 24px; border-radius: 6px; }
  .metric svg { width: 14px; height: 14px; }
  .metric strong { font-size: clamp(15px,4.1vw,22px); }
  .metric small { font-size: 10px; line-height: 1.2; }
  .project-grid { grid-template-columns: 1fr; gap: 8px; }
  .project-top { margin-bottom: 7px; }
  .project-card small { margin-bottom: 8px; }
  .payment-row { position: relative; grid-template-columns: 28px minmax(0,1fr) auto; gap: 6px 9px; padding: 10px; }
  .payment-row .tile { width: 28px; height: 28px; }
  .payment-row .payment-date { grid-column: 2; grid-row: 2; font-size: 12px; }
  .payment-row .badge { grid-column: 3; grid-row: 2; justify-self: end; }
  .payment-row > svg { display: none; }
  .payment-row strong { font-size: 13px; text-align: right; }
  .client-row { grid-template-columns: auto minmax(0,1fr) auto; }
  .client-row [data-copy] { grid-row: 2; grid-column: 2 / 4; }
  .public-header { padding: 15px; }
  .public-header .button { font-size: 11px; }
  .public-cover { background-position: center,center,62% center; }
  .dialog-body { padding: 15px; }
  .dialog-body .payment-row { grid-template-columns: 28px minmax(0,1fr) auto; }
}
