/* ============================================================
   GHULAM TRADERS WHOLESALE ERP — COMPONENT STYLES & POS BILLING COUNTER (LIGHT THEME)
   ============================================================ */

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 2px 8px var(--primary-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
}

.btn-success {
  background: linear-gradient(135deg, var(--success), var(--success-dark));
  color: white;
  box-shadow: 0 2px 8px rgba(16,185,129,0.25);
}
.btn-success:hover { transform: translateY(-1px); }

.btn-danger {
  background: linear-gradient(135deg, var(--danger), var(--danger-dark));
  color: white;
  box-shadow: 0 2px 8px rgba(239,68,68,0.25);
}
.btn-danger:hover { transform: translateY(-1px); }

.btn-warning {
  background: linear-gradient(135deg, var(--warning), var(--accent-dark));
  color: white;
}
.btn-warning:hover { transform: translateY(-1px); }

.btn-outline {
  background: #ffffff;
  border: 1px solid var(--bg-border);
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f8fafc;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { background: #f1f5f9; color: var(--text-primary); }

.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn-lg { padding: 10px 20px; font-size: 13px; }
.btn-icon { padding: 6px; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: #ffffff;
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card:hover { border-color: #cbd5e1; box-shadow: var(--shadow-md); }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.card-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.stat-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.stat-icon.purple { background: #eef2ff; color: var(--primary); }
.stat-icon.green { background: #ecfdf5; color: var(--success); }
.stat-icon.amber { background: #fffbeb; color: var(--warning); }
.stat-icon.red { background: #fef2f2; color: var(--danger); }
.stat-icon.blue { background: #eff6ff; color: var(--info); }

.stat-body { flex: 1; }
.stat-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  margin: 2px 0;
}
.stat-change {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group {
  margin-bottom: 10px;
}

.form-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  outline: none;
  box-shadow: inset 0 1px 2px rgba(15,23,42,0.04);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.search-result-item {
  transition: background 0.15s ease, border-color 0.15s ease;
}

.search-result-item.selected-search-item,
.search-result-item:hover {
  background: rgba(79, 70, 229, 0.12) !important;
  border-left: 4px solid var(--primary) !important;
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.form-hint {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ============================================================
   TABLE
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--bg-border);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

thead th {
  background: #f8fafc;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 12px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--bg-border);
}

tbody tr {
  border-bottom: 1px solid var(--bg-border);
  transition: var(--transition-fast);
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }

tbody td {
  padding: 7px 12px;
  color: var(--text-primary);
  vertical-align: middle;
}

.table-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
}

.badge-success { background: #d1fae5; color: #047857; border: 1px solid #a7f3d0; }
.badge-danger { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.badge-warning { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.badge-info { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-primary { background: #e0e7ff; color: #4338ca; border: 1px solid #c7d2fe; }
.badge-muted { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title { font-size: 22px; font-weight: 800; color: var(--text-primary); }
.page-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.page-actions { display: flex; gap: 10px; align-items: center; }

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex;
  gap: 4px;
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 20px;
  border: 1px solid var(--bg-border);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.tab-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
}

.tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
  font-weight: 600;
}

.tab-btn:hover:not(.active) { color: var(--text-primary); background: #f1f5f9; }

/* ============================================================
   SEARCH + FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  flex: 1;
  min-width: 200px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-box i { color: var(--text-muted); font-size: 13px; }
.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13px;
  width: 100%;
  font-family: 'Inter', sans-serif;
}
.search-box input::placeholder { color: var(--text-muted); }

/* ============================================================
   FULL-SCREEN POS BILLING TERMINAL STYLES (LIGHT THEME)
   ============================================================ */
.pos-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: calc(100vh - 85px);
}

.pos-topbar {
  background: transparent;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: none;
}

.pos-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pos-terminal-badge {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px var(--primary-glow);
}

/* CIRCULAR POS ACTION BUTTONS (HORIZONTAL TOP CORNER ALIGNMENT) */
.pos-circle-btn-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: nowrap;
}

.pos-circle-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  min-width: 70px;
  border-radius: 50%;
  border: 2px solid var(--bg-border);
  background: #ffffff;
  color: var(--text-primary);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  padding: 4px;
  text-decoration: none;
  white-space: nowrap;
}

.pos-circle-btn i {
  font-size: 17px;
  margin-bottom: 2px;
  transition: transform 0.2s ease;
}

.pos-circle-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.pos-circle-btn:active {
  transform: translateY(0) scale(0.98);
}

.pos-circle-badge {
  position: absolute;
  top: -4px;
  right: -2px;
  background: #3b82f6;
  color: #ffffff;
  font-size: 9px;
  font-family: monospace;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.pos-circle-count-badge {
  position: absolute;
  top: -4px;
  left: -2px;
  background: #ef4444;
  color: #ffffff;
  font-size: 9px;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 10px;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(239,68,68,0.4);
}

/* Specific theme variants for POS circle buttons */
.pos-circle-btn.btn-post {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border-color: #059669;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}

.pos-circle-btn.btn-post:hover {
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.5);
}

.pos-circle-btn.btn-record {
  border-color: #6366f1;
  color: #4f46e5;
}
.pos-circle-btn.btn-record:hover {
  background: #f5f3ff;
}

.pos-circle-btn.btn-clear {
  border-color: #f87171;
  color: #ef4444;
}
.pos-circle-btn.btn-clear:hover {
  background: #fef2f2;
}

.pos-circle-btn.btn-hold {
  border-color: #f59e0b;
  color: #d97706;
}
.pos-circle-btn.btn-hold:hover {
  background: #fffbeb;
}

.pos-circle-btn.btn-search {
  border-color: #8b5cf6;
  color: #7c3aed;
}
.pos-circle-btn.btn-search:hover {
  background: #faf5ff;
}

.pos-circle-btn.btn-unhold {
  border-color: #06b6d4;
  color: #0891b2;
}
.pos-circle-btn.btn-unhold:hover {
  background: #ecfeff;
}

/* Till Control Circular Buttons */
.pos-circle-btn.btn-till-open {
  border-color: #10b981;
  color: #059669;
}
.pos-circle-btn.btn-till-open:hover {
  background: #ecfdf5;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.25);
}

.pos-circle-btn.btn-cash-in {
  border-color: #06b6d4;
  color: #0891b2;
}
.pos-circle-btn.btn-cash-in:hover {
  background: #ecfeff;
  box-shadow: 0 6px 16px rgba(6, 182, 212, 0.25);
}

.pos-circle-btn.btn-cash-out {
  border-color: #f59e0b;
  color: #d97706;
}
.pos-circle-btn.btn-cash-out:hover {
  background: #fffbeb;
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.25);
}

.pos-circle-btn.btn-till-close {
  border-color: #ef4444;
  color: #dc2626;
}
.pos-circle-btn.btn-till-close:hover {
  background: #fef2f2;
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.25);
}

.pos-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  flex: 1;
  min-height: 0;
}

.pos-side-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 14px 10px;
  background: #ffffff;
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.pos-items-card {
  background: #ffffff;
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  flex: 1;
  min-height: 0;
}

.pos-table-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.pos-qty-input {
  width: 70px;
  text-align: center;
  font-weight: 700;
}

.pos-billing-panel {
  background: #ffffff;
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.pos-grand-total-box {
  background: linear-gradient(135deg, #eef2ff, #f0fdf4);
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
  margin: 14px 0;
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.1);
}

.pos-grand-total-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

.pos-grand-total-value {
  font-size: 34px;
  font-weight: 900;
  color: var(--primary);
  line-height: 1.2;
  margin-top: 2px;
}

/* ============================================================
   EMPTY STATE & OTHERS
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}
.empty-state i { font-size: 48px; margin-bottom: 16px; display: block; color: var(--text-muted); }
.empty-state h3 { font-size: 16px; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 13px; }

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.chart-card {
  background: #ffffff;
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.chart-card canvas { max-height: 260px; }

/* ============================================================
   CLOUD UPLOAD BLOCKING OVERLAY
   ============================================================ */
.cloud-upload-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cloud-upload-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  border: 1px solid var(--bg-border);
}

.cloud-upload-icon-spinner {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 20px auto;
  transition: all 0.3s ease;
}

.cloud-upload-icon-success {
  background: rgba(16, 185, 129, 0.1) !important;
  color: var(--success) !important;
}

.cloud-upload-icon-warning {
  background: rgba(245, 158, 11, 0.1) !important;
  color: var(--warning) !important;
}

.cloud-progress-bar {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 18px;
}

.cloud-progress-fill {
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  border-radius: 4px;
  transition: width 0.4s ease, background 0.4s ease;
}

