
  :root {
    --bg: #F4F4F5;
    --surface: #FFFFFF;
    --text-main: #18181B;
    --text-muted: #71717A;
    --border: #E4E4E7;
    --brand-dark: #18181B;
    --accent-green: #22C55E;
    --accent-orange: #F59E0B;
    --accent-red: #EF4444;
  }

  * {
    box-sizing: border-box;
  }

  body {
    font-family: 'Cairo', sans-serif;
    background: var(--bg);
    color: var(--text-main);
    margin: 0;
    -webkit-font-smoothing: antialiased;
  }

  .no-scrollbar::-webkit-scrollbar {
    display: none;
  }
  .no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  ::-webkit-scrollbar {
    width: 5px;
    height: 5px;
  }
  ::-webkit-scrollbar-track {
    background: transparent;
  }
  ::-webkit-scrollbar-thumb {
    background: #D4D4D8;
  }

  .num {
    font-family: 'JetBrains Mono', monospace;
    font-variant-numeric: tabular-nums;
  }
  
  .sys-header {
    background: #F9FAFB;
    border-bottom: 1px solid var(--border);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.08em;
  }

  .sidebar-bg {
    background-color: #18181B;
  }
  .sidebar-border {
    border-color: #27272A;
  }
  .nav-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: #71717A;
    letter-spacing: 0.05em;
    padding: 0 24px;
    margin-bottom: 8px;
    margin-top: 24px;
  }
  .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #A1A1AA;
    transition: all 0.2s;
    border-right: 2px solid transparent;
    text-decoration: none;
  }
  .nav-item:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.03);
  }
  .nav-item.active {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.05);
    border-right-color: #FFFFFF;
  }

  .nav-tabs {
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 24px;
    padding: 0 24px;
  }
  .nav-tab {
    padding: 16px 0;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    position: relative;
    cursor: pointer;
  }
  .nav-tab.active {
    color: var(--brand-dark);
  }
  .nav-tab.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--brand-dark);
  }
  .tab-btn {
    padding: 10px 4px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
  }
  .tab-btn.active {
    color: var(--brand-dark);
    border-color: var(--brand-dark);
  }

  .ent-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
  }
  .ent-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 6px;
  }
  .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
  }

  .icon-sq {
    width: 38px;
    height: 38px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
  }
  .avatar-sq {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    background: var(--brand-dark);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    flex-shrink: 0;
  }
  .avatar-circle {
    width: 46px;
    height: 46px;
    border-radius: 4px;
    background: var(--brand-dark);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.05rem;
    flex-shrink: 0;
  }

  .badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
  }
  .meta-chip {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 150px;
  }
  .meta-chip .meta-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: .3px;
    text-transform: uppercase;
  }
  .meta-chip .meta-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
  }

  .invoice-banner {
    background: var(--brand-dark);
    border-radius: 4px;
    color: #fff;
    position: relative;
    overflow: hidden;
  }
  .info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
  }
  .info-row + .info-row {
    border-top: 1px solid var(--border);
  }
  .summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
  }
  .summary-total-card {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 4px;
    padding: 16px 18px;
  }

  .progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    width: 100%;
  }
  .progress-fill {
    height: 100%;
    border-radius: 4px;
  }

  .table-row {
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
  }
  .table-row:hover, .table-row-hover:hover {
    background: #FAFAFA;
  }
  .table-th {
    padding: 14px 16px;
    font-weight: 700;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: right;
    letter-spacing: .05em;
    text-transform: uppercase;
  }
  .table-td {
    padding: 13px 16px;
    border-top: 1px solid var(--border);
    vertical-align: middle;
    font-size: 0.85rem;
    font-weight: 600;
  }

  .search-input,
  .select-input,
  .ent-input {
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    padding: 8px 12px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s;
  }
  .search-input:focus,
  .select-input:focus,
  .field-input:focus,
  .field-select:focus,
  .ent-input:focus {
    border-color: var(--brand-dark);
  }
  .field-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
    display: block;
  }
  .field-input,
  .field-select {
    width: 100%;
    border: 1px solid #D1D5DB;
    border-radius: 4px;
    background: var(--surface);
    padding: 9px 12px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.15s ease;
  }
  .field-input:disabled {
    background: var(--bg);
    color: var(--text-muted);
    cursor: not-allowed;
  }
  .table-input {
    width: 100%;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-main);
    outline: none;
    transition: all 0.2s;
  }
  .table-input:focus,
  .table-input:hover {
    border-color: var(--border);
    background: var(--surface);
  }

  .btn-ghost-icon {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
  }
  .btn-ghost-icon:hover {
    background: #FAFAFA;
    border-color: #D1D5DB;
    color: var(--text-main);
  }
  .btn-ghost-icon.danger:hover {
    background: #FEF2F2;
    border-color: #FCA5A5;
    color: #DC2626;
  }
  .btn-ghost-sm {
    background: var(--surface);
    color: var(--text-main);
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 4px;
    border: 1px solid var(--border);
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 0.72rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: all 0.15s ease;
  }
  .btn-ghost-sm:hover {
    background: #FAFAFA;
    border-color: #D1D5DB;
  }
  .btn-danger-sm {
    background: #FEF2F2;
    color: var(--accent-red);
    font-weight: 700;
    padding: 9px 16px;
    border-radius: 4px;
    border: 1px solid #FECACA;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: 'Cairo', sans-serif;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }
  .btn-danger-sm:hover {
    background: #FEE2E2;
  }
  .btn-pay {
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 4px;
    border: 1px solid var(--border);
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 0.72rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
  }
  .btn-pay.unpaid {
    background: var(--surface);
    color: var(--text-muted);
  }
  .btn-pay.unpaid:hover {
    border-color: var(--accent-green);
    color: #16A34A;
  }
  .btn-pay.paid {
    background: var(--accent-green);
    color: #fff;
    border-color: var(--accent-green);
  }

  .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(24, 24, 27, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 16px;
  }
  .modal-overlay.open {
    display: flex;
  }
  .modal-panel {
    background: var(--surface);
    border-radius: 6px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border);
  }

  .toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--brand-dark);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 12px 22px;
    border-radius: 6px;
    z-index: 60;
    transition: bottom 0.3s ease, opacity 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
  }
  .toast.show {
    bottom: 24px;
    opacity: 1;
    visibility: visible;
  }

  @media (max-width: 767px) {
    .mobile-pad {
      padding-bottom: 100px;
    }
  }

  .receipt-print {
    display: none;
  }
  @media screen {
    .receipt-print {
      display: none;
    }
  }
  @media print {
    @page {
      size: 80mm auto;
      margin: 0;
    }
    html, body {
      width: 80mm;
      background: #fff !important;
    }
    aside, header, nav, .print-hide, .screen-only {
      display: none !important;
    }
    main {
      position: static;
      width: 100%;
      height: auto;
      overflow: visible;
      display: block;
    }
    .receipt-print {
      display: block !important;
      width: 76mm;
      margin: 0 auto;
      padding: 6px 4px;
      font-family: 'Courier New', Courier, monospace;
      color: #000;
      font-size: 11.5px;
      line-height: 1.5;
    }
    .receipt-print .r-center {
      text-align: center;
    }
    .receipt-print .r-store {
      font-size: 15px;
      font-weight: 700;
    }
    .receipt-print .r-sub {
      font-size: 10.5px;
    }
    .receipt-print .r-dashed {
      border-top: 1px dashed #000;
      border-bottom: 1px dashed #000;
      margin: 10px 0;
    }
    .receipt-print .r-row {
      display: flex;
      justify-content: space-between;
      gap: 6px;
      margin-bottom: 5px;
    }
    .receipt-print .r-item-name {
      flex: 1;
      word-break: break-word;
      font-weight: bold;
    }
    .receipt-print .r-item-meta {
      font-size: 10.5px;
      color: #000;
    }
    .receipt-print .r-bold {
      font-weight: 700;
    }
    .receipt-print .r-big {
      font-size: 13.5px;
      font-weight: 700;
    }
    .receipt-print .r-footer {
      font-size: 10.5px;
      margin-top: 8px;
    }
  }
