/* NewTech POS — RTL Arabic Styles */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --success: #0d904f;
  --danger: #d93025;
  --warning: #f9ab00;
  --bg: #f5f5f5;
  --card: #ffffff;
  --text: #202124;
  --text-secondary: #5f6368;
  --border: #dadce0;
  --shadow: 0 1px 3px rgba(0,0,0,0.12);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
  --radius: 8px;
  --radius-lg: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  height: 100vh;
  overflow: hidden;
}

/* Header */
.pos-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px;
  background: var(--text);
  color: white;
  height: 50px;
}
.pos-header h1 { font-size: 18px; font-weight: 600; }
.header-subtitle { font-size: 12px; opacity: 0.7; margin-right: 10px; }
.header-left { display: flex; gap: 10px; align-items: center; }
.user-badge, .date-badge {
  background: rgba(255,255,255,0.15);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
}

/* Main Layout */
.pos-main {
  display: flex;
  height: calc(100vh - 50px);
  gap: 0;
}

/* Products Section */
.products-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px;
  overflow: hidden;
}

/* Categories */
.categories-bar {
  display: flex;
  gap: 6px;
  padding: 8px 0;
  overflow-x: auto;
  flex-shrink: 0;
}
.cat-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card);
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
  font-family: inherit;
  transition: all 0.2s;
}
.cat-btn:hover { border-color: var(--primary); color: var(--primary); }
.cat-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Search */
.search-bar {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  flex-shrink: 0;
}
.search-bar input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  direction: rtl;
}
.search-bar input:focus { outline: none; border-color: var(--primary); }
.barcode-btn {
  width: 44px;
  height: 44px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  font-size: 20px;
  cursor: pointer;
}
.barcode-btn:hover { border-color: var(--primary); }

/* Products Grid */
.products-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  overflow-y: auto;
  padding: 4px;
}
.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.product-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.product-card.out-of-stock {
  opacity: 0.5;
  pointer-events: none;
}
.product-img {
  width: 80px;
  height: 80px;
  border-radius: 6px;
  object-fit: cover;
  background: #f0f0f0;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: #ccc;
}
.product-name {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 4px;
  max-height: 32px;
  overflow: hidden;
}
.product-sku {
  font-size: 10px;
  color: var(--text-secondary);
  direction: ltr;
  margin-bottom: 4px;
}
.product-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}
.product-stock {
  font-size: 10px;
  color: var(--success);
  margin-top: 2px;
}
.product-stock.low { color: var(--warning); }
.product-stock.out { color: var(--danger); }

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 8px;
  flex-shrink: 0;
}
.page-btn {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
  font-family: inherit;
}
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-info { font-size: 13px; color: var(--text-secondary); }

/* Cart Section */
.cart-section {
  width: 360px;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

/* Customer Box */
.customer-box {
  padding: 10px;
  border-bottom: 1px solid var(--border);
}
.customer-search {
  display: flex;
  gap: 6px;
  position: relative;
}
.customer-search input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
}
.new-cust-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  background: var(--primary);
  color: white;
  font-size: 18px;
  cursor: pointer;
}
/* Customer search results dropdown */
.customer-results {
  position: absolute;
  top: 100%;
  right: 0;
  left: 42px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  max-height: 220px;
  overflow-y: auto;
}
.cust-result-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.15s;
}
.cust-result-item:hover { background: #e3f2fd; }
.cust-result-item:last-child { border-bottom: none; }
.cust-result-name { font-weight: 600; font-size: 13px; }
.cust-result-phone { font-size: 12px; color: var(--text-secondary); direction: ltr; }
.cust-result-empty {
  padding: 14px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}
.cust-result-empty button {
  margin-top: 6px;
  padding: 6px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
}
.customer-info {
  margin-top: 8px;
  padding: 8px 10px;
  background: #e8f5e9;
  border-radius: var(--radius);
  position: relative;
}
.cust-remove {
  position: absolute;
  top: 4px;
  left: 8px;
  cursor: pointer;
  font-size: 18px;
  color: var(--danger);
  line-height: 1;
}
.cust-name { font-weight: 600; font-size: 14px; }
.cust-details { font-size: 12px; color: var(--text-secondary); display: flex; justify-content: space-between; margin-top: 4px; }
/* Phone input with country code */
.phone-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.phone-prefix {
  padding: 8px 10px;
  background: #f5f5f5;
  border-left: 1px solid var(--border);
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  user-select: none;
  direction: ltr;
}
.phone-input-wrap input {
  flex: 1;
  padding: 8px 10px;
  border: none;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.loyalty-badge {
  background: var(--warning);
  color: #333;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

/* Cart Items */
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.empty-cart {
  text-align: center;
  color: var(--text-secondary);
  padding: 40px 20px;
  font-size: 14px;
}
.cart-item {
  display: flex;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid #f0f0f0;
  gap: 8px;
}
.cart-item-info { flex: 1; }
.cart-item-name { font-size: 13px; font-weight: 500; }
.cart-item-serial { font-size: 10px; color: var(--text-secondary); direction: ltr; }
.cart-item-price { font-size: 13px; font-weight: 600; color: var(--primary); white-space: nowrap; }
.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 4px;
}
.qty-btn {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--card);
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qty-btn.remove { color: var(--danger); border-color: var(--danger); }
.cart-item-qty span { font-size: 14px; font-weight: 600; min-width: 20px; text-align: center; }

/* Cart Summary */
.cart-summary {
  padding: 10px;
  border-top: 2px solid var(--border);
}
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 14px;
}
.total-row {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* Discount & Actions */
.discount-box {
  display: flex;
  gap: 4px;
  padding: 6px 10px;
}
.action-btn {
  flex: 1;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
}
.action-btn:hover { border-color: var(--primary); }

/* Payment Methods */
.payment-methods {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  padding: 8px 10px;
}
.pay-btn-kent {
  background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
  color: white;
  border-color: #1a237e;
  font-weight: 600;
}
.pay-btn-kent:hover { background: linear-gradient(135deg, #283593 0%, #1a237e 100%); border-color: #0d1642; }
.pay-btn-kent.selected { background: #0d1642; border-color: #000051; box-shadow: 0 0 0 3px rgba(26,35,126,0.3); }
.pay-btn {
  padding: 10px 4px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  transition: all 0.2s;
}
.pay-btn:hover { border-color: var(--primary); }
.pay-btn.selected {
  border-color: var(--primary);
  background: #e3f2fd;
  font-weight: 600;
}

/* Device Payment Box */
.device-pay-box {
  padding: 8px 10px;
  background: #e3f2fd;
  margin: 4px 10px;
  border-radius: var(--radius);
  border: 2px solid var(--primary);
}
.device-card-types {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.card-type-btn {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: white;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  transition: all 0.2s;
}
.card-type-btn:hover { border-color: var(--primary); }
.card-type-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.ref-input-box label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--primary-dark);
}
.ref-input-box input {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  font-size: 18px;
  font-family: inherit;
  background: white;
  text-align: center;
  letter-spacing: 2px;
  font-weight: 600;
}
.ref-input-box input:focus { outline: none; border-color: var(--primary-dark); }

/* Split Payment */
.split-pay-box {
  padding: 8px 10px;
  background: #fff3e0;
  margin: 4px 10px;
  border-radius: var(--radius);
  border: 2px solid var(--warning);
}
.split-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.split-row label { font-size: 12px; width: 60px; flex-shrink: 0; font-weight: 600; }
.split-row input {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  text-align: center;
}
.split-currency { font-size: 12px; color: var(--text-secondary); width: 30px; }

/* Payment grid */

/* Tap button */
.pay-btn-tap {
  background: linear-gradient(135deg, #2ace77 0%, #1a9c5a 100%);
  color: white;
  border-color: #1a9c5a;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
}
.pay-btn-tap:hover { background: linear-gradient(135deg, #1a9c5a 0%, #148a4e 100%); border-color: #148a4e; }
.pay-btn-tap.selected { background: #148a4e; border-color: #0d6b3a; box-shadow: 0 0 0 3px rgba(42,206,119,0.3); }
.tap-header {
  font-size: 13px;
  font-weight: 700;
  color: #1a9c5a;
  margin-bottom: 8px;
  text-align: center;
}

/* Tabby button + box */
.pay-btn-tabby {
  background: linear-gradient(135deg, #3bffc1 0%, #00c9a7 100%);
  color: #1a1a2e;
  border-color: #00c9a7;
  font-weight: 700;
}
.pay-btn-tabby:hover { background: linear-gradient(135deg, #00c9a7 0%, #00a88e 100%); }
.pay-btn-tabby.selected { background: #00a88e; border-color: #008573; box-shadow: 0 0 0 3px rgba(0,201,167,0.3); }
.tabby-box {
  padding: 10px;
  background: linear-gradient(135deg, #f0fff9 0%, #e0f7ef 100%);
  margin: 4px 10px;
  border-radius: var(--radius);
  border: 2px solid #00c9a7;
  text-align: center;
}
.tabby-header {
  font-size: 14px;
  font-weight: 700;
  color: #00a88e;
  margin-bottom: 6px;
}
.tabby-installment {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a2e;
  padding: 4px 0;
}
.tabby-status {
  font-size: 12px;
  color: #5f6368;
  margin-top: 6px;
  padding: 6px;
  background: white;
  border-radius: 6px;
}

/* Complete Button */
.complete-btn {
  margin: 8px 10px;
  padding: 14px;
  border: none;
  border-radius: var(--radius);
  background: var(--success);
  color: white;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.complete-btn:hover:not(:disabled) { background: #0a7a43; }
.complete-btn:disabled { background: #ccc; cursor: not-allowed; }

/* Secondary Actions */
.secondary-actions {
  display: flex;
  gap: 4px;
  padding: 6px 10px 10px;
}
.sec-btn {
  flex: 1;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
  font-size: 11px;
  font-family: inherit;
}
.sec-btn:hover { background: #f5f5f5; }

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-content {
  background: var(--card);
  border-radius: var(--radius-lg);
  width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-sm { width: 360px; }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 18px; }
.close-modal {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-secondary);
}
.modal-body { padding: 20px; }
.modal-footer {
  display: flex;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  justify-content: flex-start;
}
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.form-group input, .form-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
}
.primary-btn {
  padding: 8px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
}
.primary-btn:hover { background: var(--primary-dark); }
.cancel-btn {
  padding: 8px 20px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
}

/* Discount Type */
.discount-type {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.disc-type-btn {
  flex: 1;
  padding: 8px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
  font-family: inherit;
}
.disc-type-btn.active { border-color: var(--primary); background: #e3f2fd; }

/* Receipt */
.receipt {
  background: #fff;
  border: 1px dashed var(--border);
  padding: 20px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
  direction: rtl;
}
.receipt-actions { justify-content: center; }

/* Z-Report */
.z-report {
  background: #f5f5f5;
  padding: 16px;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.8;
}

/* Payment Link Status */
.pay-link-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  background: #fff3e0;
  border-radius: var(--radius);
  margin: 12px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--warning);
}
.pay-link-status.success {
  background: #e8f5e9;
  color: var(--success);
}
.pay-link-status.error {
  background: #fce4ec;
  color: var(--danger);
}
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid #ddd;
  border-top-color: var(--warning);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.pay-link-status.success .spinner { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Installation */
.install-price-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  font-size: 16px;
  font-weight: 600;
}
.install-price {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

/* Refund Steps */
.refund-step h3 { font-size: 15px; margin-bottom: 10px; color: var(--primary); }
.refund-cust-result { max-height: 200px; overflow-y: auto; }
.refund-cust-card {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.refund-cust-card:hover { border-color: var(--primary); background: #f5f9ff; }
.refund-selected-cust {
  padding: 8px 12px;
  background: #e8f5e9;
  border-radius: var(--radius);
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
}
.refund-invoices-list { max-height: 250px; overflow-y: auto; }
.refund-inv-card {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
}
.refund-inv-card:hover { border-color: var(--primary); background: #f5f9ff; }
.refund-inv-card.selected { border-color: var(--primary); background: #e3f2fd; }
.refund-inv-info {
  padding: 8px;
  background: #f5f5f5;
  border-radius: var(--radius);
  margin-bottom: 10px;
  font-size: 13px;
}
.refund-items-list { max-height: 200px; overflow-y: auto; }
.refund-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid #eee;
}
.refund-item-row input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }
.refund-item-row .item-info { flex: 1; font-size: 13px; }
.refund-item-row .item-price { font-weight: 600; white-space: nowrap; }
.refund-total {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  background: #fce4ec;
  border-radius: var(--radius);
  margin-top: 12px;
  font-size: 18px;
  font-weight: 700;
  color: var(--danger);
}

/* Header Button */
.header-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
}
.header-btn:hover { background: rgba(255,255,255,0.3); }

/* User Role Badges */
.role-admin { background: #d93025 !important; }
.role-manager { background: #1a73e8 !important; }
.role-cashier { background: #0d904f !important; }
.role-technician { background: #f9ab00 !important; color: #333 !important; }

/* Modal Large */
.modal-lg { width: 680px; max-height: 85vh; }

/* Settings Tabs */
.settings-tabs {
  display: flex;
  gap: 4px;
  padding: 0 0 12px;
  overflow-x: auto;
  border-bottom: 2px solid var(--border);
  margin-bottom: 16px;
}
.settings-tab {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card);
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  white-space: nowrap;
}
.settings-tab:hover { border-color: var(--primary); }
.settings-tab.active { background: var(--primary); color: white; border-color: var(--primary); }

/* Settings Panels */
.settings-panel { display: none; }
.settings-panel.active { display: block; }
.settings-panel h3 { font-size: 16px; margin-bottom: 12px; }
.settings-panel h4 { font-size: 14px; margin-bottom: 8px; color: var(--text-secondary); }

/* Settings Grid */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.setting-item label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text-secondary);
}
.setting-item input[type="text"],
.setting-item input[type="number"],
.setting-item input[type="password"],
.setting-item select {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
}
.setting-item.full-width { grid-column: 1 / -1; }
.setting-item.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.setting-item.toggle label { margin-bottom: 0; }
.setting-item.toggle input[type="checkbox"] {
  width: 40px;
  height: 22px;
  appearance: none;
  background: #ccc;
  border-radius: 11px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}
.setting-item.toggle input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}
.setting-item.toggle input[type="checkbox"]:checked {
  background: var(--primary);
}
.setting-item.toggle input[type="checkbox"]:checked::after {
  transform: translateX(-18px);
}

/* Tables */
.levels-table, .services-table, .users-table, .perms-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.levels-table th, .services-table th, .users-table th, .perms-table th {
  background: #f5f5f5;
  padding: 8px;
  text-align: right;
  font-weight: 600;
}
.levels-table td, .services-table td, .users-table td, .perms-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #eee;
}
.levels-table input, .services-table input {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
}
.remove-svc {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 16px;
}
.active-row { background: #e8f5e9; }

/* Role Chips */
.role-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  color: white;
}
.role-chip.role-admin { background: #d93025; }
.role-chip.role-manager { background: #1a73e8; }
.role-chip.role-cashier { background: #0d904f; }
.role-chip.role-technician { background: #f9ab00; color: #333; }

/* Switch User Buttons */
.switch-user-btn {
  padding: 6px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: white;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
}
.switch-user-btn:hover { border-color: var(--primary); }
.switch-user-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* Utility */
.hidden { display: none !important; }
.loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

/* Print Styles */
@media print {
  body * { visibility: hidden; }
  .receipt, .receipt * { visibility: visible; }
  .receipt {
    position: absolute;
    top: 0;
    right: 0;
    width: 80mm;
    border: none;
    padding: 5mm;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .pos-main { flex-direction: column; }
  .cart-section { width: 100%; height: 50vh; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}
