@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  font-family: "DM Sans", system-ui, sans-serif;
  color: #1f1d31;
  background: #f7f7fb;
  font-synthesis: none;
  --ink: #1f1d31;
  --muted: #656378;
  --line: #ecebf3;
  --accent: #6949e8;
  --accent-dark: #5032c5;
  --soft: #f0ebff;
  --dark: #18162a;
  --orange: #9c4c12;
  --round: 17px;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .65; cursor: wait; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1,h2,h3,p { margin: 0; }
h1,h2,h3,.brand,.money { font-family: Manrope, system-ui, sans-serif; }
h1 { font-size: clamp(1.85rem, 5vw, 2.45rem); letter-spacing: -.055em; line-height: 1.15; font-weight: 800; }
h2 { font-size: 1.12rem; letter-spacing: -.025em; font-weight: 800; }
h3 { font-size: .95rem; font-weight: 800; }
.icon { width: 1.2em; height: 1.2em; display: inline-block; flex: 0 0 auto; vertical-align: middle; }
.sidebar { display: none; }
.shell { min-height: 100dvh; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 64px; padding: 0 1rem; background: white; border-bottom: 1px solid var(--line); }
.topbar-left, .top-actions, .brand { display: flex; align-items: center; gap: .7rem; }
.topbar-left { min-width: 0; }
.brand { font-size: 1.44rem; font-weight: 800; letter-spacing: -.065em; text-decoration: none; white-space: nowrap; }
.brand .icon { width: 1.3rem; height: 1.3rem; stroke-width: 2; }
.brand-mark { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: .65rem; background: #7454f4; color: #fff; }
.brand-period { color: #a48bff; }
.crumb { display: none; }
.top-actions { gap: .5rem; }
.btn-icon { display: inline-grid; place-items: center; flex: 0 0 auto; position: relative; width: 2.65rem; height: 2.65rem; border: 1px solid var(--line); background: white; border-radius: .72rem; color: #5d5a72; }
.btn-icon:hover, .btn-light:hover { background: #f6f3ff; color: var(--accent-dark); }
.notice-dot { position: absolute; top: .49rem; right: .49rem; width: .48rem; height: .48rem; background: #7956ec; border: 1px solid white; border-radius: 50%; }
.avatar { width: 2.45rem; height: 2.45rem; border: 0; color: #5a36d1; background: #eee8ff; border-radius: 50%; display: grid; place-items: center; font-size: .82rem; font-weight: 800; }
.profile-text { display: none; }
.mobile-nav { position: fixed; z-index: 6; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(5, 1fr); background: white; box-shadow: 0 -4px 18px #27204d0b; border-top: 1px solid var(--line); padding: .35rem .2rem calc(.35rem + env(safe-area-inset-bottom)); }
.mobile-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .24rem; padding: .35rem .12rem; min-height: 3.05rem; font-size: .7rem; font-weight: 700; text-decoration: none; color: var(--muted); border-radius: .7rem; }
.mobile-nav a .icon { width: 1.2rem; height: 1.2rem; }
.mobile-nav a[aria-current="page"] { background: var(--soft); color: var(--accent-dark); }
main { min-width: 0; padding: 1.35rem 1rem 6.3rem; }
.page { max-width: 1500px; margin-inline: auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-head p { margin-top: .42rem; color: var(--muted); line-height: 1.5; }
.eyebrow { display: inline-flex; align-items: center; gap: .42rem; color: #593dcd; background: #eee9ff; border-radius: 40px; padding: .32rem .68rem; font-size: .77rem; font-weight: 700; margin-bottom: .65rem; text-transform: capitalize; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; border: 1px solid transparent; padding: .6rem .88rem; min-height: 2.65rem; border-radius: .65rem; font-weight: 700; font-size: .88rem; line-height: 1.25; text-decoration: none; white-space: nowrap; }
.btn-primary { background: var(--accent); color: white; box-shadow: 0 4px 10px #6545dd26; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-light { background: white; color: #514d65; border-color: #e9e7f1; }
.btn-plain { background: transparent; color: var(--accent-dark); padding-inline: .4rem; }
.btn-plain:hover { text-decoration: underline; }
.btn-danger { color: #a62d48; background: #fff1f4; border-color: #fce2e9; }
.metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; margin-bottom: 1rem; }
.panel, .metric { background: white; border: 1px solid #eeedf4; border-radius: var(--round); box-shadow: 0 2px 3px #211d4704; }
.metric { padding: .8rem; min-width: 0; }
.metric-top { display: flex; align-items: center; gap: .52rem; margin-bottom: .55rem; color: #565269; font-size: .81rem; font-weight: 700; }
.metric-icon { width: 1.85rem; height: 1.85rem; display: grid; place-items: center; border-radius: .58rem; flex: 0 0 auto; }
.tint-purple { color: #6748df; background: #eee8ff; }
.tint-blue { color: #4262cd; background: #edf1ff; }
.tint-green { color: #12775d; background: #e5f7f0; }
.tint-orange { color: #a95117; background: #fff1e5; }
.metric .money { display: block; font-size: clamp(1.05rem,4.5vw,1.85rem); letter-spacing: -.048em; line-height: 1.2; font-weight: 800; overflow-wrap: anywhere; }
.metric p { font-size: .77rem; color: var(--muted); line-height: 1.35; margin-top: .35rem; }
.dashboard-grid { display: grid; gap: 1rem; margin-bottom: 1rem; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: .55rem; }
.panel-head p, .subtext { color: var(--muted); font-size: .875rem; margin-top: .28rem; line-height: 1.5; }
.panel-pad { padding: 1rem; min-width: 0; }
.text-link { border: 0; background: none; color: var(--accent-dark); font-size: .86rem; font-weight: 800; text-decoration: none; padding: .12rem 0; }
.text-link:hover { text-decoration: underline; }
.chart { margin-top: .95rem; }
.chart-legend { display: flex; flex-wrap: wrap; gap: .45rem 1rem; color: var(--muted); font-size: .77rem; }
.chart-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.swatch { width: .55rem; height: .55rem; border-radius: .18rem; display: inline-block; flex: 0 0 auto; }
.fill-primary { background: #7655ee; }
.fill-secondary { background: #c6b6ff; }
.plot { display: grid; grid-template-columns: auto 1fr; grid-template-rows: 8.8rem auto; gap: .45rem .48rem; margin-top: .85rem; }
.axis { display: flex; flex-direction: column; justify-content: space-between; color: #6c687e; font-size: .67rem; text-align: right; }
.bars { display: grid; grid-template-columns: repeat(var(--columns,6), minmax(0,1fr)); align-items: end; height: 100%; background: repeating-linear-gradient(to top,#eceaf4 0 1px,transparent 1px 25%); padding-inline: .2rem; }
.bar-slot { height: 100%; display: flex; align-items: end; justify-content: center; min-width: 0; }
.bar { width: 66%; max-width: 3.3rem; display: flex; flex-direction: column-reverse; outline-offset: 1px; position: relative; }
.bar:focus-within, .bar:hover { filter: brightness(1.04); }
.bar span { width: 100%; flex: 0 0 auto; }
.bar span:last-child { border-radius: .35rem .35rem 0 0; }
.chart-tip { display: none; position: absolute; z-index: 2; left: 50%; bottom: calc(100% + .36rem); transform: translateX(-50%); color: white; background: #26213a; font: 700 .73rem "DM Sans", sans-serif; border-radius: .4rem; padding: .26rem .42rem; white-space: nowrap; }
.bar:focus .chart-tip, .bar:hover .chart-tip { display: block; }
.months { grid-column: 2; display: grid; grid-template-columns: repeat(var(--columns,6), minmax(0,1fr)); padding-inline: .2rem; text-align: center; color: var(--muted); font-size: .75rem; text-transform: capitalize; }
.item-list { display: grid; margin-top: .55rem; }
.item { display: flex; align-items: center; gap: .6rem; min-width: 0; padding: .52rem 0; }
.item + .item { border-top: 1px solid #f1eff6; }
.item-main { flex: 1; min-width: 0; }
.item-main strong { display: block; font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-main small { display: block; margin-top: .16rem; color: var(--muted); font-size: .75rem; }
.item-end { text-align: right; white-space: nowrap; }
.item-end > strong { display: block; font-size: .85rem; }
.item-end > small { display: block; color: var(--muted); font-size: .73rem; margin-top: .2rem; }
.item .unbordered { border: 0; }
.service-icon { flex: 0 0 auto; display: grid; place-items: center; width: 2.35rem; height: 2.35rem; border-radius: .66rem; font-weight: 900; font-size: 1.18rem; }
.brand-netflix { color: #e92843; background: #ffe9ee; font-family: Manrope,sans-serif; }
.brand-ai { color: #197d66; background: #e6f6f0; }
.brand-design { color: #5547d7; background: #ecebff; }
.brand-home { color: #5470d9; background: #ecf0ff; }
.brand-cloud { color: #6545dc; background: #efe9ff; }
.brand-service { color: #a35412; background: #fff0e3; }
.brand-safe { color: #087e67; background: #e3f6f0; }
.brand-other { color: #7652db; background: #f0ebff; }
.pill { display: inline-flex; align-items: center; min-height: 1.45rem; padding: .15rem .52rem; border-radius: 40px; font-size: .74rem; font-weight: 700; white-space: nowrap; line-height: 1.25; }
.pill.active { background: #e6f7ef; color: #17745c; }
.pill.trial { background: #fff1e3; color: #9b4a13; }
.pill.paused { background: #eeedf4; color: #605b73; }
.pill.cancelled, .pill.overdue { background: #fce8ee; color: #a93254; }
.records .panel-head { padding: 1rem 1rem .8rem; }
.scroll-area { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th,td { border-bottom: 1px solid #f0eef5; padding: .53rem .72rem; }
tr:last-child td { border-bottom: 0; }
th { background: #faf9fd; color: #615b74; font-size: .77rem; font-weight: 800; white-space: nowrap; }
td { font-size: .86rem; white-space: nowrap; }
td:first-child, th:first-child { padding-left: 1rem; }
td:last-child, th:last-child { padding-right: 1rem; }
td .item { padding: 0; }
td .item-main { max-width: 11rem; }
td .service-icon { height: 2.05rem; width: 2.05rem; }
.table-action { width: 2.05rem; height: 2.05rem; border: 0; background: transparent; }
.table-desktop { display: none; }
.cards-mobile { padding: 0 1rem; }
.cards-mobile .item { min-height: 4.15rem; }
.cards-mobile .item-main strong { white-space: normal; }
.cards-mobile .item:has(button:hover) { background: #faf8ff; }
.stack { display: grid; gap: 1rem; }
.filters { display: flex; flex-wrap: wrap; gap: .62rem; padding: 0 1rem 1rem; }
.field, .filter { display: grid; gap: .3rem; color: #4c475f; font-size: .85rem; font-weight: 700; min-width: 0; }
input,select,textarea { width: 100%; min-height: 2.65rem; padding: .55rem .68rem; border: 1px solid #e5e2f0; border-radius: .6rem; background: #fff; color: var(--ink); }
select { appearance: none; padding-right: 1.9rem; background-image: linear-gradient(45deg,transparent 50%,#6e6783 50%),linear-gradient(135deg,#6e6783 50%,transparent 50%); background-position: calc(100% - 15px) 50%,calc(100% - 11px) 50%; background-size: 4px 4px; background-repeat: no-repeat; }
.filters .search { flex: 1 1 100%; }
.filters .filter { flex: 1 1 7.5rem; }
.compact { min-height: 2.15rem; width: auto; font-size: .8rem; font-weight: 700; padding-block: .32rem; }
textarea { resize: vertical; min-height: 5rem; }
.empty { color: var(--muted); padding: 1.35rem .2rem; text-align: center; line-height: 1.5; }
.empty .btn { margin-top: .8rem; }
.demo-line { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; border: 1px solid #e8e1ff; background: #f1ecff; color: #5840a2; border-radius: .75rem; margin-top: .85rem; padding: .55rem .75rem; font-size: .78rem; }
.demo-line button { margin-left: auto; }
.calendar-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: .2rem; margin-top: 1rem; }
.calendar-grid > span { color: var(--muted); font-size: .7rem; text-align: center; }
.calendar-day { min-height: 2.6rem; border: 1px solid var(--line); border-radius: .38rem; background: #fff; color: var(--ink); font-size: .8rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; }
.calendar-day.has-event { background: #f5f1ff; color: #4e34aa; font-weight: 700; }
.calendar-day.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.calendar-day.today .day-number { color: white; background: var(--accent); border-radius: 50%; width: 1.45rem; height: 1.45rem; display: grid; place-items: center; }
.calendar-day small { font-size: .64rem; }
.calendar-month { text-transform: capitalize; padding-top: .38rem; }
.calendar-controls { display: flex; gap: .4rem; }
.rank { display: grid; gap: 1rem; padding-top: .75rem; }
.rank-entry { display: grid; gap: .45rem; }
.rank-title { display: flex; justify-content: space-between; gap: .5rem; font-size: .86rem; }
.track { height: .55rem; background: #efedf5; border-radius: 1rem; overflow: hidden; }
.track i { background: #835ff3; display: block; height: 100%; border-radius: inherit; }
.alert-box { border: 1px solid #e8e0fd; background: #f4efff; padding: .8rem; border-radius: .75rem; color: #563ca1; line-height: 1.5; font-size: .88rem; margin-top: .65rem; }
.settings-actions,.form-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1rem; }
.form-grid { display: grid; gap: .7rem; }
.form-note { color: var(--muted); font-weight: 400; line-height: 1.45; font-size: .78rem; }
fieldset { border: 1px solid var(--line); border-radius: .7rem; padding: .65rem; margin: 0; }
fieldset legend { font-weight: 700; font-size: .84rem; color: #514a65; }
.form-error { color: #a22649; font-size: .85rem; line-height: 1.4; }
[hidden] { display: none !important; }
dialog { border: 1px solid var(--line); border-radius: 1rem; padding: 0; width: min(94vw, 36rem); max-height: 90dvh; color: var(--ink); box-shadow: 0 20px 70px #15102c44; }
dialog::backdrop { background: #1813317d; backdrop-filter: blur(3px); }
.dialog-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: .6rem; border-bottom: 1px solid var(--line); background: white; padding: .72rem 1rem; }
.dialog-body { padding: 1rem; }
.details { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .7rem; margin: .75rem 0; }
.details div { background: #f8f6fc; border-radius: .55rem; padding: .55rem; overflow-wrap: anywhere; }
.details small { display: block; color: var(--muted); font-size: .75rem; margin-bottom: .15rem; }
.details strong { font-size: .86rem; }
#toast { position: fixed; z-index: 20; bottom: 4.8rem; right: 1rem; max-width: min(24rem, calc(100vw - 2rem)); background: #27213f; color: white; border-radius: .7rem; padding: .75rem 1rem; box-shadow: 0 6px 25px #1c163c30; }
#toast:empty { display: none; }
.loading { padding: 3rem 0; text-align: center; color: var(--muted); }
.vault-box { max-width: 34rem; }
.vault-box .form-grid { margin-top: .8rem; }
.long-text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); line-height: 1.55; margin-top: .65rem; }
@media (min-width: 610px) {
  main { padding-inline: 1.4rem; }
  .metrics { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .metric .money { font-size: clamp(1rem,2.6vw,1.9rem); }
  .filters .search { flex: 2 1 12rem; }
  .table-desktop { display: block; }
  .cards-mobile { display: none; }
  .form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .full { grid-column: 1 / -1; }
  .calendar-day { min-height: 3.65rem; }
}
@media (min-width: 860px) {
  .shell { display: grid; grid-template-columns: 13.2rem minmax(0,1fr); grid-template-rows: auto minmax(0,1fr); }
  .sidebar { grid-row: 1 / -1; display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; background: var(--dark); color: white; padding: 1.3rem .85rem .8rem; overflow: auto; }
  .sidebar .brand { margin: .17rem .55rem 2.2rem; }
  .nav-label { color: #a09bb6; font-size: .69rem; font-weight: 800; letter-spacing: .105em; text-transform: uppercase; padding: 0 .65rem; margin: .4rem 0 .55rem; }
  .sidebar nav { display: grid; gap: .2rem; margin-bottom: 1.15rem; }
  .sidebar nav a { color: #c9c5d9; text-decoration: none; display: flex; align-items: center; gap: .7rem; border-radius: .63rem; min-height: 2.65rem; padding: .55rem .65rem; font-size: .9rem; font-weight: 700; }
  .sidebar nav a:hover { background: #282441; color: white; }
  .sidebar nav a[aria-current="page"] { background: #332659; color: #e4d9ff; }
  .sidebar nav a[aria-current="page"] .icon { color: #b49cff; }
  .sidebar-bottom { margin-top: auto; }
  .side-tile { border: 1px solid #393052; border-radius: .76rem; background: linear-gradient(125deg,#26213e,#211c36); padding: .7rem; margin-bottom: .8rem; }
  .side-tile strong { font-size: .81rem; display: flex; gap: .42rem; align-items: center; color: #f0eaff; }
  .side-tile p { color: #bdb4d3; font-size: .75rem; line-height: 1.45; margin: .35rem 0 .45rem; }
  .side-tile button { color: #d0baff; font-size: .78rem; }
  .side-foot { color: #a8a1be; font-size: .75rem; border-top: 1px solid #332d46; padding: .72rem .25rem .25rem; }
  .topbar { grid-column: 2; padding: 0 1.65rem; min-height: 64px; }
  .topbar .brand, .mobile-nav { display: none; }
  .crumb { display: flex; gap: .4rem; align-items: center; color: #6b667d; font-size: .86rem; }
  .crumb strong { color: #383149; }
  .profile-text { display: block; line-height: 1.2; font-size: .83rem; text-align: left; }
  .profile-text small { color: var(--muted); display: block; margin-top: .16rem; }
  .profile { display: flex; align-items: center; gap: .5rem; border: 0; background: white; padding: 0 0 0 .24rem; color: var(--ink); }
  main { grid-column: 2; padding: 1.55rem 1.65rem 2rem; }
  .metric { padding: .95rem; }
  .metrics { gap: .8rem; }
  .metric-top { font-size: .87rem; }
  .metric p { font-size: .78rem; }
  .panel-pad { padding: 1.05rem; }
  .dashboard-grid { grid-template-columns: minmax(0,1.57fr) minmax(0,1fr); }
  .dashboard-grid.equal { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #toast { bottom: 1rem; }
}
@media (min-width: 1120px) {
  .shell { grid-template-columns: 14rem minmax(0,1fr); }
  .sidebar { padding-inline: 1rem; }
  .topbar,main { padding-inline: 1.9rem; }
  .page-head { margin-bottom: 1.34rem; }
  .panel-pad { padding: 1.15rem; }
  .metric { padding: 1rem 1.05rem; }
  .metric-icon { width: 2.14rem; height: 2.14rem; }
  .metric .money { font-size: 1.84rem; }
  .plot { grid-template-rows: 8.9rem auto; gap: .6rem .75rem; }
  .axis, .months { font-size: .77rem; }
  .metrics,.dashboard-grid { gap: .9rem; }
  .item { gap: .68rem; }
  th,td { padding-inline: .9rem; }
}
@media (max-width: 859px) {
  .profile { border: 0; padding: 0; background: transparent; }
}
.demo-badge { display: inline-block; color: #605377; font-size: .76rem; font-weight: 700; margin-left: .55rem; }
.fill-zero { background: #ded9ed; }
.report-filters { padding-inline: 0; align-items: flex-end; }
.report-filters .filter { flex: 0 0 auto; }
.calendar-controls .btn-icon, .calendar-controls .btn { min-height: 2.35rem; height: 2.35rem; }
.record-actions { text-align: right; }
.records .item .btn, .record-actions .btn { min-height: 2.35rem; padding-inline: .58rem; font-size: .79rem; }
.cards-mobile .item { gap: .45rem; }
.auth-page { min-height: 100dvh; display: grid; place-items: center; padding: 1rem; background: radial-gradient(ellipse at 12% 5%, #eee8ff 0, #f7f7fb 62%); }
.auth-card { width: min(100%, 27rem); padding: clamp(1.15rem, 5vw, 2rem); }
.auth-card .brand { margin-bottom: 1.4rem; }
.auth-card h1 { font-size: clamp(1.7rem, 6vw, 2.15rem); }
.auth-form { margin-top: 1.2rem; }
.cards-mobile .item .btn { min-height: 2.75rem; }
