/* Payment mode toggle */
.payment-mode-toggle {
  display: flex;
  margin: 10px 0;
  border: 1px solid #ddd;
  border-radius: 5px;
  overflow: hidden;
}

.payment-mode-toggle button {
  flex: 1;
  padding: 10px;
  border: none;
  background: #f5f5f5;
  cursor: pointer;
}

.payment-mode-toggle button.active {
  background: #04a8c5;
  color: white;
}

/* Khata info box */
.khata-info-box {
  background: #f9f9f9;
  padding: 15px;
  border-radius: 5px;
  margin: 10px 0;
  text-align: center;
}

.khata-info-box p {
  margin: 0 0 10px 0;
  color: #555;
}

.khata-manage-btn {
  background: #04a8c5;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
}

/* Khata popup styles */
.khata-popup-content {
  padding: 20px;
}

.khata-summary {
  background: #f5f5f5;
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 20px;
}

.khata-summary h3 {
  margin-top: 0;
}

.khata-payment-section {
  margin-bottom: 20px;
}

.payment-input {
  display: flex;
  gap: 10px;
}

.payment-input input {
  flex: 1;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.payment-input button {
  background: #04a8c5;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
}

.khata-records table {
  width: 100%;
  border-collapse: collapse;
}

.khata-records th, 
.khata-records td {
  padding: 8px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.khata-records th {
  background: #f5f5f5;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .pos_progley_page {
    flex-direction: column;
  }
  
  .pos_left, .pos_rigt {
    width: 100% !important;
  }
  
  .khata-popup-content {
    padding: 10px;
  }
  
  .payment-input {
    flex-direction: column;
  }
}


/* Khata System - Scoped Styles */


.khata_system.active {
  opacity: 1;
  visibility: visible;
  display: flex;
}

.khata_system .popup {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.khata_system.active .popup {
  transform: translateY(0);
}

/* Header */
.khata_system .popup-header {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: white;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.khata_system .heading_is {
  font-size: 1.5rem;
  font-weight: 600;
  color: white;
  margin: 0;
}

.khata_system .close-popup-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 8px;
  transition: transform 0.2s;
}

.khata_system .close-popup-btn:hover {
  transform: scale(1.2);
}

/* Content */
.khata_system .khata-popup-content {
  padding: 24px;
  overflow-y: auto;
  flex-grow: 1;
}

/* Summary */
.khata_system .khata-summary {
  background: #f9fafb;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
  border: 1px solid #e5e7eb;
}

.khata_system .khata-summary h3 {
  margin-top: 0;
  color: #111827;
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.khata_system .khata-summary p {
  font-size: 1.4rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

/* Payment Section */
.khata_system .khata-payment-section {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid #e5e7eb;
}

.khata_system .khata-payment-section h4 {
  margin-top: 0;
  color: #111827;
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.khata_system .payment-input-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.khata_system .input-field {
  margin-bottom: 12px;
}

.khata_system .input-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 1.1rem;
  color: #4b5563;
}

.khata_system .input-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1rem;
  transition: all 0.2s;
}

.khata_system .input-field input:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
  outline: none;
}

.khata_system .btn-primary {
  grid-column: span 2;
  padding: 12px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.khata_system .btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.khata_system .btn-primary:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
}

/* Records */
.khata_system .khata-records {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.khata_system .khata-records h4 {
  margin-top: 0;
  color: #111827;
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.khata_system .records-table-container {
  overflow-x: auto;
}

.khata_system .records-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

.khata_system .records-table th {
  background: #f9fafb;
  color: #4b5563;
  font-weight: 500;
  padding: 12px 16px;
  text-align: left;
}

.khata_system .records-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
  color: #4b5563;
}

.khata_system .records-table tr:last-child td {
  border-bottom: none;
}

.khata_system .record-type {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.khata_system .record-type.credit {
  background-color: #fee2e2;
  color: #dc2626;
}

.khata_system .record-type.payment {
  background-color: #dcfce7;
  color: #16a34a;
}

.khata_system .text-danger {
  color: #dc2626;
}

.khata_system .text-success {
  color: #16a34a;
}

.khata_system .text-center {
  text-align: center;
}

/* Footer */
.khata_system .btn_container {
  padding: 16px 24px;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
}

.khata_system .btn {
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.khata_system .btn-default {
  background: white;
  border: 1px solid #d1d5db;
  color: #4b5563;
}

.khata_system .btn-default:hover {
  background: #f3f4f6;
}

/* Animations */
@keyframes khataFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.khata_system .records-table tbody tr {
  animation: khataFadeIn 0.3s ease forwards;
}

/* Responsive */
@media (max-width: 768px) {
  .khata_system .payment-input-group {
    grid-template-columns: 1fr;
  }
  
  .khata_system .btn-primary {
    grid-column: span 1;
  }
}