:root {
        --bg:#f6f4f0;
        --paper:#fff;
        --ink:#20251f;
        --muted:#788078;
        --line:#e9e8e2;
        --green:#176b4a;
        --green2:#e7f2eb;
        --orange:#a85826;
        --orange2:#fbefe5;
        --shadow:0 5px 20px #1720190b
      }
      * {
        box-sizing:border-box
      }
      body {
        margin:0;
        background:var(--bg);
        color:var(--ink);
        font:15px/1.45 Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif
      }
      button,input,select {
        font:inherit
      }
      button {
        cursor:pointer
      }
      .shell {
        min-height:100vh
      }
      .sidebar {
        position:fixed;
        inset:0 auto 0 0;
        width:238px;
        background:#fff;
        border-right:1px solid var(--line);
        padding:26px 17px;
        display:flex;
        flex-direction:column;
        z-index:3
      }
      .brand {
        font-weight:800;
        font-size:20px;
        letter-spacing:-.7px;
        padding:6px 12px 30px
      }
      .brand i {
        display:inline-grid;
        place-items:center;
        width:32px;
        height:32px;
        border-radius:11px;
        background:#dcece1;
        color:var(--green);
        font-style:normal;
        margin-right:8px
      }
      .nav {
        display:grid;
        gap:5px
      }
      .nav button {
        border:0;
        background:transparent;
        text-align:left;
        color:#69716a;
        padding:12px;
        border-radius:10px;
        font-weight:600
      }
      .nav button:hover,.nav button.active {
        background:#eaf2ec;
        color:var(--green)
      }
      .side-note {
        margin-top:auto;
        background:#f6f8f5;
        padding:14px;
        border-radius:12px;
        color:var(--muted);
        font-size:12px
      }
      .main {
        margin-left:238px;
        padding:32px clamp(20px,4vw,58px) 60px;
        max-width:1600px
      }
      .top {
        display:flex;
        justify-content:space-between;
        align-items:center;
        gap:20px;
        margin-bottom:28px
      }
      .top h1 {
        font-size:28px;
        letter-spacing:-.8px;
        margin:0
      }
      .sub {
        color:var(--muted);
        margin:5px 0 0
      }
      .btn {
        border:1px solid var(--line);
        background:white;
        color:var(--ink);
        padding:10px 15px;
        border-radius:9px;
        font-weight:650
      }
      .btn:hover {
        background:#f7f8f5
      }
      .btn.primary {
        background:var(--green);
        border-color:var(--green);
        color:white
      }
      .btn.primary:hover {
        background:#10573b
      }
      .btn.small {
        padding:6px 10px;
        font-size:13px
      }
      .btn.danger {
        color:#a43b36
      }
      .cards {
        display:grid;
        grid-template-columns:repeat(3,minmax(0,1fr));
        gap:14px;
        margin-bottom:20px
      }
      .card,.panel {
        background:var(--paper);
        border:1px solid var(--line);
        border-radius:14px;
        box-shadow:var(--shadow)
      }
      .card {
        padding:18px 20px
      }
      .card-label {
        font-size:13px;
        color:var(--muted);
        font-weight:550
      }
      .card-value {
        font-size:27px;
        letter-spacing:-.8px;
        font-weight:750;
        margin-top:9px
      }
      .card-foot {
        color:var(--muted);
        font-size:12px;
        margin-top:4px
      }
      .positive {
        color:var(--green)
      }
      .negative {
        color:var(--orange)
      }
      .grid {
        display:grid;
        grid-template-columns:minmax(0,1.7fr) minmax(270px,.8fr);
        gap:16px
      }
      .panel {
        padding:20px;
        margin-bottom:16px
      }
      .panel-head {
        display:flex;
        align-items:center;
        justify-content:space-between;
        gap:12px;
        margin-bottom:12px
      }
      .panel h2 {
        font-size:16px;
        margin:0;
        letter-spacing:-.2px
      }
      .toolbar {
        display:flex;
        gap:9px;
        align-items:center;
        flex-wrap:wrap;
        margin:0 0 14px
      }
      .control {
        border:1px solid var(--line);
        background:white;
        color:var(--ink);
        border-radius:9px;
        padding:10px 12px;
        min-width:0
      }
      .search {
        flex:1;
        min-width:180px
      }
      .table-wrap {
        overflow:auto
      }
      table {
        width:100%;
        border-collapse:collapse;
        white-space:nowrap
      }
      th,td {
        text-align:left;
        padding:12px 10px;
        border-bottom:1px solid #f0f0eb;
        font-size:13px
      }
      th {
        font-size:11px;
        text-transform:uppercase;
        letter-spacing:.055em;
        color:var(--muted);
        font-weight:700
      }
      tbody tr:last-child td {
        border-bottom:0
      }
      .pill {
        display:inline-flex;
        align-items:center;
        padding:4px 9px;
        border-radius:99px;
        font-size:11px;
        font-weight:700;
        background:#f1f2ef;
        color:#626960
      }
      .pill.stock {
        background:#eaf2ec;
        color:#176b4a
      }
      .pill.sold {
        background:#f0edfa;
        color:#6552a2
      }
      .pill.order {
        background:#fff3de;
        color:#916016
      }
      .pill.label-sent {
        background:#e8f2fb;
        color:#315f89
      }
      .pill.finalized {
        background:#e9efff;
        color:#485b99
      }
      .pill.paid {
        background:#e5f3e9;
        color:#176b4a
      }
      .pill.refunded {
        background:#fae9e7;
        color:#a43b36
      }
      .activity {
        display:grid;
        gap:0
      }
      .activity-row {
        display:flex;
        justify-content:space-between;
        gap:12px;
        padding:12px 0;
        border-bottom:1px solid #f0f0eb
      }
      .activity-row:last-child {
        border:0
      }
      .activity-title {
        font-size:13px;
        font-weight:650
      }
      .activity-meta {
        font-size:11px;
        color:var(--muted);
        margin-top:3px
      }
      .empty {
        padding:30px 12px;
        text-align:center;
        color:var(--muted);
        font-size:13px
      }
      .section {
        display:none
      }
      .section.active {
        display:block
      }
      .hint {
        color:var(--muted);
        font-size:13px
      }
      .modal {
        display:none;
        position:fixed;
        inset:0;
        background:#18201970;
        z-index:5;
        align-items:center;
        justify-content:center;
        padding:16px
      }
      .modal.show {
        display:flex
      }
      .dialog {
        width:min(460px,100%);
        background:white;
        border-radius:16px;
        padding:22px;
        box-shadow:0 20px 70px #0003
      }
      .dialog h2 {
        margin:0 0 16px;
        font-size:19px
      }
      .fields {
        display:grid;
        grid-template-columns:1fr 1fr;
        gap:12px
      }
      .field {
        display:grid;
        gap:6px
      }
      .field.full {
        grid-column:1/-1
      }
      .field label {
        font-size:12px;
        font-weight:650;
        color:#596159
      }
      .field input,.field select {
        width:100%
      }
      .dialog-actions {
        display:flex;
        justify-content:flex-end;
        gap:8px;
        margin-top:19px
      }
      .toast {
        position:fixed;
        bottom:22px;
        left:50%;
        transform:translateX(-50%);
        background:#20251f;
        color:white;
        padding:11px 16px;
        border-radius:10px;
        z-index:8;
        opacity:0;
        pointer-events:none;
        transition:.2s
      }
      .toast.show {
        opacity:1
      }
      .link {
        color:var(--green);
        font-weight:650
      }
      .mobile-brand {
        display:none
      }
      @media(max-width:1050px) {
        .cards {
          grid-template-columns:repeat(2,minmax(0,1fr))
        }
        .grid {
          grid-template-columns:1fr
        }
      }
      @media(max-width:680px) {
        .sidebar {
          inset:auto 0 0;
          width:auto;
          height:66px;
          padding:6px 8px;
          border-right:0;
          border-top:1px solid var(--line);
          display:block
        }
        .brand,.side-note {
          display:none
        }
        .nav {
          display:flex;
          justify-content:space-around;
          gap:2px
        }
        .nav button {
          font-size:10px;
          text-align:center;
          padding:8px 2px;
          flex:1;
          white-space:nowrap;
          overflow:hidden;
          text-overflow:ellipsis
        }
        .main {
          margin:0;
          padding:22px 14px 88px
        }
        .top {
          align-items:flex-start
        }
        .top h1 {
          font-size:23px
        }
        .top .sub {
          font-size:12px
        }
        .top>.btn {
          padding:9px 11px;
          font-size:13px
        }
        .cards {
          gap:9px
        }
        .card {
          padding:14px
        }
        .card-value {
          font-size:21px
        }
        .card-label {
          font-size:11px
        }
        .card-foot {
          font-size:10px
        }
        .panel {
          padding:15px
        }
        .fields {
          grid-template-columns:1fr
        }
        .field.full {
          grid-column:auto
        }
      }
      .purchase-detail {
        display:block;
        margin-top:3px;
        color:var(--muted);
        font-size:10px;
        white-space:normal
      }
      .withdrawal-status {
        color:var(--orange);
        font-weight:700
      }
      .withdrawal-status.done {
        color:var(--green)
      }
