:root {
      --bg: #f6f6f6;
      --card: #ffffff;
      --text: #111111;
      --muted: #666666;
      --border: #dddddd;
      --accent: #111111;
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      font-family: Arial, Helvetica, sans-serif;
      background: var(--bg);
      color: var(--text);
    }

    .page {
      max-width: 1200px;
      margin: 0 auto;
      padding: 50px;
    }

    .topbar {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      align-items: end;
      justify-content: space-between;
      margin-bottom: 50px;
    }

    .title-wrap h1 {
      margin: 0 0 6px;
      font-size: 28px;
    }

    .title-wrap p {
      margin: 0;
      color: var(--muted);
    }

    .controls {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      align-items: end;
    }

    .control {
      display: flex;
      flex-direction: column;
      gap: 6px;
      font-size: 14px;
    }

    .control label {
      font-size: 10px;
      padding: 0 8px;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .control input,
    .control select,
    .control button {
      height: 30px;
      padding: 0 8px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: white;
      font: inherit;
    }

    .control button {
      cursor: pointer;
      background: var(--accent);
      color: white;
      border-color: var(--accent);
    }

    .status-row {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      align-items: center;
      margin-bottom: 20px;
      color: var(--muted);
      font-size: 14px;
    }

    .pill {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      min-height: 32px;
      padding: 0 10px;
      border-radius: 999px;
      background: white;
      border: 1px solid var(--border);
    }

    .orders, .reports {
      display: grid;
      gap: 16px;
    }

    .order-card, .report-card {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 18px;
      box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    }

    .order-card.new-order {
      outline: 3px solid var(--border);
    }

    .order-head, .report-head {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 14px;
    }

    .order-head h2, .report-head h3 {
      margin: 0 0 6px;
      font-size: 20px;
    }

    .order-head p {
      margin: 0;
      color: var(--muted);
      font-size: 14px;
    }

    .order-badges, .report-badges {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: start;
      justify-content: end;
    }

    .badge {
      display: inline-flex;
      align-items: center;
      min-height: 30px;
      padding: 0 10px;
      border-radius: 999px;
      border: 1px solid var(--border);
      background: #fafafa;
      font-size: 13px;
    }

    .order-body, .report-body {
      border-top: 1px solid var(--border);
      padding-top: 14px;
    }

    /* orders specific */

    .kv {
      display: grid;
      grid-template-columns: 180px 1fr;
      gap: 8px 14px;
      margin-bottom: 14px;
      font-size: 14px;
    }

    .kv-key {
      color: var(--muted);
      font-weight: bold;
    }

    details {
      border-top: 1px solid var(--border);
      padding-top: 12px;
      margin-top: 12px;
    }

    summary {
      cursor: pointer;
      font-weight: bold;
      margin-bottom: 10px;
    }

    .json-block {
      background: #f8f8f8;
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 12px;
      overflow: auto;
      white-space: pre-wrap;
      word-break: break-word;
      font-family: Menlo, Monaco, Consolas, monospace;
      font-size: 12px;
      line-height: 1.5;
    }

    .printful-panel {
      margin-top: 14px;
      border-top: 1px solid var(--border);
      padding-top: 14px;
      display: grid;
      gap: 12px;
    }

    .printful-panel-invalid {
      border-top-color: #efcaca;
    }

    .printful-panel-head {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      justify-content: space-between;
      align-items: center;
    }

    .printful-panel-title {
      font-weight: 700;
      font-size: 15px;
    }

    .printful-panel-subtitle {
      font-size: 13px;
      color: var(--muted);
      margin-top: 2px;
    }

    .printful-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
    }

    .printful-action-btn {
      height: 34px;
      padding: 0 12px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: white;
      cursor: pointer;
      font: inherit;
    }

    .printful-action-btn:disabled {
      cursor: not-allowed;
      opacity: 0.6;
    }

    .printful-message {
      padding: 10px 12px;
      border-radius: 10px;
      font-size: 13px;
      border: 1px solid var(--border);
    }

    .printful-message-error {
      background: #fff4f4;
      color: #8b1e1e;
      border-color: #efcaca;
    }

    .printful-message-success {
      background: #f4fbf4;
      color: #1f6d2a;
      border-color: #cfe6d2;
    }

    .printful-message-info {
      background: #f3f7ff;
      color: #0b57d0;
      border-color: #cfdcff;
    }

    .printful-block {
      display: grid;
      gap: 8px;
    }

    .printful-block-title {
      font-weight: 700;
      font-size: 13px;
    }

    .printful-error-list {
      margin: 0;
      padding-left: 18px;
      color: #8b1e1e;
      font-size: 13px;
    }

    .printful-details {
      margin-top: 0;
      padding-top: 0;
      border-top: none;
    }

    .empty {
      background: white;
      border: 1px dashed var(--border);
      border-radius: 14px;
      padding: 30px;
      text-align: center;
      color: var(--muted);
    }

    /* reports specific */

    .reports h2 {
        padding: 10px 40px;
    }

    .report-card {
        padding: 30px 40px;
        margin-bottom: 30px;
    }

    .report-body {
      padding: 20px 30px;
    }

    .merch-category {
      display: flex;
      flex-direction: column;
      gap: 8px 14px;
      margin-bottom: 14px;
      font-size: 14px;
    }

    .category-head {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 50px;
        align-items: baseline;
    }

    .category-head h4, .total-breakdown p {
        font-size: 16px;
    }

    .total-breakdown {
        display: flex;
        flex-direction: row;
        gap: 10px;
        justify-content: end;
    }

    .category-items {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    .category-item {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        padding: 16px 20px;
        gap: 20px;
        background: var(--border);
        border-radius: 8px;
    }

    .item-count, .item-total {
        justify-self: end;
    }

    .report-totals {
        display: flex;
        flex-direction: row;
        gap: 30px;
        padding-top: 40px;
        justify-content: end;
    }



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

    /* POS Modal Styles */
    .pos-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.6);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 1000;
      padding: 20px;
    }

    .pos-overlay.active {
      display: flex;
    }

    .pos-modal {
      background: white;
      border-radius: 16px;
      width: 100%;
      max-width: 1000px;
      max-height: 90vh;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    }

    .pos-header {
      padding: 20px 24px;
      border-bottom: 1px solid var(--border);
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: #fafafa;
    }

    .pos-header h2 {
      margin: 0;
      font-size: 22px;
    }

    .pos-close-btn {
      background: none;
      border: none;
      font-size: 24px;
      cursor: pointer;
      color: var(--muted);
      width: 36px;
      height: 36px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 8px;
      transition: background 0.2s;
    }

    .pos-close-btn:hover {
      background: var(--border);
    }

    .pos-content {
      flex: 1;
      overflow-y: auto;
      padding: 24px;
    }

    .pos-step {
      display: none;
    }

    .pos-step.active {
      display: block;
    }

    .pos-step-title {
      margin: 0 0 20px 0;
      font-size: 16px;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }

    /* Product Grid */
    .product-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
      gap: 16px;
      margin-bottom: 24px;
    }

    .product-card {
      background: white;
      border: 2px solid var(--border);
      border-radius: 12px;
      overflow: hidden;
      cursor: pointer;
      transition: all 0.2s;
      text-align: center;
    }

    .product-card:hover {
      border-color: var(--accent);
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }

    .product-card img {
      width: 100%;
      height: 120px;
      object-fit: cover;
      display: block;
    }

    .product-card-title {
      padding: 10px 8px;
      font-size: 12px;
      font-weight: 600;
      line-height: 1.3;
      min-height: 44px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    /* Cart Summary */
    .pos-cart {
      background: #f8f8f8;
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 16px;
      margin-bottom: 20px;
    }

    .pos-cart h3 {
      margin: 0 0 12px 0;
      font-size: 14px;
      color: var(--muted);
    }

    .pos-cart-items {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .pos-cart-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 8px 12px;
      background: white;
      border-radius: 8px;
      font-size: 13px;
    }

    .pos-cart-item-info {
      flex: 1;
    }

    .pos-cart-item-qty {
      color: var(--muted);
      margin-left: 8px;
    }

    .pos-cart-item-price {
      font-weight: 600;
    }

    .pos-cart-item-remove {
      background: none;
      border: none;
      color: #c44;
      cursor: pointer;
      font-size: 18px;
      margin-left: 8px;
      padding: 0 4px;
    }

    .pos-cart-empty {
      color: var(--muted);
      font-style: italic;
      text-align: center;
      padding: 20px;
    }

    .pos-cart-totals {
      margin-top: 16px;
      padding-top: 12px;
      border-top: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      gap: 6px;
      font-size: 14px;
    }

    .pos-cart-total-row {
      display: flex;
      justify-content: space-between;
    }

    .pos-cart-total-final {
      font-size: 18px;
      font-weight: 700;
      margin-top: 4px;
    }

    /* Product Selection Modal */
    .product-select-modal {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.5);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 1100;
    }

    .product-select-modal.active {
      display: flex;
    }

    .product-select-box {
      background: white;
      border-radius: 16px;
      padding: 24px;
      width: 100%;
      max-width: 360px;
      text-align: center;
    }

    .product-select-box img {
      width: 100px;
      height: 100px;
      object-fit: cover;
      border-radius: 8px;
      margin-bottom: 12px;
    }

    .product-select-box h3 {
      margin: 0 0 20px 0;
      font-size: 16px;
    }

    .product-select-field {
      margin-bottom: 16px;
    }

    .product-select-field label {
      display: block;
      margin-bottom: 6px;
      font-size: 13px;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.03em;
    }

    .product-select-field input,
    .product-select-field select {
      width: 100%;
      padding: 10px 12px;
      border: 1px solid var(--border);
      border-radius: 8px;
      font-size: 14px;
    }

    .product-select-buttons {
      display: flex;
      gap: 10px;
      margin-top: 20px;
    }

    .product-select-buttons button {
      flex: 1;
      padding: 12px 16px;
      border-radius: 8px;
      font-size: 14px;
      cursor: pointer;
      border: 1px solid var(--border);
    }

    .btn-cancel {
      background: white;
    }

    .btn-confirm {
      background: var(--accent);
      color: white;
      border-color: var(--accent);
    }

    /* Checkout Button */
    .pos-checkout-btn {
      width: 100%;
      padding: 16px 24px;
      background: #56951f;
      color: white;
      border: none;
      border-radius: 10px;
      font-size: 16px;
      font-weight: 600;
      cursor: pointer;
      transition: background 0.2s;
    }

    .pos-checkout-btn:hover:not(:disabled) {
      background: #447a18;
    }

    .pos-checkout-btn:disabled {
      background: #ccc;
      cursor: not-allowed;
    }

    /* Shipping Form */
    .shipping-form {
      display: grid;
      gap: 16px;
    }

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

    @media (max-width: 600px) {
      .form-row {
        grid-template-columns: 1fr;
      }
    }

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

    .form-field label {
      font-size: 13px;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.03em;
    }

    .form-field input {
      padding: 12px;
      border: 1px solid var(--border);
      border-radius: 8px;
      font-size: 14px;
    }

    .form-field input:focus {
      outline: none;
      border-color: var(--accent);
    }

    /* Payment Step */
    .payment-step {
      text-align: center;
      padding: 40px 20px;
    }

    .payment-step .total-display {
      font-size: 42px;
      font-weight: 700;
      margin: 20px 0;
    }

    .payment-instruction {
      font-size: 16px;
      color: var(--muted);
      margin-bottom: 30px;
    }

    .payment-method-options {
      display: flex;
      justify-content: center;
      gap: 12px;
      margin: 0 0 30px;
    }

    .payment-method-btn {
      background: #f4f4f4;
      color: var(--text);
      border: 2px solid var(--border);
      padding: 14px 30px;
      border-radius: 8px;
      font-size: 16px;
      font-weight: 700;
      cursor: pointer;
      transition: background 0.2s, border-color 0.2s, color 0.2s;
    }

    .payment-method-btn.selected {
      background: #56951f;
      border-color: #56951f;
      color: white;
    }

    .payment-complete-btn {
      background: #56951f;
      color: white;
      border: none;
      padding: 20px 40px;
      border-radius: 10px;
      font-size: 18px;
      font-weight: 600;
      cursor: pointer;
      transition: background 0.2s;
    }

    .payment-complete-btn:hover {
      background: #447a18;
    }

    .payment-complete-btn:disabled {
      background: #ccc;
      cursor: not-allowed;
    }

    .btn-primary {
      background: #56951f !important;
      border-color: #56951f !important;
    }

    .pos-nav-buttons {
      display: flex;
      gap: 12px;
      margin-top: 20px;
    }

    .pos-nav-buttons button {
      flex: 1;
      padding: 14px 24px;
      border-radius: 8px;
      font-size: 14px;
      cursor: pointer;
    }

    .pos-back-btn {
      background: white;
      border: 1px solid var(--border);
    }

    .pos-continue-btn {
      background: var(--accent);
      color: white;
      border: 1px solid var(--accent);
    }

    .pos-continue-btn:disabled {
      background: #ccc;
      border-color: #ccc;
      cursor: not-allowed;
    }

    .payment-item-list {
      background: #f8f8f8;
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 16px 20px;
      margin: 20px auto;
      max-width: 400px;
      text-align: left;
    }

    .payment-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 10px 0;
      border-bottom: 1px solid var(--border);
      font-size: 14px;
    }

    .payment-item:last-child {
      border-bottom: none;
    }

    .payment-item-info {
      flex: 1;
    }

    .payment-item-title {
      font-weight: 500;
    }

    .payment-item-details {
      font-size: 12px;
      color: var(--muted);
      margin-top: 2px;
    }

    .payment-item-price {
      font-weight: 600;
      font-size: 14px;
    }

    .form-field select {
      width: 100%;
      padding: 12px;
      border: 1px solid var(--border);
      border-radius: 8px;
      font-size: 14px;
      background: white;
    }

    .form-field select:focus {
      outline: none;
      border-color: var(--accent);
    }

    .payment-email-field {
      display: flex;
      align-items: center;
      gap: 12px;
      margin: 16px auto;
      max-width: 400px;
      justify-content: center;
      flex-wrap: wrap;
    }

    .payment-email-field label {
      font-size: 13px;
      color: var(--muted);
      white-space: nowrap;
    }

    .payment-email-field input {
      flex: 1;
      min-width: 200px;
      padding: 10px 12px;
      border: 1px solid var(--border);
      border-radius: 8px;
      font-size: 14px;
    }

    .payment-email-field input:focus {
      outline: none;
      border-color: var(--accent);
    }

    .custom-report-overlay {
      position: fixed;
      inset: 0;
      z-index: 1000;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 14px;
      background: rgba(0, 0, 0, 0.52);
    }

    .custom-report-overlay.active {
      display: flex;
    }

    .custom-report-modal {
      width: min(430px, 100%);
      max-height: calc(100vh - 40px);
      overflow: auto;
      background: white;
      border: 1px solid var(--border);
      border-radius: 8px;
      box-shadow: 0 22px 60px rgba(0, 0, 0, 0.24);
    }

    .custom-report-modal-head,
    .custom-report-actions {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 14px 16px;
      border-bottom: 1px solid var(--border);
    }

    .custom-report-actions {
      border-top: 1px solid var(--border);
      border-bottom: none;
    }

    .custom-report-modal h2,
    .custom-report-modal p {
      margin: 0;
    }

    .custom-report-step {
      margin-top: 4px;
      color: var(--muted);
      font-size: 13px;
    }

    .custom-report-close,
    .custom-report-nav,
    .custom-report-action {
      min-height: 34px;
      padding: 0 12px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: white;
      color: var(--text);
      cursor: pointer;
      font: inherit;
    }

    .custom-report-close {
      width: 36px;
      padding: 0;
      font-size: 18px;
      line-height: 1;
    }

    .custom-report-action.primary {
      background: var(--accent);
      border-color: var(--accent);
      color: white;
    }

    .custom-report-action:disabled {
      cursor: not-allowed;
      opacity: 0.55;
    }

    .custom-report-body {
      display: grid;
      gap: 12px;
      padding: 14px 16px;
    }

    .calendar-toolbar {
      display: grid;
      grid-template-columns: 34px 1fr 34px;
      align-items: center;
      gap: 8px;
    }

    .calendar-title {
      text-align: center;
      font-weight: 700;
    }

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

    .calendar-weekday {
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
      text-align: center;
      text-transform: uppercase;
    }

    .calendar-day {
      aspect-ratio: 1;
      min-width: 0;
      border: 1px solid var(--border);
      border-radius: 6px;
      background: white;
      color: var(--text);
      cursor: pointer;
      font: inherit;
      font-size: 13px;
      font-weight: 700;
    }

    .calendar-day.is-outside {
      color: #aaaaaa;
      background: #fafafa;
    }

    .calendar-day.is-selected {
      background: var(--accent);
      border-color: var(--accent);
      color: white;
    }

    .time-row {
      display: grid;
      grid-template-columns: 1fr;
      gap: 8px;
    }

    .time-field {
      display: grid;
      gap: 6px;
    }

    .time-field label {
      color: var(--muted);
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
    }

    .time-field select {
      width: 100%;
      height: 38px;
      padding: 0 10px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: white;
      font: inherit;
    }

    .custom-report-selected {
      min-height: 24px;
      color: var(--muted);
      font-size: 14px;
    }

    .custom-report-error {
      min-height: 20px;
      color: #9f1d1d;
      font-size: 14px;
      font-weight: 700;
    }

    .index-hero {
      display: flex;
      flex-direction: column;
      justify-content: center;
      padding: 100px 200px;
    }

    .index-nav {
      display: flex;
      flex-direction: row;
      gap: 22px;
      padding: 20px 0;
    }

    .index-nav a {
      background: #56951f;
      padding: 18px 30px;
      border-radius: 12px;
      text-decoration: none;
      color: var(--bg);
    }

    .nav {
      padding: 22px 30px;
    }

    .nav a {
      font-size: 12px;
      color: var(--muted);
    }



    