:root {
  --primary: #f94a29;
  --primary-hover: #e03716;
  --primary-soft: #fff1ee;
  --primary-border: #ffd5cd;
  --secondary: #00bfa5;
  --secondary-dark: #009688;
  --secondary-soft: #e0f2f1;
  --dark: #1e293b;
  --dark-light: #334155;
  --gray: #64748b;
  --gray-light: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --yellow: #f59e0b;
  --green: #10b981;
  --red: #ef4444;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px 0 rgba(0,0,0,0.08);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08);
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-page);
  color: var(--dark);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: break-word;
  word-break: break-word;
}
.admin-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.admin-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--dark);
  min-width: 0;
}
.admin-brand-icon {
  width: 38px;
  height: 38px;
  background: var(--primary);
  color: #ffffff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.admin-brand-text {
  min-width: 0;
}
.admin-brand-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--dark);
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.admin-brand-tag {
  font-size: 11px;
  color: var(--gray);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.admin-header-actions .btn {
  white-space: nowrap;
  flex-shrink: 0;
}
.admin-nav-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 59px;
  z-index: 90;
}
.admin-nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  gap: 4px;
  padding: 0 16px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.admin-nav-inner::-webkit-scrollbar {
  display: none;
}
.admin-nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--gray);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.admin-nav-tab:hover {
  color: var(--primary);
}
.admin-nav-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 700;
}
.badge-tab-counter {
  background: var(--primary);
  color: #ffffff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  display: none;
}
.badge-tab-counter.active {
  display: inline-block;
}
.admin-main {
  max-width: 1280px;
  margin: 20px auto;
  padding: 0 16px 40px;
}
.admin-tab-content {
  display: none;
}
.admin-tab-content.active {
  display: block;
}
.admin-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
.admin-grid-2 > * {
  min-width: 0;
}
@media (min-width: 900px) {
  .admin-grid-2 {
    grid-template-columns: 1.1fr 0.9fr;
  }
}
.admin-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.admin-grid-4 > * {
  min-width: 0;
}
.stat-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.stat-card-label {
  font-size: 12px;
  color: var(--gray);
  font-weight: 600;
  margin-bottom: 6px;
}
.stat-card-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 4px;
}
.stat-card-sub {
  font-size: 11px;
  color: var(--gray);
}
.admin-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.admin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
}
.admin-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-card-desc {
  font-size: 12px;
  color: var(--gray);
  margin-top: 4px;
}
.scanner-viewport-box {
  background: #000000;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  min-height: 240px;
  max-width: 420px;
  margin: 0 auto 16px;
}
#reader {
  width: 100%;
}
.scanner-mode-switch {
  display: flex;
  background: var(--border-light);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 16px;
}
.scanner-mode-btn {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray);
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: 0.2s;
}
.scanner-mode-btn.active {
  background: #ffffff;
  color: var(--primary);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.scan-result-card {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: 14px;
}
.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
}
.admin-table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
  font-size: 12px;
}
.admin-table th {
  background: #f8fafc;
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
  color: var(--dark-light);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.admin-table tr:hover {
  background: #fbfcfe;
}
.table-prod-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}
.table-prod-thumb {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  border: 1px solid var(--border);
  background: #f1f5f9;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray);
  font-size: 16px;
}
.table-prod-thumb.fallback {
  background: #fff1ee;
  color: var(--primary);
  border-color: #ffd5cd;
}
.badge-sku {
  display: inline-block;
  background: #f1f5f9;
  color: var(--dark);
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  font-size: 11px;
  font-family: monospace;
  white-space: nowrap;
}
.badge-status-pending,
.badge-status-done,
.badge-status-cancel {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-status-pending {
  background: #fef3c7;
  color: #92400e;
}
.badge-status-done {
  background: #d1fae5;
  color: #065f46;
}
.badge-status-cancel {
  background: #fee2e2;
  color: #991b1b;
}
.stock-counter {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: #ffffff;
  overflow: hidden;
  height: 30px;
}
.stock-counter-btn {
  width: 28px;
  height: 30px;
  border: none;
  background: #f8fafc;
  color: var(--dark);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.15s ease;
  user-select: none;
  padding: 0;
}
.stock-counter-btn:hover {
  background: var(--primary);
  color: #ffffff;
}
.stock-counter-input {
  width: 50px;
  height: 30px;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--dark);
  padding: 0 4px;
  -moz-appearance: textfield;
}
.stock-counter-input::-webkit-outer-spin-button,
.stock-counter-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: 0.2s ease;
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--primary-hover);
}
.btn-secondary {
  background: var(--secondary);
  color: #ffffff;
}
.btn-secondary:hover {
  background: var(--secondary-dark);
}
.btn-outline {
  border-color: var(--border);
  background: #ffffff;
  color: var(--dark-light);
}
.btn-outline:hover {
  background: var(--bg-page);
}
.btn-sm {
  padding: 4px 8px;
  font-size: 11px;
}
.btn-lg {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
}
.btn-block {
  width: 100%;
}
.form-group {
  margin-bottom: 14px;
}
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--dark-light);
  margin-bottom: 5px;
}
.form-control {
  width: 100%;
  padding: 8px 12px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--dark);
  transition: border-color 0.2s;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
}
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal-overlay.active {
  display: flex;
}
.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.modal-close-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--gray);
  cursor: pointer;
}
.search-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.search-filter-bar > * {
  min-width: 0;
}
.server-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.server-status-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  background: #dcfce7;
  color: #15803d;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.server-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  background: #fbfcfe;
  cursor: pointer;
  transition: all 0.2s ease;
}
.server-upload-zone:hover {
  border-color: var(--primary);
  background: #fff8f6;
}
.server-upload-zone.dragover {
  border-color: var(--primary);
  background: #f0fdf4;
}
.upload-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.upload-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #feeae6;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 4px;
}
.upload-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--dark);
}
.upload-subtitle {
  font-size: 11px;
  color: var(--gray);
}
.upload-progress-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
}
.upload-spinner-icon {
  font-size: 24px;
  color: var(--primary);
}
.upload-progress-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--dark-light);
}
.upload-preview-box {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}
.server-preview-img {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border);
  background: #ffffff;
  flex-shrink: 0;
}
.upload-preview-info {
  flex: 1;
  min-width: 0;
}
.upload-preview-status {
  font-size: 11px;
  font-weight: 700;
  color: #15803d;
  margin-bottom: 2px;
}
.upload-server-filename {
  font-size: 11px;
  color: var(--gray);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 8px;
}
.upload-preview-actions {
  display: flex;
  gap: 8px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.text-red {
  color: var(--red);
}
.mb-0 {
  margin-bottom: 0;
}
.flex-1 {
  flex: 1;
}
.text-center-muted {
  color: var(--gray);
  text-align: center;
}
.scan-empty-icon {
  font-size: 24px;
  margin-bottom: 6px;
  display: block;
}
.pos-cart-list {
  min-height: 180px;
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 14px;
}
.pos-cart-empty {
  color: var(--gray);
  text-align: center;
  padding: 40px 0;
}
.pos-empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
  display: block;
  opacity: 0.4;
}
.pos-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-top: 2px solid var(--border);
  margin-bottom: 14px;
}
.pos-total-label {
  font-size: 14px;
  font-weight: 700;
}
.pos-total-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
}
.max-w-180 {
  max-width: 180px;
}
.max-w-200 {
  max-width: 200px;
}
.max-w-260 {
  max-width: 260px;
}
.max-w-600 {
  max-width: 600px;
}
.label-filter-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
}
.settings-desc {
  color: var(--gray);
  margin-bottom: 14px;
}
.modal-heading {
  font-size: 15px;
  font-weight: 700;
}
.grid-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.grid-2-col > * {
  min-width: 0;
}
.grid-1-2-col {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px;
}
.grid-1-2-col > * {
  min-width: 0;
}
.text-xs-muted {
  font-size: 11px;
  color: var(--gray);
}
.server-status-icon {
  color: var(--primary);
  margin-right: 6px;
}
.scan-status-error {
  color: var(--red);
  font-weight: 700;
}
.scan-status-success {
  color: var(--green);
  font-weight: 700;
}
.scan-order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.scan-order-id {
  font-size: 14px;
  color: var(--primary);
  font-weight: 700;
}
.scan-order-row {
  font-size: 12px;
  margin-bottom: 6px;
}
.scan-order-box {
  background: #ffffff;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  margin: 8px 0;
}
.scan-prod-card {
  display: flex;
  gap: 12px;
  align-items: center;
}
.scan-prod-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
}
.scan-prod-price {
  color: var(--primary);
  font-weight: 700;
}
.scan-prod-stock-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.scan-prod-stock-val {
  font-size: 16px;
  color: var(--primary);
  font-weight: 700;
}
.text-muted {
  color: var(--gray);
}
.btn-group-row {
  display: flex;
  gap: 4px;
  align-items: center;
}
.btn-group-sm {
  display: flex;
  gap: 6px;
}
.order-detail-modal {
  text-align: left;
  font-size: 12px;
}
.order-detail-items-box {
  margin: 12px 0;
  background: #f8fafc;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}
.order-detail-item-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
}
.order-detail-total {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
  text-align: right;
}
.pos-row-action {
  display: flex;
  align-items: center;
  gap: 6px;
}
@media (max-width: 640px) {
  .admin-header-inner {
    padding: 8px 12px;
  }
  .admin-brand-icon {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }
  .admin-brand-name {
    font-size: 13px;
  }
  .admin-brand-tag {
    display: none;
  }
  .admin-header-actions {
    gap: 6px;
  }
  .admin-header-actions .btn {
    padding: 6px 10px;
    font-size: 11px;
  }
  .admin-main {
    margin: 12px auto;
    padding: 0 12px 30px;
  }
  .admin-card {
    padding: 14px;
    margin-bottom: 14px;
  }
  .admin-card-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .admin-card-header .btn {
    width: 100%;
    justify-content: center;
  }
  .search-filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .search-filter-bar .form-control,
  .max-w-180,
  .max-w-200,
  .max-w-260 {
    max-width: 100%;
    width: 100%;
  }
  .grid-2-col,
  .grid-1-2-col {
    grid-template-columns: 1fr;
  }
  .admin-grid-4 {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stat-card {
    padding: 12px;
  }
  .stat-card-value {
    font-size: 18px;
  }
  .pos-cart-list {
    max-height: 220px;
  }
}
@media (max-width: 480px) {
  .admin-header-actions .btn-text {
    display: none;
  }
  .admin-header-actions .btn {
    padding: 6px 9px;
    font-size: 13px;
  }
}