/* ============================================================
   main.css — Smart Mobile Shop Management System
   ============================================================ */

:root {
  --primary: #4F46E5;
  --primary-dark: #3730A3;
  --primary-light: #EEF2FF;
  --secondary: #10B981;
  --secondary-light: #D1FAE5;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --info: #3B82F6;
  --info-light: #DBEAFE;
  --dark: #1E293B;
  --gray-900: #0F172A;
  --gray-800: #1E293B;
  --gray-700: #334155;
  --gray-600: #475569;
  --gray-500: #64748B;
  --gray-400: #94A3B8;
  --gray-300: #CBD5E1;
  --gray-200: #E2E8F0;
  --gray-100: #F1F5F9;
  --gray-50: #F8FAFC;
  --white: #FFFFFF;
  --sidebar-w: 260px;
  --sidebar-collapsed: 72px;
  --header-h: 64px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .06);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, .07), 0 2px 4px -1px rgba(0, 0, 0, .06);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, .08), 0 4px 6px -2px rgba(0, 0, 0, .05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, .08), 0 10px 10px -5px rgba(0, 0, 0, .04);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --transition: all 0.2s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ==================== LOGIN PAGE ==================== */
.login-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-wrapper {
  width: 100%;
  max-width: 420px;
}

.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: 36px;
}

.logo-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 28px;
  color: var(--white);
  box-shadow: 0 8px 24px rgba(79, 70, 229, .35);
}

.login-logo h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-900);
}

.login-logo p {
  font-size: 14px;
  color: var(--gray-500);
  margin-top: 4px;
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 12px;
  color: var(--gray-400);
}

/* ==================== FORM ELEMENTS ==================== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.form-group label i {
  margin-right: 6px;
  color: var(--primary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--gray-800);
  background: var(--white);
  transition: var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .1);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 44px;
}

.toggle-pass {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  padding: 0;
}

.error-msg {
  background: var(--danger-light);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
}

/* ==================== BUTTONS ==================== */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(79, 70, 229, .4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--white);
  color: var(--primary);
  border: 1.5px solid var(--primary);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-secondary:hover {
  background: var(--primary-light);
}

.btn-success {
  background: linear-gradient(135deg, var(--secondary), #059669);
  color: var(--white);
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(16, 185, 129, .3);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #DC2626);
  color: var(--white);
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-danger:hover {
  transform: translateY(-1px);
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning), #D97706);
  color: var(--white);
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.btn-sm {
  padding: 7px 12px !important;
  font-size: 12px !important;
}

/* ==================== LAYOUT ==================== */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: linear-gradient(180deg, #1a1d2e 0%, #16192a 100%);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  transition: width 0.3s ease;
  overflow: hidden;
  box-shadow: 4px 0 20px rgba(0, 0, 0, .15);
}

/* .sidebar.collapsed removed - no desktop collapse */

.sidebar-header {
  padding: 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  min-height: var(--header-h);
  transition: padding 0.3s ease;
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  min-width: 40px;
  background: linear-gradient(135deg, var(--primary), #7C3AED);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--white);
  transition: all 0.2s ease;
}

.sidebar-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.2s ease;
}

.sidebar-toggle {
  display: none !important;
  /* Always hidden on desktop */
  margin-left: auto;
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: var(--transition);
  min-width: 30px;
  align-items: center;
  justify-content: center;
}

#mobileToggle {
  display: none !important;
  /* Always hidden on desktop */
}


.sidebar-toggle:hover {
  background: rgba(255, 255, 255, .1);
  color: var(--white);
}

.sidebar-user {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F59E0B, #EF4444);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--white);
}

.user-info {
  overflow: hidden;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--gray-400);
  text-transform: capitalize;
}

/* .sidebar.collapsed .user-info removed */

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .1);
  border-radius: 2px;
}

.nav-section-label {
  padding: 8px 20px 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, .3);
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.2s;
}

/* .sidebar.collapsed .nav-section-label removed */

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  cursor: pointer;
  color: rgba(255, 255, 255, .65);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
  margin: 2px 8px;
  border-radius: 10px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, .08);
  color: var(--white);
}

.nav-item.active {
  background: linear-gradient(135deg, var(--primary), #7C3AED);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(79, 70, 229, .4);
}

.nav-item i {
  font-size: 16px;
  min-width: 20px;
  text-align: center;
}

.nav-item span {
  transition: opacity 0.2s;
}

/* .sidebar.collapsed .nav-item span removed */

/* .sidebar.collapsed .nav-item removed */

.nav-tooltip {
  position: absolute;
  left: calc(100% + 12px);
  background: var(--gray-900);
  color: var(--white);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 9999;
}

.sidebar.collapsed .nav-item:hover .nav-tooltip {
  opacity: 1;
}

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-footer .nav-item {
  color: rgba(255, 255, 255, .5);
}

.sidebar-footer .nav-item:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, .1);
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
  margin-left: var(--sidebar-w) !important;
  /* Force expanded margin on desktop */
  flex: 1;
  min-width: 0;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* .main-content.expanded removed */

.top-bar {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

#mobileToggle {
  display: none;
}

.page-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
}

.breadcrumb {
  font-size: 12px;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 6px;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-bar-date {
  font-size: 13px;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}

.content-area {
  padding: 28px;
  flex: 1;
  width: 100%;
}

/* ==================== CARDS ==================== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-100);
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-100);
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
}

.card-subtitle {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 2px;
}

/* Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-100);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  transform: translate(20px, -20px);
  opacity: 0.12;
}

.stat-card.blue::before {
  background: var(--primary);
}

.stat-card.green::before {
  background: var(--secondary);
}

.stat-card.yellow::before {
  background: var(--warning);
}

.stat-card.red::before {
  background: var(--danger);
}

.stat-card.purple::before {
  background: #8B5CF6;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
}

.stat-card.blue .stat-icon {
  background: var(--primary-light);
  color: var(--primary);
}

.stat-card.green .stat-icon {
  background: var(--secondary-light);
  color: var(--secondary);
}

.stat-card.yellow .stat-icon {
  background: var(--warning-light);
  color: var(--warning);
}

.stat-card.red .stat-icon {
  background: var(--danger-light);
  color: var(--danger);
}

.stat-card.purple .stat-icon {
  background: #F3F0FF;
  color: #8B5CF6;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--gray-900);
  margin: 6px 0;
}

.stat-sub {
  font-size: 12px;
  color: var(--gray-400);
}

/* ==================== TABLE ==================== */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: var(--gray-50);
}

th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
}

td {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--gray-700);
}

tr:not(:last-child) td {
  border-bottom: 1px solid var(--gray-100);
}

tr:hover td {
  background: var(--gray-50);
}

/* ==================== BADGE ==================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-success {
  background: var(--secondary-light);
  color: #065F46;
}

.badge-danger {
  background: var(--danger-light);
  color: #991B1B;
}

.badge-warning {
  background: var(--warning-light);
  color: #92400E;
}

.badge-info {
  background: var(--info-light);
  color: #1E40AF;
}

.badge-purple {
  background: #F3F0FF;
  color: #5B21B6;
}

.badge-gray {
  background: var(--gray-100);
  color: var(--gray-600);
}

/* ==================== SEARCH / FILTER BAR ==================== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 14px;
}

.search-box input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}

.search-box input:focus {
  border-color: var(--primary);
}

.filter-select {
  padding: 9px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--white);
  color: var(--gray-700);
  outline: none;
  min-width: 150px;
  cursor: pointer;
}

/* ==================== PAGINATION ==================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 0;
  flex-wrap: wrap;
  gap: 12px;
}

.page-info {
  font-size: 13px;
  color: var(--gray-500);
}

.page-btns {
  display: flex;
  gap: 6px;
}

.page-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.page-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* ==================== MODAL ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  backdrop-filter: blur(3px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(.95);
  transition: transform 0.2s;
}

.modal-overlay.open .modal {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
}

.modal-close {
  width: 32px;
  height: 32px;
  background: var(--gray-100);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--gray-500);
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--danger-light);
  color: var(--danger);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ==================== FORM GRID ==================== */
.form-row {
  display: grid;
  gap: 16px;
  margin-bottom: 0;
}

.form-row.cols-2 {
  grid-template-columns: 1fr 1fr;
}

.form-row.cols-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.form-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin: 24px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==================== TOAST ==================== */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--gray-900);
  color: var(--white);
  border-radius: var(--radius);
  min-width: 280px;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  animation: slideIn .3s ease;
  border-left: 4px solid var(--secondary);
}

.toast.error {
  border-left-color: var(--danger);
}

.toast.warning {
  border-left-color: var(--warning);
}

.toast-icon {
  font-size: 18px;
}

.toast-msg {
  font-size: 13px;
  font-weight: 500;
}

@keyframes slideIn {
  from {
    transform: translateX(120%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ==================== LOADING ==================== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, .8);
  backdrop-filter: blur(4px);
  z-index: 5000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==================== QR SECTION ==================== */
.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: var(--gray-50);
  border-radius: var(--radius);
  border: 2px dashed var(--gray-200);
}

.qr-box canvas {
  border-radius: 8px;
}

.qr-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
}

.qr-upi {
  font-size: 11px;
  color: var(--gray-400);
}

/* ==================== PAYMENT SPLIT ==================== */
.payment-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.pay-method-btn {
  padding: 8px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pay-method-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pay-method-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.payment-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.payment-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
}

.payment-row-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.payment-row-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  min-width: 80px;
}

.payment-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  outline: none;
}

.payment-row input:focus {
  border-color: var(--primary);
}

.payment-total-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  margin-top: 8px;
}

.payment-total-bar span {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-dark);
}

.payment-remaining {
  color: var(--danger) !important;
  font-weight: 700 !important;
}

/* ==================== EXCHANGE CARD ==================== */
.exchange-section {
  background: var(--warning-light);
  border: 2px solid var(--warning);
  border-radius: var(--radius);
  padding: 20px;
  margin: 16px 0;
}

.exchange-section h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==================== MOBILE OVERLAY ==================== */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 999;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
  :root {
    --sidebar-w: 240px;
  }
}

@media (max-width: 768px) {
  #mobileToggle {
    display: flex !important;
  }

  .sidebar-toggle {
    display: flex !important;
  }

  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-w) !important;
    transition: transform .3s ease;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: block;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
  }

  .sidebar-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  .main-content {
    margin-left: 0 !important;
    min-width: 100%;
    width: 100%;
  }

  .content-area {
    padding: 12px;
  }

  .card {
    padding: 12px;
  }

  .top-bar {
    padding: 0 12px;
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }

  .form-row.cols-2,
  .form-row.cols-3 {
    grid-template-columns: 1fr;
  }

  .top-bar-date,
  .breadcrumb {
    display: none;
  }

  .modal {
    max-width: 100%;
    margin: 10px;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .search-box,
  .filter-select,
  .toolbar .btn-primary,
  .toolbar .btn-secondary {
    width: 100%;
  }

  input.filter-select {
    height: 40px;
  }

  /* Table column hiding - Much more aggressive to prevent pinching */
  /* View Stock Page */
  .stock-page th:nth-child(1),
  .stock-page td:nth-child(1),
  /* # */
  .stock-page th:nth-child(4),
  .stock-page td:nth-child(4),
  /* IMEI */
  .stock-page th:nth-child(5),
  .stock-page td:nth-child(5),
  /* RAM */
  .stock-page th:nth-child(6),
  .stock-page td:nth-child(6),
  /* Storage */
  .stock-page th:nth-child(7),
  .stock-page td:nth-child(7),
  /* Color */
  .stock-page th:nth-child(8),
  .stock-page td:nth-child(8),
  /* Purchase */
  .stock-page th:nth-child(10),
  .stock-page td:nth-child(10)

  /* Supplier */
    {
    display: none;
  }

  /* Sales History Page */
  .history-page th:nth-child(1),
  .history-page td:nth-child(1),
  /* Bill # */
  .history-page th:nth-child(2),
  .history-page td:nth-child(2),
  /* Date */
  .history-page th:nth-child(5),
  .history-page td:nth-child(5),
  /* IMEI */
  .history-page th:nth-child(7),
  .history-page td:nth-child(7),
  /* Cash */
  .history-page th:nth-child(8),
  .history-page td:nth-child(8),
  /* UPI */
  .history-page th:nth-child(9),
  .history-page td:nth-child(9),
  /* Card */
  .history-page th:nth-child(10),
  .history-page td:nth-child(10),
  /* Exchange */
  .history-page th:nth-child(11),
  .history-page td:nth-child(11)

  /* Staff */
    {
    display: none;
  }

  /* Staff Management Page */
  .staff-page th:nth-child(1),
  .staff-page td:nth-child(1),
  /* # */
  .staff-page th:nth-child(3),
  .staff-page td:nth-child(3)

  /* Email */
    {
    display: none;
  }

  /* Compact table padding on mobile */
  td,
  th {
    padding: 8px 6px;
    font-size: 11px;
    word-break: break-word;
  }

  .table-wrap {
    margin: 0 -12px;
    border-radius: 0;
  }

  /* Let table touch edges if needed */
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-value {
    font-size: 20px;
  }

  .top-bar-left .page-title {
    font-size: 15px;
  }

  .top-bar-right .btn-primary span,
  .top-bar-right .btn-secondary span {
    display: none;
  }

  .top-bar-right i {
    margin-right: 0 !important;
  }
}

/* Center cards on larger screens like Add Phone page */
.stock-page .card,
.history-page .card,
.staff-page .card {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}