* {
    box-sizing: border-box;
}
body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    color: #26263c;
    background: #f5f6fb;
}
button,
input,
select {
    font: inherit;
}
a {
    color: inherit;
    text-decoration: none;
}
button,
a,
input,
select {
    -webkit-tap-highlight-color: transparent;
}
button {
    cursor: pointer;
}
button:focus-visible,
a:focus-visible {
    outline: 3px solid #ad9eea;
    outline-offset: 3px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 23px;
    font-weight: 750;
    letter-spacing: -0.7px;
}
.brand small {
    display: block;
    font-size: 9px;
    letter-spacing: 2px;
    color: #9996b1;
    margin-top: 3px;
}
.brand-mark {
    display: grid;
    place-items: center;
    width: 43px;
    height: 43px;
    background: #7055df;
    color: white;
    border-radius: 13px;
    font-size: 24px;
    box-shadow: 0 5px 12px #7055df25;
}
.muted {
    color: #8b8a9f;
}
.eyebrow {
    font-size: 10px;
    letter-spacing: 2px;
    font-weight: 700;
    color: #8267dd;
}
.btn {
    border: 0;
    border-radius: 10px;
    padding: 13px 20px;
    background: #7154dc;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
}
.btn:hover {
    background: #6044c8;
}
.btn.secondary {
    background: #f0ecfc;
    color: #694ec6;
}
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 35px;
}
.login-shell {
    max-width: 1100px;
    width: 100%;
    display: grid;
    grid-template-columns: 1.04fr 1fr;
    background: white;
    border-radius: 25px;
    box-shadow: 0 20px 80px #38305d12;
    overflow: hidden;
    border: 1px solid #eceaf4;
}
.story {
    padding: 42px;
    background: #eeebfa;
    position: relative;
    overflow: hidden;
    min-height: 640px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.story h1 {
    font-size: 43px;
    line-height: 1.15;
    letter-spacing: -1.8px;
    margin: 28px 0 16px;
    max-width: 380px;
}
.story p {
    font-size: 14px;
    line-height: 1.8;
    color: #79738e;
    max-width: 355px;
}
.story-note {
    font-size: 11px;
    color: #8a81a3;
}
.network-art {
    height: 185px;
    position: relative;
    margin: 24px 0;
}
.node {
    position: absolute;
    width: 54px;
    height: 54px;
    border-radius: 17px;
    display: grid;
    place-items: center;
    background: #fff;
    color: #7354d8;
    border: 1px solid #e2dbf7;
    box-shadow: 0 10px 24px #6e54b614;
}
.node.main {
    left: 44%;
    top: 0;
    background: #7456dc;
    color: white;
}
.node.a {
    left: 20%;
    top: 70px;
}
.node.b {
    left: 67%;
    top: 70px;
}
.node.c {
    left: 5%;
    top: 142px;
    width: 40px;
    height: 40px;
}
.node.d {
    left: 34%;
    top: 142px;
    width: 40px;
    height: 40px;
}
.node.e {
    left: 56%;
    top: 142px;
    width: 40px;
    height: 40px;
}
.node.f {
    left: 83%;
    top: 142px;
    width: 40px;
    height: 40px;
}
.network-art svg.lines {
    position: absolute;
    width: 100%;
    height: 185px;
    left: 0;
    top: 0;
}
.login-side {
    padding: 52px;
    display: flex;
    align-items: center;
}
.login-content {
    width: 100%;
}
.login-content h2 {
    font-size: 30px;
    letter-spacing: -0.8px;
    margin: 12px 0 9px;
}
.intro {
    font-size: 13px;
    line-height: 1.65;
    color: #9490a4;
    margin: 0 0 27px;
}
.role-tabs {
    display: flex;
    padding: 5px;
    background: #f3f2f8;
    border-radius: 11px;
    gap: 5px;
    margin-bottom: 27px;
}
.role-tabs button {
    flex: 1;
    border: 0;
    padding: 11px;
    background: transparent;
    color: #918aa2;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}
.role-tabs button.active {
    background: #fff;
    color: #6c50d1;
    box-shadow: 0 3px 8px #3726640a;
}
.field {
    margin-bottom: 19px;
}
.field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
}
.input {
    width: 100%;
    border: 1px solid #e4e2ed;
    border-radius: 10px;
    height: 49px;
    padding: 12px 14px;
    background: #fdfdff;
    outline: none;
    color: #353149;
}
.input:focus {
    border-color: #8d70e1;
    box-shadow: 0 0 0 3px #7154dc12;
}
.password-wrap {
    position: relative;
}
.password-wrap input {
    padding-right: 57px;
}
.password-toggle {
    position: absolute;
    right: 8px;
    top: 9px;
    height: 30px;
    padding: 0 8px;
    border: 0;
    background: transparent;
    color: #7f719d;
    font-size: 11px;
}
.login-submit {
    width: 100%;
    margin-top: 9px;
}
.login-help {
    font-size: 11px;
    color: #9690a6;
    line-height: 1.7;
    margin: 20px 0;
    text-align: center;
}
.copyright {
    font-size: 10px;
    color: #b1aabc;
    text-align: center;
    margin-top: 40px;
}
.message,
.field-error {
    color: #a8334f;
    font-size: 12px;
}
.message {
    display: block;
    padding: 12px;
    background: #fff0f3;
    border: 1px solid #f4d4dd;
    border-radius: 8px;
    margin-bottom: 16px;
}
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 242px;
    background: #fff;
    border-right: 1px solid #ececf4;
    display: flex;
    flex-direction: column;
    padding: 28px 19px;
    z-index: 30;
    overflow-y: auto;
}
.sidebar .brand {
    padding-left: 9px;
}
.workspace-tag {
    font-size: 10px;
    letter-spacing: 1.3px;
    color: #8d81a9;
    margin: 24px 10px 18px;
}
.nav-label {
    font-size: 9px;
    letter-spacing: 1.6px;
    color: #aaa5ba;
    margin: 22px 13px 11px;
    font-weight: 700;
}
.nav-link,
.nav-group {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px;
    border-radius: 9px;
    color: #888396;
    font-size: 12px;
    margin: 3px 0;
    border: 0;
    background: transparent;
    text-align: left;
}
.nav-link.active {
    background: #eeebfc;
    color: #7154dc;
    font-weight: 600;
}
.nav-link:hover,
.nav-group:hover {
    background: #f5f3fb;
    color: #7154dc;
}
.icon {
    width: 19px;
    height: 19px;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}
.nav-group .chevron {
    margin-left: auto;
    font-size: 12px;
}
.submenu {
    padding: 0 0 0 30px;
}
.submenu[hidden] {
    display: none;
}
.submenu a {
    display: block;
    padding: 9px 8px;
    color: #938aa4;
    font-size: 11px;
}
.sidebar-bottom {
    margin-top: auto;
    padding-top: 28px;
}
.profile {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 14px 9px;
    border-top: 1px solid #f0edf5;
    font-size: 12px;
}
.avatar {
    width: 35px;
    height: 35px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: #f0ebfc;
    color: #7652cd;
    font-weight: 700;
}
.profile small {
    display: block;
    font-size: 10px;
    color: #aaa1b7;
    margin-top: 4px;
}
.shell {
    margin-left: 242px;
}
.topbar {
    height: 84px;
    background: white;
    border-bottom: 1px solid #eeedf5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 35px;
    gap: 15px;
}
.crumb {
    font-size: 11px;
    color: #aaa3b7;
}
.top-right {
    display: flex;
    gap: 16px;
    align-items: center;
}
.role-pill {
    background: #f1edfc;
    color: #7958d1;
    padding: 7px 11px;
    border-radius: 6px;
    font-size: 10px;
}
.icon-button {
    background: #fff;
    border: 1px solid #eae6f1;
    border-radius: 9px;
    padding: 8px;
    display: grid;
    place-items: center;
    color: #7d7294;
}
.menu-toggle {
    display: none;
}
.page {
    padding: 30px 35px;
}
.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 26px;
}
.page-heading h1 {
    font-size: 25px;
    letter-spacing: -0.7px;
    margin: 0 0 7px;
}
.page-heading p {
    font-size: 12px;
    color: #9992a8;
    margin: 0;
}
.date-tag {
    font-size: 11px;
    color: #8c839e;
    background: white;
    border: 1px solid #e9e5f0;
    border-radius: 8px;
    padding: 11px;
}
.welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: #eee9fb;
    border: 1px solid #e8e0fb;
    border-radius: 16px;
    padding: 26px 30px;
    margin-bottom: 24px;
}
.welcome h2 {
    font-size: 22px;
    letter-spacing: -0.6px;
    margin: 8px 0 10px;
}
.welcome p {
    font-size: 12px;
    line-height: 1.7;
    color: #9184a9;
    max-width: 410px;
    margin: 0;
}
.welcome-art {
    width: 100px;
    height: 88px;
    position: relative;
    display: grid;
    place-items: center;
    border-radius: 25px;
    background: #e3d9fa;
    color: #7956d4;
}
.welcome-art .icon {
    width: 47px;
    height: 47px;
}
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 17px;
    margin-bottom: 24px;
}
.stat {
    border: 1px solid #ebe7f2;
    background: white;
    border-radius: 13px;
    padding: 21px;
}
.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 11px;
    color: #9c92ac;
}
.stat .stat-icon {
    padding: 8px;
    border-radius: 10px;
    background: #f1edfc;
    color: #8967d7;
    display: grid;
    place-items: center;
}
.stat strong {
    display: block;
    font-size: 26px;
    font-weight: 650;
    letter-spacing: -0.6px;
    margin: 18px 0 7px;
}
.stat small {
    color: #b0a6bb;
    font-size: 10px;
}
.columns {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 22px;
}
.card {
    border: 1px solid #ebe7f2;
    border-radius: 14px;
    background: white;
    overflow: hidden;
}
.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 24px;
    border-bottom: 1px solid #f1edf5;
}
.card-head h3 {
    font-size: 14px;
    margin: 0;
}
.card-head small {
    font-size: 10px;
    color: #aaa0ba;
}
.empty {
    padding: 38px 25px;
    text-align: center;
}
.empty .empty-icon {
    display: inline-grid;
    place-items: center;
    color: #a88cdd;
    background: #f5f0fc;
    border-radius: 18px;
    width: 58px;
    height: 58px;
    margin-bottom: 15px;
}
.empty h4 {
    font-size: 13px;
    margin: 0 0 9px;
    font-weight: 600;
}
.empty p {
    font-size: 11px;
    line-height: 1.8;
    color: #aaa0ba;
    margin: 0;
}
.quick-list {
    padding: 13px 21px;
}
.quick-item {
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #f3eff7;
    padding: 16px 0;
    font-size: 12px;
}
.quick-item:last-child {
    border: 0;
}
.quick-item small {
    font-size: 10px;
    color: #b2a7be;
    display: block;
    margin-top: 5px;
}
.quick-item .icon {
    color: #a183d0;
}
.quick-item span.arrow {
    margin-left: auto;
    color: #b4a6c9;
}
.footer {
    display: flex;
    justify-content: space-between;
    padding: 24px 35px;
    font-size: 10px;
    color: #b3a9bf;
}
.overlay {
    display: none;
}
.preview-note {
    font-size: 11px;
    color: #9486ae;
    background: #f1edfa;
    padding: 12px 16px;
    border-radius: 9px;
    margin-bottom: 20px;
}
.table-responsive {
    overflow-x: auto;
}
.form-control {
    width: 100%;
    padding: 11px;
    border: 1px solid #e4deef;
    border-radius: 8px;
}
.sidebar-close {
    display: none;
}
.preview-only-link {
    font-size: 11px;
    color: #7255cb;
    text-align: center;
    display: block;
    margin-top: 15px;
}
@media (min-width: 1600px) {
    .page {
        max-width: 1440px;
        margin: auto;
    }
}
@media (max-width: 1100px) {
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .columns {
        grid-template-columns: 1fr;
    }
    .login-side {
        padding: 35px;
    }
    .story {
        padding: 32px;
    }
}
@media (max-width: 800px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s;
    }
    .sidebar-open .sidebar {
        transform: translateX(0);
    }
    .sidebar-open .overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: #26203866;
        z-index: 25;
    }
    .sidebar-close {
        display: block;
        position: absolute;
        right: 12px;
        top: 8px;
        border: 0;
        background: transparent;
        padding: 4px;
        color: #8e7f9f;
    }
    .menu-toggle {
        display: grid;
    }
    .shell {
        margin-left: 0;
    }
    .topbar {
        height: 72px;
        padding: 0 20px;
    }
    .page {
        padding: 24px 20px;
    }
    .footer {
        padding: 20px;
    }
    .login-page {
        padding: 18px;
    }
    .login-shell {
        max-width: 530px;
        grid-template-columns: 1fr;
    }
    .story {
        min-height: 0;
        padding: 25px;
    }
    .story h1 {
        font-size: 23px;
        margin: 22px 0 0;
        max-width: none;
        letter-spacing: -0.6px;
    }
    .story p,
    .network-art,
    .story-note,
    .story .eyebrow {
        display: none;
    }
    .login-side {
        padding: 30px;
    }
    .login-content h2 {
        font-size: 26px;
    }
    .copyright {
        margin-top: 27px;
    }
    .welcome-art {
        width: 75px;
        height: 75px;
    }
    .page-heading {
        align-items: flex-start;
    }
    .date-tag {
        display: none;
    }
}
@media (max-width: 480px) {
    .stats {
        gap: 10px;
    }
    .stat {
        padding: 15px;
    }
    .stat strong {
        font-size: 24px;
    }
    .stat-top {
        font-size: 10px;
    }
    .stat-icon {
        display: none !important;
    }
    .welcome {
        padding: 22px;
    }
    .welcome-art {
        display: none;
    }
    .welcome h2 {
        font-size: 20px;
    }
    .top-right {
        gap: 8px;
    }
    .top-right .role-pill {
        display: none;
    }
    .footer {
        gap: 10px;
        flex-wrap: wrap;
    }
    .login-side {
        padding: 25px;
    }
    .login-page {
        padding: 12px;
    }
    .login-shell {
        border-radius: 18px;
    }
}
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}
.form-card {
    padding: 25px;
    margin-bottom: 23px;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 20px;
}
.form-grid > div,
.form-grid > span {
    min-width: 0;
}
.form-grid > div[id$="joining"] {
    display: contents;
}
.toolbar {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
    margin: 10px 0 20px;
}
.toolbar .field {
    margin: 0;
    flex: 1;
    min-width: 180px;
}
.toolbar .btn {
    min-height: 49px;
}
.data-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin: 18px 0;
}
.data-grid th {
    padding: 13px;
    background: #f4f0fb;
    color: #7c699a;
    text-align: left;
    white-space: nowrap;
}
.data-grid td {
    padding: 13px;
    border-bottom: 1px solid #eee8f5;
    white-space: nowrap;
}
.data-grid a {
    color: #7952ce;
    font-weight: 600;
}
.notice {
    display: block;
    background: #f3edfd;
    border: 1px solid #e8dcfa;
    padding: 14px;
    margin-bottom: 20px;
    border-radius: 10px;
    font-size: 13px;
    color: #724caf;
}
.sale-totals {
    padding: 20px;
    text-align: right;
    background: #f8f5fc;
    margin: 15px 0;
}
.password-value {
    display: block;
    padding: 18px;
    background: #fff3e2;
    color: #7c5a2e;
    font-family: monospace;
    overflow-wrap: anywhere;
}
.tree-scroll {
    overflow: auto;
    padding: 10px;
}
.binary-tree {
    display: flex;
    justify-content: center;
    min-width: max-content;
    padding: 0;
    margin: 0;
    list-style: none;
}
.binary-tree li {
    text-align: center;
    list-style: none;
    position: relative;
    padding: 25px 10px 0;
}
.binary-tree ul {
    display: flex;
    padding: 0;
    justify-content: center;
}
.binary-tree li:before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    height: 25px;
    border-left: 1px solid #d9cce9;
}
.tree-node {
    display: inline-block;
    border: 1px solid #decfec;
    border-radius: 12px;
    padding: 14px;
    min-width: 145px;
    background: #fff;
    font-size: 11px;
}
.tree-node.active-member {
    background: #edf8f0;
    border-color: #cfebd8;
}
.tree-node strong {
    display: block;
    color: #7451bc;
    font-size: 12px;
    margin-bottom: 7px;
}
.tree-node span {
    display: block;
    margin-top: 5px;
    color: #91809d;
}
.tree-node.empty-node {
    opacity: 0.5;
    background: #f7f5fa;
}
.receipt-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}
.receipt-header p {
    font-size: 13px;
    line-height: 1.8;
}
.receipt-total {
    text-align: right;
    font-size: 17px;
    margin-top: 25px;
}
@media (max-width: 1000px) {
    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 550px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    .form-card {
        padding: 18px;
    }
    .welcome {
        flex-wrap: wrap;
    }
}
@media print {
    .sidebar,
    .topbar,
    .footer,
    .no-print,
    .page-heading {
        display: none !important;
    }
    .shell {
        margin: 0;
    }
    .page {
        padding: 0;
    }
    .card {
        border: 0;
        box-shadow: none;
    }
    .data-grid td,
    .data-grid th {
        white-space: normal;
    }
    .table-responsive {
        overflow: visible;
    }
    .receipt-header {
        display: block;
    }
}
