:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f8f9fd;
    --line: #e7eaf2;
    --line-strong: #d9deea;
    --ink: #171a2b;
    --ink-soft: #576078;
    --muted: #8a91a5;
    --sidebar: #0d1225;
    --sidebar-soft: #151c35;
    --sidebar-text: #a6aec5;
    --primary: #6d5df5;
    --primary-dark: #5445d8;
    --purple: #8a6cf6;
    --pink: #ee7eaf;
    --green: #2bbf8a;
    --orange: #ef9a54;
    --blue: #4c9af4;
    --danger: #df6476;
    --shadow-sm: 0 1px 2px rgba(23, 26, 43, .03), 0 4px 14px rgba(23, 26, 43, .025);
    --shadow-lg: 0 22px 60px rgba(25, 29, 58, .14);
    --radius: 14px;
    --radius-sm: 10px;
    --sidebar-width: 258px;
    font-family: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--ink);
    background: var(--bg);
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select {
    font: inherit;
}

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

button {
    border: 0;
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.9;
}

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

.sidebar {
    width: var(--sidebar-width);
    flex: 0 0 var(--sidebar-width);
    min-height: 100vh;
    position: fixed;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    padding: 25px 16px 17px;
    background: var(--sidebar);
    color: var(--sidebar-text);
    z-index: 50;
}

.brand-lockup {
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 9px 0 8px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: #fff;
}

.brand-mark {
    width: 31px;
    height: 31px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: linear-gradient(135deg, #8b79ff, #ee7eaf);
    box-shadow: 0 8px 20px rgba(112, 94, 246, .26);
}

.brand-mark span {
    width: 3px;
    border-radius: 5px;
    background: #fff;
    transform: skew(-14deg);
}

.brand-mark span:nth-child(1) {
    height: 10px;
    opacity: .72;
}

.brand-mark span:nth-child(2) {
    height: 16px;
}

.brand-mark span:nth-child(3) {
    height: 12px;
    opacity: .82;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1;
    gap: 4px;
}

.brand-copy strong {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 17px;
    letter-spacing: -.4px;
}

.brand-copy small {
    font-size: 7px;
    letter-spacing: 1.55px;
    color: #8790ae;
    font-weight: 700;
}

.sidebar-close,
.mobile-menu {
    display: none;
}

.workspace-switcher {
    margin: 27px 0 26px;
    min-height: 58px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 11px;
    padding: 10px 9px;
    display: flex;
    align-items: center;
    gap: 9px;
    background: rgba(255, 255, 255, .035);
}

.workspace-avatar {
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    flex: 0 0 31px;
    border-radius: 9px;
    color: #f6f3ff;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    background: linear-gradient(135deg, #6859ee, #937ffb);
}

.workspace-copy,
.profile-mini>span:nth-child(2),
.user-menu-copy {
    min-width: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
}

.workspace-copy strong,
.profile-mini strong,
.user-menu strong {
    overflow: hidden;
    color: #f2f3fb;
    font-size: 12px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-copy small,
.profile-mini small,
.user-menu small {
    color: #838ca7;
    font-size: 10px;
    white-space: nowrap;
}

.workspace-switcher>svg {
    width: 14px;
    color: #7f88a6;
}

.nav-groups {
    overflow: auto;
    flex: 1;
    scrollbar-width: none;
}

.nav-groups::-webkit-scrollbar {
    display: none;
}

.nav-group+.nav-group {
    margin-top: 27px;
}

.nav-label {
    margin: 25px 10px 9px;
    color: #6f7896;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.15px;
    text-transform: uppercase;
}

.nav-link {
    min-height: 43px;
    margin: 3px 0;
    border-radius: 9px;
    padding: 0 11px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #9099b6;
    transition: color .18s ease, background .18s ease, transform .18s ease;
}

.nav-link svg {
    width: 17px;
    height: 17px;
    color: #79839f;
}

.nav-link span {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, .06);
    transform: translateX(2px);
}

.nav-link.is-active {
    color: #fff;
    background: linear-gradient(90deg, rgba(114, 94, 246, .25), rgba(114, 94, 246, .08));
    box-shadow: inset 3px 0 0 #7f70f6;
}

.nav-link.is-active svg {
    color: #a99fff;
}

.nav-count {
    border-radius: 20px;
    padding: 3px 7px;
    color: #9da7c2;
    background: rgba(255, 255, 255, .07);
    font-size: 10px;
    font-weight: 600;
}

.nav-count-alert {
    color: #ffacbd;
    background: rgba(223, 100, 118, .15);
}

.sidebar-footer {
    flex-shrink: 0;
}

.status-pip {
    margin: 17px 7px 14px;
    padding: 13px 10px;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    border-top: 1px solid rgba(255, 255, 255, .07);
}

.status-pip>span {
    width: 7px;
    height: 7px;
    margin-top: 3px;
    border-radius: 50%;
    background: #41d29e;
    box-shadow: 0 0 0 4px rgba(65, 210, 158, .1);
}

.status-pip div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.status-pip strong {
    color: #c9d0e5;
    font-size: 10px;
    font-weight: 600;
}

.status-pip small {
    color: #69738f;
    font-size: 9px;
}

.help-card {
    width: 100%;
    margin-bottom: 15px;
    padding: 11px 9px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: #c8cde0;
    background: rgba(255, 255, 255, .035);
    text-align: left;
    transition: border-color .2s ease, background .2s ease;
}

.help-card:hover {
    border-color: rgba(152, 137, 255, .45);
    background: rgba(113, 96, 243, .1);
}

.help-card>span:nth-child(2) {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 3px;
}

.help-card strong {
    font-size: 11px;
    font-weight: 600;
}

.help-card small {
    color: #78819d;
    font-size: 9px;
}

.help-card>svg {
    width: 13px;
    color: #687390;
}

.help-icon {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #aaa0ff;
    background: rgba(128, 111, 246, .15);
}

.help-icon svg {
    width: 14px;
}

.profile-mini {
    padding: 13px 6px 0;
    border-top: 1px solid rgba(255, 255, 255, .07);
    display: flex;
    align-items: center;
    gap: 9px;
}

.profile-mini .icon-button {
    width: 25px;
    height: 25px;
    color: #78819d;
}

.avatar {
    width: 30px;
    height: 30px;
    display: grid;
    flex: 0 0 30px;
    place-items: center;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
}

.avatar-indigo {
    color: #e9e5ff;
    background: linear-gradient(135deg, #8070f4, #5b72d9);
}

.avatar-purple {
    color: #f0ebff;
    background: linear-gradient(135deg, #a681f5, #7666db);
}

.avatar-pink {
    color: #fff0f5;
    background: linear-gradient(135deg, #ef91b5, #be70e9);
}

.avatar-green {
    color: #e8fff6;
    background: linear-gradient(135deg, #42c99e, #3698ad);
}

.avatar-orange {
    color: #fff4e6;
    background: linear-gradient(135deg, #f4af68, #df775e);
}

.avatar-blue {
    color: #e9f4ff;
    background: linear-gradient(135deg, #71b7f5, #527cd8);
}

.main-content {
    min-width: 0;
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
}

.topbar {
    height: 77px;
    padding: 0 39px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, .8);
}

.topbar-left,
.topbar-actions,
.breadcrumbs,
.heading-actions,
.panel-actions,
.live-indicator,
.user-menu {
    display: flex;
    align-items: center;
}

.breadcrumbs {
    gap: 10px;
    color: var(--muted);
    font-size: 12px;
}

.breadcrumbs svg {
    width: 13px;
    color: #bdc3d1;
}

.breadcrumbs strong {
    color: var(--ink);
    font-weight: 600;
}

.topbar-actions {
    gap: 12px;
}

.live-indicator {
    gap: 6px;
    color: #5d6982;
    font-size: 11px;
    font-weight: 600;
}

.live-indicator>span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 4px rgba(43, 191, 138, .1);
}

.topbar-divider {
    width: 1px;
    height: 25px;
    margin: 0 3px;
    background: var(--line);
}

.user-menu {
    gap: 9px;
    padding: 4px 0 4px 4px;
    color: var(--ink);
    background: none;
    text-align: left;
}

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

.user-menu-copy small {
    color: var(--muted);
}

.user-menu>svg {
    width: 14px;
    color: #939aae;
}

.icon-button {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 9px;
    color: var(--ink-soft);
    background: transparent;
    transition: color .18s ease, background .18s ease, transform .18s ease;
}

.icon-button svg {
    width: 17px;
}

.icon-button:hover {
    color: var(--primary);
    background: #f0efff;
    transform: translateY(-1px);
}

.has-notification {
    position: relative;
}

.has-notification>span {
    width: 5px;
    height: 5px;
    position: absolute;
    top: 7px;
    right: 7px;
    border: 1px solid var(--surface);
    border-radius: 50%;
    background: var(--pink);
}

.content-wrap {
    max-width: 1600px;
    margin: 0 auto;
    padding: 35px 39px 55px;
}

.page-heading {
    margin-bottom: 29px;
}

.heading-with-actions {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.eyebrow {
    margin: 0 0 7px;
    color: var(--primary);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
}

.page-heading h1 {
    margin: 0;
    color: var(--ink);
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(25px, 3vw, 32px);
    font-weight: 600;
    letter-spacing: -1.15px;
}

.wave {
    display: inline-block;
    color: #f3ae6f;
    font-family: sans-serif;
    font-size: 24px;
    transform: rotate(10deg);
}

.heading-subtitle,
.panel-header p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.heading-actions {
    gap: 10px;
}

.button {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.button svg {
    width: 15px;
}

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

.button-primary {
    color: #fff;
    background: linear-gradient(135deg, #7664f7, #6154de);
    box-shadow: 0 8px 18px rgba(103, 86, 232, .2);
}

.button-primary:hover {
    box-shadow: 0 10px 23px rgba(103, 86, 232, .3);
}

.button-secondary {
    color: var(--ink-soft);
    border: 1px solid var(--line-strong);
    background: var(--surface);
}

.button-secondary:hover {
    border-color: #bab5fa;
    background: #fbfaff;
}

.text-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 0;
    color: var(--primary);
    background: none;
    font-size: 11px;
    font-weight: 600;
}

.text-button svg {
    width: 13px;
}

.demo-banner {
    min-height: 55px;
    margin-bottom: 23px;
    padding: 10px 13px;
    border: 1px solid #e5e0ff;
    border-radius: 11px;
    display: flex;
    align-items: center;
    gap: 11px;
    color: #584cb4;
    background: linear-gradient(100deg, #f5f1ff, #fff8fc);
}

.demo-banner-icon {
    width: 29px;
    height: 29px;
    display: grid;
    place-items: center;
    flex: 0 0 29px;
    border-radius: 8px;
    color: #7664ef;
    background: #e9e4ff;
}

.demo-banner-icon svg {
    width: 15px;
}

.demo-banner div {
    display: flex;
    flex: 1;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 11px;
}

.demo-banner strong {
    color: #51459c;
    font-size: 11px;
}

.demo-banner div span {
    color: #837ba5;
    font-size: 11px;
}

.demo-banner button {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    color: #aaa2cf;
    background: transparent;
}

.demo-banner button:hover {
    color: #6d5df5;
}

.demo-banner.is-dismissed {
    display: none;
}

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

.metric-card {
    min-height: 168px;
    position: relative;
    overflow: hidden;
    padding: 18px 18px 15px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

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

.metric-icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 9px;
}

.metric-icon svg {
    width: 16px;
}

.metric-card-purple .metric-icon {
    color: #7566e8;
    background: #eeebff;
}

.metric-card-green .metric-icon {
    color: #20a97c;
    background: #e4f8f1;
}

.metric-card-orange .metric-icon {
    color: #e18b42;
    background: #fff0e4;
}

.metric-card-blue .metric-icon {
    color: #418bdf;
    background: #e7f2ff;
}

.metric-card p {
    margin: 15px 0 5px;
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 500;
}

.metric-value {
    color: var(--ink);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 23px;
    font-weight: 600;
    letter-spacing: -.8px;
}

.metric-card>small {
    color: var(--muted);
    font-size: 10px;
}

.trend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.trend svg {
    width: 12px;
    height: 12px;
}

.trend-up {
    color: #25aa7c;
}

.trend-down {
    color: #da7080;
}

.sparkline {
    height: 31px;
    position: absolute;
    right: 17px;
    bottom: 15px;
    left: 17px;
    display: flex;
    align-items: flex-end;
    gap: 3px;
    opacity: .8;
}

.sparkline span {
    min-height: 3px;
    flex: 1;
    border-radius: 4px 4px 1px 1px;
    opacity: .33;
}

.sparkline-purple span {
    background: var(--purple);
}

.sparkline-green span {
    background: var(--green);
}

.sparkline-orange span {
    background: var(--orange);
}

.sparkline-blue span {
    background: var(--blue);
}

.sparkline span:last-child {
    opacity: .75;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, .9fr);
    gap: 15px;
    margin-top: 15px;
}

.panel {
    min-width: 0;
    padding: 21px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.panel-header h2 {
    margin: 0;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -.25px;
}

.panel-header p {
    margin-top: 5px;
    font-size: 11px;
}

.panel-actions {
    gap: 9px;
}

.panel-actions>.icon-button {
    width: 28px;
    height: 28px;
}

.segmented-control {
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    background: var(--surface-soft);
}

.segmented-control button {
    padding: 5px 8px;
    border-radius: 5px;
    color: var(--muted);
    background: transparent;
    font-size: 10px;
    font-weight: 600;
}

.segmented-control button.is-active {
    color: var(--ink-soft);
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(20, 24, 48, .08);
}

.chart-summary {
    min-height: 41px;
    margin-top: 22px;
    display: flex;
    align-items: center;
    gap: 9px;
}

.chart-summary strong {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 21px;
    letter-spacing: -.7px;
}

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

.revenue-chart {
    height: 249px;
    position: relative;
    margin-top: 3px;
    padding: 11px 0 24px 42px;
}

.chart-gridlines {
    position: absolute;
    inset: 11px 0 29px 42px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.chart-gridlines span {
    border-top: 1px dashed #e8ebf3;
}

.revenue-chart svg {
    width: 100%;
    height: calc(100% - 28px);
    overflow: visible;
}

.chart-area {
    fill: url(#areaFill);
}

.chart-line {
    fill: none;
    stroke: #7665f2;
    stroke-linecap: round;
    stroke-width: 2.5;
    vector-effect: non-scaling-stroke;
}

.chart-dot {
    fill: #fff;
    stroke: #7665f2;
    stroke-width: 3;
    vector-effect: non-scaling-stroke;
}

.chart-y-labels {
    position: absolute;
    inset: 7px auto 27px 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #a1a8ba;
    font-size: 9px;
}

.chart-x-labels {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 42px;
    display: flex;
    justify-content: space-between;
    color: #a1a8ba;
    font-size: 9px;
}

.chart-tooltip {
    position: absolute;
    top: 30px;
    right: 9%;
    padding: 7px 9px;
    border: 1px solid #e4e0ff;
    border-radius: 7px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: #fff;
    background: #262142;
    box-shadow: var(--shadow-lg);
}

.chart-tooltip:after {
    width: 7px;
    height: 7px;
    position: absolute;
    bottom: -4px;
    left: 18px;
    border-right: 1px solid #262142;
    border-bottom: 1px solid #262142;
    background: #262142;
    content: '';
    transform: rotate(45deg);
}

.chart-tooltip strong {
    font-size: 10px;
}

.chart-tooltip span {
    color: #a9a1c6;
    font-size: 8px;
}

.donut-wrap {
    padding: 19px 0 17px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.donut-chart {
    width: 138px;
    height: 138px;
    position: relative;
    flex: 0 0 138px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(#7463f2 0 42.4%, #e990b2 42.4% 78.1%, #68a8ec 78.1% 100%);
}

.donut-chart:after {
    width: 91px;
    height: 91px;
    position: absolute;
    border-radius: 50%;
    background: var(--surface);
    content: '';
}

.donut-chart>div {
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.donut-chart strong {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px;
    letter-spacing: -.5px;
}

.donut-chart span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 9px;
}

.donut-legend {
    min-width: 0;
    flex: 1;
}

.donut-legend div {
    display: flex;
    align-items: center;
    gap: 7px;
}

.donut-legend div+div {
    margin-top: 17px;
}

.legend-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
}

.dot-violet {
    background: #7463f2;
}

.dot-pink {
    background: #e990b2;
}

.dot-blue {
    background: #68a8ec;
}

.donut-legend span:not(.legend-dot) {
    overflow: hidden;
    flex: 1;
    color: var(--ink-soft);
    font-size: 10px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

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

.plan-footnote {
    padding-top: 14px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 10px;
}

.lower-grid {
    align-items: stretch;
}

.activity-list {
    margin-top: 17px;
}

.activity-item {
    min-height: 55px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.activity-item+.activity-item {
    border-top: 1px solid #f0f1f5;
}

.activity-icon {
    width: 29px;
    height: 29px;
    display: grid;
    flex: 0 0 29px;
    place-items: center;
    border-radius: 8px;
}

.activity-icon svg {
    width: 14px;
}

.activity-icon-green {
    color: #25ab7d;
    background: #e4f8f0;
}

.activity-icon-purple {
    color: #7464e9;
    background: #eeebff;
}

.activity-icon-orange {
    color: #df8c47;
    background: #fff0e3;
}

.activity-icon-blue {
    color: #438ede;
    background: #e6f2ff;
}

.activity-copy {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.activity-copy strong {
    overflow: hidden;
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.activity-amount {
    color: var(--ink);
    font-size: 10px;
    font-weight: 700;
}

.quick-panel {
    background: linear-gradient(147deg, #fff, #fbfaff);
}

.panel-kicker {
    color: #9ba1b0;
    font-size: 9px;
    font-weight: 700;
}

.quick-actions {
    margin-top: 13px;
}

.quick-actions>button {
    width: 100%;
    padding: 11px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    background: transparent;
    text-align: left;
}

.quick-actions>button+button {
    border-top: 1px solid var(--line);
}

.quick-action-icon {
    width: 31px;
    height: 31px;
    display: grid;
    flex: 0 0 31px;
    place-items: center;
    border-radius: 8px;
}

.quick-action-icon svg {
    width: 15px;
}

.quick-icon-purple {
    color: #7463e9;
    background: #efecff;
}

.quick-icon-orange {
    color: #dd8741;
    background: #fff0e3;
}

.quick-icon-blue {
    color: #428de0;
    background: #e7f2ff;
}

.quick-actions>button>span:nth-child(2) {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.quick-actions strong {
    font-size: 11px;
    font-weight: 600;
}

.quick-actions small {
    color: var(--muted);
    font-size: 9px;
}

.quick-actions>button>svg {
    width: 14px;
    color: #aab0bf;
    transition: transform .2s ease;
}

.quick-actions>button:hover>svg {
    color: var(--primary);
    transform: translateX(3px);
}

.view.is-hidden {
    display: none;
}

.table-page .page-heading {
    margin-bottom: 22px;
}

.table-toolbar {
    min-height: 64px;
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 9px;
}

.search-box {
    width: 260px;
    height: 36px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-box>svg {
    position: absolute;
    left: 11px;
    width: 15px;
    color: #9ca4b7;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    height: 100%;
    padding: 0 12px 0 34px;
    outline: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: var(--surface-soft);
    font-size: 11px;
    transition: border .18s ease, box-shadow .18s ease, background .18s ease;
}

.search-box input:focus {
    border-color: #aaa1fb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(109, 93, 245, .1);
}

.filter-select {
    height: 36px;
    padding: 0 29px 0 10px;
    outline: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink-soft);
    background-color: var(--surface-soft);
    font-size: 11px;
    cursor: pointer;
}

.table-card {
    overflow: hidden;
    padding: 0;
}

.data-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
}

.data-table th {
    padding: 13px 18px;
    border-bottom: 1px solid var(--line);
    color: #8d95a8;
    background: #fbfcfe;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .55px;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.data-table td {
    padding: 13px 18px;
    border-bottom: 1px solid #eff1f5;
    color: var(--ink-soft);
    font-size: 11px;
    vertical-align: middle;
}

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

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

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

.table-user {
    display: flex;
    align-items: center;
    gap: 9px;
}

.table-user>span:last-child {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.table-user strong {
    color: var(--ink);
    font-size: 11px;
    font-weight: 600;
}

.table-user small {
    color: var(--muted);
    font-size: 9px;
}

.phone-mask {
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 7px;
    border-radius: 20px;
    font-size: 9px;
    font-weight: 700;
    white-space: nowrap;
}

.status-badge:before {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    content: '';
}

.status-active,
.status-completed,
.status-verified {
    color: #1d9d70;
    background: #e5f8f0;
}

.status-pending,
.status-processing,
.status-expiring {
    color: #c98237;
    background: #fff1df;
}

.status-failed,
.status-refunded,
.status-suspended {
    color: #d15d70;
    background: #ffebef;
}

.status-expired {
    color: #858da0;
    background: #f0f2f6;
}

.status-trial {
    color: #7664e7;
    background: #eeebff;
}

.action-row {
    display: flex;
    align-items: center;
    gap: 2px;
}

.action-row .icon-button {
    width: 27px;
    height: 27px;
}

.action-row .icon-button svg {
    width: 14px;
}

.action-row .danger:hover {
    color: var(--danger);
    background: #fff0f2;
}

.pagination {
    min-height: 58px;
    padding: 0 17px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    font-size: 10px;
}

.pagination-controls {
    display: flex;
    gap: 4px;
}

.page-number {
    width: 27px;
    height: 27px;
    border-radius: 7px;
    color: var(--ink-soft);
    background: transparent;
    font-size: 10px;
}

.page-number.is-active {
    color: #fff;
    background: var(--primary);
}

.page-number:disabled {
    color: #c5c9d4;
    cursor: not-allowed;
}

.page-number:hover:not(:disabled):not(.is-active) {
    background: #f1efff;
}

.empty-state {
    padding: 45px 20px;
    color: var(--muted);
    text-align: center;
}

.empty-state svg {
    width: 25px;
    margin-bottom: 8px;
    color: #aaa2f6;
}

.empty-state p {
    margin: 0;
    font-size: 12px;
}

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

.settings-card {
    padding: 22px;
}

.settings-card+.settings-card {
    margin-top: 15px;
}

.setting-row {
    min-height: 61px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.setting-row:first-child {
    padding-top: 4px;
}

.setting-row:last-child {
    padding-bottom: 4px;
    border-bottom: 0;
}

.setting-row>div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.setting-row strong {
    font-size: 11px;
    font-weight: 600;
}

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

.toggle {
    width: 36px;
    height: 21px;
    padding: 3px;
    border-radius: 20px;
    background: #d9deea;
}

.toggle span {
    width: 15px;
    height: 15px;
    display: block;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .14);
    transition: transform .2s ease;
}

.toggle.is-on {
    background: var(--primary);
}

.toggle.is-on span {
    transform: translateX(15px);
}

.system-health {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 19px;
}

.health-row {
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 9px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.health-row>svg {
    width: 16px;
    color: var(--green);
}

.health-row>div {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 3px;
}

.health-row strong {
    font-size: 10px;
}

.health-row small {
    color: var(--muted);
    font-size: 9px;
}

.health-check {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
}

.mobile-overlay,
.drawer-backdrop,
.modal-backdrop {
    position: fixed;
    inset: 0;
    visibility: hidden;
    opacity: 0;
    background: rgba(11, 16, 32, .42);
    transition: opacity .22s ease, visibility .22s ease;
    z-index: 60;
}

.mobile-overlay.is-open,
.drawer-backdrop.is-open,
.modal-backdrop.is-open {
    visibility: visible;
    opacity: 1;
}

.detail-drawer {
    width: min(430px, calc(100vw - 30px));
    position: fixed;
    inset: 0 0 0 auto;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    transform: translateX(102%);
    transition: transform .28s cubic-bezier(.2, .8, .2, 1);
    z-index: 70;
}

.detail-drawer.is-open {
    transform: translateX(0);
}

.drawer-header,
.modal-header {
    min-height: 84px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
}

.drawer-header h2,
.modal-header h2 {
    margin: 0;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 20px;
    letter-spacing: -.6px;
}

.drawer-body {
    flex: 1;
    overflow: auto;
    padding: 22px;
}

.drawer-footer {
    padding: 14px 22px 20px;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 8px;
}

.drawer-footer .button {
    flex: 1;
}

.detail-hero {
    margin-bottom: 22px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 11px;
    display: flex;
    align-items: center;
    gap: 11px;
    background: var(--surface-soft);
}

.detail-hero .avatar {
    width: 39px;
    height: 39px;
    flex-basis: 39px;
    font-size: 12px;
}

.detail-hero-copy {
    min-width: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
}

.detail-hero-copy strong {
    color: var(--ink);
    font-size: 13px;
}

.detail-hero-copy span {
    color: var(--muted);
    font-size: 10px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 13px;
}

.detail-field {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
}

.detail-field label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
}

.detail-field strong {
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 600;
    word-break: break-word;
}

.detail-section-title {
    margin: 23px 0 10px;
    color: var(--ink);
    font-size: 11px;
    font-weight: 700;
}

.detail-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.detail-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 10px;
}

.detail-list li strong {
    color: var(--ink-soft);
    font-weight: 600;
    text-align: right;
}

.modal-backdrop {
    display: grid;
    place-items: center;
    padding: 18px;
    z-index: 80;
}

.modal {
    width: min(515px, 100%);
    max-height: min(700px, calc(100vh - 36px));
    overflow: auto;
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    transform: translateY(10px) scale(.98);
    transition: transform .22s ease;
}

.modal-backdrop.is-open .modal {
    transform: translateY(0) scale(1);
}

.modal-body {
    padding: 22px;
}

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

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

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

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

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    min-height: 38px;
    padding: 0 11px;
    outline: 0;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    color: var(--ink);
    background: var(--surface-soft);
    font-size: 11px;
}

.form-field textarea {
    min-height: 85px;
    padding-top: 10px;
    resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: #aaa1fb;
    box-shadow: 0 0 0 3px rgba(109, 93, 245, .1);
}

.form-help {
    margin: 0 0 17px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.6;
}

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

.modal-actions .button {
    min-width: 90px;
}

.toast-region {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 100;
}

.toast {
    min-width: 280px;
    max-width: 380px;
    margin-top: 9px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink-soft);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    animation: toast-in .25s ease both;
    font-size: 11px;
}

.toast svg {
    width: 16px;
    color: var(--green);
}

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

.toast.is-leaving {
    animation: toast-out .2s ease both;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.dark-mode {
    --bg: #0c1122;
    --surface: #121a2d;
    --surface-soft: #172039;
    --line: #26314b;
    --line-strong: #33405d;
    --ink: #eef1fb;
    --ink-soft: #aeb7ce;
    --muted: #7d89a5;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .12), 0 5px 16px rgba(0, 0, 0, .08);
}

.dark-mode .topbar {
    background: rgba(18, 26, 45, .86);
}

.dark-mode .data-table th {
    background: #151e34;
}

.dark-mode .chart-tooltip {
    background: #292348;
}

.dark-mode .chart-tooltip:after {
    border-color: #292348;
    background: #292348;
}

.dark-mode .quick-panel {
    background: linear-gradient(147deg, #121a2d, #171b3b);
}

.dark-mode .demo-banner {
    border-color: #373164;
    background: linear-gradient(100deg, #1d1b3c, #282035);
}

.dark-mode .demo-banner strong {
    color: #c9c1ff;
}

.dark-mode .demo-banner div span {
    color: #928ba9;
}

.dark-mode .status-active,
.dark-mode .status-completed,
.dark-mode .status-verified {
    background: #123e35;
}

.dark-mode .status-pending,
.dark-mode .status-processing {
    background: #45311c;
}

.dark-mode .status-failed,
.dark-mode .status-refunded,
.dark-mode .status-suspended {
    background: #43232e;
}

.dark-mode .status-expiring {
    background: #45311c;
}

.dark-mode .status-expired {
    background: #282f42;
}

@media (max-width: 1180px) {
    .content-wrap {
        padding-right: 26px;
        padding-left: 26px;
    }

    .topbar {
        padding-right: 26px;
        padding-left: 26px;
    }

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

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

    .plan-panel {
        min-height: 250px;
    }

    .donut-wrap {
        justify-content: center;
    }

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

@media (max-width: 780px) {
    .sidebar {
        width: 266px;
        transform: translateX(-102%);
        transition: transform .28s cubic-bezier(.2, .8, .2, 1);
        box-shadow: var(--shadow-lg);
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-close,
    .mobile-menu {
        display: inline-grid;
    }

    .mobile-overlay {
        z-index: 40;
    }

    .main-content {
        width: 100%;
        margin-left: 0;
    }

    .topbar {
        height: 65px;
        padding: 0 17px;
    }

    .topbar-left {
        gap: 9px;
    }

    .topbar-actions {
        gap: 5px;
    }

    .live-indicator,
    .user-menu-copy,
    .topbar-divider,
    .user-menu>svg {
        display: none;
    }

    .user-menu {
        padding-left: 0;
    }

    .content-wrap {
        padding: 25px 17px 42px;
    }

    .heading-with-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .heading-actions {
        width: 100%;
    }

    .heading-actions .button {
        flex: 1;
    }

    .demo-banner {
        align-items: flex-start;
    }

    .demo-banner div {
        display: block;
    }

    .demo-banner strong,
    .demo-banner div span {
        display: block;
    }

    .demo-banner div span {
        margin-top: 4px;
        line-height: 1.45;
    }

    .metric-grid {
        gap: 10px;
    }

    .metric-card {
        min-height: 159px;
        padding: 15px;
    }

    .metric-value {
        font-size: 20px;
    }

    .panel {
        padding: 16px;
    }

    .panel-header {
        flex-wrap: wrap;
    }

    .panel-actions {
        width: 100%;
        justify-content: space-between;
    }

    .segmented-control {
        flex: 1;
    }

    .segmented-control button {
        flex: 1;
    }

    .chart-tooltip {
        right: 4%;
    }

    .table-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .toolbar-left,
    .toolbar-right {
        width: 100%;
    }

    .search-box {
        width: 100%;
        flex: 1;
    }

    .toolbar-right .button {
        flex: 1;
    }

    .filter-select {
        flex: 1;
    }

    .pagination {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .settings-grid {
        gap: 10px;
    }
}

@media (max-width: 450px) {
    .metric-grid {
        grid-template-columns: 1fr;
    }

    .metric-card {
        min-height: 145px;
    }

    .donut-wrap {
        gap: 12px;
    }

    .donut-chart {
        width: 118px;
        height: 118px;
        flex-basis: 118px;
    }

    .donut-chart:after {
        width: 78px;
        height: 78px;
    }

    .donut-chart strong {
        font-size: 15px;
    }

    .donut-legend div+div {
        margin-top: 13px;
    }

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

    .form-field.full-width {
        grid-column: auto;
    }

    .toast-region {
        right: 12px;
        bottom: 12px;
        left: 12px;
    }

    .toast {
        min-width: 0;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *:before,
    *:after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}